From d07197cd140b112c2a36ab26d4a74f19c2d17405 Mon Sep 17 00:00:00 2001 From: Tmk Date: Mon, 2 Dec 2024 16:33:01 +0800 Subject: [PATCH] refactor: rename example to template --- .changeset/config.json | 2 +- .changeset/fifty-gorillas-glow.md | 5 + package.json | 2 +- packages/core-plugin/package.json | 1 + .../src/build-http/build-http-loader.ts | 2 +- packages/create-webx/package.json | 1 + packages/create-webx/src/index.ts | 2 +- packages/create-webx/tests/index.spec.ts | 4 +- packages/modernjs-plugin/package.json | 1 + packages/rsbuild-plugin/package.json | 1 + pnpm-lock.yaml | 450 +++++++++--------- pnpm-workspace.yaml | 2 +- .../react-webpack/.gitignore | 0 .../react-webpack/e2e/basic.spec.ts | 0 .../react-webpack/e2e/context.ts | 0 .../react-webpack/modern.config.ts | 0 .../react-webpack/package.json | 2 +- .../react-webpack/playwright.config.ts | 0 .../react-webpack/public/logo.png | Bin .../react-webpack/src/assets/text-logo.svg | 0 .../react-webpack/src/background/index.ts | 0 .../react-webpack/src/content-scripts/app.tsx | 0 .../src/content-scripts/hello.tsx | 0 .../src/content-scripts/index.tsx | 0 .../react-webpack/src/global.less | 0 .../react-webpack/src/manifest.ts | 0 .../react-webpack/src/modern-app-env.d.ts | 0 .../react-webpack/src/pages/options/app.tsx | 0 .../react-webpack/src/pages/options/index.tsx | 0 .../src/pages/options/style.less | 0 .../react-webpack/src/pages/popup/app.tsx | 0 .../react-webpack/src/pages/popup/index.tsx | 0 .../react-webpack/tailwind.config.ts | 0 .../react-webpack/tsconfig.json | 0 {examples => templates}/react/.gitignore | 0 .../react/e2e/basic.spec.ts | 0 {examples => templates}/react/e2e/context.ts | 0 {examples => templates}/react/package.json | 2 +- .../react/playwright.config.ts | 0 {examples => templates}/react/public/logo.png | Bin .../react/rsbuild.config.ts | 0 .../react/src/assets/text-logo.svg | 0 .../react/src/background/index.ts | 0 .../react/src/content-scripts/app.tsx | 0 .../react/src/content-scripts/hello.tsx | 0 .../react/src/content-scripts/index.tsx | 0 {examples => templates}/react/src/global.less | 0 {examples => templates}/react/src/manifest.ts | 0 .../react/src/pages/options/app.tsx | 0 .../react/src/pages/options/index.tsx | 0 .../react/src/pages/options/style.less | 0 .../react/src/pages/popup/app.tsx | 0 .../react/src/pages/popup/index.tsx | 0 .../react/src/webx-env.d.ts | 0 .../react/tailwind.config.ts | 0 {examples => templates}/react/tsconfig.json | 0 {examples => templates}/solid/.gitignore | 0 .../solid/e2e/basic.spec.ts | 0 {examples => templates}/solid/e2e/context.ts | 0 {examples => templates}/solid/package.json | 2 +- .../solid/playwright.config.ts | 0 {examples => templates}/solid/public/logo.png | Bin .../solid/rsbuild.config.ts | 0 .../solid/src/assets/text-logo.svg | 0 .../solid/src/background/index.ts | 0 .../solid/src/content-scripts/app.tsx | 0 .../solid/src/content-scripts/hello.tsx | 0 .../solid/src/content-scripts/index.tsx | 0 {examples => templates}/solid/src/global.less | 0 {examples => templates}/solid/src/manifest.ts | 0 .../solid/src/pages/options/app.tsx | 0 .../solid/src/pages/options/index.tsx | 0 .../solid/src/pages/options/style.less | 0 .../solid/src/pages/popup/app.tsx | 0 .../solid/src/pages/popup/index.tsx | 0 .../solid/src/webx-env.d.ts | 0 .../solid/tailwind.config.ts | 0 {examples => templates}/solid/tsconfig.json | 0 {examples => templates}/svelte/.gitignore | 0 .../svelte/e2e/basic.spec.ts | 0 {examples => templates}/svelte/e2e/context.ts | 0 {examples => templates}/svelte/package.json | 2 +- .../svelte/playwright.config.ts | 0 .../svelte/public/logo.png | Bin .../svelte/rsbuild.config.ts | 0 .../svelte/src/assets/text-logo.svg | 0 .../svelte/src/background/index.ts | 0 .../svelte/src/content-scripts/app.svelte | 0 .../svelte/src/content-scripts/hello.svelte | 0 .../svelte/src/content-scripts/index.ts | 0 .../svelte/src/global.less | 0 .../svelte/src/manifest.ts | 0 .../svelte/src/pages/options/app.svelte | 0 .../svelte/src/pages/options/index.ts | 0 .../svelte/src/pages/options/style.less | 0 .../svelte/src/pages/popup/app.svelte | 0 .../svelte/src/pages/popup/index.ts | 0 .../svelte/src/webx-env.d.ts | 0 .../svelte/tailwind.config.ts | 0 {examples => templates}/svelte/tsconfig.json | 0 {examples => templates}/vue/.gitignore | 0 {examples => templates}/vue/e2e/basic.spec.ts | 0 {examples => templates}/vue/e2e/context.ts | 0 {examples => templates}/vue/package.json | 2 +- .../vue/playwright.config.ts | 0 {examples => templates}/vue/public/logo.png | Bin {examples => templates}/vue/rsbuild.config.ts | 0 .../vue/src/assets/text-logo.svg | 0 .../vue/src/background/index.ts | 0 .../vue/src/content-scripts/App.vue | 0 .../vue/src/content-scripts/Hello.vue | 0 .../vue/src/content-scripts/index.ts | 0 {examples => templates}/vue/src/global.less | 0 {examples => templates}/vue/src/manifest.ts | 0 .../vue/src/pages/options/App.vue | 0 .../vue/src/pages/options/index.ts | 0 .../vue/src/pages/options/style.less | 0 .../vue/src/pages/popup/App.vue | 0 .../vue/src/pages/popup/index.ts | 0 {examples => templates}/vue/src/webx-env.d.ts | 0 .../vue/tailwind.config.ts | 0 {examples => templates}/vue/tsconfig.json | 0 tests/hmr/package.json | 10 +- tests/hmr/playwright.config.ts | 10 +- 124 files changed, 256 insertions(+), 247 deletions(-) create mode 100644 .changeset/fifty-gorillas-glow.md rename {examples => templates}/react-webpack/.gitignore (100%) rename {examples => templates}/react-webpack/e2e/basic.spec.ts (100%) rename {examples => templates}/react-webpack/e2e/context.ts (100%) rename {examples => templates}/react-webpack/modern.config.ts (100%) rename {examples => templates}/react-webpack/package.json (93%) rename {examples => templates}/react-webpack/playwright.config.ts (100%) rename {examples => templates}/react-webpack/public/logo.png (100%) rename {examples => templates}/react-webpack/src/assets/text-logo.svg (100%) rename {examples => templates}/react-webpack/src/background/index.ts (100%) rename {examples => templates}/react-webpack/src/content-scripts/app.tsx (100%) rename {examples => templates}/react-webpack/src/content-scripts/hello.tsx (100%) rename {examples => templates}/react-webpack/src/content-scripts/index.tsx (100%) rename {examples => templates}/react-webpack/src/global.less (100%) rename {examples => templates}/react-webpack/src/manifest.ts (100%) rename {examples => templates}/react-webpack/src/modern-app-env.d.ts (100%) rename {examples => templates}/react-webpack/src/pages/options/app.tsx (100%) rename {examples => templates}/react-webpack/src/pages/options/index.tsx (100%) rename {examples => templates}/react-webpack/src/pages/options/style.less (100%) rename {examples => templates}/react-webpack/src/pages/popup/app.tsx (100%) rename {examples => templates}/react-webpack/src/pages/popup/index.tsx (100%) rename {examples => templates}/react-webpack/tailwind.config.ts (100%) rename {examples => templates}/react-webpack/tsconfig.json (100%) rename {examples => templates}/react/.gitignore (100%) rename {examples => templates}/react/e2e/basic.spec.ts (100%) rename {examples => templates}/react/e2e/context.ts (100%) rename {examples => templates}/react/package.json (95%) rename {examples => templates}/react/playwright.config.ts (100%) rename {examples => templates}/react/public/logo.png (100%) rename {examples => templates}/react/rsbuild.config.ts (100%) rename {examples => templates}/react/src/assets/text-logo.svg (100%) rename {examples => templates}/react/src/background/index.ts (100%) rename {examples => templates}/react/src/content-scripts/app.tsx (100%) rename {examples => templates}/react/src/content-scripts/hello.tsx (100%) rename {examples => templates}/react/src/content-scripts/index.tsx (100%) rename {examples => templates}/react/src/global.less (100%) rename {examples => templates}/react/src/manifest.ts (100%) rename {examples => templates}/react/src/pages/options/app.tsx (100%) rename {examples => templates}/react/src/pages/options/index.tsx (100%) rename {examples => templates}/react/src/pages/options/style.less (100%) rename {examples => templates}/react/src/pages/popup/app.tsx (100%) rename {examples => templates}/react/src/pages/popup/index.tsx (100%) rename {examples => templates}/react/src/webx-env.d.ts (100%) rename {examples => templates}/react/tailwind.config.ts (100%) rename {examples => templates}/react/tsconfig.json (100%) rename {examples => templates}/solid/.gitignore (100%) rename {examples => templates}/solid/e2e/basic.spec.ts (100%) rename {examples => templates}/solid/e2e/context.ts (100%) rename {examples => templates}/solid/package.json (94%) rename {examples => templates}/solid/playwright.config.ts (100%) rename {examples => templates}/solid/public/logo.png (100%) rename {examples => templates}/solid/rsbuild.config.ts (100%) rename {examples => templates}/solid/src/assets/text-logo.svg (100%) rename {examples => templates}/solid/src/background/index.ts (100%) rename {examples => templates}/solid/src/content-scripts/app.tsx (100%) rename {examples => templates}/solid/src/content-scripts/hello.tsx (100%) rename {examples => templates}/solid/src/content-scripts/index.tsx (100%) rename {examples => templates}/solid/src/global.less (100%) rename {examples => templates}/solid/src/manifest.ts (100%) rename {examples => templates}/solid/src/pages/options/app.tsx (100%) rename {examples => templates}/solid/src/pages/options/index.tsx (100%) rename {examples => templates}/solid/src/pages/options/style.less (100%) rename {examples => templates}/solid/src/pages/popup/app.tsx (100%) rename {examples => templates}/solid/src/pages/popup/index.tsx (100%) rename {examples => templates}/solid/src/webx-env.d.ts (100%) rename {examples => templates}/solid/tailwind.config.ts (100%) rename {examples => templates}/solid/tsconfig.json (100%) rename {examples => templates}/svelte/.gitignore (100%) rename {examples => templates}/svelte/e2e/basic.spec.ts (100%) rename {examples => templates}/svelte/e2e/context.ts (100%) rename {examples => templates}/svelte/package.json (94%) rename {examples => templates}/svelte/playwright.config.ts (100%) rename {examples => templates}/svelte/public/logo.png (100%) rename {examples => templates}/svelte/rsbuild.config.ts (100%) rename {examples => templates}/svelte/src/assets/text-logo.svg (100%) rename {examples => templates}/svelte/src/background/index.ts (100%) rename {examples => templates}/svelte/src/content-scripts/app.svelte (100%) rename {examples => templates}/svelte/src/content-scripts/hello.svelte (100%) rename {examples => templates}/svelte/src/content-scripts/index.ts (100%) rename {examples => templates}/svelte/src/global.less (100%) rename {examples => templates}/svelte/src/manifest.ts (100%) rename {examples => templates}/svelte/src/pages/options/app.svelte (100%) rename {examples => templates}/svelte/src/pages/options/index.ts (100%) rename {examples => templates}/svelte/src/pages/options/style.less (100%) rename {examples => templates}/svelte/src/pages/popup/app.svelte (100%) rename {examples => templates}/svelte/src/pages/popup/index.ts (100%) rename {examples => templates}/svelte/src/webx-env.d.ts (100%) rename {examples => templates}/svelte/tailwind.config.ts (100%) rename {examples => templates}/svelte/tsconfig.json (100%) rename {examples => templates}/vue/.gitignore (100%) rename {examples => templates}/vue/e2e/basic.spec.ts (100%) rename {examples => templates}/vue/e2e/context.ts (100%) rename {examples => templates}/vue/package.json (94%) rename {examples => templates}/vue/playwright.config.ts (100%) rename {examples => templates}/vue/public/logo.png (100%) rename {examples => templates}/vue/rsbuild.config.ts (100%) rename {examples => templates}/vue/src/assets/text-logo.svg (100%) rename {examples => templates}/vue/src/background/index.ts (100%) rename {examples => templates}/vue/src/content-scripts/App.vue (100%) rename {examples => templates}/vue/src/content-scripts/Hello.vue (100%) rename {examples => templates}/vue/src/content-scripts/index.ts (100%) rename {examples => templates}/vue/src/global.less (100%) rename {examples => templates}/vue/src/manifest.ts (100%) rename {examples => templates}/vue/src/pages/options/App.vue (100%) rename {examples => templates}/vue/src/pages/options/index.ts (100%) rename {examples => templates}/vue/src/pages/options/style.less (100%) rename {examples => templates}/vue/src/pages/popup/App.vue (100%) rename {examples => templates}/vue/src/pages/popup/index.ts (100%) rename {examples => templates}/vue/src/webx-env.d.ts (100%) rename {examples => templates}/vue/tailwind.config.ts (100%) rename {examples => templates}/vue/tsconfig.json (100%) diff --git a/.changeset/config.json b/.changeset/config.json index 34cb8102..91e30711 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": ["@webx-kit/app-*", "@webx-kit/docs", "@webx-kit/example-*", "@webx-kit/test-*", "!@webx-kit/test-utils"] + "ignore": ["@webx-kit/app-*", "@webx-kit/docs", "@webx-kit/template-*", "@webx-kit/test-*", "!@webx-kit/test-utils"] } diff --git a/.changeset/fifty-gorillas-glow.md b/.changeset/fifty-gorillas-glow.md new file mode 100644 index 00000000..364c7dfa --- /dev/null +++ b/.changeset/fifty-gorillas-glow.md @@ -0,0 +1,5 @@ +--- +"create-webx": patch +--- + +refactor: rename `example` to `template` diff --git a/package.json b/package.json index 56382e45..c5fd7aa0 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "engines": { "node": ">=18.19.0" }, - "packageManager": "pnpm@9.12.3", + "packageManager": "pnpm@9.14.4", "scripts": { "lint:type": "nx run-many -t lint:type", "build": "nx run-many -t build", diff --git a/packages/core-plugin/package.json b/packages/core-plugin/package.json index e0dfb1f8..fe64e24a 100644 --- a/packages/core-plugin/package.json +++ b/packages/core-plugin/package.json @@ -1,6 +1,7 @@ { "name": "@webx-kit/core-plugin", "version": "0.1.0", + "type": "commonjs", "exports": { "./background": { "types": "./src/background.ts", diff --git a/packages/core-plugin/src/build-http/build-http-loader.ts b/packages/core-plugin/src/build-http/build-http-loader.ts index 12b6c72a..a4d96c89 100644 --- a/packages/core-plugin/src/build-http/build-http-loader.ts +++ b/packages/core-plugin/src/build-http/build-http-loader.ts @@ -13,7 +13,7 @@ const loader: Rspack.LoaderDefinition = function (_code, _sourceMap, _additional .then(async (res) => { const contentType = res.headers.get('content-type'); if (contentType && /^application\/json\b/.test(contentType)) { - return `export default JSON.parse(${JSON.stringify(JSON.stringify(await res.json()))})`; + return `module.exports = ${JSON.stringify(await res.json())}`; } return await res.text(); }) diff --git a/packages/create-webx/package.json b/packages/create-webx/package.json index 65e3c083..eefaf8e9 100644 --- a/packages/create-webx/package.json +++ b/packages/create-webx/package.json @@ -1,6 +1,7 @@ { "name": "create-webx", "version": "0.1.0", + "type": "commonjs", "bin": { "create-webx": "./dist/index.js" }, diff --git a/packages/create-webx/src/index.ts b/packages/create-webx/src/index.ts index 7923e979..ec1151dc 100644 --- a/packages/create-webx/src/index.ts +++ b/packages/create-webx/src/index.ts @@ -85,7 +85,7 @@ async function main() { const { stdout: lastCommitHash } = await execa('git', ['rev-parse', 'HEAD'], { cwd: repoDir }); debug({ lastCommitHash }); - await fs.promises.cp(path.resolve(repoDir, 'examples', template), targetDir, { recursive: true }); + await fs.promises.cp(path.resolve(repoDir, 'templates', template), targetDir, { recursive: true }); const resolvedPackageJson = await updateWorkspaceReferences(repoDir, path.resolve(targetDir, 'package.json')); await fs.promises.writeFile(path.resolve(targetDir, 'package.json'), JSON.stringify(resolvedPackageJson, null, 2)); diff --git a/packages/create-webx/tests/index.spec.ts b/packages/create-webx/tests/index.spec.ts index 94830ec2..a2c724c2 100644 --- a/packages/create-webx/tests/index.spec.ts +++ b/packages/create-webx/tests/index.spec.ts @@ -10,11 +10,11 @@ assert(root); test('ensure template exists', async () => { for (const template of templateLists) { - expect(fs.existsSync(path.resolve(root, 'examples', template.value, 'package.json'))).toBeTruthy(); + expect(fs.existsSync(path.resolve(root, 'templates', template.value, 'package.json'))).toBeTruthy(); } }); test('updateWorkspaceReferences', async () => { - const packageJson = await updateWorkspaceReferences(root, path.resolve(root, 'examples/svelte/package.json')); + const packageJson = await updateWorkspaceReferences(root, path.resolve(root, 'templates/svelte/package.json')); expect(JSON.stringify(packageJson)).not.toContain('workspace:'); }); diff --git a/packages/modernjs-plugin/package.json b/packages/modernjs-plugin/package.json index 920e156d..941a2e76 100644 --- a/packages/modernjs-plugin/package.json +++ b/packages/modernjs-plugin/package.json @@ -1,6 +1,7 @@ { "name": "@webx-kit/modernjs-plugin", "version": "0.1.0", + "type": "commonjs", "exports": { ".": { "types": "./src/index.ts", diff --git a/packages/rsbuild-plugin/package.json b/packages/rsbuild-plugin/package.json index 8b1594e1..795d6877 100644 --- a/packages/rsbuild-plugin/package.json +++ b/packages/rsbuild-plugin/package.json @@ -1,6 +1,7 @@ { "name": "@webx-kit/rsbuild-plugin", "version": "0.1.0", + "type": "commonjs", "exports": { ".": { "types": "./src/index.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3d93f600..8b422157 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -232,221 +232,6 @@ importers: specifier: ^1.5.0 version: 1.5.0(@algolia/client-search@5.13.0)(@types/node@22.9.0)(@types/react@18.3.12)(axios@1.7.7)(postcss@8.4.49)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass-embedded@1.80.6)(terser@5.36.0)(typescript@5.6.3) - examples/react: - dependencies: - '@webx-kit/runtime': - specifier: workspace:^ - version: link:../../packages/runtime - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - devDependencies: - '@playwright/test': - specifier: ^1.48.2 - version: 1.48.2 - '@rsbuild/core': - specifier: 'catalog:' - version: 1.1.0 - '@rsbuild/plugin-less': - specifier: 'catalog:' - version: 1.1.0(@rsbuild/core@1.1.0) - '@rsbuild/plugin-react': - specifier: 'catalog:' - version: 1.0.7(@rsbuild/core@1.1.0) - '@types/chrome': - specifier: ^0.0.280 - version: 0.0.280 - '@types/node': - specifier: ^22.9.0 - version: 22.9.0 - '@types/react': - specifier: ^18.3.12 - version: 18.3.12 - '@types/react-dom': - specifier: ^18.3.1 - version: 18.3.1 - '@webx-kit/rsbuild-plugin': - specifier: workspace:^ - version: link:../../packages/rsbuild-plugin - '@webx-kit/test-utils': - specifier: workspace:^ - version: link:../../packages/test-utils - tailwindcss: - specifier: ^3.4.14 - version: 3.4.14 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - - examples/react-webpack: - dependencies: - '@webx-kit/runtime': - specifier: workspace:^ - version: link:../../packages/runtime - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - devDependencies: - '@modern-js/app-tools': - specifier: ^2.61.0 - version: 2.61.0(@rspack/core@1.1.1(@swc/helpers@0.5.15))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsconfig-paths@4.2.0)(type-fest@4.26.1)(typescript@5.6.3) - '@playwright/test': - specifier: ^1.48.2 - version: 1.48.2 - '@types/chrome': - specifier: ^0.0.280 - version: 0.0.280 - '@types/node': - specifier: ^22.9.0 - version: 22.9.0 - '@types/react': - specifier: ^18.3.12 - version: 18.3.12 - '@types/react-dom': - specifier: ^18.3.1 - version: 18.3.1 - '@webx-kit/modernjs-plugin': - specifier: workspace:^ - version: link:../../packages/modernjs-plugin - '@webx-kit/test-utils': - specifier: workspace:^ - version: link:../../packages/test-utils - tailwindcss: - specifier: ^3.4.14 - version: 3.4.14 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - - examples/solid: - dependencies: - '@webx-kit/runtime': - specifier: workspace:^ - version: link:../../packages/runtime - solid-js: - specifier: ^1.9.3 - version: 1.9.3 - devDependencies: - '@playwright/test': - specifier: ^1.48.2 - version: 1.48.2 - '@rsbuild/core': - specifier: 'catalog:' - version: 1.1.0 - '@rsbuild/plugin-babel': - specifier: 'catalog:' - version: 1.0.3(@rsbuild/core@1.1.0) - '@rsbuild/plugin-less': - specifier: 'catalog:' - version: 1.1.0(@rsbuild/core@1.1.0) - '@rsbuild/plugin-solid': - specifier: 'catalog:' - version: 1.0.1(@babel/core@7.26.0)(@rsbuild/core@1.1.0)(solid-js@1.9.3) - '@types/chrome': - specifier: ^0.0.280 - version: 0.0.280 - '@types/node': - specifier: ^22.9.0 - version: 22.9.0 - '@webx-kit/rsbuild-plugin': - specifier: workspace:^ - version: link:../../packages/rsbuild-plugin - '@webx-kit/test-utils': - specifier: workspace:^ - version: link:../../packages/test-utils - tailwindcss: - specifier: ^3.4.14 - version: 3.4.14 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - - examples/svelte: - dependencies: - '@webx-kit/runtime': - specifier: workspace:^ - version: link:../../packages/runtime - svelte: - specifier: ^4.2.19 - version: 4.2.19 - devDependencies: - '@playwright/test': - specifier: ^1.48.2 - version: 1.48.2 - '@rsbuild/core': - specifier: 'catalog:' - version: 1.1.0 - '@rsbuild/plugin-less': - specifier: 'catalog:' - version: 1.1.0(@rsbuild/core@1.1.0) - '@rsbuild/plugin-svelte': - specifier: 'catalog:' - version: 1.0.1(@babel/core@7.26.0)(@rsbuild/core@1.1.0)(postcss-load-config@6.0.1(jiti@2.4.0)(postcss@8.4.49)(yaml@2.6.0))(postcss@8.4.49)(pug@3.0.3)(svelte@4.2.19)(typescript@5.6.3) - '@types/chrome': - specifier: ^0.0.280 - version: 0.0.280 - '@types/node': - specifier: ^22.9.0 - version: 22.9.0 - '@webx-kit/rsbuild-plugin': - specifier: workspace:^ - version: link:../../packages/rsbuild-plugin - '@webx-kit/test-utils': - specifier: workspace:^ - version: link:../../packages/test-utils - tailwindcss: - specifier: ^3.4.14 - version: 3.4.14 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - - examples/vue: - dependencies: - '@webx-kit/runtime': - specifier: workspace:^ - version: link:../../packages/runtime - vue: - specifier: ^3.5.12 - version: 3.5.12(typescript@5.6.3) - devDependencies: - '@playwright/test': - specifier: ^1.48.2 - version: 1.48.2 - '@rsbuild/core': - specifier: 'catalog:' - version: 1.1.0 - '@rsbuild/plugin-less': - specifier: 'catalog:' - version: 1.1.0(@rsbuild/core@1.1.0) - '@rsbuild/plugin-vue': - specifier: 'catalog:' - version: 1.0.1(@rsbuild/core@1.1.0)(vue@3.5.12(typescript@5.6.3)) - '@types/chrome': - specifier: ^0.0.280 - version: 0.0.280 - '@types/node': - specifier: ^22.9.0 - version: 22.9.0 - '@webx-kit/rsbuild-plugin': - specifier: workspace:^ - version: link:../../packages/rsbuild-plugin - '@webx-kit/test-utils': - specifier: workspace:^ - version: link:../../packages/test-utils - tailwindcss: - specifier: ^3.4.14 - version: 3.4.14 - typescript: - specifier: ^5.6.3 - version: 5.6.3 - packages/chrome-types: dependencies: '@types/chrome': @@ -716,6 +501,221 @@ importers: specifier: ^5.6.3 version: 5.6.3 + templates/react: + dependencies: + '@webx-kit/runtime': + specifier: workspace:^ + version: link:../../packages/runtime + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + devDependencies: + '@playwright/test': + specifier: ^1.48.2 + version: 1.48.2 + '@rsbuild/core': + specifier: 'catalog:' + version: 1.1.0 + '@rsbuild/plugin-less': + specifier: 'catalog:' + version: 1.1.0(@rsbuild/core@1.1.0) + '@rsbuild/plugin-react': + specifier: 'catalog:' + version: 1.0.7(@rsbuild/core@1.1.0) + '@types/chrome': + specifier: ^0.0.280 + version: 0.0.280 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + '@types/react': + specifier: ^18.3.12 + version: 18.3.12 + '@types/react-dom': + specifier: ^18.3.1 + version: 18.3.1 + '@webx-kit/rsbuild-plugin': + specifier: workspace:^ + version: link:../../packages/rsbuild-plugin + '@webx-kit/test-utils': + specifier: workspace:^ + version: link:../../packages/test-utils + tailwindcss: + specifier: ^3.4.14 + version: 3.4.14 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + + templates/react-webpack: + dependencies: + '@webx-kit/runtime': + specifier: workspace:^ + version: link:../../packages/runtime + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) + devDependencies: + '@modern-js/app-tools': + specifier: ^2.61.0 + version: 2.61.0(@rspack/core@1.1.1(@swc/helpers@0.5.15))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(tsconfig-paths@4.2.0)(type-fest@4.26.1)(typescript@5.6.3) + '@playwright/test': + specifier: ^1.48.2 + version: 1.48.2 + '@types/chrome': + specifier: ^0.0.280 + version: 0.0.280 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + '@types/react': + specifier: ^18.3.12 + version: 18.3.12 + '@types/react-dom': + specifier: ^18.3.1 + version: 18.3.1 + '@webx-kit/modernjs-plugin': + specifier: workspace:^ + version: link:../../packages/modernjs-plugin + '@webx-kit/test-utils': + specifier: workspace:^ + version: link:../../packages/test-utils + tailwindcss: + specifier: ^3.4.14 + version: 3.4.14 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + + templates/solid: + dependencies: + '@webx-kit/runtime': + specifier: workspace:^ + version: link:../../packages/runtime + solid-js: + specifier: ^1.9.3 + version: 1.9.3 + devDependencies: + '@playwright/test': + specifier: ^1.48.2 + version: 1.48.2 + '@rsbuild/core': + specifier: 'catalog:' + version: 1.1.0 + '@rsbuild/plugin-babel': + specifier: 'catalog:' + version: 1.0.3(@rsbuild/core@1.1.0) + '@rsbuild/plugin-less': + specifier: 'catalog:' + version: 1.1.0(@rsbuild/core@1.1.0) + '@rsbuild/plugin-solid': + specifier: 'catalog:' + version: 1.0.1(@babel/core@7.26.0)(@rsbuild/core@1.1.0)(solid-js@1.9.3) + '@types/chrome': + specifier: ^0.0.280 + version: 0.0.280 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + '@webx-kit/rsbuild-plugin': + specifier: workspace:^ + version: link:../../packages/rsbuild-plugin + '@webx-kit/test-utils': + specifier: workspace:^ + version: link:../../packages/test-utils + tailwindcss: + specifier: ^3.4.14 + version: 3.4.14 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + + templates/svelte: + dependencies: + '@webx-kit/runtime': + specifier: workspace:^ + version: link:../../packages/runtime + svelte: + specifier: ^4.2.19 + version: 4.2.19 + devDependencies: + '@playwright/test': + specifier: ^1.48.2 + version: 1.48.2 + '@rsbuild/core': + specifier: 'catalog:' + version: 1.1.0 + '@rsbuild/plugin-less': + specifier: 'catalog:' + version: 1.1.0(@rsbuild/core@1.1.0) + '@rsbuild/plugin-svelte': + specifier: 'catalog:' + version: 1.0.1(@babel/core@7.26.0)(@rsbuild/core@1.1.0)(postcss-load-config@6.0.1(jiti@2.4.0)(postcss@8.4.49)(yaml@2.6.0))(postcss@8.4.49)(pug@3.0.3)(svelte@4.2.19)(typescript@5.6.3) + '@types/chrome': + specifier: ^0.0.280 + version: 0.0.280 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + '@webx-kit/rsbuild-plugin': + specifier: workspace:^ + version: link:../../packages/rsbuild-plugin + '@webx-kit/test-utils': + specifier: workspace:^ + version: link:../../packages/test-utils + tailwindcss: + specifier: ^3.4.14 + version: 3.4.14 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + + templates/vue: + dependencies: + '@webx-kit/runtime': + specifier: workspace:^ + version: link:../../packages/runtime + vue: + specifier: ^3.5.12 + version: 3.5.12(typescript@5.6.3) + devDependencies: + '@playwright/test': + specifier: ^1.48.2 + version: 1.48.2 + '@rsbuild/core': + specifier: 'catalog:' + version: 1.1.0 + '@rsbuild/plugin-less': + specifier: 'catalog:' + version: 1.1.0(@rsbuild/core@1.1.0) + '@rsbuild/plugin-vue': + specifier: 'catalog:' + version: 1.0.1(@rsbuild/core@1.1.0)(vue@3.5.12(typescript@5.6.3)) + '@types/chrome': + specifier: ^0.0.280 + version: 0.0.280 + '@types/node': + specifier: ^22.9.0 + version: 22.9.0 + '@webx-kit/rsbuild-plugin': + specifier: workspace:^ + version: link:../../packages/rsbuild-plugin + '@webx-kit/test-utils': + specifier: workspace:^ + version: link:../../packages/test-utils + tailwindcss: + specifier: ^3.4.14 + version: 3.4.14 + typescript: + specifier: ^5.6.3 + version: 5.6.3 + tests/env-vars: devDependencies: '@modern-js/app-tools': @@ -760,21 +760,21 @@ importers: '@webx-kit/chrome-types': specifier: workspace:^ version: link:../../packages/chrome-types - '@webx-kit/example-react': + '@webx-kit/template-react': specifier: workspace:^ - version: link:../../examples/react - '@webx-kit/example-react-webpack': + version: link:../../templates/react + '@webx-kit/template-react-webpack': specifier: workspace:^ - version: link:../../examples/react-webpack - '@webx-kit/example-solid': + version: link:../../templates/react-webpack + '@webx-kit/template-solid': specifier: workspace:^ - version: link:../../examples/solid - '@webx-kit/example-svelte': + version: link:../../templates/solid + '@webx-kit/template-svelte': specifier: workspace:^ - version: link:../../examples/svelte - '@webx-kit/example-vue': + version: link:../../templates/svelte + '@webx-kit/template-vue': specifier: workspace:^ - version: link:../../examples/vue + version: link:../../templates/vue '@webx-kit/test-utils': specifier: workspace:^ version: link:../../packages/test-utils diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 17560db4..79d0e2ee 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,7 +1,7 @@ packages: - apps/* - - examples/* - packages/* + - templates/* - tests/* - docs diff --git a/examples/react-webpack/.gitignore b/templates/react-webpack/.gitignore similarity index 100% rename from examples/react-webpack/.gitignore rename to templates/react-webpack/.gitignore diff --git a/examples/react-webpack/e2e/basic.spec.ts b/templates/react-webpack/e2e/basic.spec.ts similarity index 100% rename from examples/react-webpack/e2e/basic.spec.ts rename to templates/react-webpack/e2e/basic.spec.ts diff --git a/examples/react-webpack/e2e/context.ts b/templates/react-webpack/e2e/context.ts similarity index 100% rename from examples/react-webpack/e2e/context.ts rename to templates/react-webpack/e2e/context.ts diff --git a/examples/react-webpack/modern.config.ts b/templates/react-webpack/modern.config.ts similarity index 100% rename from examples/react-webpack/modern.config.ts rename to templates/react-webpack/modern.config.ts diff --git a/examples/react-webpack/package.json b/templates/react-webpack/package.json similarity index 93% rename from examples/react-webpack/package.json rename to templates/react-webpack/package.json index b096f26e..f210b9c4 100644 --- a/examples/react-webpack/package.json +++ b/templates/react-webpack/package.json @@ -1,5 +1,5 @@ { - "name": "@webx-kit/example-react-webpack", + "name": "@webx-kit/template-react-webpack", "version": "0.0.0", "private": true, "scripts": { diff --git a/examples/react-webpack/playwright.config.ts b/templates/react-webpack/playwright.config.ts similarity index 100% rename from examples/react-webpack/playwright.config.ts rename to templates/react-webpack/playwright.config.ts diff --git a/examples/react-webpack/public/logo.png b/templates/react-webpack/public/logo.png similarity index 100% rename from examples/react-webpack/public/logo.png rename to templates/react-webpack/public/logo.png diff --git a/examples/react-webpack/src/assets/text-logo.svg b/templates/react-webpack/src/assets/text-logo.svg similarity index 100% rename from examples/react-webpack/src/assets/text-logo.svg rename to templates/react-webpack/src/assets/text-logo.svg diff --git a/examples/react-webpack/src/background/index.ts b/templates/react-webpack/src/background/index.ts similarity index 100% rename from examples/react-webpack/src/background/index.ts rename to templates/react-webpack/src/background/index.ts diff --git a/examples/react-webpack/src/content-scripts/app.tsx b/templates/react-webpack/src/content-scripts/app.tsx similarity index 100% rename from examples/react-webpack/src/content-scripts/app.tsx rename to templates/react-webpack/src/content-scripts/app.tsx diff --git a/examples/react-webpack/src/content-scripts/hello.tsx b/templates/react-webpack/src/content-scripts/hello.tsx similarity index 100% rename from examples/react-webpack/src/content-scripts/hello.tsx rename to templates/react-webpack/src/content-scripts/hello.tsx diff --git a/examples/react-webpack/src/content-scripts/index.tsx b/templates/react-webpack/src/content-scripts/index.tsx similarity index 100% rename from examples/react-webpack/src/content-scripts/index.tsx rename to templates/react-webpack/src/content-scripts/index.tsx diff --git a/examples/react-webpack/src/global.less b/templates/react-webpack/src/global.less similarity index 100% rename from examples/react-webpack/src/global.less rename to templates/react-webpack/src/global.less diff --git a/examples/react-webpack/src/manifest.ts b/templates/react-webpack/src/manifest.ts similarity index 100% rename from examples/react-webpack/src/manifest.ts rename to templates/react-webpack/src/manifest.ts diff --git a/examples/react-webpack/src/modern-app-env.d.ts b/templates/react-webpack/src/modern-app-env.d.ts similarity index 100% rename from examples/react-webpack/src/modern-app-env.d.ts rename to templates/react-webpack/src/modern-app-env.d.ts diff --git a/examples/react-webpack/src/pages/options/app.tsx b/templates/react-webpack/src/pages/options/app.tsx similarity index 100% rename from examples/react-webpack/src/pages/options/app.tsx rename to templates/react-webpack/src/pages/options/app.tsx diff --git a/examples/react-webpack/src/pages/options/index.tsx b/templates/react-webpack/src/pages/options/index.tsx similarity index 100% rename from examples/react-webpack/src/pages/options/index.tsx rename to templates/react-webpack/src/pages/options/index.tsx diff --git a/examples/react-webpack/src/pages/options/style.less b/templates/react-webpack/src/pages/options/style.less similarity index 100% rename from examples/react-webpack/src/pages/options/style.less rename to templates/react-webpack/src/pages/options/style.less diff --git a/examples/react-webpack/src/pages/popup/app.tsx b/templates/react-webpack/src/pages/popup/app.tsx similarity index 100% rename from examples/react-webpack/src/pages/popup/app.tsx rename to templates/react-webpack/src/pages/popup/app.tsx diff --git a/examples/react-webpack/src/pages/popup/index.tsx b/templates/react-webpack/src/pages/popup/index.tsx similarity index 100% rename from examples/react-webpack/src/pages/popup/index.tsx rename to templates/react-webpack/src/pages/popup/index.tsx diff --git a/examples/react-webpack/tailwind.config.ts b/templates/react-webpack/tailwind.config.ts similarity index 100% rename from examples/react-webpack/tailwind.config.ts rename to templates/react-webpack/tailwind.config.ts diff --git a/examples/react-webpack/tsconfig.json b/templates/react-webpack/tsconfig.json similarity index 100% rename from examples/react-webpack/tsconfig.json rename to templates/react-webpack/tsconfig.json diff --git a/examples/react/.gitignore b/templates/react/.gitignore similarity index 100% rename from examples/react/.gitignore rename to templates/react/.gitignore diff --git a/examples/react/e2e/basic.spec.ts b/templates/react/e2e/basic.spec.ts similarity index 100% rename from examples/react/e2e/basic.spec.ts rename to templates/react/e2e/basic.spec.ts diff --git a/examples/react/e2e/context.ts b/templates/react/e2e/context.ts similarity index 100% rename from examples/react/e2e/context.ts rename to templates/react/e2e/context.ts diff --git a/examples/react/package.json b/templates/react/package.json similarity index 95% rename from examples/react/package.json rename to templates/react/package.json index 9cb33dab..6c9cf93b 100644 --- a/examples/react/package.json +++ b/templates/react/package.json @@ -1,5 +1,5 @@ { - "name": "@webx-kit/example-react", + "name": "@webx-kit/template-react", "version": "0.0.0", "private": true, "scripts": { diff --git a/examples/react/playwright.config.ts b/templates/react/playwright.config.ts similarity index 100% rename from examples/react/playwright.config.ts rename to templates/react/playwright.config.ts diff --git a/examples/react/public/logo.png b/templates/react/public/logo.png similarity index 100% rename from examples/react/public/logo.png rename to templates/react/public/logo.png diff --git a/examples/react/rsbuild.config.ts b/templates/react/rsbuild.config.ts similarity index 100% rename from examples/react/rsbuild.config.ts rename to templates/react/rsbuild.config.ts diff --git a/examples/react/src/assets/text-logo.svg b/templates/react/src/assets/text-logo.svg similarity index 100% rename from examples/react/src/assets/text-logo.svg rename to templates/react/src/assets/text-logo.svg diff --git a/examples/react/src/background/index.ts b/templates/react/src/background/index.ts similarity index 100% rename from examples/react/src/background/index.ts rename to templates/react/src/background/index.ts diff --git a/examples/react/src/content-scripts/app.tsx b/templates/react/src/content-scripts/app.tsx similarity index 100% rename from examples/react/src/content-scripts/app.tsx rename to templates/react/src/content-scripts/app.tsx diff --git a/examples/react/src/content-scripts/hello.tsx b/templates/react/src/content-scripts/hello.tsx similarity index 100% rename from examples/react/src/content-scripts/hello.tsx rename to templates/react/src/content-scripts/hello.tsx diff --git a/examples/react/src/content-scripts/index.tsx b/templates/react/src/content-scripts/index.tsx similarity index 100% rename from examples/react/src/content-scripts/index.tsx rename to templates/react/src/content-scripts/index.tsx diff --git a/examples/react/src/global.less b/templates/react/src/global.less similarity index 100% rename from examples/react/src/global.less rename to templates/react/src/global.less diff --git a/examples/react/src/manifest.ts b/templates/react/src/manifest.ts similarity index 100% rename from examples/react/src/manifest.ts rename to templates/react/src/manifest.ts diff --git a/examples/react/src/pages/options/app.tsx b/templates/react/src/pages/options/app.tsx similarity index 100% rename from examples/react/src/pages/options/app.tsx rename to templates/react/src/pages/options/app.tsx diff --git a/examples/react/src/pages/options/index.tsx b/templates/react/src/pages/options/index.tsx similarity index 100% rename from examples/react/src/pages/options/index.tsx rename to templates/react/src/pages/options/index.tsx diff --git a/examples/react/src/pages/options/style.less b/templates/react/src/pages/options/style.less similarity index 100% rename from examples/react/src/pages/options/style.less rename to templates/react/src/pages/options/style.less diff --git a/examples/react/src/pages/popup/app.tsx b/templates/react/src/pages/popup/app.tsx similarity index 100% rename from examples/react/src/pages/popup/app.tsx rename to templates/react/src/pages/popup/app.tsx diff --git a/examples/react/src/pages/popup/index.tsx b/templates/react/src/pages/popup/index.tsx similarity index 100% rename from examples/react/src/pages/popup/index.tsx rename to templates/react/src/pages/popup/index.tsx diff --git a/examples/react/src/webx-env.d.ts b/templates/react/src/webx-env.d.ts similarity index 100% rename from examples/react/src/webx-env.d.ts rename to templates/react/src/webx-env.d.ts diff --git a/examples/react/tailwind.config.ts b/templates/react/tailwind.config.ts similarity index 100% rename from examples/react/tailwind.config.ts rename to templates/react/tailwind.config.ts diff --git a/examples/react/tsconfig.json b/templates/react/tsconfig.json similarity index 100% rename from examples/react/tsconfig.json rename to templates/react/tsconfig.json diff --git a/examples/solid/.gitignore b/templates/solid/.gitignore similarity index 100% rename from examples/solid/.gitignore rename to templates/solid/.gitignore diff --git a/examples/solid/e2e/basic.spec.ts b/templates/solid/e2e/basic.spec.ts similarity index 100% rename from examples/solid/e2e/basic.spec.ts rename to templates/solid/e2e/basic.spec.ts diff --git a/examples/solid/e2e/context.ts b/templates/solid/e2e/context.ts similarity index 100% rename from examples/solid/e2e/context.ts rename to templates/solid/e2e/context.ts diff --git a/examples/solid/package.json b/templates/solid/package.json similarity index 94% rename from examples/solid/package.json rename to templates/solid/package.json index 8fb61fd8..6256af32 100644 --- a/examples/solid/package.json +++ b/templates/solid/package.json @@ -1,5 +1,5 @@ { - "name": "@webx-kit/example-solid", + "name": "@webx-kit/template-solid", "version": "0.0.0", "private": true, "scripts": { diff --git a/examples/solid/playwright.config.ts b/templates/solid/playwright.config.ts similarity index 100% rename from examples/solid/playwright.config.ts rename to templates/solid/playwright.config.ts diff --git a/examples/solid/public/logo.png b/templates/solid/public/logo.png similarity index 100% rename from examples/solid/public/logo.png rename to templates/solid/public/logo.png diff --git a/examples/solid/rsbuild.config.ts b/templates/solid/rsbuild.config.ts similarity index 100% rename from examples/solid/rsbuild.config.ts rename to templates/solid/rsbuild.config.ts diff --git a/examples/solid/src/assets/text-logo.svg b/templates/solid/src/assets/text-logo.svg similarity index 100% rename from examples/solid/src/assets/text-logo.svg rename to templates/solid/src/assets/text-logo.svg diff --git a/examples/solid/src/background/index.ts b/templates/solid/src/background/index.ts similarity index 100% rename from examples/solid/src/background/index.ts rename to templates/solid/src/background/index.ts diff --git a/examples/solid/src/content-scripts/app.tsx b/templates/solid/src/content-scripts/app.tsx similarity index 100% rename from examples/solid/src/content-scripts/app.tsx rename to templates/solid/src/content-scripts/app.tsx diff --git a/examples/solid/src/content-scripts/hello.tsx b/templates/solid/src/content-scripts/hello.tsx similarity index 100% rename from examples/solid/src/content-scripts/hello.tsx rename to templates/solid/src/content-scripts/hello.tsx diff --git a/examples/solid/src/content-scripts/index.tsx b/templates/solid/src/content-scripts/index.tsx similarity index 100% rename from examples/solid/src/content-scripts/index.tsx rename to templates/solid/src/content-scripts/index.tsx diff --git a/examples/solid/src/global.less b/templates/solid/src/global.less similarity index 100% rename from examples/solid/src/global.less rename to templates/solid/src/global.less diff --git a/examples/solid/src/manifest.ts b/templates/solid/src/manifest.ts similarity index 100% rename from examples/solid/src/manifest.ts rename to templates/solid/src/manifest.ts diff --git a/examples/solid/src/pages/options/app.tsx b/templates/solid/src/pages/options/app.tsx similarity index 100% rename from examples/solid/src/pages/options/app.tsx rename to templates/solid/src/pages/options/app.tsx diff --git a/examples/solid/src/pages/options/index.tsx b/templates/solid/src/pages/options/index.tsx similarity index 100% rename from examples/solid/src/pages/options/index.tsx rename to templates/solid/src/pages/options/index.tsx diff --git a/examples/solid/src/pages/options/style.less b/templates/solid/src/pages/options/style.less similarity index 100% rename from examples/solid/src/pages/options/style.less rename to templates/solid/src/pages/options/style.less diff --git a/examples/solid/src/pages/popup/app.tsx b/templates/solid/src/pages/popup/app.tsx similarity index 100% rename from examples/solid/src/pages/popup/app.tsx rename to templates/solid/src/pages/popup/app.tsx diff --git a/examples/solid/src/pages/popup/index.tsx b/templates/solid/src/pages/popup/index.tsx similarity index 100% rename from examples/solid/src/pages/popup/index.tsx rename to templates/solid/src/pages/popup/index.tsx diff --git a/examples/solid/src/webx-env.d.ts b/templates/solid/src/webx-env.d.ts similarity index 100% rename from examples/solid/src/webx-env.d.ts rename to templates/solid/src/webx-env.d.ts diff --git a/examples/solid/tailwind.config.ts b/templates/solid/tailwind.config.ts similarity index 100% rename from examples/solid/tailwind.config.ts rename to templates/solid/tailwind.config.ts diff --git a/examples/solid/tsconfig.json b/templates/solid/tsconfig.json similarity index 100% rename from examples/solid/tsconfig.json rename to templates/solid/tsconfig.json diff --git a/examples/svelte/.gitignore b/templates/svelte/.gitignore similarity index 100% rename from examples/svelte/.gitignore rename to templates/svelte/.gitignore diff --git a/examples/svelte/e2e/basic.spec.ts b/templates/svelte/e2e/basic.spec.ts similarity index 100% rename from examples/svelte/e2e/basic.spec.ts rename to templates/svelte/e2e/basic.spec.ts diff --git a/examples/svelte/e2e/context.ts b/templates/svelte/e2e/context.ts similarity index 100% rename from examples/svelte/e2e/context.ts rename to templates/svelte/e2e/context.ts diff --git a/examples/svelte/package.json b/templates/svelte/package.json similarity index 94% rename from examples/svelte/package.json rename to templates/svelte/package.json index 2989de73..1f4b1277 100644 --- a/examples/svelte/package.json +++ b/templates/svelte/package.json @@ -1,5 +1,5 @@ { - "name": "@webx-kit/example-svelte", + "name": "@webx-kit/template-svelte", "version": "0.0.0", "private": true, "scripts": { diff --git a/examples/svelte/playwright.config.ts b/templates/svelte/playwright.config.ts similarity index 100% rename from examples/svelte/playwright.config.ts rename to templates/svelte/playwright.config.ts diff --git a/examples/svelte/public/logo.png b/templates/svelte/public/logo.png similarity index 100% rename from examples/svelte/public/logo.png rename to templates/svelte/public/logo.png diff --git a/examples/svelte/rsbuild.config.ts b/templates/svelte/rsbuild.config.ts similarity index 100% rename from examples/svelte/rsbuild.config.ts rename to templates/svelte/rsbuild.config.ts diff --git a/examples/svelte/src/assets/text-logo.svg b/templates/svelte/src/assets/text-logo.svg similarity index 100% rename from examples/svelte/src/assets/text-logo.svg rename to templates/svelte/src/assets/text-logo.svg diff --git a/examples/svelte/src/background/index.ts b/templates/svelte/src/background/index.ts similarity index 100% rename from examples/svelte/src/background/index.ts rename to templates/svelte/src/background/index.ts diff --git a/examples/svelte/src/content-scripts/app.svelte b/templates/svelte/src/content-scripts/app.svelte similarity index 100% rename from examples/svelte/src/content-scripts/app.svelte rename to templates/svelte/src/content-scripts/app.svelte diff --git a/examples/svelte/src/content-scripts/hello.svelte b/templates/svelte/src/content-scripts/hello.svelte similarity index 100% rename from examples/svelte/src/content-scripts/hello.svelte rename to templates/svelte/src/content-scripts/hello.svelte diff --git a/examples/svelte/src/content-scripts/index.ts b/templates/svelte/src/content-scripts/index.ts similarity index 100% rename from examples/svelte/src/content-scripts/index.ts rename to templates/svelte/src/content-scripts/index.ts diff --git a/examples/svelte/src/global.less b/templates/svelte/src/global.less similarity index 100% rename from examples/svelte/src/global.less rename to templates/svelte/src/global.less diff --git a/examples/svelte/src/manifest.ts b/templates/svelte/src/manifest.ts similarity index 100% rename from examples/svelte/src/manifest.ts rename to templates/svelte/src/manifest.ts diff --git a/examples/svelte/src/pages/options/app.svelte b/templates/svelte/src/pages/options/app.svelte similarity index 100% rename from examples/svelte/src/pages/options/app.svelte rename to templates/svelte/src/pages/options/app.svelte diff --git a/examples/svelte/src/pages/options/index.ts b/templates/svelte/src/pages/options/index.ts similarity index 100% rename from examples/svelte/src/pages/options/index.ts rename to templates/svelte/src/pages/options/index.ts diff --git a/examples/svelte/src/pages/options/style.less b/templates/svelte/src/pages/options/style.less similarity index 100% rename from examples/svelte/src/pages/options/style.less rename to templates/svelte/src/pages/options/style.less diff --git a/examples/svelte/src/pages/popup/app.svelte b/templates/svelte/src/pages/popup/app.svelte similarity index 100% rename from examples/svelte/src/pages/popup/app.svelte rename to templates/svelte/src/pages/popup/app.svelte diff --git a/examples/svelte/src/pages/popup/index.ts b/templates/svelte/src/pages/popup/index.ts similarity index 100% rename from examples/svelte/src/pages/popup/index.ts rename to templates/svelte/src/pages/popup/index.ts diff --git a/examples/svelte/src/webx-env.d.ts b/templates/svelte/src/webx-env.d.ts similarity index 100% rename from examples/svelte/src/webx-env.d.ts rename to templates/svelte/src/webx-env.d.ts diff --git a/examples/svelte/tailwind.config.ts b/templates/svelte/tailwind.config.ts similarity index 100% rename from examples/svelte/tailwind.config.ts rename to templates/svelte/tailwind.config.ts diff --git a/examples/svelte/tsconfig.json b/templates/svelte/tsconfig.json similarity index 100% rename from examples/svelte/tsconfig.json rename to templates/svelte/tsconfig.json diff --git a/examples/vue/.gitignore b/templates/vue/.gitignore similarity index 100% rename from examples/vue/.gitignore rename to templates/vue/.gitignore diff --git a/examples/vue/e2e/basic.spec.ts b/templates/vue/e2e/basic.spec.ts similarity index 100% rename from examples/vue/e2e/basic.spec.ts rename to templates/vue/e2e/basic.spec.ts diff --git a/examples/vue/e2e/context.ts b/templates/vue/e2e/context.ts similarity index 100% rename from examples/vue/e2e/context.ts rename to templates/vue/e2e/context.ts diff --git a/examples/vue/package.json b/templates/vue/package.json similarity index 94% rename from examples/vue/package.json rename to templates/vue/package.json index 6aba1921..f7bd8d40 100644 --- a/examples/vue/package.json +++ b/templates/vue/package.json @@ -1,5 +1,5 @@ { - "name": "@webx-kit/example-vue", + "name": "@webx-kit/template-vue", "version": "0.0.0", "private": true, "scripts": { diff --git a/examples/vue/playwright.config.ts b/templates/vue/playwright.config.ts similarity index 100% rename from examples/vue/playwright.config.ts rename to templates/vue/playwright.config.ts diff --git a/examples/vue/public/logo.png b/templates/vue/public/logo.png similarity index 100% rename from examples/vue/public/logo.png rename to templates/vue/public/logo.png diff --git a/examples/vue/rsbuild.config.ts b/templates/vue/rsbuild.config.ts similarity index 100% rename from examples/vue/rsbuild.config.ts rename to templates/vue/rsbuild.config.ts diff --git a/examples/vue/src/assets/text-logo.svg b/templates/vue/src/assets/text-logo.svg similarity index 100% rename from examples/vue/src/assets/text-logo.svg rename to templates/vue/src/assets/text-logo.svg diff --git a/examples/vue/src/background/index.ts b/templates/vue/src/background/index.ts similarity index 100% rename from examples/vue/src/background/index.ts rename to templates/vue/src/background/index.ts diff --git a/examples/vue/src/content-scripts/App.vue b/templates/vue/src/content-scripts/App.vue similarity index 100% rename from examples/vue/src/content-scripts/App.vue rename to templates/vue/src/content-scripts/App.vue diff --git a/examples/vue/src/content-scripts/Hello.vue b/templates/vue/src/content-scripts/Hello.vue similarity index 100% rename from examples/vue/src/content-scripts/Hello.vue rename to templates/vue/src/content-scripts/Hello.vue diff --git a/examples/vue/src/content-scripts/index.ts b/templates/vue/src/content-scripts/index.ts similarity index 100% rename from examples/vue/src/content-scripts/index.ts rename to templates/vue/src/content-scripts/index.ts diff --git a/examples/vue/src/global.less b/templates/vue/src/global.less similarity index 100% rename from examples/vue/src/global.less rename to templates/vue/src/global.less diff --git a/examples/vue/src/manifest.ts b/templates/vue/src/manifest.ts similarity index 100% rename from examples/vue/src/manifest.ts rename to templates/vue/src/manifest.ts diff --git a/examples/vue/src/pages/options/App.vue b/templates/vue/src/pages/options/App.vue similarity index 100% rename from examples/vue/src/pages/options/App.vue rename to templates/vue/src/pages/options/App.vue diff --git a/examples/vue/src/pages/options/index.ts b/templates/vue/src/pages/options/index.ts similarity index 100% rename from examples/vue/src/pages/options/index.ts rename to templates/vue/src/pages/options/index.ts diff --git a/examples/vue/src/pages/options/style.less b/templates/vue/src/pages/options/style.less similarity index 100% rename from examples/vue/src/pages/options/style.less rename to templates/vue/src/pages/options/style.less diff --git a/examples/vue/src/pages/popup/App.vue b/templates/vue/src/pages/popup/App.vue similarity index 100% rename from examples/vue/src/pages/popup/App.vue rename to templates/vue/src/pages/popup/App.vue diff --git a/examples/vue/src/pages/popup/index.ts b/templates/vue/src/pages/popup/index.ts similarity index 100% rename from examples/vue/src/pages/popup/index.ts rename to templates/vue/src/pages/popup/index.ts diff --git a/examples/vue/src/webx-env.d.ts b/templates/vue/src/webx-env.d.ts similarity index 100% rename from examples/vue/src/webx-env.d.ts rename to templates/vue/src/webx-env.d.ts diff --git a/examples/vue/tailwind.config.ts b/templates/vue/tailwind.config.ts similarity index 100% rename from examples/vue/tailwind.config.ts rename to templates/vue/tailwind.config.ts diff --git a/examples/vue/tsconfig.json b/templates/vue/tsconfig.json similarity index 100% rename from examples/vue/tsconfig.json rename to templates/vue/tsconfig.json diff --git a/tests/hmr/package.json b/tests/hmr/package.json index 6d2b1aca..0a4bbe57 100644 --- a/tests/hmr/package.json +++ b/tests/hmr/package.json @@ -10,11 +10,11 @@ "@playwright/test": "^1.48.2", "@types/node": "^22.9.0", "@webx-kit/chrome-types": "workspace:^", - "@webx-kit/example-react": "workspace:^", - "@webx-kit/example-react-webpack": "workspace:^", - "@webx-kit/example-solid": "workspace:^", - "@webx-kit/example-svelte": "workspace:^", - "@webx-kit/example-vue": "workspace:^", + "@webx-kit/template-react": "workspace:^", + "@webx-kit/template-react-webpack": "workspace:^", + "@webx-kit/template-solid": "workspace:^", + "@webx-kit/template-svelte": "workspace:^", + "@webx-kit/template-vue": "workspace:^", "@webx-kit/test-utils": "workspace:^", "p-retry": "^6.2.0", "typescript": "^5.6.3" diff --git a/tests/hmr/playwright.config.ts b/tests/hmr/playwright.config.ts index a00277b1..ad880524 100644 --- a/tests/hmr/playwright.config.ts +++ b/tests/hmr/playwright.config.ts @@ -19,35 +19,35 @@ export default defineConfig({ name: 'React', grep: /react\.spec/, use: { - launchOptions: createLaunchOptions('@webx-kit/example-react'), + launchOptions: createLaunchOptions('@webx-kit/template-react'), }, }, { name: 'ReactWebpack', grep: /react-webpack/, use: { - launchOptions: createLaunchOptions('@webx-kit/example-react-webpack'), + launchOptions: createLaunchOptions('@webx-kit/template-react-webpack'), }, }, { name: 'Solid', grep: /solid/, use: { - launchOptions: createLaunchOptions('@webx-kit/example-solid'), + launchOptions: createLaunchOptions('@webx-kit/template-solid'), }, }, { name: 'Svelte', grep: /svelte/, use: { - launchOptions: createLaunchOptions('@webx-kit/example-svelte'), + launchOptions: createLaunchOptions('@webx-kit/template-svelte'), }, }, { name: 'Vue', grep: /vue/, use: { - launchOptions: createLaunchOptions('@webx-kit/example-vue'), + launchOptions: createLaunchOptions('@webx-kit/template-vue'), }, }, ],