@tomjs/create-app 1.4.0 → 1.5.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tomjs/create-app",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "1.5.0",
5
5
  "description": "create tomjs web app",
6
6
  "keywords": [
7
7
  "tomjs",
@@ -47,21 +47,21 @@
47
47
  "@tomjs/node": "^2.2.1",
48
48
  "chalk": "^5.3.0",
49
49
  "dayjs": "^1.11.11",
50
- "execa": "^9.2.0",
51
- "inquirer": "^9.2.23",
50
+ "execa": "^9.3.0",
51
+ "inquirer": "^9.3.2",
52
52
  "lodash-es": "^4.17.21",
53
53
  "meow": "^13.2.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@commitlint/cli": "^19.3.0",
57
57
  "@tomjs/commitlint": "^3.3.0",
58
- "@tomjs/eslint": "^3.2.0",
58
+ "@tomjs/eslint": "^3.3.0",
59
59
  "@tomjs/prettier": "^1.4.1",
60
- "@tomjs/stylelint": "^2.5.0",
61
- "@tomjs/tsconfig": "^1.6.0",
60
+ "@tomjs/stylelint": "^2.6.1",
61
+ "@tomjs/tsconfig": "^1.7.0",
62
62
  "@types/inquirer": "^9.0.7",
63
63
  "@types/lodash-es": "^4.17.12",
64
- "@types/node": "^18.19.36",
64
+ "@types/node": "^18.19.39",
65
65
  "@types/prompts": "^2.4.9",
66
66
  "cross-env": "^7.0.3",
67
67
  "dotenv": "^16.4.5",
@@ -72,9 +72,9 @@
72
72
  "prettier": "^3.3.2",
73
73
  "stylelint": "^16.6.1",
74
74
  "tsup": "^8.1.0",
75
- "tsx": "^4.15.6",
75
+ "tsx": "^4.16.0",
76
76
  "type-fest": "^4.20.1",
77
- "typescript": "~5.4.5"
77
+ "typescript": "~5.5.2"
78
78
  },
79
79
  "scripts": {
80
80
  "dev": "tsup --watch",
@@ -15,16 +15,16 @@
15
15
  "devDependencies": {
16
16
  "@commitlint/cli": "^19.3.0",
17
17
  "@tomjs/commitlint": "^3.3.0",
18
- "@tomjs/eslint": "^3.2.0",
18
+ "@tomjs/eslint": "^3.3.0",
19
19
  "@tomjs/prettier": "^1.4.1",
20
- "@tomjs/tsconfig": "^1.6.0",
21
- "@types/node": "^18.19.36",
20
+ "@tomjs/tsconfig": "^1.7.0",
21
+ "@types/node": "^18.19.39",
22
22
  "eslint": "^8.57.0",
23
23
  "husky": "^9.0.11",
24
24
  "lint-staged": "^15.2.7",
25
25
  "npm-run-all": "^4.1.5",
26
26
  "prettier": "^3.3.2",
27
27
  "rimraf": "^5.0.7",
28
- "typescript": "~5.4.5"
28
+ "typescript": "~5.5.2"
29
29
  }
30
30
  }
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@tomjs/vite-plugin-electron": "^1.9.0",
21
- "electron": "^31.0.1",
21
+ "electron": "^31.1.0",
22
22
  "electron-builder": "^24.13.3",
23
23
  "vite-plugin-electron-renderer": "^0.14.5"
24
24
  }
@@ -1,6 +1,6 @@
1
1
  # {{pkgName}}
2
2
 
