@tanyueran/cli 0.0.21 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +1 -1
  3. package/package.json +1 -1
  4. package/template/module/vue/vue-ts-empty/index.module.scss.hbs +6 -0
  5. package/template/module/vue/vue-ts-empty/index.vue.hbs +55 -0
  6. package/template/project/vue/vite-vue-ts/.editorconfig +8 -0
  7. package/template/project/vue/vite-vue-ts/.env +0 -0
  8. package/template/project/vue/vite-vue-ts/.env.dev +1 -0
  9. package/template/project/vue/vite-vue-ts/.env.qa +1 -0
  10. package/template/project/vue/vite-vue-ts/.gitattributes +1 -0
  11. package/template/project/vue/vite-vue-ts/.prettierrc.json +6 -0
  12. package/template/project/vue/vite-vue-ts/.vscode/extensions.json +8 -0
  13. package/template/project/vue/vite-vue-ts/README.md +39 -0
  14. package/template/project/vue/vite-vue-ts/build/plugins/vite-plugin-html-replace-flag.js +13 -0
  15. package/template/project/vue/vite-vue-ts/env.d.ts +1 -0
  16. package/template/project/vue/vite-vue-ts/eslint.config.ts +22 -0
  17. package/template/project/vue/vite-vue-ts/index.html +13 -0
  18. package/template/project/vue/vite-vue-ts/package.json.hbs +40 -0
  19. package/template/project/vue/vite-vue-ts/pnpm-lock.yaml +3219 -0
  20. package/template/project/vue/vite-vue-ts/public/favicon.ico +0 -0
  21. package/template/project/vue/vite-vue-ts/src/App.vue +15 -0
  22. package/template/project/vue/vite-vue-ts/src/main.ts +12 -0
  23. package/template/project/vue/vite-vue-ts/src/router/index.ts +23 -0
  24. package/template/project/vue/vite-vue-ts/src/stores/counter.ts +12 -0
  25. package/template/project/vue/vite-vue-ts/src/views/about/index.vue +28 -0
  26. package/template/project/vue/vite-vue-ts/src/views/home/index.vue +28 -0
  27. package/template/project/vue/vite-vue-ts/tsconfig.json +22 -0
  28. package/template/project/vue/vite-vue-ts/vite.config.ts +45 -0
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <div>
3
+ <div>
4
+ <router-link to="/">Home</router-link> |
5
+ <router-link to="/about">About</router-link>
6
+ </div>
7
+ <div>
8
+ <router-view />
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup lang="ts"></script>
14
+
15
+ <style scoped></style>
@@ -0,0 +1,12 @@
1
+ import { createApp } from 'vue'
2
+ import { createPinia } from 'pinia'
3
+
4
+ import App from './App.vue'
5
+ import router from './router'
6
+
7
+ const app = createApp(App)
8
+
9
+ app.use(createPinia())
10
+ app.use(router)
11
+
12
+ app.mount('#app')
@@ -0,0 +1,23 @@
1
+ import { createRouter, createWebHistory } from 'vue-router'
2
+
3
+ const router = createRouter({
4
+ history: createWebHistory(),
5
+ routes: [
6
+ {
7
+ path: '/',
8
+ redirect: '/home',
9
+ },
10
+ {
11
+ path: '/home',
12
+ name: 'home',
13
+ component: () => import('@/views/home/index.vue'),
14
+ },
15
+ {
16
+ path: '/about',
17
+ name: 'about',
18
+ component: () => import('@/views/about/index.vue'),
19
+ },
20
+ ],
21
+ })
22
+
23
+ export default router
@@ -0,0 +1,12 @@
1
+ import { ref, computed } from 'vue'
2
+ import { defineStore } from 'pinia'
3
+
4
+ export const useCounterStore = defineStore('counter', () => {
5
+ const count = ref(0)
6
+ const doubleCount = computed(() => count.value * 2)
7
+ function increment() {
8
+ count.value++
9
+ }
10
+
11
+ return { count, doubleCount, increment }
12
+ })
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div></div>
3
+ </template>
4
+ <script setup lang="ts">
5
+ import { defineOptions } from 'vue'
6
+
7
+ defineOptions({
8
+ name: 'AboutPage',
9
+ })
10
+
11
+ // #region Prop
12
+ //#endregion
13
+
14
+ // #region 变量
15
+ //#endregion
16
+
17
+ // #region 计算属性
18
+ //#endregion
19
+
20
+ // #region 监听器
21
+ //#endregion
22
+
23
+ // #region 方法
24
+ //#endregion
25
+
26
+ // #region 生命周期
27
+ //#endregion
28
+ </script>
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div>home</div>
3
+ </template>
4
+ <script setup lang="ts">
5
+ import { defineOptions } from 'vue'
6
+
7
+ defineOptions({
8
+ name: 'HomePage',
9
+ })
10
+
11
+ // #region Prop
12
+ //#endregion
13
+
14
+ // #region 变量
15
+ //#endregion
16
+
17
+ // #region 计算属性
18
+ //#endregion
19
+
20
+ // #region 监听器
21
+ //#endregion
22
+
23
+ // #region 方法
24
+ //#endregion
25
+
26
+ // #region 生命周期
27
+ //#endregion
28
+ </script>
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "moduleResolution": "node",
6
+ "strict": true,
7
+ "jsx": "preserve",
8
+ "sourceMap": false,
9
+ "resolveJsonModule": true,
10
+ "esModuleInterop": true,
11
+ "allowJs": true,
12
+ "lib": ["esnext", "dom"],
13
+ "types": ["vite/client"],
14
+ "baseUrl": ".",
15
+ "paths": {
16
+ "@/*": ["src/*"]
17
+ },
18
+ "outDir": "dist"
19
+ },
20
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
21
+ "exclude": ["node-modules", "vite.config.ts", "./src/js-utils/**"]
22
+ }
@@ -0,0 +1,45 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+
3
+ import { defineConfig } from 'vite'
4
+ import vue from '@vitejs/plugin-vue'
5
+ import vueJsx from '@vitejs/plugin-vue-jsx'
6
+ import vueDevTools from 'vite-plugin-vue-devtools'
7
+ import { VitePluginHtmlReplaceFlag } from './build/plugins/vite-plugin-html-replace-flag'
8
+
9
+ const proxyConfig = {
10
+ '/api': {
11
+ target: 'http://localhost:8080',
12
+ changeOrigin: true,
13
+ rewrite: (path) => path.replace(/^\/api/, ''),
14
+ },
15
+ }
16
+
17
+ // https://vite.dev/config/
18
+ export default defineConfig({
19
+ plugins: [vue(), vueJsx(), vueDevTools(), VitePluginHtmlReplaceFlag()],
20
+ resolve: {
21
+ alias: {
22
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
23
+ },
24
+ },
25
+ build: {
26
+ outDir: 'dist',
27
+ rollupOptions: {
28
+ output: {
29
+ manualChunks: {
30
+ vue: ['vue'],
31
+ 'vue-router': ['vue-router'],
32
+ pinia: ['pinia'],
33
+ },
34
+ },
35
+ },
36
+ },
37
+ server: {
38
+ port: 3000,
39
+ proxy: proxyConfig,
40
+ },
41
+ preview: {
42
+ port: 8081,
43
+ proxy: proxyConfig,
44
+ },
45
+ })