Welcom! intergitive
appreciates any contribution.
Contributions can mostly be made in two aspects: changes of main program or changes of tutorial contents. No matter which kind of contributions you would like to make, this guide will help you jump start.
Most part of intergitive
is developed under the following environment settings. It is highly recommended to use the same settings to avoid possible errors caused by differences in environment.
- Windows 10
- PowerShell v5.1
- node v12.20.2
- npm v6.14.11
- VS code v1.46
- ESLint v2.1.8: Currently this project adopts JavaScript Standard style because it needs least manual modifications while the project starting linting after a long time of development.
- Vetur 0.24.0
- vue 0.1.5
- YAML 0.16.0
- Clone the repository to your computer.
- Open PowerShell. Change directory to the cloned project. If no extra notion is provided, we assume that "execute command" means executing PowerShell command in the project directory.
- Install npm packages: execute command
npm install
- Important: install
nodegit
(a package allowsintergitive
to operate git)。One may choose to install it via a script or manually (if you don't trust the installtion script)- Via the script
- Allow PowerShell to execute scripts: execute command
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
- Run the script: execute
.\post-npm-install-win.ps1 -architecture x64
- Allow PowerShell to execute scripts: execute command
- Manually. We will install
nodegit
for running in node and electron. We also maintain a cache for switching between the two modes quickly.- Initialize cache: execute
node .\dev\module-switch.js init
- Clean up existing cache (one may skip this step if it is the first time of cloning
intergitive
): executenode .\dev\module-switch.js drop nodegit
- Install
nodegit
for electron- Create
.npmrc
and fill in the following contents. If the file already exists, overwrite it:
- Create
$content = @" runtime = electron target = 8.2.0 target_arch = $architecture disturl = "https://atom.io/download/atom-shell"
- Install
nodegit
: executenpm install nodegit@0.26.x
- Cache it: execute
node .\dev\module-switch.js save nodegit electron
- Install
nodegit
for node- Delete
.npmrc
- Install
nodegit
: executenpm install nodegit@0.26.x
- Cache it: execute
node .\dev\module-switch.js save nodegit node
- Delete
- Initialize cache: execute
- Via the script
- Run tests in node: execute
npm run test
(takes about 5-10 minutes) - Run tests in electron: execute
npm run etest
(takes about 5-10 minutes) - Execute the program: execute
npm run test-pack
Here are a brief list of NPM commands that might be useful
load-native-node
: switch NPM native packages to node modeload-native-electron
: switch NPM native packages to electron modetest
: run tests in nodecheck-course
: checks if any assets used in tutorials is missingetest
: run tests in electronlint
: run style checksfix-lint
: run style checks and try fix it automaticallypack
: pack the project in production mode. The entry point of packed product ismain.js
in the project folderpack-dev
: pack the project in development mode. The entry point of packed product ismain.js
in the project foldertest-pack
: pack and execute the project in development modetest-pack-production
: pack and execute the project in production modebuild-pack-win64
: pack the project in production mode and bundle it into theout
folder. Please ensure the folder is empty before execution
- Please be sure the style checks are passed: execute
npm run lint
ornpm run fix-lint
to fix errors automatically - Please be sure that all tests are passed: execute
npm run test