Skip to content

Commit c454de3

Browse files
committed
[add] Model Relation constructing method
[optimize] use TS for ESLint configuration [optimize] update Upstream packages [fix] several detail bugs
1 parent 82be457 commit c454de3

File tree

12 files changed

+666
-685
lines changed

12 files changed

+666
-685
lines changed

.github/workflows/publish-type.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- uses: pnpm/action-setup@v4
1616
with:
17-
version: 9
17+
version: 10
1818
- uses: actions/setup-node@v4
1919
with:
2020
node-version: 22

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get update && \
55
apt-get install curl -y --no-install-recommends
66
ENV PNPM_HOME="/pnpm"
77
ENV PATH="$PNPM_HOME:$PATH"
8-
RUN npm i pnpm@^9 -g
8+
RUN npm i pnpm@latest -g
99
COPY . /app
1010
WORKDIR /app
1111

ReadMe.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,30 @@
2323

2424
1. [API entry & Health checking](source/controller/Base.ts)
2525
2. [User & Session](source/controller/User.ts)
26+
- Email OTP (One Time Password)
2627
3. [OAuth sign in](source/controller/OAuth.ts)
2728
- recommend to use with [Next SSR middleware][16]
28-
4. [Activity logging](source/controller/ActivityLog.ts)
29+
4. [WebAuthn sign in](source/controller/WebAuthn.ts)
30+
- recommend to use with [Passwordless ID][17]
31+
5. [Activity logging](source/controller/ActivityLog.ts)
32+
6. [File object storage](source/controller/File.ts)
2933

3034
## Best practice
3135

3236
1. Install GitHub apps in your organization or account:
3337

34-
1. [Probot settings][17]: set up Issue labels & Pull Request rules
35-
2. [PR badge][18]: set up Online [VS Code][19] editor entries in Pull Request description
38+
1. [Probot settings][18]: set up Issue labels & Pull Request rules
39+
2. [PR badge][19]: set up Online [VS Code][20] editor entries in Pull Request description
3640

37-
2. Click the **[<kbd>Use this template</kbd>][20] button** on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above
41+
2. Click the **[<kbd>Use this template</kbd>][21] button** on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above
3842

3943
3. Click the **[<kbd>Open in GitHub codespaces</kbd>][8] button** on the top of ReadMe file, then an **online VS Code development environment** will be started immediately
4044

41-
4. Recommend to add a [Notification step in GitHub actions][21] for your Team IM app
45+
4. Recommend to add a [Notification step in GitHub actions][22] for your Team IM app
4246

43-
5. Remind the PMs & users of your product to submit **Feature/Enhancement** requests or **Bug** reports with [Issue forms][22] instead of IM messages or Mobile Phone calls
47+
5. Remind the PMs & users of your product to submit **Feature/Enhancement** requests or **Bug** reports with [Issue forms][23] instead of IM messages or Mobile Phone calls
4448

45-
6. Collect all these issues into [Project kanbans][23], then create **Pull requests** & add `closes #issue_number` into its description for automation
49+
6. Collect all these issues into [Project kanbans][24], then create **Pull requests** & add `closes #issue_number` into its description for automation
4650

4751
## API Usage
4852

