@tomjs/create-app 2.0.3 → 2.1.1
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/package.json +10 -10
- package/templates/config/base/_.gitignore +1 -0
- package/templates/config/base/package.json +5 -5
- package/templates/config/style/package.json +1 -1
- package/templates/electron-react/electron/main/index.ts +0 -31
- package/templates/electron-react/package.json +8 -9
- package/templates/electron-vue/electron/main/index.ts +0 -17
- package/templates/electron-vue/package.json +8 -8
- package/templates/electron-vue/pnpm-workspace.yaml +1 -0
- package/templates/electron-vue/src/App.vue +3 -3
- package/templates/electron-vue/src/components/HelloWorld.vue +10 -4
- package/templates/electron-vue/vite.config.ts +7 -1
- package/templates/node-cli/package.json +3 -3
- package/templates/node-vite/package.json +3 -3
- package/templates/vscode-base/package.json +1 -1
- package/templates/vscode-react/package.json +5 -5
- package/templates/vscode-vue/package.json +7 -6
- package/templates/web-react/package.json +6 -6
- package/templates/web-vue/package.json +5 -5
- /package/dist/{index.js → index.mjs} +0 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/create-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.1",
|
|
5
5
|
"description": "Create a node/web/electron/vscode project based on tomjs",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom Gao",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node"
|
|
36
36
|
],
|
|
37
37
|
"bin": {
|
|
38
|
-
"create-app": "dist/index.
|
|
38
|
+
"create-app": "dist/index.mjs"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"locales",
|
|
@@ -52,30 +52,30 @@
|
|
|
52
52
|
"@tomjs/node": "^2.2.3",
|
|
53
53
|
"chalk": "^5.6.2",
|
|
54
54
|
"dayjs": "^1.11.19",
|
|
55
|
-
"execa": "^9.6.
|
|
56
|
-
"lodash-es": "^4.17.
|
|
55
|
+
"execa": "^9.6.1",
|
|
56
|
+
"lodash-es": "^4.17.22",
|
|
57
57
|
"meow": "^14.0.0",
|
|
58
58
|
"tinyglobby": "^0.2.15"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@antfu/eslint-config": "^6.
|
|
62
|
-
"@commitlint/cli": "^20.
|
|
61
|
+
"@antfu/eslint-config": "^6.7.1",
|
|
62
|
+
"@commitlint/cli": "^20.2.0",
|
|
63
63
|
"@tomjs/commitlint": "^5.0.0",
|
|
64
64
|
"@tomjs/eslint": "^6.0.0",
|
|
65
65
|
"@tomjs/stylelint": "^7.0.0",
|
|
66
66
|
"@tomjs/tsconfig": "^2.1.0",
|
|
67
67
|
"@tsconfig/node20": "^20.1.8",
|
|
68
68
|
"@types/lodash-es": "^4.17.12",
|
|
69
|
-
"@types/node": "^20.19.
|
|
69
|
+
"@types/node": "^20.19.27",
|
|
70
70
|
"dotenv": "^17.2.3",
|
|
71
|
-
"eslint": "^9.39.
|
|
71
|
+
"eslint": "^9.39.2",
|
|
72
72
|
"lint-staged": "^16.2.7",
|
|
73
73
|
"npm-run-all2": "^8.0.4",
|
|
74
|
-
"publint": "^0.3.
|
|
74
|
+
"publint": "^0.3.16",
|
|
75
75
|
"rimraf": "^6.1.2",
|
|
76
76
|
"simple-git-hooks": "^2.13.1",
|
|
77
77
|
"stylelint": "^16.26.1",
|
|
78
|
-
"tsdown": "~0.
|
|
78
|
+
"tsdown": "~0.18.1",
|
|
79
79
|
"tsx": "^4.20.6",
|
|
80
80
|
"type-fest": "^5.2.0",
|
|
81
81
|
"typescript": "~5.9.3"
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
"prepare": "simple-git-hooks"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@antfu/eslint-config": "^6.
|
|
12
|
-
"@commitlint/cli": "^20.
|
|
11
|
+
"@antfu/eslint-config": "^6.7.1",
|
|
12
|
+
"@commitlint/cli": "^20.2.0",
|
|
13
13
|
"@tomjs/commitlint": "^5.0.0",
|
|
14
14
|
"@tomjs/eslint": "^6.0.0",
|
|
15
15
|
"@tomjs/tsconfig": "^2.1.0",
|
|
16
|
-
"@types/node": "^20.19.
|
|
17
|
-
"eslint": "^9.39.
|
|
16
|
+
"@types/node": "^20.19.27",
|
|
17
|
+
"eslint": "^9.39.2",
|
|
18
18
|
"lint-staged": "^16.2.7",
|
|
19
19
|
"npm-run-all2": "^8.0.4",
|
|
20
20
|
"simple-git-hooks": "^2.13.1",
|
|
21
|
-
"tsx": "^4.
|
|
21
|
+
"tsx": "^4.21.0",
|
|
22
22
|
"typescript": "~5.9.3"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -75,37 +75,6 @@ function createWindow() {
|
|
|
75
75
|
|
|
76
76
|
app.whenReady().then(async () => {
|
|
77
77
|
createWindow();
|
|
78
|
-
|
|
79
|
-
if (isDev) {
|
|
80
|
-
try {
|
|
81
|
-
const { installExtension, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = await import(
|
|
82
|
-
'@tomjs/electron-devtools-installer',
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
|
|
86
|
-
.then((exts) => {
|
|
87
|
-
// console.log('Added Extension: ', exts.name);
|
|
88
|
-
// console.log('Added Extension: ', exts.name);
|
|
89
|
-
|
|
90
|
-
// Open devTool if the app is not packaged
|
|
91
|
-
if (win) {
|
|
92
|
-
win.webContents.openDevTools();
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
console.log(
|
|
96
|
-
'Added Extension: ',
|
|
97
|
-
exts.map(s => s.name),
|
|
98
|
-
);
|
|
99
|
-
})
|
|
100
|
-
.catch((err) => {
|
|
101
|
-
console.log('Failed to install extensions');
|
|
102
|
-
console.error(err);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
console.error(e);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
78
|
});
|
|
110
79
|
|
|
111
80
|
app.on('window-all-closed', () => {
|
|
@@ -15,23 +15,22 @@
|
|
|
15
15
|
"preview": "vite preview"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"
|
|
19
|
-
"react": "^19.2.
|
|
20
|
-
"react-dom": "^19.2.0"
|
|
18
|
+
"react": "^19.2.3",
|
|
19
|
+
"react-dom": "^19.2.3"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
24
|
-
"@tomjs/vite-plugin-electron": "^2.0
|
|
25
|
-
"@types/node": "^
|
|
22
|
+
"@eslint-react/eslint-plugin": "^2.3.13",
|
|
23
|
+
"@tomjs/vite-plugin-electron": "^2.1.0",
|
|
24
|
+
"@types/node": "^22.19.3",
|
|
26
25
|
"@types/react": "^19.2.7",
|
|
27
26
|
"@types/react-dom": "^19.2.3",
|
|
28
27
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
29
28
|
"cross-env": "^10.1.0",
|
|
30
|
-
"electron": "^39.2.
|
|
29
|
+
"electron": "^39.2.7",
|
|
31
30
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
32
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
31
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
33
32
|
"typescript": "~5.9.3",
|
|
34
|
-
"vite": "^7.
|
|
33
|
+
"vite": "^7.3.0",
|
|
35
34
|
"vite-plugin-electron-renderer": "^0.14.6"
|
|
36
35
|
}
|
|
37
36
|
}
|
|
@@ -69,23 +69,6 @@ async function createWindow() {
|
|
|
69
69
|
|
|
70
70
|
app.whenReady().then(async () => {
|
|
71
71
|
createWindow();
|
|
72
|
-
|
|
73
|
-
if (isDev) {
|
|
74
|
-
const { installExtension, VUEJS_DEVTOOLS } = await import('@tomjs/electron-devtools-installer');
|
|
75
|
-
|
|
76
|
-
installExtension(VUEJS_DEVTOOLS)
|
|
77
|
-
.then((ext) => {
|
|
78
|
-
console.log('Added Extension: ', ext.name);
|
|
79
|
-
// Open devTool if the app is not packaged
|
|
80
|
-
if (win) {
|
|
81
|
-
win.webContents.openDevTools();
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
.catch((err) => {
|
|
85
|
-
console.error(err);
|
|
86
|
-
console.log('Failed to install extensions');
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
72
|
});
|
|
90
73
|
|
|
91
74
|
app.on('window-all-closed', () => {
|
|
@@ -16,20 +16,20 @@
|
|
|
16
16
|
"preview": "vite preview"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"
|
|
20
|
-
"vue": "^3.5.25"
|
|
19
|
+
"vue": "^3.5.26"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
|
-
"@tomjs/vite-plugin-electron": "^2.0
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
22
|
+
"@tomjs/vite-plugin-electron": "^2.1.0",
|
|
23
|
+
"@types/node": "^22.19.3",
|
|
24
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
26
25
|
"@vue/tsconfig": "^0.8.1",
|
|
27
26
|
"cross-env": "^10.1.0",
|
|
28
|
-
"electron": "^39.2.
|
|
27
|
+
"electron": "^39.2.7",
|
|
29
28
|
"electron-builder": "^26.0.12",
|
|
30
29
|
"typescript": "~5.9.3",
|
|
31
|
-
"vite": "^7.
|
|
30
|
+
"vite": "^7.3.0",
|
|
32
31
|
"vite-plugin-electron-renderer": "^0.14.6",
|
|
33
|
-
"vue-
|
|
32
|
+
"vite-plugin-vue-devtools": "^8.0.5",
|
|
33
|
+
"vue-tsc": "^3.2.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -5,13 +5,13 @@ import HelloWorld from './components/HelloWorld.vue';
|
|
|
5
5
|
<template>
|
|
6
6
|
<div>
|
|
7
7
|
<a href="https://vitejs.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://www.electronjs.org" target="_blank">
|
|
11
|
-
<img src="./assets/electron.svg" class="logo electron" alt="Vite logo"
|
|
11
|
+
<img src="./assets/electron.svg" class="logo electron" alt="Vite logo">
|
|
12
12
|
</a>
|
|
13
13
|
<a href="https://vuejs.org" target="_blank">
|
|
14
|
-
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo"
|
|
14
|
+
<img src="./assets/vue.svg" class="logo vue" alt="Vue logo">
|
|
15
15
|
</a>
|
|
16
16
|
</div>
|
|
17
17
|
<HelloWorld msg="Vite + Electron + Vue" />
|
|
@@ -8,15 +8,19 @@ const count = ref(0);
|
|
|
8
8
|
|
|
9
9
|
const versions = ['chrome', 'node', 'electron']
|
|
10
10
|
.map(s => `${s}: ${process.versions[s]}`)
|
|
11
|
-
.concat([
|
|
11
|
+
.concat([`platform: ${os.platform()} ${os.arch()}`]);
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
15
|
<h1>{{ msg }}</h1>
|
|
16
16
|
|
|
17
17
|
<div class="card">
|
|
18
|
-
<div style="margin-bottom: 1em">
|
|
19
|
-
|
|
18
|
+
<div style="margin-bottom: 1em">
|
|
19
|
+
{{ versions.join(', ') }}
|
|
20
|
+
</div>
|
|
21
|
+
<button type="button" @click="count++">
|
|
22
|
+
count is {{ count }}
|
|
23
|
+
</button>
|
|
20
24
|
<p>
|
|
21
25
|
Edit
|
|
22
26
|
<code>components/HelloWorld.vue</code> to test HMR
|
|
@@ -33,7 +37,9 @@ const versions = ['chrome', 'node', 'electron']
|
|
|
33
37
|
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
|
|
34
38
|
in your IDE for a better DX
|
|
35
39
|
</p>
|
|
36
|
-
<p class="read-the-docs">
|
|
40
|
+
<p class="read-the-docs">
|
|
41
|
+
Click on the Vite and Vue logos to learn more
|
|
42
|
+
</p>
|
|
37
43
|
</template>
|
|
38
44
|
|
|
39
45
|
<style scoped>
|
|
@@ -2,7 +2,13 @@ import electron from '@tomjs/vite-plugin-electron';
|
|
|
2
2
|
import vue from '@vitejs/plugin-vue';
|
|
3
3
|
import { defineConfig } from 'vite';
|
|
4
4
|
import renderer from 'vite-plugin-electron-renderer';
|
|
5
|
+
import devtools from 'vite-plugin-vue-devtools';
|
|
5
6
|
|
|
6
7
|
export default defineConfig({
|
|
7
|
-
plugins: [
|
|
8
|
+
plugins: [
|
|
9
|
+
vue(),
|
|
10
|
+
electron({ builder: true }),
|
|
11
|
+
devtools({}),
|
|
12
|
+
renderer(),
|
|
13
|
+
],
|
|
8
14
|
});
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@tomjs/node": "^2.2.3",
|
|
21
21
|
"chalk": "^5.6.2",
|
|
22
22
|
"cosmiconfig": "^9.0.0",
|
|
23
|
-
"execa": "^9.6.
|
|
23
|
+
"execa": "^9.6.1",
|
|
24
24
|
"meow": "^14.0.0",
|
|
25
25
|
"ora": "^9.0.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"publint": "0.3.
|
|
29
|
-
"tsdown": "^0.
|
|
28
|
+
"publint": "0.3.16",
|
|
29
|
+
"tsdown": "^0.18.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -48,18 +48,18 @@
|
|
|
48
48
|
"@tomjs/vscode": "^2.5.0",
|
|
49
49
|
"@tomjs/vscode-webview": "^2.0.2",
|
|
50
50
|
"@vscode/webview-ui-toolkit": "^1.4.0",
|
|
51
|
-
"react": "^19.2.
|
|
52
|
-
"react-dom": "^19.2.
|
|
51
|
+
"react": "^19.2.3",
|
|
52
|
+
"react-dom": "^19.2.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@tomjs/vite-plugin-vscode": "^5.
|
|
55
|
+
"@tomjs/vite-plugin-vscode": "^5.2.0",
|
|
56
56
|
"@tomjs/vscode-dev": "^3.0.2",
|
|
57
57
|
"@types/react": "^19.2.7",
|
|
58
58
|
"@types/react-dom": "^19.2.3",
|
|
59
59
|
"@types/vscode": "^1.56.0",
|
|
60
60
|
"@types/vscode-webview": "^1.57.5",
|
|
61
|
-
"@vitejs/plugin-react": "^5.1.
|
|
61
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
62
62
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
63
|
-
"vite": "^7.
|
|
63
|
+
"vite": "^7.3.0"
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -48,16 +48,17 @@
|
|
|
48
48
|
"@tomjs/vscode": "^2.5.0",
|
|
49
49
|
"@tomjs/vscode-webview": "^2.0.2",
|
|
50
50
|
"@vscode/webview-ui-toolkit": "^1.4.0",
|
|
51
|
-
"vue": "^3.5.
|
|
52
|
-
"vue-i18n": "^11.2.
|
|
51
|
+
"vue": "^3.5.26",
|
|
52
|
+
"vue-i18n": "^11.2.7"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@tomjs/vite-plugin-vscode": "^5.
|
|
55
|
+
"@tomjs/vite-plugin-vscode": "^5.2.0",
|
|
56
56
|
"@tomjs/vscode-dev": "^3.0.2",
|
|
57
57
|
"@types/vscode": "^1.56.0",
|
|
58
58
|
"@types/vscode-webview": "^1.57.5",
|
|
59
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
60
|
-
"vite": "^7.
|
|
61
|
-
"vue-
|
|
59
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
60
|
+
"vite": "^7.3.0",
|
|
61
|
+
"vite-plugin-vue-devtools": "^8.0.5",
|
|
62
|
+
"vue-tsc": "^3.2.0"
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"preview": "vite preview"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"react": "^19.2.
|
|
13
|
+
"react": "^19.2.3",
|
|
14
14
|
"react-dom": "^19.2.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@eslint-react/eslint-plugin": "^2.3.
|
|
18
|
-
"@types/node": "^
|
|
19
|
-
"@types/react": "^19.2.
|
|
17
|
+
"@eslint-react/eslint-plugin": "^2.3.13",
|
|
18
|
+
"@types/node": "^22.19.3",
|
|
19
|
+
"@types/react": "^19.2.7",
|
|
20
20
|
"@types/react-dom": "^19.2.3",
|
|
21
21
|
"@vitejs/plugin-react-swc": "^4.2.2",
|
|
22
22
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
23
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
23
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
24
24
|
"typescript": "~5.9.3",
|
|
25
|
-
"vite": "^7.
|
|
25
|
+
"vite": "^7.3.0"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"preview": "vite preview"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"vue": "^3.5.
|
|
12
|
+
"vue": "^3.5.26"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@types/node": "^
|
|
16
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
15
|
+
"@types/node": "^22.19.3",
|
|
16
|
+
"@vitejs/plugin-vue": "^6.0.3",
|
|
17
17
|
"@vue/tsconfig": "^0.8.1",
|
|
18
18
|
"typescript": "~5.9.3",
|
|
19
|
-
"vite": "^7.
|
|
20
|
-
"vue-tsc": "^3.
|
|
19
|
+
"vite": "^7.3.0",
|
|
20
|
+
"vue-tsc": "^3.2.0"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
File without changes
|