@nathapp/nestjs-app 3.2.2 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +43 -0
- package/CLAUDE.md +18 -0
- package/GEMINI.md +41 -0
- package/codex.md +41 -0
- package/package.json +8 -6
package/AGENTS.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Agent Instructions
|
|
2
|
+
|
|
3
|
+
This file is auto-generated from `.nax/context.md`.
|
|
4
|
+
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
+
|
|
6
|
+
These instructions apply to all AI coding agents in this project.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Project Metadata
|
|
11
|
+
|
|
12
|
+
> Auto-injected by `nax generate`
|
|
13
|
+
|
|
14
|
+
**Project:** `@nathapp/nestjs-app`
|
|
15
|
+
|
|
16
|
+
**Language:** TypeScript
|
|
17
|
+
|
|
18
|
+
**Key dependencies:** typescript
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
# @nathapp/nestjs-app
|
|
22
|
+
|
|
23
|
+
Bootstrap orchestrator — `NathApplication` + `AppFactory` wire all other packages together.
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
- Test: `npx jest --config test/jest-test.json --no-coverage`
|
|
27
|
+
- Build: `npx tsc`
|
|
28
|
+
|
|
29
|
+
## Architecture
|
|
30
|
+
- `AppFactory.useApp(app, options)` creates `NathApplication` wrapper around `INestApplication`.
|
|
31
|
+
- `NathApplication` chains: `.useAppGlobalPipes()`, `.useAppGlobalFilters()`, `.useAppGlobalGuards()`, `.useSwaggerUI()`.
|
|
32
|
+
- DI-aware resolution: `tryGetFromDI()` resolves guards/filters from DI first, falls back to manual creation.
|
|
33
|
+
- Supports both Express and Fastify adapters.
|
|
34
|
+
|
|
35
|
+
## Guard/Filter Wiring
|
|
36
|
+
- `getJwtGuard()`: tries DI → `JwtMsAuthGuard` (if microservices) → `JwtAuthGuard` (manual).
|
|
37
|
+
- `createPermissionGuard()`: tries `PERMISSION_PROVIDER` from DI → manual `DefaultPermissionProvider`.
|
|
38
|
+
- `useAppGlobalFilters()`: tries `GlobalExceptionsFilter` from DI → manual creation.
|
|
39
|
+
|
|
40
|
+
## Gotchas
|
|
41
|
+
- Tests import from `@nathapp/nestjs-auth` dist — rebuild nestjs-auth before running tests.
|
|
42
|
+
- Uses `AuthenticationModule` (AuthN only) in tests, NOT `AuthModule` (combined).
|
|
43
|
+
- `@nathapp/nestjs-microservices` is dynamically loaded via `require()` — optional dependency.
|
package/CLAUDE.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# Project Context
|
|
2
|
+
|
|
3
|
+
This file is auto-generated from `.nax/context.md`.
|
|
4
|
+
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Metadata
|
|
9
|
+
|
|
10
|
+
> Auto-injected by `nax generate`
|
|
11
|
+
|
|
12
|
+
**Project:** `@nathapp/nestjs-app`
|
|
13
|
+
|
|
14
|
+
**Language:** TypeScript
|
|
15
|
+
|
|
16
|
+
**Key dependencies:** typescript
|
|
17
|
+
|
|
18
|
+
---
|
|
1
19
|
# @nathapp/nestjs-app
|
|
2
20
|
|
|
3
21
|
Bootstrap orchestrator — `NathApplication` + `AppFactory` wire all other packages together.
|
package/GEMINI.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Gemini CLI Context
|
|
2
|
+
|
|
3
|
+
This file is auto-generated from `.nax/context.md`.
|
|
4
|
+
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Metadata
|
|
9
|
+
|
|
10
|
+
> Auto-injected by `nax generate`
|
|
11
|
+
|
|
12
|
+
**Project:** `@nathapp/nestjs-app`
|
|
13
|
+
|
|
14
|
+
**Language:** TypeScript
|
|
15
|
+
|
|
16
|
+
**Key dependencies:** typescript
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
# @nathapp/nestjs-app
|
|
20
|
+
|
|
21
|
+
Bootstrap orchestrator — `NathApplication` + `AppFactory` wire all other packages together.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
- Test: `npx jest --config test/jest-test.json --no-coverage`
|
|
25
|
+
- Build: `npx tsc`
|
|
26
|
+
|
|
27
|
+
## Architecture
|
|
28
|
+
- `AppFactory.useApp(app, options)` creates `NathApplication` wrapper around `INestApplication`.
|
|
29
|
+
- `NathApplication` chains: `.useAppGlobalPipes()`, `.useAppGlobalFilters()`, `.useAppGlobalGuards()`, `.useSwaggerUI()`.
|
|
30
|
+
- DI-aware resolution: `tryGetFromDI()` resolves guards/filters from DI first, falls back to manual creation.
|
|
31
|
+
- Supports both Express and Fastify adapters.
|
|
32
|
+
|
|
33
|
+
## Guard/Filter Wiring
|
|
34
|
+
- `getJwtGuard()`: tries DI → `JwtMsAuthGuard` (if microservices) → `JwtAuthGuard` (manual).
|
|
35
|
+
- `createPermissionGuard()`: tries `PERMISSION_PROVIDER` from DI → manual `DefaultPermissionProvider`.
|
|
36
|
+
- `useAppGlobalFilters()`: tries `GlobalExceptionsFilter` from DI → manual creation.
|
|
37
|
+
|
|
38
|
+
## Gotchas
|
|
39
|
+
- Tests import from `@nathapp/nestjs-auth` dist — rebuild nestjs-auth before running tests.
|
|
40
|
+
- Uses `AuthenticationModule` (AuthN only) in tests, NOT `AuthModule` (combined).
|
|
41
|
+
- `@nathapp/nestjs-microservices` is dynamically loaded via `require()` — optional dependency.
|
package/codex.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Codex Instructions
|
|
2
|
+
|
|
3
|
+
This file is auto-generated from `.nax/context.md`.
|
|
4
|
+
DO NOT EDIT MANUALLY — run `nax generate` to regenerate.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Project Metadata
|
|
9
|
+
|
|
10
|
+
> Auto-injected by `nax generate`
|
|
11
|
+
|
|
12
|
+
**Project:** `@nathapp/nestjs-app`
|
|
13
|
+
|
|
14
|
+
**Language:** TypeScript
|
|
15
|
+
|
|
16
|
+
**Key dependencies:** typescript
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
# @nathapp/nestjs-app
|
|
20
|
+
|
|
21
|
+
Bootstrap orchestrator — `NathApplication` + `AppFactory` wire all other packages together.
|
|
22
|
+
|
|
23
|
+
## Commands
|
|
24
|
+
- Test: `npx jest --config test/jest-test.json --no-coverage`
|
|
25
|
+
- Build: `npx tsc`
|
|
26
|
+
|
|
27
|
+
## Architecture
|
|
28
|
+
- `AppFactory.useApp(app, options)` creates `NathApplication` wrapper around `INestApplication`.
|
|
29
|
+
- `NathApplication` chains: `.useAppGlobalPipes()`, `.useAppGlobalFilters()`, `.useAppGlobalGuards()`, `.useSwaggerUI()`.
|
|
30
|
+
- DI-aware resolution: `tryGetFromDI()` resolves guards/filters from DI first, falls back to manual creation.
|
|
31
|
+
- Supports both Express and Fastify adapters.
|
|
32
|
+
|
|
33
|
+
## Guard/Filter Wiring
|
|
34
|
+
- `getJwtGuard()`: tries DI → `JwtMsAuthGuard` (if microservices) → `JwtAuthGuard` (manual).
|
|
35
|
+
- `createPermissionGuard()`: tries `PERMISSION_PROVIDER` from DI → manual `DefaultPermissionProvider`.
|
|
36
|
+
- `useAppGlobalFilters()`: tries `GlobalExceptionsFilter` from DI → manual creation.
|
|
37
|
+
|
|
38
|
+
## Gotchas
|
|
39
|
+
- Tests import from `@nathapp/nestjs-auth` dist — rebuild nestjs-auth before running tests.
|
|
40
|
+
- Uses `AuthenticationModule` (AuthN only) in tests, NOT `AuthModule` (combined).
|
|
41
|
+
- `@nathapp/nestjs-microservices` is dynamically loaded via `require()` — optional dependency.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nathapp/nestjs-app",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "this package is to shorten up nestjs app instantiate",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist/ .turbo/",
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
"test": "jest --config ./test/jest-test.json",
|
|
10
10
|
"test:cov": "jest --config ./test/jest-test.json --coverage",
|
|
11
11
|
"test:watch": "jest --config ./test/jest-test.json --watch",
|
|
12
|
-
"lint": "eslint -c .eslintrc.js"
|
|
12
|
+
"lint": "eslint -c .eslintrc.js",
|
|
13
|
+
"type-check": "tsc --noEmit -p tsconfig.json",
|
|
14
|
+
"lint:fix": "eslint -c .eslintrc.js --fix"
|
|
13
15
|
},
|
|
14
16
|
"author": "William Khoo",
|
|
15
17
|
"license": "ISC",
|
|
@@ -17,8 +19,8 @@
|
|
|
17
19
|
"node": ">=16"
|
|
18
20
|
},
|
|
19
21
|
"devDependencies": {
|
|
20
|
-
"@nathapp/nestjs-cache": "^3.
|
|
21
|
-
"@nathapp/nestjs-microservices": "^3.
|
|
22
|
+
"@nathapp/nestjs-cache": "^3.3.0",
|
|
23
|
+
"@nathapp/nestjs-microservices": "^3.3.0",
|
|
22
24
|
"eslint": "^8.57.0",
|
|
23
25
|
"typescript": "^5"
|
|
24
26
|
},
|
|
@@ -28,8 +30,8 @@
|
|
|
28
30
|
"lib": "lib"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@nathapp/nestjs-auth": "^3.
|
|
32
|
-
"@nathapp/nestjs-common": "^3.
|
|
33
|
+
"@nathapp/nestjs-auth": "^3.3.0",
|
|
34
|
+
"@nathapp/nestjs-common": "^3.3.0"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
37
|
"@nathapp/auth": "^1.0.2",
|