Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Commit fd69e11

Browse files
ltfschoenamaury1093
authored andcommitted
WIP: Relates to #81. Update to Electron v4.1.0 (#91)
* fix: Fixes #81. Update to Electron 4 * misc: Contributor instructions. Minimum Node.js version check for Electron 4 * Add contributor instructions for forking, cloning, testing, linting, and building * Add contributor instructions for checking if dependencies need updating * Add contributor instructions for updating dependencies and checking that latest library updates integrate with other repos by adding a version number to the package.json so that it may be installed from a remote branch. * Add minimum Node.js version compatible with Electron 4. * docs: Use NPM outdated * fix: Add typescript to devDependencies of abi package to fix missing tsc when install as dependency * fix: Add Typescript dependency to all packages to avoid missing tsc binary error when install as dependency * fix: Use tsc binary of package not global version * fix: Install dependencies first before run tsc * fix: Install dependencies before run tsc * Able to run yarn and yarn build using Node.js v10.11.0 * feat: Relates to #81. Update to Electron v3.1.0 * Update to Electron v3.1.0 - https://github.com/electron/electron/releases * Update Readme * Update dependencies versions * Add .nvmrc * fix: Add version to NPM package.json Otherwise when try to use the package from a remote branch such as ``` "@parity/electron": "https://github.com/paritytech/js-libs.git#luke-81-electron-3", ``` Then it produces error: ``` error Can't add "@parity/electron": invalid package version undefined. ``` * fix: Update dependencies. See commit details When I add this to the fether-electron package.json dependency with: ``` "@parity/electron": "https://github.com/paritytech/js-libs.git#luke-81-electron-3", ``` And then try to run `yarn; yarn build;`, it gives the following error: ``` scon @ ~/code/src/paritytech/fether - [luke-309-electron-3] $ yarn; yarn build yarn install v1.12.3 [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... [3/5] 🚚 Fetching packages... [4/5] 🔗 Linking dependencies... warning " > [email protected]" has unmet peer dependency "eslint@>= 4.12.1". warning " > [email protected]" has unmet peer dependency "prop-types@^15.6.1". warning " > [email protected]" has unmet peer dependency "react@^16.4.0". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > @parity/[email protected]" has incorrect peer dependency "rxjs@~6.2.2". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > @parity/[email protected]" has incorrect peer dependency "rxjs@~6.2.2". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > [email protected]" has unmet peer dependency "prop-types@^15.6.0". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > [email protected]" has unmet peer dependency "prop-types@^15.6.0". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-ui > [email protected]" has unmet peer dependency "react-dom@>=0.14.0 <= 16". warning "workspace-aggregator-cc67e372-3487-4efc-8fcb-a403fb15962c > fether-react > @babel/plugin-proposal-decorators > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0-0". [5/5] 📃 Building fresh packages... [1/2] ⠄ @parity/electron error /Users/scon/code/src/paritytech/fether/node_modules/@parity/electron: Command failed. Exit code: 1 Command: yarn build Arguments: Directory: /Users/scon/code/src/paritytech/fether/node_modules/@parity/electron Output: yarn run v1.12.3 $ lerna exec yarn build --stream lerna notice cli v3.10.1 lerna info Executing command in 6 packages: "yarn build" @parity/abi: $ rimraf lib @parity/electron: $ rimraf lib @parity/abi: $ tsc @parity/abi: /bin/sh: tsc: command not found @parity/electron: $ tsc @parity/abi: error Command failed with exit code 127. @parity/abi: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. @parity/electron: /bin/sh: tsc: command not found lerna ERR! yarn build exited 1 in '@parity/abi' lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` * review-fix: Updates to address comments in the electron 3 PR * fix: Remove useless .nvmrc file * review-fix: Update Readme Step 7 * review-fix: Revert back to just tsc command since resolved Step 7 issue * review-fix: Remove version number from main package.json. See Readme updates * fix: Remove .npmrc file * remove .nvmrc * review-fix: Fix to resolve CI failing as cannot find matching electron version Tries to solve the following error when push to Github and CI runs ``` CI is failing with error Couldn't find any versions for "electron" that matches "^2.0.2 | ^3.1.0 | ^4.0.1" ``` * review-fix: Remove version number * review-fix: Revert to just tsc in package.json build
1 parent 39ea5e2 commit fd69e11

File tree

9 files changed

+908
-644
lines changed

9 files changed

