-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeno.jsonc
46 lines (44 loc) · 3.45 KB
/
deno.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"tasks": {
"run": "DENO_TASK=sub-run deno task sub-normal-task",
"compile" : "DENO_TASK=sub-compile deno task sub-normal-task",
"debug": "DENO_EXT=--inspect-brk deno task run",
"test": "deno test --unstable --trace-ops -A test",
"release": "DENO_TASK=sub-release DENO_REL=secure deno task sub-secure-task && DENO_TASK=sub-release DENO_REL=normal deno task sub-normal-task",
"run-secure": "DENO_TASK=sub-run deno task sub-secure-task",
"compile-secure": "DENO_TASK=sub-compile deno task sub-secure-task",
// these are all sub tasks, ie they are not meant to be run directly
// it's all kind of hacky but we call subs tasks like they're functions and pass them arguments via env vars
// sub-secure-task adds restricted permissions via $DENO_PERMS then runs the deno task provided in $DENO_TASK
// XXX the postgres module attempts to access an *abundance* of env vars related to postgres (and there's no way to silently deny them)
"sub-secure-task": "DENO_PERMS='--allow-net=127.0.0.1,localhost --allow-read=./booger.jsonc,./plugs,./index.html --allow-write=./booger.jsonc --allow-env=HOSTNAME,PORT,DB,DB_STATS,DB_LIMITS,PGHOST,PGPORT,PGDATABASE,PGUSERNAME,PGUSER,PGPASSWORD,PGIDLE_TIMEOUT,PGCONNECT_TIMEOUT,PGMAX,PGMAX_LIFETIME,PGMAX_PIPELINE,PGSSL,PGBACKOFF,PGKEEP_ALIVE,PGPREPARE,PGDEBUG,PGFETCH_TYPES,PGPUBLICATIONS,PGTARGET_SESSION_ATTRS,PGTARGETSESSIONATTRS,USERNAME,USER,LOGNAME' deno task $DENO_TASK",
// sub-normal-task adds permissive permissions via $DENO_PERMS and runs the deno task provided in $DENO_TASK
"sub-normal-task": "DENO_PERMS=-A deno task $DENO_TASK",
// sub-run takes $DENO_EXT and $DENO_PERMS and runs deno run
"sub-run": "deno run $DENO_EXT $DENO_PERMS --unstable index.js",
// sub-compile takes $DENO_EXT and $DENO_PERMS and runs deno compile
"sub-compile": "deno compile $DENO_EXT $DENO_PERMS --unstable --include=./plugs/builtin/validate/validate-sub.js --include=./plugs/builtin/validate/validate-event.js --include=./plugs/builtin/limits/limits.js --include=./plugs/builtin/stats/stats.js ./index.js -- --__compiled-version=$BOOGER_VER",
// sub-release adds $DENO_TARGET for all the target platforms and runs sub-sub-release
"sub-release": "DENO_TARGET=x86_64-unknown-linux-gnu deno task sub-sub-release && DENO_TARGET=x86_64-pc-windows-msvc deno task sub-sub-release && DENO_TARGET=x86_64-apple-darwin deno task sub-sub-release && DENO_TARGET=aarch64-apple-darwin deno task sub-sub-release",
// sub-sub-release adds $DENO_EXT using both $DENO_TARGET and $DENO_REL (specifies the target and output directory) then runs sub-compile
// after compiling, it zips the binary using $BOOGER_VER provided to the original task
"sub-sub-release": "DENO_EXT=\"--target=$DENO_TARGET -o ./release/$DENO_REL/$DENO_TARGET/booger\" deno task sub-compile && sh -c \"chmod +x ./release/$DENO_REL/$DENO_TARGET/booger*\" && sh -c \"zip -j ./release/booger-v$BOOGER_VER-$DENO_REL-$DENO_TARGET.zip ./release/$DENO_REL/$DENO_TARGET/booger*\""
},
"imports": {
"std/": "https://deno.land/[email protected]/",
"postgres": "https://deno.land/x/[email protected]/mod.js",
"sqlite": "https://deno.land/x/[email protected]/mod.ts",
"zod": "https://deno.land/x/[email protected]/mod.ts",
"secp": "npm:@noble/[email protected]/secp256k1"
},
"fmt": {
"options": {
"lineWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"useTabs": false,
"indentWidth": 2,
"semiColons": false
}
}
}