@nestbridge/unplugin 2.0.3 → 2.1.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/README.md +12 -3
- package/build/nestbridge.unplugin.d.ts +27 -0
- package/build/nestbridge.unplugin.js +1505 -0
- package/build/nestbridge.unplugin.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,13 +68,22 @@ tests) that need the resolved shape ahead of time.
|
|
|
68
68
|
through [`@nestbridge/core`](../core)'s static analysis, and writes the
|
|
69
69
|
generated `.d.ts` declarations to `outputDir` so TypeScript sees a
|
|
70
70
|
client-facing shape instead of the real file.
|
|
71
|
-
2. It
|
|
71
|
+
2. It also discovers a single bootstrap file (`main.ts`) under `root` and
|
|
72
|
+
runs it through `@nestbridge/core`'s `detectResponseWrapper` and
|
|
73
|
+
`detectErrorResponseShape`. A registered global response interceptor is
|
|
74
|
+
reflected directly in the generated controller declarations; a
|
|
75
|
+
registered `@Catch` exception filter is written to a fixed
|
|
76
|
+
`nestbridge-error-body.d.ts` file in `outputDir`. Neither writes anything
|
|
77
|
+
when nothing is registered — see the [repository
|
|
78
|
+
README](../../README.md) for what's recognized.
|
|
79
|
+
3. It intercepts the bundler's resolution of that same import (`resolveId`/
|
|
72
80
|
`transform`) and serves generated code that calls
|
|
73
81
|
[`@nestbridge/runtime`](../runtime) instead of the real controller or
|
|
74
82
|
resolver — the real source, its NestJS decorators, and its dependencies
|
|
75
83
|
never enter the bundle.
|
|
76
|
-
|
|
77
|
-
file and rewrites its declaration and generated module
|
|
84
|
+
4. On watched file changes (`watchChange`), it re-analyzes only the affected
|
|
85
|
+
file and rewrites its declaration and generated module; a change to the
|
|
86
|
+
bootstrap file itself re-runs the interceptor/filter detection too.
|
|
78
87
|
|
|
79
88
|
Diagnostics from `@nestbridge/core` (an unsupported decorator, a
|
|
80
89
|
non-literal route path, etc.) are thrown during a one-shot build and logged
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UnpluginInstance } from "unplugin";
|
|
2
|
+
//#region src/options/nestbridge-options.d.ts
|
|
3
|
+
interface NestBridgeOptions {
|
|
4
|
+
controllers: string | string[];
|
|
5
|
+
resolvers?: string | string[];
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
debug?: boolean;
|
|
8
|
+
outputDir?: string;
|
|
9
|
+
root?: string;
|
|
10
|
+
}
|
|
11
|
+
interface ResolvedNestBridgeOptions {
|
|
12
|
+
controllers: string[];
|
|
13
|
+
resolvers: string[];
|
|
14
|
+
baseURL: string | undefined;
|
|
15
|
+
debug: boolean;
|
|
16
|
+
outputDir: string;
|
|
17
|
+
root: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/plugin/nestbridge-unplugin-factory.d.ts
|
|
21
|
+
export declare const nestBridgeUnplugin: UnpluginInstance<NestBridgeOptions, false>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/version.d.ts
|
|
24
|
+
export declare const VERSION: string;
|
|
25
|
+
//#endregion
|
|
26
|
+
export type { NestBridgeOptions, ResolvedNestBridgeOptions };
|
|
27
|
+
//# sourceMappingURL=nestbridge.unplugin.d.ts.map
|