diff --git a/apps/create-kunkun/build.ts b/apps/create-kunkun/build.ts index 0dabea8..6535af8 100644 --- a/apps/create-kunkun/build.ts +++ b/apps/create-kunkun/build.ts @@ -30,7 +30,7 @@ fs.emptyDirSync(tmpDistTemplatesPath) /* -------------------------------------------------------------------------- */ console.log(getRootDir()) -const templatesPath = path.join(getRootDir(), "../..", "templates") +const templatesPath = path.join(getRootDir(), "../..", "packages/templates") fs.copySync(templatesPath, tmpDistTemplatesPath, { dereference: os.platform() === "win32" }) /* -------------------------------------------------------------------------- */ diff --git a/apps/create-kunkun/index.ts b/apps/create-kunkun/index.ts index 6f6e1cd..3a714e4 100644 --- a/apps/create-kunkun/index.ts +++ b/apps/create-kunkun/index.ts @@ -6,7 +6,7 @@ import chalk from "chalk" import { Command, Option } from "commander" import fs from "fs-extra" import pkgJson from "./package.json" -import { createKunkunVersion, getTemplateRoot, isProduction } from "./src/constants" +import { createKunkunVersion, getTemplateRoot, isProduction, NODE_ENV } from "./src/constants" import { cleanExtension, patchHBS, patchManifestJsonSchema, patchPkgJsonDep } from "./src/patch" import { getLatestNpmPkgVersion, tarExtract } from "./src/utils" @@ -64,7 +64,7 @@ if (!fs.existsSync(outdir)) { async function copyTemplate(templateTgz: string, targetFolderName: string): Promise { const destDir = path.join(outdir, targetFolderName) - + if (!fs.existsSync(templateTgz)) { console.error(`Worker Extension Template not found at ${templateTgz}`) process.exit(1) diff --git a/templates/template-ext-sveltekit/.gitignore b/packages/extensions/ext-sveltekit-exp/.gitignore similarity index 100% rename from templates/template-ext-sveltekit/.gitignore rename to packages/extensions/ext-sveltekit-exp/.gitignore diff --git a/templates/template-ext-sveltekit/.npmrc b/packages/extensions/ext-sveltekit-exp/.npmrc similarity index 100% rename from templates/template-ext-sveltekit/.npmrc rename to packages/extensions/ext-sveltekit-exp/.npmrc diff --git a/templates/template-ext-sveltekit/.prettierignore b/packages/extensions/ext-sveltekit-exp/.prettierignore similarity index 100% rename from templates/template-ext-sveltekit/.prettierignore rename to packages/extensions/ext-sveltekit-exp/.prettierignore diff --git a/templates/template-ext-sveltekit/.prettierrc b/packages/extensions/ext-sveltekit-exp/.prettierrc similarity index 100% rename from templates/template-ext-sveltekit/.prettierrc rename to packages/extensions/ext-sveltekit-exp/.prettierrc diff --git a/templates/template-ext-sveltekit/CHANGELOG.md b/packages/extensions/ext-sveltekit-exp/CHANGELOG.md similarity index 100% rename from templates/template-ext-sveltekit/CHANGELOG.md rename to packages/extensions/ext-sveltekit-exp/CHANGELOG.md diff --git a/templates/template-ext-sveltekit/README.md b/packages/extensions/ext-sveltekit-exp/README.md similarity index 100% rename from templates/template-ext-sveltekit/README.md rename to packages/extensions/ext-sveltekit-exp/README.md diff --git a/templates/template-ext-svelte/components.json b/packages/extensions/ext-sveltekit-exp/components.json similarity index 100% rename from templates/template-ext-svelte/components.json rename to packages/extensions/ext-sveltekit-exp/components.json diff --git a/templates/template-ext-sveltekit/eslint.config.js b/packages/extensions/ext-sveltekit-exp/eslint.config.js similarity index 100% rename from templates/template-ext-sveltekit/eslint.config.js rename to packages/extensions/ext-sveltekit-exp/eslint.config.js diff --git a/templates/template-ext-sveltekit/package.json b/packages/extensions/ext-sveltekit-exp/package.json similarity index 100% rename from templates/template-ext-sveltekit/package.json rename to packages/extensions/ext-sveltekit-exp/package.json diff --git a/templates/template-ext-sveltekit/postcss.config.js b/packages/extensions/ext-sveltekit-exp/postcss.config.js similarity index 100% rename from templates/template-ext-sveltekit/postcss.config.js rename to packages/extensions/ext-sveltekit-exp/postcss.config.js diff --git a/templates/template-ext-sveltekit/src/app.css b/packages/extensions/ext-sveltekit-exp/src/app.css similarity index 100% rename from templates/template-ext-sveltekit/src/app.css rename to packages/extensions/ext-sveltekit-exp/src/app.css diff --git a/templates/template-ext-sveltekit/src/app.d.ts b/packages/extensions/ext-sveltekit-exp/src/app.d.ts similarity index 100% rename from templates/template-ext-sveltekit/src/app.d.ts rename to packages/extensions/ext-sveltekit-exp/src/app.d.ts diff --git a/templates/template-ext-sveltekit/src/app.html b/packages/extensions/ext-sveltekit-exp/src/app.html similarity index 100% rename from templates/template-ext-sveltekit/src/app.html rename to packages/extensions/ext-sveltekit-exp/src/app.html diff --git a/templates/template-ext-svelte/src/lib/components/ThemeCustomizer.svelte b/packages/extensions/ext-sveltekit-exp/src/lib/components/ThemeCustomizer.svelte similarity index 100% rename from templates/template-ext-svelte/src/lib/components/ThemeCustomizer.svelte rename to packages/extensions/ext-sveltekit-exp/src/lib/components/ThemeCustomizer.svelte diff --git a/templates/template-ext-sveltekit/src/lib/index.ts b/packages/extensions/ext-sveltekit-exp/src/lib/index.ts similarity index 100% rename from templates/template-ext-sveltekit/src/lib/index.ts rename to packages/extensions/ext-sveltekit-exp/src/lib/index.ts diff --git a/templates/template-ext-svelte/src/lib/utils.ts b/packages/extensions/ext-sveltekit-exp/src/lib/utils.ts similarity index 100% rename from templates/template-ext-svelte/src/lib/utils.ts rename to packages/extensions/ext-sveltekit-exp/src/lib/utils.ts diff --git a/templates/template-ext-sveltekit/src/routes/+layout.svelte b/packages/extensions/ext-sveltekit-exp/src/routes/+layout.svelte similarity index 100% rename from templates/template-ext-sveltekit/src/routes/+layout.svelte rename to packages/extensions/ext-sveltekit-exp/src/routes/+layout.svelte diff --git a/templates/template-ext-sveltekit/src/routes/+layout.ts b/packages/extensions/ext-sveltekit-exp/src/routes/+layout.ts similarity index 100% rename from templates/template-ext-sveltekit/src/routes/+layout.ts rename to packages/extensions/ext-sveltekit-exp/src/routes/+layout.ts diff --git a/templates/template-ext-sveltekit/src/routes/+page.svelte b/packages/extensions/ext-sveltekit-exp/src/routes/+page.svelte similarity index 100% rename from templates/template-ext-sveltekit/src/routes/+page.svelte rename to packages/extensions/ext-sveltekit-exp/src/routes/+page.svelte diff --git a/templates/template-ext-sveltekit/src/routes/about/+page.svelte b/packages/extensions/ext-sveltekit-exp/src/routes/about/+page.svelte similarity index 100% rename from templates/template-ext-sveltekit/src/routes/about/+page.svelte rename to packages/extensions/ext-sveltekit-exp/src/routes/about/+page.svelte diff --git a/templates/template-ext-sveltekit/static/favicon.png b/packages/extensions/ext-sveltekit-exp/static/favicon.png similarity index 100% rename from templates/template-ext-sveltekit/static/favicon.png rename to packages/extensions/ext-sveltekit-exp/static/favicon.png diff --git a/templates/template-ext-sveltekit/svelte.config.js b/packages/extensions/ext-sveltekit-exp/svelte.config.js similarity index 100% rename from templates/template-ext-sveltekit/svelte.config.js rename to packages/extensions/ext-sveltekit-exp/svelte.config.js diff --git a/templates/template-ext-sveltekit/tailwind.config.ts b/packages/extensions/ext-sveltekit-exp/tailwind.config.ts similarity index 100% rename from templates/template-ext-sveltekit/tailwind.config.ts rename to packages/extensions/ext-sveltekit-exp/tailwind.config.ts diff --git a/templates/template-ext-sveltekit/tsconfig.json b/packages/extensions/ext-sveltekit-exp/tsconfig.json similarity index 100% rename from templates/template-ext-sveltekit/tsconfig.json rename to packages/extensions/ext-sveltekit-exp/tsconfig.json diff --git a/templates/template-ext-sveltekit/vite.config.ts b/packages/extensions/ext-sveltekit-exp/vite.config.ts similarity index 100% rename from templates/template-ext-sveltekit/vite.config.ts rename to packages/extensions/ext-sveltekit-exp/vite.config.ts diff --git a/packages/templates/.gitkeep b/packages/templates/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/templates/index.html b/packages/templates/index.html similarity index 100% rename from templates/index.html rename to packages/templates/index.html diff --git a/templates/template-ext-next/.eslintrc.json b/packages/templates/template-ext-next/.eslintrc.json similarity index 100% rename from templates/template-ext-next/.eslintrc.json rename to packages/templates/template-ext-next/.eslintrc.json diff --git a/templates/template-ext-next/.gitignore b/packages/templates/template-ext-next/.gitignore similarity index 100% rename from templates/template-ext-next/.gitignore rename to packages/templates/template-ext-next/.gitignore diff --git a/templates/template-ext-next/CHANGELOG.md b/packages/templates/template-ext-next/CHANGELOG.md similarity index 100% rename from templates/template-ext-next/CHANGELOG.md rename to packages/templates/template-ext-next/CHANGELOG.md diff --git a/templates/template-ext-next/README.md b/packages/templates/template-ext-next/README.md similarity index 100% rename from templates/template-ext-next/README.md rename to packages/templates/template-ext-next/README.md diff --git a/templates/template-ext-next/next.config.mjs b/packages/templates/template-ext-next/next.config.mjs similarity index 100% rename from templates/template-ext-next/next.config.mjs rename to packages/templates/template-ext-next/next.config.mjs diff --git a/templates/template-ext-next/package.json b/packages/templates/template-ext-next/package.json similarity index 100% rename from templates/template-ext-next/package.json rename to packages/templates/template-ext-next/package.json diff --git a/templates/template-ext-next/postcss.config.mjs b/packages/templates/template-ext-next/postcss.config.mjs similarity index 100% rename from templates/template-ext-next/postcss.config.mjs rename to packages/templates/template-ext-next/postcss.config.mjs diff --git a/templates/template-ext-next/public/next.svg b/packages/templates/template-ext-next/public/next.svg similarity index 100% rename from templates/template-ext-next/public/next.svg rename to packages/templates/template-ext-next/public/next.svg diff --git a/templates/template-ext-next/public/vercel.svg b/packages/templates/template-ext-next/public/vercel.svg similarity index 100% rename from templates/template-ext-next/public/vercel.svg rename to packages/templates/template-ext-next/public/vercel.svg diff --git a/templates/template-ext-next/src/app/about/page.tsx b/packages/templates/template-ext-next/src/app/about/page.tsx similarity index 100% rename from templates/template-ext-next/src/app/about/page.tsx rename to packages/templates/template-ext-next/src/app/about/page.tsx diff --git a/templates/template-ext-next/src/app/favicon.ico b/packages/templates/template-ext-next/src/app/favicon.ico similarity index 100% rename from templates/template-ext-next/src/app/favicon.ico rename to packages/templates/template-ext-next/src/app/favicon.ico diff --git a/templates/template-ext-next/src/app/globals.css b/packages/templates/template-ext-next/src/app/globals.css similarity index 100% rename from templates/template-ext-next/src/app/globals.css rename to packages/templates/template-ext-next/src/app/globals.css diff --git a/templates/template-ext-next/src/app/layout.tsx b/packages/templates/template-ext-next/src/app/layout.tsx similarity index 100% rename from templates/template-ext-next/src/app/layout.tsx rename to packages/templates/template-ext-next/src/app/layout.tsx diff --git a/templates/template-ext-next/src/app/page.tsx b/packages/templates/template-ext-next/src/app/page.tsx similarity index 100% rename from templates/template-ext-next/src/app/page.tsx rename to packages/templates/template-ext-next/src/app/page.tsx diff --git a/templates/template-ext-next/src/components/about.tsx b/packages/templates/template-ext-next/src/components/about.tsx similarity index 100% rename from templates/template-ext-next/src/components/about.tsx rename to packages/templates/template-ext-next/src/components/about.tsx diff --git a/templates/template-ext-next/src/components/main.tsx b/packages/templates/template-ext-next/src/components/main.tsx similarity index 100% rename from templates/template-ext-next/src/components/main.tsx rename to packages/templates/template-ext-next/src/components/main.tsx diff --git a/templates/template-ext-next/tailwind.config.ts b/packages/templates/template-ext-next/tailwind.config.ts similarity index 100% rename from templates/template-ext-next/tailwind.config.ts rename to packages/templates/template-ext-next/tailwind.config.ts diff --git a/templates/template-ext-next/tsconfig.json b/packages/templates/template-ext-next/tsconfig.json similarity index 100% rename from templates/template-ext-next/tsconfig.json rename to packages/templates/template-ext-next/tsconfig.json diff --git a/templates/template-ext-nuxt/.gitignore b/packages/templates/template-ext-nuxt/.gitignore similarity index 100% rename from templates/template-ext-nuxt/.gitignore rename to packages/templates/template-ext-nuxt/.gitignore diff --git a/templates/template-ext-nuxt/CHANGELOG.md b/packages/templates/template-ext-nuxt/CHANGELOG.md similarity index 100% rename from templates/template-ext-nuxt/CHANGELOG.md rename to packages/templates/template-ext-nuxt/CHANGELOG.md diff --git a/templates/template-ext-nuxt/README.md b/packages/templates/template-ext-nuxt/README.md similarity index 100% rename from templates/template-ext-nuxt/README.md rename to packages/templates/template-ext-nuxt/README.md diff --git a/templates/template-ext-nuxt/app.vue b/packages/templates/template-ext-nuxt/app.vue similarity index 100% rename from templates/template-ext-nuxt/app.vue rename to packages/templates/template-ext-nuxt/app.vue diff --git a/templates/template-ext-nuxt/nuxt.config.ts b/packages/templates/template-ext-nuxt/nuxt.config.ts similarity index 100% rename from templates/template-ext-nuxt/nuxt.config.ts rename to packages/templates/template-ext-nuxt/nuxt.config.ts diff --git a/templates/template-ext-nuxt/package.json b/packages/templates/template-ext-nuxt/package.json similarity index 100% rename from templates/template-ext-nuxt/package.json rename to packages/templates/template-ext-nuxt/package.json diff --git a/templates/template-ext-nuxt/pages/about.vue b/packages/templates/template-ext-nuxt/pages/about.vue similarity index 100% rename from templates/template-ext-nuxt/pages/about.vue rename to packages/templates/template-ext-nuxt/pages/about.vue diff --git a/templates/template-ext-nuxt/pages/index.vue b/packages/templates/template-ext-nuxt/pages/index.vue similarity index 100% rename from templates/template-ext-nuxt/pages/index.vue rename to packages/templates/template-ext-nuxt/pages/index.vue diff --git a/templates/template-ext-nuxt/public/favicon.ico b/packages/templates/template-ext-nuxt/public/favicon.ico similarity index 100% rename from templates/template-ext-nuxt/public/favicon.ico rename to packages/templates/template-ext-nuxt/public/favicon.ico diff --git a/templates/template-ext-nuxt/server/tsconfig.json b/packages/templates/template-ext-nuxt/server/tsconfig.json similarity index 100% rename from templates/template-ext-nuxt/server/tsconfig.json rename to packages/templates/template-ext-nuxt/server/tsconfig.json diff --git a/templates/template-ext-nuxt/tsconfig.json b/packages/templates/template-ext-nuxt/tsconfig.json similarity index 100% rename from templates/template-ext-nuxt/tsconfig.json rename to packages/templates/template-ext-nuxt/tsconfig.json diff --git a/templates/template-ext-react/.eslintrc.cjs b/packages/templates/template-ext-react/.eslintrc.cjs similarity index 100% rename from templates/template-ext-react/.eslintrc.cjs rename to packages/templates/template-ext-react/.eslintrc.cjs diff --git a/templates/template-ext-react/.gitignore b/packages/templates/template-ext-react/.gitignore similarity index 100% rename from templates/template-ext-react/.gitignore rename to packages/templates/template-ext-react/.gitignore diff --git a/templates/template-ext-react/CHANGELOG.md b/packages/templates/template-ext-react/CHANGELOG.md similarity index 100% rename from templates/template-ext-react/CHANGELOG.md rename to packages/templates/template-ext-react/CHANGELOG.md diff --git a/templates/template-ext-react/README.md b/packages/templates/template-ext-react/README.md similarity index 100% rename from templates/template-ext-react/README.md rename to packages/templates/template-ext-react/README.md diff --git a/templates/template-ext-react/index.html b/packages/templates/template-ext-react/index.html similarity index 100% rename from templates/template-ext-react/index.html rename to packages/templates/template-ext-react/index.html diff --git a/templates/template-ext-react/package.json b/packages/templates/template-ext-react/package.json similarity index 100% rename from templates/template-ext-react/package.json rename to packages/templates/template-ext-react/package.json diff --git a/templates/template-ext-react/postcss.config.js b/packages/templates/template-ext-react/postcss.config.js similarity index 100% rename from templates/template-ext-react/postcss.config.js rename to packages/templates/template-ext-react/postcss.config.js diff --git a/templates/template-ext-react/public/vite.svg b/packages/templates/template-ext-react/public/vite.svg similarity index 100% rename from templates/template-ext-react/public/vite.svg rename to packages/templates/template-ext-react/public/vite.svg diff --git a/templates/template-ext-react/src/App.tsx b/packages/templates/template-ext-react/src/App.tsx similarity index 100% rename from templates/template-ext-react/src/App.tsx rename to packages/templates/template-ext-react/src/App.tsx diff --git a/templates/template-ext-react/src/index.css b/packages/templates/template-ext-react/src/index.css similarity index 100% rename from templates/template-ext-react/src/index.css rename to packages/templates/template-ext-react/src/index.css diff --git a/templates/template-ext-react/src/main.tsx b/packages/templates/template-ext-react/src/main.tsx similarity index 100% rename from templates/template-ext-react/src/main.tsx rename to packages/templates/template-ext-react/src/main.tsx diff --git a/templates/template-ext-react/src/vite-env.d.ts b/packages/templates/template-ext-react/src/vite-env.d.ts similarity index 100% rename from templates/template-ext-react/src/vite-env.d.ts rename to packages/templates/template-ext-react/src/vite-env.d.ts diff --git a/templates/template-ext-react/tailwind.config.js b/packages/templates/template-ext-react/tailwind.config.js similarity index 100% rename from templates/template-ext-react/tailwind.config.js rename to packages/templates/template-ext-react/tailwind.config.js diff --git a/templates/template-ext-react/tsconfig.app.json b/packages/templates/template-ext-react/tsconfig.app.json similarity index 100% rename from templates/template-ext-react/tsconfig.app.json rename to packages/templates/template-ext-react/tsconfig.app.json diff --git a/templates/template-ext-react/tsconfig.json b/packages/templates/template-ext-react/tsconfig.json similarity index 100% rename from templates/template-ext-react/tsconfig.json rename to packages/templates/template-ext-react/tsconfig.json diff --git a/templates/template-ext-react/tsconfig.node.json b/packages/templates/template-ext-react/tsconfig.node.json similarity index 100% rename from templates/template-ext-react/tsconfig.node.json rename to packages/templates/template-ext-react/tsconfig.node.json diff --git a/templates/template-ext-react/vite.config.ts b/packages/templates/template-ext-react/vite.config.ts similarity index 100% rename from templates/template-ext-react/vite.config.ts rename to packages/templates/template-ext-react/vite.config.ts diff --git a/templates/template-ext-svelte/.gitignore b/packages/templates/template-ext-svelte/.gitignore similarity index 100% rename from templates/template-ext-svelte/.gitignore rename to packages/templates/template-ext-svelte/.gitignore diff --git a/templates/template-ext-svelte/.vscode/extensions.json b/packages/templates/template-ext-svelte/.vscode/extensions.json similarity index 100% rename from templates/template-ext-svelte/.vscode/extensions.json rename to packages/templates/template-ext-svelte/.vscode/extensions.json diff --git a/templates/template-ext-svelte/CHANGELOG.md b/packages/templates/template-ext-svelte/CHANGELOG.md similarity index 100% rename from templates/template-ext-svelte/CHANGELOG.md rename to packages/templates/template-ext-svelte/CHANGELOG.md diff --git a/templates/template-ext-svelte/README.md b/packages/templates/template-ext-svelte/README.md similarity index 100% rename from templates/template-ext-svelte/README.md rename to packages/templates/template-ext-svelte/README.md diff --git a/templates/template-ext-sveltekit/components.json b/packages/templates/template-ext-svelte/components.json similarity index 100% rename from templates/template-ext-sveltekit/components.json rename to packages/templates/template-ext-svelte/components.json diff --git a/templates/template-ext-svelte/index.html b/packages/templates/template-ext-svelte/index.html similarity index 100% rename from templates/template-ext-svelte/index.html rename to packages/templates/template-ext-svelte/index.html diff --git a/templates/template-ext-svelte/package.json b/packages/templates/template-ext-svelte/package.json similarity index 100% rename from templates/template-ext-svelte/package.json rename to packages/templates/template-ext-svelte/package.json diff --git a/templates/template-ext-svelte/postcss.config.js b/packages/templates/template-ext-svelte/postcss.config.js similarity index 100% rename from templates/template-ext-svelte/postcss.config.js rename to packages/templates/template-ext-svelte/postcss.config.js diff --git a/templates/template-ext-svelte/public/vite.svg b/packages/templates/template-ext-svelte/public/vite.svg similarity index 100% rename from templates/template-ext-svelte/public/vite.svg rename to packages/templates/template-ext-svelte/public/vite.svg diff --git a/templates/template-ext-svelte/src/App.svelte b/packages/templates/template-ext-svelte/src/App.svelte similarity index 100% rename from templates/template-ext-svelte/src/App.svelte rename to packages/templates/template-ext-svelte/src/App.svelte diff --git a/templates/template-ext-svelte/src/app.css b/packages/templates/template-ext-svelte/src/app.css similarity index 100% rename from templates/template-ext-svelte/src/app.css rename to packages/templates/template-ext-svelte/src/app.css diff --git a/templates/template-ext-svelte/src/assets/svelte.svg b/packages/templates/template-ext-svelte/src/assets/svelte.svg similarity index 100% rename from templates/template-ext-svelte/src/assets/svelte.svg rename to packages/templates/template-ext-svelte/src/assets/svelte.svg diff --git a/templates/template-ext-svelte/src/lib/Counter.svelte b/packages/templates/template-ext-svelte/src/lib/Counter.svelte similarity index 100% rename from templates/template-ext-svelte/src/lib/Counter.svelte rename to packages/templates/template-ext-svelte/src/lib/Counter.svelte diff --git a/templates/template-ext-sveltekit/src/lib/components/ThemeCustomizer.svelte b/packages/templates/template-ext-svelte/src/lib/components/ThemeCustomizer.svelte similarity index 100% rename from templates/template-ext-sveltekit/src/lib/components/ThemeCustomizer.svelte rename to packages/templates/template-ext-svelte/src/lib/components/ThemeCustomizer.svelte diff --git a/templates/template-ext-sveltekit/src/lib/utils.ts b/packages/templates/template-ext-svelte/src/lib/utils.ts similarity index 100% rename from templates/template-ext-sveltekit/src/lib/utils.ts rename to packages/templates/template-ext-svelte/src/lib/utils.ts diff --git a/templates/template-ext-svelte/src/main.ts b/packages/templates/template-ext-svelte/src/main.ts similarity index 100% rename from templates/template-ext-svelte/src/main.ts rename to packages/templates/template-ext-svelte/src/main.ts diff --git a/templates/template-ext-svelte/src/vite-env.d.ts b/packages/templates/template-ext-svelte/src/vite-env.d.ts similarity index 100% rename from templates/template-ext-svelte/src/vite-env.d.ts rename to packages/templates/template-ext-svelte/src/vite-env.d.ts diff --git a/templates/template-ext-svelte/svelte.config.js b/packages/templates/template-ext-svelte/svelte.config.js similarity index 100% rename from templates/template-ext-svelte/svelte.config.js rename to packages/templates/template-ext-svelte/svelte.config.js diff --git a/templates/template-ext-svelte/tailwind.config.ts b/packages/templates/template-ext-svelte/tailwind.config.ts similarity index 100% rename from templates/template-ext-svelte/tailwind.config.ts rename to packages/templates/template-ext-svelte/tailwind.config.ts diff --git a/templates/template-ext-svelte/tsconfig.json b/packages/templates/template-ext-svelte/tsconfig.json similarity index 100% rename from templates/template-ext-svelte/tsconfig.json rename to packages/templates/template-ext-svelte/tsconfig.json diff --git a/templates/template-ext-svelte/tsconfig.node.json b/packages/templates/template-ext-svelte/tsconfig.node.json similarity index 100% rename from templates/template-ext-svelte/tsconfig.node.json rename to packages/templates/template-ext-svelte/tsconfig.node.json diff --git a/templates/template-ext-svelte/vite.config.ts b/packages/templates/template-ext-svelte/vite.config.ts similarity index 100% rename from templates/template-ext-svelte/vite.config.ts rename to packages/templates/template-ext-svelte/vite.config.ts diff --git a/packages/templates/template-ext-sveltekit/.gitignore b/packages/templates/template-ext-sveltekit/.gitignore new file mode 100644 index 0000000..4095aa9 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/.gitignore @@ -0,0 +1,23 @@ +node_modules + +# Output +.output +.vercel +/.svelte-kit +/build + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* +extensions_support/ + diff --git a/packages/templates/template-ext-sveltekit/.npmrc b/packages/templates/template-ext-sveltekit/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/packages/templates/template-ext-sveltekit/.prettierignore b/packages/templates/template-ext-sveltekit/.prettierignore new file mode 100644 index 0000000..ab78a95 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/.prettierignore @@ -0,0 +1,4 @@ +# Package Managers +package-lock.json +pnpm-lock.yaml +yarn.lock diff --git a/packages/templates/template-ext-sveltekit/.prettierrc b/packages/templates/template-ext-sveltekit/.prettierrc new file mode 100644 index 0000000..7ebb855 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/.prettierrc @@ -0,0 +1,15 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} diff --git a/packages/templates/template-ext-sveltekit/CHANGELOG.md b/packages/templates/template-ext-sveltekit/CHANGELOG.md new file mode 100644 index 0000000..4f20216 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/CHANGELOG.md @@ -0,0 +1,15 @@ +# template-ext-sveltekit + +## 0.0.3 + +### Patch Changes + +- Updated dependencies + - @kksh/api@0.0.4 + +## 0.0.2 + +### Patch Changes + +- Updated dependencies [fba6a49] + - @kksh/svelte@0.0.2 diff --git a/packages/templates/template-ext-sveltekit/README.md b/packages/templates/template-ext-sveltekit/README.md new file mode 100644 index 0000000..8bc14a0 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/README.md @@ -0,0 +1,69 @@ +# Kunkun Custom UI Extension Template (SvelteKit) + +[Custom UI Extension Documentation](https://docs.kunkun.sh/extensions/custom-ui-ext/) + +This is a template for a custom UI extension. + +This type of extension is basically a static website. You can use any frontend framework you like, this template uses [SvelteKit](https://svelte.dev/). + +It is assumed that you have some knowledge of frontend development with SvelteKit. + +## Development + +Development is the same as developing a normal website. + +```bash +pnpm install +pnpm dev +pnpm build +``` + +- To develop and preview the extension in Kunkun, you need to run the `Add Dev Extension` command in Kunkun, and register this extension's path. + +In `package.json`, `"devMain"` is the url for development server, and `"main"` is the path to static `.html` file for production. + +To load the extension in development mode, you have to enable it with `Toggle Dev Extension Live Load Mode` command in Kunkun. A `Live` badge will be shown on the commands. This indicates that dev extensions will be loaded from `devMain` instead of `main`. + +## Advanced + +### Rendering Mode + +This is a Meta-Framework template, and already configured with SSG rendering mode. +Please do not enable SSR unless you know what you are doing. +There will not be a JS runtime in production, and Kunkun always load the extension as static files. + +The main benefit of using a meta-framework is that it comes with routing, and will output multiple `.html` files, which makes multi-command support much easier. + +## Verify Build and Publish + +```bash +pnpm build # make sure the build npm script works +npx kksh@latest verify # Verify some basic settings before publishing +``` + +It is recommended to build the extension with the same environment our CI uses. + +The docker image used by our CI is `huakunshen/kunkun-ext-builder:latest`. + +You can use the following command to build the extension with the same environment our CI uses. +This requires you to have docker installed, and the shell you are using has access to it via `docker` command. + +```bash +npx kksh@latest build # Build the extension with +``` + +`pnpm` is used to install dependencies and build the extension. + +The docker image environment also has `node`, `pnpm`, `npm`, `bun`, `deno` installed. +If your build failed, try debug with `huakunshen/kunkun-ext-builder:latest` image in interative mode and bind your extension volume to `/workspace`. + +After build successfully, you should find a tarball file ends with `.tgz` in the root of your extension. +The tarball is packaged with `npm pack` command. You can uncompress it to see if it contains all the necessary files. + +This tarball is the final product that will be published and installed in Kunkun. You can further verify your extension by installing this tarball directly in Kunkun. + +After verifying the tarball, it's ready to be published. + +Fork [KunkunExtensions](https://github.com/kunkunsh/KunkunExtensions) repo, add your extension to the `extensions` directory, and create a PR. + +Once CI passed and PR merged, you can use your extension in Kunkun. diff --git a/packages/templates/template-ext-sveltekit/components.json b/packages/templates/template-ext-sveltekit/components.json new file mode 100644 index 0000000..5a53aa5 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/components.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://shadcn-svelte.com/schema.json", + "style": "new-york", + "tailwind": { + "config": "tailwind.config.ts", + "css": "src/app.css", + "baseColor": "neutral" + }, + "aliases": { + "components": "$lib/components", + "utils": "$lib/utils" + }, + "typescript": true +} \ No newline at end of file diff --git a/packages/templates/template-ext-sveltekit/eslint.config.js b/packages/templates/template-ext-sveltekit/eslint.config.js new file mode 100644 index 0000000..62dbd03 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/eslint.config.js @@ -0,0 +1,33 @@ +import js from '@eslint/js'; +import ts from 'typescript-eslint'; +import svelte from 'eslint-plugin-svelte'; +import prettier from 'eslint-config-prettier'; +import globals from 'globals'; + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + js.configs.recommended, + ...ts.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + ...svelte.configs['flat/prettier'], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], + languageOptions: { + parserOptions: { + parser: ts.parser + } + } + }, + { + ignores: ['build/', '.svelte-kit/', 'dist/'] + } +]; diff --git a/packages/templates/template-ext-sveltekit/package.json b/packages/templates/template-ext-sveltekit/package.json new file mode 100644 index 0000000..3e53075 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/package.json @@ -0,0 +1,84 @@ +{ + "$schema": "./node_modules/@kksh/api/dist/schema.json", + "name": "template-ext-sveltekit", + "version": "0.0.3", + "private": true, + "kunkun": { + "name": "TODO: Change Display Name", + "shortDescription": "A Custom UI template for sveltekit", + "longDescription": "A Custom UI template for sveltekit", + "identifier": "template-ext-sveltekit", + "icon": { + "type": "iconify", + "value": "logos:svelte-icon" + }, + "demoImages": [], + "permissions": [ + "clipboard:read-text", + "notification:all" + ], + "customUiCmds": [ + { + "main": "/", + "dist": "build", + "devMain": "http://localhost:5173", + "name": "Sveltekit Template Home Page", + "cmds": [] + }, + { + "main": "about", + "dist": "build", + "devMain": "http://localhost:5173/about", + "name": "Sveltekit Template About Page", + "cmds": [] + } + ], + "templateUiCmds": [] + }, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "dependencies": { + "@kksh/api": "workspace:*", + "@kksh/svelte": "0.1.4", + "clsx": "^2.1.1", + "lucide-svelte": "^0.416.0", + "mode-watcher": "^0.4.0", + "tailwind-merge": "^2.4.0", + "tailwind-variants": "^0.2.1" + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^4.0.0", + "svelte": "^5.0.0", + "svelte-check": "^4.0.0", + "typescript": "^5.0.0", + "vite": "^5.0.3", + "@sveltejs/adapter-static": "^3.0.6", + "@tailwindcss/typography": "^0.5.13", + "@types/eslint": "^9.6.0", + "autoprefixer": "^10.4.19", + "eslint": "^9.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "globals": "^15.0.0", + "postcss": "^8.4.38", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", + "prettier-plugin-tailwindcss": "^0.6.4", + "tailwindcss": "^3.4.4", + "typescript-eslint": "^8.0.0-alpha.20" + }, + "type": "module", + "files": [ + "build", + ".gitignore" + ] +} diff --git a/packages/templates/template-ext-sveltekit/postcss.config.js b/packages/templates/template-ext-sveltekit/postcss.config.js new file mode 100644 index 0000000..0f77216 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {} + } +}; diff --git a/packages/templates/template-ext-sveltekit/src/app.css b/packages/templates/template-ext-sveltekit/src/app.css new file mode 100644 index 0000000..7c7fb79 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/app.css @@ -0,0 +1,80 @@ +@import url("@kksh/svelte/themes"); +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + :root { + --background: 0 0% 100%; + --foreground: 0 0% 3.9%; + + --muted: 0 0% 96.1%; + --muted-foreground: 0 0% 45.1%; + + --popover: 0 0% 100%; + --popover-foreground: 0 0% 3.9%; + + --card: 0 0% 100%; + --card-foreground: 0 0% 3.9%; + + --border: 0 0% 89.8%; + --input: 0 0% 89.8%; + + --primary: 0 0% 9%; + --primary-foreground: 0 0% 98%; + + --secondary: 0 0% 96.1%; + --secondary-foreground: 0 0% 9%; + + --accent: 0 0% 96.1%; + --accent-foreground: 0 0% 9%; + + --destructive: 0 72.2% 50.6%; + --destructive-foreground: 0 0% 98%; + + --ring: 0 0% 3.9%; + + --radius: 0.5rem; + } + + .dark { + --background: 0 0% 3.9%; + --foreground: 0 0% 98%; + + --muted: 0 0% 14.9%; + --muted-foreground: 0 0% 63.9%; + + --popover: 0 0% 3.9%; + --popover-foreground: 0 0% 98%; + + --card: 0 0% 3.9%; + --card-foreground: 0 0% 98%; + + --border: 0 0% 14.9%; + --input: 0 0% 14.9%; + + --primary: 0 0% 98%; + --primary-foreground: 0 0% 9%; + + --secondary: 0 0% 14.9%; + --secondary-foreground: 0 0% 98%; + + --accent: 0 0% 14.9%; + --accent-foreground: 0 0% 98%; + + --destructive: 0 62.8% 30.6%; + --destructive-foreground: 0 0% 98%; + + --ring: 0 0% 83.1%; + } +} + +@layer base { + * { + @apply border-border; + } + + body { + @apply bg-background text-foreground; + } +} \ No newline at end of file diff --git a/packages/templates/template-ext-sveltekit/src/app.d.ts b/packages/templates/template-ext-sveltekit/src/app.d.ts new file mode 100644 index 0000000..743f07b --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/packages/templates/template-ext-sveltekit/src/app.html b/packages/templates/template-ext-sveltekit/src/app.html new file mode 100644 index 0000000..77a5ff5 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/packages/templates/template-ext-sveltekit/src/lib/components/ThemeCustomizer.svelte b/packages/templates/template-ext-sveltekit/src/lib/components/ThemeCustomizer.svelte new file mode 100644 index 0000000..6901dc7 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/lib/components/ThemeCustomizer.svelte @@ -0,0 +1,20 @@ + + + diff --git a/packages/templates/template-ext-sveltekit/src/lib/index.ts b/packages/templates/template-ext-sveltekit/src/lib/index.ts new file mode 100644 index 0000000..856f2b6 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/lib/index.ts @@ -0,0 +1 @@ +// place files you want to import through the `$lib` alias in this folder. diff --git a/packages/templates/template-ext-sveltekit/src/lib/utils.ts b/packages/templates/template-ext-sveltekit/src/lib/utils.ts new file mode 100644 index 0000000..8871245 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/lib/utils.ts @@ -0,0 +1,62 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; +import { cubicOut } from "svelte/easing"; +import type { TransitionConfig } from "svelte/transition"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} + +type FlyAndScaleParams = { + y?: number; + x?: number; + start?: number; + duration?: number; +}; + +export const flyAndScale = ( + node: Element, + params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 } +): TransitionConfig => { + const style = getComputedStyle(node); + const transform = style.transform === "none" ? "" : style.transform; + + const scaleConversion = ( + valueA: number, + scaleA: [number, number], + scaleB: [number, number] + ) => { + const [minA, maxA] = scaleA; + const [minB, maxB] = scaleB; + + const percentage = (valueA - minA) / (maxA - minA); + const valueB = percentage * (maxB - minB) + minB; + + return valueB; + }; + + const styleToString = ( + style: Record + ): string => { + return Object.keys(style).reduce((str, key) => { + if (style[key] === undefined) return str; + return str + `${key}:${style[key]};`; + }, ""); + }; + + return { + duration: params.duration ?? 200, + delay: 0, + css: (t) => { + const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]); + const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]); + const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]); + + return styleToString({ + transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`, + opacity: t + }); + }, + easing: cubicOut + }; +}; \ No newline at end of file diff --git a/packages/templates/template-ext-sveltekit/src/routes/+layout.svelte b/packages/templates/template-ext-sveltekit/src/routes/+layout.svelte new file mode 100644 index 0000000..1179a2b --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/routes/+layout.svelte @@ -0,0 +1,19 @@ + + + + + + diff --git a/packages/templates/template-ext-sveltekit/src/routes/+layout.ts b/packages/templates/template-ext-sveltekit/src/routes/+layout.ts new file mode 100644 index 0000000..ceccaaf --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/routes/+layout.ts @@ -0,0 +1,2 @@ +export const prerender = true; +export const ssr = false; diff --git a/packages/templates/template-ext-sveltekit/src/routes/+page.svelte b/packages/templates/template-ext-sveltekit/src/routes/+page.svelte new file mode 100644 index 0000000..9aa172d --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/routes/+page.svelte @@ -0,0 +1,102 @@ + + + + + + + +
+ + No results found. + + console.log('selected:', v)}> + + + Calendar + + console.log('selected:', v)}> + + Search Emoji + + console.log('selected:', v)}> + + Calculator + + + + + console.log('selected:', v)}> + + Profile + ⌘P + + + + Billing + ⌘B + + console.log('selected:', v)}> + + Settings + ⌘S + + + +
+ + +
+ + + + + + +
+
+
+
diff --git a/packages/templates/template-ext-sveltekit/src/routes/about/+page.svelte b/packages/templates/template-ext-sveltekit/src/routes/about/+page.svelte new file mode 100644 index 0000000..1ea52f9 --- /dev/null +++ b/packages/templates/template-ext-sveltekit/src/routes/about/+page.svelte @@ -0,0 +1,15 @@ + + + + + About Page + + + + + + + diff --git a/packages/templates/template-ext-sveltekit/static/favicon.png b/packages/templates/template-ext-sveltekit/static/favicon.png new file mode 100644 index 0000000..825b9e6 Binary files /dev/null and b/packages/templates/template-ext-sveltekit/static/favicon.png differ diff --git a/packages/templates/template-ext-sveltekit/svelte.config.js b/packages/templates/template-ext-sveltekit/svelte.config.js new file mode 100644 index 0000000..03d229d --- /dev/null +++ b/packages/templates/template-ext-sveltekit/svelte.config.js @@ -0,0 +1,21 @@ +import adapter from '@sveltejs/adapter-static'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), + + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter({}), + alias: { + '@/*': './src/lib/*' + } + } +}; + +export default config; diff --git a/packages/templates/template-ext-sveltekit/tailwind.config.ts b/packages/templates/template-ext-sveltekit/tailwind.config.ts new file mode 100644 index 0000000..a47b85e --- /dev/null +++ b/packages/templates/template-ext-sveltekit/tailwind.config.ts @@ -0,0 +1,67 @@ +import { fontFamily } from 'tailwindcss/defaultTheme'; +import type { Config } from 'tailwindcss'; + +const config: Config = { + darkMode: ['class'], + content: [ + './src/**/*.{html,js,svelte,ts}', + 'node_modules/@kksh/svelte/dist/**/*.{html,js,svelte,ts}' + ], + safelist: ['dark'], + theme: { + container: { + center: true, + padding: '2rem', + screens: { + '2xl': '1400px' + } + }, + extend: { + colors: { + border: 'hsl(var(--border) / )', + input: 'hsl(var(--input) / )', + ring: 'hsl(var(--ring) / )', + background: 'hsl(var(--background) / )', + foreground: 'hsl(var(--foreground) / )', + primary: { + DEFAULT: 'hsl(var(--primary) / )', + foreground: 'hsl(var(--primary-foreground) / )' + }, + secondary: { + DEFAULT: 'hsl(var(--secondary) / )', + foreground: 'hsl(var(--secondary-foreground) / )' + }, + destructive: { + DEFAULT: 'hsl(var(--destructive) / )', + foreground: 'hsl(var(--destructive-foreground) / )' + }, + muted: { + DEFAULT: 'hsl(var(--muted) / )', + foreground: 'hsl(var(--muted-foreground) / )' + }, + accent: { + DEFAULT: 'hsl(var(--accent) / )', + foreground: 'hsl(var(--accent-foreground) / )' + }, + popover: { + DEFAULT: 'hsl(var(--popover) / )', + foreground: 'hsl(var(--popover-foreground) / )' + }, + card: { + DEFAULT: 'hsl(var(--card) / )', + foreground: 'hsl(var(--card-foreground) / )' + } + }, + borderRadius: { + lg: 'var(--radius)', + md: 'calc(var(--radius) - 2px)', + sm: 'calc(var(--radius) - 4px)' + }, + fontFamily: { + sans: [...fontFamily.sans] + } + } + } +}; + +export default config; diff --git a/packages/templates/template-ext-sveltekit/tsconfig.json b/packages/templates/template-ext-sveltekit/tsconfig.json new file mode 100644 index 0000000..fc93cbd --- /dev/null +++ b/packages/templates/template-ext-sveltekit/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./.svelte-kit/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "checkJs": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "moduleResolution": "bundler" + } + // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias + // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files + // + // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes + // from the referenced tsconfig.json - TypeScript does not merge them in +} diff --git a/packages/templates/template-ext-sveltekit/vite.config.ts b/packages/templates/template-ext-sveltekit/vite.config.ts new file mode 100644 index 0000000..bbf8c7d --- /dev/null +++ b/packages/templates/template-ext-sveltekit/vite.config.ts @@ -0,0 +1,6 @@ +import { sveltekit } from '@sveltejs/kit/vite'; +import { defineConfig } from 'vite'; + +export default defineConfig({ + plugins: [sveltekit()] +}); diff --git a/templates/template-ext-vue/.gitignore b/packages/templates/template-ext-vue/.gitignore similarity index 100% rename from templates/template-ext-vue/.gitignore rename to packages/templates/template-ext-vue/.gitignore diff --git a/templates/template-ext-vue/.vscode/extensions.json b/packages/templates/template-ext-vue/.vscode/extensions.json similarity index 100% rename from templates/template-ext-vue/.vscode/extensions.json rename to packages/templates/template-ext-vue/.vscode/extensions.json diff --git a/templates/template-ext-vue/CHANGELOG.md b/packages/templates/template-ext-vue/CHANGELOG.md similarity index 100% rename from templates/template-ext-vue/CHANGELOG.md rename to packages/templates/template-ext-vue/CHANGELOG.md diff --git a/templates/template-ext-vue/README.md b/packages/templates/template-ext-vue/README.md similarity index 100% rename from templates/template-ext-vue/README.md rename to packages/templates/template-ext-vue/README.md diff --git a/templates/template-ext-vue/components.json b/packages/templates/template-ext-vue/components.json similarity index 100% rename from templates/template-ext-vue/components.json rename to packages/templates/template-ext-vue/components.json diff --git a/templates/template-ext-vue/index.html b/packages/templates/template-ext-vue/index.html similarity index 100% rename from templates/template-ext-vue/index.html rename to packages/templates/template-ext-vue/index.html diff --git a/templates/template-ext-vue/package.json b/packages/templates/template-ext-vue/package.json similarity index 100% rename from templates/template-ext-vue/package.json rename to packages/templates/template-ext-vue/package.json diff --git a/templates/template-ext-vue/postcss.config.js b/packages/templates/template-ext-vue/postcss.config.js similarity index 100% rename from templates/template-ext-vue/postcss.config.js rename to packages/templates/template-ext-vue/postcss.config.js diff --git a/templates/template-ext-vue/public/vite.svg b/packages/templates/template-ext-vue/public/vite.svg similarity index 100% rename from templates/template-ext-vue/public/vite.svg rename to packages/templates/template-ext-vue/public/vite.svg diff --git a/templates/template-ext-vue/src/App.vue b/packages/templates/template-ext-vue/src/App.vue similarity index 100% rename from templates/template-ext-vue/src/App.vue rename to packages/templates/template-ext-vue/src/App.vue diff --git a/templates/template-ext-vue/src/assets/vue.svg b/packages/templates/template-ext-vue/src/assets/vue.svg similarity index 100% rename from templates/template-ext-vue/src/assets/vue.svg rename to packages/templates/template-ext-vue/src/assets/vue.svg diff --git a/templates/template-ext-vue/src/index.css b/packages/templates/template-ext-vue/src/index.css similarity index 100% rename from templates/template-ext-vue/src/index.css rename to packages/templates/template-ext-vue/src/index.css diff --git a/templates/template-ext-vue/src/lib/utils.ts b/packages/templates/template-ext-vue/src/lib/utils.ts similarity index 100% rename from templates/template-ext-vue/src/lib/utils.ts rename to packages/templates/template-ext-vue/src/lib/utils.ts diff --git a/templates/template-ext-vue/src/main.ts b/packages/templates/template-ext-vue/src/main.ts similarity index 100% rename from templates/template-ext-vue/src/main.ts rename to packages/templates/template-ext-vue/src/main.ts diff --git a/templates/template-ext-vue/src/vite-env.d.ts b/packages/templates/template-ext-vue/src/vite-env.d.ts similarity index 100% rename from templates/template-ext-vue/src/vite-env.d.ts rename to packages/templates/template-ext-vue/src/vite-env.d.ts diff --git a/templates/template-ext-vue/tailwind.config.js b/packages/templates/template-ext-vue/tailwind.config.js similarity index 100% rename from templates/template-ext-vue/tailwind.config.js rename to packages/templates/template-ext-vue/tailwind.config.js diff --git a/templates/template-ext-vue/tsconfig.app.json b/packages/templates/template-ext-vue/tsconfig.app.json similarity index 100% rename from templates/template-ext-vue/tsconfig.app.json rename to packages/templates/template-ext-vue/tsconfig.app.json diff --git a/templates/template-ext-vue/tsconfig.json b/packages/templates/template-ext-vue/tsconfig.json similarity index 100% rename from templates/template-ext-vue/tsconfig.json rename to packages/templates/template-ext-vue/tsconfig.json diff --git a/templates/template-ext-vue/tsconfig.node.json b/packages/templates/template-ext-vue/tsconfig.node.json similarity index 100% rename from templates/template-ext-vue/tsconfig.node.json rename to packages/templates/template-ext-vue/tsconfig.node.json diff --git a/templates/template-ext-vue/vite.config.ts b/packages/templates/template-ext-vue/vite.config.ts similarity index 100% rename from templates/template-ext-vue/vite.config.ts rename to packages/templates/template-ext-vue/vite.config.ts diff --git a/templates/template-ext-worker/.gitignore b/packages/templates/template-ext-worker/.gitignore similarity index 100% rename from templates/template-ext-worker/.gitignore rename to packages/templates/template-ext-worker/.gitignore diff --git a/templates/template-ext-worker/README.md b/packages/templates/template-ext-worker/README.md similarity index 100% rename from templates/template-ext-worker/README.md rename to packages/templates/template-ext-worker/README.md diff --git a/templates/template-ext-worker/build.ts b/packages/templates/template-ext-worker/build.ts similarity index 100% rename from templates/template-ext-worker/build.ts rename to packages/templates/template-ext-worker/build.ts diff --git a/templates/template-ext-worker/package.json b/packages/templates/template-ext-worker/package.json similarity index 100% rename from templates/template-ext-worker/package.json rename to packages/templates/template-ext-worker/package.json diff --git a/templates/template-ext-worker/src/i18n/en.ts b/packages/templates/template-ext-worker/src/i18n/en.ts similarity index 100% rename from templates/template-ext-worker/src/i18n/en.ts rename to packages/templates/template-ext-worker/src/i18n/en.ts diff --git a/templates/template-ext-worker/src/i18n/index.ts b/packages/templates/template-ext-worker/src/i18n/index.ts similarity index 100% rename from templates/template-ext-worker/src/i18n/index.ts rename to packages/templates/template-ext-worker/src/i18n/index.ts diff --git a/templates/template-ext-worker/src/i18n/zh.ts b/packages/templates/template-ext-worker/src/i18n/zh.ts similarity index 100% rename from templates/template-ext-worker/src/i18n/zh.ts rename to packages/templates/template-ext-worker/src/i18n/zh.ts diff --git a/templates/template-ext-worker/src/index.ts b/packages/templates/template-ext-worker/src/index.ts similarity index 100% rename from templates/template-ext-worker/src/index.ts rename to packages/templates/template-ext-worker/src/index.ts diff --git a/templates/template-ext-worker/tsconfig.json b/packages/templates/template-ext-worker/tsconfig.json similarity index 100% rename from templates/template-ext-worker/tsconfig.json rename to packages/templates/template-ext-worker/tsconfig.json