diff --git a/.changeset/breezy-plums-study.md b/.changeset/breezy-plums-study.md new file mode 100644 index 000000000..d9016188c --- /dev/null +++ b/.changeset/breezy-plums-study.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +WIP: fix HMR singleton issue diff --git a/.changeset/eleven-buttons-dream.md b/.changeset/eleven-buttons-dream.md new file mode 100644 index 000000000..55ad8a596 --- /dev/null +++ b/.changeset/eleven-buttons-dream.md @@ -0,0 +1,6 @@ +--- +"vite-plugin-docs": patch +"@crxjs/vite-plugin": patch +--- + +Add tip `type: module` to vue page diff --git a/.changeset/eleven-planes-tease.md b/.changeset/eleven-planes-tease.md new file mode 100644 index 000000000..9339b28b8 --- /dev/null +++ b/.changeset/eleven-planes-tease.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +fix(package): update cjs export path diff --git a/.changeset/fair-eggs-change.md b/.changeset/fair-eggs-change.md new file mode 100644 index 000000000..3840e3671 --- /dev/null +++ b/.changeset/fair-eggs-change.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +Add newline to generated manifest.json (issue #668) diff --git a/.changeset/kind-donkeys-cry.md b/.changeset/kind-donkeys-cry.md new file mode 100644 index 000000000..fb3b4e9f7 --- /dev/null +++ b/.changeset/kind-donkeys-cry.md @@ -0,0 +1,6 @@ +--- +"vite-plugin-docs": patch +"@crxjs/vite-plugin": patch +--- + +fix: add new screenshot and remove the redudant code diff --git a/.changeset/late-paws-change.md b/.changeset/late-paws-change.md new file mode 100644 index 000000000..84242f078 --- /dev/null +++ b/.changeset/late-paws-change.md @@ -0,0 +1,5 @@ +--- +'rollup-plugin-chrome-extension': patch +--- + +Allows match in manifest.json within rollup package diff --git a/.changeset/moody-ligers-exercise.md b/.changeset/moody-ligers-exercise.md new file mode 100644 index 000000000..ceca48566 --- /dev/null +++ b/.changeset/moody-ligers-exercise.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +fix: infinite recursion on circular dependency diff --git a/.changeset/pre.json b/.changeset/pre.json index 4fb18fff1..09c37dd62 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -8,19 +8,32 @@ }, "changesets": [ "beige-snails-kiss", + "breezy-plums-study", + "eleven-buttons-dream", + "eleven-planes-tease", + "fair-eggs-change", "fluffy-numbers-brake", "fresh-suns-do", "gold-spies-occur", "grumpy-brooms-exist", "grumpy-comics-explain", + "kind-donkeys-cry", + "late-paws-change", "long-kangaroos-work", "lucky-cows-tan", + "moody-ligers-exercise", "perfect-doors-exercise", + "rotten-snakes-brush", + "six-cobras-flash", "sixty-mirrors-promise", + "small-phones-beam", + "strong-jobs-try", "stupid-years-whisper", "swift-years-kick", "tidy-shrimps-cross", "tiny-planes-float", + "wet-hornets-run", + "wicked-moose-listen", "young-terms-tickle" ] } diff --git a/.changeset/rotten-snakes-brush.md b/.changeset/rotten-snakes-brush.md new file mode 100644 index 000000000..837117c50 --- /dev/null +++ b/.changeset/rotten-snakes-brush.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +Add inline sourcemap support to content scripts diff --git a/.changeset/six-cobras-flash.md b/.changeset/six-cobras-flash.md new file mode 100644 index 000000000..92347c366 --- /dev/null +++ b/.changeset/six-cobras-flash.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +Test: infinite recursion on circular dependency diff --git a/.changeset/small-phones-beam.md b/.changeset/small-phones-beam.md new file mode 100644 index 000000000..ccaf2ae3d --- /dev/null +++ b/.changeset/small-phones-beam.md @@ -0,0 +1,6 @@ +--- +"vite-plugin-docs": patch +"@crxjs/vite-plugin": patch +--- + +React v18 ReactDOM.render changes diff --git a/.changeset/strong-jobs-try.md b/.changeset/strong-jobs-try.md new file mode 100644 index 000000000..f70c5127a --- /dev/null +++ b/.changeset/strong-jobs-try.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +Add content script module API diff --git a/.changeset/wet-hornets-run.md b/.changeset/wet-hornets-run.md new file mode 100644 index 000000000..c27670fcb --- /dev/null +++ b/.changeset/wet-hornets-run.md @@ -0,0 +1,5 @@ +--- +"@crxjs/vite-plugin": patch +--- + +Fix content scripts hmr diff --git a/.changeset/wicked-moose-listen.md b/.changeset/wicked-moose-listen.md new file mode 100644 index 000000000..66cbbb21a --- /dev/null +++ b/.changeset/wicked-moose-listen.md @@ -0,0 +1,6 @@ +--- +"rollup-plugin-chrome-extension": patch +"@crxjs/vite-plugin": patch +--- + +fix: schema of input_components diff --git a/.github/workflows/vite-plugin.yml b/.github/workflows/vite-plugin.yml index 1e68ec29e..8e928e58d 100644 --- a/.github/workflows/vite-plugin.yml +++ b/.github/workflows/vite-plugin.yml @@ -113,7 +113,7 @@ jobs: run: pnpm install --filter "vite-plugin" - name: Run e2e tests - uses: GabrielBB/xvfb-action@v1 + uses: xvfb-run -a npm test with: run: pnpm test:run:e2e working-directory: "packages/vite-plugin" @@ -122,7 +122,7 @@ jobs: if: failure() with: name: image-diff-${{ matrix.type }} - path: ${{ github.workspace }}/tests/**/__image_snapshots__/__diff_output__/*.png + path: ${{ github.workspace }}/packages/vite-plugin/tests/**/__image_snapshots__/__diff_output__/*.png # Runs unit and output tests unit: @@ -170,21 +170,23 @@ jobs: - name: Run unit and output tests run: pnpm test:run:out - - name: Check for diff - id: diff - run: echo "::set-output name=diff::$(git --no-pager diff --name-only)" - - - name: Fail if diff - if: ${{ steps.diff.outputs.diff }} - run: exit 1 - - - name: Git diff - if: failure() - run: git diff > diff.txt - - - uses: actions/upload-artifact@v3 - if: failure() - with: - name: output-diff-${{ matrix.type }} - path: diff.txt - if-no-files-found: ignore + # Disabling diff check for now, don't think it's doing anything + # + # - name: Check for diff + # id: diff + # run: echo "::set-output name=diff::$(git --no-pager diff --name-only)" + + # - name: Fail if diff + # if: ${{ steps.diff.outputs.diff }} + # run: exit 1 + + # - name: Git diff + # if: failure() + # run: git diff > diff.txt + + # - uses: actions/upload-artifact@v3 + # if: failure() + # with: + # name: output-diff-${{ matrix.type }} + # path: diff.txt + # if-no-files-found: ignore diff --git a/.prettierignore b/.prettierignore index 0f5ac8061..34adb6dc5 100644 --- a/.prettierignore +++ b/.prettierignore @@ -6,4 +6,5 @@ dist schema *-lock.* .github/**/*.yaml -.github/**/*.yml \ No newline at end of file +.github/**/*.yml +packages/vite-plugin/src/client/iife \ No newline at end of file diff --git a/package.json b/package.json index 5bdbd45b6..8e5262947 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@changesets/cli": "^2.22.0", "@typescript-eslint/eslint-plugin": "^5.20.0", "@typescript-eslint/parser": "^5.20.0", - "eslint": "8.26.0", + "eslint": "8.43.0", "eslint-plugin-react": "^7.29.4", "npm-run-all": "^4.1.5", "prettier": "^2.6.2", diff --git a/packages/rollup-plugin/CHANGELOG.md b/packages/rollup-plugin/CHANGELOG.md index ad36d065c..0c31fc18f 100644 --- a/packages/rollup-plugin/CHANGELOG.md +++ b/packages/rollup-plugin/CHANGELOG.md @@ -1,5 +1,19 @@ # rollup-plugin-chrome-extension +## 3.6.13-beta.0 + +### Patch Changes + +- bbc4d33: fix: schema of input_components + +## 3.6.11 + +## 3.6.11-beta.0 + +### Patch Changes + +- 2fd88aa: Allows match in manifest.json within rollup package + ## 3.6.10 ### Patch Changes diff --git a/packages/rollup-plugin/README.md b/packages/rollup-plugin/README.md index d932dbcc6..d991da24e 100755 --- a/packages/rollup-plugin/README.md +++ b/packages/rollup-plugin/README.md @@ -14,7 +14,7 @@ Use `manifest.json` as the input. Every file in the manifest will be bundled or copied to the output folder. RPCE simplifies project config and supports many of Vite's features in the -Chrome Extension evironment, including HMR. +Chrome Extension environment, including HMR. ## [Documentation](https://www.extend-chrome.dev/rollup-plugin) diff --git a/packages/rollup-plugin/__tests__/e2e__mv3-basic-js.test.ts b/packages/rollup-plugin/__tests__/e2e__mv3-basic-js.test.ts index 8a2c3187f..55e9fae80 100755 --- a/packages/rollup-plugin/__tests__/e2e__mv3-basic-js.test.ts +++ b/packages/rollup-plugin/__tests__/e2e__mv3-basic-js.test.ts @@ -39,7 +39,7 @@ test('bundles assets', async () => { expect(assets.length).toBe(2) }) -test('entries in manifest match entriess in output', async () => { +test('entries in manifest match entries in output', async () => { const { output } = await outputPromise const assets = output.filter(isAsset) diff --git a/packages/rollup-plugin/jest.setup.ts b/packages/rollup-plugin/jest.setup.ts index 7f179f74c..311637bd5 100644 --- a/packages/rollup-plugin/jest.setup.ts +++ b/packages/rollup-plugin/jest.setup.ts @@ -12,7 +12,7 @@ jest.spyOn(console, 'log') jest.spyOn(console, 'error') jest.spyOn(console, 'warn') -/* ---------- DONT LET ROLLUP PLUGINS WARN --------- */ +/* ---------- DON'T LET ROLLUP PLUGINS WARN --------- */ beforeAll(() => { // eslint-disable-next-line diff --git a/packages/rollup-plugin/package.json b/packages/rollup-plugin/package.json index 8c11513d9..2e4e63d41 100644 --- a/packages/rollup-plugin/package.json +++ b/packages/rollup-plugin/package.json @@ -1,6 +1,6 @@ { "name": "rollup-plugin-chrome-extension", - "version": "3.6.10", + "version": "3.6.13-beta.0", "description": "Build Chrome Extensions with this Rollup plugin.", "keywords": [ "rollup-plugin", @@ -56,7 +56,7 @@ "localforage": "^1.9.0", "lodash": "^4.17.21", "mem": "^6.0.1", - "playwright-chromium": "1.27.1", + "playwright-chromium": "1.33.0", "rollup": "^2.72.1", "slash": "^3.0.0", "webextension-polyfill": "^0.9.0" @@ -78,7 +78,7 @@ "@testing-library/dom": "^6.12.2", "@testing-library/jest-dom": "^5.1.1", "@types/cheerio": "0.22.22", - "@types/chrome": "0.0.209", + "@types/chrome": "0.0.237", "@types/fs-extra": "^8.0.1", "@types/glob": "^8.0.0", "@types/jest": "^27.0.0", @@ -87,7 +87,7 @@ "@types/lodash.flatten": "^4.4.6", "@types/lodash.get": "^4.4.6", "@types/node": "^13.7.0", - "@types/prettier": "^1.19.0", + "@types/prettier": "^2.0.0", "@types/react": "^17.0.3", "@types/react-dom": "^17.0.3", "jest": "^27.5.1", diff --git a/packages/rollup-plugin/schema/manifest-v3.schema.json b/packages/rollup-plugin/schema/manifest-v3.schema.json index 5afdf253b..f626aa511 100644 --- a/packages/rollup-plugin/schema/manifest-v3.schema.json +++ b/packages/rollup-plugin/schema/manifest-v3.schema.json @@ -472,22 +472,22 @@ "items": { "additionalProperties": false, "properties": { - "description": { + "name": { "type": "string" }, "id": { "type": "string" }, "language": { - "type": "string" + "type": ["string", "array"] }, "layouts": { - "type": "array" + "type": ["string", "array"] }, - "name": { + "input_view": { "type": "string" }, - "type": { + "options_page": { "type": "string" } }, diff --git a/packages/rollup-plugin/src/manifest-input/convertMatchPatterns.ts b/packages/rollup-plugin/src/manifest-input/convertMatchPatterns.ts index 88c4923ad..15c397f43 100644 --- a/packages/rollup-plugin/src/manifest-input/convertMatchPatterns.ts +++ b/packages/rollup-plugin/src/manifest-input/convertMatchPatterns.ts @@ -1,4 +1,5 @@ export const convertMatchPatterns = (m: string): string => { + if (m === ('')) return m // Use URL to parse match pattern // URL must have valid url scheme const [scheme, rest] = m.split('://') @@ -16,7 +17,7 @@ export const convertMatchPatterns = (m: string): string => { const [x, y] = base.split(':3333') const final = isWildPort ? [x, port, y].join('') : base - // URL escapes asterixes + // URL escapes asterisks // Need to unescape them return unescape(`${scheme}://${final}/*`) } diff --git a/packages/vite-plugin-docs/CHANGELOG.md b/packages/vite-plugin-docs/CHANGELOG.md index cc4bb27a7..9f5bcc83e 100644 --- a/packages/vite-plugin-docs/CHANGELOG.md +++ b/packages/vite-plugin-docs/CHANGELOG.md @@ -1,5 +1,18 @@ # vite-plugin-docs +## 0.0.3-beta.2 + +### Patch Changes + +- 00be1a1: fix: add new screenshot and remove the redudant code +- 42baebb: React v18 ReactDOM.render changes + +## 0.0.3-beta.1 + +### Patch Changes + +- 3dea230: Add tip `type: module` to vue page + ## 0.0.3-beta.0 ### Patch Changes diff --git a/packages/vite-plugin-docs/docs/getting-started/react/01-dev-basics.md b/packages/vite-plugin-docs/docs/getting-started/react/01-dev-basics.md index 2625deb86..9feb96be6 100644 --- a/packages/vite-plugin-docs/docs/getting-started/react/01-dev-basics.md +++ b/packages/vite-plugin-docs/docs/getting-started/react/01-dev-basics.md @@ -22,7 +22,11 @@ import Installing from '../\_install-extension.md'; -![Chrome Extension icon context menu](./assets/start-context-menu-inspect.png) +## Opening the extension + + + +![image](https://user-images.githubusercontent.com/33419526/227034773-c8b065eb-a3b4-4ab2-a31e-86a29bec7894.png) ## Profit with Vite HMR @@ -30,18 +34,8 @@ Once you've found the extension icon, right-click it and choose "Inspect popup window". This will open the popup and the popup dev tools window. We need to inspect the popup to keep it open while making changes. -![Popup without min-width](./assets/start-starter-narrow.png) - -That popup is pretty tiny; let's add some CSS to make it wider. - -```css title=App.css -.App { - text-align: center; - // highlight-next-line - min-width: 350px; -} -``` +![Chrome Extension icon context menu](./assets/start-context-menu-inspect.png) And boom! HMR magic at work. -![Popup with min-width](./assets/start-starter-wide.png) +![image](https://user-images.githubusercontent.com/33419526/227035247-c1956251-847a-4361-8e2f-dd323c9d7c67.png) diff --git a/packages/vite-plugin-docs/docs/getting-started/react/02-add-content-script.md b/packages/vite-plugin-docs/docs/getting-started/react/02-add-content-script.md index c9055c015..051885514 100644 --- a/packages/vite-plugin-docs/docs/getting-started/react/02-add-content-script.md +++ b/packages/vite-plugin-docs/docs/getting-started/react/02-add-content-script.md @@ -42,6 +42,15 @@ with `https://www.google.com`. Content scripts don't use an HTML file, so we need to create our root element and append it to the DOM before mounting our React app. +:::info + + + +Vite now defaults to React v18 which uses ReactDOM.createRoot instead of previous ReactDOM.render +https://reactjs.org/blog/2022/03/29/react-v18.html + +::: + ```jsx title=src/main.jsx import React from 'react' import ReactDOM from 'react-dom' @@ -59,6 +68,21 @@ ReactDOM.render( ) ``` +### Implementation for React 18+ + +```jsx title=src/main.jsx +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import App from './App' + +ReactDOM.createRoot(document.getElementById("root")).render( + + + +); +``` + Let's add that root element. Make a copy of `src/main.jsx` and name it `src/content.jsx`. Add the highlighted code. @@ -83,6 +107,27 @@ ReactDOM.render( ) ``` +### Implementation for React 18+ + +```jsx title=src/content.jsx +import React from "react"; +import ReactDOM from "react-dom/client"; +import "./index.css"; +import App from "./App"; + +// highlight-start +const root = document.createElement("div"); +root.id = "crx-root"; +document.body.appendChild(root); +// highlight-end + +ReactDOM.createRoot(root).render( + + + +); +``` + ## Get the right URL :::info diff --git a/packages/vite-plugin-docs/docs/getting-started/vue/00-create-project.md b/packages/vite-plugin-docs/docs/getting-started/vue/00-create-project.md index 68ae4cd2a..d008d9fab 100644 --- a/packages/vite-plugin-docs/docs/getting-started/vue/00-create-project.md +++ b/packages/vite-plugin-docs/docs/getting-started/vue/00-create-project.md @@ -20,6 +20,13 @@ extension Vue HTML page. The first two sections take about 90 seconds! +:::tip package.json + +Check `package.json` to ensure that `"type": "module"` is set. If this package +key is missing, Vite might not be able to build `vite.config.ts`. + +::: + ## Update the Vite config Update `vite.config.js` to match the code below. diff --git a/packages/vite-plugin-docs/package.json b/packages/vite-plugin-docs/package.json index a74976792..61ce52273 100644 --- a/packages/vite-plugin-docs/package.json +++ b/packages/vite-plugin-docs/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-docs", - "version": "0.0.3-beta.0", + "version": "0.0.3-beta.2", "private": true, "scripts": { "build": "docusaurus build", diff --git a/packages/vite-plugin/CHANGELOG.md b/packages/vite-plugin/CHANGELOG.md index dfe1ad97b..ccf463319 100644 --- a/packages/vite-plugin/CHANGELOG.md +++ b/packages/vite-plugin/CHANGELOG.md @@ -1,5 +1,47 @@ # @crxjs/vite-plugin +## 2.0.0-beta.18 + +### Patch Changes + +- 47eeda7: fix(package): update cjs export path +- 557721e: fix: infinite recursion on circular dependency +- a6ee0d2: Test: infinite recursion on circular dependency + +## 2.0.0-beta.17 + +### Patch Changes + +- 936ed77: Add inline sourcemap support to content scripts +- bbc4d33: fix: schema of input_components + +## 2.0.0-beta.16 + +### Patch Changes + +- 1728bdd: Add newline to generated manifest.json (issue #668) +- 00be1a1: fix: add new screenshot and remove the redudant code +- 42baebb: React v18 ReactDOM.render changes +- a4982e3: Add content script module API + +## 2.0.0-beta.15 + +### Patch Changes + +- ca0dfee: WIP: fix HMR singleton issue + +## 2.0.0-beta.14 + +### Patch Changes + +- 3dea230: Add tip `type: module` to vue page + +## 2.0.0-beta.13 + +### Patch Changes + +- 3cf9305: Fix content scripts hmr + ## 2.0.0-beta.12 ### Patch Changes diff --git a/packages/vite-plugin/client.d.ts b/packages/vite-plugin/client.d.ts index e7203e5d6..47491fa55 100644 --- a/packages/vite-plugin/client.d.ts +++ b/packages/vite-plugin/client.d.ts @@ -57,3 +57,18 @@ declare module '*?script&module' { const fileName: string export default fileName } + +declare namespace ContentScriptAPI { + export interface ExecuteFnOptions { + perf: { + injectTime: number + loadTime: number + } + } + export interface ExecuteFn { + (options: ExecuteFnOptions): void + } + export interface ModuleExports { + onExecute?: ExecuteFn + } +} diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json index cdec35274..1681757ed 100644 --- a/packages/vite-plugin/package.json +++ b/packages/vite-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@crxjs/vite-plugin", - "version": "2.0.0-beta.12", + "version": "2.0.0-beta.18", "description": "Build Chrome Extensions with this Vite plugin.", "keywords": [ "rollup-plugin", @@ -26,7 +26,7 @@ "type": "module", "exports": { ".": { - "require": "./index.cjs", + "require": "./dist/index.cjs", "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, @@ -68,6 +68,7 @@ "acorn-walk": "^8.2.0", "cheerio": "^1.0.0-rc.10", "connect-injector": "^0.4.4", + "convert-source-map": "^1.7.0", "debug": "^4.3.3", "es-module-lexer": "^0.10.0", "fast-glob": "^3.2.11", @@ -82,13 +83,14 @@ "devDependencies": { "@extend-chrome/messages": "1.2.2", "@extend-chrome/storage": "1.5.0", - "@rollup/plugin-alias": "4.0.2", + "@rollup/plugin-alias": "4.0.4", "@rollup/plugin-commonjs": "21.1.0", "@rollup/plugin-json": "^5.0.0", "@rollup/plugin-node-resolve": "13.2.0", - "@sveltejs/vite-plugin-svelte": "1.1.0", + "@sveltejs/vite-plugin-svelte": "1.4.0", "@types/acorn": "4.0.6", - "@types/chrome": "0.0.209", + "@types/chrome": "0.0.237", + "@types/convert-source-map": "^2.0.0", "@types/debug": "4.1.7", "@types/fs-extra": "9.0.13", "@types/jest-image-snapshot": "^5.1.0", @@ -101,23 +103,23 @@ "@vitejs/plugin-react": "^2.1.0", "@vitejs/plugin-vue": "3.2.0", "chokidar": "^3.5.3", - "esbuild": "0.17.4", + "esbuild": "0.17.14", "esbuild-runner": "2.2.2", - "eslint": "8.26.0", + "eslint": "8.43.0", "eslint-plugin-react": "^7.29.4", "jest-image-snapshot": "^5.2.0", "npm-run-all": "^4.1.5", - "playwright-chromium": "1.27.1", + "playwright-chromium": "1.33.0", "react": "17.0.2", "react-dom": "17.0.2", "rimraf": "3.0.2", "rollup-plugin-dts": "^4.2.0", - "rollup-plugin-esbuild": "4.10.1", + "rollup-plugin-esbuild": "4.10.3", "svelte": "^3.48.0", "typescript": "^4.6.4", "vite": "^3.1.7", - "vite-plugin-inspect": "0.7.14", - "vitest": "0.24.3", - "vue": "3.2.41" + "vite-plugin-inspect": "0.7.25", + "vitest": "0.28.5", + "vue": "3.2.47" } } diff --git a/packages/vite-plugin/src/client/iife/content-dev-loader.ts b/packages/vite-plugin/src/client/iife/content-dev-loader.ts index 21a8a1c79..2e5d6bf75 100644 --- a/packages/vite-plugin/src/client/iife/content-dev-loader.ts +++ b/packages/vite-plugin/src/client/iife/content-dev-loader.ts @@ -1,12 +1,15 @@ declare const __PREAMBLE__: string declare const __CLIENT__: string declare const __SCRIPT__: string +const injectTime = performance.now() ;(async () => { // remember, __PREAMBLE__ and __CLIENT__ are emitted files if (__PREAMBLE__) await import(/* @vite-ignore */ chrome.runtime.getURL(__PREAMBLE__)) await import(/* @vite-ignore */ chrome.runtime.getURL(__CLIENT__)) - await import(/* @vite-ignore */ chrome.runtime.getURL(__SCRIPT__)) + const { onExecute } = await import(/* @vite-ignore */ chrome.runtime.getURL(__SCRIPT__)) as ContentScriptAPI.ModuleExports + // this is the entry point of the content script, it will run each time this script is injected + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }) })().catch(console.error) export {} diff --git a/packages/vite-plugin/src/client/iife/content-pro-loader.ts b/packages/vite-plugin/src/client/iife/content-pro-loader.ts index c84477435..ffad94b34 100644 --- a/packages/vite-plugin/src/client/iife/content-pro-loader.ts +++ b/packages/vite-plugin/src/client/iife/content-pro-loader.ts @@ -1,6 +1,9 @@ declare const __SCRIPT__: string +const injectTime = performance.now() ;(async () => { - await import(/* @vite-ignore */ chrome.runtime.getURL(__SCRIPT__)) + const { onExecute } = await import(/* @vite-ignore */ chrome.runtime.getURL(__SCRIPT__)) as ContentScriptAPI.ModuleExports + // this is the entry point of the content script, it will run each time this script is injected + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }) })().catch(console.error) export {} diff --git a/packages/vite-plugin/src/node/compileFileResources.ts b/packages/vite-plugin/src/node/compileFileResources.ts index 622b59bcc..9b86df206 100644 --- a/packages/vite-plugin/src/node/compileFileResources.ts +++ b/packages/vite-plugin/src/node/compileFileResources.ts @@ -26,14 +26,20 @@ export function compileFileResources( css: new Set(), imports: new Set(), }, + processedFiles = new Set(), ): FileResources { + if (processedFiles.has(fileName)) { + return resources + } + processedFiles.add(fileName) + const chunk = chunks.get(fileName) if (chunk) { const { modules, facadeModuleId, imports, dynamicImports } = chunk for (const x of imports) resources.imports.add(x) for (const x of dynamicImports) resources.imports.add(x) for (const x of [...imports, ...dynamicImports]) - compileFileResources(x, { chunks, files, config }, resources) + compileFileResources(x, { chunks, files, config }, resources, processedFiles) for (const m of Object.keys(modules)) if (m !== facadeModuleId) { const key = prefix('/', relative(config.root, m.split('?')[0])) @@ -47,6 +53,7 @@ export function compileFileResources( script.fileName, { chunks, files, config }, resources, + processedFiles, ) } } diff --git a/packages/vite-plugin/src/node/fileWriter-hmr.ts b/packages/vite-plugin/src/node/fileWriter-hmr.ts index 2b2efdabd..ed624cc09 100644 --- a/packages/vite-plugin/src/node/fileWriter-hmr.ts +++ b/packages/vite-plugin/src/node/fileWriter-hmr.ts @@ -1,5 +1,6 @@ import { buffer, filter, map, mergeMap, Observable, Subject } from 'rxjs' import { + CustomPayload, FullReloadPayload, HMRPayload, PrunePayload, @@ -14,11 +15,12 @@ const debug = _debug('file-writer').extend('hmr') /* ------------------- HMR EVENTS ------------------ */ -const isCrxHMRPayload = (p: HMRPayload): p is CrxHMRPayload => - p.type === 'custom' && p.event.startsWith('crx:') +const isCustomPayload = (p: HMRPayload): p is CustomPayload => { + return p.type === 'custom' +} export const hmrPayload$ = new Subject() export const crxHMRPayload$: Observable = hmrPayload$.pipe( - filter((p) => !isCrxHMRPayload(p)), + filter((p) => !isCustomPayload(p)), buffer(allFilesReady$), mergeMap((pps) => { let fullReload: FullReloadPayload | undefined @@ -81,6 +83,7 @@ export const crxHMRPayload$: Observable = hmrPayload$.pipe( } }), map((data): CrxHMRPayload => { + debug(`hmr payload`, data) return { type: 'custom', event: 'crx:content-script-payload', diff --git a/packages/vite-plugin/src/node/fileWriter-rxjs.ts b/packages/vite-plugin/src/node/fileWriter-rxjs.ts index cd976973c..3f8599df9 100644 --- a/packages/vite-plugin/src/node/fileWriter-rxjs.ts +++ b/packages/vite-plugin/src/node/fileWriter-rxjs.ts @@ -2,6 +2,7 @@ import * as lexer from 'es-module-lexer' import { readFile } from 'fs/promises' import MagicString from 'magic-string' import { + BehaviorSubject, filter, first, firstValueFrom, @@ -21,6 +22,7 @@ import { outputFiles } from './fileWriter-filesMap' import { getFileName, getOutputPath, getViteUrl } from './fileWriter-utilities' import { join } from './path' import { CrxDevAssetId, CrxDevScriptId, CrxPlugin } from './types' +import convertSourceMap from 'convert-source-map' /* ----------------- SERVER EVENTS ----------------- */ @@ -74,6 +76,12 @@ export const allFilesReady$ = buildEnd$.pipe( switchMap((files) => Promise.allSettled(files.map(({ file }) => file))), ) +const timestamp$ = new BehaviorSubject(Date.now()) +allFilesReady$.subscribe(() => { + // update timestamp when all files have emitted + timestamp$.next(Date.now()) +}) + export const isRejected = ( x: PromiseSettledResult | undefined, ): x is PromiseRejectedResult => x?.status === 'rejected' @@ -139,8 +147,25 @@ function prepScript( const transformResult = await server.transformRequest(viteUrl) if (!transformResult) throw new TypeError(`Unable to load "${script.id}" from server.`) - const { code, deps = [], dynamicDeps = [] } = transformResult - return { target, code, deps: [...deps, ...dynamicDeps].flat(), server } + const { deps = [], dynamicDeps = [], map } = transformResult + let { code } = transformResult + try { + if (map && server.config.build.sourcemap === 'inline') { + // remove existing source map (might be a url, which doesn't work in content scripts) + code = code.replace(/\n*\/\/# sourceMappingURL=[^\n]+/g, '') + // create a new inline source map + const sourceMap = convertSourceMap.fromObject(map).toComment() + code += `\n${sourceMap}\n` + } + } catch (error) { + console.warn('Failed to inline source map', error) + } + return { + target, + code, + deps: [...deps, ...dynamicDeps].flat(), + server, + } }), // retry in case of dependency rebundle retry({ count: 10, delay: 100 }), @@ -157,13 +182,13 @@ function prepScript( mergeMap(async ({ target, code, deps }) => { await lexer.init const [imports] = lexer.parse(code, fileName) - const depSet = new Set(deps) + const depSet = new Set(deps) const magic = new MagicString(code) for (const i of imports) if (i.n) { depSet.add(i.n) const fileName = getFileName({ type: 'module', id: i.n }) - + // NOTE: Temporary fix for this bug: https://github.com/guybedford/es-module-lexer/issues/144 const fullImport = code.substring(i.s, i.e) magic.overwrite(i.s, i.e, fullImport.replace(i.n, `/${fileName}`)) diff --git a/packages/vite-plugin/src/node/fileWriter-utilities.ts b/packages/vite-plugin/src/node/fileWriter-utilities.ts index 8d8466395..789f2eedf 100644 --- a/packages/vite-plugin/src/node/fileWriter-utilities.ts +++ b/packages/vite-plugin/src/node/fileWriter-utilities.ts @@ -47,6 +47,7 @@ export function formatFileData< export function getFileName({ type, id }: FileWriterId): string { let fileName = id .replace(/t=\d+&/, '') // filenames do not contain timestamps + .replace(/\?t=\d+$/, '') // filenames do not contain timestamps .replace(/^\//, '') // filenames do not start with a slash .replace(/\?/g, '__') // convert url queries .replace(/&/g, '_') diff --git a/packages/vite-plugin/src/node/files.ts b/packages/vite-plugin/src/node/files.ts index 43aa3ff57..2058b1624 100644 --- a/packages/vite-plugin/src/node/files.ts +++ b/packages/vite-plugin/src/node/files.ts @@ -75,6 +75,7 @@ export function htmlFiles(manifest: ManifestV3): string[] { manifest.options_page, manifest.options_ui?.page, manifest.sandbox?.pages, + manifest.side_panel?.default_path ] .flat() .filter(isString) diff --git a/packages/vite-plugin/src/node/isImporter.ts b/packages/vite-plugin/src/node/isImporter.ts index 34339a98e..47083a99d 100644 --- a/packages/vite-plugin/src/node/isImporter.ts +++ b/packages/vite-plugin/src/node/isImporter.ts @@ -1,10 +1,14 @@ import { ModuleNode } from 'vite' -/** Determine if a changed file was imported by a file */ +export type FullModuleNode = ModuleNode & { + file: string + importers: Set +} +/** Determine if a changed file was imported by a file */ export function isImporter(file: string) { const seen = new Set() - const pred = (changedNode: ModuleNode): boolean => { + const pred = (changedNode: ModuleNode): changedNode is FullModuleNode => { seen.add(changedNode) if (changedNode.file === file) return true diff --git a/packages/vite-plugin/src/node/manifest.ts b/packages/vite-plugin/src/node/manifest.ts index 15631d55e..6c4a5b3ca 100644 --- a/packages/vite-plugin/src/node/manifest.ts +++ b/packages/vite-plugin/src/node/manifest.ts @@ -166,12 +166,12 @@ export interface ManifestV3 { incognito?: string | undefined input_components?: | { - name?: string | undefined - type?: string | undefined + name: string id?: string | undefined - description?: string | undefined - language?: string | undefined - layouts?: string[] | undefined + language?: string | string[] | undefined + layouts?: string | string[] | undefined + input_view?: string | undefined + options_page?: string | undefined }[] | undefined key?: string | undefined @@ -238,6 +238,11 @@ export interface ManifestV3 { content_security_policy?: string | undefined } | undefined + side_panel?: + | { + default_path?: string | undefined + } + | undefined short_name?: string | undefined spellcheck?: | { diff --git a/packages/vite-plugin/src/node/plugin-contentScripts.ts b/packages/vite-plugin/src/node/plugin-contentScripts.ts index 5c480564c..0791b9eaa 100644 --- a/packages/vite-plugin/src/node/plugin-contentScripts.ts +++ b/packages/vite-plugin/src/node/plugin-contentScripts.ts @@ -120,6 +120,21 @@ export const pluginContentScripts: CrxPluginFn = () => { name: 'crx:content-scripts', apply: 'build', enforce: 'pre', + config(config) { + return { + ...config, + build: { + ...config.build, + rollupOptions: { + ...config.build?.rollupOptions, + // keep exports for content script module api + preserveEntrySignatures: + config.build?.rollupOptions?.preserveEntrySignatures ?? + 'exports-only', + }, + }, + } + }, generateBundle() { // emit content script loaders for (const [key, script] of contentScripts) diff --git a/packages/vite-plugin/src/node/plugin-contentScripts_dynamic.ts b/packages/vite-plugin/src/node/plugin-contentScripts_dynamic.ts index 5be8c530f..629ef3984 100644 --- a/packages/vite-plugin/src/node/plugin-contentScripts_dynamic.ts +++ b/packages/vite-plugin/src/node/plugin-contentScripts_dynamic.ts @@ -1,6 +1,6 @@ import { ResolvedConfig } from 'vite' -import { allFilesReady } from '.' import { ContentScript, contentScripts, hashScriptId } from './contentScripts' +import { allFilesReady } from './fileWriter' import { formatFileData, getFileName } from './fileWriter-utilities' import { basename, relative } from './path' import { CrxPluginFn } from './types' diff --git a/packages/vite-plugin/src/node/plugin-fileWriter.ts b/packages/vite-plugin/src/node/plugin-fileWriter.ts index 6918e050f..f8c71f673 100644 --- a/packages/vite-plugin/src/node/plugin-fileWriter.ts +++ b/packages/vite-plugin/src/node/plugin-fileWriter.ts @@ -3,6 +3,9 @@ import { fileWriterError$ } from './fileWriter-rxjs' import { CrxPluginFn } from './types' import { createLogger } from 'vite' import { outputFiles } from './fileWriter-filesMap' +import fsx from 'fs-extra' + +const { remove } = fsx const logger = createLogger('error', { prefix: 'crxjs' }) @@ -12,22 +15,34 @@ export const pluginFileWriter: CrxPluginFn = () => { logger.error(error.err.message, { error: error.err }) }) - return { - name: 'crx:file-writer', - apply: 'serve', - configureServer(server) { - server.httpServer?.on('listening', async () => { - try { - await start({ server }) - } catch (error) { - console.error(error) - server.close() + return [ + { + name: 'crx:file-writer-empty-out-dir', + apply: 'serve', + enforce: 'pre', + async configResolved(config) { + if (config.build.emptyOutDir) { + await remove(config.build.outDir) } - }) - server.httpServer?.on('close', () => close()) + }, }, - closeBundle() { - outputFiles.clear() + { + name: 'crx:file-writer', + apply: 'serve', + configureServer(server) { + server.httpServer?.on('listening', async () => { + try { + await start({ server }) + } catch (error) { + console.error(error) + server.close() + } + }) + server.httpServer?.on('close', () => close()) + }, + closeBundle() { + outputFiles.clear() + }, }, - } + ] } diff --git a/packages/vite-plugin/src/node/plugin-manifest.ts b/packages/vite-plugin/src/node/plugin-manifest.ts index 4319a0cf3..a8286dd00 100644 --- a/packages/vite-plugin/src/node/plugin-manifest.ts +++ b/packages/vite-plugin/src/node/plugin-manifest.ts @@ -60,7 +60,7 @@ export const pluginManifest: CrxPluginFn = () => { html, } = await manifestFiles(manifest, { cwd: config.root }) const { entries = [] } = config.optimizeDeps ?? {} - // Vite ignores build inputs if optimize depts has explicit entries, + // Vite ignores build inputs if optimize deps has explicit entries, // so we need to merge both to include extra HTML files let { input = [] } = config.build?.rollupOptions ?? {} if (typeof input === 'string') input = [input] @@ -250,7 +250,7 @@ export const pluginManifest: CrxPluginFn = () => { } const encoded = encodeManifest(manifest) - return encoded + return { code: encoded, map: null } }, async generateBundle(options, bundle) { const manifestName = this.getFileName(refId) @@ -389,10 +389,10 @@ Public dir: "${config.publicDir}"`, this.emitFile({ type: 'asset', fileName: 'manifest.json', - source: JSON.stringify(manifest, null, 2), + source: JSON.stringify(manifest, null, 2) + '\n', }) } else { - manifestJson.source = JSON.stringify(manifest, null, 2) + manifestJson.source = JSON.stringify(manifest, null, 2) + '\n' } // remove manifest js file, we're done with it :) diff --git a/packages/vite-plugin/tests/e2e/helpers.ts b/packages/vite-plugin/tests/e2e/helpers.ts index 7e42af88b..8cd3d7b20 100644 --- a/packages/vite-plugin/tests/e2e/helpers.ts +++ b/packages/vite-plugin/tests/e2e/helpers.ts @@ -1,7 +1,8 @@ import jsesc from 'jsesc' import { BrowserContext, Locator, Page } from 'playwright-chromium' import { basename } from 'src/path' -import { TestContext } from 'vitest' +import { TestContext, vi } from 'vitest' +import fs from 'fs-extra' let count = 0 export function getCustomId({ meta }: TestContext): string { @@ -64,3 +65,29 @@ export async function waitForInnerHtml( } throw new Error('could not find element') } + +export const createUpdate = + ({ + target, + src, + plugins = [], + }: { + target: string + src: string + plugins?: (() => Promise)[] + }) => + async (includes: string, srcDir = src) => { + await vi.advanceTimersByTimeAsync(1000) + return Promise.all([ + ...plugins.map((p) => p()), + fs.copy(srcDir, target, { + recursive: true, + overwrite: true, + filter: (f) => { + if (fs.lstatSync(f).isDirectory()) return true + const base = basename(f) + return base.endsWith(includes) + }, + }), + ]) + } diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-dynamic-content-script-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-dynamic-content-script-hmr/vite-serve.test.ts index e3fb0cf8c..cc7fdf059 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-dynamic-content-script-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-dynamic-content-script-hmr/vite-serve.test.ts @@ -1,56 +1,48 @@ import fs from 'fs-extra' import path from 'path' import { expect, test } from 'vitest' -import { waitForInnerHtml } from '../helpers' +import { createUpdate, waitForInnerHtml } from '../helpers' import { serve } from '../runners' import { header } from './src2/header' -test('crx page update on hmr', async () => { - const src = path.join(__dirname, 'src') - const src1 = path.join(__dirname, 'src1') - const src2 = path.join(__dirname, 'src2') - - await fs.remove(src) - await fs.copy(src1, src, { recursive: true }) - - const { browser, routes } = await serve(__dirname) - - const page = await browser.newPage() - await page.goto('https://example.com') - - const app = page.locator('#app') - await app.waitFor() - - const styles = page.locator('head style') - - // page reloads aren't reliable in CI, tracking route hits - let reloads = 0 - routes.subscribe(() => { - reloads++ - }) - - // update css file -> trigger css update - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('css') - }, - }) - - await waitForInnerHtml(styles, (h) => h.includes('background-color: red;')) - expect(reloads).toBe(0) // no reload on css update - - // update header.ts file -> trigger full reload - await fs.copy(src2, src, { - recursive: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('header.ts') - }, - }) - - await page.locator('h1', { hasText: header }).waitFor() - expect(reloads).toBeGreaterThanOrEqual(1) // full reload on jsx update -}) +test( + 'crx page update on hmr', + async () => { + const src = path.join(__dirname, 'src') + const src1 = path.join(__dirname, 'src1') + const src2 = path.join(__dirname, 'src2') + + await fs.remove(src) + await fs.copy(src1, src, { recursive: true }) + + const { browser, routes } = await serve(__dirname) + + const page = await browser.newPage() + const update = createUpdate({ target: src, src: src2 }) + await page.goto('https://example.com') + + const app = page.locator('#app') + await app.waitFor() + + const styles = page.locator('head style') + + // page reloads aren't reliable in CI, tracking route hits + let reloads = 0 + routes.subscribe(() => { + reloads++ + }) + + // update css file -> trigger css update + await update('css') + + await waitForInnerHtml(styles, (h) => h.includes('background-color: red;')) + expect(reloads).toBe(0) // no reload on css update + + // update header.ts file -> trigger full reload + await update('header.ts') + + await page.locator('h1', { hasText: header }).waitFor() + expect(reloads).toBeGreaterThanOrEqual(1) // full reload on jsx update + }, + { retry: 2 }, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-hmr/vite-serve.test.ts index e8a015c84..82a5f0194 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-hmr/vite-serve.test.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import path from 'path' import { expect, test } from 'vitest' -import { waitForInnerHtml } from '../helpers' +import { createUpdate, waitForInnerHtml } from '../helpers' import { serve } from '../runners' test( @@ -16,6 +16,8 @@ test( const { browser } = await serve(__dirname) const page = await browser.newPage() + const update = createUpdate({ target: src, src: src2 }) + await page.goto('https://example.com') const app = page.locator('.App') @@ -36,27 +38,14 @@ test( }) // update css files - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('css') - }, - }) + await update('css') await waitForInnerHtml(styles, (h) => h.includes('background-color: red;')) expect(reloaded).toBe(false) // no reload on css update buttonText.add(await button.innerText()) // update jsx files - await fs.copy(src2, src, { - recursive: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('jsx') - }, - }) + await update('jsx') await page.locator('p', { hasText: 'Hello Vite + React + CRX!' }).waitFor() expect(reloaded).toBe(false) // no reload on jsx update diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/manifest.json b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/manifest.json new file mode 100644 index 000000000..b2e96d5bd --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/manifest.json @@ -0,0 +1,12 @@ +{ + "description": "test extension", + "manifest_version": 3, + "name": "test extension", + "content_scripts": [ + { + "matches": ["https://example.com/*"], + "js": ["src/main.jsx"] + } + ], + "version": "1.0.0" +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/A.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/A.jsx new file mode 100644 index 000000000..6d2903448 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/A.jsx @@ -0,0 +1,8 @@ +import { C } from './C' + +export const A = () => ( +
+

a-0

+ +
+) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/App.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/App.jsx new file mode 100644 index 000000000..d37d80c9b --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/App.jsx @@ -0,0 +1,13 @@ +import { A } from './A' +import { B } from './B' + +function App() { + return ( + + ) +} + +export default App diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/B.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/B.jsx new file mode 100644 index 000000000..359567759 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/B.jsx @@ -0,0 +1,8 @@ +import { C } from './C' + +export const B = () => ( +
+

b-0

+ +
+) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/C.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/C.jsx new file mode 100644 index 000000000..4f0b7ae3e --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/C.jsx @@ -0,0 +1,17 @@ +import { useEffect, useState } from 'react' +import { BehaviorSubject } from 'rxjs' + +const count$ = new BehaviorSubject(0) + +export const C = () => { + const [count, setCount] = useState(0) + useEffect(() => { + count$.subscribe(setCount) + }) + + return ( + + ) +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/main.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/main.jsx new file mode 100644 index 000000000..a5a934bdc --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src1/main.jsx @@ -0,0 +1,14 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' + +const root = document.createElement('div') +root.id = 'root' +document.body.appendChild(root) + +ReactDOM.render( + + + , + root, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/A.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/A.jsx new file mode 100644 index 000000000..f56697a81 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/A.jsx @@ -0,0 +1,8 @@ +import { C } from './C' + +export const A = () => ( +
+

a-1

+ +
+) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/B.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/B.jsx new file mode 100644 index 000000000..3636e10f5 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/B.jsx @@ -0,0 +1,8 @@ +import { C } from './C' + +export const B = () => ( +
+

b-1

+ +
+) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/C.jsx b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/C.jsx new file mode 100644 index 000000000..3c97a58c9 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/src2/C.jsx @@ -0,0 +1,17 @@ +import { useEffect, useState } from 'react' +import { BehaviorSubject } from 'rxjs' + +const count$ = new BehaviorSubject(0) + +export const C = () => { + const [count, setCount] = useState(0) + useEffect(() => { + count$.subscribe(setCount) + }) + + return ( + + ) +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite-serve.test.ts new file mode 100644 index 000000000..6aa955b06 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite-serve.test.ts @@ -0,0 +1,133 @@ +import fs from 'fs-extra' +import path from 'path' +import { expect, test } from 'vitest' +import { createUpdate } from '../helpers' +import { serve } from '../runners' + +test('crx page update on hmr', async () => { + const src = path.join(__dirname, 'src') + const src1 = path.join(__dirname, 'src1') + const src2 = path.join(__dirname, 'src2') + + await fs.remove(src) + await fs.copy(src1, src, { recursive: true }) + + const { browser } = await serve(__dirname) + const page = await browser.newPage() + const update = createUpdate({ + target: src, + src: src2, + }) + + const waitForText = (text: string) => + page.waitForFunction( + (text: string) => { + const app = document.querySelector('#app') + return app?.textContent?.includes(text) + }, + text, + { timeout: 1000 }, + ) + + const root = page.locator('#root') + const app = root.locator('#app') + const a = app.locator('.A') + const b = app.locator('.B') + const c1 = app.locator('.A + .C') + const c2 = app.locator('.B + .C') + + { + // load page for the first time + await page.goto('https://example.com') + await root.waitFor() + await app.waitFor() + await a.waitFor() + await b.waitFor() + await c1.waitFor() + await c2.waitFor() + + expect(await a.textContent()).toMatch('a-0') + expect(await b.textContent()).toMatch('b-0') + expect(await c1.textContent()).toMatch('c-0-0') + expect(await c2.textContent()).toMatch('c-0-0') + } + + { + await c1.click() + await waitForText('c-0-1') + + expect(await c1.textContent()).toMatch('c-0-1') + expect(await c2.textContent()).toMatch('c-0-1') + } + + { + // update c1.jsx -> simple update + await update('C.jsx') + await waitForText('c-1') + + expect(await a.textContent()).toMatch('a-0') + expect(await b.textContent()).toMatch('b-0') + expect(await c1.textContent()).toMatch('c-1-0') + expect(await c2.textContent()).toMatch('c-1-0') + } + + { + await c1.click() + await waitForText('c-1-1') + + expect(await c1.textContent()).toMatch('c-1-1') + expect(await c2.textContent()).toMatch('c-1-1') + } + + { + // update c1.jsx -> simple update + await update('A.jsx') + await waitForText('a-1') + + expect(await a.textContent()).toMatch('a-1') + expect(await b.textContent()).toMatch('b-0') + expect(await c1.textContent()).toMatch('c-1-1') + expect(await c2.textContent()).toMatch('c-1-1') + } + + { + // update c1.jsx -> simple update + await update('B.jsx') + await waitForText('b-1') + + expect(await a.textContent()).toMatch('a-1') + expect(await b.textContent()).toMatch('b-1') + expect(await c1.textContent()).toMatch('c-1-1') + expect(await c2.textContent()).toMatch('c-1-1') + } + + { + // update C.jsx -> revert C + await update('C.jsx', src1) + await waitForText('c-0') + + expect(await a.textContent()).toMatch('a-1') + expect(await b.textContent()).toMatch('b-1') + expect(await c1.textContent()).toMatch('c-0-0') + expect(await c2.textContent()).toMatch('c-0-0') + } + + { + await c1.click() + await waitForText('c-0-1') + + expect(await c1.textContent()).toMatch('c-0-1') + expect(await c2.textContent()).toMatch('c-0-1') + } + + { + // update B.jsx -> revert B + await update('B.jsx', src1) + await waitForText('b-0') + + expect(await a.textContent()).toMatch('a-1') + expect(await b.textContent()).toMatch('b-0') + expect(await c1.textContent()).toMatch('c-0-1') + expect(await c2.textContent()).toMatch('c-0-1') + } +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite.config.ts b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite.config.ts new file mode 100644 index 000000000..50bd92d77 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-content-script-seq-hmr/vite.config.ts @@ -0,0 +1,15 @@ +import react from '@vitejs/plugin-react' +import { crx, defineManifest } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' +import _manifest from './manifest.json' + +const { preambleCode } = react + +const manifest = defineManifest(_manifest) + +export default defineConfig({ + build: { minify: false }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest, contentScripts: { preambleCode } }), react()], +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-react-page-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-react-page-hmr/vite-serve.test.ts index 3d0dc955d..8aa7286da 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-react-page-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-react-page-hmr/vite-serve.test.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import path from 'path' import { expect, test } from 'vitest' -import { getPage, waitForInnerHtml } from '../helpers' +import { createUpdate, getPage, waitForInnerHtml } from '../helpers' import { serve } from '../runners' test( @@ -16,6 +16,7 @@ test( const { browser } = await serve(__dirname) const page = await getPage(browser, 'chrome-extension') + const update = createUpdate({ target: src, src: src2 }) await page.waitForLoadState() @@ -34,27 +35,14 @@ test( }) // update css files - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('css') - }, - }) + await update('css') await waitForInnerHtml(styles, (h) => h.includes('border: solid red;')) expect(reloaded).toBe(false) // no reload on css update buttonText.add(await button.innerText()) // update jsx files - await fs.copy(src2, src, { - recursive: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('jsx') - }, - }) + await update('jsx') await page.locator('p', { hasText: 'Hello Vite + React + CRX!' }).waitFor() expect(reloaded).toBe(false) // no reload on jsx update diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script-hmr/vite-serve.test.ts index d9f3ddabf..5c3d146e7 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script-hmr/vite-serve.test.ts @@ -1,6 +1,6 @@ import fs from 'fs-extra' import path from 'path' -import { waitForInnerHtml } from '../helpers' +import { createUpdate, waitForInnerHtml } from '../helpers' import { serve } from '../runners' import { test, expect } from 'vitest' @@ -15,12 +15,13 @@ test('crx page update on hmr', async () => { const { browser } = await serve(__dirname) const page = await browser.newPage() - await page.goto('https://www.google.com') + const update = createUpdate({ target: src, src: src2 }) const styles = page.locator('head style') const app = page.locator('#crx-app') const button = app.locator('button') + await page.goto('https://www.google.com') await app.waitFor() // check that page does not update during hmr update @@ -35,14 +36,7 @@ test('crx page update on hmr', async () => { buttonText.add(await button.innerText()) // update template - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('App.svelte') - }, - }) + await update('App.svelte') await page .locator('p', { hasText: 'Make a Chrome Extension with Svelte and Vite!' }) @@ -54,14 +48,7 @@ test('crx page update on hmr', async () => { await new Promise((r) => setTimeout(r, 100)) // update css - await fs.copy(src3, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('App.svelte') - }, - }) + await update('App.svelte', src3) await waitForInnerHtml(styles, (h) => { return h.includes('background-color:blue;') diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script/vite-build.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script/vite-build.test.ts index 941151744..f8ea01372 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script/vite-build.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-content-script/vite-build.test.ts @@ -2,15 +2,19 @@ import { build } from '../runners' import { test, expect } from 'vitest' import { getCustomId } from '../helpers' -test('crx runs from build output', async (ctx) => { - const { browser } = await build(__dirname) - const page = await browser.newPage() - await page.goto('http://www.google.com') +test( + 'crx runs from build output', + async (ctx) => { + const { browser } = await build(__dirname) + const page = await browser.newPage() + await page.goto('http://www.google.com') - const app = page.locator('#crx-app') - await app.locator('img').waitFor() + const app = page.locator('#crx-app') + await app.locator('img').waitFor() - expect(await app.screenshot()).toMatchImageSnapshot({ - customSnapshotIdentifier: getCustomId(ctx), - }) -}) + expect(await app.screenshot()).toMatchImageSnapshot({ + customSnapshotIdentifier: getCustomId(ctx), + }) + }, + { retry: 2 }, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page-hmr/vite-serve.test.ts index 9974ba3c7..c668f23ab 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page-hmr/vite-serve.test.ts @@ -1,6 +1,6 @@ import fs from 'fs-extra' import path from 'path' -import { getPage, waitForInnerHtml } from '../helpers' +import { createUpdate, getPage, waitForInnerHtml } from '../helpers' import { serve } from '../runners' import { test, expect } from 'vitest' @@ -17,6 +17,7 @@ test.skip('crx page update on hmr', async () => { const { browser } = await serve(__dirname) const page = await getPage(browser, 'chrome-extension') + const update = createUpdate({ target: src, src: src2 }) await page.waitForLoadState() @@ -29,14 +30,7 @@ test.skip('crx page update on hmr', async () => { }) // update template - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('App.svelte') - }, - }) + await update('App.svelte') await page .locator('h1', { hasText: 'Hello Vite + Svelte + CRXJS!' }) @@ -47,14 +41,7 @@ test.skip('crx page update on hmr', async () => { await new Promise((r) => setTimeout(r, 100)) // update css - await fs.copy(src3, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('App.svelte') - }, - }) + await update('App.svelte', src3) await waitForInnerHtml(styles, (h) => h.includes('color:blue;')) expect(reloaded).toBe(false) // no reload on css update diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-build.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-build.test.ts index fd5065769..af8b97946 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-build.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-build.test.ts @@ -2,14 +2,18 @@ import { getCustomId, getPage } from '../helpers' import { build } from '../runners' import { test, expect } from 'vitest' -test('crx runs from build output', async (ctx) => { - const { browser } = await build(__dirname) - const page = await getPage(browser, 'chrome-extension') +test( + 'crx runs from build output', + async (ctx) => { + const { browser } = await build(__dirname) + const page = await getPage(browser, 'chrome-extension') - const app = page.locator('#app') - await app.locator('img').waitFor() + const app = page.locator('#app') + await app.locator('img').waitFor() - expect(await app.screenshot()).toMatchImageSnapshot({ - customSnapshotIdentifier: getCustomId(ctx), - }) -}) + expect(await app.screenshot()).toMatchImageSnapshot({ + customSnapshotIdentifier: getCustomId(ctx), + }) + }, + { retry: 2 }, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-serve.test.ts index 4719c7cc7..3c6b70629 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-svelte-page/vite-serve.test.ts @@ -2,14 +2,18 @@ import { getCustomId, getPage } from '../helpers' import { serve } from '../runners' import { test, expect } from 'vitest' -test('crx runs from server output', async (ctx) => { - const { browser } = await serve(__dirname) - const page = await getPage(browser, 'chrome-extension') +test( + 'crx runs from server output', + async (ctx) => { + const { browser } = await serve(__dirname) + const page = await getPage(browser, 'chrome-extension') - const app = page.locator('#app') - await app.locator('img').waitFor() + const app = page.locator('#app') + await app.locator('img').waitFor() - expect(await app.screenshot()).toMatchImageSnapshot({ - customSnapshotIdentifier: getCustomId(ctx), - }) -}) + expect(await app.screenshot()).toMatchImageSnapshot({ + customSnapshotIdentifier: getCustomId(ctx), + }) + }, + { retry: 2 }, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-hmr/vite-serve.test.ts index 836fd2b7e..b964fb7a5 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-hmr/vite-serve.test.ts @@ -2,7 +2,7 @@ import fs from 'fs-extra' import path from 'path' import { firstValueFrom } from 'rxjs' import { expect, test } from 'vitest' -import { getPage, waitForInnerHtml } from '../helpers' +import { createUpdate, getPage, waitForInnerHtml } from '../helpers' import { serve } from '../runners' import { header } from './src2/header' @@ -18,13 +18,13 @@ test.skipIf(process.env.CI)('crx page update on hmr', async () => { const { browser, routes } = await serve(__dirname) const page = await browser.newPage() - await page.goto('https://example.com') - + const update = createUpdate({ target: src, src: src2 }) const app = page.locator('#app') - await app.waitFor() - const styles = page.locator('head style') + await page.goto('https://example.com') + await app.waitFor() + // page reloads aren't reliable in CI, tracking route hits let reloads = 0 routes.subscribe(() => { @@ -34,27 +34,14 @@ test.skipIf(process.env.CI)('crx page update on hmr', async () => { const optionsPage = await getPage(browser, /options.html$/) // update css file -> trigger css update - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('css') - }, - }) + await update('css') await waitForInnerHtml(styles, (h) => h.includes('background-color: red;')) expect(reloads).toBe(0) // no reload on css update expect(optionsPage.isClosed()).toBe(false) // no runtime reload on css update // update header.ts file -> trigger full reload - await fs.copy(src2, src, { - recursive: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('header.ts') - }, - }) + await update('header.ts') await page.locator('h1', { hasText: header }).waitFor() expect(reloads).toBeGreaterThanOrEqual(1) // full reload on jsx update @@ -64,13 +51,7 @@ test.skipIf(process.env.CI)('crx page update on hmr', async () => { await Promise.all([ optionsPage.waitForEvent('close', { timeout: 5000 }), firstValueFrom(routes), - fs.copy(src2, src, { - recursive: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('bg-onload.ts') - }, - }), + update('bg-onload.ts'), ]) await app.waitFor() diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/root.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/root.ts new file mode 100644 index 000000000..739382071 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/root.ts @@ -0,0 +1,16 @@ +const root = document.createElement('div') +root.id = 'root' +root.addEventListener('click', () => { + chrome.runtime.sendMessage('clicked') +}) +document.body.append(root) + +let injectCount = 0 +export function onExecute({ perf }: ContentScriptAPI.ExecuteFnOptions) { + injectCount++ + root.textContent = `injected ${injectCount}x` + root.dataset.injected = injectCount.toString() + root.dataset.injectTime = perf.injectTime.toString() + root.dataset.loadTime = perf.loadTime.toString() + console.log('content script ran') +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/service-worker.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/service-worker.ts new file mode 100644 index 000000000..f0175931f --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/src/service-worker.ts @@ -0,0 +1,10 @@ +import contentScript from './root?script' + +chrome.runtime.onMessage.addListener((msg, sender) => { + chrome.scripting + .executeScript({ + target: { tabId: sender.tab!.id! }, + files: [contentScript], + }) + .then(() => console.log('injected')) +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-build.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-build.test.ts new file mode 100644 index 000000000..9717b81ae --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-build.test.ts @@ -0,0 +1,18 @@ +import { expect, test } from 'vitest' +import { build } from '../runners' + +test('content script export runs when script is injected', async () => { + const { browser } = await build(__dirname) + const page = await browser.newPage() + + const root = page.locator('#root') + + // load page for the first time + await page.goto('https://example.com') + await page.waitForSelector('#root[data-injected="1"]') + expect(await root.textContent()).toBe('injected 1x') + + await root.click() + await page.waitForSelector('#root[data-injected="2"]') + await expect(await root.textContent()).toBe('injected 2x') +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-serve.test.ts new file mode 100644 index 000000000..27bf6e164 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite-serve.test.ts @@ -0,0 +1,18 @@ +import { expect, test } from 'vitest' +import { serve } from '../runners' + +test('content script export runs when script is injected', async () => { + const { browser } = await serve(__dirname) + const page = await browser.newPage() + + const root = page.locator('#root') + + // load page for the first time + await page.goto('https://example.com') + await page.waitForSelector('#root[data-injected="1"]') + expect(await root.textContent()).toBe('injected 1x') + + await root.click() + await page.waitForSelector('#root[data-injected="2"]') + await expect(await root.textContent()).toBe('injected 2x') +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite.config.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite.config.ts new file mode 100644 index 000000000..2f0c7e61c --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-api/vite.config.ts @@ -0,0 +1,27 @@ +import { crx, defineManifest } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' + +const manifest = defineManifest({ + description: 'test extension', + manifest_version: 3, + name: 'test extension', + background: { + service_worker: 'src/service-worker.ts', + }, + content_scripts: [ + { + matches: ['https://example.com/*'], + js: ['src/root.ts'], + }, + ], + host_permissions: ['https://example.com/*'], + permissions: ['scripting', 'activeTab'], + version: '1.0.0', +}) + +export default defineConfig({ + build: { minify: false }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/a.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/a.ts new file mode 100644 index 000000000..79dd35659 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/a.ts @@ -0,0 +1,3 @@ +import { c } from './c' + +export const a = c diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/b.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/b.ts new file mode 100644 index 000000000..c54fb7892 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/b.ts @@ -0,0 +1,3 @@ +import { c } from './c' + +export const b = c diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/c.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/c.ts new file mode 100644 index 000000000..14972217c --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/c.ts @@ -0,0 +1 @@ +export const c = {} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/root.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/root.ts new file mode 100644 index 000000000..7e228ddd4 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/src/root.ts @@ -0,0 +1,9 @@ +import { a } from './a' +import { b } from './b' + +const root = new DOMParser().parseFromString( + `
${JSON.stringify(a === b)}
`, + 'text/html', +).body.firstElementChild as HTMLDivElement + +document.body.append(root) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite-serve.test.ts new file mode 100644 index 000000000..7d4cac8ff --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite-serve.test.ts @@ -0,0 +1,16 @@ +import { expect, test } from 'vitest' +import { serve } from '../runners' + +test('crx page update on hmr', async () => { + const { browser } = await serve(__dirname) + const page = await browser.newPage() + + const root = page.locator('#root') + + // load page for the first time + await page.goto('https://example.com') + await root.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('true') +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite.config.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite.config.ts new file mode 100644 index 000000000..c8fcb042c --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-module-singleton/vite.config.ts @@ -0,0 +1,22 @@ +import { crx, defineManifest } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' + +const manifest = defineManifest({ + description: 'test extension', + manifest_version: 3, + name: 'test extension', + content_scripts: [ + { + matches: ['https://example.com/*'], + js: ['src/root.ts'], + }, + ], + version: '1.0.0', +}) + +export default defineConfig({ + build: { minify: false }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/a.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/a.ts new file mode 100644 index 000000000..651a91fb9 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/a.ts @@ -0,0 +1,6 @@ +import { b, c } from './b' + +export const a = ` +

${b}

+
${JSON.stringify(c)}
+` diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/b.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/b.ts new file mode 100644 index 000000000..ad2505ebf --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/b.ts @@ -0,0 +1,9 @@ +import { c1 } from './c1' +import { c2 } from './c2' + +export const b = 'first' + +export const c = { + c1, + c2, +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c1.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c1.ts new file mode 100644 index 000000000..8bc7448c0 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c1.ts @@ -0,0 +1 @@ +export const c1 = 'c1-0' diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c2.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c2.ts new file mode 100644 index 000000000..cce769749 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/c2.ts @@ -0,0 +1 @@ +export const c2 = 'c2-0' diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/root.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/root.ts new file mode 100644 index 000000000..f1076e6e4 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src1/root.ts @@ -0,0 +1,8 @@ +import { a } from './a' + +const root = new DOMParser().parseFromString( + `
${a}
`, + 'text/html', +).body.firstElementChild as HTMLDivElement + +document.body.append(root) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/a.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/a.ts new file mode 100644 index 000000000..7c7cc6f25 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/a.ts @@ -0,0 +1,6 @@ +import { b, c } from './b' + +export const a = ` +

${b}

+
${JSON.stringify(c)}
+` diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/b.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/b.ts new file mode 100644 index 000000000..5310854c5 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/b.ts @@ -0,0 +1,9 @@ +import { c1 } from './c1' +import { c2 } from './c2' + +export const b = 'second' + +export const c = { + c1, + c2, +} diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c1.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c1.ts new file mode 100644 index 000000000..598f53694 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c1.ts @@ -0,0 +1 @@ +export const c1 = 'c1-1' diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c2.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c2.ts new file mode 100644 index 000000000..d2bb88c86 --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/c2.ts @@ -0,0 +1 @@ +export const c2 = 'c2-1' diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/root.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/root.ts new file mode 100644 index 000000000..e5a448aba --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/src2/root.ts @@ -0,0 +1,10 @@ +import { a } from './a' + +console.log('updated root') + +const root = new DOMParser().parseFromString( + `
${a}
`, + 'text/html', +).body.firstElementChild as HTMLDivElement + +document.body.append(root) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite-serve.test.ts new file mode 100644 index 000000000..076efc08e --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite-serve.test.ts @@ -0,0 +1,113 @@ +import fs from 'fs-extra' +import path from 'path' +import { expect, test } from 'vitest' +import { createUpdate } from '../helpers' +import { serve } from '../runners' + +test('crx page update on hmr', async () => { + const src = path.join(__dirname, 'src') + const src1 = path.join(__dirname, 'src1') + const src2 = path.join(__dirname, 'src2') + + await fs.remove(src) + await fs.copy(src1, src, { recursive: true }) + + const { browser } = await serve(__dirname) + const page = await browser.newPage() + const update = createUpdate({ + target: src, + src: src2, + plugins: [ + async () => { + await page.waitForEvent('load') + }, + ], + }) + + const root = page.locator('#root') + const h1 = root.locator('h1') + const h2 = root.locator('h2') + + { + // load page for the first time + await page.goto('https://example.com') + await root.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-0') + expect(text).toMatch('c2-0') + } + + { + // update c1.ts -> simple update + await update('c1.ts') + await root.waitFor({ timeout: 100 }) + await h1.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-0') + } + + { + // update root file -> update w/ timestamp + await update('root.ts') + await root.waitFor({ timeout: 100 }) + await h1.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-0') + } + + { + // update a.ts -> simple update + await update('a.ts') + await root.waitFor({ timeout: 100 }) + await h2.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-0') + } + + { + // revert root file -> update w/ timestamp + await update('root.ts', src1) + await root.waitFor({ timeout: 100 }) + await h2.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-0') + } + + { + // revert a.ts file -> simple update + await update('a.ts', src1) + await root.waitFor({ timeout: 100 }) + await h1.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-0') + } + + { + // update c2.ts file -> simple update + await update('c2.ts') + await root.waitFor({ timeout: 100 }) + await h1.waitFor({ timeout: 100 }) + + const text = await root.textContent() + expect(text).toMatch('first') + expect(text).toMatch('c1-1') + expect(text).toMatch('c2-1') + } +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite.config.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite.config.ts new file mode 100644 index 000000000..c8fcb042c --- /dev/null +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vanilla-content-script-seq-hmr/vite.config.ts @@ -0,0 +1,22 @@ +import { crx, defineManifest } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' + +const manifest = defineManifest({ + description: 'test extension', + manifest_version: 3, + name: 'test extension', + content_scripts: [ + { + matches: ['https://example.com/*'], + js: ['src/root.ts'], + }, + ], + version: '1.0.0', +}) + +export default defineConfig({ + build: { minify: false }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vue-content-script-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vue-content-script-hmr/vite-serve.test.ts index 4e71cd9d9..421c133f6 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-vue-content-script-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vue-content-script-hmr/vite-serve.test.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import path from 'path' import { expect, test } from 'vitest' -import { waitForInnerHtml } from '../helpers' +import { createUpdate, waitForInnerHtml } from '../helpers' import { serve } from '../runners' test( @@ -17,12 +17,13 @@ test( const { browser } = await serve(__dirname) const page = await browser.newPage() - await page.goto('https://example.com') + const update = createUpdate({ target: src, src: src2 }) const styles = page.locator('head style') const app = page.locator('#app') const button = app.locator('button') + await page.goto('https://example.com') await app.waitFor() // check that page does not update during hmr update @@ -37,14 +38,7 @@ test( buttonText.add(await button.innerText()) // update template - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('vue') - }, - }) + await update('vue') await page .locator('p', { hasText: 'Make a Chrome Extension with Vite!' }) @@ -56,14 +50,7 @@ test( await new Promise((r) => setTimeout(r, 100)) // update css - await fs.copy(src3, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('vue') - }, - }) + await update('vue', src3) await waitForInnerHtml(styles, (h) => { return h.includes('background-color: red;') diff --git a/packages/vite-plugin/tests/e2e/mv3-vite-vue-page-hmr/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-vite-vue-page-hmr/vite-serve.test.ts index 5b876990a..bb50f8b4d 100644 --- a/packages/vite-plugin/tests/e2e/mv3-vite-vue-page-hmr/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-vite-vue-page-hmr/vite-serve.test.ts @@ -1,7 +1,7 @@ import fs from 'fs-extra' import path from 'path' import { expect, test } from 'vitest' -import { getPage, waitForInnerHtml } from '../helpers' +import { createUpdate, getPage, waitForInnerHtml } from '../helpers' import { serve } from '../runners' test( @@ -17,14 +17,12 @@ test( const { browser } = await serve(__dirname) const page = await getPage(browser, 'chrome-extension') - - await page.waitForLoadState() - + const update = createUpdate({ target: src, src: src2 }) const styles = page.locator('head style') const button = page.locator('button') - const buttonText = new Set() + await page.waitForLoadState() await button.click() buttonText.add(await button.innerText()) @@ -35,14 +33,7 @@ test( }) // update template - await fs.copy(src2, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('vue') - }, - }) + await update('vue') await page.locator('h1', { hasText: 'Hello Vue 3 + Vite + CRX' }).waitFor() expect(reloaded).toBe(false) // no reload on template update @@ -52,14 +43,7 @@ test( await new Promise((r) => setTimeout(r, 100)) // update css - await fs.copy(src3, src, { - recursive: true, - overwrite: true, - filter: (f) => { - if (fs.lstatSync(f).isDirectory()) return true - return f.endsWith('vue') - }, - }) + await update('vue', src3) await waitForInnerHtml(styles, (h) => h.includes('background: red;')) expect(reloaded).toBe(false) // no reload on css update diff --git a/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-build.test.ts b/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-build.test.ts index 8217f60cf..d28e4237c 100644 --- a/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-build.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-build.test.ts @@ -1,16 +1,20 @@ import { test } from 'vitest' import { build } from '../runners' -test('crx runs from build output', async () => { - const { browser } = await build(__dirname) - const page = await browser.newPage() - const container = page.locator('div.container') - const font = container.locator('.tags.font') - const image = container.locator('.tags.image') - const script = container.locator('.tags.script') +test( + 'crx runs from build output', + async () => { + const { browser } = await build(__dirname) + const page = await browser.newPage() + const container = page.locator('div.container') + const font = container.locator('.tags.font') + const image = container.locator('.tags.image') + const script = container.locator('.tags.script') - await page.goto('https://example.com') - await font.waitFor({ state: 'attached' }) - await image.waitFor({ state: 'attached' }) - await script.waitFor({ state: 'attached' }) -}) + await page.goto('https://example.com') + await font.waitFor({ state: 'attached' }) + await image.waitFor({ state: 'attached' }) + await script.waitFor({ state: 'attached' }) + }, + { retry: 2 }, +) diff --git a/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-serve.test.ts b/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-serve.test.ts index 396fcedc8..381623f12 100644 --- a/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-serve.test.ts +++ b/packages/vite-plugin/tests/e2e/mv3-web-accessible-resources/vite-serve.test.ts @@ -16,5 +16,5 @@ test( await image.waitFor({ state: 'attached' }) await script.waitFor({ state: 'attached' }) }, - { retry: process.env.CI ? 5 : 0 }, + { retry: process.env.CI ? 5 : 2 }, ) diff --git a/packages/vite-plugin/tests/e2e/runners.ts b/packages/vite-plugin/tests/e2e/runners.ts index f766d3fea..db39d2b9e 100644 --- a/packages/vite-plugin/tests/e2e/runners.ts +++ b/packages/vite-plugin/tests/e2e/runners.ts @@ -6,6 +6,16 @@ import { ViteDevServer } from 'vite' import { afterAll } from 'vitest' import { build as _build, serve as _serve } from '../runners' +const chromiumArgs = (outDir: string) => { + const args = [ + `--disable-extensions-except=${outDir}`, + `--load-extension=${outDir}`, + ] + // run headless if not in debug mode + if (typeof process.env.DEBUG === 'undefined') args.unshift(`--headless=new`) + return args +} + let browser: ChromiumBrowserContext | undefined let server: ViteDevServer | undefined @@ -21,10 +31,7 @@ export async function build(dirname: string) { browser = (await chromium.launchPersistentContext(dataDir, { headless: false, slowMo: 100, - args: [ - `--disable-extensions-except=${outDir}`, - `--load-extension=${outDir}`, - ], + args: chromiumArgs(outDir), })) as ChromiumBrowserContext await browser.route('https://example.com', (route) => { @@ -46,10 +53,7 @@ export async function serve(dirname: string) { browser = (await chromium.launchPersistentContext(dataDir, { headless: false, slowMo: 100, - args: [ - `--disable-extensions-except=${outDir}`, - `--load-extension=${outDir}`, - ], + args: chromiumArgs(outDir), })) as ChromiumBrowserContext const routes = new Subject() diff --git a/packages/vite-plugin/tests/out/basic-js/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/basic-js/__snapshots__/build.test.ts.snap index 7350c6b1c..9e4296cc5 100644 --- a/packages/vite-plugin/tests/out/basic-js/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/basic-js/__snapshots__/build.test.ts.snap @@ -69,11 +69,13 @@ exports[`build fs output > assets/content.js-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.js.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/basic-js/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/basic-js/__snapshots__/serve.test.ts.snap index eee6eb9bc..3bd85dc5c 100644 --- a/packages/vite-plugin/tests/out/basic-js/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/basic-js/__snapshots__/serve.test.ts.snap @@ -87,6 +87,7 @@ exports[`serve fs output > src/content.js-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -97,10 +98,11 @@ exports[`serve fs output > src/content.js-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.js.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/basic-ts/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/basic-ts/__snapshots__/build.test.ts.snap index bf9cc5491..03d9ba549 100644 --- a/packages/vite-plugin/tests/out/basic-ts/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/basic-ts/__snapshots__/build.test.ts.snap @@ -66,11 +66,13 @@ exports[`build fs output > assets/content.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/basic-ts/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/basic-ts/__snapshots__/serve.test.ts.snap index 5baa82fdd..ea2999ad5 100644 --- a/packages/vite-plugin/tests/out/basic-ts/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/basic-ts/__snapshots__/serve.test.ts.snap @@ -85,6 +85,7 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -95,10 +96,11 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/build.test.ts.snap new file mode 100644 index 000000000..a49c1e287 --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/build.test.ts.snap @@ -0,0 +1,72 @@ +// Vitest Snapshot v1 + +exports[`build fs output > _00 manifest.json 1`] = ` +Object { + "content_scripts": Array [ + Object { + "js": Array [ + "assets/content.js-loader.hash0.js", + ], + "matches": Array [ + "https://a.com/*", + "http://b.com/*", + ], + }, + ], + "description": "test extension", + "host_permissions": Array [ + "https://c.com/*", + ], + "manifest_version": 3, + "name": "Test Extension", + "version": "1.0.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "http://b.com/*", + "https://a.com/*", + ], + "resources": Array [ + "assets/content.js.hash1.js", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`build fs output > _01 output files 1`] = ` +Array [ + "assets/content.js-loader.hash0.js", + "assets/content.js.hash1.js", + "manifest.json", +] +`; + +exports[`build fs output > assets/content.js.hash1.js 1`] = ` +"console.log(\\"content script\\"); +function onExecute() { + console.log(\\"onExecute\\"); +} +export { + onExecute +}; +" +`; + +exports[`build fs output > assets/content.js-loader.hash0.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"assets/content.js.hash1.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; diff --git a/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/serve.test.ts.snap new file mode 100644 index 000000000..8e77e6a6e --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/__snapshots__/serve.test.ts.snap @@ -0,0 +1,99 @@ +// Vitest Snapshot v1 + +exports[`serve fs output > _00 manifest.json 1`] = ` +Object { + "background": Object { + "service_worker": "service-worker-loader.js", + "type": "module", + }, + "content_scripts": Array [ + Object { + "js": Array [ + "src/content.js-loader.js", + ], + "matches": Array [ + "https://a.com/*", + "http://b.com/*", + ], + }, + ], + "description": "test extension", + "host_permissions": Array [ + "https://c.com/*", + ], + "manifest_version": 3, + "name": "Test Extension", + "version": "1.0.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "", + ], + "resources": Array [ + "*", + "**/*", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`serve fs output > _01 output files 1`] = ` +Array [ + "manifest.json", + "service-worker-loader.js", + "src/content.js-loader.js", + "src/content.js.js", + "vendor/crx-client-port.js", + "vendor/vite-client.js", + "vendor/vite-dist-client-env.mjs.js", + "vendor/webcomponents-custom-elements.js", +] +`; + +exports[`serve fs output > _02 optimized deps 1`] = ` +Set { + "src/content.js", +} +`; + +exports[`serve fs output > service-worker-loader.js 1`] = ` +"import 'http://localhost:3000/@vite/env'; +import 'http://localhost:3000/@crx/client-worker'; +" +`; + +exports[`serve fs output > src/content.js.js 1`] = ` +"console.log('content script') +export function onExecute() { + console.log('onExecute') +} +" +`; + +exports[`serve fs output > src/content.js-loader.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + if (\\"\\") + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"\\") + ); + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"vendor/vite-client.js\\") + ); + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"src/content.js.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; diff --git a/packages/vite-plugin/tests/out/content-script-module-api/build.test.ts b/packages/vite-plugin/tests/out/content-script-module-api/build.test.ts new file mode 100644 index 000000000..84bcc380a --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/build.test.ts @@ -0,0 +1,8 @@ +import { build } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { test } from 'vitest' + +test('build fs output', async () => { + const result = await build(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/content-script-module-api/manifest.json b/packages/vite-plugin/tests/out/content-script-module-api/manifest.json new file mode 100644 index 000000000..e2bc1334a --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/manifest.json @@ -0,0 +1,13 @@ +{ + "content_scripts": [ + { + "js": ["src/content.js"], + "matches": ["https://a.com/*", "http://b.com/*"] + } + ], + "description": "test extension", + "host_permissions": ["https://c.com/*"], + "manifest_version": 3, + "name": "Test Extension", + "version": "1.0.0" +} diff --git a/packages/vite-plugin/tests/out/content-script-module-api/serve.test.ts b/packages/vite-plugin/tests/out/content-script-module-api/serve.test.ts new file mode 100644 index 000000000..394772d33 --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/serve.test.ts @@ -0,0 +1,16 @@ +import { serve } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { afterAll, test } from 'vitest' + +let result: Awaited> | undefined + +afterAll(async () => { + try { + await result?.server.close() + } catch (error) {} +}) + +test('serve fs output', async () => { + result = await serve(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/content-script-module-api/src/content.js b/packages/vite-plugin/tests/out/content-script-module-api/src/content.js new file mode 100644 index 000000000..3946c8db2 --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/src/content.js @@ -0,0 +1,4 @@ +console.log('content script') +export function onExecute() { + console.log('onExecute') +} diff --git a/packages/vite-plugin/tests/out/content-script-module-api/vite.config.ts b/packages/vite-plugin/tests/out/content-script-module-api/vite.config.ts new file mode 100644 index 000000000..de94678c9 --- /dev/null +++ b/packages/vite-plugin/tests/out/content-script-module-api/vite.config.ts @@ -0,0 +1,21 @@ +import { crx } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' +import manifest from './manifest.json' + +export default defineConfig({ + build: { + minify: false, + rollupOptions: { + output: { + // the hash randomly changes between environments + assetFileNames: 'assets/[name].hash[hash].[ext]', + chunkFileNames: 'assets/[name].hash[hash].js', + entryFileNames: 'assets/[name].hash[hash].js', + preserveModulesRoot: 'assets', + }, + }, + }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/build.test.ts.snap index 9b49e1faa..f62e83bf3 100644 --- a/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/build.test.ts.snap @@ -86,11 +86,13 @@ exports[`build fs output > assets/declared-script.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/declared-script.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -106,11 +108,13 @@ exports[`build fs output > assets/dynamic-script.ts-loader.hash5.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/dynamic-script.ts.hash3.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/serve.test.ts.snap index 6e6937223..bd244763a 100644 --- a/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/dynamic-script/__snapshots__/serve.test.ts.snap @@ -80,6 +80,7 @@ exports[`serve fs output > src/declared-script.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -90,10 +91,11 @@ exports[`serve fs output > src/declared-script.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/declared-script.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -110,6 +112,7 @@ exports[`serve fs output > src/dynamic-script.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -120,10 +123,11 @@ exports[`serve fs output > src/dynamic-script.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/dynamic-script.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/build.test.ts.snap index 2537180ad..bf335340b 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/build.test.ts.snap @@ -89,11 +89,13 @@ exports[`build fs output > assets/index.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/index.ts.hash5.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -104,11 +106,13 @@ exports[`build fs output > assets/index.ts-loader.hash2.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/index.ts.hash4.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/serve.test.ts.snap index 4e6a72ee7..36fc3df38 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports-2/__snapshots__/serve.test.ts.snap @@ -84,6 +84,7 @@ exports[`serve fs output > src/content1/index.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -94,10 +95,11 @@ exports[`serve fs output > src/content1/index.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content1/index.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -124,6 +126,7 @@ exports[`serve fs output > src/content2/index.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -134,10 +137,11 @@ exports[`serve fs output > src/content2/index.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content2/index.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/build.test.ts.snap index 435e75543..62164e916 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/build.test.ts.snap @@ -109,11 +109,13 @@ exports[`build fs output > assets/index.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/index.ts.hash7.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -124,11 +126,13 @@ exports[`build fs output > assets/index.ts-loader.hash3.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/index.ts.hash6.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/serve.test.ts.snap index c99b2baf6..5986de783 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports-3/__snapshots__/serve.test.ts.snap @@ -87,6 +87,7 @@ exports[`serve fs output > src/content1/index.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -97,10 +98,11 @@ exports[`serve fs output > src/content1/index.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content1/index.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -128,6 +130,7 @@ exports[`serve fs output > src/content2/index.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -138,10 +141,11 @@ exports[`serve fs output > src/content2/index.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content2/index.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/build.test.ts.snap index 9fb8ff6c3..10ff41161 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/build.test.ts.snap @@ -60,11 +60,13 @@ exports[`build fs output > assets/content.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.ts.hash2.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/serve.test.ts.snap index 15143759e..73ec9861b 100644 --- a/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-content-script-css-imports/__snapshots__/serve.test.ts.snap @@ -71,6 +71,7 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -81,10 +82,11 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/build.test.ts.snap index 4ff30ce33..a5413fb99 100644 --- a/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/build.test.ts.snap @@ -61,11 +61,13 @@ exports[`build fs output > assets/content.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/serve.test.ts.snap index ca850226c..c49d263d3 100644 --- a/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-declared-script-resources/__snapshots__/serve.test.ts.snap @@ -82,6 +82,7 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -92,10 +93,11 @@ exports[`serve fs output > src/content.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/build.test.ts.snap index c1baad2cb..94b4b4e81 100644 --- a/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/build.test.ts.snap @@ -58,11 +58,13 @@ exports[`build fs output > assets/content1.ts-loader.hash6.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content1.ts.hash0.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -78,11 +80,13 @@ exports[`build fs output > assets/content2.ts-loader.hash7.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content2.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/serve.test.ts.snap index 8c59b9de1..c6b7be06f 100644 --- a/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-dynamic-script-resources-minify/__snapshots__/serve.test.ts.snap @@ -69,6 +69,7 @@ exports[`serve fs output > src/content1.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -79,10 +80,11 @@ exports[`serve fs output > src/content1.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content1.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -99,6 +101,7 @@ exports[`serve fs output > src/content2.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -109,10 +112,11 @@ exports[`serve fs output > src/content2.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content2.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/build.test.ts.snap index d6cd28bc5..eab22e5bb 100644 --- a/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/build.test.ts.snap @@ -64,11 +64,13 @@ exports[`build fs output > assets/content1.ts-loader.hash6.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content1.ts.hash0.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -85,11 +87,13 @@ exports[`build fs output > assets/content2.ts-loader.hash7.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content2.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/serve.test.ts.snap index 8c59b9de1..c6b7be06f 100644 --- a/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-dynamic-script-resources/__snapshots__/serve.test.ts.snap @@ -69,6 +69,7 @@ exports[`serve fs output > src/content1.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -79,10 +80,11 @@ exports[`serve fs output > src/content1.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content1.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); @@ -99,6 +101,7 @@ exports[`serve fs output > src/content2.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -109,10 +112,11 @@ exports[`serve fs output > src/content2.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content2.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/build.test.ts.snap index bfa97a955..036f1d10f 100644 --- a/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/build.test.ts.snap @@ -81,11 +81,13 @@ exports[`build fs output > assets/content.tsx-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.tsx.hash2.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/serve.test.ts.snap index 0c1fd50b1..36a722be0 100644 --- a/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-react-fast-refresh/__snapshots__/serve.test.ts.snap @@ -155,6 +155,7 @@ exports[`serve fs output > src/content.tsx-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"vendor/crx-client-preamble.js\\") await import( @@ -165,10 +166,11 @@ exports[`serve fs output > src/content.tsx-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.tsx.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/build.test.ts.snap index c147be96f..1b2096d51 100644 --- a/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/build.test.ts.snap @@ -69,11 +69,13 @@ exports[`works with 'self' directive > assets/content.ts-loader.hash0.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.ts.hash1.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/serve.test.ts.snap index 77d39bb2b..5ff9277d5 100644 --- a/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-self-directive-in-csp/__snapshots__/serve.test.ts.snap @@ -88,6 +88,7 @@ exports[`works with 'self' directive > src/content.ts-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -98,10 +99,11 @@ exports[`works with 'self' directive > src/content.ts-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.ts.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/build.test.ts.snap index cf6249b0b..b357cb045 100644 --- a/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/build.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/build.test.ts.snap @@ -201,7 +201,10 @@ import \\"./vendor.hash.js\\"; const html = \`
\`; const target = new DOMParser().parseFromString(html, \\"text/html\\").body.firstElementChild; document.body.append(target); -new App$({ target }); +const app = new App$({ target }); +export { + app as default +}; " `; @@ -209,11 +212,13 @@ exports[`build fs output > assets/content.js-loader.hash.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"assets/content.js.hash.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/serve.test.ts.snap index e29df16e8..39fea1a2c 100644 --- a/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/serve.test.ts.snap +++ b/packages/vite-plugin/tests/out/vite-svelte/__snapshots__/serve.test.ts.snap @@ -293,6 +293,7 @@ exports[`serve fs output > src/content.js-loader.js 1`] = ` "(function () { 'use strict'; + const injectTime = performance.now(); (async () => { if (\\"\\") await import( @@ -303,10 +304,11 @@ exports[`serve fs output > src/content.js-loader.js 1`] = ` /* @vite-ignore */ chrome.runtime.getURL(\\"vendor/vite-client.js\\") ); - await import( + const { onExecute } = await import( /* @vite-ignore */ chrome.runtime.getURL(\\"src/content.js.js\\") ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); })().catch(console.error); })(); diff --git a/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/build.test.ts.snap new file mode 100644 index 000000000..ca1ee4881 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/build.test.ts.snap @@ -0,0 +1,318 @@ +// Vitest Snapshot v1 + +exports[`build fs output > _00 manifest.json 1`] = ` +Object { + "action": Object { + "default_popup": "index.html", + }, + "content_scripts": Array [ + Object { + "all_frames": true, + "js": Array [ + "assets/content.ts-loader.hash0.js", + ], + "matches": Array [ + "", + ], + "run_at": "document_start", + }, + ], + "manifest_version": 3, + "name": "CRXJS Vanilla JS Example", + "version": "1.0.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "", + ], + "resources": Array [ + "assets/content.ts.hash1.js", + "assets/module.hash2.js", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`build fs output > _01 output files 1`] = ` +Array [ + "assets/content.ts-loader.hash0.js", + "assets/content.ts.hash1.js", + "assets/index.hash3.css", + "assets/index.html.hash4.js", + "assets/module.hash2.js", + "assets/typescript.hash5.svg", + "index.html", + "manifest.json", + "vite.svg", +] +`; + +exports[`build fs output > assets/content.ts.hash1.js 1`] = ` +"const scriptRel = \\"modulepreload\\"; +const assetsURL = function(dep) { + return \\"/\\" + dep; +}; +const seen = {}; +const __vitePreload = function preload(baseModule, deps, importerUrl) { + if (!deps || deps.length === 0) { + return baseModule(); + } + return Promise.all(deps.map((dep) => { + dep = assetsURL(dep); + if (dep in seen) + return; + seen[dep] = true; + const isCss = dep.endsWith(\\".css\\"); + const cssSelector = isCss ? '[rel=\\"stylesheet\\"]' : \\"\\"; + if (document.querySelector(\`link[href=\\"\${dep}\\"]\${cssSelector}\`)) { + return; + } + const link = document.createElement(\\"link\\"); + link.rel = isCss ? \\"stylesheet\\" : scriptRel; + if (!isCss) { + link.as = \\"script\\"; + link.crossOrigin = \\"\\"; + } + link.href = dep; + document.head.appendChild(link); + if (isCss) { + return new Promise((res, rej) => { + link.addEventListener(\\"load\\", res); + link.addEventListener(\\"error\\", () => rej(new Error(\`Unable to preload CSS for \${dep}\`))); + }); + } + })).then(() => baseModule()); +}; +const sharedUtil = () => { + console.log(\\"util\\"); +}; +sharedUtil(); +__vitePreload(() => import(\\"./module.hash2.js\\"), true ? [] : void 0); +export { + sharedUtil as s +}; +// # sourceMappingURL=data:application/json;base64, +" +`; + +exports[`build fs output > assets/content.ts-loader.hash0.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"assets/content.ts.hash1.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; + +exports[`build fs output > assets/index.hash3.css 1`] = ` +":root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.vanilla:hover { + filter: drop-shadow(0 0 2em #3178c6aa); +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} +" +`; + +exports[`build fs output > assets/index.html.hash4.js 1`] = ` +"(function polyfill() { + const relList = document.createElement(\\"link\\").relList; + if (relList && relList.supports && relList.supports(\\"modulepreload\\")) { + return; + } + for (const link of document.querySelectorAll('link[rel=\\"modulepreload\\"]')) { + processPreload(link); + } + new MutationObserver((mutations) => { + for (const mutation of mutations) { + if (mutation.type !== \\"childList\\") { + continue; + } + for (const node of mutation.addedNodes) { + if (node.tagName === \\"LINK\\" && node.rel === \\"modulepreload\\") + processPreload(node); + } + } + }).observe(document, { childList: true, subtree: true }); + function getFetchOpts(script) { + const fetchOpts = {}; + if (script.integrity) + fetchOpts.integrity = script.integrity; + if (script.referrerpolicy) + fetchOpts.referrerPolicy = script.referrerpolicy; + if (script.crossorigin === \\"use-credentials\\") + fetchOpts.credentials = \\"include\\"; + else if (script.crossorigin === \\"anonymous\\") + fetchOpts.credentials = \\"omit\\"; + else + fetchOpts.credentials = \\"same-origin\\"; + return fetchOpts; + } + function processPreload(link) { + if (link.ep) + return; + link.ep = true; + const fetchOpts = getFetchOpts(link); + fetch(link.href, fetchOpts); + } +})(); +const style = \\"\\"; +const typescriptLogo = \\"/assets/typescript.hash5.svg\\"; +const viteLogo = \\"/vite.svg\\"; +function setupCounter(element) { + let counter = 0; + const setCounter = (count) => { + counter = count; + element.innerHTML = \`count is \${counter}\`; + }; + element.addEventListener(\\"click\\", () => setCounter(counter + 1)); + setCounter(0); +} +document.querySelector(\\"#app\\").innerHTML = \` +
+\`; +setupCounter(document.querySelector(\\"#counter\\")); +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`build fs output > assets/module.hash2.js 1`] = ` +"import { s as sharedUtil } from \\"./content.ts.hash1.js\\"; +sharedUtil(); +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`build fs output > index.html 1`] = ` +" + + + + + + Vite + TS + + + + +
+ + + +" +`; diff --git a/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/serve.test.ts.snap new file mode 100644 index 000000000..b7c6c05cc --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/__snapshots__/serve.test.ts.snap @@ -0,0 +1,149 @@ +// Vitest Snapshot v1 + +exports[`serve fs output > _00 manifest.json 1`] = ` +Object { + "action": Object { + "default_popup": "index.html", + }, + "background": Object { + "service_worker": "service-worker-loader.js", + "type": "module", + }, + "content_scripts": Array [ + Object { + "all_frames": true, + "js": Array [ + "src/content.ts-loader.js", + ], + "matches": Array [ + "", + ], + "run_at": "document_start", + }, + ], + "manifest_version": 3, + "name": "CRXJS Vanilla JS Example", + "version": "1.0.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "", + ], + "resources": Array [ + "*", + "**/*", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`serve fs output > _01 output files 1`] = ` +Array [ + "assets/precontroller.hash0.js", + "index.html", + "manifest.json", + "service-worker-loader.js", + "src/content.ts-loader.js", + "src/content.ts.js", + "src/module.ts.js", + "src/utils.ts.js", + "vendor/crx-client-port.js", + "vendor/vite-client.js", + "vendor/vite-dist-client-env.mjs.js", + "vendor/webcomponents-custom-elements.js", + "vite.svg", +] +`; + +exports[`serve fs output > _02 optimized deps 1`] = ` +Set { + "src/content.ts", + "index.html", +} +`; + +exports[`serve fs output > assets/precontroller.hash0.js 1`] = ` +"const id = setInterval(() => location.reload(), 100); +setTimeout(() => clearInterval(id), 5e3); +" +`; + +exports[`serve fs output > index.html 1`] = ` +" + + + Waiting for the extension service worker... + + + +

Waiting for service worker

+ +

+ If you see this message, it means the service worker has not loaded fully. +

+ +

This page is never added in production.

+ + +" +`; + +exports[`serve fs output > service-worker-loader.js 1`] = ` +"import 'http://localhost:3000/@vite/env'; +import 'http://localhost:3000/@crx/client-worker'; +" +`; + +exports[`serve fs output > src/content.ts.js 1`] = ` +"import { sharedUtil } from \\"/src/utils.ts.js\\"; +sharedUtil(); +import(\\"/src/module.ts.js\\"); + +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`serve fs output > src/content.ts-loader.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + if (\\"\\") + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"\\") + ); + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"vendor/vite-client.js\\") + ); + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"src/content.ts.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; + +exports[`serve fs output > src/module.ts.js 1`] = ` +"import { sharedUtil } from \\"/src/utils.ts.js\\"; +sharedUtil(); + +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`serve fs output > src/utils.ts.js 1`] = ` +"export const sharedUtil = () => { + console.log(\\"util\\"); +}; + +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; diff --git a/packages/vite-plugin/tests/out/with-circular-deps/build.test.ts b/packages/vite-plugin/tests/out/with-circular-deps/build.test.ts new file mode 100644 index 000000000..84bcc380a --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/build.test.ts @@ -0,0 +1,8 @@ +import { build } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { test } from 'vitest' + +test('build fs output', async () => { + const result = await build(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/with-circular-deps/index.html b/packages/vite-plugin/tests/out/with-circular-deps/index.html new file mode 100644 index 000000000..f86e483c9 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite + TS + + +
+ + + diff --git a/packages/vite-plugin/tests/out/with-circular-deps/manifest.json b/packages/vite-plugin/tests/out/with-circular-deps/manifest.json new file mode 100644 index 000000000..80d0c2838 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/manifest.json @@ -0,0 +1,16 @@ +{ + "manifest_version": 3, + "name": "CRXJS Vanilla JS Example", + "version": "1.0.0", + "action": { + "default_popup": "index.html" + }, + "content_scripts": [ + { + "matches": [""], + "js": ["src/content.ts"], + "run_at": "document_start", + "all_frames": true + } + ] +} \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/public/vite.svg b/packages/vite-plugin/tests/out/with-circular-deps/public/vite.svg new file mode 100644 index 000000000..e7b8dfb1b --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/serve.test.ts b/packages/vite-plugin/tests/out/with-circular-deps/serve.test.ts new file mode 100644 index 000000000..394772d33 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/serve.test.ts @@ -0,0 +1,16 @@ +import { serve } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { afterAll, test } from 'vitest' + +let result: Awaited> | undefined + +afterAll(async () => { + try { + await result?.server.close() + } catch (error) {} +}) + +test('serve fs output', async () => { + result = await serve(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/content.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/content.ts new file mode 100644 index 000000000..0753b9842 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/content.ts @@ -0,0 +1,5 @@ +import { sharedUtil } from "./utils"; + +sharedUtil(); + +import('./module'); \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/counter.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/counter.ts new file mode 100644 index 000000000..09e5afd2d --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/counter.ts @@ -0,0 +1,9 @@ +export function setupCounter(element: HTMLButtonElement) { + let counter = 0 + const setCounter = (count: number) => { + counter = count + element.innerHTML = `count is ${counter}` + } + element.addEventListener('click', () => setCounter(counter + 1)) + setCounter(0) +} diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/main.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/main.ts new file mode 100644 index 000000000..2f852a7cf --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/main.ts @@ -0,0 +1,24 @@ +import './style.css' +import typescriptLogo from './typescript.svg' +import viteLogo from '/vite.svg' +import { setupCounter } from './counter' + +document.querySelector('#app')!.innerHTML = ` +
+ + + + + + +

Vite + TypeScript

+
+ +
+

+ Click on the Vite and TypeScript logos to learn more +

+
+` + +setupCounter(document.querySelector('#counter')!) diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/module.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/module.ts new file mode 100644 index 000000000..f6ba181d9 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/module.ts @@ -0,0 +1,3 @@ +import { sharedUtil } from "./utils"; + +sharedUtil(); \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/style.css b/packages/vite-plugin/tests/out/with-circular-deps/src/style.css new file mode 100644 index 000000000..b528b6cc2 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/style.css @@ -0,0 +1,97 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #646cffaa); +} +.logo.vanilla:hover { + filter: drop-shadow(0 0 2em #3178c6aa); +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #646cff; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #747bff; + } + button { + background-color: #f9f9f9; + } +} diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/typescript.svg b/packages/vite-plugin/tests/out/with-circular-deps/src/typescript.svg new file mode 100644 index 000000000..d91c910cc --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/typescript.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/utils.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/utils.ts new file mode 100644 index 000000000..0acb614df --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/utils.ts @@ -0,0 +1,3 @@ +export const sharedUtil = () => { + console.log('util'); +}; \ No newline at end of file diff --git a/packages/vite-plugin/tests/out/with-circular-deps/src/vite-env.d.ts b/packages/vite-plugin/tests/out/with-circular-deps/src/vite-env.d.ts new file mode 100644 index 000000000..11f02fe2a --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/vite-plugin/tests/out/with-circular-deps/vite.config.ts b/packages/vite-plugin/tests/out/with-circular-deps/vite.config.ts new file mode 100644 index 000000000..17c4d0892 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-circular-deps/vite.config.ts @@ -0,0 +1,21 @@ +import { crx } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' +import manifest from './manifest.json' + +export default defineConfig({ + build: { + sourcemap: 'inline', + minify: false, + rollupOptions: { + output: { + // the hash randomly changes between environments + assetFileNames: 'assets/[name].hash[hash].[ext]', + chunkFileNames: 'assets/[name].hash[hash].js', + entryFileNames: 'assets/[name].hash[hash].js', + }, + }, + }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/build.test.ts.snap b/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/build.test.ts.snap new file mode 100644 index 000000000..3fe4c0437 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/build.test.ts.snap @@ -0,0 +1,159 @@ +// Vitest Snapshot v1 + +exports[`build fs output > _00 manifest.json 1`] = ` +Object { + "action": Object { + "default_popup": "src/popup.html", + }, + "background": Object { + "service_worker": "service-worker-loader.js", + "type": "module", + }, + "content_scripts": Array [ + Object { + "js": Array [ + "assets/content.ts-loader.hash0.js", + ], + "matches": Array [ + "https://*/*", + "http://*/*", + ], + }, + ], + "description": "test extension", + "manifest_version": 3, + "name": "test extension", + "version": "0.1.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "http://*/*", + "https://*/*", + ], + "resources": Array [ + "assets/content.ts.hash1.js", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`build fs output > _01 output files 1`] = ` +Array [ + "assets/background.ts.hash2.js", + "assets/content.ts-loader.hash0.js", + "assets/content.ts.hash1.js", + "assets/popup.html.hash3.js", + "assets/vendor.hash4.js", + "manifest.json", + "service-worker-loader.js", + "src/popup.html", +] +`; + +exports[`build fs output > assets/background.ts.hash2.js 1`] = ` +"console.log(\\"service_worker.ts\\"); +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`build fs output > assets/content.ts.hash1.js 1`] = ` +"const message = \\"content script\\"; +console.log(message); +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`build fs output > assets/content.ts-loader.hash0.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"assets/content.ts.hash1.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; + +exports[`build fs output > assets/popup.html.hash3.js 1`] = ` +"import { R as React, r as reactDom } from \\"./vendor.hash4.js\\"; +(function polyfill() { + const relList = document.createElement(\\"link\\").relList; + if (relList && relList.supports && relList.supports(\\"modulepreload\\")) { + return; + } + for (const link of document.querySelectorAll('link[rel=\\"modulepreload\\"]')) { + processPreload(link); + } + new MutationObserver((mutations) => { + for (const mutation of mutations) { + if (mutation.type !== \\"childList\\") { + continue; + } + for (const node of mutation.addedNodes) { + if (node.tagName === \\"LINK\\" && node.rel === \\"modulepreload\\") + processPreload(node); + } + } + }).observe(document, { childList: true, subtree: true }); + function getFetchOpts(script) { + const fetchOpts = {}; + if (script.integrity) + fetchOpts.integrity = script.integrity; + if (script.referrerpolicy) + fetchOpts.referrerPolicy = script.referrerpolicy; + if (script.crossorigin === \\"use-credentials\\") + fetchOpts.credentials = \\"include\\"; + else if (script.crossorigin === \\"anonymous\\") + fetchOpts.credentials = \\"omit\\"; + else + fetchOpts.credentials = \\"same-origin\\"; + return fetchOpts; + } + function processPreload(link) { + if (link.ep) + return; + link.ep = true; + const fetchOpts = getFetchOpts(link); + fetch(link.href, fetchOpts); + } +})(); +const App = () => { + return /* @__PURE__ */ React.createElement(\\"div\\", null, /* @__PURE__ */ React.createElement(\\"h1\\", null, \\"Popup Page\\"), /* @__PURE__ */ React.createElement(\\"p\\", null, \\"If you are seeing this, React is working!\\")); +}; +console.log(\\"popup script\\"); +const root = document.querySelector(\\"#root\\"); +reactDom.exports.render(/* @__PURE__ */ React.createElement(App, null), root); +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`build fs output > service-worker-loader.js 1`] = ` +"import './assets/background.ts.hash2.js'; +" +`; + +exports[`build fs output > src/popup.html 1`] = ` +" + + + + + Popup Page + + + + +
+ + + +" +`; diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/serve.test.ts.snap b/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/serve.test.ts.snap new file mode 100644 index 000000000..282e48469 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/__snapshots__/serve.test.ts.snap @@ -0,0 +1,131 @@ +// Vitest Snapshot v1 + +exports[`serve fs output > _00 manifest.json 1`] = ` +Object { + "action": Object { + "default_popup": "src/popup.html", + }, + "background": Object { + "service_worker": "service-worker-loader.js", + "type": "module", + }, + "content_scripts": Array [ + Object { + "js": Array [ + "src/content.ts-loader.js", + ], + "matches": Array [ + "https://*/*", + "http://*/*", + ], + }, + ], + "description": "test extension", + "manifest_version": 3, + "name": "test extension", + "version": "0.1.0", + "web_accessible_resources": Array [ + Object { + "matches": Array [ + "", + ], + "resources": Array [ + "*", + "**/*", + ], + "use_dynamic_url": true, + }, + ], +} +`; + +exports[`serve fs output > _01 output files 1`] = ` +Array [ + "assets/precontroller.hash0.js", + "manifest.json", + "service-worker-loader.js", + "src/content.ts-loader.js", + "src/content.ts.js", + "src/popup.html", + "vendor/crx-client-port.js", + "vendor/vite-client.js", + "vendor/vite-dist-client-env.mjs.js", + "vendor/webcomponents-custom-elements.js", +] +`; + +exports[`serve fs output > _02 optimized deps 1`] = ` +Set { + "src/content.ts", + "src/background.ts", + "src/popup.html", +} +`; + +exports[`serve fs output > assets/precontroller.hash0.js 1`] = ` +"const id = setInterval(() => location.reload(), 100); +setTimeout(() => clearInterval(id), 5e3); +" +`; + +exports[`serve fs output > service-worker-loader.js 1`] = ` +"import 'http://localhost:3000/@vite/env'; +import 'http://localhost:3000/@crx/client-worker'; +import 'http://localhost:3000/src/background.ts'; +" +`; + +exports[`serve fs output > src/content.ts.js 1`] = ` +"const message = \\"content script\\"; +console.log(message); +export {}; + +// # sourceMappingURL=data:application/json;charset=utf-8;base64, +" +`; + +exports[`serve fs output > src/content.ts-loader.js 1`] = ` +"(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + if (\\"\\") + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"\\") + ); + await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"vendor/vite-client.js\\") + ); + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL(\\"src/content.ts.js\\") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); +" +`; + +exports[`serve fs output > src/popup.html 1`] = ` +" + + + Waiting for the extension service worker... + + + +

Waiting for service worker

+ +

+ If you see this message, it means the service worker has not loaded fully. +

+ +

This page is never added in production.

+ + +" +`; diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/build.test.ts b/packages/vite-plugin/tests/out/with-sourcemaps/build.test.ts new file mode 100644 index 000000000..84bcc380a --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/build.test.ts @@ -0,0 +1,8 @@ +import { build } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { test } from 'vitest' + +test('build fs output', async () => { + const result = await build(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/manifest.json b/packages/vite-plugin/tests/out/with-sourcemaps/manifest.json new file mode 100644 index 000000000..6b8040799 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/manifest.json @@ -0,0 +1,18 @@ +{ + "action": { + "default_popup": "src/popup.html" + }, + "background": { + "service_worker": "src/background.ts" + }, + "content_scripts": [ + { + "js": ["src/content.ts"], + "matches": ["https://*/*", "http://*/*"] + } + ], + "manifest_version": 3, + "name": "test extension", + "description": "test extension", + "version": "0.1.0" +} diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/serve.test.ts b/packages/vite-plugin/tests/out/with-sourcemaps/serve.test.ts new file mode 100644 index 000000000..394772d33 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/serve.test.ts @@ -0,0 +1,16 @@ +import { serve } from 'tests/runners' +import { testOutput } from 'tests/testOutput' +import { afterAll, test } from 'vitest' + +let result: Awaited> | undefined + +afterAll(async () => { + try { + await result?.server.close() + } catch (error) {} +}) + +test('serve fs output', async () => { + result = await serve(__dirname) + await testOutput(result) +}) diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/src/App.tsx b/packages/vite-plugin/tests/out/with-sourcemaps/src/App.tsx new file mode 100644 index 000000000..73a16b5a6 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/src/App.tsx @@ -0,0 +1,12 @@ +import React from 'react' + +const App: React.FC = () => { + return ( +
+

Popup Page

+

If you are seeing this, React is working!

+
+ ) +} + +export default App diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/src/background.ts b/packages/vite-plugin/tests/out/with-sourcemaps/src/background.ts new file mode 100644 index 000000000..e7ab4dc9e --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/src/background.ts @@ -0,0 +1,3 @@ +console.log('service_worker.ts') + +export {} diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/src/content.ts b/packages/vite-plugin/tests/out/with-sourcemaps/src/content.ts new file mode 100644 index 000000000..ce92280b6 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/src/content.ts @@ -0,0 +1,4 @@ +type Log = 'content script' +const message: Log = 'content script' +console.log(message) +export {} diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.html b/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.html new file mode 100644 index 000000000..4c895110c --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.html @@ -0,0 +1,12 @@ + + + + + + Popup Page + + +
+ + + diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.tsx b/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.tsx new file mode 100644 index 000000000..f5d5e7ed1 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/src/popup.tsx @@ -0,0 +1,9 @@ +import React from 'react' +import { render } from 'react-dom' +import App from './App' + +console.log('popup script') + +const root = document.querySelector('#root') + +render(, root) diff --git a/packages/vite-plugin/tests/out/with-sourcemaps/vite.config.ts b/packages/vite-plugin/tests/out/with-sourcemaps/vite.config.ts new file mode 100644 index 000000000..17c4d0892 --- /dev/null +++ b/packages/vite-plugin/tests/out/with-sourcemaps/vite.config.ts @@ -0,0 +1,21 @@ +import { crx } from '../../plugin-testOptionsProvider' +import { defineConfig } from 'vite' +import manifest from './manifest.json' + +export default defineConfig({ + build: { + sourcemap: 'inline', + minify: false, + rollupOptions: { + output: { + // the hash randomly changes between environments + assetFileNames: 'assets/[name].hash[hash].[ext]', + chunkFileNames: 'assets/[name].hash[hash].js', + entryFileNames: 'assets/[name].hash[hash].js', + }, + }, + }, + clearScreen: false, + logLevel: 'error', + plugins: [crx({ manifest })], +}) diff --git a/packages/vite-plugin/tests/runners.ts b/packages/vite-plugin/tests/runners.ts index a3d0b8a58..115fca45d 100644 --- a/packages/vite-plugin/tests/runners.ts +++ b/packages/vite-plugin/tests/runners.ts @@ -86,7 +86,7 @@ export async function build( if (Array.isArray(output)) throw new TypeError('received outputarray from vite build') - if ('close' in output) throw new TypeError('recieved watcher from vite build') + if ('close' in output) throw new TypeError('received watcher from vite build') return { command: 'build', outDir, output, config: config! } } diff --git a/packages/vite-plugin/tests/testOutput.ts b/packages/vite-plugin/tests/testOutput.ts index dfcdea7ff..73fb60e40 100644 --- a/packages/vite-plugin/tests/testOutput.ts +++ b/packages/vite-plugin/tests/testOutput.ts @@ -65,6 +65,7 @@ export async function testOutput( return replaced }) .replace(/(v--)([a-z0-9]+)\./g, '$1hash.') + .replace(/^\/\/#(.+?base64,)(.+)$/m, '// #$1') getTest('manifest.json', (source, name) => { const scrubbed = scrubHashes(source) diff --git a/packages/vite-plugin/vitest.config.ts b/packages/vite-plugin/vitest.config.ts index 311138947..d5b698e1b 100644 --- a/packages/vite-plugin/vitest.config.ts +++ b/packages/vite-plugin/vitest.config.ts @@ -32,7 +32,13 @@ export default defineConfig(({ mode }) => { replacement: `${path.resolve(__dirname, 'tests/artifacts')}/$1.js`, }, ], - exclude: [...exclude, '**/templates/**', '**/node_modules/**'], + exclude: [ + ...exclude, + '**/templates/**', + '**/node_modules/**', + '**/dist*/**', + '**/.vite/**', + ], globalSetup: './tests/jest.globalSetup.ts', maxThreads: mode === 'e2e' ? 1 : undefined, minThreads: mode === 'e2e' ? 1 : undefined, @@ -42,6 +48,7 @@ export default defineConfig(({ mode }) => { }, testTimeout, watchExclude: [...configDefaults.watchExclude, '**/tests/templates'], + chaiConfig: { includeStack: false, showDiff: true, truncateThreshold: 0 }, }, } }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d3c9399c..9b6924f98 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,7 +7,7 @@ importers: '@changesets/cli': ^2.22.0 '@typescript-eslint/eslint-plugin': ^5.20.0 '@typescript-eslint/parser': ^5.20.0 - eslint: 8.26.0 + eslint: 8.43.0 eslint-plugin-react: ^7.29.4 npm-run-all: ^4.1.5 prettier: ^2.6.2 @@ -16,10 +16,10 @@ importers: vitest: 0.24.3 dependencies: '@changesets/cli': 2.22.0 - '@typescript-eslint/eslint-plugin': 5.23.0_si2oinfypjo5utzvexk6yv22zq - '@typescript-eslint/parser': 5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4 - eslint: 8.26.0 - eslint-plugin-react: 7.29.4_eslint@8.26.0 + '@typescript-eslint/eslint-plugin': 5.23.0_ttki4ynzteu7mlbvqnybjztyzm + '@typescript-eslint/parser': 5.23.0_uywfi3zeys2kqr4zjbjh4sypl4 + eslint: 8.43.0 + eslint-plugin-react: 7.29.4_eslint@8.43.0 npm-run-all: 4.1.5 prettier: 2.6.2 prettier-plugin-jsdoc: 0.4.2_prettier@2.6.2 @@ -45,7 +45,7 @@ importers: '@testing-library/dom': ^6.12.2 '@testing-library/jest-dom': ^5.1.1 '@types/cheerio': 0.22.22 - '@types/chrome': 0.0.209 + '@types/chrome': 0.0.237 '@types/fs-extra': ^8.0.1 '@types/glob': ^8.0.0 '@types/jest': ^27.0.0 @@ -55,7 +55,7 @@ importers: '@types/lodash.flatten': ^4.4.6 '@types/lodash.get': ^4.4.6 '@types/node': ^13.7.0 - '@types/prettier': ^1.19.0 + '@types/prettier': ^2.0.0 '@types/react': ^17.0.3 '@types/react-dom': ^17.0.3 ajv: ^8.6.2 @@ -77,7 +77,7 @@ importers: lodash: ^4.17.21 mem: ^6.0.1 npm-run-all: ^4.1.5 - playwright-chromium: 1.27.1 + playwright-chromium: 1.33.0 prettier: ^2.3.2 react: ^17.0.2 react-dom: ^17.0.2 @@ -106,7 +106,7 @@ importers: localforage: 1.10.0 lodash: 4.17.21 mem: 6.1.1 - playwright-chromium: 1.27.1 + playwright-chromium: 1.33.0 rollup: 2.72.1 slash: 3.0.0 webextension-polyfill: 0.9.0 @@ -127,7 +127,7 @@ importers: '@testing-library/dom': 6.16.0 '@testing-library/jest-dom': 5.16.4 '@types/cheerio': 0.22.22 - '@types/chrome': 0.0.209 + '@types/chrome': 0.0.237 '@types/fs-extra': 8.1.2 '@types/glob': 8.0.0 '@types/jest': 27.5.0 @@ -136,7 +136,7 @@ importers: '@types/lodash.flatten': 4.4.7 '@types/lodash.get': 4.4.7 '@types/node': 13.13.52 - '@types/prettier': 1.19.1 + '@types/prettier': 2.6.0 '@types/react': 17.0.45 '@types/react-dom': 17.0.16 jest: 27.5.1 @@ -158,14 +158,15 @@ importers: specifiers: '@extend-chrome/messages': 1.2.2 '@extend-chrome/storage': 1.5.0 - '@rollup/plugin-alias': 4.0.2 + '@rollup/plugin-alias': 4.0.4 '@rollup/plugin-commonjs': 21.1.0 '@rollup/plugin-json': ^5.0.0 '@rollup/plugin-node-resolve': 13.2.0 '@rollup/pluginutils': ^4.1.2 - '@sveltejs/vite-plugin-svelte': 1.1.0 + '@sveltejs/vite-plugin-svelte': 1.4.0 '@types/acorn': 4.0.6 - '@types/chrome': 0.0.209 + '@types/chrome': 0.0.237 + '@types/convert-source-map': ^2.0.0 '@types/debug': 4.1.7 '@types/fs-extra': 9.0.13 '@types/jest-image-snapshot': ^5.1.0 @@ -182,11 +183,12 @@ importers: cheerio: ^1.0.0-rc.10 chokidar: ^3.5.3 connect-injector: ^0.4.4 + convert-source-map: ^1.7.0 debug: ^4.3.3 es-module-lexer: ^0.10.0 - esbuild: 0.17.4 + esbuild: 0.17.14 esbuild-runner: 2.2.2 - eslint: 8.26.0 + eslint: 8.43.0 eslint-plugin-react: ^7.29.4 fast-glob: ^3.2.11 fs-extra: ^10.0.1 @@ -195,27 +197,28 @@ importers: magic-string: ^0.26.0 npm-run-all: ^4.1.5 picocolors: ^1.0.0 - playwright-chromium: 1.27.1 + playwright-chromium: 1.33.0 react: 17.0.2 react-dom: 17.0.2 react-refresh: ^0.13.0 rimraf: 3.0.2 rollup: 2.78.1 rollup-plugin-dts: ^4.2.0 - rollup-plugin-esbuild: 4.10.1 + rollup-plugin-esbuild: 4.10.3 rxjs: 7.5.7 svelte: ^3.48.0 typescript: ^4.6.4 vite: ^3.1.7 - vite-plugin-inspect: 0.7.14 - vitest: 0.24.3 - vue: 3.2.41 + vite-plugin-inspect: 0.7.25 + vitest: 0.28.5 + vue: 3.2.47 dependencies: '@rollup/pluginutils': 4.2.1 '@webcomponents/custom-elements': 1.5.0 acorn-walk: 8.2.0 cheerio: 1.0.0-rc.10 connect-injector: 0.4.4 + convert-source-map: 1.8.0 debug: 4.3.4 es-module-lexer: 0.10.5 fast-glob: 3.2.11 @@ -229,13 +232,14 @@ importers: devDependencies: '@extend-chrome/messages': 1.2.2 '@extend-chrome/storage': 1.5.0 - '@rollup/plugin-alias': 4.0.2_rollup@2.78.1 + '@rollup/plugin-alias': 4.0.4_rollup@2.78.1 '@rollup/plugin-commonjs': 21.1.0_rollup@2.78.1 '@rollup/plugin-json': 5.0.1_rollup@2.78.1 '@rollup/plugin-node-resolve': 13.2.0_rollup@2.78.1 - '@sveltejs/vite-plugin-svelte': 1.1.0_svelte@3.48.0+vite@3.1.7 + '@sveltejs/vite-plugin-svelte': 1.4.0_svelte@3.48.0+vite@3.1.7 '@types/acorn': 4.0.6 - '@types/chrome': 0.0.209 + '@types/chrome': 0.0.237 + '@types/convert-source-map': 2.0.0 '@types/debug': 4.1.7 '@types/fs-extra': 9.0.13 '@types/jest-image-snapshot': 5.1.0 @@ -243,29 +247,29 @@ importers: '@types/node': 17.0.18 '@types/react': 17.0.52 '@types/react-dom': 17.0.18 - '@typescript-eslint/eslint-plugin': 5.41.0_ffukdn5orh6tcfytlcazewwqli - '@typescript-eslint/parser': 5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/eslint-plugin': 5.41.0_jvlu6duvhd66pma4iesjjjctze + '@typescript-eslint/parser': 5.41.0_uywfi3zeys2kqr4zjbjh4sypl4 '@vitejs/plugin-react': 2.1.0_vite@3.1.7 - '@vitejs/plugin-vue': 3.2.0_vite@3.1.7+vue@3.2.41 + '@vitejs/plugin-vue': 3.2.0_vite@3.1.7+vue@3.2.47 chokidar: 3.5.3 - esbuild: 0.17.4 - esbuild-runner: 2.2.2_esbuild@0.17.4 - eslint: 8.26.0 - eslint-plugin-react: 7.29.4_eslint@8.26.0 + esbuild: 0.17.14 + esbuild-runner: 2.2.2_esbuild@0.17.14 + eslint: 8.43.0 + eslint-plugin-react: 7.29.4_eslint@8.43.0 jest-image-snapshot: 5.2.0 npm-run-all: 4.1.5 - playwright-chromium: 1.27.1 + playwright-chromium: 1.33.0 react: 17.0.2 react-dom: 17.0.2_react@17.0.2 rimraf: 3.0.2 rollup-plugin-dts: 4.2.1_jjzidkftin3enz34jsjwztw6ai - rollup-plugin-esbuild: 4.10.1_6kmmevfga3h4dux5epad7mqmyq + rollup-plugin-esbuild: 4.10.3_cko6c3u4jw6ltq7rc3stnghywi svelte: 3.48.0 typescript: 4.6.4 vite: 3.1.7 - vite-plugin-inspect: 0.7.14_rollup@2.78.1+vite@3.1.7 - vitest: 0.24.3 - vue: 3.2.41 + vite-plugin-inspect: 0.7.25_rollup@2.78.1+vite@3.1.7 + vitest: 0.28.5 + vue: 3.2.47 packages/vite-plugin-docs: specifiers: @@ -482,7 +486,7 @@ packages: '@babel/generator': 7.19.0 '@babel/helper-module-transforms': 7.19.6 '@babel/helpers': 7.19.0 - '@babel/parser': 7.19.1 + '@babel/parser': 7.20.0 '@babel/template': 7.18.10 '@babel/traverse': 7.20.0 '@babel/types': 7.20.0 @@ -572,7 +576,7 @@ packages: resolution: {integrity: sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.4 + '@babel/types': 7.20.0 dev: true /@babel/helper-annotate-as-pure/7.18.6: @@ -751,7 +755,7 @@ packages: resolution: {integrity: sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.19.0 + '@babel/types': 7.20.0 dev: true /@babel/helper-environment-visitor/7.18.9: @@ -769,7 +773,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.18.10 - '@babel/types': 7.19.0 + '@babel/types': 7.20.0 dev: true /@babel/helper-function-name/7.19.0: @@ -789,7 +793,7 @@ packages: resolution: {integrity: sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.4 + '@babel/types': 7.20.0 dev: true /@babel/helper-member-expression-to-functions/7.18.9: @@ -854,7 +858,7 @@ packages: resolution: {integrity: sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.18.4 + '@babel/types': 7.20.0 dev: true /@babel/helper-optimise-call-expression/7.18.6: @@ -914,7 +918,7 @@ packages: '@babel/helper-member-expression-to-functions': 7.17.7 '@babel/helper-optimise-call-expression': 7.16.7 '@babel/traverse': 7.17.10 - '@babel/types': 7.17.10 + '@babel/types': 7.20.0 transitivePeerDependencies: - supports-color dev: true @@ -953,7 +957,7 @@ packages: resolution: {integrity: sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.19.0 + '@babel/types': 7.20.0 dev: true /@babel/helper-split-export-declaration/7.18.6: @@ -2982,7 +2986,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.19.1 + '@babel/parser': 7.20.0 '@babel/types': 7.20.0 /@babel/traverse/7.17.10: @@ -3013,7 +3017,7 @@ packages: '@babel/helper-function-name': 7.19.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.19.1 + '@babel/parser': 7.20.0 '@babel/types': 7.20.0 debug: 4.3.4 globals: 11.12.0 @@ -3045,14 +3049,6 @@ packages: to-fast-properties: 2.0.0 dev: true - /@babel/types/7.18.4: - resolution: {integrity: sha512-ThN1mBcMq5pG/Vm2IcBmPPfyPXbd8S02rS+OBIDENdufvqC7Z/jHPCv9IcP01277aKtDI8g/2XysBN4hA8niiw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-validator-identifier': 7.19.1 - to-fast-properties: 2.0.0 - dev: true - /@babel/types/7.19.0: resolution: {integrity: sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==} engines: {node: '>=6.9.0'} @@ -3667,7 +3663,7 @@ packages: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@babel/parser': 7.19.1 + '@babel/parser': 7.20.0 '@babel/traverse': 7.19.1 '@docusaurus/logger': 2.2.0 '@docusaurus/utils': 2.2.0 @@ -3702,7 +3698,7 @@ packages: react: ^16.8.4 || ^17.0.0 react-dom: ^16.8.4 || ^17.0.0 dependencies: - '@babel/parser': 7.19.1 + '@babel/parser': 7.20.0 '@babel/traverse': 7.19.1 '@docusaurus/logger': 2.2.0 '@docusaurus/utils': 2.2.0_@docusaurus+types@2.2.0 @@ -4630,6 +4626,15 @@ packages: dev: true optional: true + /@esbuild/android-arm/0.17.14: + resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm/0.17.4: resolution: {integrity: sha512-R9GCe2xl2XDSc2XbQB63mFiFXHIVkOP+ltIxICKXqUPrFX97z6Z7vONCLQM1pSOLGqfLrGi3B7nbhxmFY/fomg==} engines: {node: '>=12'} @@ -4638,6 +4643,15 @@ packages: requiresBuild: true optional: true + /@esbuild/android-arm64/0.17.14: + resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-arm64/0.17.4: resolution: {integrity: sha512-91VwDrl4EpxBCiG6h2LZZEkuNvVZYJkv2T9gyLG/mhGG1qrM7i5SwUcg/hlSPnL/4hDT0TFcF35/XMGSn0bemg==} engines: {node: '>=12'} @@ -4646,6 +4660,15 @@ packages: requiresBuild: true optional: true + /@esbuild/android-x64/0.17.14: + resolution: {integrity: sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@esbuild/android-x64/0.17.4: resolution: {integrity: sha512-mGSqhEPL7029XL7QHNPxPs15JVa02hvZvysUcyMP9UXdGFwncl2WU0bqx+Ysgzd+WAbv8rfNa73QveOxAnAM2w==} engines: {node: '>=12'} @@ -4654,6 +4677,15 @@ packages: requiresBuild: true optional: true + /@esbuild/darwin-arm64/0.17.14: + resolution: {integrity: sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-arm64/0.17.4: resolution: {integrity: sha512-tTyJRM9dHvlMPt1KrBFVB5OW1kXOsRNvAPtbzoKazd5RhD5/wKlXk1qR2MpaZRYwf4WDMadt0Pv0GwxB41CVow==} engines: {node: '>=12'} @@ -4662,6 +4694,15 @@ packages: requiresBuild: true optional: true + /@esbuild/darwin-x64/0.17.14: + resolution: {integrity: sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@esbuild/darwin-x64/0.17.4: resolution: {integrity: sha512-phQuC2Imrb3TjOJwLN8EO50nb2FHe8Ew0OwgZDH1SV6asIPGudnwTQtighDF2EAYlXChLoMJwqjAp4vAaACq6w==} engines: {node: '>=12'} @@ -4670,6 +4711,15 @@ packages: requiresBuild: true optional: true + /@esbuild/freebsd-arm64/0.17.14: + resolution: {integrity: sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-arm64/0.17.4: resolution: {integrity: sha512-oH6JUZkocgmjzzYaP5juERLpJQSwazdjZrTPgLRmAU2bzJ688x0vfMB/WTv4r58RiecdHvXOPC46VtsMy/mepg==} engines: {node: '>=12'} @@ -4678,6 +4728,15 @@ packages: requiresBuild: true optional: true + /@esbuild/freebsd-x64/0.17.14: + resolution: {integrity: sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/freebsd-x64/0.17.4: resolution: {integrity: sha512-U4iWGn/9TrAfpAdfd56eO0pRxIgb0a8Wj9jClrhT8hvZnOnS4dfMPW7o4fn15D/KqoiVYHRm43jjBaTt3g/2KA==} engines: {node: '>=12'} @@ -4686,6 +4745,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-arm/0.17.14: + resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm/0.17.4: resolution: {integrity: sha512-S2s9xWTGMTa/fG5EyMGDeL0wrWVgOSQcNddJWgu6rG1NCSXJHs76ZP9AsxjB3f2nZow9fWOyApklIgiTGZKhiw==} engines: {node: '>=12'} @@ -4694,6 +4762,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-arm64/0.17.14: + resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-arm64/0.17.4: resolution: {integrity: sha512-UkGfQvYlwOaeYJzZG4cLV0hCASzQZnKNktRXUo3/BMZvdau40AOz9GzmGA063n1piq6VrFFh43apRDQx8hMP2w==} engines: {node: '>=12'} @@ -4702,6 +4779,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-ia32/0.17.14: + resolution: {integrity: sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ia32/0.17.4: resolution: {integrity: sha512-3lqFi4VFo/Vwvn77FZXeLd0ctolIJH/uXkH3yNgEk89Eh6D3XXAC9/iTPEzeEpsNE5IqGIsFa5Z0iPeOh25IyA==} engines: {node: '>=12'} @@ -4719,6 +4805,15 @@ packages: dev: true optional: true + /@esbuild/linux-loong64/0.17.14: + resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64/0.17.4: resolution: {integrity: sha512-HqpWZkVslDHIwdQ9D+gk7NuAulgQvRxF9no54ut/M55KEb3mi7sQS3GwpPJzSyzzP0UkjQVN7/tbk88/CaX4EQ==} engines: {node: '>=12'} @@ -4727,6 +4822,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-mips64el/0.17.14: + resolution: {integrity: sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-mips64el/0.17.4: resolution: {integrity: sha512-d/nMCKKh/SVDbqR9ju+b78vOr0tNXtfBjcp5vfHONCCOAL9ad8gN9dC/u+UnH939pz7wO+0u/x9y1MaZcb/lKA==} engines: {node: '>=12'} @@ -4735,6 +4839,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-ppc64/0.17.14: + resolution: {integrity: sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-ppc64/0.17.4: resolution: {integrity: sha512-lOD9p2dmjZcNiTU+sGe9Nn6G3aYw3k0HBJies1PU0j5IGfp6tdKOQ6mzfACRFCqXjnBuTqK7eTYpwx09O5LLfg==} engines: {node: '>=12'} @@ -4743,6 +4856,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-riscv64/0.17.14: + resolution: {integrity: sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-riscv64/0.17.4: resolution: {integrity: sha512-mTGnwWwVshAjGsd8rP+K6583cPDgxOunsqqldEYij7T5/ysluMHKqUIT4TJHfrDFadUwrghAL6QjER4FeqQXoA==} engines: {node: '>=12'} @@ -4751,6 +4873,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-s390x/0.17.14: + resolution: {integrity: sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-s390x/0.17.4: resolution: {integrity: sha512-AQYuUGp50XM29/N/dehADxvc2bUqDcoqrVuijop1Wv72SyxT6dDB9wjUxuPZm2HwIM876UoNNBMVd+iX/UTKVQ==} engines: {node: '>=12'} @@ -4759,6 +4890,15 @@ packages: requiresBuild: true optional: true + /@esbuild/linux-x64/0.17.14: + resolution: {integrity: sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-x64/0.17.4: resolution: {integrity: sha512-+AsFBwKgQuhV2shfGgA9YloxLDVjXgUEWZum7glR5lLmV94IThu/u2JZGxTgjYby6kyXEx8lKOqP5rTEVBR0Rw==} engines: {node: '>=12'} @@ -4767,6 +4907,15 @@ packages: requiresBuild: true optional: true + /@esbuild/netbsd-x64/0.17.14: + resolution: {integrity: sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/netbsd-x64/0.17.4: resolution: {integrity: sha512-zD1TKYX9553OiLS/qkXPMlWoELYkH/VkzRYNKEU+GwFiqkq0SuxsKnsCg5UCdxN3cqd+1KZ8SS3R+WG/Hxy2jQ==} engines: {node: '>=12'} @@ -4775,6 +4924,15 @@ packages: requiresBuild: true optional: true + /@esbuild/openbsd-x64/0.17.14: + resolution: {integrity: sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + /@esbuild/openbsd-x64/0.17.4: resolution: {integrity: sha512-PY1NjEsLRhPEFFg1AV0/4Or/gR+q2dOb9s5rXcPuCjyHRzbt8vnHJl3vYj+641TgWZzTFmSUnZbzs1zwTzjeqw==} engines: {node: '>=12'} @@ -4783,6 +4941,15 @@ packages: requiresBuild: true optional: true + /@esbuild/sunos-x64/0.17.14: + resolution: {integrity: sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + /@esbuild/sunos-x64/0.17.4: resolution: {integrity: sha512-B3Z7s8QZQW9tKGleMRXvVmwwLPAUoDCHs4WZ2ElVMWiortLJFowU1NjAhXOKjDgC7o9ByeVcwyOlJ+F2r6ZgmQ==} engines: {node: '>=12'} @@ -4791,6 +4958,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-arm64/0.17.14: + resolution: {integrity: sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-arm64/0.17.4: resolution: {integrity: sha512-0HCu8R3mY/H5V7N6kdlsJkvrT591bO/oRZy8ztF1dhgNU5xD5tAh5bKByT1UjTGjp/VVBsl1PDQ3L18SfvtnBQ==} engines: {node: '>=12'} @@ -4799,6 +4975,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-ia32/0.17.14: + resolution: {integrity: sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-ia32/0.17.4: resolution: {integrity: sha512-VUjhVDQycse1gLbe06pC/uaA0M+piQXJpdpNdhg8sPmeIZZqu5xPoGWVCmcsOO2gaM2cywuTYTHkXRozo3/Nkg==} engines: {node: '>=12'} @@ -4807,6 +4992,15 @@ packages: requiresBuild: true optional: true + /@esbuild/win32-x64/0.17.14: + resolution: {integrity: sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@esbuild/win32-x64/0.17.4: resolution: {integrity: sha512-0kLAjs+xN5OjhTt/aUA6t48SfENSCKgGPfExADYTOo/UCn0ivxos9/anUVeSfg+L+2O9xkFxvJXIJfG+Q4sYSg==} engines: {node: '>=12'} @@ -4815,14 +5009,27 @@ packages: requiresBuild: true optional: true - /@eslint/eslintrc/1.3.3: - resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==} + /@eslint-community/eslint-utils/4.4.0_eslint@8.43.0: + resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 8.43.0 + eslint-visitor-keys: 3.4.1 + + /@eslint-community/regexpp/4.5.1: + resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + + /@eslint/eslintrc/2.0.3: + resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.4.0 - globals: 13.15.0 + espree: 9.5.2 + globals: 13.20.0 ignore: 5.2.0 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -4831,6 +5038,10 @@ packages: transitivePeerDependencies: - supports-color + /@eslint/js/8.43.0: + resolution: {integrity: sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@extend-chrome/messages/1.2.2: resolution: {integrity: sha512-1VyUCT+1jewkm7cVBE5fMrrazxuL5QrmCOg2azmItBpiTqwmV/XxhGDQAtfsT4i24xB4gwL0s7+6PpEPec+1mw==} dependencies: @@ -4854,8 +5065,8 @@ packages: dependencies: '@hapi/hoek': 9.3.0 - /@humanwhocodes/config-array/0.11.6: - resolution: {integrity: sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==} + /@humanwhocodes/config-array/0.11.10: + resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -5344,8 +5555,8 @@ packages: /@polka/url/1.0.0-next.21: resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} - /@rollup/plugin-alias/4.0.2_rollup@2.78.1: - resolution: {integrity: sha512-1hv7dBOZZwo3SEupxn4UA2N0EDThqSSS+wI1St1TNTBtOZvUchyIClyHcnDcjjrReTPZ47Faedrhblv4n+T5UQ==} + /@rollup/plugin-alias/4.0.4_rollup@2.78.1: + resolution: {integrity: sha512-0CaAY238SMtYAWEXXptWSR8iz8NYZnH7zNBKuJ14xFJSGwLtPgjvXYsoApAHfzYXXH1ejxpVw7WlHss3zhh9SQ==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0 @@ -5616,24 +5827,21 @@ packages: jest: 27.5.1 dev: true - /@sveltejs/vite-plugin-svelte/1.1.0_svelte@3.48.0+vite@3.1.7: - resolution: {integrity: sha512-cFRfEdztubtj1c/rYh7ArK7XCfFJn6wG6+J8/e9amFsKtEJILovoBrK0/mxt1AjPQg0vaX+fHPKvhx+q8mTPaQ==} + /@sveltejs/vite-plugin-svelte/1.4.0_svelte@3.48.0+vite@3.1.7: + resolution: {integrity: sha512-6QupI/jemMfK+yI2pMtJcu5iO2gtgTfcBdGwMZZt+lgbFELhszbDl6Qjh000HgAV8+XUA+8EY8DusOFk8WhOIg==} engines: {node: ^14.18.0 || >= 16} peerDependencies: - diff-match-patch: ^1.0.5 svelte: ^3.44.0 vite: ^3.0.0 - peerDependenciesMeta: - diff-match-patch: - optional: true dependencies: debug: 4.3.4 deepmerge: 4.2.2 kleur: 4.1.5 magic-string: 0.26.7 svelte: 3.48.0 - svelte-hmr: 0.15.0_svelte@3.48.0 + svelte-hmr: 0.15.2_svelte@3.48.0 vite: 3.1.7 + vitefu: 0.2.4_vite@3.1.7 transitivePeerDependencies: - supports-color dev: true @@ -5889,21 +6097,25 @@ packages: /@types/chai-subset/1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: - '@types/chai': 4.3.3 + '@types/chai': 4.3.4 dev: true /@types/chai/4.3.3: resolution: {integrity: sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==} dev: true + /@types/chai/4.3.4: + resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==} + dev: true + /@types/cheerio/0.22.22: resolution: {integrity: sha512-05DYX4zU96IBfZFY+t3Mh88nlwSMtmmzSYaQkKN48T495VV1dkHSah6qYyDTN5ngaS0i0VonH37m+RuzSM0YiA==} dependencies: '@types/node': 13.13.52 dev: true - /@types/chrome/0.0.209: - resolution: {integrity: sha512-YL3gz9cAKKym/b+u26p8BQuKAc3USsPRcOYZ1OWQmOw0kfYBXkxrh9ASvSRgwA8ywA4sIahio0z0chzmmLq2og==} + /@types/chrome/0.0.237: + resolution: {integrity: sha512-krsRmyfMlck5r+H1EapsrrucDRq6iRm0NAi5fapr93CgnpVMDdK+h2+z4x79GegdW7BNH9Vb//gkptORwwwVIQ==} dependencies: '@types/filesystem': 0.0.32 '@types/har-format': 1.2.8 @@ -5928,6 +6140,10 @@ packages: '@types/node': 17.0.18 dev: false + /@types/convert-source-map/2.0.0: + resolution: {integrity: sha512-QUm4YOC/ENo0VjPVl2o8HGyTbHHQGDOw8PCg3rXBucYHKyZN/XjXRbPFAV1tB2FvM0/wyFoDct4cTIctzKrQFg==} + dev: true + /@types/debug/4.1.7: resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==} dependencies: @@ -6164,10 +6380,6 @@ packages: '@types/node': 17.0.18 dev: true - /@types/prettier/1.19.1: - resolution: {integrity: sha512-5qOlnZscTn4xxM5MeGXAMOsIOIKIbh9e85zJWfBRVPlRMEVawzoPhINYbRGkBZCI8LxvBe7tJCdWiarA99OZfQ==} - dev: true - /@types/prettier/2.6.0: resolution: {integrity: sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==} dev: true @@ -6329,7 +6541,7 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@typescript-eslint/eslint-plugin/5.23.0_si2oinfypjo5utzvexk6yv22zq: + /@typescript-eslint/eslint-plugin/5.23.0_ttki4ynzteu7mlbvqnybjztyzm: resolution: {integrity: sha512-hEcSmG4XodSLiAp1uxv/OQSGsDY6QN3TcRU32gANp+19wGE1QQZLRS8/GV58VRUoXhnkuJ3ZxNQ3T6Z6zM59DA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6340,12 +6552,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/parser': 5.23.0_uywfi3zeys2kqr4zjbjh4sypl4 '@typescript-eslint/scope-manager': 5.23.0 - '@typescript-eslint/type-utils': 5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4 - '@typescript-eslint/utils': 5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/type-utils': 5.23.0_uywfi3zeys2kqr4zjbjh4sypl4 + '@typescript-eslint/utils': 5.23.0_uywfi3zeys2kqr4zjbjh4sypl4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 functional-red-black-tree: 1.0.1 ignore: 5.2.0 regexpp: 3.2.0 @@ -6356,7 +6568,7 @@ packages: - supports-color dev: false - /@typescript-eslint/eslint-plugin/5.41.0_ffukdn5orh6tcfytlcazewwqli: + /@typescript-eslint/eslint-plugin/5.41.0_jvlu6duvhd66pma4iesjjjctze: resolution: {integrity: sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6367,12 +6579,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/parser': 5.41.0_uywfi3zeys2kqr4zjbjh4sypl4 '@typescript-eslint/scope-manager': 5.41.0 - '@typescript-eslint/type-utils': 5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4 - '@typescript-eslint/utils': 5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/type-utils': 5.41.0_uywfi3zeys2kqr4zjbjh4sypl4 + '@typescript-eslint/utils': 5.41.0_uywfi3zeys2kqr4zjbjh4sypl4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.7 @@ -6382,7 +6594,7 @@ packages: - supports-color dev: true - /@typescript-eslint/parser/5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/parser/5.23.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-V06cYUkqcGqpFjb8ttVgzNF53tgbB/KoQT/iB++DOIExKmzI9vBJKjZKt/6FuV9c+zrDsvJKbJ2DOCYwX91cbw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6396,13 +6608,13 @@ packages: '@typescript-eslint/types': 5.23.0 '@typescript-eslint/typescript-estree': 5.23.0_typescript@4.6.4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 typescript: 4.6.4 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser/5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/parser/5.41.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6416,7 +6628,7 @@ packages: '@typescript-eslint/types': 5.41.0 '@typescript-eslint/typescript-estree': 5.41.0_typescript@4.6.4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 typescript: 4.6.4 transitivePeerDependencies: - supports-color @@ -6438,7 +6650,7 @@ packages: '@typescript-eslint/visitor-keys': 5.41.0 dev: true - /@typescript-eslint/type-utils/5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/type-utils/5.23.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-iuI05JsJl/SUnOTXA9f4oI+/4qS/Zcgk+s2ir+lRmXI+80D8GaGwoUqs4p+X+4AxDolPpEpVUdlEH4ADxFy4gw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6448,16 +6660,16 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/utils': 5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/utils': 5.23.0_uywfi3zeys2kqr4zjbjh4sypl4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 tsutils: 3.21.0_typescript@4.6.4 typescript: 4.6.4 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/type-utils/5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/type-utils/5.41.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6468,9 +6680,9 @@ packages: optional: true dependencies: '@typescript-eslint/typescript-estree': 5.41.0_typescript@4.6.4 - '@typescript-eslint/utils': 5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4 + '@typescript-eslint/utils': 5.41.0_uywfi3zeys2kqr4zjbjh4sypl4 debug: 4.3.4 - eslint: 8.26.0 + eslint: 8.43.0 tsutils: 3.21.0_typescript@4.6.4 typescript: 4.6.4 transitivePeerDependencies: @@ -6529,7 +6741,7 @@ packages: - supports-color dev: true - /@typescript-eslint/utils/5.23.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/utils/5.23.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-dbgaKN21drqpkbbedGMNPCtRPZo1IOUr5EI9Jrrh99r5UW5Q0dz46RKXeSBoPV+56R6dFKpbrdhgUNSJsDDRZA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6539,15 +6751,15 @@ packages: '@typescript-eslint/scope-manager': 5.23.0 '@typescript-eslint/types': 5.23.0 '@typescript-eslint/typescript-estree': 5.23.0_typescript@4.6.4 - eslint: 8.26.0 + eslint: 8.43.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.26.0 + eslint-utils: 3.0.0_eslint@8.43.0 transitivePeerDependencies: - supports-color - typescript dev: false - /@typescript-eslint/utils/5.41.0_t64u7vh5pvkzkn6jnkohfgcmb4: + /@typescript-eslint/utils/5.41.0_uywfi3zeys2kqr4zjbjh4sypl4: resolution: {integrity: sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -6558,9 +6770,9 @@ packages: '@typescript-eslint/scope-manager': 5.41.0 '@typescript-eslint/types': 5.41.0 '@typescript-eslint/typescript-estree': 5.41.0_typescript@4.6.4 - eslint: 8.26.0 + eslint: 8.43.0 eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.26.0 + eslint-utils: 3.0.0_eslint@8.43.0 semver: 7.3.7 transitivePeerDependencies: - supports-color @@ -6572,7 +6784,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.23.0 - eslint-visitor-keys: 3.3.0 + eslint-visitor-keys: 3.4.1 dev: false /@typescript-eslint/visitor-keys/5.41.0: @@ -6580,7 +6792,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: '@typescript-eslint/types': 5.41.0 - eslint-visitor-keys: 3.3.0 + eslint-visitor-keys: 3.4.1 dev: true /@vitejs/plugin-react/2.1.0_vite@3.1.7: @@ -6602,7 +6814,7 @@ packages: - supports-color dev: true - /@vitejs/plugin-vue/3.2.0_vite@3.1.7+vue@3.2.41: + /@vitejs/plugin-vue/3.2.0_vite@3.1.7+vue@3.2.47: resolution: {integrity: sha512-E0tnaL4fr+qkdCNxJ+Xd0yM31UwMkQje76fsDVBBUCoGOUPexu2VDUYHL8P4CwV+zMvWw6nlRw19OnRKmYAJpw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -6610,90 +6822,122 @@ packages: vue: ^3.2.25 dependencies: vite: 3.1.7 - vue: 3.2.41 + vue: 3.2.47 dev: true - /@vue/compiler-core/3.2.41: - resolution: {integrity: sha512-oA4mH6SA78DT+96/nsi4p9DX97PHcNROxs51lYk7gb9Z4BPKQ3Mh+BLn6CQZBw857Iuhu28BfMSRHAlPvD4vlw==} + /@vitest/expect/0.28.5: + resolution: {integrity: sha512-gqTZwoUTwepwGIatnw4UKpQfnoyV0Z9Czn9+Lo2/jLIt4/AXLTn+oVZxlQ7Ng8bzcNkR+3DqLJ08kNr8jRmdNQ==} dependencies: - '@babel/parser': 7.19.1 - '@vue/shared': 3.2.41 + '@vitest/spy': 0.28.5 + '@vitest/utils': 0.28.5 + chai: 4.3.7 + dev: true + + /@vitest/runner/0.28.5: + resolution: {integrity: sha512-NKkHtLB+FGjpp5KmneQjTcPLWPTDfB7ie+MmF1PnUBf/tGe2OjGxWyB62ySYZ25EYp9krR5Bw0YPLS/VWh1QiA==} + dependencies: + '@vitest/utils': 0.28.5 + p-limit: 4.0.0 + pathe: 1.1.0 + dev: true + + /@vitest/spy/0.28.5: + resolution: {integrity: sha512-7if6rsHQr9zbmvxN7h+gGh2L9eIIErgf8nSKYDlg07HHimCxp4H6I/X/DPXktVPPLQfiZ1Cw2cbDIx9fSqDjGw==} + dependencies: + tinyspy: 1.0.2 + dev: true + + /@vitest/utils/0.28.5: + resolution: {integrity: sha512-UyZdYwdULlOa4LTUSwZ+Paz7nBHGTT72jKwdFSV4IjHF1xsokp+CabMdhjvVhYwkLfO88ylJT46YMilnkSARZA==} + dependencies: + cli-truncate: 3.1.0 + diff: 5.1.0 + loupe: 2.3.6 + picocolors: 1.0.0 + pretty-format: 27.5.1 + dev: true + + /@vue/compiler-core/3.2.47: + resolution: {integrity: sha512-p4D7FDnQb7+YJmO2iPEv0SQNeNzcbHdGByJDsT4lynf63AFkOTFN07HsiRSvjGo0QrxR/o3d0hUyNCUnBU2Tig==} + dependencies: + '@babel/parser': 7.20.0 + '@vue/shared': 3.2.47 estree-walker: 2.0.2 source-map: 0.6.1 dev: true - /@vue/compiler-dom/3.2.41: - resolution: {integrity: sha512-xe5TbbIsonjENxJsYRbDJvthzqxLNk+tb3d/c47zgREDa/PCp6/Y4gC/skM4H6PIuX5DAxm7fFJdbjjUH2QTMw==} + /@vue/compiler-dom/3.2.47: + resolution: {integrity: sha512-dBBnEHEPoftUiS03a4ggEig74J2YBZ2UIeyfpcRM2tavgMWo4bsEfgCGsu+uJIL/vax9S+JztH8NmQerUo7shQ==} dependencies: - '@vue/compiler-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-core': 3.2.47 + '@vue/shared': 3.2.47 dev: true - /@vue/compiler-sfc/3.2.41: - resolution: {integrity: sha512-+1P2m5kxOeaxVmJNXnBskAn3BenbTmbxBxWOtBq3mQTCokIreuMULFantBUclP0+KnzNCMOvcnKinqQZmiOF8w==} + /@vue/compiler-sfc/3.2.47: + resolution: {integrity: sha512-rog05W+2IFfxjMcFw10tM9+f7i/+FFpZJJ5XHX72NP9eC2uRD+42M3pYcQqDXVYoj74kHMSEdQ/WmCjt8JFksQ==} dependencies: - '@babel/parser': 7.19.1 - '@vue/compiler-core': 3.2.41 - '@vue/compiler-dom': 3.2.41 - '@vue/compiler-ssr': 3.2.41 - '@vue/reactivity-transform': 3.2.41 - '@vue/shared': 3.2.41 + '@babel/parser': 7.20.0 + '@vue/compiler-core': 3.2.47 + '@vue/compiler-dom': 3.2.47 + '@vue/compiler-ssr': 3.2.47 + '@vue/reactivity-transform': 3.2.47 + '@vue/shared': 3.2.47 estree-walker: 2.0.2 magic-string: 0.25.9 postcss: 8.4.16 source-map: 0.6.1 dev: true - /@vue/compiler-ssr/3.2.41: - resolution: {integrity: sha512-Y5wPiNIiaMz/sps8+DmhaKfDm1xgj6GrH99z4gq2LQenfVQcYXmHIOBcs5qPwl7jaW3SUQWjkAPKMfQemEQZwQ==} + /@vue/compiler-ssr/3.2.47: + resolution: {integrity: sha512-wVXC+gszhulcMD8wpxMsqSOpvDZ6xKXSVWkf50Guf/S+28hTAXPDYRTbLQ3EDkOP5Xz/+SY37YiwDquKbJOgZw==} dependencies: - '@vue/compiler-dom': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-dom': 3.2.47 + '@vue/shared': 3.2.47 dev: true - /@vue/reactivity-transform/3.2.41: - resolution: {integrity: sha512-mK5+BNMsL4hHi+IR3Ft/ho6Za+L3FA5j8WvreJ7XzHrqkPq8jtF/SMo7tuc9gHjLDwKZX1nP1JQOKo9IEAn54A==} + /@vue/reactivity-transform/3.2.47: + resolution: {integrity: sha512-m8lGXw8rdnPVVIdIFhf0LeQ/ixyHkH5plYuS83yop5n7ggVJU+z5v0zecwEnX7fa7HNLBhh2qngJJkxpwEEmYA==} dependencies: '@babel/parser': 7.20.0 - '@vue/compiler-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-core': 3.2.47 + '@vue/shared': 3.2.47 estree-walker: 2.0.2 magic-string: 0.25.9 dev: true - /@vue/reactivity/3.2.41: - resolution: {integrity: sha512-9JvCnlj8uc5xRiQGZ28MKGjuCoPhhTwcoAdv3o31+cfGgonwdPNuvqAXLhlzu4zwqavFEG5tvaoINQEfxz+l6g==} + /@vue/reactivity/3.2.47: + resolution: {integrity: sha512-7khqQ/75oyyg+N/e+iwV6lpy1f5wq759NdlS1fpAhFXa8VeAIKGgk2E/C4VF59lx5b+Ezs5fpp/5WsRYXQiKxQ==} dependencies: - '@vue/shared': 3.2.41 + '@vue/shared': 3.2.47 dev: true - /@vue/runtime-core/3.2.41: - resolution: {integrity: sha512-0LBBRwqnI0p4FgIkO9q2aJBBTKDSjzhnxrxHYengkAF6dMOjeAIZFDADAlcf2h3GDALWnblbeprYYpItiulSVQ==} + /@vue/runtime-core/3.2.47: + resolution: {integrity: sha512-RZxbLQIRB/K0ev0K9FXhNbBzT32H9iRtYbaXb0ZIz2usLms/D55dJR2t6cIEUn6vyhS3ALNvNthI+Q95C+NOpA==} dependencies: - '@vue/reactivity': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/reactivity': 3.2.47 + '@vue/shared': 3.2.47 dev: true - /@vue/runtime-dom/3.2.41: - resolution: {integrity: sha512-U7zYuR1NVIP8BL6jmOqmapRAHovEFp7CSw4pR2FacqewXNGqZaRfHoNLQsqQvVQ8yuZNZtxSZy0FFyC70YXPpA==} + /@vue/runtime-dom/3.2.47: + resolution: {integrity: sha512-ArXrFTjS6TsDei4qwNvgrdmHtD930KgSKGhS5M+j8QxXrDJYLqYw4RRcDy1bz1m1wMmb6j+zGLifdVHtkXA7gA==} dependencies: - '@vue/runtime-core': 3.2.41 - '@vue/shared': 3.2.41 + '@vue/runtime-core': 3.2.47 + '@vue/shared': 3.2.47 csstype: 2.6.20 dev: true - /@vue/server-renderer/3.2.41_vue@3.2.41: - resolution: {integrity: sha512-7YHLkfJdTlsZTV0ae5sPwl9Gn/EGr2hrlbcS/8naXm2CDpnKUwC68i1wGlrYAfIgYWL7vUZwk2GkYLQH5CvFig==} + /@vue/server-renderer/3.2.47_vue@3.2.47: + resolution: {integrity: sha512-dN9gc1i8EvmP9RCzvneONXsKfBRgqFeFZLurmHOveL7oH6HiFXJw5OGu294n1nHc/HMgTy6LulU/tv5/A7f/LA==} peerDependencies: - vue: 3.2.41 + vue: 3.2.47 dependencies: - '@vue/compiler-ssr': 3.2.41 - '@vue/shared': 3.2.41 - vue: 3.2.41 + '@vue/compiler-ssr': 3.2.47 + '@vue/shared': 3.2.47 + vue: 3.2.47 dev: true - /@vue/shared/3.2.41: - resolution: {integrity: sha512-W9mfWLHmJhkfAmV+7gDjcHeAWALQtgGT3JErxULl0oz6R6+3ug91I7IErs93eCFhPCZPHBs4QJS7YWEV7A3sxw==} + /@vue/shared/3.2.47: + resolution: {integrity: sha512-BHGyyGN3Q97EZx0taMQ+OLNuZcW3d37ZEVmEAyeoA9ERdGvm9Irc/0Fua8SNyOtV1w6BS4q25wbMzJujO9HIfQ==} dev: true /@webassemblyjs/ast/1.11.1: @@ -6816,19 +7060,19 @@ packages: acorn-walk: 7.2.0 dev: true - /acorn-import-assertions/1.8.0_acorn@8.8.0: + /acorn-import-assertions/1.8.0_acorn@8.8.2: resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} peerDependencies: acorn: ^8 dependencies: - acorn: 8.8.0 + acorn: 8.8.2 - /acorn-jsx/5.3.2_acorn@8.8.0: + /acorn-jsx/5.3.2_acorn@8.8.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.0 + acorn: 8.8.2 /acorn-walk/7.2.0: resolution: {integrity: sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==} @@ -6838,7 +7082,6 @@ packages: /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} - dev: false /acorn/7.4.1: resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} @@ -6850,6 +7093,12 @@ packages: resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==} engines: {node: '>=0.4.0'} hasBin: true + dev: true + + /acorn/8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + engines: {node: '>=0.4.0'} + hasBin: true /address/1.2.0: resolution: {integrity: sha512-tNEZYz5G/zYunxFm7sfhAxkXEuLj3K6BKwv6ZURlsF6yiUQ65z0Q2wZW9L5cPUl9ocofGvXOdFYbFHp0+6MOig==} @@ -6984,7 +7233,6 @@ packages: /ansi-regex/6.0.1: resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} engines: {node: '>=12'} - dev: false /ansi-styles/2.2.1: resolution: {integrity: sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==} @@ -7011,7 +7259,6 @@ packages: /ansi-styles/6.1.0: resolution: {integrity: sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ==} engines: {node: '>=12'} - dev: false /any-promise/1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} @@ -7613,6 +7860,11 @@ packages: engines: {node: '>= 0.8'} dev: false + /cac/6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + /cache-base/1.0.1: resolution: {integrity: sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==} engines: {node: '>=0.10.0'} @@ -7720,6 +7972,19 @@ packages: type-detect: 4.0.8 dev: true + /chai/4.3.7: + resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} + engines: {node: '>=4'} + dependencies: + assertion-error: 1.1.0 + check-error: 1.0.2 + deep-eql: 4.1.3 + get-func-name: 2.0.0 + loupe: 2.3.4 + pathval: 1.1.1 + type-detect: 4.0.8 + dev: true + /chalk/1.1.3: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} engines: {node: '>=0.10.0'} @@ -7920,6 +8185,14 @@ packages: '@colors/colors': 1.5.0 dev: false + /cli-truncate/3.1.0: + resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + slice-ansi: 5.0.0 + string-width: 5.1.2 + dev: true + /cliui/6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -8610,6 +8883,13 @@ packages: type-detect: 4.0.8 dev: true + /deep-eql/4.1.3: + resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} + engines: {node: '>=6'} + dependencies: + type-detect: 4.0.8 + dev: true + /deep-extend/0.6.0: resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} engines: {node: '>=4.0.0'} @@ -8768,6 +9048,11 @@ packages: engines: {node: '>=0.3.1'} dev: false + /diff/5.1.0: + resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + engines: {node: '>=0.3.1'} + dev: true + /dir-glob/3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -8892,7 +9177,6 @@ packages: /eastasianwidth/0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: false /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -8916,7 +9200,6 @@ packages: /emoji-regex/9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: false /emojis-list/3.0.0: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} @@ -9170,13 +9453,13 @@ packages: tslib: 2.3.1 dev: false - /esbuild-runner/2.2.2_esbuild@0.17.4: + /esbuild-runner/2.2.2_esbuild@0.17.14: resolution: {integrity: sha512-fRFVXcmYVmSmtYm2mL8RlUASt2TDkGh3uRcvHFOKNr/T58VrfVeKD9uT9nlgxk96u0LS0ehS/GY7Da/bXWKkhw==} hasBin: true peerDependencies: esbuild: '*' dependencies: - esbuild: 0.17.4 + esbuild: 0.17.14 source-map-support: 0.5.21 tslib: 2.4.0 dev: true @@ -9247,6 +9530,36 @@ packages: esbuild-windows-arm64: 0.15.16 dev: true + /esbuild/0.17.14: + resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.17.14 + '@esbuild/android-arm64': 0.17.14 + '@esbuild/android-x64': 0.17.14 + '@esbuild/darwin-arm64': 0.17.14 + '@esbuild/darwin-x64': 0.17.14 + '@esbuild/freebsd-arm64': 0.17.14 + '@esbuild/freebsd-x64': 0.17.14 + '@esbuild/linux-arm': 0.17.14 + '@esbuild/linux-arm64': 0.17.14 + '@esbuild/linux-ia32': 0.17.14 + '@esbuild/linux-loong64': 0.17.14 + '@esbuild/linux-mips64el': 0.17.14 + '@esbuild/linux-ppc64': 0.17.14 + '@esbuild/linux-riscv64': 0.17.14 + '@esbuild/linux-s390x': 0.17.14 + '@esbuild/linux-x64': 0.17.14 + '@esbuild/netbsd-x64': 0.17.14 + '@esbuild/openbsd-x64': 0.17.14 + '@esbuild/sunos-x64': 0.17.14 + '@esbuild/win32-arm64': 0.17.14 + '@esbuild/win32-ia32': 0.17.14 + '@esbuild/win32-x64': 0.17.14 + dev: true + /esbuild/0.17.4: resolution: {integrity: sha512-zBn9MeCwT7W5F1a3lXClD61ip6vQM+H8Msb0w8zMT4ZKBpDg+rFAraNyWCDelB/2L6M3g6AXHPnsyvjMFnxtFw==} engines: {node: '>=12'} @@ -9315,7 +9628,7 @@ packages: source-map: 0.6.1 dev: true - /eslint-plugin-react/7.29.4_eslint@8.26.0: + /eslint-plugin-react/7.29.4_eslint@8.43.0: resolution: {integrity: sha512-CVCXajliVh509PcZYRFyu/BoUEz452+jtQJq2b3Bae4v3xBUWPLCmtmBM+ZinG4MzwmxJgJ2M5rMqhqLVn7MtQ==} engines: {node: '>=4'} peerDependencies: @@ -9324,7 +9637,7 @@ packages: array-includes: 3.1.5 array.prototype.flatmap: 1.3.0 doctrine: 2.1.0 - eslint: 8.26.0 + eslint: 8.43.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.0 minimatch: 3.1.2 @@ -9344,37 +9657,40 @@ packages: esrecurse: 4.3.0 estraverse: 4.3.0 - /eslint-scope/7.1.1: - resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} + /eslint-scope/7.2.0: + resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 - /eslint-utils/3.0.0_eslint@8.26.0: + /eslint-utils/3.0.0_eslint@8.43.0: resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} peerDependencies: eslint: '>=5' dependencies: - eslint: 8.26.0 + eslint: 8.43.0 eslint-visitor-keys: 2.1.0 /eslint-visitor-keys/2.1.0: resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} engines: {node: '>=10'} - /eslint-visitor-keys/3.3.0: - resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + /eslint-visitor-keys/3.4.1: + resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint/8.26.0: - resolution: {integrity: sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==} + /eslint/8.43.0: + resolution: {integrity: sha512-aaCpf2JqqKesMFGgmRPessmVKjcGXqdlAYLLC3THM8t5nBRZRQ+st5WM/hoJXkdioEXLLbXgclUpM0TXo5HX5Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint/eslintrc': 1.3.3 - '@humanwhocodes/config-array': 0.11.6 + '@eslint-community/eslint-utils': 4.4.0_eslint@8.43.0 + '@eslint-community/regexpp': 4.5.1 + '@eslint/eslintrc': 2.0.3 + '@eslint/js': 8.43.0 + '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -9383,24 +9699,22 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.1.1 - eslint-utils: 3.0.0_eslint@8.26.0 - eslint-visitor-keys: 3.3.0 - espree: 9.4.0 - esquery: 1.4.0 + eslint-scope: 7.2.0 + eslint-visitor-keys: 3.4.1 + espree: 9.5.2 + esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.15.0 - grapheme-splitter: 1.0.4 + globals: 13.20.0 + graphemer: 1.4.0 ignore: 5.2.0 import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.1.5 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 @@ -9408,28 +9722,27 @@ packages: minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.1 - regexpp: 3.2.0 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color - /espree/9.4.0: - resolution: {integrity: sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw==} + /espree/9.5.2: + resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.0 - acorn-jsx: 5.3.2_acorn@8.8.0 - eslint-visitor-keys: 3.3.0 + acorn: 8.8.2 + acorn-jsx: 5.3.2_acorn@8.8.2 + eslint-visitor-keys: 3.4.1 /esprima/4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - /esquery/1.4.0: - resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} + /esquery/1.5.0: + resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 @@ -9925,8 +10238,8 @@ packages: universalify: 2.0.0 dev: false - /fs-extra/11.1.0: - resolution: {integrity: sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw==} + /fs-extra/11.1.1: + resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} dependencies: graceful-fs: 4.2.10 @@ -10126,8 +10439,8 @@ packages: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} - /globals/13.15.0: - resolution: {integrity: sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==} + /globals/13.20.0: + resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -10194,6 +10507,10 @@ packages: /grapheme-splitter/1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: false + + /graphemer/1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} /gray-matter/4.0.3: resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} @@ -10857,6 +11174,11 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + /is-fullwidth-code-point/4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + dev: true + /is-generator-fn/2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} @@ -12011,9 +12333,6 @@ packages: engines: {node: '>=10'} dev: true - /js-sdsl/4.1.5: - resolution: {integrity: sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==} - /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -12040,7 +12359,7 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.8.0 + acorn: 8.8.2 acorn-globals: 6.0.0 cssom: 0.4.4 cssstyle: 2.3.0 @@ -12116,8 +12435,8 @@ packages: engines: {node: '>=6'} hasBin: true - /jsonc-parser/3.0.0: - resolution: {integrity: sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==} + /jsonc-parser/3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} dev: true /jsonfile/4.0.0: @@ -12187,10 +12506,6 @@ packages: engines: {node: '>= 8'} dev: false - /kolorist/1.6.0: - resolution: {integrity: sha512-dLkz37Ab97HWMx9KTes3Tbi3D1ln9fCAy2zr2YVExJasDRPGRaKcoE4fycWNtnCAJfjFqe0cnY+f8KT2JePEXQ==} - dev: true - /latest-version/5.1.0: resolution: {integrity: sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==} engines: {node: '>=8'} @@ -12343,6 +12658,12 @@ packages: get-func-name: 2.0.0 dev: true + /loupe/2.3.6: + resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + dependencies: + get-func-name: 2.0.0 + dev: true + /lower-case/2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} dependencies: @@ -12891,6 +13212,15 @@ packages: minimist: 1.2.6 dev: true + /mlly/1.1.1: + resolution: {integrity: sha512-Jnlh4W/aI4GySPo6+DyTN17Q75KKbLTyFK8BrGhjNP4rxuUjbRWhE6gHg3bs33URWAF44FRm7gdQA348i3XxRw==} + dependencies: + acorn: 8.8.2 + pathe: 1.1.0 + pkg-types: 1.0.2 + ufo: 1.1.0 + dev: true + /mri/1.2.0: resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} engines: {node: '>=4'} @@ -13256,6 +13586,13 @@ packages: dependencies: yocto-queue: 0.1.0 + /p-limit/4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate/3.0.0: resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} engines: {node: '>=6'} @@ -13448,6 +13785,10 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + /pathe/1.1.0: + resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + dev: true + /pathval/1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -13491,6 +13832,14 @@ packages: dependencies: find-up: 4.1.0 + /pkg-types/1.0.2: + resolution: {integrity: sha512-hM58GKXOcj8WTqUXnsQyJYXdeAPbythQgEF3nTcEo+nkD49chjQ9IKm/QJy9xf6JakXptz86h7ecP2024rrLaQ==} + dependencies: + jsonc-parser: 3.2.0 + mlly: 1.1.1 + pathe: 1.1.0 + dev: true + /pkg-up/3.1.0: resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} engines: {node: '>=8'} @@ -13498,16 +13847,16 @@ packages: find-up: 3.0.0 dev: false - /playwright-chromium/1.27.1: - resolution: {integrity: sha512-AXAfmNHVnqByo7dKLwLqEC3aKIUlATwDUHCBwVw/qyRCgGUEoufeFUxFXB7pJ4nppwThph7TFe3fHfoETPqSvg==} + /playwright-chromium/1.33.0: + resolution: {integrity: sha512-aG2IqRp7Q6vRltZFT+N2stWwDUH2fEUTOTv8RxSKMK5QmIQQoNL9nJvNMIJ3yLuin8+coaa3mhJXjjUheo0+/A==} engines: {node: '>=14'} hasBin: true requiresBuild: true dependencies: - playwright-core: 1.27.1 + playwright-core: 1.33.0 - /playwright-core/1.27.1: - resolution: {integrity: sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q==} + /playwright-core/1.33.0: + resolution: {integrity: sha512-aizyPE1Cj62vAECdph1iaMILpT0WUDCq3E6rW6I+dleSbBoGbktvJtzS6VHkZ4DKNEOG9qJpiom/ZxO+S15LAw==} engines: {node: '>=14'} hasBin: true @@ -14827,8 +15176,8 @@ packages: '@babel/code-frame': 7.18.6 dev: true - /rollup-plugin-esbuild/4.10.1_6kmmevfga3h4dux5epad7mqmyq: - resolution: {integrity: sha512-/ymcRB283zjFp1JTBXO8ekxv0c9vRc2L6OTljghsLthQ4vqeDSDWa9BVz1tHiVrx6SbUnUpDPLC0K/MXK7j5TA==} + /rollup-plugin-esbuild/4.10.3_cko6c3u4jw6ltq7rc3stnghywi: + resolution: {integrity: sha512-RILwUCgnCL5vo8vyZ/ZpwcqRuE5KmLizEv6BujBQfgXFZ6ggcS0FiYvQN+gsTJfWCMaU37l0Fosh4eEufyO97Q==} engines: {node: '>=12'} peerDependencies: esbuild: '>=0.10.1' @@ -14837,9 +15186,9 @@ packages: '@rollup/pluginutils': 4.2.1 debug: 4.3.4 es-module-lexer: 0.9.3 - esbuild: 0.17.4 + esbuild: 0.17.14 joycon: 3.1.1 - jsonc-parser: 3.0.0 + jsonc-parser: 3.2.0 rollup: 2.78.1 transitivePeerDependencies: - supports-color @@ -15174,6 +15523,10 @@ packages: get-intrinsic: 1.1.1 object-inspect: 1.12.0 + /siginfo/2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + dev: true + /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -15186,8 +15539,8 @@ packages: totalist: 1.1.0 dev: false - /sirv/2.0.2: - resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==} + /sirv/2.0.3: + resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} engines: {node: '>= 10'} dependencies: '@polka/url': 1.0.0-next.21 @@ -15217,6 +15570,14 @@ packages: resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} engines: {node: '>=12'} + /slice-ansi/5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.1.0 + is-fullwidth-code-point: 4.0.0 + dev: true + /smartwrap/1.2.5: resolution: {integrity: sha512-bzWRwHwu0RnWjwU7dFy7tF68pDAx/zMSu3g7xr9Nx5J0iSImYInglwEVExyHLxXljy6PWMjkSAbwF7t2mPnRmg==} deprecated: Backported compatibility to node > 6 @@ -15419,6 +15780,10 @@ packages: escape-string-regexp: 2.0.0 dev: true + /stackback/0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + dev: true + /state-toggle/1.0.3: resolution: {integrity: sha512-d/5Z4/2iiCnHw6Xzghyhb+GcmF89bxwgXG60wjIiZaxnymbyOmI8Hk4VqHXiVVp6u2ysaskFfXg3ekCj4WNftQ==} dev: false @@ -15445,6 +15810,10 @@ packages: resolution: {integrity: sha512-/c645XdExBypL01TpFKiG/3RAa/Qmu+zRi0MwAmrdEkwHNuN0ebo8ccAXBBDa5Z0QOJgBskUIbuCK91x0sCVEw==} dev: false + /std-env/3.3.2: + resolution: {integrity: sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==} + dev: true + /stream-buffers/0.2.6: resolution: {integrity: sha1-GBwI1bs2kARfaUAbmuanoM8zE/w=} engines: {node: '>= 0.3.0'} @@ -15479,7 +15848,6 @@ packages: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.0.1 - dev: false /string.prototype.matchall/4.0.7: resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==} @@ -15552,7 +15920,6 @@ packages: engines: {node: '>=12'} dependencies: ansi-regex: 6.0.1 - dev: false /strip-bom-string/1.0.0: resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} @@ -15598,6 +15965,12 @@ packages: acorn: 8.8.0 dev: true + /strip-literal/1.0.1: + resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} + dependencies: + acorn: 8.8.2 + dev: true + /style-to-object/0.3.0: resolution: {integrity: sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA==} dependencies: @@ -15663,11 +16036,11 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - /svelte-hmr/0.15.0_svelte@3.48.0: - resolution: {integrity: sha512-Aw21SsyoohyVn4yiKXWPNCSW2DQNH/76kvUnE9kpt4h9hcg9tfyQc6xshx9hzgMfGF0kVx0EGD8oBMWSnATeOg==} + /svelte-hmr/0.15.2_svelte@3.48.0: + resolution: {integrity: sha512-q/bAruCvFLwvNbeE1x3n37TYFb3mTBJ6TrCq6p2CoFbSTNhDE9oAtEfpy+wmc9So8AG0Tja+X0/mJzX9tSfvIg==} engines: {node: ^12.20 || ^14.13.1 || >= 16} peerDependencies: - svelte: '>=3.19.0' + svelte: ^3.19.0 || ^4.0.0-next.0 dependencies: svelte: 3.48.0 dev: true @@ -15749,7 +16122,7 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - acorn: 8.8.0 + acorn: 8.8.2 commander: 2.20.3 source-map: 0.8.0-beta.0 source-map-support: 0.5.21 @@ -15761,7 +16134,7 @@ packages: hasBin: true dependencies: '@jridgewell/source-map': 0.3.2 - acorn: 8.8.0 + acorn: 8.8.2 commander: 2.20.3 source-map-support: 0.5.21 @@ -15819,6 +16192,11 @@ packages: engines: {node: '>=14.0.0'} dev: true + /tinypool/0.3.1: + resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} + engines: {node: '>=14.0.0'} + dev: true + /tinyspy/1.0.2: resolution: {integrity: sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==} engines: {node: '>=14.0.0'} @@ -16078,8 +16456,8 @@ packages: resolution: {integrity: sha1-YdTqsCT5CcTm6lK+hnxIlKS+63Y=} dev: false - /ufo/1.0.1: - resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} + /ufo/1.1.0: + resolution: {integrity: sha512-LQc2s/ZDMaCN3QLpa+uzHUOQ7SdV0qgv3VBXOolQGXTaaZpIur6PwUclF5nN2hNkiTRcUugXd1zFOW3FLJ135Q==} dev: true /unbox-primitive/1.0.1: @@ -16425,8 +16803,29 @@ packages: vfile-message: 2.0.4 dev: false - /vite-plugin-inspect/0.7.14_rollup@2.78.1+vite@3.1.7: - resolution: {integrity: sha512-C9V93Yy2yUf941oVxIq93K6T1o0SZxoG8MdmyJsnoNDijOAGHT1rVSVjzF/uKFYvgnvLvaXioaoy6ica6aOS0g==} + /vite-node/0.28.5: + resolution: {integrity: sha512-LmXb9saMGlrMZbXTvOveJKwMTBTNUH66c8rJnQ0ZPNX+myPEol64+szRzXtV5ORb0Hb/91yq+/D3oERoyAt6LA==} + engines: {node: '>=v14.16.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.1.1 + pathe: 1.1.0 + picocolors: 1.0.0 + source-map: 0.6.1 + source-map-support: 0.5.21 + vite: 3.1.7 + transitivePeerDependencies: + - less + - sass + - stylus + - supports-color + - terser + dev: true + + /vite-plugin-inspect/0.7.25_rollup@2.78.1+vite@3.1.7: + resolution: {integrity: sha512-11j3hG3stRfFkoI+adIDX+KvZueWNgd9lFGdh7lgm0IjGqpP6luCQAMSSnHHV7AZXaTE06X+bUG3M68diz8ZyA==} engines: {node: '>=14'} peerDependencies: vite: ^3.1.0 || ^4.0.0 @@ -16434,10 +16833,9 @@ packages: '@antfu/utils': 0.7.2 '@rollup/pluginutils': 5.0.2_rollup@2.78.1 debug: 4.3.4 - fs-extra: 11.1.0 - kolorist: 1.6.0 - sirv: 2.0.2 - ufo: 1.0.1 + fs-extra: 11.1.1 + picocolors: 1.0.0 + sirv: 2.0.3 vite: 3.1.7 transitivePeerDependencies: - rollup @@ -16471,6 +16869,17 @@ packages: fsevents: 2.3.2 dev: true + /vitefu/0.2.4_vite@3.1.7: + resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} + peerDependencies: + vite: ^3.0.0 || ^4.0.0 + peerDependenciesMeta: + vite: + optional: true + dependencies: + vite: 3.1.7 + dev: true + /vitest/0.24.3: resolution: {integrity: sha512-aM0auuPPgMSstWvr851hB74g/LKaKBzSxcG3da7ejfZbx08Y21JpZmbmDYrMTCGhVZKqTGwzcnLMwyfz2WzkhQ==} engines: {node: '>=v14.16.0'} @@ -16512,14 +16921,68 @@ packages: - terser dev: true - /vue/3.2.41: - resolution: {integrity: sha512-uuuvnrDXEeZ9VUPljgHkqB5IaVO8SxhPpqF2eWOukVrBnRBx2THPSGQBnVRt0GrIG1gvCmFXMGbd7FqcT1ixNQ==} + /vitest/0.28.5: + resolution: {integrity: sha512-pyCQ+wcAOX7mKMcBNkzDwEHRGqQvHUl0XnoHR+3Pb1hytAHISgSxv9h0gUiSiYtISXUU3rMrKiKzFYDrI6ZIHA==} + engines: {node: '>=v14.16.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + dependencies: + '@types/chai': 4.3.4 + '@types/chai-subset': 1.3.3 + '@types/node': 17.0.18 + '@vitest/expect': 0.28.5 + '@vitest/runner': 0.28.5 + '@vitest/spy': 0.28.5 + '@vitest/utils': 0.28.5 + acorn: 8.8.2 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + debug: 4.3.4 + local-pkg: 0.4.2 + pathe: 1.1.0 + picocolors: 1.0.0 + source-map: 0.6.1 + std-env: 3.3.2 + strip-literal: 1.0.1 + tinybench: 2.3.1 + tinypool: 0.3.1 + tinyspy: 1.0.2 + vite: 3.1.7 + vite-node: 0.28.5 + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - sass + - stylus + - supports-color + - terser + dev: true + + /vue/3.2.47: + resolution: {integrity: sha512-60188y/9Dc9WVrAZeUVSDxRQOZ+z+y5nO2ts9jWXSTkMvayiWxCWOWtBQoYjLeccfXkiiPZWAHcV+WTPhkqJHQ==} dependencies: - '@vue/compiler-dom': 3.2.41 - '@vue/compiler-sfc': 3.2.41 - '@vue/runtime-dom': 3.2.41 - '@vue/server-renderer': 3.2.41_vue@3.2.41 - '@vue/shared': 3.2.41 + '@vue/compiler-dom': 3.2.47 + '@vue/compiler-sfc': 3.2.47 + '@vue/runtime-dom': 3.2.47 + '@vue/server-renderer': 3.2.47_vue@3.2.47 + '@vue/shared': 3.2.47 dev: true /w3c-hr-time/1.0.2: @@ -16609,7 +17072,7 @@ packages: engines: {node: '>= 10.13.0'} hasBin: true dependencies: - acorn: 8.8.0 + acorn: 8.8.2 acorn-walk: 8.2.0 chalk: 4.1.2 commander: 7.2.0 @@ -16711,8 +17174,8 @@ packages: '@webassemblyjs/ast': 1.11.1 '@webassemblyjs/wasm-edit': 1.11.1 '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.0 - acorn-import-assertions: 1.8.0_acorn@8.8.0 + acorn: 8.8.2 + acorn-import-assertions: 1.8.0_acorn@8.8.2 browserslist: 4.21.4 chrome-trace-event: 1.0.3 enhanced-resolve: 5.10.0 @@ -16829,6 +17292,15 @@ packages: dependencies: isexe: 2.0.0 + /why-is-node-running/2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + dev: true + /widest-line/3.1.0: resolution: {integrity: sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==} engines: {node: '>=8'} @@ -17001,6 +17473,11 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + /yocto-queue/1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true + /zwitch/1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: false diff --git a/schema/manifest-v2.schema.json b/schema/manifest-v2.schema.json index f02702986..749303600 100644 --- a/schema/manifest-v2.schema.json +++ b/schema/manifest-v2.schema.json @@ -517,7 +517,7 @@ "description": "The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.", "properties": { "keyword": { - "description": "The keyward that will trigger your extension.", + "description": "The keyword that will trigger your extension.", "type": "string" } }, diff --git a/schema/manifest-v3.schema.json b/schema/manifest-v3.schema.json index 97df32dac..d285093b3 100644 --- a/schema/manifest-v3.schema.json +++ b/schema/manifest-v3.schema.json @@ -149,6 +149,7 @@ "scripting", "search", "sessions", + "sidePanel", "signedInDevices", "storage", "system.cpu", @@ -476,22 +477,22 @@ "items": { "additionalProperties": false, "properties": { - "description": { + "name": { "type": "string" }, "id": { "type": "string" }, "language": { - "type": "string" + "type": ["string", "array"] }, "layouts": { - "type": "array" + "type": ["string", "array"] }, - "name": { + "input_view": { "type": "string" }, - "type": { + "options_page": { "type": "string" } }, @@ -574,7 +575,7 @@ "description": "The omnibox API allows you to register a keyword with Google Chrome's address bar, which is also known as the omnibox.", "properties": { "keyword": { - "description": "The keyward that will trigger your extension.", + "description": "The keyword that will trigger your extension.", "type": "string" } }, @@ -681,6 +682,17 @@ "maxLength": 12, "type": "string" }, + "side_panel": { + "description": "The Side Panel API allows extensions to display their own UI in the side panel, enabling persistent experiences that complement the user's browsing journey.", + "properties": { + "default_path": { + "description": "The path to your site panel page, relative to your extension's root.", + "type": "string" + } + }, + "required": ["default_path"], + "type": "object" + }, "signature": {}, "spellcheck": {}, "storage": {},
+ + \\"Vite + + + + +

Vite + TypeScript

+
+ +
+

+ Click on the Vite and TypeScript logos to learn more +

+