@tomjs/create-app 2.1.0 → 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/dist/index.mjs +0 -0
- package/package.json +2 -2
- package/templates/electron-react/electron/main/index.ts +0 -31
- package/templates/electron-react/package.json +2 -3
- package/templates/electron-vue/electron/main/index.ts +0 -17
- package/templates/electron-vue/package.json +4 -4
- 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/vscode-react/package.json +1 -1
- package/templates/vscode-vue/package.json +3 -2
package/dist/index.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/create-app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1.
|
|
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",
|
|
@@ -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,14 +15,13 @@
|
|
|
15
15
|
"preview": "vite preview"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tomjs/electron-devtools-installer": "^4.0.1",
|
|
19
18
|
"react": "^19.2.3",
|
|
20
19
|
"react-dom": "^19.2.3"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|
|
23
22
|
"@eslint-react/eslint-plugin": "^2.3.13",
|
|
24
|
-
"@tomjs/vite-plugin-electron": "^2.0
|
|
25
|
-
"@types/node": "^
|
|
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",
|
|
@@ -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,12 +16,11 @@
|
|
|
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": "^
|
|
22
|
+
"@tomjs/vite-plugin-electron": "^2.1.0",
|
|
23
|
+
"@types/node": "^22.19.3",
|
|
25
24
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
26
25
|
"@vue/tsconfig": "^0.8.1",
|
|
27
26
|
"cross-env": "^10.1.0",
|
|
@@ -30,6 +29,7 @@
|
|
|
30
29
|
"typescript": "~5.9.3",
|
|
31
30
|
"vite": "^7.3.0",
|
|
32
31
|
"vite-plugin-electron-renderer": "^0.14.6",
|
|
32
|
+
"vite-plugin-vue-devtools": "^8.0.5",
|
|
33
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
|
});
|
|
@@ -49,15 +49,16 @@
|
|
|
49
49
|
"@tomjs/vscode-webview": "^2.0.2",
|
|
50
50
|
"@vscode/webview-ui-toolkit": "^1.4.0",
|
|
51
51
|
"vue": "^3.5.26",
|
|
52
|
-
"vue-i18n": "^11.2.
|
|
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
59
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
60
60
|
"vite": "^7.3.0",
|
|
61
|
+
"vite-plugin-vue-devtools": "^8.0.5",
|
|
61
62
|
"vue-tsc": "^3.2.0"
|
|
62
63
|
}
|
|
63
64
|
}
|