Skip to content

Commit 4597e88

Browse files
committed
Update packages for production, remove unused packages, update README
We can do `yarn install --production`
1 parent 801f7ef commit 4597e88

File tree

4 files changed

+63
-88
lines changed

4 files changed

+63
-88
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,26 @@ Alternatively, you may provide the configuration as environment variables
3535

3636
You can find full list of config options in [.env.sample](./.env.sample)
3737

38+
### Provide private key for JWT
39+
40+
You must provide a path to a private key for signing and verifying JWT tokens in `.env` file. You can generate it:
41+
42+
```
43+
openssl ecparam -name prime256v1 -genkey -noout -out ecdsa-p256-private.pem
44+
```
45+
46+
Default algorithm is ES256, but you can specify a different one.
47+
3848
### Run
3949

50+
Install for production:
51+
52+
```sh
53+
yarn install --frozen-lockfile --production
54+
```
55+
56+
Run:
57+
4058
```sh
4159
yarn start
4260
```
@@ -47,7 +65,17 @@ Service API is documented in [OpenAPI schema](./apidocs/openapi.json) (still wor
4765

4866
## Tests
4967

50-
Run `yarn test`
68+
Install for development:
69+
70+
```sh
71+
yarn install --frozen-lockfile
72+
```
73+
74+
Run:
75+
76+
```sh
77+
yarn test
78+
```
5179

5280
Tests are placed in [src/test/](./src/test/)
5381

package.json

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,26 @@
44
"main": "dist/index.js",
55
"scripts": {
66
"start": "yarn build && node dist/index.js",
7-
"build": "rm -rf dist && tsc && yarn copy-hbs",
7+
"build": "rm -rf dist && tsc --project tsconfig.production.json && yarn copy-hbs",
88
"copy-hbs": "cp src/templates/*.hbs dist/templates && cp src/templates/*.css dist/templates",
99
"format": "prettier 'src/**/*.ts' '**/*.{md,yml,yaml,json}' --write",
1010
"lint": "eslint . --ext .ts",
1111
"test": "mocha",
12+
"generate-key": "openssl ecparam -name prime256v1 -genkey -noout -out ecdsa-p256-private.pem",
1213
"generate-api-docs": "tsc && node dist/generate-api-docs.js"
1314
},
1415
"license": "MIT",
1516
"devDependencies": {
1617
"@solid/community-server": "^7.0.2",
17-
"@types/bcryptjs": "^2.4.2",
1818
"@types/chai": "^4.3.5",
19-
"@types/co-body": "^6.1.0",
20-
"@types/fs-extra": "^11.0.4",
21-
"@types/jsonwebtoken": "^9.0.5",
22-
"@types/koa": "^2.13.7",
23-
"@types/koa-static": "^4.0.3",
24-
"@types/koa__cors": "^4.0.1",
25-
"@types/koa__router": "^12.0.0",
26-
"@types/lodash": "^4.14.196",
2719
"@types/maildev": "^0.0.7",
2820
"@types/mocha": "^10.0.1",
29-
"@types/n3": "^1.16.0",
30-
"@types/node": "^20.4.2",
31-
"@types/nodemailer": "^6.4.9",
32-
"@types/parse-link-header": "^2.0.1",
3321
"@types/sinon": "^10.0.15",
34-
"@types/tough-cookie": "^4.0.5",
3522
"@typescript-eslint/eslint-plugin": "^6.0.0",
3623
"@typescript-eslint/parser": "^6.19.0",
3724
"chai": "^4.3.7",
3825
"cheerio": "^1.0.0-rc.12",
26+
"cross-fetch": "^4.0.0",
3927
"eslint": "^8.13.0",
4028
"eslint-config-prettier": "^8.5.0",
4129
"eslint-import-resolver-typescript": "^3.6.1",
@@ -46,24 +34,29 @@
4634
"msw": "^2.0.14",
4735
"prettier": "^3.0.0",
4836
"puppeteer": "^22.2.0",
49-
"rdf-namespaces": "^1.11.0",
5037
"sinon": "^15.2.0",
5138
"swagger-autogen": "^2.23.6",
52-
"tough-cookie": "^4.1.3",
53-
"ts-node": "^10.9.1",
54-
"typescript": "^5.1.6"
39+
"ts-node": "^10.9.1"
5540
},
5641
"dependencies": {
57-
"@inrupt/solid-client-authn-node": "^1.17.0",
5842
"@koa/bodyparser": "^5.0.0",
5943
"@koa/cors": "^4.0.0",
6044
"@koa/router": "^12.0.0",
6145
"@ldhop/core": "^0.0.0-alpha.1",
6246
"@solid/access-token-verifier": "^2.0.5",
47+
"@types/co-body": "^6.1.0",
48+
"@types/fs-extra": "^11.0.4",
49+
"@types/jsonwebtoken": "^9.0.5",
50+
"@types/koa": "^2.13.7",
51+
"@types/koa-static": "^4.0.3",
52+
"@types/koa__cors": "^4.0.1",
53+
"@types/koa__router": "^12.0.0",
54+
"@types/lodash": "^4.14.196",
55+
"@types/n3": "^1.16.0",
56+
"@types/node": "^20.4.2",
57+
"@types/nodemailer": "^6.4.9",
6358
"ajv": "^8.12.0",
6459
"ajv-formats": "^2.1.1",
65-
"bcryptjs": "^2.4.3",
66-
"cross-fetch": "^4.0.0",
6760
"css-authn": "^0.0.15-alpha.3",
6861
"dotenv": "^16.0.0",
6962
"fs-extra": "^11.2.0",
@@ -76,6 +69,7 @@
7669
"lodash": "^4.17.21",
7770
"n3": "^1.17.0",
7871
"nodemailer": "^6.9.4",
79-
"parse-link-header": "^2.0.0"
72+
"rdf-namespaces": "^1.11.0",
73+
"typescript": "^5.1.6"
8074
}
8175
}

