Skip to content

Commit 83df1d7

Browse files
committed
update command line documentations
1 parent 22df9d5 commit 83df1d7

File tree

2 files changed

+27
-54
lines changed

2 files changed

+27
-54
lines changed

README.md

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,11 @@ interpretation of the text. No machine learning involved.
99
**It is work in progress!**
1010
[We welcome contributors however!](./CONTRIBUTING.md)
1111

12-
## Dependencies
12+
## Building locally
1313

14-
You'll need the following in order to run commands:
14+
You'll need [Deno](https://deno.com/) for this project. Then you'll need to
15+
install the dependencies before running any command: `deno install`.
1516

16-
- [Deno](https://deno.com/)
17-
18-
Before running any command line mentioned here, run the following command first.
19-
20-
```
21-
deno install
22-
```
23-
24-
## Building
25-
26-
This builds the distribution code at `./dist/main.js` as minified file ready for
27-
production use, it also builds the source map so contributors can directly debug
28-
the production code.
29-
30-
```
31-
deno task build
32-
```
33-
34-
Before building the distribution code, it builds the dictionary first by
35-
transforming the dictionary into a code at `./dictionary/dictionary.ts`. This
36-
enables faster code startup without dealing with file access or network access.
37-
38-
## Watching
39-
40-
This is similar to [building](#building) but it doesn't minify the code. This
41-
command also watches the codes in `./src/` and `./dictionary/` including the
42-
dictionary and rebuilds whenever there are changes. To stop this command, simply
43-
press Ctrl + C.
44-
45-
```
46-
deno task watch
47-
```
48-
49-
## Running locally with browser
50-
51-
After building or watching, you can directly run `./dist/index.html` with your
52-
browser to test ilo Token. If you wish to start a local server, run
53-
`deno task start`. The stdout will tell you the URL to use.
54-
55-
## Running locally with Deno
56-
57-
This will run a REPL that you can use to test ilo Token. To stop this command,
58-
simply press Ctrl + D or Ctrl + C.
59-
60-
```
61-
deno task repl
62-
```
17+
After this, you can start away by running `deno task watch` then open
18+
`./dist/index.html` using your favorite browser. Run `deno task` to see more
19+
useful command lines.

deno.json

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,31 @@
33
"lib": ["dom", "deno.ns"]
44
},
55
"tasks": {
6-
"build": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./bundle.ts build",
6+
"build": {
7+
"description": "Builds `./dist/main.js` as minified file with source mapping at `./dist/main.js.map`. This command also builds the dictionary at `./dictionary/dictionary.ts`.",
8+
"command": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./bundle.ts build"
9+
},
10+
"watch": {
11+
"description": "Similar to `deno task build` but doesn't minify the code. This command also watches the source code and rebuilds `./dist/main.js` or `./dictionary/dictionary.ts` whenever necessary. This DOESN'T auto-refreshes the webpage.",
12+
"command": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./bundle.ts watch"
13+
},
14+
"start-server": {
15+
"description": "Starts a local server serving `./dist/` statically",
16+
"command": "deno run -N=0.0.0.0 -R=./dist/ --no-prompt jsr:@std/http/file-server ./dist/"
17+
},
718
"repl": {
19+
"description": "Starts a REPL",
820
"command": "deno run --no-prompt --frozen --cached-only ./src/repl.ts",
921
"dependencies": ["build-dictionary"]
1022
},
11-
"start": "deno run -N=0.0.0.0 -R=./dist/ --no-prompt jsr:@std/http/file-server ./dist/",
12-
"watch": "deno run -E -R -W -N=jsr.io --allow-run --no-prompt --frozen --cached-only ./bundle.ts watch",
13-
"update": "deno outdated --update && deno run -N=api.linku.la,gitlab.com -W=./telo_misikeke/linku_data.json,./telo_misikeke/Parser.js,./telo_misikeke/rules.js --no-prompt --frozen --cached-only ./telo_misikeke/update.ts",
14-
"build-dictionary": "deno run -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/build.ts"
23+
"update": {
24+
"description": "Updates dependencies and telo misikeke",
25+
"command": "deno outdated --update && deno run -N=api.linku.la,gitlab.com -W=./telo_misikeke/linku_data.json,./telo_misikeke/Parser.js,./telo_misikeke/rules.js --no-prompt --frozen --cached-only ./telo_misikeke/update.ts"
26+
},
27+
"build-dictionary": {
28+
"description": "Builds the dictionary at `./dictionary/dictionary.ts`",
29+
"command": "deno run -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/build.ts"
30+
}
1531
},
1632
"fmt": {
1733
"exclude": [

0 commit comments

Comments
 (0)