diff --git a/package.json b/package.json index 445ead0..7926c05 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "packages/*" ], "scripts": { - "dev": "esno ./scripts/build.mjs", + "build": "esno ./scripts/build.mjs", + "dev": "cd vite-cli && farm build --watch", "build:docs": "turbo run build --filter=docs", "serve": "turbo run docs --parallel", "lint": "turbo run lint", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0eddfa3..c57b8c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -85,7 +85,7 @@ importers: version: 6.6.3(ts-node@10.9.1)(typescript@5.0.2) turbo: specifier: latest - version: 1.8.2 + version: 1.10.12 typescript: specifier: ^5.0.0 version: 5.0.2 @@ -109,8 +109,8 @@ importers: vite-cli: dependencies: prettier: - specifier: latest - version: 3.0.0 + specifier: 2.8.0 + version: 2.8.0 devDependencies: '@types/node': specifier: ^18.11.9 @@ -3200,11 +3200,11 @@ packages: eslint-plugin-jsonc: 2.6.0(eslint@8.34.0) eslint-plugin-md: 1.0.19 eslint-plugin-n: 15.6.1(eslint@8.34.0) - eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.6.0)(eslint@8.34.0)(prettier@2.8.8) + eslint-plugin-prettier: 4.2.1(eslint-config-prettier@8.6.0)(eslint@8.34.0)(prettier@2.8.0) eslint-plugin-promise: 6.1.1(eslint@8.34.0) eslint-plugin-yml: 1.5.0(eslint@8.34.0) markdown-eslint-parser: 1.2.1 - prettier: 2.8.8 + prettier: 2.8.0 yaml-eslint-parser: 1.1.0 transitivePeerDependencies: - '@typescript-eslint/parser' @@ -3376,7 +3376,7 @@ packages: semver: 7.3.8 dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.6.0)(eslint@8.34.0)(prettier@2.8.8): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.6.0)(eslint@8.34.0)(prettier@2.8.0): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3389,7 +3389,7 @@ packages: dependencies: eslint: 8.34.0 eslint-config-prettier: 8.6.0(eslint@8.34.0) - prettier: 2.8.8 + prettier: 2.8.0 prettier-linter-helpers: 1.0.0 dev: true @@ -5876,16 +5876,16 @@ packages: fast-diff: 1.2.0 dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} + /prettier@2.8.0: + resolution: {integrity: sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==} engines: {node: '>=10.13.0'} hasBin: true - dev: true /prettier@3.0.0: resolution: {integrity: sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==} engines: {node: '>=14'} hasBin: true + dev: true /progress@2.0.3: resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} @@ -7427,65 +7427,65 @@ packages: fsevents: 2.3.2 dev: true - /turbo-darwin-64@1.8.2: - resolution: {integrity: sha512-j77U0uOeppENexFsIvvzExADSqMBEeCHnm+6LSNQfaajHSrbUVSTsuD6ZMYHamT6bslc+ZZm21jdecWkwZFBbw==} + /turbo-darwin-64@1.10.12: + resolution: {integrity: sha512-vmDfGVPl5/aFenAbOj3eOx3ePNcWVUyZwYr7taRl0ZBbmv2TzjRiFotO4vrKCiTVnbqjQqAFQWY2ugbqCI1kOQ==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.8.2: - resolution: {integrity: sha512-1NoAvjlwt2wycsAFJouauy9epn9DptSMy6BoGqxJVc4jiibsLepp9qYc4f1/ln0zjd3FR1IvhGOiBfdpqMN7hg==} + /turbo-darwin-arm64@1.10.12: + resolution: {integrity: sha512-3JliEESLNX2s7g54SOBqqkqJ7UhcOGkS0ywMr5SNuvF6kWVTbuUq7uBU/sVbGq8RwvK1ONlhPvJne5MUqBCTCQ==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.8.2: - resolution: {integrity: sha512-TcT3CRYnBYA46kLGGbGC2jDyCEAvMgVpUdpIZGTmod48EKpZaEfVgTkpa4GJde8W68yRFogPZjPVL3yJHFpXSA==} + /turbo-linux-64@1.10.12: + resolution: {integrity: sha512-siYhgeX0DidIfHSgCR95b8xPee9enKSOjCzx7EjTLmPqPaCiVebRYvbOIYdQWRqiaKh9yfhUtFmtMOMScUf1gg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.8.2: - resolution: {integrity: sha512-Mb9+KBy4YJzPMZ6WGoMzMVZ6EtueCSvOvgmNpVFgkwbtabfBuaBOvN+irtg4RRSWvJQTDTziLABieocEEXZImQ==} + /turbo-linux-arm64@1.10.12: + resolution: {integrity: sha512-K/ZhvD9l4SslclaMkTiIrnfcACgos79YcAo4kwc8bnMQaKuUeRpM15sxLpZp3xDjDg8EY93vsKyjaOhdFG2UbA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.8.2: - resolution: {integrity: sha512-/+R5ikRrw2w2w38JtNPubGLIQHgUC70m783DI9aPgaM5c8P5D/Y0k6HgjuC/uXgiaz2h3R7p7YWlr+2/E0bqyA==} + /turbo-windows-64@1.10.12: + resolution: {integrity: sha512-7FSgSwvktWDNOqV65l9AbZwcoueAILeE4L7JvjauNASAjjbuzXGCEq5uN8AQU3U5BOFj4TdXrVmO2dX+lLu8Zg==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.8.2: - resolution: {integrity: sha512-s07viz5nXSx4kyiksuPM4FGLRkoaGMaw0BpwFjdRQsl1p+WclUN1IPdokVPKOmFpu5pNCVYlG/raP/mXAEzDCg==} + /turbo-windows-arm64@1.10.12: + resolution: {integrity: sha512-gCNXF52dwom1HLY9ry/cneBPOKTBHhzpqhMylcyvJP0vp9zeMQQkt6yjYv+6QdnmELC92CtKNp2FsNZo+z0pyw==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.8.2: - resolution: {integrity: sha512-G/uJx6bZK5RwTWHsRN/MP0MvXFznmCaL3MQXdSf+OG/q0o8GE7+yivyyWEplWI1Asc8AEN909A/wlIkoz2FKTg==} + /turbo@1.10.12: + resolution: {integrity: sha512-WM3+jTfQWnB9W208pmP4oeehZcC6JQNlydb/ZHMRrhmQa+htGhWLCzd6Q9rLe0MwZLPpSPFV2/bN5egCLyoKjQ==} hasBin: true requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.8.2 - turbo-darwin-arm64: 1.8.2 - turbo-linux-64: 1.8.2 - turbo-linux-arm64: 1.8.2 - turbo-windows-64: 1.8.2 - turbo-windows-arm64: 1.8.2 + turbo-darwin-64: 1.10.12 + turbo-darwin-arm64: 1.10.12 + turbo-linux-64: 1.10.12 + turbo-linux-arm64: 1.10.12 + turbo-windows-64: 1.10.12 + turbo-windows-arm64: 1.10.12 dev: true /type-check@0.3.2: diff --git a/scripts/build.mjs b/scripts/build.mjs index 4e05cc8..c44bfad 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -7,7 +7,7 @@ const watcher = chokidar.watch('file, dir, glob, or array', { persistent: true }) -await esbuild.build({ + await esbuild.build({ bundle: true, entryPoints: ['vite-cli/src/index.ts'], outfile: 'vite-cli/outfile.cjs', @@ -78,6 +78,8 @@ await esbuild.build({ ] }) + + // await esbuild.build({ // bundle: true, // entryPoints: ['vite-cli/src/index.ts'], diff --git a/vite-cli/package.json b/vite-cli/package.json index 1f10f8d..c282612 100644 --- a/vite-cli/package.json +++ b/vite-cli/package.json @@ -1,6 +1,6 @@ { "name": "create-vite-template", - "version": "0.5.3", + "version": "0.5.4", "description": "", "bin": { "vite-app": "./outfile.cjs", @@ -13,7 +13,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "copy": "esno ./scripts/dev.mjs", "build": "farm build", - "build:tsup": "tsup", + "build:tsup": "tsup --watch", "dev": "farm watch" }, "keywords": [], @@ -23,7 +23,7 @@ "repository": "https://github.com/ErKeLost/vite-cli", "bugs": "https://github.com/ErKeLost/vite-cli/issues", "dependencies": { - "prettier": "latest" + "prettier": "2.8.0" }, "devDependencies": { "@types/node": "^18.11.9", diff --git a/vite-cli/src/core/questions/vue/components.ts b/vite-cli/src/core/questions/vue/components.ts index 5f19790..f30cd8b 100644 --- a/vite-cli/src/core/questions/vue/components.ts +++ b/vite-cli/src/core/questions/vue/components.ts @@ -4,14 +4,16 @@ export default { message: 'choose UI frameWork', choices: [ { title: 'Element Plus', value: 'elementPlus' }, - { title: 'Tiny Vue', value: 'tinyVue' }, { title: 'Ant Design Vue', value: 'antDesignVue' }, { title: 'Vuetify3', value: 'vuetify' }, { title: 'Naive UI', value: 'naiveUI' }, { title: 'Varlet Pc', value: 'varlet' }, - { title: 'DevUI', value: 'devUI' }, { title: 'arco-design', value: 'arco' }, { title: 'TDesign', value: 'tencent' }, + { title: 'Tiny Vue', value: 'tinyVue' }, + { title: 'DevUI', value: 'devUI' }, + { title: 'TDesign', value: 'tencent' }, + { title: 'Shuimo', value: 'shuimo' }, { title: 'Vant 4.x', value: 'vant' }, { title: 'tdesign-mobile-vue', value: 'tencent-mobile' } ] diff --git a/vite-cli/src/dependence/vue/components.ts b/vite-cli/src/dependence/vue/components.ts index eede4a8..b89c1d7 100644 --- a/vite-cli/src/dependence/vue/components.ts +++ b/vite-cli/src/dependence/vue/components.ts @@ -94,6 +94,13 @@ const vant = { dev: 'pro' } +const shuimo = { + name: 'shuimo-ui', + version: '^0.3.0-alpha.7', + stableVersion: '^0.3.0-alpha.7', + theme: false, + dev: 'pro' +} export { varlet, tinyVue, @@ -104,5 +111,6 @@ export { naiveUI, antDesignVue, elementPlus, - vant + vant, + shuimo } diff --git a/vite-cli/src/utils/ejsRender.ts b/vite-cli/src/utils/ejsRender.ts index a8c3283..1af2faa 100644 --- a/vite-cli/src/utils/ejsRender.ts +++ b/vite-cli/src/utils/ejsRender.ts @@ -23,6 +23,7 @@ export async function ejsRender(filePath: string, name): Promise { // 获取后缀 const extname = path.extname(filePath).replace(/[.]/g, '') const opts = await prettier.resolveConfig(templatePath) + try { switch (extname) { case 'ts': diff --git a/vite-cli/template/vue/src/assets/shuimo.svg b/vite-cli/template/vue/src/assets/shuimo.svg new file mode 100644 index 0000000..3770acc --- /dev/null +++ b/vite-cli/template/vue/src/assets/shuimo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vite-cli/template/vue/src/components/HelloWorld.ejs b/vite-cli/template/vue/src/components/HelloWorld.ejs index 8bccc27..cb443f7 100644 --- a/vite-cli/template/vue/src/components/HelloWorld.ejs +++ b/vite-cli/template/vue/src/components/HelloWorld.ejs @@ -23,6 +23,10 @@ NaiveUi + <% } -%> <% if (components === 'shuimo') { -%> + Shuimo <% } -%> <% if (components === 'devUI') { -%> DevUI Home <% } -%> + <% if (components === 'shuimo') { -%> + Home + <% } -%> <% if (components === 'arco') { -%> Home <% } -%> @@ -73,6 +76,9 @@ const { count } = storeToRefs(counterStore); <% if (components === 'tinyVue') { -%> About <% } -%> + <% if (components === 'shuimo') { -%> + About + <% } -%> <% if (components === 'naiveUI') { -%> About <% } -%> diff --git a/vite-cli/template/vue/src/main.ejs b/vite-cli/template/vue/src/main.ejs index 8d3458c..9ca243d 100644 --- a/vite-cli/template/vue/src/main.ejs +++ b/vite-cli/template/vue/src/main.ejs @@ -8,6 +8,10 @@ import { createApp } from 'vue' <% if (tinyVue) { -%> import TinyVue from '@opentiny/vue' <% } -%> +<% if (components === 'shuimo') { -%> + import { createMUI } from 'shuimo-ui'; + import 'shuimo-ui/dist/style.css'; +<% } -%> <% if (components === 'antDesignVue') { -%> import Antd from 'ant-design-vue' <% if (useTheme) { -%> @@ -60,6 +64,9 @@ async function bootStrap() { <% if (components === 'antDesignVue') { -%> app.use(Antd) <% } -%> + <% if (components === 'shuimo') { -%> + app.use(createMUI()) + <% } -%> <% if (components === 'vuetify') { -%> app.use(createVuetify); <% } -%>