@tomjs/create-app 0.5.0 → 0.5.2
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 +2 -2
- package/template-electron-react/.vscode/launch.json +10 -5
- package/template-electron-react/.vscode/tasks.json +31 -0
- package/template-electron-react/electron/main/index.ts +2 -2
- package/template-electron-react/package.json +7 -5
- package/template-electron-react/vite.config.ts +1 -1
- package/template-electron-vue/.vscode/launch.json +10 -5
- package/template-electron-vue/.vscode/tasks.json +31 -0
- package/template-electron-vue/electron/main/index.ts +7 -12
- package/template-electron-vue/package.json +6 -4
- package/template-electron-vue/vite.config.ts +1 -1
- package/template-node/package.json +2 -2
- package/template-react/package.json +3 -3
- package/template-vue/package.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/create-app",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "create tomjs web app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tomjs",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/node": "^18.19.3",
|
|
62
62
|
"@types/prompts": "^2.4.9",
|
|
63
63
|
"@types/shelljs": "^0.8.15",
|
|
64
|
-
"eslint": "^8.
|
|
64
|
+
"eslint": "^8.56.0",
|
|
65
65
|
"husky": "^8.0.3",
|
|
66
66
|
"lint-staged": "^15.2.0",
|
|
67
67
|
"np": "^9.2.0",
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
"version": "0.2.0",
|
|
6
6
|
"configurations": [
|
|
7
7
|
{
|
|
8
|
-
"name": "Main
|
|
8
|
+
"name": "Debug Main Process",
|
|
9
|
+
"preLaunchTask": "npm:debug",
|
|
9
10
|
"type": "node",
|
|
10
11
|
"request": "launch",
|
|
11
12
|
"cwd": "${workspaceFolder}",
|
|
@@ -14,11 +15,15 @@
|
|
|
14
15
|
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
|
15
16
|
},
|
|
16
17
|
"args": [
|
|
17
|
-
"."
|
|
18
|
+
".",
|
|
18
19
|
],
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
"outFiles": [
|
|
21
|
+
"${workspaceFolder}/**/*.js",
|
|
22
|
+
"${workspaceFolder}/**/*.cjs",
|
|
23
|
+
"${workspaceFolder}/**/*.mjs",
|
|
24
|
+
"!**/node_modules/**"
|
|
25
|
+
],
|
|
26
|
+
"envFile": "${workspaceFolder}/node_modules/@tomjs/vite-plugin-electron/debug/.env"
|
|
22
27
|
},
|
|
23
28
|
]
|
|
24
29
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
// for the documentation about the tasks.json format
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"tasks": [
|
|
6
|
+
{
|
|
7
|
+
"label": "npm:debug",
|
|
8
|
+
"type": "npm",
|
|
9
|
+
"script": "debug",
|
|
10
|
+
"detail": "cross-env VITE_ELECTRON_DEBUG=1 vite",
|
|
11
|
+
"isBackground": true,
|
|
12
|
+
"problemMatcher": {
|
|
13
|
+
"owner": "typescript",
|
|
14
|
+
"fileLocation": "relative",
|
|
15
|
+
"pattern": {
|
|
16
|
+
"regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
17
|
+
"file": 1,
|
|
18
|
+
"line": 3,
|
|
19
|
+
"column": 4,
|
|
20
|
+
"code": 5,
|
|
21
|
+
"message": 6
|
|
22
|
+
},
|
|
23
|
+
"background": {
|
|
24
|
+
"activeOnStart": true,
|
|
25
|
+
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
|
|
26
|
+
"endsPattern": "^.*\\[@tomjs:electron\\] startup electron*$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -3,8 +3,6 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { app, BrowserWindow, ipcMain, shell } from 'electron';
|
|
4
4
|
import '../polyfills';
|
|
5
5
|
|
|
6
|
-
const isDev = process.env.NODE_ENV === 'development';
|
|
7
|
-
|
|
8
6
|
// Disable GPU Acceleration for Windows 7
|
|
9
7
|
if (release().startsWith('6.1')) app.disableHardwareAcceleration();
|
|
10
8
|
|
|
@@ -21,6 +19,8 @@ if (!app.requestSingleInstanceLock()) {
|
|
|
21
19
|
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
|
|
22
20
|
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
|
|
23
21
|
|
|
22
|
+
const isDev = process.env.NODE_ENV === 'development';
|
|
23
|
+
|
|
24
24
|
let win: BrowserWindow | null = null;
|
|
25
25
|
// package.json "type":"module", must use mjs extension
|
|
26
26
|
const preload = join(__dirname, '../preload/index.mjs');
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18"
|
|
8
8
|
},
|
|
9
|
-
"main": "dist/main/index.
|
|
9
|
+
"main": "dist/main/index.mjs",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "vite",
|
|
12
|
+
"debug": "cross-env VITE_ELECTRON_DEBUG=1 npm run dev",
|
|
12
13
|
"build": "npm run clean && vite build",
|
|
14
|
+
"build:pack": "cross-env VITE_ELECTRON_BUILDER=1 npm run build",
|
|
13
15
|
"clean": "rimraf ./dist",
|
|
14
16
|
"lint": "run-s lint:eslint lint:stylelint lint:prettier",
|
|
15
17
|
"lint:eslint": "eslint \"{src,electron,scripts}/**/*.{ts,tsx}\" *.{js,cjs,ts} --fix --cache",
|
|
@@ -29,14 +31,14 @@
|
|
|
29
31
|
"@tomjs/prettier": "^1.0.6",
|
|
30
32
|
"@tomjs/stylelint": "^1.1.1",
|
|
31
33
|
"@tomjs/tsconfig": "^1.1.2",
|
|
32
|
-
"@tomjs/vite-plugin-electron": "^1.
|
|
34
|
+
"@tomjs/vite-plugin-electron": "^1.6.0",
|
|
33
35
|
"@types/node": "^18.19.3",
|
|
34
|
-
"@types/react": "^18.2.
|
|
36
|
+
"@types/react": "^18.2.45",
|
|
35
37
|
"@types/react-dom": "^18.2.17",
|
|
36
38
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
37
39
|
"electron": "^28.0.0",
|
|
38
40
|
"electron-builder": "^24.9.1",
|
|
39
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.56.0",
|
|
40
42
|
"husky": "^8.0.3",
|
|
41
43
|
"lint-staged": "^15.2.0",
|
|
42
44
|
"npm-run-all": "^4.1.5",
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
"stylelint": "^15.11.0",
|
|
46
48
|
"tsx": "^4.6.2",
|
|
47
49
|
"typescript": "~5.2.2",
|
|
48
|
-
"vite": "^5.0.
|
|
50
|
+
"vite": "^5.0.10",
|
|
49
51
|
"vite-plugin-electron-renderer": "^0.14.5"
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
"version": "0.2.0",
|
|
6
6
|
"configurations": [
|
|
7
7
|
{
|
|
8
|
-
"name": "Main
|
|
8
|
+
"name": "Debug Main Process",
|
|
9
|
+
"preLaunchTask": "npm:debug",
|
|
9
10
|
"type": "node",
|
|
10
11
|
"request": "launch",
|
|
11
12
|
"cwd": "${workspaceFolder}",
|
|
@@ -14,11 +15,15 @@
|
|
|
14
15
|
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
|
|
15
16
|
},
|
|
16
17
|
"args": [
|
|
17
|
-
"."
|
|
18
|
+
".",
|
|
18
19
|
],
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
"outFiles": [
|
|
21
|
+
"${workspaceFolder}/**/*.js",
|
|
22
|
+
"${workspaceFolder}/**/*.cjs",
|
|
23
|
+
"${workspaceFolder}/**/*.mjs",
|
|
24
|
+
"!**/node_modules/**"
|
|
25
|
+
],
|
|
26
|
+
"envFile": "${workspaceFolder}/node_modules/@tomjs/vite-plugin-electron/debug/.env"
|
|
22
27
|
},
|
|
23
28
|
]
|
|
24
29
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
3
|
+
// for the documentation about the tasks.json format
|
|
4
|
+
"version": "2.0.0",
|
|
5
|
+
"tasks": [
|
|
6
|
+
{
|
|
7
|
+
"label": "npm:debug",
|
|
8
|
+
"type": "npm",
|
|
9
|
+
"script": "debug",
|
|
10
|
+
"detail": "cross-env VITE_ELECTRON_DEBUG=1 vite",
|
|
11
|
+
"isBackground": true,
|
|
12
|
+
"problemMatcher": {
|
|
13
|
+
"owner": "typescript",
|
|
14
|
+
"fileLocation": "relative",
|
|
15
|
+
"pattern": {
|
|
16
|
+
"regexp": "^([a-zA-Z]\\:\/?([\\w\\-]\/?)+\\.\\w+):(\\d+):(\\d+): (ERROR|WARNING)\\: (.*)$",
|
|
17
|
+
"file": 1,
|
|
18
|
+
"line": 3,
|
|
19
|
+
"column": 4,
|
|
20
|
+
"code": 5,
|
|
21
|
+
"message": 6
|
|
22
|
+
},
|
|
23
|
+
"background": {
|
|
24
|
+
"activeOnStart": true,
|
|
25
|
+
"beginsPattern": "^.*VITE v.* ready in \\d* ms.*$",
|
|
26
|
+
"endsPattern": "^.*\\[@tomjs:electron\\] startup electron*$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -3,8 +3,6 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { app, BrowserWindow, ipcMain, shell } from 'electron';
|
|
4
4
|
import '../polyfills';
|
|
5
5
|
|
|
6
|
-
const isDev = process.env.NODE_ENV === 'development';
|
|
7
|
-
|
|
8
6
|
// Disable GPU Acceleration for Windows 7
|
|
9
7
|
if (release().startsWith('6.1')) app.disableHardwareAcceleration();
|
|
10
8
|
|
|
@@ -21,6 +19,8 @@ if (!app.requestSingleInstanceLock()) {
|
|
|
21
19
|
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
|
|
22
20
|
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
|
|
23
21
|
|
|
22
|
+
const isDev = process.env.NODE_ENV === 'development';
|
|
23
|
+
|
|
24
24
|
let win: BrowserWindow | null = null;
|
|
25
25
|
// package.json "type":"module", must use mjs extension
|
|
26
26
|
const preload = join(__dirname, '../preload/index.mjs');
|
|
@@ -70,16 +70,11 @@ app.whenReady().then(async () => {
|
|
|
70
70
|
createWindow();
|
|
71
71
|
|
|
72
72
|
if (isDev) {
|
|
73
|
-
const { installExtension,
|
|
74
|
-
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
.then(exts => {
|
|
79
|
-
console.log(
|
|
80
|
-
'Added Extension: ',
|
|
81
|
-
exts.map(s => s.name),
|
|
82
|
-
);
|
|
73
|
+
const { installExtension, VUEJS_DEVTOOLS } = await import('@tomjs/electron-devtools-installer');
|
|
74
|
+
|
|
75
|
+
installExtension(VUEJS_DEVTOOLS)
|
|
76
|
+
.then(ext => {
|
|
77
|
+
console.log('Added Extension: ', ext.name);
|
|
83
78
|
})
|
|
84
79
|
.catch(() => {
|
|
85
80
|
console.log('Failed to install extensions');
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=18"
|
|
8
8
|
},
|
|
9
|
-
"main": "dist/main/index.
|
|
9
|
+
"main": "dist/main/index.mjs",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "vite",
|
|
12
|
+
"debug": "cross-env VITE_ELECTRON_DEBUG=1 npm run dev",
|
|
12
13
|
"build": "npm run clean && vue-tsc --noEmit && vite build",
|
|
14
|
+
"build:pack": "cross-env VITE_ELECTRON_BUILDER=1 npm run build",
|
|
13
15
|
"clean": "rimraf ./dist",
|
|
14
16
|
"lint": "run-s lint:eslint lint:stylelint lint:prettier",
|
|
15
17
|
"lint:eslint": "eslint \"{src,electron,scripts}/**/*.{js,cjs,ts,vue}\" *.{js,cjs,ts} --fix --cache",
|
|
@@ -28,12 +30,12 @@
|
|
|
28
30
|
"@tomjs/prettier": "^1.0.6",
|
|
29
31
|
"@tomjs/stylelint": "^1.1.1",
|
|
30
32
|
"@tomjs/tsconfig": "^1.1.2",
|
|
31
|
-
"@tomjs/vite-plugin-electron": "^1.
|
|
33
|
+
"@tomjs/vite-plugin-electron": "^1.6.0",
|
|
32
34
|
"@types/node": "^18.19.3",
|
|
33
35
|
"@vitejs/plugin-vue": "^4.5.2",
|
|
34
36
|
"electron": "^28.0.0",
|
|
35
37
|
"electron-builder": "^24.9.1",
|
|
36
|
-
"eslint": "^8.
|
|
38
|
+
"eslint": "^8.56.0",
|
|
37
39
|
"husky": "^8.0.3",
|
|
38
40
|
"lint-staged": "^15.2.0",
|
|
39
41
|
"npm-run-all": "^4.1.5",
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
"stylelint": "^15.11.0",
|
|
43
45
|
"tsx": "^4.6.2",
|
|
44
46
|
"typescript": "~5.2.2",
|
|
45
|
-
"vite": "^5.0.
|
|
47
|
+
"vite": "^5.0.10",
|
|
46
48
|
"vite-plugin-electron-renderer": "^0.14.5",
|
|
47
49
|
"vue-tsc": "^1.8.25"
|
|
48
50
|
}
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@types/jest": "^29.5.11",
|
|
62
62
|
"@types/node": "^18.19.3",
|
|
63
63
|
"electron": "^28.0.0",
|
|
64
|
-
"eslint": "^8.
|
|
64
|
+
"eslint": "^8.56.0",
|
|
65
65
|
"husky": "^8.0.3",
|
|
66
66
|
"jest": "^29.7.0",
|
|
67
67
|
"lint-staged": "^15.2.0",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"tsup": "^8.0.1",
|
|
75
75
|
"tsx": "^4.6.2",
|
|
76
76
|
"typescript": "~5.2.2",
|
|
77
|
-
"vite": "^5.0.
|
|
77
|
+
"vite": "^5.0.10"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -28,16 +28,16 @@
|
|
|
28
28
|
"@tomjs/stylelint": "^1.1.1",
|
|
29
29
|
"@tomjs/tsconfig": "^1.1.2",
|
|
30
30
|
"@types/node": "^18.19.3",
|
|
31
|
-
"@types/react": "^18.2.
|
|
31
|
+
"@types/react": "^18.2.45",
|
|
32
32
|
"@types/react-dom": "^18.2.17",
|
|
33
33
|
"@vitejs/plugin-react-swc": "^3.5.0",
|
|
34
|
-
"eslint": "^8.
|
|
34
|
+
"eslint": "^8.56.0",
|
|
35
35
|
"husky": "^8.0.3",
|
|
36
36
|
"lint-staged": "^15.2.0",
|
|
37
37
|
"npm-run-all": "^4.1.5",
|
|
38
38
|
"prettier": "^3.1.1",
|
|
39
39
|
"stylelint": "^15.11.0",
|
|
40
40
|
"typescript": "~5.2.2",
|
|
41
|
-
"vite": "^5.0.
|
|
41
|
+
"vite": "^5.0.10"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"@tomjs/tsconfig": "^1.1.2",
|
|
29
29
|
"@types/node": "^18.19.3",
|
|
30
30
|
"@vitejs/plugin-vue": "^4.5.2",
|
|
31
|
-
"eslint": "^8.
|
|
31
|
+
"eslint": "^8.56.0",
|
|
32
32
|
"husky": "^8.0.3",
|
|
33
33
|
"lint-staged": "^15.2.0",
|
|
34
34
|
"npm-run-all": "^4.1.5",
|
|
35
35
|
"prettier": "^3.1.1",
|
|
36
36
|
"stylelint": "^15.11.0",
|
|
37
37
|
"typescript": "~5.2.2",
|
|
38
|
-
"vite": "^5.0.
|
|
38
|
+
"vite": "^5.0.10",
|
|
39
39
|
"vue-tsc": "^1.8.25"
|
|
40
40
|
}
|
|
41
41
|
}
|