@tomjs/create-app 5.0.0 → 5.2.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 (79) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +5 -5
  3. package/templates/config/base/package.json +3 -0
  4. package/templates/config/electron/package.json +2 -2
  5. package/templates/config/hbuilderx/extension/index.ts +22 -0
  6. package/templates/config/hbuilderx/extension/webview.ts +71 -0
  7. package/templates/config/hbuilderx/package.json +96 -0
  8. package/templates/config/hbuilderx/tsconfig.node.json +15 -0
  9. package/templates/config/package.json +26 -15
  10. package/templates/config/react/package.json +3 -3
  11. package/templates/{web-react → config/react}/tsconfig.app.json +3 -1
  12. package/templates/config/style/package.json +2 -2
  13. package/templates/config/style/stylelint.config.mjs +4 -0
  14. package/templates/config/vscode/package.json +1 -1
  15. package/templates/config/vue/_eslint.config.mjs +5 -0
  16. package/templates/config/vue/env.d.ts +3 -0
  17. package/templates/config/vue/package.json +8 -2
  18. package/templates/{vscode-vue → config/vue}/tsconfig.app.json +8 -3
  19. package/templates/config/vue/uno.config.ts +9 -0
  20. package/templates/electron-react/vite.config.ts +7 -3
  21. package/templates/electron-vue/package.json +3 -1
  22. package/templates/electron-vue/vite.config.ts +16 -2
  23. package/templates/hbuilderx-base/README.md +20 -0
  24. package/templates/hbuilderx-base/package.json +52 -0
  25. package/templates/hbuilderx-base/src/env.d.ts +1 -0
  26. package/templates/hbuilderx-base/src/index.ts +17 -0
  27. package/templates/hbuilderx-base/tsconfig.json +7 -0
  28. package/templates/hbuilderx-base/tsdown.config.ts +13 -0
  29. package/templates/hbuilderx-react/README.md +25 -0
  30. package/templates/hbuilderx-react/index.html +13 -0
  31. package/templates/hbuilderx-react/package.json +12 -0
  32. package/templates/hbuilderx-react/pnpm-workspace.yaml +5 -0
  33. package/templates/hbuilderx-react/src/App.css +45 -0
  34. package/templates/hbuilderx-react/src/App.tsx +41 -0
  35. package/templates/hbuilderx-react/src/assets/react.svg +1 -0
  36. package/templates/hbuilderx-react/src/assets/vite.svg +1 -0
  37. package/templates/hbuilderx-react/src/index.css +73 -0
  38. package/templates/hbuilderx-react/src/main.tsx +10 -0
  39. package/templates/hbuilderx-react/tsconfig.app.json +18 -0
  40. package/templates/hbuilderx-react/vite.config.ts +20 -0
  41. package/templates/hbuilderx-vue/README.md +26 -0
  42. package/templates/hbuilderx-vue/index.html +13 -0
  43. package/templates/hbuilderx-vue/package.json +12 -0
  44. package/templates/hbuilderx-vue/pnpm-workspace.yaml +4 -0
  45. package/templates/hbuilderx-vue/src/App.vue +32 -0
  46. package/templates/hbuilderx-vue/src/assets/vite.svg +1 -0
  47. package/templates/hbuilderx-vue/src/assets/vue.svg +1 -0
  48. package/templates/hbuilderx-vue/src/components/HelloWorld.vue +29 -0
  49. package/templates/hbuilderx-vue/src/main.ts +5 -0
  50. package/templates/hbuilderx-vue/src/style.css +68 -0
  51. package/templates/hbuilderx-vue/tsconfig.app.json +18 -0
  52. package/templates/hbuilderx-vue/vite.config.ts +31 -0
  53. package/templates/node-vite/examples/vue/src/App.vue +3 -3
  54. package/templates/node-vite/examples/vue/src/components/HelloWorld.vue +6 -4
  55. package/templates/vscode-react/package.json +1 -1
  56. package/templates/vscode-react/vite.config.ts +6 -2
  57. package/templates/vscode-vue/package.json +1 -1
  58. package/templates/vscode-vue/vite.config.ts +16 -2
  59. package/templates/web-react/public/vite.svg +1 -0
  60. package/templates/web-react/vite.config.ts +3 -1
  61. package/templates/web-vue/package.json +3 -0
  62. package/templates/web-vue/public/vite.svg +1 -0
  63. package/templates/web-vue/src/App.vue +3 -3
  64. package/templates/web-vue/src/components/HelloWorld.vue +6 -4
  65. package/templates/web-vue/src/main.ts +1 -1
  66. package/templates/web-vue/vite.config.ts +19 -1
  67. package/templates/vscode-react/tsconfig.app.json +0 -8
  68. package/templates/vscode-vue/tsconfig.node.json +0 -8
  69. package/templates/web-vue/tsconfig.app.json +0 -9
  70. /package/templates/{vscode-react → config/hbuilderx}/tsconfig.json +0 -0
  71. /package/templates/{vscode-vue → config/react}/tsconfig.json +0 -0
  72. /package/templates/{web-react → config/react}/tsconfig.node.json +0 -0
  73. /package/templates/{web-react → config/vscode}/tsconfig.json +0 -0
  74. /package/templates/{vscode-react → config/vscode}/tsconfig.node.json +0 -0
  75. /package/templates/{web-vue → config/vue}/tsconfig.json +0 -0
  76. /package/templates/{web-vue → config/vue}/tsconfig.node.json +0 -0
  77. /package/templates/{config/react → electron-react}/public/vite.svg +0 -0
  78. /package/templates/{config/vue → electron-vue}/public/vite.svg +0 -0
  79. /package/templates/web-vue/src/{style.css → style.scss} +0 -0