@@ -57,9 +61,9 @@
5761
| :------------------------: | :--------------------------: |
5862
| `APP_SECRET` | encrypt Password & Token |
5963
| `DATABASE_URL` | PostgreSQL connection string |
60-
| `SUPABASE_PROJECT_URL` | [Supabase][24] project URL |
64+
| `SUPABASE_PROJECT_URL` | [Supabase][25] project URL |
6165
| `SUPABASE_ANON_KEY` | Supabase anon key |
62-
| `AWS_S3_END_POINT` | [AWS S3][25] endpoint URL |
66+
| `AWS_S3_END_POINT` | [AWS S3][26] endpoint URL |
6367
| `AWS_S3_BUCKET` | AWS S3 bucket name |
6468
| `AWS_S3_ACCESS_KEY_ID` | AWS S3 access key id |
6569
| `AWS_S3_SECRET_ACCESS_KEY` | AWS S3 secret access key |
@@ -80,7 +84,7 @@ pnpm i
8084
pnpm dev
8185
```
8286

83-
or just press <kbd>F5</kbd> key in [VS Code][19].
87+
or just press <kbd>F5</kbd> key in [VS Code][20].
8488

8589
### Migration
8690

@@ -143,12 +147,13 @@ git push origin master --tags
143147
[14]: https://github.com/anttiviljami/openapi-backend
144148
[15]: https://jestjs.io/
145149
[16]: https://github.com/idea2app/Next-SSR-middleware
146-
[17]: https://github.com/apps/settings
147-
[18]: https://pullrequestbadge.com/
148-
[19]: https://code.visualstudio.com/
149-
[20]: https://github.com/new?template_name=REST-Node-ts&template_owner=idea2app
150-
[21]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
151-
[22]: https://github.com/idea2app/REST-Node-ts/issues/new/choose
152-
[23]: https://github.com/idea2app/REST-Node-ts/projects
153-
[24]: https://supabase.com/
154-
[25]: https://aws.amazon.com/s3/
150+
[17]: https://webauthn.passwordless.id/
151+
[18]: https://github.com/apps/settings
152+
[19]: https://pullrequestbadge.com/
153+
[20]: https://code.visualstudio.com/
154+
[21]: https://github.com/new?template_name=REST-Node-ts&template_owner=idea2app
155+
[22]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
156+
[23]: https://github.com/idea2app/REST-Node-ts/issues/new/choose
157+
[24]: https://github.com/idea2app/REST-Node-ts/projects
158+
[25]: https://supabase.com/
159+
[26]: https://aws.amazon.com/s3/

eslint.config.mjs renamed to eslint.config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
// @ts-check
21
import eslint from '@eslint/js';
3-
import { currentModulePath } from '@tech_query/node-toolkit';
42
import eslintConfigPrettier from 'eslint-config-prettier';
53
import simpleImportSortPlugin from 'eslint-plugin-simple-import-sort';
64
import globals from 'globals';
75
import tsEslint from 'typescript-eslint';
6+
import { fileURLToPath } from 'url';
87

9-
const tsconfigRootDir = currentModulePath();
8+
const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));
109

1110
export default tsEslint.config(
1211
// register all of the plugins up-front
@@ -17,7 +16,7 @@ export default tsEslint.config(
1716
}
1817
},
1918
// config with just ignores is the replacement for `.eslintignore`
20-
{ ignores: ['**/node_modules/**', '**/dist/**', 'type/**', '*.mjs'] },
19+
{ ignores: ['**/node_modules/**', '**/dist/**', 'type/**', '*.ts'] },
2120

2221
// extends ...
2322
eslint.configs.recommended,

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,66 @@
1818
"node": ">=22"
1919
},
2020
"dependencies": {
21-
"@aws-sdk/client-s3": "^3.779.0",
22-
"@aws-sdk/s3-request-presigner": "^3.779.0",
21+
"@aws-sdk/client-s3": "^3.797.0",
22+
"@aws-sdk/s3-request-presigner": "^3.797.0",
2323
"@koa/cors": "^5.0.0",
2424
"@koa/multer": "^3.1.0",
2525
"@koa/router": "^13.1.0",
2626
"@passwordless-id/webauthn": "^2.3.0",
27-
"@smithy/smithy-client": "^4.1.6",
27+
"@smithy/smithy-client": "^4.2.0",
2828
"@supabase/auth-js": "^2.69.1",
2929
"@supabase/supabase-js": "^2.49.4",
3030
"class-transformer": "^0.5.1",
3131
"class-validator": "^0.14.1",
3232
"cross-env": "^7.0.3",
33-
"dotenv": "^16.4.7",
33+
"dotenv": "^16.5.0",
3434
"jsonwebtoken": "^9.0.2",
35-
"koa": "^2.16.0",
35+
"koa": "^2.16.1",
3636
"koa-bodyparser": "^4.4.1",
3737
"koa-jwt": "^4.0.4",
3838
"koa-logger": "^3.2.1",
39-
"koa-mount": "^4.0.0",
39+
"koa-mount": "^4.2.0",
4040
"koa2-swagger-ui": "^5.11.0",
4141
"koagger": "^0.4.0",
42-
"marked": "^15.0.7",
42+
"marked": "^15.0.11",
4343
"mobx-github": "^0.3.5",
4444
"mobx-restful": "^2.1.0",
45-
"pg": "^8.14.1",
46-
"pg-connection-string": "^2.7.0",
45+
"pg": "^8.15.6",
46+
"pg-connection-string": "^2.8.5",
4747
"reflect-metadata": "^0.2.2",
4848
"routing-controllers": "^0.11.2",
4949
"routing-controllers-openapi": "^5.0.0",
5050
"tslib": "^2.8.1",
5151
"typeorm": "npm:@helveg/typeorm@^0.3.21",
52-
"undici": "^7.7.0",
52+
"undici": "^7.8.0",
5353
"web-utility": "^4.4.3"
5454
},
5555
"devDependencies": {
56-
"@eslint/js": "^9.23.0",
57-
"@octokit/openapi-types": "^24.2.0",
58-
"@tech_query/node-toolkit": "^2.0.0-alpha.0",
56+
"@eslint/js": "^9.25.1",
57+
"@octokit/openapi-types": "^25.0.0",
5958
"@types/eslint-config-prettier": "^6.11.3",
6059
"@types/jest": "^29.5.14",
6160
"@types/jsonwebtoken": "^9.0.9",
6261
"@types/koa": "^2.15.0",
6362
"@types/koa-logger": "^3.1.5",
64-
"@types/node": "^22.13.17",
65-
"eslint": "^9.23.0",
66-
"eslint-config-prettier": "^10.1.1",
63+
"@types/node": "^22.15.2",
64+
"eslint": "^9.25.1",
65+
"eslint-config-prettier": "^10.1.2",
6766
"eslint-plugin-simple-import-sort": "^12.1.1",
6867
"globals": "^16.0.0",
6968
"husky": "^9.1.7",
7069
"jest": "^29.7.0",
70+
"jiti": "^2.4.2",
7171
"koajax": "^3.1.2",
72-
"lint-staged": "^15.5.0",
72+
"lint-staged": "^15.5.1",
7373
"prettier": "^3.5.3",
7474
"sqlite3": "^5.1.7",
7575
"start-server-and-test": "^2.0.11",
76-
"swagger-typescript-api": "^13.0.28",
77-
"ts-jest": "^29.3.1",
76+
"swagger-typescript-api": "^13.1.1",
77+
"ts-jest": "^29.3.2",
7878
"ts-node": "^10.9.2",
79-
"typescript": "~5.8.2",
80-
"typescript-eslint": "^8.29.0"
79+
"typescript": "~5.8.3",
80+
"typescript-eslint": "^8.31.0"
8181
},
8282
"resolutions": {
8383
"reflect-metadata": "$reflect-metadata"

0 commit comments

Comments
 (0)