Skip to content

Commit 7bf0e61

Browse files
committed
Add documentation in CONTRIBUTING.md and npm run help.
1 parent 10595dd commit 7bf0e61

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

CONTRIBUTING.md

+45
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,52 @@ We try to get to pull requests in a very timely way so they don't languish. Noth
5656
* pull-request: (on github)
5757

5858

59+
### NPM Commands
5960

61+
* `npm run help`
62+
63+
Help on all `npm` commands.
64+
65+
* `npm run build`
66+
67+
Production, optimized build.
68+
69+
* `npm run devbuild`
70+
71+
Development, unoptimized build
72+
73+
* `npm run watch`
74+
75+
Development, unoptimized build, which will automatically be rebuilt when there are any source changes.
76+
77+
* `npm run dist`
78+
79+
Prepare the distribution: build the optimized Skulpt, run all tests, build docs.
80+
81+
* `npm run brun <pyfile>`
82+
83+
Run Python <pyfile> in the browser. This will automatically rebuild the unoptimized Skulpt first.
84+
85+
* `npm run btest`
86+
87+
Run the unit tests in the browser.
88+
89+
* `npm run repl`
90+
91+
Open the REPL. You need to build Skulpt (either `npm run build` or `npm run devbuild`) first.
92+
93+
* `npm test`
94+
95+
Run all tests. You need to build Skulpt (either `npm run build` or `npm run devbuild`) first.
96+
97+
* `npm start <py2|py3> <pyfile>`
98+
99+
Run pyfile using either Python 2 (py2) or Python 3 (py3). You need to build Skulpt (either `npm run build` or `npm run devbuild`) first.
100+
101+
* `npm run profile <py2|py3> <pyfile>`
102+
103+
Run pyfile using either Python 2 (py2) or Python 3 (py3) with the profiler on. Will report the profiling results to the console. You need to build the optimized Skulpt (`npm run build`) first.
104+
60105

61106
## Coding Style and Conventions
62107

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"skulpt"
77
],
88
"scripts": {
9+
"help": "node support/build/help.js",
910
"regenparser": "node support/build/regenparser.js",
1011
"prebrun": "npm run devbuild",
1112
"brun": "node support/run/brun.js -p",

support/build/help.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const chalk = require('chalk');
2+
3+
var commands = {
4+
"run help": "Help on all " + chalk.green("npm") + " commands.",
5+
"run build": "Production, optimized build.",
6+
"run devbuild": "Development, unoptimized build",
7+
"run watch": "Development, unoptimized build, which will automatically be rebuilt when there are any source changes.",
8+
"run dist": "Prepare the distribution: build the optimized Skulpt, run all tests, build docs.",
9+
"run brun <pyfile>": "Run Python <pyfile> in the browser. This will automatically rebuild the unoptimized Skulpt first.",
10+
"run btest": "Run all unit tests in the browser.",
11+
"run repl": "Open the REPL. You need to build Skulpt (either " + chalk.green("npm run build") + " or " + chalk.green("npm run devbuild") + ") first.",
12+
"test": "Run all tests. You need to build Skulpt (either " + chalk.green("npm run build") + " or " + chalk.green("npm run devbuild") + ") first.",
13+
"start <py2|py3> <pyfile>": "Run pyfile using either Python 2 (py2) or Python 3 (py3). You need to build Skulpt (either " + chalk.green("npm run build") + " or " + chalk.green("npm run devbuild") + ") first.",
14+
"run profile <py2|py3> <pyfile>": "Run pyfile using either Python 2 (py2) or Python 3 (py3) with the profiler on. Will report the profiling results to the console. You need to build the optimized Skulpt (" + chalk.green("npm run build") + ") first."
15+
};
16+
17+
for (command in commands) {
18+
console.log(chalk.green("npm " + command));
19+
console.log("\t" + commands[command]);
20+
console.log("");
21+
}
22+
23+
24+

0 commit comments

Comments
 (0)