@@ -1,16 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref } from 'vue';
3
3
 
4
- defineProps<{ msg: string }>()
4
+ defineProps<{ msg: string }>();
5
5
 
6
- const count = ref(0)
6
+ const count = ref(0);
7
7
  </script>
8
8
 
9
9
  <template>
10
10
  <h1>{{ msg }}</h1>
11
11
 
12
12
  <div class="card">
13
- <button type="button" @click="count++">count is {{ count }}</button>
13
+ <button type="button" @click="count++">
14
+ count is {{ count }}
15
+ </button>
14
16
  </div>
15
17
  </template>
16
18
 
@@ -7,6 +7,6 @@
7
7
  "license": "MIT",
8
8
  "main": "dist/extension/index.js",
9
9
  "scripts": {
10
- "build": "tsc -b && vite build"
10
+ "build": "tsc -b && vscode-dev && vite build"
11
11
  }
12
12
  }
@@ -1,4 +1,4 @@
1
- import path from 'node:path';
1
+ import { fileURLToPath, URL } from 'node:url';
2
2
  import vscode from '@tomjs/vite-plugin-vscode';
3
3
  import react from '@vitejs/plugin-react-swc';
4
4
  import { defineConfig } from 'vite';
@@ -8,9 +8,13 @@ export default defineConfig(() => {
8
8
  return {
9
9
  resolve: {
10
10
  alias: {
11
- '@': path.join(__dirname, 'src'),
11
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
12
12
  },
13
13
  },
14
+ build: {
15
+ chunkSizeWarningLimit: 102400,
16
+ reportCompressedSize: false,
17
+ },
14
18
  plugins: [
15
19
  react(),
16
20
  vscode(),
@@ -7,7 +7,7 @@
7
7
  "license": "MIT",
8
8
  "main": "dist/extension/index.js",
9
9
  "scripts": {
10
- "build": "vscode-dev && vue-tsc --noEmit && vite build"
10
+ "build": "vue-tsc --noEmit && vscode-dev && vite build"
11
11
  },
12
12
  "dependencies": {
13
13
  "vue-i18n": "^11.2.8"
@@ -1,16 +1,24 @@
1
- import path from 'node:path';
1
+ import { fileURLToPath, URL } from 'node:url';
2
2
  import vscode from '@tomjs/vite-plugin-vscode';
3
3
  import vue from '@vitejs/plugin-vue';
4
+ import UnoCSS from 'unocss/vite';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import Components from 'unplugin-vue-components/vite';
4
7
  import { defineConfig } from 'vite';
8
+ import devtools from 'vite-plugin-vue-devtools';
5
9
 
6
10
  // https://vitejs.dev/config/
7
11
  export default defineConfig(() => {
8
12
  return {
9
13
  resolve: {
10
14
  alias: {
11
- '@': path.join(__dirname, 'src'),
15
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
12
16
  },
13
17
  },
18
+ build: {
19
+ chunkSizeWarningLimit: 102400,
20
+ reportCompressedSize: false,
21
+ },
14
22
  plugins: [
15
23
  vue({
16
24
  template: {
@@ -19,7 +27,13 @@ export default defineConfig(() => {
19
27
  },
20
28
  },
21
29
  }),
30
+ AutoImport({
31
+ imports: ['vue'],
32
+ }),
33
+ Components(),
34
+ UnoCSS(),
22
35
  vscode(),
36
+ devtools(),
23
37
  ],
24
38
  };
25
39
  });
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,4 +1,5 @@
1
1
  import path from 'node:path';
2
+ import { fileURLToPath, URL } from 'node:url';
2
3
  import react from '@vitejs/plugin-react-swc';
3
4
  import { defineConfig } from 'vite';
4
5
 
@@ -6,8 +7,9 @@ import { defineConfig } from 'vite';
6
7
  export default defineConfig({
7
8
  resolve: {
8
9
  alias: {
10
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
9
11
  // https://github.com/facebook/react/issues/24928#issuecomment-2267624188
10
- react: path.resolve(process.cwd(), 'node_modules/react'),
12
+ 'react': path.resolve(process.cwd(), 'node_modules/react'),
11
13
  },
12
14
  },
13
15
  plugins: [react()],
@@ -7,5 +7,8 @@
7
7
  "dev": "vite",
8
8
  "build": "vue-tsc -b && vite build",
9
9
  "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "vue-router": "^4.6.4"
10
13
  }
11
14
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
- import HelloWorld from './components/HelloWorld.vue'
2
+ import HelloWorld from './components/HelloWorld.vue';
3
3
  </script>
4
4
 
5
5
  <template>
6
6
  <div>
7
7
  <a href="https://vite.dev" target="_blank">
8
- <img src="/vite.svg" class="logo" alt="Vite logo" />
8
+ <img src="/vite.svg" class="logo" alt="Vite logo">
9
9
  </a>
10
10
  <a href="https://vuejs.org/" target="_blank">
11
- <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
11
+ <img src="./assets/vue.svg" class="logo vue" alt="Vue logo">
12
12
  </a>
13
13
  </div>
14
14
  <HelloWorld msg="Vite + Vue" />
@@ -1,16 +1,18 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref } from 'vue';
3
3
 
4
- defineProps<{ msg: string }>()
4
+ defineProps<{ msg: string }>();
5
5
 
6
- const count = ref(0)
6
+ const count = ref(0);
7
7
  </script>
8
8
 
9
9
  <template>
10
10
  <h1>{{ msg }}</h1>
11
11
 
12
12
  <div class="card">
13
- <button type="button" @click="count++">count is {{ count }}</button>
13
+ <button type="button" @click="count++">
14
+ count is {{ count }}
15
+ </button>
14
16
  </div>
15
17
  </template>
16
18
 
@@ -1,5 +1,5 @@
1
1
  import { createApp } from 'vue';
2
2
  import App from './App.vue';
3
- import './style.css';
3
+ import './style.scss';
4
4
 
5
5
  createApp(App).mount('#app');
@@ -1,7 +1,25 @@
1
+ import { fileURLToPath, URL } from 'node:url';
1
2
  import vue from '@vitejs/plugin-vue';
3
+ import UnoCSS from 'unocss/vite';
4
+ import AutoImport from 'unplugin-auto-import/vite';
5
+ import Components from 'unplugin-vue-components/vite';
2
6
  import { defineConfig } from 'vite';
7
+ import devtools from 'vite-plugin-vue-devtools';
3
8
 
4
9
  // https://vite.dev/config/
5
10
  export default defineConfig({
6
- plugins: [vue()],
11
+ resolve: {
12
+ alias: {
13
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
14
+ },
15
+ },
16
+ plugins: [
17
+ vue(),
18
+ AutoImport({
19
+ imports: ['vue', 'vue-router'],
20
+ }),
21
+ Components(),
22
+ UnoCSS(),
23
+ devtools(),
24
+ ],
7
25
  });
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/react-dom.json",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
- "types": ["vite/client"]
6
- },
7
- "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.d.ts"]
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/node.json",
3
- "compilerOptions": {
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
- "types": ["@tomjs/vite-plugin-vscode/types"]
6
- },
7
- "include": ["extension", "*.config.ts"]
8
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@tomjs/tsconfig/vue-dom.json",
3
- "compilerOptions": {
4
- "composite": true,
5
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
6
- "types": ["vite/client"]
7
- },
8
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
9
- }
File without changes
File without changes