Skip to content

Commit 5a6e546

Browse files
committed
use permissions
1 parent 2fa575f commit 5a6e546

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

deno.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
"compilerOptions": {
33
"lib": ["dom", "deno.ns"]
44
},
5+
"permissions": {
6+
"build-dictionary": {
7+
"env": ["NO_COLOR", "DEBUG_TAGS", "DEBUG_CHUNKS"],
8+
"read": ["./dictionary/dictionary"],
9+
"write": ["./dictionary/dictionary.ts"]
10+
},
11+
"soft-build-dictionary": {
12+
"env": ["NO_COLOR", "DEBUG_TAGS", "DEBUG_CHUNKS"],
13+
"read": ["./dictionary/dictionary", "./dictionary/dictionary.ts"],
14+
"write": ["./dictionary/dictionary.ts"]
15+
}
16+
},
517
"tasks": {
618
"build": {
719
"description": "Builds every static files needed for GitHub pages. This builds the dictionary first at `./dictionary/dictionary.ts` then the distribution code `./dist/main.js`.",
@@ -10,7 +22,7 @@
1022
},
1123
"start": {
1224
"description": "Starts a development server which automatically rebuilds the project whenever there are changes to the code. However, there is no server that serves frontend and you have to manually refresh the page.",
13-
"command": "(trap 'kill 0' SIGINT; deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only --watch --no-clear-screen ./dictionary/watch.ts & deno bundle --output=./dist/main.js --sourcemap=linked --platform=browser --format=iife --watch ./src/main.ts)",
25+
"command": "(trap 'kill 0' SIGINT; deno run --permission-set=build-dictionary --no-prompt --frozen --cached-only --watch --no-clear-screen ./dictionary/watch.ts & deno bundle --output=./dist/main.js --sourcemap=linked --platform=browser --format=iife --watch ./src/main.ts)",
1426
"dependencies": ["soft-build-dictionary"]
1527
},
1628
"repl": {
@@ -20,11 +32,11 @@
2032
},
2133
"build-dictionary": {
2234
"description": "Builds the dictionary at `./dictionary/dictionary.ts`",
23-
"command": "deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/build.ts"
35+
"command": "deno run --permission-set=build-dictionary --no-prompt --frozen --cached-only ./dictionary/build.ts"
2436
},
2537
"soft-build-dictionary": {
2638
"description": "Only builds the dictionary at `./dictionary/dictionary.ts` when it doesn't exists. When an error occurs, an empty dictionary is provided.",
27-
"command": "deno run -E=NO_COLOR,DEBUG_TAGS,DEBUG_CHUNKS -R=./dictionary/dictionary,./dictionary/dictionary.ts -W=./dictionary/dictionary.ts --no-prompt --frozen --cached-only ./dictionary/soft-build.ts"
39+
"command": "deno run --permission-set=soft-build-dictionary --no-prompt --frozen --cached-only ./dictionary/soft-build.ts"
2840
}
2941
},
3042
"fmt": {

0 commit comments

Comments
 (0)