tsconfig.production.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"esModuleInterop": true,
5+
"target": "es6",
6+
"moduleResolution": "node",
7+
"sourceMap": true,
8+
"outDir": "dist",
9+
"rootDir": "src",
10+
"strict": true,
11+
"noImplicitAny": true,
12+
"downlevelIteration": true
13+
},
14+
"lib": ["esnext"],
15+
"exclude": ["src/test", "src/generate-api-docs.ts"]
16+
}

yarn.lock

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,16 +2443,6 @@
24432443
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
24442444
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
24452445

2446-
"@inrupt/solid-client-authn-core@^1.17.0":
2447-
version "1.17.0"
2448-
resolved "https://registry.yarnpkg.com/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.17.0.tgz#fb8332dfb863cb898491c4e1db9d27f34319dd5c"
2449-
integrity sha512-r0P3nArdJX5yiY0/ZPmKVJ/xe20Unw+qrUn+ysAmAXQvL+V0gDcuGFZwrqHgMA1r6+1dLIqxlKGzMKLigFnJcw==
2450-
dependencies:
2451-
"@inrupt/universal-fetch" "^1.0.1"
2452-
events "^3.3.0"
2453-
jose "^4.10.0"
2454-
uuid "^9.0.0"
2455-
24562446
"@inrupt/solid-client-authn-core@^1.17.5":
24572447
version "1.17.5"
24582448
resolved "https://registry.yarnpkg.com/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.17.5.tgz#fc1eb1a3f4558bc924934862b5f1865a4f50dd4e"
@@ -2463,17 +2453,6 @@
24632453
jose "^4.15.4"
24642454
uuid "^9.0.1"
24652455