+908
-644
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,69 @@ And below are the lower-level packages, used internally, or by advanced users.
3131
| [`@parity/contracts`](/packages/contracts) | [![npm (scoped)](https://img.shields.io/npm/v/@parity/contracts.svg)](https://www.npmjs.com/package/@parity/contracts) | [![README](https://img.shields.io/badge/docs-README-green.svg)](/packages/contracts#readme) | Parity's [contracts](https://github.com/parity-contracts) as ES6 classes. |
3232
| [`@parity/electron`](/packages/electron) | [![npm (scoped)](https://img.shields.io/npm/v/@parity/electron.svg)](https://www.npmjs.com/package/@parity/electron) | [![README](https://img.shields.io/badge/docs-README-green.svg)](/packages/electron#readme) | Control the Parity Ethereum node from Electron. |
3333

34+
### Contributing
35+
36+
#### Dependencies
37+
38+
Install at least `yarn` version 1.4.2 and [Node.js >=10.10.0](https://nodejs.org/en/)
39+
40+
```
41+
yarn --version // Should be at least 1.4.2
42+
```
43+
44+
#### Tests
45+
46+
```
47+
yarn test
48+
```
49+
50+
#### Build
51+
52+
```
53+
yarn build
54+
```
55+
56+
#### Maintenance
57+
58+
1. Fork the repo
59+
60+
2. Clone your fork
61+
```bash
62+
git clone https://github.com/<INSERT_YOUR_GITHUB_USERNAME>/js-libs
63+
```
64+
65+
3. Check outdated dependencies
66+
67+
```bash
68+
yarn outdated
69+
```
70+
71+
4. Create a branch
72+
73+
```bash
74+
git checkout -b <INSERT_YOUR_BRANCH_NAME>
75+
```
76+
77+
5. Run tests, linting, and build
78+
79+
```bash
80+
yarn test; yarn lint; yarn build
81+
```
82+
83+
6. Push the branch to your fork of the repo
84+
85+
7. Integrate the updated library as a dependency. Example: If you want to test a branch of one of the js-lib packages in another project like Fether temporarily, then build js-libs and replace the /lib directory where it's a dependency on the Fether project. Then run Fether to use it:
86+
87+
```bash
88+
~/paritytech/js-libs [my-branch-name] $ yarn build
89+
~/paritytech/js-libs [my-branch-name] $ cp -r packages/my-package/lib ../fether/node_modules/@parity/my-package/lib
90+
~/paritytech/js-libs [my-branch-name] $ cd ../fether
91+
~/paritytech/fether [master] $ yarn start
92+
```
93+
94+
8. Create a pull request from your fork of the repo to the upstream master branch
95+
96+
3497
## License
3598

3699
All Parity's JavaScript libraries are open-source software [licensed as MIT](/LICENSE).

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
"packages/*"
1818
]
1919
},
20+
"engines": {
21+
"node": ">=10.10.0",
22+
"yarn": "^1.4.2"
23+
},
2024
"scripts": {
2125
"build": "lerna exec yarn build --stream",
2226
"lint": "tslint 'packages/**/*.ts'",

packages/abi/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"test": "jest"
2222
},
2323
"devDependencies": {
24-
"@types/utf8": "^2.1.6"
24+
"@types/utf8": "^2.1.6",
25+
"typescript": "^3.1.6"
2526
},
2627
"dependencies": {
2728
"bignumber.js": "^8.0.1",

packages/api/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"sinon": "1.17.7",
3636
"sinon-as-promised": "4.0.2",
3737
"sinon-chai": "2.8.0",
38-
"ts-node": "^7.0.1"
38+
"ts-node": "^7.0.1",
39+
"typescript": "^3.1.6"
3940
},
4041
"dependencies": {
4142
"@parity/abi": "^3.0.25",

packages/contracts/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"@parity/abi": "^3.0.25",
2626
"@parity/api": "^3.0.25",
2727
"bignumber.js": "^8.0.1"
28+
},
29+
"devDependencies": {
30+
"typescript": "^3.1.6"
2831
}
2932
}

packages/electron/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,22 @@
2121
"test": "jest"
2222
},
2323
"dependencies": {
24-
"async-retry": "^1.2.1",
24+
"async-retry": "^1.2.3",
2525
"axios": "^0.18.0",
2626
"checksum": "^0.1.1",
27-
"command-exists": "^1.2.6",
28-
"debug": "^4.1.0",
29-
"electron-dl": "^1.11.0",
27+
"command-exists": "^1.2.8",
28+
"debug": "^4.1.1",
29+
"electron-dl": "^1.12.0",
3030
"promise-any": "^0.2.0",
31-
"sntp": "^3.0.1"
31+
"sntp": "^3.0.2"
3232
},
3333
"devDependencies": {
3434
"@types/async-retry": "^1.2.1",
3535
"@types/checksum": "^0.1.30",
36-
"electron": "^2.0.2"
36+
"electron": "^4.0.1",
37+
"typescript": "^3.1.6"
3738
},
3839
"peerDependencies": {
39-
"electron": "^2.0.3"
40+
"electron": "^2.0.2 | ^3.1.0 | ^4.0.1"
4041
}
4142
}

packages/light.js-react/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"enzyme-adapter-react-16": "^1.2.0",
3939
"jest-enzyme": "^6.0.3",
4040
"react": "^16.4.2",
41-
"react-dom": "^16.4.2"
41+
"react-dom": "^16.4.2",
42+
"typescript": "^3.1.6"
4243
},
4344
"peerDependencies": {
4445
"@parity/light.js": "^3.0.0",

packages/light.js/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"@types/debug": "^0.0.30",
3838
"@types/memoizee": "^0.4.2",
3939
"eventemitter3": "^3.1.0",
40-
"rxjs": "~6.2.2"
40+
"rxjs": "~6.2.2",
41+
"typescript": "^3.1.6"
4142
},
4243
"peerDependencies": {
4344
"rxjs": "~6.2.2"

0 commit comments

Comments
 (0)