@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.
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/templates/config/base/package.json +3 -0
- package/templates/config/electron/package.json +2 -2
- package/templates/config/hbuilderx/extension/index.ts +22 -0
- package/templates/config/hbuilderx/extension/webview.ts +71 -0
- package/templates/config/hbuilderx/package.json +96 -0
- package/templates/config/hbuilderx/tsconfig.node.json +15 -0
- package/templates/config/package.json +26 -15
- package/templates/config/react/package.json +3 -3
- package/templates/{web-react → config/react}/tsconfig.app.json +3 -1
- package/templates/config/style/package.json +2 -2
- package/templates/config/style/stylelint.config.mjs +4 -0
- package/templates/config/vscode/package.json +1 -1
- package/templates/config/vue/_eslint.config.mjs +5 -0
- package/templates/config/vue/env.d.ts +3 -0
- package/templates/config/vue/package.json +8 -2
- package/templates/{vscode-vue → config/vue}/tsconfig.app.json +8 -3
- package/templates/config/vue/uno.config.ts +9 -0
- package/templates/electron-react/vite.config.ts +7 -3
- package/templates/electron-vue/package.json +3 -1
- package/templates/electron-vue/vite.config.ts +16 -2
- package/templates/hbuilderx-base/README.md +20 -0
- package/templates/hbuilderx-base/package.json +52 -0
- package/templates/hbuilderx-base/src/env.d.ts +1 -0
- package/templates/hbuilderx-base/src/index.ts +17 -0
- package/templates/hbuilderx-base/tsconfig.json +7 -0
- package/templates/hbuilderx-base/tsdown.config.ts +13 -0
- package/templates/hbuilderx-react/README.md +25 -0
- package/templates/hbuilderx-react/index.html +13 -0
- package/templates/hbuilderx-react/package.json +12 -0
- package/templates/hbuilderx-react/pnpm-workspace.yaml +5 -0
- package/templates/hbuilderx-react/src/App.css +45 -0
- package/templates/hbuilderx-react/src/App.tsx +41 -0
- package/templates/hbuilderx-react/src/assets/react.svg +1 -0
- package/templates/hbuilderx-react/src/assets/vite.svg +1 -0
- package/templates/hbuilderx-react/src/index.css +73 -0
- package/templates/hbuilderx-react/src/main.tsx +10 -0
- package/templates/hbuilderx-react/tsconfig.app.json +18 -0
- package/templates/hbuilderx-react/vite.config.ts +20 -0
- package/templates/hbuilderx-vue/README.md +26 -0
- package/templates/hbuilderx-vue/index.html +13 -0
- package/templates/hbuilderx-vue/package.json +12 -0
- package/templates/hbuilderx-vue/pnpm-workspace.yaml +4 -0
- package/templates/hbuilderx-vue/src/App.vue +32 -0
- package/templates/hbuilderx-vue/src/assets/vite.svg +1 -0
- package/templates/hbuilderx-vue/src/assets/vue.svg +1 -0
- package/templates/hbuilderx-vue/src/components/HelloWorld.vue +29 -0
- package/templates/hbuilderx-vue/src/main.ts +5 -0
- package/templates/hbuilderx-vue/src/style.css +68 -0
- package/templates/hbuilderx-vue/tsconfig.app.json +18 -0
- package/templates/hbuilderx-vue/vite.config.ts +31 -0
- package/templates/node-vite/examples/vue/src/App.vue +3 -3
- package/templates/node-vite/examples/vue/src/components/HelloWorld.vue +6 -4
- package/templates/vscode-react/package.json +1 -1
- package/templates/vscode-react/vite.config.ts +6 -2
- package/templates/vscode-vue/package.json +1 -1
- package/templates/vscode-vue/vite.config.ts +16 -2
- package/templates/web-react/public/vite.svg +1 -0
- package/templates/web-react/vite.config.ts +3 -1
- package/templates/web-vue/package.json +3 -0
- package/templates/web-vue/public/vite.svg +1 -0
- package/templates/web-vue/src/App.vue +3 -3
- package/templates/web-vue/src/components/HelloWorld.vue +6 -4
- package/templates/web-vue/src/main.ts +1 -1
- package/templates/web-vue/vite.config.ts +19 -1
- package/templates/vscode-react/tsconfig.app.json +0 -8
- package/templates/vscode-vue/tsconfig.node.json +0 -8
- package/templates/web-vue/tsconfig.app.json +0 -9
- /package/templates/{vscode-react → config/hbuilderx}/tsconfig.json +0 -0
- /package/templates/{vscode-vue → config/react}/tsconfig.json +0 -0
- /package/templates/{web-react → config/react}/tsconfig.node.json +0 -0
- /package/templates/{web-react → config/vscode}/tsconfig.json +0 -0
- /package/templates/{vscode-react → config/vscode}/tsconfig.node.json +0 -0
- /package/templates/{web-vue → config/vue}/tsconfig.json +0 -0
- /package/templates/{web-vue → config/vue}/tsconfig.node.json +0 -0
- /package/templates/{config/react → electron-react}/public/vite.svg +0 -0
- /package/templates/{config/vue → electron-vue}/public/vite.svg +0 -0
- /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++">
|
|
13
|
+
<button type="button" @click="count++">
|
|
14
|
+
count is {{ count }}
|
|
15
|
+
</button>
|
|
14
16
|
</div>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
-
'@':
|
|
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(),
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import
|
|
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
|
-
'@':
|
|
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()],
|
|
@@ -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++">
|
|
13
|
+
<button type="button" @click="count++">
|
|
14
|
+
count is {{ count }}
|
|
15
|
+
</button>
|
|
14
16
|
</div>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
@@ -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
|
-
|
|
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,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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|