2466-
"@inrupt/solid-client-authn-node@^1.17.0":
2467-
version "1.17.0"
2468-
resolved "https://registry.yarnpkg.com/@inrupt/solid-client-authn-node/-/solid-client-authn-node-1.17.0.tgz#8e6faaf5b0c96a8cb24450750a4be20d48baa177"
2469-
integrity sha512-rJsoNDn/EpvvcFvaV9gXI3TdRx0alS6+MYn1TFWbLE4qNKjBDb3hFUaCVN6tlTx3o0F9kT856mKx/XVGz/Hrww==
2470-
dependencies:
2471-
"@inrupt/solid-client-authn-core" "^1.17.0"
2472-
"@inrupt/universal-fetch" "^1.0.1"
2473-
jose "^4.3.7"
2474-
openid-client "~5.4.2"
2475-
uuid "^9.0.0"
2476-
24772456
"@inrupt/universal-fetch@^1.0.1":
24782457
version "1.0.2"
24792458
resolved "https://registry.yarnpkg.com/@inrupt/universal-fetch/-/universal-fetch-1.0.2.tgz#9e9ef73b2e19ea3c1b89411efa14cd3c212817f4"
@@ -2887,11 +2866,6 @@
28872866
resolved "https://registry.yarnpkg.com/@types/async-lock/-/async-lock-1.4.0.tgz#e7d555d037f93e911d54000acb626e783ff9023a"
28882867
integrity sha512-2+rYSaWrpdbQG3SA0LmMT6YxWLrI81AqpMlSkw3QtFc2HGDufkweQSn30Eiev7x9LL0oyFrBqk1PXOnB9IEgKg==
28892868

2890-
"@types/bcryptjs@^2.4.2":
2891-
version "2.4.2"
2892-
resolved "https://registry.yarnpkg.com/@types/bcryptjs/-/bcryptjs-2.4.2.tgz#e3530eac9dd136bfdfb0e43df2c4c5ce1f77dfae"
2893-
integrity sha512-LiMQ6EOPob/4yUL66SZzu6Yh77cbzJFYll+ZfaPiPPFswtIlA/Fs1MzdKYA7JApHU49zQTbJGX3PDmCpIdDBRQ==
2894-
28952869
"@types/bcryptjs@^2.4.4":
28962870
version "2.4.6"
28972871
resolved "https://registry.yarnpkg.com/@types/bcryptjs/-/bcryptjs-2.4.6.tgz#2b92e3c2121c66eba3901e64faf8bb922ec291fa"
@@ -3221,11 +3195,6 @@
32213195
"@types/koa" "*"
32223196
"@types/node" "*"
32233197

3224-
"@types/parse-link-header@^2.0.1":
3225-
version "2.0.1"
3226-
resolved "https://registry.yarnpkg.com/@types/parse-link-header/-/parse-link-header-2.0.1.tgz#be4b412eb36e5d6bffc481e3f6e38b7706a4c9ee"
3227-
integrity sha512-BrKNSrRTqn3UkMXvdVtr/znJch0PMBpEvEP8oBkxDx7eEGntuFLI+WpA5HGsNHK4SlqyhaMa+Ks0ViwyixQB5w==
3228-
32293198
"@types/proper-lockfile@^4.1.2":
32303199
version "4.1.2"
32313200
resolved "https://registry.yarnpkg.com/@types/proper-lockfile/-/proper-lockfile-4.1.2.tgz#49537cee7134055ee13a1833b76a1c298f39bb26"
@@ -3335,11 +3304,6 @@
33353304
resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.4.tgz#041143ba4a918e8f080f8b0ffbe3d4cb514e2315"
33363305
integrity sha512-eqNDvZsCNY49OAXB0Firg/Sc2BgoWsntsLUdybGFOhAfCD6QJ2n9HXUIHGqt5qjrxmMv4wS8WLAw43ZkKcJ8Pw==
33373306

