diff --git a/.changeset/good-masks-float.md b/.changeset/good-masks-float.md new file mode 100644 index 0000000..4e380d2 --- /dev/null +++ b/.changeset/good-masks-float.md @@ -0,0 +1,5 @@ +--- +"arc-vite": minor +--- + +Move away from top level await which has limited browser support. diff --git a/package-lock.json b/package-lock.json index 2ae6a79..cd1228d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,35 +10,33 @@ "license": "MIT", "dependencies": { "arc-resolver": "^3.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", "htmlparser2": "^9.0.0" }, "devDependencies": { - "@changesets/changelog-github": "^0.4.8", - "@changesets/cli": "^2.26.2", - "@marko/compiler": "^5.33.8", - "@marko/vite": "^4.0.2", - "@playwright/test": "^1.39.0", + "@changesets/changelog-github": "^0.5.0", + "@changesets/cli": "^2.27.1", + "@marko/compiler": "^5.34.1", + "@marko/vite": "^4.1.1", + "@playwright/test": "^1.40.1", "@types/estree": "^1.0.5", - "@types/node": "^20.9.0", + "@types/node": "^20.10.1", "@types/serve-handler": "^6.1.4", - "@typescript-eslint/eslint-plugin": "^6.11.0", - "@typescript-eslint/parser": "^6.11.0", + "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/parser": "^6.13.1", "c8": "^8.0.1", - "eslint": "^8.53.0", + "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.0", "husky": "^8.0.3", "lint-staged": "^15.1.0", - "marko": "^5.31.18", - "playwright": "^1.39.0", + "marko": "^5.32.0", + "playwright": "^1.40.1", "prettier": "^3.1.0", "serve-handler": "^6.1.5", "sort-package-json": "^2.6.0", - "tsx": "^4.1.2", - "typescript": "^5.2.2", + "tsx": "^4.6.1", + "typescript": "^5.3.2", "vite": "^4.5.0" }, "peerDependencies": { @@ -69,12 +67,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -82,30 +80,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.3.tgz", - "integrity": "sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", + "integrity": "sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz", - "integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.5.tgz", + "integrity": "sha512-Cwc2XjUrG4ilcfOw4wBAK+enbdgwAcAJCfGUItPBKR7Mjw4aEfAFYrLxeRp4jWgtNIKn3n2AlBOfwwafl+42/g==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-module-transforms": "^7.23.3", - "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.3", + "@babel/helpers": "^7.23.5", + "@babel/parser": "^7.23.5", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -130,12 +128,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.3.tgz", - "integrity": "sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", + "integrity": "sha512-BPssCHrBD+0YrxviOa3QzpqwhNIXKEtOa2jQrm4FlmkC2apYgRnQcmPWiGZDlGxiNtltnUFolMe8497Esry+jA==", "dev": true, "dependencies": { - "@babel/types": "^7.23.3", + "@babel/types": "^7.23.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -194,17 +192,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.15.tgz", - "integrity": "sha512-jKkwA59IXcvSaiK2UN45kKwSC9o+KuoXsBDvHvU/7BecYIp8GQ2UwrVvFgJASUT+hBnwJx6MhvMCuMzwZZ7jlg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.5.tgz", + "integrity": "sha512-QELlRWxSpgdwdJzSJn4WAhKC+hvw/AtHbbrIoncKHkhKKR/luAlKkgBDcri1EzWAo8f8VvYVryEHN4tax/V67A==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", - "@babel/helper-member-expression-to-functions": "^7.22.15", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-member-expression-to-functions": "^7.23.0", "@babel/helper-optimise-call-expression": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-replace-supers": "^7.22.20", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", "semver": "^6.3.1" @@ -377,9 +375,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -395,32 +393,32 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", - "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", - "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.5.tgz", + "integrity": "sha512-oO7us8FzTEsG3U6ag9MfdF1iA/7Z6dz+MtFhifZk8C8o453rGJFFWUP1t+ULM9TUIAzC9uxXEiXjOiVMyd7QPg==", "dev": true, "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0" + "@babel/traverse": "^7.23.5", + "@babel/types": "^7.23.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", @@ -432,9 +430,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.3.tgz", - "integrity": "sha512-uVsWNvlVsIninV2prNz/3lHCb+5CJ+e+IUBfbjToAHODtfGYLfCFuY4AU7TskI+dAKk+njsPiBjq1gKTvZOBaw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", + "integrity": "sha512-hOOqoiNXrmGdFbhgCzu6GiURxUgM27Xwd/aPuu8RfHEZPBzL1Z54okAHAQjXfcQNwvrlkAmAp4SlRTZ45vlthQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -476,13 +474,13 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.3.tgz", - "integrity": "sha512-ogV0yWnq38CFwH20l2Afz0dfKuZBx9o/Y2Rmh5vuSS0YD1hswgEgTfyTzuSrT2q9btmHRSqYoSfwFUVaC1M1Jw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.23.5.tgz", + "integrity": "sha512-2fMkXEJkrmwgu2Bsv1Saxgj30IXZdJ+84lQcKKI7sm719oXs0BBw2ZENKdJdR1PjWndgLCEBNXJOri0fk7RYQA==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.22.15", + "@babel/helper-create-class-features-plugin": "^7.23.5", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-typescript": "^7.23.3" }, @@ -494,9 +492,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.2.tgz", - "integrity": "sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz", + "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -520,19 +518,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.3.tgz", - "integrity": "sha512-+K0yF1/9yR0oHdE0StHuEj3uTPzwwbrLGfNOndVJVV2TqA5+j3oljJUb4nmB954FLGjNem976+B+eDuLIjesiQ==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.5.tgz", + "integrity": "sha512-czx7Xy5a6sapWWRx61m1Ke1Ra4vczu1mCTtJam5zRTBOonfdJ+S/B6HYmGYu3fJtr8GGET3si6IhgWVBhJ/m8w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.3", + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.5", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.3", - "@babel/types": "^7.23.3", + "@babel/parser": "^7.23.5", + "@babel/types": "^7.23.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -541,12 +539,12 @@ } }, "node_modules/@babel/types": { - "version": "7.23.3", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz", - "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.5.tgz", + "integrity": "sha512-ON5kSOJwVO6xXVRTvOI0eOnWe7VdUcIpsovGo9U/Br4Ie4UVFQTboO2cYnDhAGU6Fp+UxSiT+pMft0SMHfuq6w==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -561,16 +559,16 @@ "dev": true }, "node_modules/@changesets/apply-release-plan": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", - "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-7.0.0.tgz", + "integrity": "sha512-vfi69JR416qC9hWmFGSxj7N6wA5J222XNBmezSVATPWDVPIF7gkd4d8CpbEbXmRWbVrkoli3oerGS6dcL/BGsQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.1", - "@changesets/get-version-range-type": "^0.3.2", - "@changesets/git": "^2.0.0", - "@changesets/types": "^5.2.1", + "@changesets/config": "^3.0.0", + "@changesets/get-version-range-type": "^0.4.0", + "@changesets/git": "^3.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "detect-indent": "^6.0.0", "fs-extra": "^7.0.1", @@ -597,69 +595,68 @@ } }, "node_modules/@changesets/assemble-release-plan": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", - "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-6.0.0.tgz", + "integrity": "sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "semver": "^7.5.3" } }, "node_modules/@changesets/changelog-git": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.1.14.tgz", - "integrity": "sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-git/-/changelog-git-0.2.0.tgz", + "integrity": "sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1" + "@changesets/types": "^6.0.0" } }, "node_modules/@changesets/changelog-github": { - "version": "0.4.8", - "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.4.8.tgz", - "integrity": "sha512-jR1DHibkMAb5v/8ym77E4AMNWZKB5NPzw5a5Wtqm1JepAuIF+hrKp2u04NKM14oBZhHglkCfrla9uq8ORnK/dw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@changesets/changelog-github/-/changelog-github-0.5.0.tgz", + "integrity": "sha512-zoeq2LJJVcPJcIotHRJEEA2qCqX0AQIeFE+L21L8sRLPVqDhSXY8ZWAt2sohtBpFZkBwu+LUwMSKRr2lMy3LJA==", "dev": true, "dependencies": { - "@changesets/get-github-info": "^0.5.2", - "@changesets/types": "^5.2.1", + "@changesets/get-github-info": "^0.6.0", + "@changesets/types": "^6.0.0", "dotenv": "^8.1.0" } }, "node_modules/@changesets/cli": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", - "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.27.1.tgz", + "integrity": "sha512-iJ91xlvRnnrJnELTp4eJJEOPjgpF3NOh4qeQehM6Ugiz9gJPRZ2t+TsXun6E3AMN4hScZKjqVXl0TX+C7AB3ZQ==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.4", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.1", - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/get-release-plan": "^3.0.17", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", - "@changesets/write": "^0.2.3", + "@changesets/apply-release-plan": "^7.0.0", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/changelog-git": "^0.2.0", + "@changesets/config": "^3.0.0", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/get-release-plan": "^4.0.0", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", + "@changesets/write": "^0.3.0", "@manypkg/get-packages": "^1.1.3", - "@types/is-ci": "^3.0.0", "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", "chalk": "^2.1.0", + "ci-info": "^3.7.0", "enquirer": "^2.3.0", "external-editor": "^3.1.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", - "is-ci": "^3.0.1", "meow": "^6.0.0", "outdent": "^0.5.0", "p-limit": "^2.2.0", @@ -675,36 +672,36 @@ } }, "node_modules/@changesets/config": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", - "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-3.0.0.tgz", + "integrity": "sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==", "dev": true, "dependencies": { - "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.6", - "@changesets/logger": "^0.0.5", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/get-dependents-graph": "^2.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1", "micromatch": "^4.0.2" } }, "node_modules/@changesets/errors": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.1.4.tgz", - "integrity": "sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@changesets/errors/-/errors-0.2.0.tgz", + "integrity": "sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==", "dev": true, "dependencies": { "extendable-error": "^0.1.5" } }, "node_modules/@changesets/get-dependents-graph": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", - "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-2.0.0.tgz", + "integrity": "sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "chalk": "^2.1.0", "fs-extra": "^7.0.1", @@ -712,9 +709,9 @@ } }, "node_modules/@changesets/get-github-info": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.5.2.tgz", - "integrity": "sha512-JppheLu7S114aEs157fOZDjFqUDpm7eHdq5E8SSR0gUBTEK0cNSHsrSR5a66xs0z3RWuo46QvA3vawp8BxDHvg==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/get-github-info/-/get-github-info-0.6.0.tgz", + "integrity": "sha512-v/TSnFVXI8vzX9/w3DU2Ol+UlTZcu3m0kXTjTT4KlAdwSvwutcByYwyYn9hwerPWfPkT2JfpoX0KgvCEi8Q/SA==", "dev": true, "dependencies": { "dataloader": "^1.4.0", @@ -722,35 +719,35 @@ } }, "node_modules/@changesets/get-release-plan": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", - "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-4.0.0.tgz", + "integrity": "sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.4", - "@changesets/config": "^2.3.1", - "@changesets/pre": "^1.0.14", - "@changesets/read": "^0.5.9", - "@changesets/types": "^5.2.1", + "@changesets/assemble-release-plan": "^6.0.0", + "@changesets/config": "^3.0.0", + "@changesets/pre": "^2.0.0", + "@changesets/read": "^0.6.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3" } }, "node_modules/@changesets/get-version-range-type": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.3.2.tgz", - "integrity": "sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/get-version-range-type/-/get-version-range-type-0.4.0.tgz", + "integrity": "sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==", "dev": true }, "node_modules/@changesets/git": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@changesets/git/-/git-2.0.0.tgz", - "integrity": "sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@changesets/git/-/git-3.0.0.tgz", + "integrity": "sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "is-subdir": "^1.1.1", "micromatch": "^4.0.2", @@ -758,67 +755,67 @@ } }, "node_modules/@changesets/logger": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.0.5.tgz", - "integrity": "sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@changesets/logger/-/logger-0.1.0.tgz", + "integrity": "sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==", "dev": true, "dependencies": { "chalk": "^2.1.0" } }, "node_modules/@changesets/parse": { - "version": "0.3.16", - "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.3.16.tgz", - "integrity": "sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@changesets/parse/-/parse-0.4.0.tgz", + "integrity": "sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==", "dev": true, "dependencies": { - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "js-yaml": "^3.13.1" } }, "node_modules/@changesets/pre": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-1.0.14.tgz", - "integrity": "sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@changesets/pre/-/pre-2.0.0.tgz", + "integrity": "sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/errors": "^0.1.4", - "@changesets/types": "^5.2.1", + "@changesets/errors": "^0.2.0", + "@changesets/types": "^6.0.0", "@manypkg/get-packages": "^1.1.3", "fs-extra": "^7.0.1" } }, "node_modules/@changesets/read": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.5.9.tgz", - "integrity": "sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@changesets/read/-/read-0.6.0.tgz", + "integrity": "sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/git": "^2.0.0", - "@changesets/logger": "^0.0.5", - "@changesets/parse": "^0.3.16", - "@changesets/types": "^5.2.1", + "@changesets/git": "^3.0.0", + "@changesets/logger": "^0.1.0", + "@changesets/parse": "^0.4.0", + "@changesets/types": "^6.0.0", "chalk": "^2.1.0", "fs-extra": "^7.0.1", "p-filter": "^2.1.0" } }, "node_modules/@changesets/types": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@changesets/types/-/types-5.2.1.tgz", - "integrity": "sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@changesets/types/-/types-6.0.0.tgz", + "integrity": "sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==", "dev": true }, "node_modules/@changesets/write": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.2.3.tgz", - "integrity": "sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@changesets/write/-/write-0.3.0.tgz", + "integrity": "sha512-slGLb21fxZVUYbyea+94uFiD6ntQW0M2hIKNznFizDhZPDgn2c/fv1UzzlW43RVzh1BEDuIqW6hzlJ1OflNmcw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/types": "^5.2.1", + "@changesets/types": "^6.0.0", "fs-extra": "^7.0.1", "human-id": "^1.0.2", "prettier": "^2.7.1" @@ -1284,9 +1281,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", - "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", + "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1460,9 +1457,9 @@ } }, "node_modules/@marko/compiler": { - "version": "5.33.8", - "resolved": "https://registry.npmjs.org/@marko/compiler/-/compiler-5.33.8.tgz", - "integrity": "sha512-hPdPZDlJ83zlfb4J2iU++Jbrw0nS7EDcajn9jeo5iDjHeKc4UjIPrLsDNVqvIEbtEB2SMjCz6a7ZGU23WQWc2g==", + "version": "5.34.1", + "resolved": "https://registry.npmjs.org/@marko/compiler/-/compiler-5.34.1.tgz", + "integrity": "sha512-ANpVSaNg/T8Zgz0Cd/XH26JaCIELDHf2lxw99K8MWE7Oud/MIKmwYRM40BUUObcj1N/iPkQ8aUZXOX/zvyfDIg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.16.0", @@ -1521,9 +1518,9 @@ } }, "node_modules/@marko/vite": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@marko/vite/-/vite-4.0.2.tgz", - "integrity": "sha512-MDPVCldlxCn3odHe/o20LL62Ji3p4YCm2KA5aGFxujWfNzqMl+ccthPi5KK78rSkk/dtx041kawy71tpLsQdQg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@marko/vite/-/vite-4.1.1.tgz", + "integrity": "sha512-R9KDq6qiKmwl20a37OzeuNqSkjDD07A9T0Pxhf1vaAA+VYC6R/QB1ZhWekLlCurBToNEnqnO70xril3TzwAqgg==", "dev": true, "dependencies": { "anymatch": "^3.1.3", @@ -1574,12 +1571,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.39.0.tgz", - "integrity": "sha512-3u1iFqgzl7zr004bGPYiN/5EZpRUSFddQBra8Rqll5N0/vfpqlP9I9EXqAoGacuAbX6c9Ulg/Cjqglp5VkK6UQ==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", + "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", "dev": true, "dependencies": { - "playwright": "1.39.0" + "playwright": "1.40.1" }, "bin": { "playwright": "cli.js" @@ -1594,15 +1591,6 @@ "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, - "node_modules/@types/is-ci": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@types/is-ci/-/is-ci-3.0.4.tgz", - "integrity": "sha512-AkCYCmwlXeuH89DagDCzvCAyltI2v9lh3U3DqSg/GrBYoReAaWwxfXCqMx9UV5MajLZ4ZFwZzV4cABGIxk2XRw==", - "dev": true, - "dependencies": { - "ci-info": "^3.1.0" - } - }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -1628,9 +1616,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", - "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", + "version": "20.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.1.tgz", + "integrity": "sha512-T2qwhjWwGH81vUEx4EXmBKsTJRXFXNZTL4v0gi01+zyBmCwzE6TyHszqX01m+QHTEq+EZNo13NeJIdEqf+Myrg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1643,9 +1631,9 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz", - "integrity": "sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", + "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", "dev": true }, "node_modules/@types/serve-handler": { @@ -1658,16 +1646,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.11.0.tgz", - "integrity": "sha512-uXnpZDc4VRjY4iuypDBKzW1rz9T5YBBK0snMn8MaTSNd2kMlj50LnLBABELjJiOL5YHk7ZD8hbSpI9ubzqYI0w==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz", + "integrity": "sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.11.0", - "@typescript-eslint/type-utils": "6.11.0", - "@typescript-eslint/utils": "6.11.0", - "@typescript-eslint/visitor-keys": "6.11.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/type-utils": "6.13.1", + "@typescript-eslint/utils": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1693,15 +1681,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.11.0.tgz", - "integrity": "sha512-+whEdjk+d5do5nxfxx73oanLL9ghKO3EwM9kBCkUtWMRwWuPaFv9ScuqlYfQ6pAD6ZiJhky7TZ2ZYhrMsfMxVQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", + "integrity": "sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.11.0", - "@typescript-eslint/types": "6.11.0", - "@typescript-eslint/typescript-estree": "6.11.0", - "@typescript-eslint/visitor-keys": "6.11.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4" }, "engines": { @@ -1721,13 +1709,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.11.0.tgz", - "integrity": "sha512-0A8KoVvIURG4uhxAdjSaxy8RdRE//HztaZdG8KiHLP8WOXSk0vlF7Pvogv+vlJA5Rnjj/wDcFENvDaHb+gKd1A==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz", + "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.11.0", - "@typescript-eslint/visitor-keys": "6.11.0" + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1738,13 +1726,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.11.0.tgz", - "integrity": "sha512-nA4IOXwZtqBjIoYrJcYxLRO+F9ri+leVGoJcMW1uqr4r1Hq7vW5cyWrA43lFbpRvQ9XgNrnfLpIkO3i1emDBIA==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz", + "integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.11.0", - "@typescript-eslint/utils": "6.11.0", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/utils": "6.13.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1765,9 +1753,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.11.0.tgz", - "integrity": "sha512-ZbEzuD4DwEJxwPqhv3QULlRj8KYTAnNsXxmfuUXFCxZmO6CF2gM/y+ugBSAQhrqaJL3M+oe4owdWunaHM6beqA==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz", + "integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1778,13 +1766,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.11.0.tgz", - "integrity": "sha512-Aezzv1o2tWJwvZhedzvD5Yv7+Lpu1by/U1LZ5gLc4tCx8jUmuSCMioPFRjliN/6SJIvY6HpTtJIWubKuYYYesQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz", + "integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.11.0", - "@typescript-eslint/visitor-keys": "6.11.0", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1805,17 +1793,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.11.0.tgz", - "integrity": "sha512-p23ibf68fxoZy605dc0dQAEoUsoiNoP3MD9WQGiHLDuTSOuqoTsa4oAy+h3KDkTcxbbfOtUjb9h3Ta0gT4ug2g==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", + "integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.11.0", - "@typescript-eslint/types": "6.11.0", - "@typescript-eslint/typescript-estree": "6.11.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", "semver": "^7.5.4" }, "engines": { @@ -1830,12 +1818,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.11.0.tgz", - "integrity": "sha512-+SUN/W7WjBr05uRxPggJPSzyB8zUpaYo2hByKasWbqr3PM8AXfZt8UHdNpBS1v9SA62qnSSMF3380SwDqqprgQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", + "integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.11.0", + "@typescript-eslint/types": "6.13.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2404,9 +2392,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001562", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001562.tgz", - "integrity": "sha512-kfte3Hym//51EdX4239i+Rmp20EsLIYGdPkERegTgU19hQWCRhsRFGKHTliUlsry53tv17K7n077Kqa0WJU4ng==", + "version": "1.0.30001565", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001565.tgz", + "integrity": "sha512-xrE//a3O7TP0vaJ8ikzkD2c2NgcVUvsEe2IvFTntV4Yd1Z9FVzh+gW+enX96L0psrbaFMcVcH2l90xNuGDWc8w==", "dev": true, "funding": [ { @@ -2957,9 +2945,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.584", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.584.tgz", - "integrity": "sha512-rXCtDiXCBtfTfEegkthruCvyWZnr1/FCrUGY/nYQiF+lSZDmwQBDxp0rivZxV8trXb6cbgojhcSTW5xsDcHQ8g==", + "version": "1.4.597", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.597.tgz", + "integrity": "sha512-0XOQNqHhg2YgRVRUrS4M4vWjFCFIP2ETXcXe/0KIQBjXE9Cpy+tgzzYfuq6HGai3hWq0YywtG+5XK8fyG08EjA==", "dev": true }, "node_modules/emoji-regex": { @@ -3172,15 +3160,15 @@ } }, "node_modules/eslint": { - "version": "8.53.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", - "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", + "version": "8.54.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", + "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.53.0", + "@eslint/js": "8.54.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -4329,9 +4317,9 @@ } }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "dev": true, "engines": { "node": ">= 4" @@ -4470,18 +4458,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dev": true, - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -5128,12 +5104,12 @@ } }, "node_modules/marko": { - "version": "5.31.18", - "resolved": "https://registry.npmjs.org/marko/-/marko-5.31.18.tgz", - "integrity": "sha512-kzPHPgib+EuktFtaN5SMxt22FyNTR2wRgUVaFrQO+7RYJepM3xDbi0NUp+vCn2kK0LqMFgLiVr2h/j/l+hw/cw==", + "version": "5.32.0", + "resolved": "https://registry.npmjs.org/marko/-/marko-5.32.0.tgz", + "integrity": "sha512-jsUr2cwpV7DwQ1ctQq4vpOGKunP1RSsRkeV5TsP6JMaQclbnIwy2FtD8CKhYpPc5ROUdZ3EAgnI284tq4evkMA==", "dev": true, "dependencies": { - "@marko/compiler": "^5.33.8", + "@marko/compiler": "^5.34.0", "@marko/translator-default": "^5.31.8", "app-module-path": "^2.2.0", "argly": "^1.2.0", @@ -5308,9 +5284,9 @@ } }, "node_modules/mixme": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.9.tgz", - "integrity": "sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==", + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/mixme/-/mixme-0.5.10.tgz", + "integrity": "sha512-5H76ANWinB1H3twpJ6JY8uvAtpmFvHNArpilJAjXRKXSDDLPIMoZArw5SH0q9z+lLs8IrMw7Q2VWpWimFKFT1Q==", "dev": true, "engines": { "node": ">= 8.0.0" @@ -5760,12 +5736,12 @@ } }, "node_modules/playwright": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.39.0.tgz", - "integrity": "sha512-naE5QT11uC/Oiq0BwZ50gDmy8c8WLPRTEWuSSFVG2egBka/1qMoSqYQcROMT9zLwJ86oPofcTH2jBY/5wWOgIw==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", + "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", "dev": true, "dependencies": { - "playwright-core": "1.39.0" + "playwright-core": "1.40.1" }, "bin": { "playwright": "cli.js" @@ -5778,9 +5754,9 @@ } }, "node_modules/playwright-core": { - "version": "1.39.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.39.0.tgz", - "integrity": "sha512-+k4pdZgs1qiM+OUkSjx96YiKsXsmb59evFoqv8SKO067qBA+Z2s/dCzJij/ZhdQcs2zlTAgRKfeiiLm8PQ2qvw==", + "version": "1.40.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", + "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", "dev": true, "bin": { "playwright-core": "cli.js" @@ -7150,14 +7126,13 @@ } }, "node_modules/tsx": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.1.2.tgz", - "integrity": "sha512-1spM1bFV6MP2s4tO4tDC7g52fsaFdtEWdO4GfGdqi20qUgPbnAJqixOyIAvCSx1DDj3YIUB4CD06owTWUsOAuQ==", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.6.1.tgz", + "integrity": "sha512-OQ4TAPHXAPUo/NZAmmIybl0o8LFOTlycQxFepLBAp6EV87U88fOKYGCQI2viGAEOVU9UW/cgQcxcOMnfEKVY3Q==", "dev": true, "dependencies": { "esbuild": "~0.18.20", - "get-tsconfig": "^4.7.2", - "source-map-support": "^0.5.21" + "get-tsconfig": "^4.7.2" }, "bin": { "tsx": "dist/cli.mjs" @@ -7373,9 +7348,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", + "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -7464,9 +7439,9 @@ } }, "node_modules/v8-to-istanbul": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", - "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", diff --git a/package.json b/package.json index a37a254..cebc94f 100644 --- a/package.json +++ b/package.json @@ -37,40 +37,38 @@ "lint": "npm run build && eslint -f unix && prettier . --check --log-level=warn && sort-package-json --quiet --check", "prepare": "husky install", "release": "npm run build && changeset publish", - "test": "tsx --test-reporter=spec --test ./src/tests/*.test.ts", + "test": "MARKO_DEBUG=true tsx --test-reporter=spec --test ./src/tests/*.test.ts", "version": "changeset version && npm i --package-lock-only" }, "dependencies": { "arc-resolver": "^3.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", "htmlparser2": "^9.0.0" }, "devDependencies": { - "@changesets/changelog-github": "^0.4.8", - "@changesets/cli": "^2.26.2", - "@marko/compiler": "^5.33.8", - "@marko/vite": "^4.0.2", - "@playwright/test": "^1.39.0", + "@changesets/changelog-github": "^0.5.0", + "@changesets/cli": "^2.27.1", + "@marko/compiler": "^5.34.1", + "@marko/vite": "^4.1.1", + "@playwright/test": "^1.40.1", "@types/estree": "^1.0.5", - "@types/node": "^20.9.0", + "@types/node": "^20.10.1", "@types/serve-handler": "^6.1.4", - "@typescript-eslint/eslint-plugin": "^6.11.0", - "@typescript-eslint/parser": "^6.11.0", + "@typescript-eslint/eslint-plugin": "^6.13.1", + "@typescript-eslint/parser": "^6.13.1", "c8": "^8.0.1", - "eslint": "^8.53.0", + "eslint": "^8.54.0", "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.6.1", "eslint-plugin-import": "^2.29.0", "husky": "^8.0.3", "lint-staged": "^15.1.0", - "marko": "^5.31.18", - "playwright": "^1.39.0", + "marko": "^5.32.0", + "playwright": "^1.40.1", "prettier": "^3.1.0", "serve-handler": "^6.1.5", "sort-package-json": "^2.6.0", - "tsx": "^4.1.2", - "typescript": "^5.2.2", + "tsx": "^4.6.1", + "typescript": "^5.3.2", "vite": "^4.5.0" }, "peerDependencies": { diff --git a/src/index.ts b/src/index.ts index 113fa72..7655b14 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,6 +5,7 @@ import type { Plugin } from "vite"; import { pluginBuildSSR } from "./plugins/build-ssr"; import { pluginBuildWeb } from "./plugins/build-web"; import { pluginServe } from "./plugins/serve"; +import type { FlagSet } from "./utils/flags"; import { type Options, getInternalPluginOptions } from "./utils/options"; export { createFlagSets, hasFlags } from "./utils/flags"; @@ -35,6 +36,7 @@ declare module "rollup" { arcSourceId?: string; arcSourceCode?: string; arcScanIds?: string[]; + arcFlagSet?: FlagSet; arcFS?: typeof import("fs"); } } diff --git a/src/plugins/build-ssr.ts b/src/plugins/build-ssr.ts index a76e929..ed10a01 100644 --- a/src/plugins/build-ssr.ts +++ b/src/plugins/build-ssr.ts @@ -209,16 +209,21 @@ function partsToString(parts, base, injectAttrs) { } } } else if (isArcVirtualMatch(id)) { - const [arcSourceId, flagSet] = decodeArcVirtualMatch(id); + const [arcSourceId, arcFlagSet] = decodeArcVirtualMatch(id); const { meta, moduleSideEffects, syntheticNamedExports } = this.getModuleInfo(arcSourceId)!; const code = meta.arcSourceCode as string; - const arcFS = getArcFS(flagSet); + const arcFS = getArcFS(arcFlagSet); return { code, moduleSideEffects, syntheticNamedExports, - meta: { ...meta, arcSourceId, arcFS }, + meta: { + ...meta, + arcSourceId, + arcFlagSet, + arcFS, + }, }; } diff --git a/src/plugins/build-web.ts b/src/plugins/build-web.ts index a3da545..e547aa6 100644 --- a/src/plugins/build-web.ts +++ b/src/plugins/build-web.ts @@ -10,11 +10,13 @@ import { indexToId } from "../utils/index-to-id"; import { isCssFile } from "../utils/is-css-file"; import { type DocManifest, - generateDocManifest, - generateInputDoc, + generatManifest, + generateHTML, } from "../utils/manifest"; import { type Matches } from "../utils/matches"; import { type InternalPluginOptions } from "../utils/options"; +import { stripEntryScript } from "../utils/strip-entry-script"; +import { toPosix } from "../utils/to-posix"; import { decodeArcVirtualMatch, getVirtualMatches, @@ -23,10 +25,10 @@ import { const arcPrefix = "\0arc-"; const arcJsSuffix = ".mjs"; -const arcProxyPrefix = `${arcPrefix}proxy:`; const arcInitPrefix = `${arcPrefix}init:`; -const arcHTMLChunkReg = /(.+)\.arc(?:\.(.+))?\.html$/; - +const arcProxyPrefix = `${arcPrefix}proxy:`; +const emptyScriptReg = /^[\s;]+$/; +const arcChunkFileNameReg = /(.+)\.arc(?:\.(.+))?\.html$/; export function pluginBuildWeb({ runtimeId, flagSets, @@ -36,9 +38,12 @@ export function pluginBuildWeb({ const adaptiveImporters = new Map>(); const adaptiveMatchesForId = new Map(); const bindingsByAdaptiveId = new Map | true>(); - const resolvedAdaptiveImportsForChunk = new Map< + const metaForAdaptiveChunk = new Map< string, - Map + { + entryId: string; + adaptiveImports: Map; + } >(); const apply: Plugin["apply"] = (config, { command }) => command === "build" && !config.build?.ssr; @@ -62,7 +67,7 @@ export function pluginBuildWeb({ adaptiveImporters.clear(); adaptiveMatchesForId.clear(); bindingsByAdaptiveId.clear(); - resolvedAdaptiveImportsForChunk.clear(); + metaForAdaptiveChunk.clear(); }, async resolveId(source, importer, options) { if (importer) { @@ -111,9 +116,9 @@ export function pluginBuildWeb({ } return resolved; - } else if (resolvedAdaptiveImportsForChunk.has(source)) { + } else if (metaForAdaptiveChunk.has(source)) { return source; - } else if (options.isEntry) { + } else if (options.isEntry && !isArcId(source)) { const resolved = await this.resolve(source, importer, { ...options, skipSelf: true, @@ -205,10 +210,10 @@ export function pluginBuildWeb({ flagSet.length ? `.${flagSet.join(".")}` : "" }.html`; - resolvedAdaptiveImportsForChunk.set( - id, - resolvedAdaptiveImports, - ); + metaForAdaptiveChunk.set(id, { + entryId: resolved.id, + adaptiveImports: resolvedAdaptiveImports, + }); return id; }), ); @@ -273,27 +278,25 @@ export function pluginBuildWeb({ }, async load(id) { - const resolvedAdaptiveImports = resolvedAdaptiveImportsForChunk.get(id); - if (resolvedAdaptiveImports) { - let code = ""; + const adaptiveChunkMeta = metaForAdaptiveChunk.get(id); - for (const [adaptiveImport, adaptedImport] of [ - ...resolvedAdaptiveImports, - ].reverse()) { + if (adaptiveChunkMeta) { + let code = ""; + const adaptiveImports = [...adaptiveChunkMeta.adaptiveImports]; + for (let i = adaptiveImports.length; i--; ) { + const [adaptiveImport, adaptedImport] = adaptiveImports[i]; code += `import ${JSON.stringify( encodeArcInitId(adaptiveImport, adaptedImport), )};\n`; } - code = generateInputDoc(code); + code = generateHTML(code); return { code, - moduleSideEffects: false, + moduleSideEffects: "no-treeshake", }; - } - - if (isArcProxyId(id)) { + } else if (isArcProxyId(id)) { id = decodeArcProxyId(id); if (isCssFile(id)) { @@ -360,47 +363,79 @@ export function pluginBuildWeb({ moduleSideEffects: "no-treeshake", }; } else if (isArcVirtualMatch(id)) { - const [arcSourceId, flagSet] = decodeArcVirtualMatch(id); + const [arcSourceId, arcFlagSet] = decodeArcVirtualMatch(id); const { meta, moduleSideEffects, syntheticNamedExports } = this.getModuleInfo(arcSourceId)!; const code = meta.arcSourceCode as string; - const arcFS = getArcFS(flagSet); + const arcFS = getArcFS(arcFlagSet); return { code, moduleSideEffects, syntheticNamedExports, - meta: { ...meta, arcSourceId, arcFS }, + meta: { + ...meta, + arcSourceId, + arcFlagSet, + arcFS, + }, }; } return null; }, + transformIndexHtml(html, { chunk }) { + if (!chunk?.facadeModuleId) return; + if (arcChunkFileNameReg.test(chunk.facadeModuleId)) { + return [ + { + injectTo: "head-prepend", + tag: "script", + children: `${runtimeId}={}`, + }, + ]; + } - banner(chunk) { - if (chunk.isEntry) { + return stripEntryScript(basePath, chunk.fileName, html); + }, + generateBundle(_, bundle) { + const facadeModuleIdToEntryName = new Map(); + for (const fileName in bundle) { + const chunk = bundle[fileName]; if ( + chunk.type === "chunk" && + chunk.isEntry && chunk.facadeModuleId && - arcHTMLChunkReg.test(chunk.facadeModuleId) + !arcChunkFileNameReg.test(chunk.facadeModuleId) && + !emptyScriptReg.test(chunk.code) ) { - return `window.${runtimeId}={};`; + facadeModuleIdToEntryName.set(chunk.facadeModuleId, chunk.fileName); } - - return `window.${runtimeId}_d || await new Promise(r => window.${runtimeId}_d = r);`; } - return ""; - }, - - footer(chunk) { - if ( - chunk.isEntry && - chunk.facadeModuleId && - arcHTMLChunkReg.test(chunk.facadeModuleId) - ) { - return `window.${runtimeId}_d?.();\nwindow.${runtimeId}_d = true;`; + for (const fileName in bundle) { + const chunk = bundle[fileName]; + if ( + chunk.type === "chunk" && + chunk.isEntry && + chunk.facadeModuleId && + arcChunkFileNameReg.test(chunk.facadeModuleId) + ) { + const adaptiveChunkMeta = metaForAdaptiveChunk.get( + chunk.facadeModuleId, + ); + if (adaptiveChunkMeta) { + const originalEntryName = facadeModuleIdToEntryName.get( + adaptiveChunkMeta.entryId, + ); + if (originalEntryName) { + chunk.imports.push(originalEntryName); + chunk.code += `;import ${JSON.stringify( + toRelativeImport(chunk.fileName, originalEntryName), + )}`; + } + } + } } - - return ""; }, }, { @@ -431,16 +466,13 @@ export function pluginBuildWeb({ for (const fileName in bundle) { const chunk = bundle[fileName]; if (chunk.type === "asset") { - const arcHTMLChunkMatch = arcHTMLChunkReg.exec(chunk.fileName); + const arcHTMLChunkMatch = arcChunkFileNameReg.exec(chunk.fileName); if (!arcHTMLChunkMatch) continue; delete bundle[fileName]; const [, entryName, flagSetStr] = arcHTMLChunkMatch; const flaggedManifest = { flags: (flagSetStr ? flagSetStr.split(".") : []) as FlagSet, - manifest: await generateDocManifest( - basePath, - chunk.source.toString(), - ), + manifest: generatManifest(basePath, chunk.source.toString()), }; const flaggedAssetsForEntry = flaggedManifestByEntry.get(entryName); if (flaggedAssetsForEntry) { @@ -554,3 +586,11 @@ function decodeArcInitId(id: string) { : path.join(adaptiveImport, "..", relativeAdaptedImport); return [adaptiveImport, adaptedImport]; } + +function toRelativeImport(from: string, to: string) { + const relative = path.relative(path.dirname(toPosix(from)), toPosix(to)); + if (relative[0] !== ".") { + return `./${relative}`; + } + return relative; +} diff --git a/src/tests/basic.test.ts b/src/tests/basic.test.ts index bd8abea..5653d22 100644 --- a/src/tests/basic.test.ts +++ b/src/tests/basic.test.ts @@ -86,7 +86,6 @@ async function assertHasDesktopContent(page: Page) { } async function assertHasMobileContent(page: Page) { - await page.pause(); await expect(page.locator("body")).toHaveCSS( "background-color", "rgb(0, 255, 255)", diff --git a/src/tests/marko-scan-files.test.ts b/src/tests/marko-scan-files.test.ts index 3519271..ebaff42 100644 --- a/src/tests/marko-scan-files.test.ts +++ b/src/tests/marko-scan-files.test.ts @@ -68,7 +68,6 @@ t.test("marko-scan-files", async (t) => { await t.test("FLAGS=mobile", async (t) => { await page.goto("/?mobile"); - await page.pause(); await t.test("has mobile content", async () => { await assertHasMobileContent(page); }); diff --git a/src/tests/marko.test.ts b/src/tests/marko.test.ts index c042b7e..648c740 100644 --- a/src/tests/marko.test.ts +++ b/src/tests/marko.test.ts @@ -86,7 +86,6 @@ async function assertHasDesktopContent(page: Page) { } async function assertHasMobileContent(page: Page) { - await page.pause(); await expect(page.locator("body")).toHaveCSS( "background-color", "rgb(0, 255, 255)", diff --git a/src/utils/flags.ts b/src/utils/flags.ts index 637ec0d..44a2320 100644 --- a/src/utils/flags.ts +++ b/src/utils/flags.ts @@ -62,8 +62,7 @@ export function compareFlagSets(a: FlagSet, b: FlagSet) { if (aLen === bLen) { for (let i = aLen; i--; ) { const compared = compareFlags(a[i], b[i]); - if (compared === 0) continue; - return compared; + if (compared !== 0) return compared; } } @@ -71,8 +70,10 @@ export function compareFlagSets(a: FlagSet, b: FlagSet) { } export function normalizeFlagSets(rawFlagSets: string[][]): FlagSet[] { - if (!rawFlagSets.length) return rawFlagSets as FlagSet[]; - const sortedFlagSets = rawFlagSets.map(normalizeFlagSet).sort(); + if (!rawFlagSets.length) return [[]] as unknown as FlagSet[]; + const sortedFlagSets = rawFlagSets + .map(normalizeFlagSet) + .sort(compareFlagSets); let prev = sortedFlagSets[0]; const uniqueFlagSets = [prev]; for (let i = 1; i < sortedFlagSets.length; i++) { diff --git a/src/utils/manifest.ts b/src/utils/manifest.ts index 39b4080..de4c7dd 100644 --- a/src/utils/manifest.ts +++ b/src/utils/manifest.ts @@ -1,6 +1,5 @@ -import { ElementType } from "domelementtype"; -import { Comment, DomHandler, Element, Node, Text } from "domhandler"; -import { Parser } from "htmlparser2"; +import type { Comment, Node, Element, Text } from "domhandler"; +import { parseDocument, ElementType, DomUtils } from "htmlparser2"; type Serialized = ReturnType; export type DocManifest = { @@ -15,6 +14,7 @@ enum InjectType { PublicPath = 1, } +const { isComment, isTag } = DomUtils; const markerComment = "ARC_VITE"; const voidElements = new Set([ "area", @@ -33,55 +33,39 @@ const voidElements = new Set([ "wbr", ]); -export function generateDocManifest( - basePath: string, - rawHtml: string, -): Promise { - return new Promise((resolve, reject) => { - const parser = new Parser( - new DomHandler(function (err, dom) { - if (err) { - return reject(err); +export function generatManifest(basePath: string, html: string): DocManifest { + const dom = parseDocument(html); + const headPrepend: Node[] = []; + const head: Node[] = []; + const bodyPrepend: Node[] = []; + const body: Node[] = []; + + for (const node of dom.childNodes) { + if (isTag(node) && node.tagName === "html") { + for (const child of node.childNodes) { + if (isTag(child)) { + switch (child.tagName) { + case "head": + splitNodesByMarker(child.childNodes, headPrepend, head); + break; + case "body": + splitNodesByMarker(child.childNodes, bodyPrepend, body); + break; + } } + } + } + } - const htmlChildren = dom.find(isElement)!.childNodes; - const headPrepend: Node[] = []; - const head: Node[] = []; - const bodyPrepend: Node[] = []; - const body: Node[] = []; - splitNodesByMarker( - ( - htmlChildren.find( - (node) => isElement(node) && node.tagName === "head", - ) as Element - ).childNodes, - headPrepend, - head, - ); - splitNodesByMarker( - ( - htmlChildren.find( - (node) => isElement(node) && node.tagName === "body", - ) as Element - ).childNodes, - bodyPrepend, - body, - ); - - resolve({ - "head-prepend": serializeOrUndefined(basePath, headPrepend), - head: serializeOrUndefined(basePath, head), - "body-prepend": serializeOrUndefined(basePath, bodyPrepend), - body: serializeOrUndefined(basePath, body), - }); - }), - ); - parser.write(rawHtml); - parser.end(); - }); + return { + "head-prepend": serializeOrUndefined(basePath, headPrepend), + head: serializeOrUndefined(basePath, head), + "body-prepend": serializeOrUndefined(basePath, bodyPrepend), + body: serializeOrUndefined(basePath, body), + }; } -export function generateInputDoc(code: string) { +export function generateHTML(code: string) { return ``; } @@ -192,7 +176,7 @@ function splitNodesByMarker(nodes: Node[], before: Node[], after: Node[]) { for (let i = 0; i < nodes.length; i++) { let node = nodes[i]; - if ((node as Comment).data === markerComment) { + if (isComment(node) && node.data === markerComment) { i++; for (; i < nodes.length; i++) { node = nodes[i]; @@ -206,10 +190,6 @@ function splitNodesByMarker(nodes: Node[], before: Node[], after: Node[]) { } } -function isElement(node: Node): node is Element { - return node.type === ElementType.Tag; -} - function stripBasePath(basePath: string, path: string) { if (path.startsWith(basePath)) return path.slice(basePath.length); return path; diff --git a/src/utils/strip-entry-script.ts b/src/utils/strip-entry-script.ts new file mode 100644 index 0000000..0cf44d8 --- /dev/null +++ b/src/utils/strip-entry-script.ts @@ -0,0 +1,34 @@ +import toHTML from "dom-serializer"; +import type { Node, Element } from "domhandler"; +import { parseDocument, DomUtils } from "htmlparser2"; + +const { isTag, removeElement, filter } = DomUtils; + +export function stripEntryScript( + basePath: string, + fileName: string, + html: string, +) { + const dom = parseDocument(html); + for (const script of filter(isModule, dom) as Element[]) { + if (stripBasePath(basePath, script.attribs.src) === fileName) { + removeElement(script); + } + } + + return toHTML(dom); +} + +function isModule(node: Node): node is Element { + return ( + isTag(node) && + node.tagName === "script" && + node.attribs.type === "module" && + !!node.attribs.src + ); +} + +function stripBasePath(basePath: string, path: string) { + if (path.startsWith(basePath)) return path.slice(basePath.length); + return path; +} diff --git a/src/utils/virtual-matches.ts b/src/utils/virtual-matches.ts index b6a3404..2e95432 100644 --- a/src/utils/virtual-matches.ts +++ b/src/utils/virtual-matches.ts @@ -22,7 +22,9 @@ export async function getVirtualMatches( if (isBuiltinModuleType.test(id)) return; - const { meta } = await ctx.load(resolved); + let info = ctx.getModuleInfo(id); + if (!info?.ast) info = await ctx.load(resolved); + const { meta } = info; if (Array.isArray(meta.arcScanIds)) { if (typeof meta.arcSourceCode !== "string") { ctx.error(