3
- [![npm](https://img.shields.io/npm/v/{{pkgName}})](https://www.npmjs.com/package/{{pkgName}}) ![node-current (scoped)](https://img.shields.io/node/v/{{pkgName}}) ![NPM](https://img.shields.io/npm/l/{{pkgName}}) [![Docs](https://www.paka.dev/badges/v0/cute.svg)](https://www.paka.dev/npm/{{pkgName}})
3
+ [![npm](https://img.shields.io/npm/v/{{pkgName}})](https://www.npmjs.com/package/{{pkgName}}) ![node-current (scoped)](https://img.shields.io/node/v/{{pkgName}}) ![NPM](https://img.shields.io/npm/l/{{pkgName}})
4
4
 
5
5
  **English** | [中文](./README.zh_CN.md)
6
6
 
@@ -1,6 +1,6 @@
1
1
  # {{pkgName}}
2
2
 
3
- [![npm](https://img.shields.io/npm/v/{{pkgName}})](https://www.npmjs.com/package/{{pkgName}}) ![node-current (scoped)](https://img.shields.io/node/v/{{pkgName}}) ![NPM](https://img.shields.io/npm/l/{{pkgName}}) [![Docs](https://www.paka.dev/badges/v0/cute.svg)](https://www.paka.dev/npm/{{pkgName}})
3
+ [![npm](https://img.shields.io/npm/v/{{pkgName}})](https://www.npmjs.com/package/{{pkgName}}) ![node-current (scoped)](https://img.shields.io/node/v/{{pkgName}}) ![NPM](https://img.shields.io/npm/l/{{pkgName}})
4
4
 
5
5
  [English](./README.md) | **中文**
6
6
 
@@ -33,13 +33,14 @@
33
33
  },
34
34
  "scripts": {
35
35
  "lint:eslint": "eslint \"{src,test}/**/*.ts\" *.{js,cjs,mjs,ts} --fix --cache",
36
- "test": "vitest"
36
+ "test": "vitest",
37
+ "prepublishOnly": "pnpm build"
37
38
  },
38
39
  "dependencies": {
39
40
  "@tomjs/node": "^2.2.1"
40
41
  },
41
42
  "devDependencies": {
42
- "tsx": "^4.15.6",
43
+ "tsx": "^4.16.0",
43
44
  "type-fest": "^4.20.1",
44
45
  "vitest": "^1.6.0"
45
46
  }
@@ -14,6 +14,6 @@
14
14
  "@types/react": "^18.3.3",
15
15
  "@types/react-dom": "^18.3.0",
16
16
  "@vitejs/plugin-react-swc": "^3.7.0",
17
- "vite": "^5.3.1"
17
+ "vite": "^5.3.2"
18
18
  }
19
19
  }
@@ -4,7 +4,7 @@
4
4
  "lint:stylelint": "stylelint \"src/**/*.{css,less,scss,html}\" *.html --fix --cache"
5
5
  },
6
6
  "devDependencies": {
7
- "@tomjs/stylelint": "^2.5.0",
7
+ "@tomjs/stylelint": "^2.6.0",
8
8
  "stylelint": "^16.6.1"
9
9
  }
10
10
  }
@@ -13,7 +13,7 @@
13
13
  "--extensionDevelopmentPath=${workspaceFolder}"
14
14
  ],
15
15
  "outFiles": [
16
- "${workspaceFolder}/dist/*.js"
16
+ "${workspaceFolder}/dist/extension/*.js"
17
17
  ],
18
18
  "preLaunchTask": "${defaultBuildTask}"
19
19
  }
@@ -54,14 +54,14 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@tomjs/node": "^2.2.1",
57
- "@tomjs/vscode": "^2.4.1",
57
+ "@tomjs/vscode": "^2.4.2",
58
58
  "@vscode/webview-ui-toolkit": "^1.4.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@tomjs/vite-plugin-vscode": "^2.4.0",
62
- "@tomjs/vscode-dev": "^2.2.2",
61
+ "@tomjs/vite-plugin-vscode": "^2.5.3",
62
+ "@tomjs/vscode-dev": "^3.0.2",
63
63
  "@types/vscode": "^1.56.0",
64
64
  "@types/vscode-webview": "^1.57.5",
65
- "vite": "^5.3.1"
65
+ "vite": "^5.3.2"
66
66
  }
67
67
  }
@@ -7,11 +7,11 @@
7
7
  "lint:stylelint": "stylelint \"src/**/*.{css,less,scss,html,vue}\" *.html --fix --cache"
8
8
  },
9
9
  "dependencies": {
10
- "vue": "^3.4.29"
10
+ "vue": "^3.4.31"
11
11
  },
12
12
  "devDependencies": {
13
13
  "@vitejs/plugin-vue": "^5.0.5",
14
- "vite": "^5.3.1",
15
- "vue-tsc": "^2.0.21"
14
+ "vite": "^5.3.2",
15
+ "vue-tsc": "^2.0.24"
16
16
  }
17
17
  }
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "chalk": "^5.3.0",
25
25
  "cosmiconfig": "^9.0.0",
26
- "execa": "^9.2.0",
26
+ "execa": "^9.3.0",
27
27
  "meow": "^13.2.0",
28
28
  "ora": "^8.0.1"
29
29
  },
@@ -11,7 +11,7 @@
11
11
  "dependencies": {},
12
12
  "devDependencies": {
13
13
  "tsup": "^8.1.0",
14
- "vite": "^5.3.1"
14
+ "vite": "^5.3.2"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "vite": ">=2"
@@ -46,10 +46,10 @@
46
46
  },
47
47
  "dependencies": {
48
48
  "@tomjs/node": "^2.2.1",
49
- "@tomjs/vscode": "^2.4.1"
49
+ "@tomjs/vscode": "^2.4.2"
50
50
  },
51
51
  "devDependencies": {
52
- "@tomjs/vscode-dev": "^2.2.2",
52
+ "@tomjs/vscode-dev": "^3.0.2",
53
53
  "@types/vscode": "^1.56.0",
54
54
  "tsup": "^8.1.0"
55
55
  }
