@tomjs/create-app 0.5.0 → 0.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomjs/create-app",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "create tomjs web app",
5
5
  "keywords": [
6
6
  "tomjs",
@@ -5,7 +5,8 @@
5
5
  "version": "0.2.0",
6
6
  "configurations": [
7
7
  {
8
- "name": "Main Debug",
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
- "envFile": "${workspaceFolder}/node_modules/@tomjs/vite-plugin-electron/debug/.env",
20
- "outputCapture": "std",
21
- "console": "integratedTerminal"
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.js",
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,9 +31,9 @@
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.5.0",
34
+ "@tomjs/vite-plugin-electron": "^1.6.0",
33
35
  "@types/node": "^18.19.3",
34
- "@types/react": "^18.2.43",
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",
@@ -19,7 +19,7 @@ export default defineConfig(() => {
19
19
  },
20
20
  plugins: [
21
21
  react(),
22
- electron({ builder: true }),
22
+ electron(),
23
23
  // Use Node.js API in the Renderer process
24
24
  renderer(),
25
25
  ],
@@ -5,7 +5,8 @@
5
5
  "version": "0.2.0",
6
6
  "configurations": [
7
7
  {
8
- "name": "Main Debug",
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
- "envFile": "${workspaceFolder}/node_modules/@tomjs/vite-plugin-electron/debug/.env",
20
- "outputCapture": "std",
21
- "console": "integratedTerminal"
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, REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS } = await import(
74
- '@tomjs/electron-devtools-installer'
75
- );
76
-
77
- installExtension([REACT_DEVELOPER_TOOLS, REDUX_DEVTOOLS])
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.js",
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,7 +30,7 @@
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.5.0",
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",
@@ -18,7 +18,7 @@ export default defineConfig(() => {
18
18
  },
19
19
  plugins: [
20
20
  vue(),
21
- electron({ builder: true }),
21
+ electron(),
22
22
  // Use Node.js API in the Renderer process
23
23
  renderer(),
24
24
  ],
@@ -28,7 +28,7 @@
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.43",
31
+ "@types/react": "^18.2.45",
32
32
  "@types/react-dom": "^18.2.17",
33
33
  "@vitejs/plugin-react-swc": "^3.5.0",
34
34
  "eslint": "^8.55.0",