3338-
"@types/tough-cookie@^4.0.5":
3339-
version "4.0.5"
3340-
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304"
3341-
integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==
3342-
33433307
"@types/triple-beam@^1.3.2":
33443308
version "1.3.2"
33453309
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.2.tgz#38ecb64f01aa0d02b7c8f4222d7c38af6316fef8"
@@ -6263,7 +6227,7 @@ jake@^10.8.5:
62636227
filelist "^1.0.4"
62646228
minimatch "^3.1.2"
62656229

6266-
jose@^4.10.0, jose@^4.10.3, jose@^4.14.4, jose@^4.3.7:
6230+
jose@^4.10.3:
62676231
version "4.14.4"
62686232
resolved "https://registry.yarnpkg.com/jose/-/jose-4.14.4.tgz#59e09204e2670c3164ee24cbfe7115c6f8bff9ca"
62696233
integrity sha512-j8GhLiKmUAh+dsFXlX1aJCbt5KMibuKb+d7j1JaOJG6s2UjX1PQlW+OKB/sD4a/5ZYF4RcmYmLSndOoU3Lt/3g==
@@ -7083,11 +7047,6 @@ object-assign@^4:
70837047
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
70847048
integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==
70857049

7086-
object-hash@^2.2.0:
7087-
version "2.2.0"
7088-
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-2.2.0.tgz#5ad518581eefc443bd763472b8ff2e9c2c0d54a5"
7089-
integrity sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==
7090-
70917050
object-hash@^3.0.0:
70927051
version "3.0.0"
70937052
resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-3.0.0.tgz#73f97f753e7baffc0e2cc9d6e079079744ac82e9"
@@ -7225,16 +7184,6 @@ open@^9.1.0:
72257184
is-inside-container "^1.0.0"
72267185
is-wsl "^2.2.0"
72277186

7228-
openid-client@~5.4.2:
7229-
version "5.4.3"
7230-
resolved "https://registry.yarnpkg.com/openid-client/-/openid-client-5.4.3.tgz#c75d2f6d07a25d383a72c8ff34605a36b7e2cd73"
7231-
integrity sha512-sVQOvjsT/sbSfYsQI/9liWQGVZH/Pp3rrtlGEwgk/bbHfrUDZ24DN57lAagIwFtuEu+FM9Ev7r85s8S/yPjimQ==
7232-
dependencies:
7233-
jose "^4.14.4"
7234-
lru-cache "^6.0.0"
7235-
object-hash "^2.2.0"
7236-
oidc-token-hash "^5.0.3"
7237-
72387187
optionator@^0.9.3:
72397188
version "0.9.3"
72407189
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64"
@@ -7330,13 +7279,6 @@ parse-json@^5.2.0:
73307279
json-parse-even-better-errors "^2.3.0"
73317280
lines-and-columns "^1.1.6"
73327281

7333-
parse-link-header@^2.0.0:
7334-
version "2.0.0"
7335-
resolved "https://registry.yarnpkg.com/parse-link-header/-/parse-link-header-2.0.0.tgz#949353e284f8aa01f2ac857a98f692b57733f6b7"
7336-
integrity sha512-xjU87V0VyHZybn2RrCX5TIFGxTVZE6zqqZWMPlIKiSKuWh/X5WZdt+w1Ki1nXB+8L/KtL+nZ4iq+sfI6MrhhMw==
7337-
dependencies:
7338-
xtend "~4.0.1"
7339-
73407282
parse5-htmlparser2-tree-adapter@^7.0.0:
73417283
version "7.0.0"
73427284
resolved "https://registry.yarnpkg.com/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz#23c2cc233bcf09bb7beba8b8a69d46b08c62c2f1"
@@ -9151,11 +9093,6 @@ xmlchars@^2.2.0:
91519093
resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"
91529094
integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==
91539095

9154-
xtend@~4.0.1:
9155-
version "4.0.2"
9156-
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
9157-
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
9158-
91599096
y18n@^5.0.5:
91609097
version "5.0.8"
91619098
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"

0 commit comments

Comments
 (0)