Skip to content

Commit

Permalink
chore: update new template
Browse files Browse the repository at this point in the history
  • Loading branch information
ErKeLost committed Sep 2, 2023
1 parent e1dceb8 commit 9223da6
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 38 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 30 additions & 30 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -78,6 +78,8 @@ await esbuild.build({
]
})



// await esbuild.build({
// bundle: true,
// entryPoints: ['vite-cli/src/index.ts'],
Expand Down
6 changes: 3 additions & 3 deletions vite-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-vite-template",
"version": "0.5.3",
"version": "0.5.4",
"description": "",
"bin": {
"vite-app": "./outfile.cjs",
Expand All @@ -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": [],
Expand All @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions vite-cli/src/core/questions/vue/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
]
Expand Down
10 changes: 9 additions & 1 deletion vite-cli/src/dependence/vue/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -104,5 +111,6 @@ export {
naiveUI,
antDesignVue,
elementPlus,
vant
vant,
shuimo
}
1 change: 1 addition & 0 deletions vite-cli/src/utils/ejsRender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export async function ejsRender(filePath: string, name): Promise<void> {
// 获取后缀
const extname = path.extname(filePath).replace(/[.]/g, '')
const opts = await prettier.resolveConfig(templatePath)

try {
switch (extname) {
case 'ts':
Expand Down
1 change: 1 addition & 0 deletions vite-cli/template/vue/src/assets/shuimo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions vite-cli/template/vue/src/components/HelloWorld.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<a target="_blank" href="https://www.naiveui.com/zh-CN/os-theme"
>NaiveUi</a
>
<% } -%> <% if (components === 'shuimo') { -%>
<a target="_blank" href="https://shuimo.design/main"
>Shuimo</a
>
<% } -%> <% if (components === 'devUI') { -%>
<a target="_blank" href="https://github.com/DevCloudFE/vue-devui"
>DevUI</a
Expand Down
6 changes: 6 additions & 0 deletions vite-cli/template/vue/src/components/Welcome.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const { count } = storeToRefs(counterStore);
<% if (components === 'naiveUI') { -%>
<n-button type="primary">Home</n-button>
<% } -%>
<% if (components === 'shuimo') { -%>
<m-button type="primary">Home</m-button>
<% } -%>
<% if (components === 'arco') { -%>
<a-button type="primary">Home</a-button>
<% } -%>
Expand Down Expand Up @@ -73,6 +76,9 @@ const { count } = storeToRefs(counterStore);
<% if (components === 'tinyVue') { -%>
<TinyButton type="primary">About</TinyButton>
<% } -%>
<% if (components === 'shuimo') { -%>
<m-button type="primary">About</m-button>
<% } -%>
<% if (components === 'naiveUI') { -%>
<n-button type="primary">About</n-button>
<% } -%>
Expand Down
7 changes: 7 additions & 0 deletions vite-cli/template/vue/src/main.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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) { -%>
Expand Down Expand Up @@ -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);
<% } -%>
Expand Down

0 comments on commit 9223da6

Please sign in to comment.