Skip to content

Commit 5c9abff

Browse files
authored
chore: bump version to 34; fix several errors (#45)
* docs: correct the invalid link in README demo * refactor: filename typo * fix: missing key and illegal fixed (left after right) in tsx * chore: bump version to 34 and electron 34 and update dev script
1 parent dce4650 commit 5c9abff

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ npm i electrom --save-dev
4444
Please visit the demo code
4545

4646
- [./example/main.ts](./example/main.ts)
47-
- [electron-modules/electron-windows/blob/master/app/electrom.js](https://github.com/electron-modules/electron-windows/blob/master/app/electrom.js)
47+
- [electron-modules/electron-modules-sample/main/src/electrom.ts](https://github.com/electron-modules/electron-modules-sample/blob/main/src/electrom.ts)
4848

4949
```typescript
5050
// main process: import electrom

example/bootstrap.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// New version Electron CLI passes the script directly to the internal Node VM
2+
// without ensuring pre-transpilation with `-r ts-node/register/transpile-only`.
3+
// This bootstrap file is a workaround then.
4+
require('ts-node/register/transpile-only');
5+
require('./main.ts');

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "electrom",
3-
"version": "19.3.1",
3+
"version": "34.0.0",
44
"description": "Electrom is a resource management solution for Electron applications, which is convenient for performance management and friendly debugging of multiple windows",
55
"scripts": {
66
"build": "sh ./build.sh",
77
"build:web": "cross-env NODE_ENV=production webpack",
88
"dev": "concurrently npm:dev:*",
9-
"dev:main": "cross-env NODE_ENV=development electron -r ts-node/register/transpile-only ./example/main.ts",
9+
"dev:main": "cross-env NODE_ENV=development electron ./example/bootstrap.js",
1010
"dev:web": "cross-env NODE_ENV=development webpack-dev-server",
1111
"test": "jest",
1212
"lint": "eslint --fix --quiet --ext .js,.jsx ./src",
@@ -61,8 +61,8 @@
6161
"css-loader": "^0.28.8",
6262
"css-minimizer-webpack-plugin": "^4.2.2",
6363
"detect-port": "1",
64-
"electron": "22",
65-
"electron-windows": "18",
64+
"electron": "34",
65+
"electron-windows": "34",
6666
"eslint": "^7.32.0",
6767
"git-contributor": "*",
6868
"html-webpack-plugin": "^5.5.0",
@@ -113,4 +113,4 @@
113113
]
114114
},
115115
"license": "MIT"
116-
}
116+
}

src/renderer/StatusBoard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ const useViewModel = (props: StatusBoardProps) => {
9393
<span className={styles.desc}>
9494
<span>id:{webContentInfo.id}</span>
9595
<span>type:{webContentInfo.type}</span>
96-
{display.map((item) => (
97-
<span>{item}</span>
96+
{display.map((textOrElement, index) => (
97+
<span key={index}>{textOrElement}</span>
9898
))}
9999
</span>
100100
</>
@@ -173,7 +173,7 @@ const useViewModel = (props: StatusBoardProps) => {
173173
title: 'Action',
174174
dataIndex: 'type',
175175
width: '60px',
176-
fixed: 'left',
176+
fixed: 'right',
177177
render: (type: string, item) => {
178178
const isDevtoolsSelf = !!item.webContentInfo?.url.startsWith('devtools://devtools');
179179
return (
File renamed without changes.

0 commit comments

Comments
 (0)