Skip to content

Commit 5589eec

Browse files
authored
docs: Improved CONTIRUBTING.md (#6892)
1 parent 869ec27 commit 5589eec

File tree

2 files changed

+69
-23
lines changed

2 files changed

+69
-23
lines changed

.changeset/ninety-gifts-swim.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
docs: Improved CONTIRUBTING.md

CONTRIBUTING.md

+64-23
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
You decided to contribute to this project? Great, thanks a lot for pushing it.
22

3-
This project adheres to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
3+
This project adheres to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
44
By participating, you are expected to uphold this code. Please file issue to report unacceptable behavior.
55

6+
This repository has a mono-repo structure consisting of multiple packages. Try to take a look at the [packages directory](https://github.com/electron-userland/electron-builder/tree/master/packages)!
7+
68
## Prerequisites
9+
710
> All prerequisites could be installed via script at the end of the chapter
8-
>
911
10-
* [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM.
11-
* For local development, you can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to
12-
electron-builder for your other projects to leverage and test with.
12+
- [pnpm](https://pnpm.js.org) is required because NPM is not reliable and Yarn 2 is not as good as PNPM.
13+
- For local development, you can use [yalc](https://github.com/whitecolor/yalc) in order to apply changes made to
14+
electron-builder for your other projects to leverage and test with.
15+
1316
```
14-
npm install -g pnpm
17+
npm i -g pnpm
1518
pnpm i yalc -g
1619
```
1720

21+
- (unsettled) You may need yarn. See [this issue](https://github.com/electron-userland/electron-builder/issues/6820) for details. Detailed reports are welcome.
22+
23+
```
24+
npm i -g yarn
25+
```
26+
1827
## To setup a local dev environment
28+
1929
Follow this chapter to setup an environment from scratch.
30+
2031
```
2132
git clone https://github.com/electron-userland/electron-builder.git
2233
@@ -25,38 +36,66 @@ pnpm install
2536
popd
2637
```
2738

28-
You must link `yalc`'s local "packages" to your project via the one-liner below (run from your project folder)
39+
You must publish and link `yalc`'s local "packages" to your project via the one-liner below (run from your project folder).
40+
Unfortunately,the `yalc publish` command cannot pass multiple packages.
41+
2942
```
43+
yalc publish app-builder-lib
44+
yalc publish builder-util
45+
yalc publish builder-util-runtime
46+
yalc publish dmg-builder
47+
yalc publish electron-builder
48+
yalc publish electron-publish
49+
yalc publish electron-builder-squirrel-windows
50+
yalc publish electron-forge-maker-appimage
51+
yalc publish electron-forge-maker-nsis
52+
yalc publish electron-forge-maker-nsis-web
53+
yalc publish electron-forge-maker-snap
54+
yalc publish electron-updater
55+
3056
yalc link app-builder-lib builder-util builder-util-runtime dmg-builder electron-builder electron-publish electron-builder-squirrel-windows electron-forge-maker-appimage electron-forge-maker-nsis electron-forge-maker-nsis-web electron-forge-maker-snap electron-updater
3157
```
3258

33-
The magical script for whenever you make changes to electron-builder! Rebuilds electron-builder, and then patches
59+
The magical script for whenever you make changes to electron-builder! Rebuilds electron-builder, and then patches
3460
the npm modules in your project (such as `electron-quick-start`).
35-
Ready for copy-paste into terminal presuming electron-builder repo is at root level outside your project folder,
61+
Ready for copy-paste into terminal presuming electron-builder repo is at root level outside your project folder,
3662
otherwise adjust path as necessary.
63+
3764
```
3865
pushd ../electron-builder
3966
pnpm compile
4067
find packages/ -type d -maxdepth 1 -print0 | xargs -0 -L1 sh -c 'cd "$0" && yalc push'
4168
popd
4269
```
4370

71+
If you are using Windows and Visual Studio Code(Powershell), please use this.
72+
73+
```PowerShell
74+
pushd ..\electron-builder
75+
pnpm compile
76+
Get-ChildItem packages -Directory | Foreach-Object{pushd "./packages/$_"; yalc push; popd;}
77+
popd
78+
```
79+
4480
On Windows cmd.exe:
81+
4582
```batch
4683
pushd ..\electron-builder
4784
pnpm compile
48-
for /D %d in (packages\*) do (pushd "%d" & yalc push & popd)
85+
for /D %d in (packages\*) do (pushd "%d" & yalc push & popd)
4986
popd
5087
```
5188

5289
## Pull Requests
90+
5391
To check that your contributions match the project coding style make sure `pnpm test` passes.
5492
To build project run: `pnpm i && pnpm compile`
5593

5694
> If you get strange compilation errors, try to remove all `node_modules` directories in the project (especially under `packages/*`).
57-
>
95+
5896
### Git Commit Guidelines
59-
We use [semantic-release](https://github.com/semantic-release/semantic-release), so we have very precise rules over how
97+
98+
We use [semantic-release](https://github.com/semantic-release/semantic-release), so we have very precise rules over how
6099
our git [commit messages can be formatted](https://gist.github.com/develar/273e2eb938792cf5f86451fbac2bcd51).
61100

62101
## Documentation
@@ -71,32 +110,34 @@ Build command: `mkdocs build`.
71110

72111
## Debug Tests
73112

74-
Only IntelliJ Platform IDEs ([IntelliJ IDEA](https://confluence.jetbrains.com/display/IDEADEV/IDEA+2017.1+EAP),
113+
Only IntelliJ Platform IDEs ([IntelliJ IDEA](https://confluence.jetbrains.com/display/IDEADEV/IDEA+2017.1+EAP),
75114
[WebStorm](https://confluence.jetbrains.com/display/WI/WebStorm+EAP)) support debug.
76115

77-
If you use IntelliJ IDEA or WebStorm — [ij-rc-producer](https://github.com/develar/ij-rc-producer) is used and you
116+
If you use IntelliJ IDEA or WebStorm — [ij-rc-producer](https://github.com/develar/ij-rc-producer) is used and you
78117
can run tests from an editor (just click on `Run` green gutter icon).
79118

80119
Or you can create the Node.js run configuration manually:
81-
* Ensure that `Before launch` contains `Compile TypeScript`.
82-
* Set `Node interpreter` to NodeJS 8. NodeJS 8 is required to debug.
83-
* Set `Application Parameters` to `-t "test name" relative-test-file-name` if you want to debug particular test. E.g.
120+
121+
- Ensure that `Before launch` contains `Compile TypeScript`.
122+
- Set `Node interpreter` to NodeJS 8. NodeJS 8 is required to debug.
123+
- Set `Application Parameters` to `-t "test name" relative-test-file-name` if you want to debug particular test. E.g.
84124
```
85125
-t "extraResources - one-package" globTest.js
86126
```
87-
* Set `Environment Variables`:
88-
* Optionally, `TEST_APP_TMP_DIR` to some directory (e.g. `/tmp/electron-builder-test`) to inspect output if test
89-
uses temporary directory (only if `--match` is used). Specified directory will be used instead of random
90-
temporary directory and *cleared* on each run.
127+
- Set `Environment Variables`:
128+
- Optionally, `TEST_APP_TMP_DIR` to some directory (e.g. `/tmp/electron-builder-test`) to inspect output if test
129+
uses temporary directory (only if `--match` is used). Specified directory will be used instead of random
130+
temporary directory and _cleared_ on each run.
91131

92132
### Run Test using CLI
133+
93134
```sh
94135
pnpm compile
95136
TEST_APP_TMP_DIR=/tmp/electron-builder-test ./node_modules/.bin/jest --env jest-environment-node-debug -t 'assisted' '/oneClickInstallerTest\.\w+$'
96137
```
97-
where `TEST_APP_TMP_DIR` is specified to easily inspect and use test build, `assisted` is the test name
98-
and `/oneClickInstallerTest\.\w+$` is the path to test file.
99138

139+
where `TEST_APP_TMP_DIR` is specified to easily inspect and use test build, `assisted` is the test name
140+
and `/oneClickInstallerTest\.\w+$` is the path to test file.
100141

101142
## Issues
102143

0 commit comments

Comments
 (0)