diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 938292352..99ca8bb12 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -14,6 +14,7 @@ import { version as i18nVersion } from '../../packages/i18n/package.json'; import { version as autoIconsVersion } from '../../packages/auto-icons/package.json'; import { version as unocssVersion } from '../../packages/unocss/package.json'; import { version as storageVersion } from '../../packages/storage/package.json'; +import knowledge from 'vitepress-knowledge'; const title = 'Next-gen Web Extension Framework'; const titleSuffix = ' – WXT'; @@ -25,6 +26,16 @@ const ogImage = 'https://wxt.dev/social-preview.png'; // https://vitepress.dev/reference/site-config export default defineConfig({ + extends: knowledge({ + paths: { + '/': 'docs', + '/api/': 'api-reference', + }, + pageSelectors: { + 'examples.md': '#VPContent > .VPPage', + }, + }), + titleTemplate: `:title${titleSuffix}`, title: 'WXT', description, diff --git a/docs/.vitepress/utils/menus.ts b/docs/.vitepress/utils/menus.ts index 8395cabb2..5eadec1ed 100644 --- a/docs/.vitepress/utils/menus.ts +++ b/docs/.vitepress/utils/menus.ts @@ -28,13 +28,13 @@ export function menuRoot(items: SidebarItem[]) { export function menuGroup( text: string, items: SidebarItem[], - collapsable?: boolean, + collapsible?: boolean, ): SidebarItem; export function menuGroup( text: string, base: string, items: SidebarItem[], - collapsable?: boolean, + collapsible?: boolean, ): SidebarItem; export function menuGroup( text: string, diff --git a/docs/guide/resources/faq.md b/docs/guide/resources/faq.md index 43db036b6..c19ef2c75 100644 --- a/docs/guide/resources/faq.md +++ b/docs/guide/resources/faq.md @@ -164,3 +164,11 @@ This is usually caused by one of two things (or both) when using `createShadowRo Both issues have the same cause: the library puts something outside the `ShadowRoot`, and the `ShadowRoot`'s isolation prevents CSS from being applied to your UI. Both issues have the same fix: tell the library to put elements inside the `ShadowRoot`, not outside it. See the details above for more information and example fixes for each problem. + +## Is there an LLM trained on WXT's docs that I chat with? + +Not yet, but we're working on it. For now, https://wxt.dev hosts pre-aggregated and pre-formatted knowledge files containing all the docs from this website: + +- Index listing available knowledge files: https://wxt.dev/.wellknown/knowledge/index.json + +You don't need to crawl the entire website, these files already contain all the relevant docs for training a LLM on WXT. But feel free to crawl it and generate your own files if you want! diff --git a/package.json b/package.json index b1e9c5883..b12764793 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "typedoc-vitepress-theme": "1.0.0-next.3", "typescript": "^5.6.3", "vitepress": "^1.5.0", + "vitepress-knowledge": "^0.3.0", "vitest-mock-extended": "^2.0.2", "vue": "^3.5.12", "wxt": "workspace:*" diff --git a/packages/wxt/src/core/utils/__tests__/content-scripts.test.ts b/packages/wxt/src/core/utils/__tests__/content-scripts.test.ts index d0b4e6feb..919ba4f75 100644 --- a/packages/wxt/src/core/utils/__tests__/content-scripts.test.ts +++ b/packages/wxt/src/core/utils/__tests__/content-scripts.test.ts @@ -11,8 +11,8 @@ describe('Content Script Utils', () => { it('should return a string containing all the options with defaults applied', () => { const hash = hashContentScriptOptions({ matches: [] }); - expect(hash).toMatchInlineSnapshot( - `"[["all_frames",false],["exclude_globs",[]],["exclude_matches",[]],["include_globs",[]],["match_about_blank",false],["match_origin_as_fallback",false],["matches",[]],["run_at","document_idle"],["world","ISOLATED"]]"`, + expect(hash).toEqual( + '[["all_frames",false],["exclude_globs",[]],["exclude_matches",[]],["include_globs",[]],["match_about_blank",false],["match_origin_as_fallback",false],["matches",[]],["run_at","document_idle"],["world","ISOLATED"]]', ); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed42473c5..ccaf4f705 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,7 +30,7 @@ importers: version: 11.0.4 '@vitest/coverage-v8': specifier: ^2.1.4 - version: 2.1.4(vitest@2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7)) + version: 2.1.4(vitest@2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7)) changelogen: specifier: ^0.5.7 version: 0.5.7(magicast@0.3.5) @@ -79,9 +79,12 @@ importers: vitepress: specifier: ^1.5.0 version: 1.5.0(@algolia/client-search@4.20.0)(@types/node@20.17.6)(@types/react@18.3.12)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.80.7)(search-insights@2.15.0)(typescript@5.6.3) + vitepress-knowledge: + specifier: ^0.3.0 + version: 0.3.0(vitepress@1.5.0(@algolia/client-search@4.20.0)(@types/node@20.17.6)(@types/react@18.3.12)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.80.7)(search-insights@2.15.0)(typescript@5.6.3)) vitest-mock-extended: specifier: ^2.0.2 - version: 2.0.2(typescript@5.6.3)(vitest@2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7)) + version: 2.0.2(typescript@5.6.3)(vitest@2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7)) vue: specifier: ^3.5.12 version: 3.5.12(typescript@5.6.3) @@ -155,7 +158,7 @@ importers: version: 2.0.0(sass@1.80.7)(typescript@5.6.3) vitest: specifier: ^2.1.4 - version: 2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7) + version: 2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7) vitest-plugin-random-seed: specifier: ^1.1.0 version: 1.1.0(vite@5.4.11(@types/node@20.17.6)(sass@1.80.7)) @@ -301,7 +304,7 @@ importers: version: 2.0.0(sass@1.80.7)(typescript@5.6.3) vitest: specifier: ^2.0.0 - version: 2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7) + version: 2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7) packages/unocss: dependencies: @@ -568,7 +571,7 @@ importers: version: 0.64.0(postcss@8.4.47)(rollup@4.24.0)(vite@5.4.11(@types/node@20.17.6)(sass@1.80.7))(vue@3.5.12(typescript@5.6.3)) vitest: specifier: ^2.1.4 - version: 2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7) + version: 2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7) vitest-plugin-random-seed: specifier: ^1.1.0 version: 1.1.0(vite@5.4.11(@types/node@20.17.6)(sass@1.80.7)) @@ -3157,6 +3160,10 @@ packages: resolution: {integrity: sha512-AU6tzh3ADd28vSmXahgLsGyGGihXPGeKH0owDn9lhHolB6vIwEhag//T+TBzDoAcHhmVEwlxwSgtW1KZep+1MA==} engines: {node: '>=18.0.0'} + happy-dom@16.6.0: + resolution: {integrity: sha512-Zz5S9sog8a3p8XYZbO+eI1QMOAvCNnIoyrH8A8MLX+X2mJrzADTy+kdETmc4q+uD9AGAvQYGn96qBAn2RAciKw==} + engines: {node: '>=18.0.0'} + has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} @@ -3179,6 +3186,10 @@ packages: hast-util-whitespace@3.0.0: resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + highlight.js@10.7.3: resolution: {integrity: sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==} @@ -3523,6 +3534,9 @@ packages: linkedom@0.18.5: resolution: {integrity: sha512-JGLaGGtqtu+eOhYrC1wkWYTBcpVWL4AsnwAtMtgO1Q0gI0PuPJKI0zBBE+a/1BrhOE3Uw8JI/ycByAv5cLrAuQ==} + linkedom@0.18.6: + resolution: {integrity: sha512-6G8euAJ84s7MTXTli5JIOO5tzEpyoUBw2/zcqAunSurbCtC83YcgrK+VTcO8HZ/rdR3eaaZM573FP9rNo1uXIA==} + lint-staged@15.2.10: resolution: {integrity: sha512-5dY5t743e1byO19P9I4b3x8HJwalIznL5E1FWYnU6OWw33KxNBSLAc6Cy7F2PsFEO8FKnLwjwm5hx7aMF0jzZg==} engines: {node: '>=18.12.0'} @@ -3831,6 +3845,13 @@ packages: resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} engines: {node: '>= 6.13.0'} + node-html-markdown@1.3.0: + resolution: {integrity: sha512-OeFi3QwC/cPjvVKZ114tzzu+YoR+v9UXW5RwSXGUqGb0qCl0DvP406tzdL7SFn8pZrMyzXoisfG2zcuF9+zw4g==} + engines: {node: '>=10.0.0'} + + node-html-parser@6.1.13: + resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==} + node-notifier@10.0.1: resolution: {integrity: sha512-YX7TSyDukOZ0g+gmzjB6abKu+hTGvO8+8+gIFDsRCU2t8fLV/P2unmt+LGFaIa4y64aX98Qksa97rgz4vMNeLQ==} @@ -4976,6 +4997,11 @@ packages: vite: optional: true + vitepress-knowledge@0.3.0: + resolution: {integrity: sha512-P3M6u30cV7bgbIFWOvfkyaDHhkk4rrVTzU8Qc8N1iEtn1lCP9Ulk3+PZXVzJ8sf7UEg1ObUMPrWFJd1XjuZJdQ==} + peerDependencies: + vitepress: ^1.0.0 + vitepress@1.5.0: resolution: {integrity: sha512-q4Q/G2zjvynvizdB3/bupdYkCJe2umSAMv9Ju4d92E6/NXJ59z70xB0q5p/4lpRyAwflDsbwy1mLV9Q5+nlB+g==} hasBin: true @@ -5164,6 +5190,11 @@ packages: engines: {node: '>= 14'} hasBin: true + yaml@2.7.0: + resolution: {integrity: sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@20.2.9: resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} engines: {node: '>=10'} @@ -6661,7 +6692,7 @@ snapshots: vite: 5.4.11(@types/node@20.17.6)(sass@1.80.7) vue: 3.5.12(typescript@5.6.3) - '@vitest/coverage-v8@2.1.4(vitest@2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7))': + '@vitest/coverage-v8@2.1.4(vitest@2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -6675,7 +6706,7 @@ snapshots: std-env: 3.7.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7) + vitest: 2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7) transitivePeerDependencies: - supports-color @@ -7853,6 +7884,12 @@ snapshots: webidl-conversions: 7.0.0 whatwg-mimetype: 3.0.0 + happy-dom@16.6.0: + dependencies: + webidl-conversions: 7.0.0 + whatwg-mimetype: 3.0.0 + optional: true + has-flag@3.0.0: {} has-flag@4.0.0: {} @@ -7881,6 +7918,8 @@ snapshots: dependencies: '@types/hast': 3.0.4 + he@1.2.0: {} + highlight.js@10.7.3: {} hookable@5.5.3: {} @@ -8164,6 +8203,14 @@ snapshots: htmlparser2: 9.1.0 uhyphen: 0.2.0 + linkedom@0.18.6: + dependencies: + css-select: 5.1.0 + cssom: 0.5.0 + html-escaper: 3.0.3 + htmlparser2: 9.1.0 + uhyphen: 0.2.0 + lint-staged@15.2.10: dependencies: chalk: 5.3.0 @@ -8469,6 +8516,15 @@ snapshots: node-forge@1.3.1: {} + node-html-markdown@1.3.0: + dependencies: + node-html-parser: 6.1.13 + + node-html-parser@6.1.13: + dependencies: + css-select: 5.1.0 + he: 1.2.0 + node-notifier@10.0.1: dependencies: growly: 1.3.0 @@ -9726,6 +9782,14 @@ snapshots: optionalDependencies: vite: 5.4.11(@types/node@20.17.6)(sass@1.80.7) + vitepress-knowledge@0.3.0(vitepress@1.5.0(@algolia/client-search@4.20.0)(@types/node@20.17.6)(@types/react@18.3.12)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.80.7)(search-insights@2.15.0)(typescript@5.6.3)): + dependencies: + linkedom: 0.18.6 + node-html-markdown: 1.3.0 + picocolors: 1.1.1 + vitepress: 1.5.0(@algolia/client-search@4.20.0)(@types/node@20.17.6)(@types/react@18.3.12)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.80.7)(search-insights@2.15.0)(typescript@5.6.3) + yaml: 2.7.0 + vitepress@1.5.0(@algolia/client-search@4.20.0)(@types/node@20.17.6)(@types/react@18.3.12)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.80.7)(search-insights@2.15.0)(typescript@5.6.3): dependencies: '@docsearch/css': 3.6.2 @@ -9776,11 +9840,11 @@ snapshots: - typescript - universal-cookie - vitest-mock-extended@2.0.2(typescript@5.6.3)(vitest@2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7)): + vitest-mock-extended@2.0.2(typescript@5.6.3)(vitest@2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7)): dependencies: ts-essentials: 10.0.1(typescript@5.6.3) typescript: 5.6.3 - vitest: 2.1.4(@types/node@20.17.6)(happy-dom@15.11.4)(sass@1.80.7) + vitest: 2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7) vitest-plugin-random-seed@1.1.0(vite@5.4.11(@types/node@20.17.6)(sass@1.80.7)): dependencies: @@ -9822,6 +9886,42 @@ snapshots: - supports-color - terser + vitest@2.1.4(@types/node@20.17.6)(happy-dom@16.6.0)(sass@1.80.7): + dependencies: + '@vitest/expect': 2.1.4 + '@vitest/mocker': 2.1.4(vite@5.4.11(@types/node@20.17.6)(sass@1.80.7)) + '@vitest/pretty-format': 2.1.4 + '@vitest/runner': 2.1.4 + '@vitest/snapshot': 2.1.4 + '@vitest/spy': 2.1.4 + '@vitest/utils': 2.1.4 + chai: 5.1.2 + debug: 4.3.7 + expect-type: 1.1.0 + magic-string: 0.30.12 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.9.0 + tinyexec: 0.3.1 + tinypool: 1.0.1 + tinyrainbow: 1.2.0 + vite: 5.4.11(@types/node@20.17.6)(sass@1.80.7) + vite-node: 2.1.4(@types/node@20.17.6)(sass@1.80.7) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.17.6 + happy-dom: 16.6.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vscode-oniguruma@1.7.0: {} vscode-textmate@8.0.0: {} @@ -9963,6 +10063,8 @@ snapshots: yaml@2.5.1: {} + yaml@2.7.0: {} + yargs-parser@20.2.9: {} yargs-parser@21.1.1: {}