@@ -3,7 +3,6 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
7
6
  <title>Vite + VSCode Extension + React</title>
8
7
  </head>
9
8
 
@@ -3,7 +3,6 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
7
6
  <title>Vite + VSCode Extension + Vue</title>
8
7
  </head>
9
8
 
@@ -2,5 +2,8 @@
2
2
  "scripts": {
3
3
  "build": "vscode-dev && vue-tsc --noEmit && vite build",
4
4
  "lint:eslint": "eslint \"{src,extension}/**/*.{js,cjs,ts,tsx,vue}\" *.{js,cjs,ts} --fix --cache"
5
+ },
6
+ "dependencies": {
7
+ "vue-i18n": "^9.13.1"
5
8
  }
6
9
  }
@@ -1,123 +0,0 @@
1
- import '../polyfills';
2
-
3
- import { release } from 'node:os';
4
- import { join } from 'node:path';
5
- import { app, BrowserWindow, ipcMain, shell } from 'electron';
6
-
7
- // Disable GPU Acceleration for Windows 7
8
- if (release().startsWith('6.1')) app.disableHardwareAcceleration();
9
-
10
- // Set application name for Windows 10+ notifications
11
- if (process.platform === 'win32') app.setAppUserModelId(app.getName());
12
-
13
- if (!app.requestSingleInstanceLock()) {
14
- app.quit();
15
- process.exit(0);
16
- }
17
-
18
- // Remove electron security warnings
19
- // This warning only shows in development mode
20
- // Read more on https://www.electronjs.org/docs/latest/tutorial/security
21
- process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
22
-
23
- const isDev = process.env.NODE_ENV === 'development';
24
-
25
- let win: BrowserWindow | null = null;
26
- // package.json "type":"module", must use mjs extension
27
- const preload = join(__dirname, '../preload/index.mjs');
28
- const serverUrl = process.env.VITE_DEV_SERVER_URL as string;
29
- const rendererDist = join(__dirname, '../renderer');
30
- const indexHtml = join(rendererDist, 'index.html');
31
- const publicPath = serverUrl ? join(__dirname, '../../public') : rendererDist;
32
-
33
- function createWindow() {
34
- win = new BrowserWindow({
35
- title: 'Main window',
36
- width: 800,
37
- height: 700,
38
- icon: join(publicPath, 'img/icon.png'),
39
- webPreferences: {
40
- preload,
41
- // Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
42
- // Consider using contextBridge.exposeInMainWorld
43
- // Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
44
- nodeIntegration: true,
45
- contextIsolation: false,
46
- },
47
- });
48
-
49
- if (isDev) {
50
- win.loadURL(serverUrl);
51
- // Open devTool if the app is not packaged
52
- win.webContents.openDevTools();
53
- } else {
54
- win.loadFile(indexHtml);
55
- }
56
-
57
- // Test actively push message to the Electron-Renderer
58
- win.webContents.on('did-finish-load', () => {
59
- win?.webContents.send('main-process-message', new Date().toLocaleString());
60
- });
61
-
62
- // Make all links open with the browser, not with the application
63
- win.webContents.setWindowOpenHandler(({ url }) => {
64
- if (url.startsWith('https:')) shell.openExternal(url);
65
- return { action: 'deny' };
66
- });
67
- // win.webContents.on('will-navigate', (event, url) => { }) #344
68
- }
69
-
70
- app.whenReady().then(async () => {
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
- })
80
- .catch(() => {
81
- console.log('Failed to install extensions');
82
- });
83
- }
84
- });
85
-
86
- app.on('window-all-closed', () => {
87
- win = null;
88
- if (process.platform !== 'darwin') app.quit();
89
- });
90
-
91
- app.on('second-instance', () => {
92
- if (win) {
93
- // Focus on the main window if the user tried to open another
94
- if (win.isMinimized()) win.restore();
95
- win.focus();
96
- }
97
- });
98
-
99
- app.on('activate', () => {
100
- const allWindows = BrowserWindow.getAllWindows();
101
- if (allWindows.length) {
102
- allWindows[0].focus();
103
- } else {
104
- createWindow();
105
- }
106
- });
107
-
108
- // New window example arg: new windows url
109
- ipcMain.handle('open-win', (_, arg) => {
110
- const childWindow = new BrowserWindow({
111
- webPreferences: {
112
- preload,
113
- nodeIntegration: true,
114
- contextIsolation: false,
115
- },
116
- });
117
-
118
- if (serverUrl) {
119
- childWindow.loadURL(`${serverUrl}#${arg}`);
120
- } else {
121
- childWindow.loadFile(indexHtml, { hash: arg });
122
- }
123
- });