@nestbridge/unplugin 2.6.0 → 3.0.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/CHANGELOG.md +46 -1
- package/README.md +23 -11
- package/build/nestbridge.unplugin.d.ts +10 -4
- package/build/nestbridge.unplugin.js +77 -133
- package/build/nestbridge.unplugin.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @nestbridge/unplugin
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- b5009b4: Every server now has one declaration folder, named after the package at its `root`, with the same layout everywhere. Declarations are written to `<outputDir>/<package name>/`, where `outputDir` is the explicit option, the workspace-root `.nestbridge`, or the project-root `.nestbridge` when there is no workspace. Paths inside the folder mirror the files relative to `root`, so `src/items/items.controller.ts` of a package named `http-server` becomes `.nestbridge/http-server/src/items/items.controller.d.ts`. A scoped name nests (`.nestbridge/@acme/api/`). The error body declaration is `error-body.d.ts` in the same folder (it was `nestbridge-error-body.d.ts` next to the client). The `name` option no longer affects any path: it only names the runtime service.
|
|
8
|
+
|
|
9
|
+
`root` must point at the server package, and its `package.json` must have a non-empty `name`; otherwise the build fails with an error that says so.
|
|
10
|
+
|
|
11
|
+
Declarations depend only on the server, so any number of clients of a server write the same files and share one folder. Message methods (`@EventPattern` / `@MessagePattern`) are always written to the declarations; `messagePatterns` now only decides whether the generated client module has the message methods, and whether `unsupported-message-pattern` diagnostics are reported. Every client of a server should state the same `bootstrap` option; when they disagree, the last build wins.
|
|
12
|
+
|
|
13
|
+
Upgrading:
|
|
14
|
+
|
|
15
|
+
1. Set `root` to the server package (for example `root: '../server'`) and make the globs relative to it (`controllers: 'src/**/*.controller.ts'`). Give the server's `package.json` a `name`.
|
|
16
|
+
2. Change tsconfig `paths` to `.nestbridge/<server package name>/src/*`, for example `"@server/*": ["../../../.nestbridge/http-server/src/*"]`.
|
|
17
|
+
3. Change error body imports to `.nestbridge/<server package name>/error-body`.
|
|
18
|
+
4. Delete the old `.nestbridge/` output.
|
|
19
|
+
|
|
20
|
+
See `MIGRATION.md`.
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- b5009b4: Response-shaping interceptors are now detected per route instead of as one app-wide wrapper, and anything that cannot be read is reported instead of silently ignored.
|
|
25
|
+
|
|
26
|
+
Each JSON route gets its own interceptor chain, outermost first: `APP_INTERCEPTOR` providers (`useClass` only, read from the root module and the modules it imports), then `app.useGlobalInterceptors(new X())`, then the controller's `@UseInterceptors`, then the method's `@UseInterceptors`. `intercept()` may hold any statements before its final `return`; the returned `next.handle()` may be piped through any number of operators. `map` operators compose in order, `tap`, `timeout` and `finalize` are shape-neutral, and a bare `return next.handle()` changes nothing. Shorthand properties (`{ data }`) and `-`, `*`, `/`, `%` arithmetic (typed `number`) are understood in `map` bodies. Message handlers and GraphQL resolvers are not wrapped yet.
|
|
27
|
+
|
|
28
|
+
An interceptor that cannot be analyzed (another operator, a `useFactory` / `useValue` / `useExisting` / spread provider, a class from a package, an unreadable `map` body, a `@UseInterceptors` argument that is not a class or `new X()`) is a new `unsupported-interceptor` diagnostic, reported once per interceptor at its source location. The JSON routes under it are declared as `AbortablePromise<unknown>`. A one-shot build fails on the diagnostic; watch mode warns.
|
|
29
|
+
|
|
30
|
+
Breaking changes to `@nestbridge/core`:
|
|
31
|
+
|
|
32
|
+
- `detectResponseWrapper` is removed. `analyzeControllers(files, { bootstrapFilePath })` now attaches an optional `responseWrapper` to each JSON method of the result and returns `interceptorFiles`, the files that took part in the detection.
|
|
33
|
+
- `generateControllerDeclaration(definition, outputFilePath)` no longer takes a response wrapper argument; it reads each method's own `responseWrapper`. A declaration can now hold several `__NestBridgeWrapped` helper aliases (`__NestBridgeWrapped`, `__NestBridgeWrapped2`, ...), one per distinct shape. Controllers without a response-shaping interceptor produce the same output as before.
|
|
34
|
+
|
|
35
|
+
`@nestbridge/unplugin` passes the bootstrap file to the controller analysis, re-analyzes when a file that contributed to interceptor detection changes, and registers those files and the bootstrap file with the bundler's watcher.
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- Updated dependencies [b5009b4]
|
|
40
|
+
- @nestbridge/core@3.0.0
|
|
41
|
+
|
|
42
|
+
## 2.6.1
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- @nestbridge/core@2.6.1
|
|
47
|
+
|
|
3
48
|
## 2.6.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
|
@@ -8,7 +53,7 @@
|
|
|
8
53
|
|
|
9
54
|
Patterns must be statically known: a string or number literal, an object literal of those, or a constant whose type is a literal or an `as const` object. Anything else gives an `unsupported-message-pattern` diagnostic and drops the method. `analyzeControllers()` takes a `{ messagePatterns }` option, and `ControllerDefinition` gains `messageHandlers`.
|
|
10
55
|
|
|
11
|
-
The runtime adds a `@nestbridge/runtime/microservices` subpath, re-exported as `nestbridge/microservices`, with `configureNestBridgeMicroservices({ clients, defaultClient })`, `closeNestBridgeMicroservices()`, `emitMessage()`, `sendMessage()`, `NestBridgeMicroserviceError` and the `NestBridgeMessageResult` type. `@nestjs/microservices` is an optional peer dependency, and the main entry does not import it. This replaces
|
|
56
|
+
The runtime adds a `@nestbridge/runtime/microservices` subpath, re-exported as `nestbridge/microservices`, with `configureNestBridgeMicroservices({ clients, defaultClient })`, `closeNestBridgeMicroservices()`, `emitMessage()`, `sendMessage()`, `NestBridgeMicroserviceError` and the `NestBridgeMessageResult` type. `@nestjs/microservices` is an optional peer dependency, and the main entry does not import it. This replaces nestrelay; see MIGRATION.md.
|
|
12
57
|
|
|
13
58
|
Builds that use the same app name for the same server now record which build generated its shared declarations in `.nestbridge/<name>/…/nestbridge-app.json`. A build that configures that app differently (`messagePatterns` or the bootstrap file) reports an error naming the other build and does not overwrite its declarations.
|
|
14
59
|
|
package/README.md
CHANGED
|
@@ -50,17 +50,18 @@ nestBridgeUnplugin.farm(options); // Farm JsPlugin
|
|
|
50
50
|
|
|
51
51
|
```ts
|
|
52
52
|
interface NestBridgeOptions {
|
|
53
|
-
name?: string; // names the server app; required, and unique, when you pass several apps
|
|
53
|
+
name?: string; // names the server app's runtime service; required, and unique, when you pass several apps; does not affect declaration paths
|
|
54
54
|
controllers: string | string[]; // glob(s), resolved relative to `root`
|
|
55
55
|
resolvers?: string | string[]; // glob(s) for GraphQL resolvers; defaults to none
|
|
56
|
+
messagePatterns?: boolean; // generates client methods for the @EventPattern/@MessagePattern handlers of `controllers`; needs `name`; defaults to false; declarations always include them
|
|
56
57
|
baseURL?: string; // origin (or mount path) for this app's REST requests and its default GraphQL endpoint; applied to the runtime automatically
|
|
57
58
|
bootstrap?: string; // the app's bootstrap file, relative to `root`; skips the `main.ts` search
|
|
58
59
|
globalPrefix?: string | GlobalPrefixOption | false; // replaces the prefix read from `setGlobalPrefix()`; `false` ignores it
|
|
59
60
|
versioning?: VersioningOption | false; // replaces the versioning read from `enableVersioning()`; `false` ignores it
|
|
60
61
|
debug?: boolean; // logs discovery/analysis/watch activity
|
|
61
62
|
logLevel?: 'info' | 'warn' | 'error' | 'silent'; // how much the plugin logs; defaults to the bundler's own level (Vite's logLevel, webpack's infrastructureLogging.level)
|
|
62
|
-
outputDir?: string; // defaults to ".nestbridge" at the workspace root (nearest nx.json / pnpm-workspace.yaml / turbo.json / lerna.json / package.json with "workspaces"), or at the project root when there is no workspace; an explicit value is resolved from the bundler's own root
|
|
63
|
-
root?: string; // base for
|
|
63
|
+
outputDir?: string; // defaults to ".nestbridge" at the workspace root (nearest nx.json / pnpm-workspace.yaml / turbo.json / lerna.json / package.json with "workspaces"), or at the project root when there is no workspace; an explicit value is resolved from the bundler's own root; either way a server's declarations go into <outputDir>/<its package name>/
|
|
64
|
+
root?: string; // the server package; its package.json needs a "name", which names the declarations folder; base directory for its controllers, resolvers and bootstrap file; relative paths resolve against the bundler's root (process.cwd() under webpack), which is also the default
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
interface GlobalPrefixOption {
|
|
@@ -94,17 +95,26 @@ apps behaves like several single-app builds sharing one plugin.
|
|
|
94
95
|
|
|
95
96
|
1. On `buildStart`, it globs `controllers`/`resolvers`, runs each file
|
|
96
97
|
through [`@nestbridge/core`](../core)'s static analysis, and writes the
|
|
97
|
-
generated `.d.ts` declarations to
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
generated `.d.ts` declarations to `<outputDir>/<package name>/` — one folder
|
|
99
|
+
per server, named after the package at `root`, with each file's path
|
|
100
|
+
mirrored relative to `root` — so TypeScript sees a client-facing shape
|
|
101
|
+
instead of the real file. Message handlers (`@EventPattern` /
|
|
102
|
+
`@MessagePattern`) are always declared; `messagePatterns` only decides
|
|
103
|
+
whether the generated client code has them. The declarations depend only on the server, so every client of it
|
|
104
|
+
writes the same files (when clients disagree on the bootstrap file, the
|
|
105
|
+
last build wins). A `root` without a named `package.json` fails the build. A file matched by the globs of two apps is an error (a warning
|
|
100
106
|
in watch mode) that names both.
|
|
101
107
|
2. It also locates the app's bootstrap file — the `bootstrap` option, which
|
|
102
108
|
must exist, or else the single `main.ts` under `root` — and runs it through
|
|
103
|
-
`@nestbridge/core`'s `
|
|
104
|
-
`
|
|
105
|
-
|
|
109
|
+
`@nestbridge/core`'s `detectErrorResponseShape`, `detectGlobalPrefix` and
|
|
110
|
+
`detectVersioning`; the same bootstrap file also feeds the controller
|
|
111
|
+
analysis, which reads the interceptors that apply to each JSON route
|
|
112
|
+
(`APP_INTERCEPTOR` providers, `useGlobalInterceptors` and `@UseInterceptors`).
|
|
113
|
+
Their response shape is reflected directly in the generated controller
|
|
114
|
+
declarations, and an interceptor it cannot read is an
|
|
115
|
+
`unsupported-interceptor` diagnostic;
|
|
106
116
|
a registered `@Catch` exception filter is written to a fixed
|
|
107
|
-
`
|
|
117
|
+
`error-body.d.ts` file next to them. The prefix and versioning
|
|
108
118
|
are composed into each route's path with `applyApplicationRouting`, unless
|
|
109
119
|
`globalPrefix`/`versioning` state them explicitly (or `false` ignores them),
|
|
110
120
|
which replaces the detection and its diagnostics. Nothing is written when
|
|
@@ -125,7 +135,9 @@ apps behaves like several single-app builds sharing one plugin.
|
|
|
125
135
|
5. When a tracked controller, resolver, or bootstrap file changes
|
|
126
136
|
(`watchChange`), it re-analyzes only the app that owns the file and rewrites
|
|
127
137
|
its declarations, including the interceptor, filter, prefix and versioning
|
|
128
|
-
detection.
|
|
138
|
+
detection. The bootstrap file and the interceptor files that took part in the
|
|
139
|
+
detection are registered with the bundler's watcher (`addWatchFile`), so
|
|
140
|
+
editing them re-analyzes the app.
|
|
129
141
|
|
|
130
142
|
Diagnostics from `@nestbridge/core` (an unsupported decorator, a
|
|
131
143
|
non-literal route path, a global prefix or versioning setup that cannot be
|
|
@@ -19,7 +19,7 @@ interface VersioningOption {
|
|
|
19
19
|
interface NestBridgeOptions {
|
|
20
20
|
/**
|
|
21
21
|
* Identifies the server app. Required, and unique, when several apps are
|
|
22
|
-
* configured. It
|
|
22
|
+
* configured. It names the runtime service and does not affect where declarations go.
|
|
23
23
|
*/
|
|
24
24
|
name?: string;
|
|
25
25
|
controllers: string | string[];
|
|
@@ -28,7 +28,8 @@ interface NestBridgeOptions {
|
|
|
28
28
|
* Also turns the controllers' `@EventPattern()` / `@MessagePattern()` handlers into client
|
|
29
29
|
* methods that publish through `nestbridge/microservices`. Requires `name`, which is the service
|
|
30
30
|
* the message client is looked up by. Off by default, so browser clients never receive
|
|
31
|
-
* microservice code.
|
|
31
|
+
* microservice code. The generated declarations always describe the message handlers, whatever
|
|
32
|
+
* this is set to.
|
|
32
33
|
*/
|
|
33
34
|
messagePatterns?: boolean;
|
|
34
35
|
baseURL?: string;
|
|
@@ -58,10 +59,15 @@ interface NestBridgeOptions {
|
|
|
58
59
|
/**
|
|
59
60
|
* Where the generated declarations go. By default `.nestbridge` at the workspace root (the nearest
|
|
60
61
|
* ancestor with `nx.json`, `pnpm-workspace.yaml`, `turbo.json`, `lerna.json` or a `package.json`
|
|
61
|
-
* with `workspaces`),
|
|
62
|
-
*
|
|
62
|
+
* with `workspaces`), or in the project root when there is no workspace. An explicit value is
|
|
63
|
+
* resolved from the bundler's own root. Either way the declarations of a server go into a folder
|
|
64
|
+
* named after its package.
|
|
63
65
|
*/
|
|
64
66
|
outputDir?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The server package, resolved from the bundler's root. Its `package.json` must have a `name`,
|
|
69
|
+
* which names the server's declaration folder. Declaration paths mirror this directory.
|
|
70
|
+
*/
|
|
65
71
|
root?: string;
|
|
66
72
|
}
|
|
67
73
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createUnplugin } from "unplugin";
|
|
2
2
|
import { closeSync, existsSync, globSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join, posix, relative, resolve, sep } from "node:path";
|
|
4
|
-
import { analyzeControllers, analyzeResolvers, applyApplicationRouting, detectErrorResponseShape, detectGlobalPrefix,
|
|
4
|
+
import { analyzeControllers, analyzeResolvers, applyApplicationRouting, detectErrorResponseShape, detectGlobalPrefix, detectVersioning, formatDiagnostic, generateControllerDeclaration, generateErrorBodyDeclaration } from "@nestbridge/core";
|
|
5
5
|
//#region src/codegen/generate-config-module.ts
|
|
6
6
|
var generateBaseURLStatement = (entry) => {
|
|
7
7
|
if (entry.baseURL === void 0) return;
|
|
@@ -302,6 +302,17 @@ var mostVerboseLogLevel = (levels) => levels.reduce((mostVerbose, level) => {
|
|
|
302
302
|
return LOG_LEVEL_RANKS[level] > LOG_LEVEL_RANKS[mostVerbose] ? level : mostVerbose;
|
|
303
303
|
}, "silent");
|
|
304
304
|
//#endregion
|
|
305
|
+
//#region src/declarations/mirrored-path.ts
|
|
306
|
+
var stripLeadingParentSegments = (relativePath) => {
|
|
307
|
+
const segments = relativePath.split(/[\\/]/);
|
|
308
|
+
const firstOwnedIndex = segments.findIndex((segment) => segment !== "..");
|
|
309
|
+
return segments.slice(firstOwnedIndex === -1 ? segments.length : firstOwnedIndex).join("/");
|
|
310
|
+
};
|
|
311
|
+
var mirroredPath = (sourceRoot, resolvedOutputDir, sourcePath) => join(resolvedOutputDir, stripLeadingParentSegments(relative(sourceRoot, sourcePath)));
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region src/declarations/mirror-declaration-path.ts
|
|
314
|
+
var mirroredDeclarationPath = (sourceRoot, resolvedOutputDir, controllerFilePath) => mirroredPath(sourceRoot, resolvedOutputDir, controllerFilePath).replace(/\.ts$/, ".d.ts");
|
|
315
|
+
//#endregion
|
|
305
316
|
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/usingCtx.js
|
|
306
317
|
function _usingCtx() {
|
|
307
318
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
|
@@ -396,61 +407,23 @@ var acquireLock = (lockPath, options) => {
|
|
|
396
407
|
}
|
|
397
408
|
};
|
|
398
409
|
var hasContent = (filePath, content) => existsSync(filePath) && readFileSync(filePath, "utf-8") === content;
|
|
399
|
-
var lockFile = (filePath, options = {}) => acquireLock(`${filePath}${LOCK_FILE_SUFFIX}`, {
|
|
400
|
-
timeoutMs: options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS,
|
|
401
|
-
staleAfterMs: options.staleAfterMs ?? DEFAULT_STALE_LOCK_MS
|
|
402
|
-
});
|
|
403
|
-
/**
|
|
404
|
-
* Swaps the content in through a rename. Callers must hold the file's lock.
|
|
405
|
-
*/
|
|
406
|
-
var writeFileAtomically = (filePath, content) => {
|
|
407
|
-
const temporaryPath = `${filePath}.${process.pid}.tmp`;
|
|
408
|
-
try {
|
|
409
|
-
writeFileSync(temporaryPath, content, "utf-8");
|
|
410
|
-
renameSync(temporaryPath, filePath);
|
|
411
|
-
} finally {
|
|
412
|
-
rmSync(temporaryPath, { force: true });
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
410
|
var writeFileLocked = (filePath, content, options = {}) => {
|
|
416
411
|
try {
|
|
417
|
-
var _usingCtx$
|
|
412
|
+
var _usingCtx$1 = _usingCtx();
|
|
418
413
|
if (hasContent(filePath, content)) return;
|
|
419
|
-
|
|
414
|
+
const lockPath = `${filePath}${LOCK_FILE_SUFFIX}`;
|
|
415
|
+
_usingCtx$1.u(acquireLock(lockPath, {
|
|
416
|
+
timeoutMs: options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS,
|
|
417
|
+
staleAfterMs: options.staleAfterMs ?? DEFAULT_STALE_LOCK_MS
|
|
418
|
+
}));
|
|
420
419
|
if (hasContent(filePath, content)) return;
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
//#endregion
|
|
429
|
-
//#region src/declarations/claim-declarations.ts
|
|
430
|
-
var DECLARATION_CLAIM_FILE_NAME = "nestbridge-app.json";
|
|
431
|
-
var isDeclarationClaim = (value) => typeof value === "object" && value !== null && "caller" in value && typeof value.caller === "string" && "messagePatterns" in value && typeof value.messagePatterns === "boolean" && "bootstrap" in value && (typeof value.bootstrap === "string" || value.bootstrap === null);
|
|
432
|
-
var readClaim = (claimPath) => {
|
|
433
|
-
if (!existsSync(claimPath)) return;
|
|
434
|
-
const claim = JSON.parse(readFileSync(claimPath, "utf-8"));
|
|
435
|
-
if (!isDeclarationClaim(claim)) throw new Error(`[NestBridge] ${claimPath} is not a NestBridge declaration claim. Delete it so the next build recreates it.`);
|
|
436
|
-
return claim;
|
|
437
|
-
};
|
|
438
|
-
var hasSameOptions = (left, right) => left.messagePatterns === right.messagePatterns && left.bootstrap === right.bootstrap;
|
|
439
|
-
var serializeClaim = (claim) => `${JSON.stringify(claim, null, 2)}\n`;
|
|
440
|
-
/**
|
|
441
|
-
* Records `claim` as the owner of an app's declarations, unless another caller that still exists
|
|
442
|
-
* owns them with options that generate different declarations. That owner's claim is returned, and
|
|
443
|
-
* the caller must not write the declarations.
|
|
444
|
-
*/
|
|
445
|
-
var claimDeclarations = (claimPath, claim) => {
|
|
446
|
-
try {
|
|
447
|
-
var _usingCtx$1 = _usingCtx();
|
|
448
|
-
mkdirSync(dirname(claimPath), { recursive: true });
|
|
449
|
-
_usingCtx$1.u(lockFile(claimPath));
|
|
450
|
-
const existing = readClaim(claimPath);
|
|
451
|
-
if (existing !== void 0 && existing.caller !== claim.caller && existsSync(existing.caller)) return hasSameOptions(existing, claim) ? void 0 : existing;
|
|
452
|
-
writeFileAtomically(claimPath, serializeClaim(claim));
|
|
453
|
-
return;
|
|
420
|
+
const temporaryPath = `${filePath}.${process.pid}.tmp`;
|
|
421
|
+
try {
|
|
422
|
+
writeFileSync(temporaryPath, content, "utf-8");
|
|
423
|
+
renameSync(temporaryPath, filePath);
|
|
424
|
+
} finally {
|
|
425
|
+
rmSync(temporaryPath, { force: true });
|
|
426
|
+
}
|
|
454
427
|
} catch (_) {
|
|
455
428
|
_usingCtx$1.e = _;
|
|
456
429
|
} finally {
|
|
@@ -458,28 +431,17 @@ var claimDeclarations = (claimPath, claim) => {
|
|
|
458
431
|
}
|
|
459
432
|
};
|
|
460
433
|
//#endregion
|
|
461
|
-
//#region src/declarations/mirrored-path.ts
|
|
462
|
-
var stripLeadingParentSegments = (relativePath) => {
|
|
463
|
-
const segments = relativePath.split(/[\\/]/);
|
|
464
|
-
const firstOwnedIndex = segments.findIndex((segment) => segment !== "..");
|
|
465
|
-
return segments.slice(firstOwnedIndex === -1 ? segments.length : firstOwnedIndex).join("/");
|
|
466
|
-
};
|
|
467
|
-
var mirroredPath = (sourceRoot, resolvedOutputDir, sourcePath) => join(resolvedOutputDir, stripLeadingParentSegments(relative(sourceRoot, sourcePath)));
|
|
468
|
-
//#endregion
|
|
469
|
-
//#region src/declarations/mirror-declaration-path.ts
|
|
470
|
-
var mirroredDeclarationPath = (sourceRoot, resolvedOutputDir, controllerFilePath) => mirroredPath(sourceRoot, resolvedOutputDir, controllerFilePath).replace(/\.ts$/, ".d.ts");
|
|
471
|
-
//#endregion
|
|
472
434
|
//#region src/declarations/write-controller-declarations.ts
|
|
473
|
-
var writeControllerDeclarations = (controllers, sourceRoot, resolvedOutputDir
|
|
435
|
+
var writeControllerDeclarations = (controllers, sourceRoot, resolvedOutputDir) => {
|
|
474
436
|
for (const controller of controllers) {
|
|
475
437
|
const outputFilePath = mirroredDeclarationPath(sourceRoot, resolvedOutputDir, controller.sourceFile);
|
|
476
438
|
mkdirSync(dirname(outputFilePath), { recursive: true });
|
|
477
|
-
writeFileLocked(outputFilePath, generateControllerDeclaration(controller, outputFilePath
|
|
439
|
+
writeFileLocked(outputFilePath, generateControllerDeclaration(controller, outputFilePath));
|
|
478
440
|
}
|
|
479
441
|
};
|
|
480
442
|
//#endregion
|
|
481
443
|
//#region src/declarations/write-error-body-declaration.ts
|
|
482
|
-
var ERROR_BODY_DECLARATION_FILE_NAME = "
|
|
444
|
+
var ERROR_BODY_DECLARATION_FILE_NAME = "error-body.d.ts";
|
|
483
445
|
var errorBodyDeclarationPath = (resolvedOutputDir) => join(resolvedOutputDir, ERROR_BODY_DECLARATION_FILE_NAME);
|
|
484
446
|
var writeErrorBodyDeclaration = (resolvedOutputDir, errorResponseShape) => {
|
|
485
447
|
const outputFilePath = errorBodyDeclarationPath(resolvedOutputDir);
|
|
@@ -531,15 +493,19 @@ var normalizePath = (filePath) => posix.normalize(isWindows ? filePath.replaceAl
|
|
|
531
493
|
//#region src/plugin/controller-registry.ts
|
|
532
494
|
var createControllerRegistry = (patterns, root, analysisOptions) => {
|
|
533
495
|
const controllersByFile = /* @__PURE__ */ new Map();
|
|
534
|
-
const refresh = (routing = {}) => {
|
|
496
|
+
const refresh = (routing = {}, bootstrapFilePath) => {
|
|
535
497
|
controllersByFile.clear();
|
|
536
498
|
const files = discoverFiles(patterns, root);
|
|
537
|
-
const { controllers: analyzed, diagnostics } = analyzeControllers(files,
|
|
499
|
+
const { controllers: analyzed, diagnostics, interceptorFiles } = analyzeControllers(files, {
|
|
500
|
+
...analysisOptions,
|
|
501
|
+
bootstrapFilePath
|
|
502
|
+
});
|
|
538
503
|
const controllers = applyApplicationRouting(analyzed, routing);
|
|
539
504
|
for (const controller of controllers) controllersByFile.set(normalizePath(controller.sourceFile), controller);
|
|
540
505
|
return {
|
|
541
506
|
controllers,
|
|
542
|
-
diagnostics
|
|
507
|
+
diagnostics,
|
|
508
|
+
interceptorFiles
|
|
543
509
|
};
|
|
544
510
|
};
|
|
545
511
|
return {
|
|
@@ -550,19 +516,6 @@ var createControllerRegistry = (patterns, root, analysisOptions) => {
|
|
|
550
516
|
};
|
|
551
517
|
};
|
|
552
518
|
//#endregion
|
|
553
|
-
//#region src/plugin/describe-declaration-conflict.ts
|
|
554
|
-
var describeDifferences = (owner, claim) => {
|
|
555
|
-
const differences = [];
|
|
556
|
-
if (owner.messagePatterns !== claim.messagePatterns) differences.push(`messagePatterns ${owner.messagePatterns} there, ${claim.messagePatterns} here`);
|
|
557
|
-
if (owner.bootstrap !== claim.bootstrap) differences.push(`bootstrap ${owner.bootstrap ?? "none"} there, ${claim.bootstrap ?? "none"} here`);
|
|
558
|
-
return differences.join("; ");
|
|
559
|
-
};
|
|
560
|
-
var describeDeclarationConflict = (appName, declarationDir, owner, claim) => {
|
|
561
|
-
const app = appName === void 0 ? "The app" : `App "${appName}"`;
|
|
562
|
-
const remedy = appName === void 0 ? "give this app a `name`" : "give this app another `name`";
|
|
563
|
-
return `${app} shares its declarations in ${declarationDir} with the build of ${owner.caller}, which configures it differently (${describeDifferences(owner, claim)}). Builds that use the same app name for the same server must configure it the same way: ${remedy}, or match the other build's options. Declarations were not written.`;
|
|
564
|
-
};
|
|
565
|
-
//#endregion
|
|
566
519
|
//#region src/discovery/find-workspace-root.ts
|
|
567
520
|
var WORKSPACE_MARKER_FILES = [
|
|
568
521
|
"nx.json",
|
|
@@ -587,38 +540,32 @@ var findWorkspaceRoot = (startDirectory) => {
|
|
|
587
540
|
}
|
|
588
541
|
};
|
|
589
542
|
//#endregion
|
|
543
|
+
//#region src/discovery/read-package-name.ts
|
|
544
|
+
var missingName = (root) => /* @__PURE__ */ new Error(`[NestBridge] ${join(root, "package.json")} has no "name". NestBridge names a server's declaration folder after its package: point \`root\` at the server package, or give it a name.`);
|
|
545
|
+
var readPackageName = (root) => {
|
|
546
|
+
const manifestPath = join(root, "package.json");
|
|
547
|
+
if (!existsSync(manifestPath)) throw missingName(root);
|
|
548
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
|
|
549
|
+
if (typeof manifest !== "object" || manifest === null || !("name" in manifest) || typeof manifest.name !== "string" || manifest.name === "") throw missingName(root);
|
|
550
|
+
return manifest.name;
|
|
551
|
+
};
|
|
552
|
+
//#endregion
|
|
590
553
|
//#region src/plugin/resolve-output-location.ts
|
|
591
554
|
var DEFAULT_OUTPUT_DIR = ".nestbridge";
|
|
592
|
-
var
|
|
593
|
-
var resolveOutputLocation = (input) => {
|
|
555
|
+
var resolveOutputDir = (input) => {
|
|
594
556
|
const projectRoot = input.bundlerRoot ?? input.root;
|
|
595
|
-
if (input.outputDir !== void 0)
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
const workspaceRoot = findWorkspaceRoot(projectRoot);
|
|
606
|
-
if (workspaceRoot === void 0) {
|
|
607
|
-
const outputDir = resolve(projectRoot, DEFAULT_OUTPUT_DIR);
|
|
608
|
-
const declarationDir = withAppName(outputDir, input.name);
|
|
609
|
-
return {
|
|
610
|
-
outputDir,
|
|
611
|
-
declarationDir,
|
|
612
|
-
errorBodyDir: declarationDir,
|
|
613
|
-
mirrorRoot: input.root
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
const outputDir = resolve(workspaceRoot, DEFAULT_OUTPUT_DIR);
|
|
557
|
+
if (input.outputDir !== void 0) return resolve(projectRoot, input.outputDir);
|
|
558
|
+
return resolve(findWorkspaceRoot(projectRoot) ?? projectRoot, DEFAULT_OUTPUT_DIR);
|
|
559
|
+
};
|
|
560
|
+
/**
|
|
561
|
+
* Every server gets one folder, named after the package at its `root`, so any number of clients of
|
|
562
|
+
* that server share the same declarations.
|
|
563
|
+
*/
|
|
564
|
+
var resolveOutputLocation = (input) => {
|
|
565
|
+
const outputDir = resolveOutputDir(input);
|
|
617
566
|
return {
|
|
618
567
|
outputDir,
|
|
619
|
-
declarationDir:
|
|
620
|
-
errorBodyDir: withAppName(join(outputDir, relative(workspaceRoot, projectRoot)), input.name),
|
|
621
|
-
mirrorRoot: workspaceRoot
|
|
568
|
+
declarationDir: join(outputDir, readPackageName(input.root))
|
|
622
569
|
};
|
|
623
570
|
};
|
|
624
571
|
//#endregion
|
|
@@ -664,15 +611,13 @@ var createNestBridgeApp = (options, location) => {
|
|
|
664
611
|
const root = options.root === void 0 ? location.baseRoot : resolve(location.baseRoot, options.root);
|
|
665
612
|
const output = resolveOutputLocation({
|
|
666
613
|
outputDir: options.outputDir,
|
|
667
|
-
name: options.name,
|
|
668
614
|
root,
|
|
669
615
|
bundlerRoot: location.bundlerRoot
|
|
670
616
|
});
|
|
671
|
-
const controllerRegistry = createControllerRegistry(options.controllers, root, { messagePatterns:
|
|
617
|
+
const controllerRegistry = createControllerRegistry(options.controllers, root, { messagePatterns: true });
|
|
672
618
|
const resolverRegistry = createResolverRegistry(options.resolvers, root);
|
|
673
|
-
const claimPath = mirroredPath(output.mirrorRoot, output.declarationDir, join(root, DECLARATION_CLAIM_FILE_NAME));
|
|
674
|
-
const caller = normalizePath(location.bundlerRoot ?? location.baseRoot);
|
|
675
619
|
let bootstrapFilePath;
|
|
620
|
+
let interceptorFiles = /* @__PURE__ */ new Set();
|
|
676
621
|
const describeApp = () => options.name === void 0 ? "the app" : `app "${options.name}"`;
|
|
677
622
|
const locateBootstrapFile = (problems) => {
|
|
678
623
|
const bootstrapFile = resolveBootstrapFile(root, output.outputDir, options.bootstrap);
|
|
@@ -697,28 +642,21 @@ var createNestBridgeApp = (options, location) => {
|
|
|
697
642
|
globalPrefix: globalPrefix.value,
|
|
698
643
|
versioning: versioning.value
|
|
699
644
|
};
|
|
700
|
-
const responseWrapper = bootstrapFile === void 0 ? void 0 : detectResponseWrapper(bootstrapFile);
|
|
701
645
|
const errorResponseShape = bootstrapFile === void 0 ? void 0 : detectErrorResponseShape(bootstrapFile);
|
|
702
|
-
const { controllers, diagnostics: controllerDiagnostics } = controllerRegistry.refresh(routing);
|
|
646
|
+
const { controllers, diagnostics: controllerDiagnostics, interceptorFiles: analyzedInterceptorFiles } = controllerRegistry.refresh(routing, bootstrapFile);
|
|
647
|
+
interceptorFiles = new Set(analyzedInterceptorFiles.map(normalizePath));
|
|
703
648
|
const { resolvers, diagnostics: resolverDiagnostics } = resolverRegistry.refresh();
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
};
|
|
709
|
-
const owner = claimDeclarations(claimPath, claim);
|
|
710
|
-
if (owner === void 0) {
|
|
711
|
-
writeControllerDeclarations(controllers, output.mirrorRoot, output.declarationDir, responseWrapper);
|
|
712
|
-
writeResolverDeclarations(resolvers, output.mirrorRoot, output.declarationDir);
|
|
713
|
-
writeErrorBodyDeclaration(output.errorBodyDir, errorResponseShape);
|
|
714
|
-
} else problems.push(describeDeclarationConflict(options.name, output.declarationDir, owner, claim));
|
|
649
|
+
const reportedControllerDiagnostics = options.messagePatterns ? controllerDiagnostics : controllerDiagnostics.filter(({ code }) => code !== "unsupported-message-pattern");
|
|
650
|
+
writeControllerDeclarations(controllers, root, output.declarationDir);
|
|
651
|
+
writeResolverDeclarations(resolvers, root, output.declarationDir);
|
|
652
|
+
writeErrorBodyDeclaration(output.declarationDir, errorResponseShape);
|
|
715
653
|
return {
|
|
716
654
|
controllerCount: controllers.length,
|
|
717
655
|
resolverCount: resolvers.length,
|
|
718
656
|
diagnostics: [
|
|
719
657
|
...globalPrefix.diagnostics,
|
|
720
658
|
...versioning.diagnostics,
|
|
721
|
-
...
|
|
659
|
+
...reportedControllerDiagnostics,
|
|
722
660
|
...resolverDiagnostics
|
|
723
661
|
],
|
|
724
662
|
problems
|
|
@@ -726,17 +664,22 @@ var createNestBridgeApp = (options, location) => {
|
|
|
726
664
|
};
|
|
727
665
|
const transform = (filePath) => {
|
|
728
666
|
const controller = controllerRegistry.get(filePath);
|
|
729
|
-
if (controller !== void 0) return generateControllerModule(controller
|
|
667
|
+
if (controller !== void 0) return generateControllerModule(options.messagePatterns ? controller : {
|
|
668
|
+
...controller,
|
|
669
|
+
messageHandlers: []
|
|
670
|
+
}, options.name);
|
|
730
671
|
const resolver = resolverRegistry.get(filePath);
|
|
731
672
|
if (resolver !== void 0) return generateResolverModule(resolver, options.name);
|
|
732
673
|
};
|
|
733
674
|
const ownedFiles = () => [...controllerRegistry.all().map((controller) => normalizePath(controller.sourceFile)), ...resolverRegistry.all().map((resolver) => normalizePath(resolver.sourceFile))];
|
|
734
|
-
const
|
|
675
|
+
const supportFiles = () => [...bootstrapFilePath === void 0 ? [] : [bootstrapFilePath], ...interceptorFiles];
|
|
676
|
+
const isAffectedBy = (changedFile) => controllerRegistry.has(changedFile) || resolverRegistry.has(changedFile) || changedFile === bootstrapFilePath || interceptorFiles.has(changedFile) || matchesPatterns(options.controllers, changedFile) || matchesPatterns(options.resolvers, changedFile) || isBootstrapFile(changedFile);
|
|
735
677
|
return {
|
|
736
678
|
options,
|
|
737
679
|
analyze,
|
|
738
680
|
transform,
|
|
739
681
|
ownedFiles,
|
|
682
|
+
supportFiles,
|
|
740
683
|
isAffectedBy
|
|
741
684
|
};
|
|
742
685
|
};
|
|
@@ -770,10 +713,11 @@ var nestBridgeUnplugin = createUnplugin((options, meta) => {
|
|
|
770
713
|
loggerOf(app).info(`[nestbridge] ${prefix}${message}`);
|
|
771
714
|
}
|
|
772
715
|
};
|
|
773
|
-
const analyzeApps = (targets) => {
|
|
716
|
+
const analyzeApps = (targets, context) => {
|
|
774
717
|
const watchMode = isWatchMode();
|
|
775
718
|
for (const app of targets) {
|
|
776
719
|
const { controllerCount, resolverCount, diagnostics, problems } = app.analyze();
|
|
720
|
+
for (const supportFile of app.supportFiles()) context.addWatchFile(supportFile);
|
|
777
721
|
reportMessages(problems.map((problem) => `[nestbridge] ${problem}`), watchMode, loggerOf(app));
|
|
778
722
|
reportDiagnostics(diagnostics, watchMode, loggerOf(app));
|
|
779
723
|
log(app, `analyzed ${controllerCount} controller(s), ${resolverCount} resolver(s), ${diagnostics.length} diagnostic(s)`);
|
|
@@ -788,7 +732,7 @@ var nestBridgeUnplugin = createUnplugin((options, meta) => {
|
|
|
788
732
|
baseRoot,
|
|
789
733
|
bundlerRoot
|
|
790
734
|
}));
|
|
791
|
-
analyzeApps(apps);
|
|
735
|
+
analyzeApps(apps, this);
|
|
792
736
|
},
|
|
793
737
|
resolveId(source) {
|
|
794
738
|
if (source === "virtual-nestbridge-config") return RESOLVED_CONFIG_VIRTUAL_MODULE_ID;
|
|
@@ -810,7 +754,7 @@ var nestBridgeUnplugin = createUnplugin((options, meta) => {
|
|
|
810
754
|
const changedFile = normalizePath(id);
|
|
811
755
|
const affectedApps = apps.filter((app) => app.isAffectedBy(changedFile));
|
|
812
756
|
if (affectedApps.length === 0) return;
|
|
813
|
-
analyzeApps(affectedApps);
|
|
757
|
+
analyzeApps(affectedApps, this);
|
|
814
758
|
for (const app of affectedApps) log(app, `nestbridge source changed: ${changedFile}`);
|
|
815
759
|
},
|
|
816
760
|
vite: { configResolved(config) {
|
|
@@ -829,7 +773,7 @@ var nestBridgeUnplugin = createUnplugin((options, meta) => {
|
|
|
829
773
|
});
|
|
830
774
|
//#endregion
|
|
831
775
|
//#region src/version.ts
|
|
832
|
-
var VERSION = "
|
|
776
|
+
var VERSION = "3.0.0";
|
|
833
777
|
//#endregion
|
|
834
778
|
export { VERSION, nestBridgeUnplugin };
|
|
835
779
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nestbridge.unplugin.js","names":[],"sources":["../src/codegen/generate-config-module.ts","../src/virtual-modules/config-virtual-id.ts","../src/codegen/merge-named-parameters-expression.ts","../src/codegen/generate-body-expression.ts","../src/codegen/generate-headers-expression.ts","../src/codegen/message-runtime-function.ts","../src/codegen/generate-message-method.ts","../src/codegen/generate-parameter-list.ts","../src/codegen/generate-path-expression.ts","../src/codegen/generate-query-expression.ts","../src/codegen/generate-controller-module.ts","../src/codegen/generate-graphql-document.ts","../src/codegen/generate-resolver-argument-list.ts","../src/codegen/generate-resolver-module.ts","../src/options/log-level-ranks.ts","../src/options/resolve-global-prefix-option.ts","../src/options/resolve-versioning-option.ts","../src/options/resolve-nestbridge-entry.ts","../src/options/validate-nestbridge-entries.ts","../src/options/resolve-nestbridge-options.ts","../src/plugin/console-logger.ts","../src/plugin/create-level-logger.ts","../src/plugin/find-overlapping-files.ts","../src/plugin/most-verbose-log-level.ts","../src/declarations/write-file-locked.ts","../src/declarations/claim-declarations.ts","../src/declarations/mirrored-path.ts","../src/declarations/mirror-declaration-path.ts","../src/declarations/write-controller-declarations.ts","../src/declarations/write-error-body-declaration.ts","../src/declarations/write-resolver-declarations.ts","../src/discovery/discover-files.ts","../src/discovery/discover-bootstrap-file.ts","../src/discovery/resolve-bootstrap-file.ts","../src/plugin/normalize-path.ts","../src/plugin/controller-registry.ts","../src/plugin/describe-declaration-conflict.ts","../src/discovery/find-workspace-root.ts","../src/plugin/resolve-output-location.ts","../src/plugin/resolve-routing-option.ts","../src/plugin/resolver-registry.ts","../src/plugin/nestbridge-app.ts","../src/plugin/report-messages.ts","../src/plugin/report-diagnostics.ts","../src/plugin/nestbridge-unplugin-factory.ts","../package.json","../src/version.ts"],"sourcesContent":["import type { ResolvedNestBridgeOptions } from '../options';\n\nconst generateBaseURLStatement = (entry: ResolvedNestBridgeOptions) => {\n if (entry.baseURL === undefined) {\n return undefined;\n }\n\n if (entry.name === undefined) {\n return `setNestBridgeBaseURL(${JSON.stringify(entry.baseURL)});`;\n }\n\n return `setNestBridgeServiceBaseURL(${JSON.stringify(entry.name)}, ${JSON.stringify(entry.baseURL)});`;\n};\n\nexport const generateConfigModule = (entries: readonly ResolvedNestBridgeOptions[]) => {\n const statements = entries\n .map(generateBaseURLStatement)\n .filter((statement) => statement !== undefined);\n\n if (statements.length === 0) {\n return '';\n }\n\n const importedNames = ['setNestBridgeBaseURL', 'setNestBridgeServiceBaseURL'].filter((name) =>\n statements.some((statement) => statement.startsWith(`${name}(`)),\n );\n\n return [`import { ${importedNames.join(', ')} } from 'nestbridge';`, '', ...statements, ''].join(\n '\\n',\n );\n};\n","/**\n * Must not contain a colon: webpack treats any `letter+:` prefix as a URL\n * scheme and routes the request past its filesystem resolver entirely,\n * bypassing the resolveId hook this virtual module relies on.\n */\nexport const CONFIG_VIRTUAL_MODULE_ID = 'virtual-nestbridge-config';\n\nexport const RESOLVED_CONFIG_VIRTUAL_MODULE_ID = `\\0${CONFIG_VIRTUAL_MODULE_ID}`;\n","interface NamedParameterLike {\n name?: string;\n parameterName: string;\n}\n\nexport const mergeNamedParametersExpression = (parameters: readonly NamedParameterLike[]) => {\n if (parameters.length === 0) {\n return undefined;\n }\n\n const whole = parameters.find((parameter) => parameter.name === undefined);\n const named = parameters.filter((parameter) => parameter.name !== undefined);\n const namedEntries = named.map(\n (parameter) => `${JSON.stringify(parameter.name)}: ${parameter.parameterName}`,\n );\n\n if (whole === undefined) {\n return `{ ${namedEntries.join(', ')} }`;\n }\n\n if (named.length === 0) {\n return whole.parameterName;\n }\n\n return `{ ...${whole.parameterName}, ${namedEntries.join(', ')} }`;\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\nimport { mergeNamedParametersExpression } from './merge-named-parameters-expression';\n\nexport const generateBodyExpression = (parameters: readonly ControllerParameterDefinition[]) =>\n mergeNamedParametersExpression(parameters.filter((parameter) => parameter.kind === 'body'));\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\n\nexport const generateHeadersExpression = (parameters: readonly ControllerParameterDefinition[]) => {\n const headerParameters = parameters.filter((parameter) => parameter.kind === 'header');\n\n if (headerParameters.length === 0) {\n return undefined;\n }\n\n const entries = headerParameters.map(\n (parameter) => `${JSON.stringify(parameter.name)}: ${parameter.parameterName}`,\n );\n\n return `{ ${entries.join(', ')} }`;\n};\n","import type { MessageKind } from '@nestbridge/core';\n\nexport const messageRuntimeFunctionOf = (kind: MessageKind) =>\n kind === 'event' ? 'emitMessage' : 'sendMessage';\n","import type { MessageHandlerDefinition } from '@nestbridge/core';\nimport { messageRuntimeFunctionOf } from './message-runtime-function';\n\nconst PAYLOAD_PARAMETER = 'payload';\n\nconst EMPTY_PAYLOAD = '{}';\n\nexport const generateMessageMethod = (handler: MessageHandlerDefinition, service: string) => {\n const hasPayload = handler.payloadParameterIndex !== null;\n const messageProperties = [\n `service: ${JSON.stringify(service)}`,\n `pattern: ${JSON.stringify(handler.pattern)}`,\n hasPayload ? PAYLOAD_PARAMETER : `payload: ${EMPTY_PAYLOAD}`,\n ];\n\n return [\n ` ${handler.name}(${hasPayload ? PAYLOAD_PARAMETER : ''}) {`,\n ` return ${messageRuntimeFunctionOf(handler.kind)}({`,\n ...messageProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\n\nexport const generateParameterList = (parameters: readonly ControllerParameterDefinition[]) =>\n [...parameters]\n .sort((a, b) => a.index - b.index)\n .map((parameter) => parameter.parameterName)\n .join(', ');\n","import type { ControllerMethodDefinition } from '@nestbridge/core';\n\nconst PARAM_TOKEN_PATTERN = /:([A-Za-z0-9_]+)/;\nconst IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nconst generatePropertyAccess = (objectName: string, propertyName: string) =>\n IDENTIFIER_PATTERN.test(propertyName)\n ? `${objectName}.${propertyName}`\n : `${objectName}[${JSON.stringify(propertyName)}]`;\n\nexport const generatePathExpression = (method: ControllerMethodDefinition) => {\n const paramParameters = method.parameters.filter((parameter) => parameter.kind === 'param');\n const wholeParameter = paramParameters.find((parameter) => parameter.name === undefined);\n const parts = method.path.split(PARAM_TOKEN_PATTERN);\n const expressionParts: string[] = [];\n\n const generateTokenExpression = (token: string) => {\n const namedParameter = paramParameters.find((parameter) => parameter.name === token);\n\n if (namedParameter !== undefined) {\n return `encodeURIComponent(${namedParameter.parameterName})`;\n }\n\n if (wholeParameter !== undefined) {\n return `encodeURIComponent(${generatePropertyAccess(wholeParameter.parameterName, token)})`;\n }\n\n return JSON.stringify(`:${token}`);\n };\n\n parts.forEach((part, index) => {\n const isParamToken = index % 2 === 1;\n\n if (isParamToken) {\n expressionParts.push(generateTokenExpression(part));\n return;\n }\n\n if (part.length > 0) {\n expressionParts.push(JSON.stringify(part));\n }\n });\n\n return expressionParts.length > 0 ? expressionParts.join(' + ') : \"''\";\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\nimport { mergeNamedParametersExpression } from './merge-named-parameters-expression';\n\nexport const generateQueryExpression = (parameters: readonly ControllerParameterDefinition[]) =>\n mergeNamedParametersExpression(parameters.filter((parameter) => parameter.kind === 'query'));\n","import type { ControllerDefinition, ControllerMethodDefinition } from '@nestbridge/core';\nimport { CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport { generateBodyExpression } from './generate-body-expression';\nimport { generateHeadersExpression } from './generate-headers-expression';\nimport { generateMessageMethod } from './generate-message-method';\nimport { generateParameterList } from './generate-parameter-list';\nimport { generatePathExpression } from './generate-path-expression';\nimport { generateQueryExpression } from './generate-query-expression';\nimport { messageRuntimeFunctionOf } from './message-runtime-function';\n\nconst generateMethod = (method: ControllerMethodDefinition, service: string | undefined) => {\n const requestProperties = [\n `method: ${JSON.stringify(method.httpMethod)}`,\n `path: ${generatePathExpression(method)}`,\n ];\n\n if (service !== undefined) {\n requestProperties.push(`service: ${JSON.stringify(service)}`);\n }\n\n const queryExpression = generateQueryExpression(method.parameters);\n if (queryExpression !== undefined) {\n requestProperties.push(`query: ${queryExpression}`);\n }\n\n const bodyExpression = generateBodyExpression(method.parameters);\n if (bodyExpression !== undefined) {\n requestProperties.push(`body: ${bodyExpression}`);\n }\n\n const headersExpression = generateHeadersExpression(method.parameters);\n if (headersExpression !== undefined) {\n requestProperties.push(`headers: ${headersExpression}`);\n }\n\n if (method.responseKind === 'stream') {\n requestProperties.push(`responseType: \"blob\"`);\n }\n\n return [\n ` ${method.name}(${generateParameterList(method.parameters)}) {`,\n ' return request({',\n ...requestProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n\nconst generateMessageMethods = (controller: ControllerDefinition, service: string | undefined) => {\n if (controller.messageHandlers.length === 0) {\n return [];\n }\n\n if (service === undefined) {\n throw new Error(\n `[nestbridge] ${controller.name} has message handlers, but its app has no \\`name\\` to address the service by.`,\n );\n }\n\n return controller.messageHandlers.map((handler) => generateMessageMethod(handler, service));\n};\n\nexport const generateControllerModule = (controller: ControllerDefinition, service?: string) => {\n const methods = [\n ...controller.methods.map((method) => generateMethod(method, service)),\n ...generateMessageMethods(controller, service),\n ].join('\\n\\n');\n const messageRuntimeFunctions = Array.from(\n new Set(controller.messageHandlers.map((handler) => messageRuntimeFunctionOf(handler.kind))),\n ).sort();\n\n return [\n `import '${CONFIG_VIRTUAL_MODULE_ID}';`,\n \"import { request } from 'nestbridge';\",\n ...(messageRuntimeFunctions.length > 0\n ? [`import { ${messageRuntimeFunctions.join(', ')} } from 'nestbridge/microservices';`]\n : []),\n '',\n `export class ${controller.name} {`,\n ' constructor() {}',\n '',\n methods,\n '}',\n '',\n ].join('\\n');\n};\n","import type { ResolverMethodDefinition, SelectionField } from '@nestbridge/core';\n\nconst capitalize = (value: string) => `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n\nconst renderSelectionSet = (fields: readonly SelectionField[]): string => {\n const rendered = fields.map((field) =>\n field.children === undefined\n ? field.name\n : `${field.name} ${renderSelectionSet(field.children)}`,\n );\n\n return `{ ${rendered.join(' ')} }`;\n};\n\nexport const generateGraphqlDocument = (method: ResolverMethodDefinition) => {\n const variableDeclarations = method.arguments\n .map((argument) => `$${argument.name}: ${argument.graphqlType}`)\n .join(', ');\n const fieldArguments = method.arguments\n .map((argument) => `${argument.name}: $${argument.name}`)\n .join(', ');\n\n const variablesClause = variableDeclarations.length > 0 ? `(${variableDeclarations})` : '';\n const fieldArgumentsClause = fieldArguments.length > 0 ? `(${fieldArguments})` : '';\n const fieldSelection =\n method.selection.length > 0 ? ` ${renderSelectionSet(method.selection)}` : '';\n\n return `${method.operationKind} ${capitalize(method.name)}${variablesClause} { ${method.operationName}${fieldArgumentsClause}${fieldSelection} }`;\n};\n","import type { ResolverArgumentDefinition } from '@nestbridge/core';\n\nexport const generateResolverArgumentList = (\n resolverArguments: readonly ResolverArgumentDefinition[],\n) =>\n [...resolverArguments]\n .sort((a, b) => a.index - b.index)\n .map((argument) => argument.parameterName)\n .join(', ');\n","import type {\n ResolverArgumentDefinition,\n ResolverDefinition,\n ResolverMethodDefinition,\n} from '@nestbridge/core';\nimport { CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport { generateGraphqlDocument } from './generate-graphql-document';\nimport { generateResolverArgumentList } from './generate-resolver-argument-list';\n\nconst generateVariablesExpression = (resolverArguments: readonly ResolverArgumentDefinition[]) => {\n if (resolverArguments.length === 0) {\n return undefined;\n }\n\n const entries = resolverArguments.map(\n (argument) => `${JSON.stringify(argument.name)}: ${argument.parameterName}`,\n );\n\n return `{ ${entries.join(', ')} }`;\n};\n\nconst generateMethod = (method: ResolverMethodDefinition, service: string | undefined) => {\n const requestProperties = [\n `document: ${JSON.stringify(generateGraphqlDocument(method))}`,\n `field: ${JSON.stringify(method.operationName)}`,\n ];\n\n if (service !== undefined) {\n requestProperties.push(`service: ${JSON.stringify(service)}`);\n }\n\n const variablesExpression = generateVariablesExpression(method.arguments);\n if (variablesExpression !== undefined) {\n requestProperties.push(`variables: ${variablesExpression}`);\n }\n\n return [\n ` ${method.name}(${generateResolverArgumentList(method.arguments)}) {`,\n ' return graphqlRequest({',\n ...requestProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n\nexport const generateResolverModule = (resolver: ResolverDefinition, service?: string) => {\n const methods = resolver.methods.map((method) => generateMethod(method, service)).join('\\n\\n');\n\n return [\n `import '${CONFIG_VIRTUAL_MODULE_ID}';`,\n \"import { graphqlRequest } from 'nestbridge';\",\n '',\n `export class ${resolver.name} {`,\n ' constructor() {}',\n '',\n methods,\n '}',\n '',\n ].join('\\n');\n};\n","import type { NestBridgeLogLevel } from './nestbridge-log-level';\n\nexport const LOG_LEVEL_RANKS: Record<NestBridgeLogLevel, number> = {\n silent: 0,\n error: 1,\n warn: 2,\n info: 3,\n};\n","import type { GlobalPrefix } from '@nestbridge/core';\nimport type { NestBridgeOptions } from './nestbridge-options';\n\nexport const resolveGlobalPrefixOption = (\n option: NestBridgeOptions['globalPrefix'],\n): GlobalPrefix | false | undefined => {\n if (option === undefined || option === false) {\n return option;\n }\n\n if (typeof option === 'string') {\n return { prefix: option, exclude: [] };\n }\n\n return {\n prefix: option.prefix,\n exclude: (option.exclude ?? []).map((entry) =>\n typeof entry === 'string' ? { path: entry } : entry,\n ),\n };\n};\n","import type { UriVersioning } from '@nestbridge/core';\nimport type { NestBridgeOptions } from './nestbridge-options';\n\nconst DEFAULT_VERSION_PREFIX = 'v';\n\nexport const resolveVersioningOption = (\n option: NestBridgeOptions['versioning'],\n): UriVersioning | false | undefined => {\n if (option === undefined || option === false) {\n return option;\n }\n\n return {\n prefix: option.prefix ?? DEFAULT_VERSION_PREFIX,\n defaultVersion: option.defaultVersion,\n };\n};\n","import type { NestBridgeOptions } from './nestbridge-options';\nimport { resolveGlobalPrefixOption } from './resolve-global-prefix-option';\nimport { resolveVersioningOption } from './resolve-versioning-option';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\n\nconst toArray = (value: string | string[] | undefined) => {\n if (value === undefined) {\n return [];\n }\n\n return Array.isArray(value) ? value : [value];\n};\n\nexport const resolveNestBridgeEntry = (options: NestBridgeOptions): ResolvedNestBridgeOptions => ({\n name: options.name,\n controllers: toArray(options.controllers),\n resolvers: toArray(options.resolvers),\n messagePatterns: options.messagePatterns ?? false,\n baseURL: options.baseURL,\n bootstrap: options.bootstrap,\n globalPrefix: resolveGlobalPrefixOption(options.globalPrefix),\n versioning: resolveVersioningOption(options.versioning),\n debug: options.debug ?? false,\n logLevel: options.logLevel,\n outputDir: options.outputDir,\n root: options.root,\n});\n","import { LOG_LEVEL_RANKS } from './log-level-ranks';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\n\nconst NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;\n\nexport const validateNestBridgeEntries = (entries: readonly ResolvedNestBridgeOptions[]): void => {\n if (entries.length === 0) {\n throw new Error('[nestbridge] Pass at least one app to the plugin options.');\n }\n\n const seenNames = new Set<string>();\n\n entries.forEach((entry, index) => {\n if (entry.logLevel !== undefined && !Object.hasOwn(LOG_LEVEL_RANKS, entry.logLevel)) {\n throw new Error(\n `[nestbridge] Invalid logLevel \"${entry.logLevel}\". Use one of: ${Object.keys(LOG_LEVEL_RANKS).join(', ')}.`,\n );\n }\n\n if (entry.messagePatterns && entry.name === undefined) {\n throw new Error(\n `[nestbridge] App #${index + 1} sets \\`messagePatterns\\` and needs a \\`name\\`, the service its message client is looked up by.`,\n );\n }\n\n if (entry.name === undefined) {\n if (entries.length > 1) {\n throw new Error(\n `[nestbridge] App #${index + 1} needs a \\`name\\` because several apps are configured.`,\n );\n }\n\n return;\n }\n\n if (!NAME_PATTERN.test(entry.name)) {\n throw new Error(\n `[nestbridge] Invalid app name \"${entry.name}\". Start with a letter and use only letters, digits, \"-\" and \"_\".`,\n );\n }\n\n if (seenNames.has(entry.name)) {\n throw new Error(\n `[nestbridge] Duplicate app name \"${entry.name}\". Each app needs its own name.`,\n );\n }\n\n seenNames.add(entry.name);\n });\n};\n","import type { NestBridgePluginOptions } from './nestbridge-plugin-options';\nimport { resolveNestBridgeEntry } from './resolve-nestbridge-entry';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\nimport { validateNestBridgeEntries } from './validate-nestbridge-entries';\n\nexport const resolveNestBridgeOptions = (\n options: NestBridgePluginOptions,\n): ResolvedNestBridgeOptions[] => {\n const entries = (Array.isArray(options) ? options : [options]).map(resolveNestBridgeEntry);\n\n validateNestBridgeEntries(entries);\n\n return entries;\n};\n","import type { BundlerLogger } from './bundler-logger';\n\nexport const consoleLogger: BundlerLogger = {\n info: (message) => console.log(message),\n warn: (message) => console.warn(message),\n};\n","import { LOG_LEVEL_RANKS, type NestBridgeLogLevel } from '../options';\nimport type { BundlerLogger } from './bundler-logger';\n\nexport const createLevelLogger = (level: NestBridgeLogLevel | undefined, logger: BundlerLogger) => {\n const rank = LOG_LEVEL_RANKS[level ?? 'info'];\n\n return {\n info: (message) => {\n if (rank >= LOG_LEVEL_RANKS.info) {\n logger.info(message);\n }\n },\n warn: (message) => {\n if (rank >= LOG_LEVEL_RANKS.warn) {\n logger.warn(message);\n }\n },\n } satisfies BundlerLogger;\n};\n","import type { NestBridgeApp } from './nestbridge-app';\n\nconst describeOwner = (app: NestBridgeApp) =>\n app.options.name === undefined ? 'the app' : `\"${app.options.name}\"`;\n\nexport const findOverlappingFiles = (apps: readonly NestBridgeApp[]) => {\n const ownersByFile = new Map<string, NestBridgeApp[]>();\n\n for (const app of apps) {\n for (const filePath of app.ownedFiles()) {\n ownersByFile.set(filePath, [...(ownersByFile.get(filePath) ?? []), app]);\n }\n }\n\n return [...ownersByFile.entries()]\n .filter(([, owners]) => owners.length > 1)\n .map(\n ([filePath, owners]) =>\n `${filePath} is matched by several apps (${owners.map(describeOwner).join(', ')}). ` +\n 'Narrow their controllers and resolvers globs so each file belongs to one app.',\n );\n};\n","import { LOG_LEVEL_RANKS, type NestBridgeLogLevel } from '../options';\n\nexport const mostVerboseLogLevel = (levels: readonly (NestBridgeLogLevel | undefined)[]) =>\n levels.reduce<NestBridgeLogLevel | undefined>((mostVerbose, level) => {\n if (mostVerbose === undefined || level === undefined) {\n return undefined;\n }\n\n return LOG_LEVEL_RANKS[level] > LOG_LEVEL_RANKS[mostVerbose] ? level : mostVerbose;\n }, 'silent');\n","import {\n closeSync,\n existsSync,\n openSync,\n readFileSync,\n renameSync,\n rmSync,\n statSync,\n writeFileSync,\n} from 'node:fs';\n\nexport const LOCK_FILE_SUFFIX = '.lock';\n\nconst DEFAULT_LOCK_TIMEOUT_MS = 5_000;\nconst DEFAULT_STALE_LOCK_MS = 10_000;\nconst LOCK_RETRY_INTERVAL_MS = 10;\n\nexport interface WriteFileLockedOptions {\n timeoutMs?: number;\n staleAfterMs?: number;\n}\n\nconst sleep = (milliseconds: number) => {\n Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, milliseconds);\n};\n\nconst isErrnoException = (error: unknown): error is NodeJS.ErrnoException =>\n error instanceof Error && 'code' in error;\n\nconst isStale = (lockPath: string, staleAfterMs: number) => {\n try {\n return Date.now() - statSync(lockPath).mtimeMs > staleAfterMs;\n } catch (error) {\n if (isErrnoException(error) && error.code === 'ENOENT') {\n return true;\n }\n\n throw error;\n }\n};\n\nconst acquireLock = (lockPath: string, options: Required<WriteFileLockedOptions>) => {\n const deadline = Date.now() + options.timeoutMs;\n\n while (true) {\n try {\n const descriptor = openSync(lockPath, 'wx');\n\n return {\n [Symbol.dispose]: () => {\n closeSync(descriptor);\n rmSync(lockPath, { force: true });\n },\n };\n } catch (error) {\n if (!isErrnoException(error) || error.code !== 'EEXIST') {\n throw error;\n }\n }\n\n if (isStale(lockPath, options.staleAfterMs)) {\n rmSync(lockPath, { force: true });\n continue;\n }\n\n if (Date.now() >= deadline) {\n throw new Error(\n `[NestBridge] Timed out after ${options.timeoutMs}ms waiting for ${lockPath}. Delete it if no other NestBridge process is running.`,\n );\n }\n\n sleep(LOCK_RETRY_INTERVAL_MS);\n }\n};\n\nconst hasContent = (filePath: string, content: string) =>\n existsSync(filePath) && readFileSync(filePath, 'utf-8') === content;\n\nexport const lockFile = (filePath: string, options: WriteFileLockedOptions = {}) =>\n acquireLock(`${filePath}${LOCK_FILE_SUFFIX}`, {\n timeoutMs: options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS,\n staleAfterMs: options.staleAfterMs ?? DEFAULT_STALE_LOCK_MS,\n });\n\n/**\n * Swaps the content in through a rename. Callers must hold the file's lock.\n */\nexport const writeFileAtomically = (filePath: string, content: string) => {\n const temporaryPath = `${filePath}.${process.pid}.tmp`;\n\n try {\n writeFileSync(temporaryPath, content, 'utf-8');\n renameSync(temporaryPath, filePath);\n } finally {\n rmSync(temporaryPath, { force: true });\n }\n};\n\nexport const writeFileLocked = (\n filePath: string,\n content: string,\n options: WriteFileLockedOptions = {},\n) => {\n if (hasContent(filePath, content)) {\n return;\n }\n\n using _lock = lockFile(filePath, options);\n\n if (hasContent(filePath, content)) {\n return;\n }\n\n writeFileAtomically(filePath, content);\n};\n","import { existsSync, mkdirSync, readFileSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport type { DeclarationClaim } from './declaration-claim';\nimport { lockFile, writeFileAtomically } from './write-file-locked';\n\nexport const DECLARATION_CLAIM_FILE_NAME = 'nestbridge-app.json';\n\nconst isDeclarationClaim = (value: unknown): value is DeclarationClaim =>\n typeof value === 'object' &&\n value !== null &&\n 'caller' in value &&\n typeof value.caller === 'string' &&\n 'messagePatterns' in value &&\n typeof value.messagePatterns === 'boolean' &&\n 'bootstrap' in value &&\n (typeof value.bootstrap === 'string' || value.bootstrap === null);\n\nconst readClaim = (claimPath: string) => {\n if (!existsSync(claimPath)) {\n return undefined;\n }\n\n const claim: unknown = JSON.parse(readFileSync(claimPath, 'utf-8'));\n\n if (!isDeclarationClaim(claim)) {\n throw new Error(\n `[NestBridge] ${claimPath} is not a NestBridge declaration claim. Delete it so the next build recreates it.`,\n );\n }\n\n return claim;\n};\n\nconst hasSameOptions = (left: DeclarationClaim, right: DeclarationClaim) =>\n left.messagePatterns === right.messagePatterns && left.bootstrap === right.bootstrap;\n\nconst serializeClaim = (claim: DeclarationClaim) => `${JSON.stringify(claim, null, 2)}\\n`;\n\n/**\n * Records `claim` as the owner of an app's declarations, unless another caller that still exists\n * owns them with options that generate different declarations. That owner's claim is returned, and\n * the caller must not write the declarations.\n */\nexport const claimDeclarations = (claimPath: string, claim: DeclarationClaim) => {\n mkdirSync(dirname(claimPath), { recursive: true });\n using _lock = lockFile(claimPath);\n\n const existing = readClaim(claimPath);\n\n if (existing !== undefined && existing.caller !== claim.caller && existsSync(existing.caller)) {\n return hasSameOptions(existing, claim) ? undefined : existing;\n }\n\n writeFileAtomically(claimPath, serializeClaim(claim));\n return undefined;\n};\n","import { join, relative } from 'node:path';\n\nconst stripLeadingParentSegments = (relativePath: string) => {\n const segments = relativePath.split(/[\\\\/]/);\n const firstOwnedIndex = segments.findIndex((segment) => segment !== '..');\n return segments.slice(firstOwnedIndex === -1 ? segments.length : firstOwnedIndex).join('/');\n};\n\nexport const mirroredPath = (sourceRoot: string, resolvedOutputDir: string, sourcePath: string) =>\n join(resolvedOutputDir, stripLeadingParentSegments(relative(sourceRoot, sourcePath)));\n","import { mirroredPath } from './mirrored-path';\n\nexport const mirroredDeclarationPath = (\n sourceRoot: string,\n resolvedOutputDir: string,\n controllerFilePath: string,\n) => mirroredPath(sourceRoot, resolvedOutputDir, controllerFilePath).replace(/\\.ts$/, '.d.ts');\n","import { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport {\n type ControllerDefinition,\n generateControllerDeclaration,\n type ResponseWrapperDetection,\n} from '@nestbridge/core';\nimport { mirroredDeclarationPath } from './mirror-declaration-path';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const writeControllerDeclarations = (\n controllers: readonly ControllerDefinition[],\n sourceRoot: string,\n resolvedOutputDir: string,\n responseWrapper?: ResponseWrapperDetection,\n) => {\n for (const controller of controllers) {\n const outputFilePath = mirroredDeclarationPath(\n sourceRoot,\n resolvedOutputDir,\n controller.sourceFile,\n );\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(\n outputFilePath,\n generateControllerDeclaration(controller, outputFilePath, responseWrapper),\n );\n }\n};\n","import { mkdirSync, rmSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { type ErrorResponseShapeDetection, generateErrorBodyDeclaration } from '@nestbridge/core';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const ERROR_BODY_DECLARATION_FILE_NAME = 'nestbridge-error-body.d.ts';\n\nexport const errorBodyDeclarationPath = (resolvedOutputDir: string) =>\n join(resolvedOutputDir, ERROR_BODY_DECLARATION_FILE_NAME);\n\nexport const writeErrorBodyDeclaration = (\n resolvedOutputDir: string,\n errorResponseShape?: ErrorResponseShapeDetection,\n) => {\n const outputFilePath = errorBodyDeclarationPath(resolvedOutputDir);\n\n if (errorResponseShape === undefined) {\n rmSync(outputFilePath, { force: true });\n return;\n }\n\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(\n outputFilePath,\n generateErrorBodyDeclaration(errorResponseShape.errorBodyTypeSource),\n );\n};\n","import { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { generateControllerDeclaration, type ResolverDefinition } from '@nestbridge/core';\nimport { mirroredDeclarationPath } from './mirror-declaration-path';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const writeResolverDeclarations = (\n resolvers: readonly ResolverDefinition[],\n sourceRoot: string,\n resolvedOutputDir: string,\n) => {\n for (const resolver of resolvers) {\n const outputFilePath = mirroredDeclarationPath(\n sourceRoot,\n resolvedOutputDir,\n resolver.sourceFile,\n );\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(outputFilePath, generateControllerDeclaration(resolver, outputFilePath));\n }\n};\n","import { globSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nexport const discoverFiles = (\n patterns: readonly string[],\n root: string,\n exclude?: (filePath: string) => boolean,\n) => {\n const matches = globSync([...patterns], { cwd: root, exclude });\n return [...new Set(matches.map((match) => resolve(root, match)))].sort();\n};\n","import { resolve, sep } from 'node:path';\nimport { discoverFiles } from './discover-files';\n\nconst BOOTSTRAP_FILE_PATTERN = '**/main.ts';\n\nexport const discoverBootstrapFile = (root: string, resolvedOutputDir: string) => {\n const isExcluded = (filePath: string) => {\n if (filePath.split(/[\\\\/]/).includes('node_modules')) {\n return true;\n }\n\n const resolvedPath = resolve(root, filePath);\n return (\n resolvedPath === resolvedOutputDir || resolvedPath.startsWith(`${resolvedOutputDir}${sep}`)\n );\n };\n\n const matches = discoverFiles([BOOTSTRAP_FILE_PATTERN], root, isExcluded);\n\n return matches.length === 1 ? matches[0] : undefined;\n};\n","import { resolve } from 'node:path';\nimport { discoverBootstrapFile } from './discover-bootstrap-file';\n\nexport const resolveBootstrapFile = (\n root: string,\n resolvedOutputDir: string,\n bootstrap: string | undefined,\n): string | undefined =>\n bootstrap === undefined\n ? discoverBootstrapFile(root, resolvedOutputDir)\n : resolve(root, bootstrap);\n","import { posix } from 'node:path';\n\nconst isWindows = process.platform === 'win32';\n\nexport const normalizePath = (filePath: string) =>\n posix.normalize(isWindows ? filePath.replaceAll('\\\\', '/') : filePath);\n","import {\n type ApplicationRouting,\n analyzeControllers,\n applyApplicationRouting,\n type ControllerAnalysisOptions,\n type ControllerDefinition,\n type NestBridgeDiagnostic,\n} from '@nestbridge/core';\nimport { discoverFiles } from '../discovery';\nimport { normalizePath } from './normalize-path';\n\nexport interface ControllerRegistryRefreshResult {\n controllers: ControllerDefinition[];\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport interface ControllerRegistry {\n refresh: (routing?: ApplicationRouting) => ControllerRegistryRefreshResult;\n get: (filePath: string) => ControllerDefinition | undefined;\n has: (filePath: string) => boolean;\n all: () => ControllerDefinition[];\n}\n\nexport const createControllerRegistry = (\n patterns: readonly string[],\n root: string,\n analysisOptions: ControllerAnalysisOptions,\n): ControllerRegistry => {\n const controllersByFile = new Map<string, ControllerDefinition>();\n\n const refresh = (routing: ApplicationRouting = {}) => {\n controllersByFile.clear();\n\n const files = discoverFiles(patterns, root);\n const { controllers: analyzed, diagnostics } = analyzeControllers(files, analysisOptions);\n const controllers = applyApplicationRouting(analyzed, routing);\n\n for (const controller of controllers) {\n controllersByFile.set(normalizePath(controller.sourceFile), controller);\n }\n\n return { controllers, diagnostics };\n };\n\n return {\n refresh,\n get: (filePath) => controllersByFile.get(filePath),\n has: (filePath) => controllersByFile.has(filePath),\n all: () => [...controllersByFile.values()],\n };\n};\n","import type { DeclarationClaim } from '../declarations';\n\nconst describeDifferences = (owner: DeclarationClaim, claim: DeclarationClaim) => {\n const differences: string[] = [];\n\n if (owner.messagePatterns !== claim.messagePatterns) {\n differences.push(\n `messagePatterns ${owner.messagePatterns} there, ${claim.messagePatterns} here`,\n );\n }\n\n if (owner.bootstrap !== claim.bootstrap) {\n differences.push(\n `bootstrap ${owner.bootstrap ?? 'none'} there, ${claim.bootstrap ?? 'none'} here`,\n );\n }\n\n return differences.join('; ');\n};\n\nexport const describeDeclarationConflict = (\n appName: string | undefined,\n declarationDir: string,\n owner: DeclarationClaim,\n claim: DeclarationClaim,\n) => {\n const app = appName === undefined ? 'The app' : `App \"${appName}\"`;\n const remedy = appName === undefined ? 'give this app a `name`' : 'give this app another `name`';\n\n return (\n `${app} shares its declarations in ${declarationDir} with the build of ${owner.caller}, ` +\n `which configures it differently (${describeDifferences(owner, claim)}). ` +\n `Builds that use the same app name for the same server must configure it the same way: ` +\n `${remedy}, or match the other build's options. Declarations were not written.`\n );\n};\n","import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nconst WORKSPACE_MARKER_FILES = ['nx.json', 'pnpm-workspace.yaml', 'turbo.json', 'lerna.json'];\n\nconst declaresWorkspaces = (directory: string) => {\n const manifestPath = join(directory, 'package.json');\n\n if (!existsSync(manifestPath)) {\n return false;\n }\n\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n\n return typeof manifest === 'object' && manifest !== null && 'workspaces' in manifest;\n};\n\nconst isWorkspaceRoot = (directory: string) =>\n WORKSPACE_MARKER_FILES.some((file) => existsSync(join(directory, file))) ||\n declaresWorkspaces(directory);\n\nexport const findWorkspaceRoot = (startDirectory: string) => {\n let directory = startDirectory;\n\n while (true) {\n if (isWorkspaceRoot(directory)) {\n return directory;\n }\n\n const parent = dirname(directory);\n\n if (parent === directory) {\n return undefined;\n }\n\n directory = parent;\n }\n};\n","import { join, relative, resolve } from 'node:path';\nimport { findWorkspaceRoot } from '../discovery/find-workspace-root';\n\nexport const DEFAULT_OUTPUT_DIR = '.nestbridge';\n\ninterface OutputLocationInput {\n outputDir: string | undefined;\n name: string | undefined;\n root: string;\n bundlerRoot: string | undefined;\n}\n\nexport interface OutputLocation {\n outputDir: string;\n declarationDir: string;\n errorBodyDir: string;\n mirrorRoot: string;\n}\n\nconst withAppName = (outputDir: string, name: string | undefined) =>\n name === undefined ? outputDir : join(outputDir, name);\n\nexport const resolveOutputLocation = (input: OutputLocationInput): OutputLocation => {\n const projectRoot = input.bundlerRoot ?? input.root;\n\n if (input.outputDir !== undefined) {\n const outputDir = resolve(projectRoot, input.outputDir);\n const declarationDir = withAppName(outputDir, input.name);\n\n return { outputDir, declarationDir, errorBodyDir: declarationDir, mirrorRoot: input.root };\n }\n\n const workspaceRoot = findWorkspaceRoot(projectRoot);\n\n if (workspaceRoot === undefined) {\n const outputDir = resolve(projectRoot, DEFAULT_OUTPUT_DIR);\n const declarationDir = withAppName(outputDir, input.name);\n\n return { outputDir, declarationDir, errorBodyDir: declarationDir, mirrorRoot: input.root };\n }\n\n const outputDir = resolve(workspaceRoot, DEFAULT_OUTPUT_DIR);\n\n return {\n outputDir,\n declarationDir: withAppName(outputDir, input.name),\n errorBodyDir: withAppName(join(outputDir, relative(workspaceRoot, projectRoot)), input.name),\n mirrorRoot: workspaceRoot,\n };\n};\n","import type { BootstrapDetection } from '@nestbridge/core';\n\nexport const resolveRoutingOption = <T>(\n explicit: T | false | undefined,\n bootstrapFile: string | undefined,\n detect: (bootstrapFilePath: string) => BootstrapDetection<T>,\n): BootstrapDetection<T> => {\n if (explicit === false) {\n return { value: undefined, diagnostics: [] };\n }\n\n if (explicit !== undefined) {\n return { value: explicit, diagnostics: [] };\n }\n\n return bootstrapFile === undefined\n ? { value: undefined, diagnostics: [] }\n : detect(bootstrapFile);\n};\n","import {\n analyzeResolvers,\n type NestBridgeDiagnostic,\n type ResolverDefinition,\n} from '@nestbridge/core';\nimport { discoverFiles } from '../discovery';\nimport { normalizePath } from './normalize-path';\n\nexport interface ResolverRegistryRefreshResult {\n resolvers: ResolverDefinition[];\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport interface ResolverRegistry {\n refresh: () => ResolverRegistryRefreshResult;\n get: (filePath: string) => ResolverDefinition | undefined;\n has: (filePath: string) => boolean;\n all: () => ResolverDefinition[];\n}\n\nexport const createResolverRegistry = (\n patterns: readonly string[],\n root: string,\n): ResolverRegistry => {\n const resolversByFile = new Map<string, ResolverDefinition>();\n\n const refresh = () => {\n resolversByFile.clear();\n\n const files = discoverFiles(patterns, root);\n const { resolvers, diagnostics } = analyzeResolvers(files);\n\n for (const resolver of resolvers) {\n resolversByFile.set(normalizePath(resolver.sourceFile), resolver);\n }\n\n return { resolvers, diagnostics };\n };\n\n return {\n refresh,\n get: (filePath) => resolversByFile.get(filePath),\n has: (filePath) => resolversByFile.has(filePath),\n all: () => [...resolversByFile.values()],\n };\n};\n","import { existsSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n type ApplicationRouting,\n detectErrorResponseShape,\n detectGlobalPrefix,\n detectResponseWrapper,\n detectVersioning,\n} from '@nestbridge/core';\nimport { generateControllerModule, generateResolverModule } from '../codegen';\nimport {\n claimDeclarations,\n DECLARATION_CLAIM_FILE_NAME,\n type DeclarationClaim,\n mirroredPath,\n writeControllerDeclarations,\n writeErrorBodyDeclaration,\n writeResolverDeclarations,\n} from '../declarations';\nimport { discoverFiles, resolveBootstrapFile } from '../discovery';\nimport type { ResolvedNestBridgeOptions } from '../options';\nimport { createControllerRegistry } from './controller-registry';\nimport { describeDeclarationConflict } from './describe-declaration-conflict';\nimport type { NestBridgeAppAnalysis } from './nestbridge-app-analysis';\nimport type { NestBridgeAppLocation } from './nestbridge-app-location';\nimport { normalizePath } from './normalize-path';\nimport { resolveOutputLocation } from './resolve-output-location';\nimport { resolveRoutingOption } from './resolve-routing-option';\nimport { createResolverRegistry } from './resolver-registry';\n\nexport interface NestBridgeApp {\n options: ResolvedNestBridgeOptions;\n analyze: () => NestBridgeAppAnalysis;\n transform: (filePath: string) => string | undefined;\n ownedFiles: () => string[];\n isAffectedBy: (changedFile: string) => boolean;\n}\n\nexport const createNestBridgeApp = (\n options: ResolvedNestBridgeOptions,\n location: NestBridgeAppLocation,\n): NestBridgeApp => {\n const root =\n options.root === undefined ? location.baseRoot : resolve(location.baseRoot, options.root);\n const output = resolveOutputLocation({\n outputDir: options.outputDir,\n name: options.name,\n root,\n bundlerRoot: location.bundlerRoot,\n });\n const controllerRegistry = createControllerRegistry(options.controllers, root, {\n messagePatterns: options.messagePatterns,\n });\n const resolverRegistry = createResolverRegistry(options.resolvers, root);\n const claimPath = mirroredPath(\n output.mirrorRoot,\n output.declarationDir,\n join(root, DECLARATION_CLAIM_FILE_NAME),\n );\n const caller = normalizePath(location.bundlerRoot ?? location.baseRoot);\n let bootstrapFilePath: string | undefined;\n\n const describeApp = () => (options.name === undefined ? 'the app' : `app \"${options.name}\"`);\n\n const locateBootstrapFile = (problems: string[]) => {\n const bootstrapFile = resolveBootstrapFile(root, output.outputDir, options.bootstrap);\n\n if (\n bootstrapFile !== undefined &&\n options.bootstrap !== undefined &&\n !existsSync(bootstrapFile)\n ) {\n problems.push(`Bootstrap file of ${describeApp()} not found: ${bootstrapFile}`);\n return undefined;\n }\n\n return bootstrapFile;\n };\n\n const matchesPatterns = (patterns: readonly string[], filePath: string) =>\n discoverFiles(patterns, root).map(normalizePath).includes(filePath);\n\n const isBootstrapFile = (filePath: string) => {\n const bootstrapFile = resolveBootstrapFile(root, output.outputDir, options.bootstrap);\n return bootstrapFile !== undefined && normalizePath(bootstrapFile) === filePath;\n };\n\n const analyze = (): NestBridgeAppAnalysis => {\n const problems: string[] = [];\n const bootstrapFile = locateBootstrapFile(problems);\n bootstrapFilePath = bootstrapFile === undefined ? undefined : normalizePath(bootstrapFile);\n\n const globalPrefix = resolveRoutingOption(\n options.globalPrefix,\n bootstrapFile,\n detectGlobalPrefix,\n );\n const versioning = resolveRoutingOption(options.versioning, bootstrapFile, detectVersioning);\n const routing: ApplicationRouting = {\n globalPrefix: globalPrefix.value,\n versioning: versioning.value,\n };\n const responseWrapper =\n bootstrapFile === undefined ? undefined : detectResponseWrapper(bootstrapFile);\n const errorResponseShape =\n bootstrapFile === undefined ? undefined : detectErrorResponseShape(bootstrapFile);\n\n const { controllers, diagnostics: controllerDiagnostics } = controllerRegistry.refresh(routing);\n const { resolvers, diagnostics: resolverDiagnostics } = resolverRegistry.refresh();\n\n const claim: DeclarationClaim = {\n caller,\n messagePatterns: options.messagePatterns,\n bootstrap: bootstrapFilePath ?? null,\n };\n const owner = claimDeclarations(claimPath, claim);\n\n if (owner === undefined) {\n writeControllerDeclarations(\n controllers,\n output.mirrorRoot,\n output.declarationDir,\n responseWrapper,\n );\n writeResolverDeclarations(resolvers, output.mirrorRoot, output.declarationDir);\n writeErrorBodyDeclaration(output.errorBodyDir, errorResponseShape);\n } else {\n problems.push(describeDeclarationConflict(options.name, output.declarationDir, owner, claim));\n }\n\n return {\n controllerCount: controllers.length,\n resolverCount: resolvers.length,\n diagnostics: [\n ...globalPrefix.diagnostics,\n ...versioning.diagnostics,\n ...controllerDiagnostics,\n ...resolverDiagnostics,\n ],\n problems,\n };\n };\n\n const transform = (filePath: string) => {\n const controller = controllerRegistry.get(filePath);\n if (controller !== undefined) {\n return generateControllerModule(controller, options.name);\n }\n\n const resolver = resolverRegistry.get(filePath);\n if (resolver !== undefined) {\n return generateResolverModule(resolver, options.name);\n }\n\n return undefined;\n };\n\n const ownedFiles = () => [\n ...controllerRegistry.all().map((controller) => normalizePath(controller.sourceFile)),\n ...resolverRegistry.all().map((resolver) => normalizePath(resolver.sourceFile)),\n ];\n\n const isAffectedBy = (changedFile: string) =>\n controllerRegistry.has(changedFile) ||\n resolverRegistry.has(changedFile) ||\n changedFile === bootstrapFilePath ||\n matchesPatterns(options.controllers, changedFile) ||\n matchesPatterns(options.resolvers, changedFile) ||\n isBootstrapFile(changedFile);\n\n return { options, analyze, transform, ownedFiles, isAffectedBy };\n};\n","import type { BundlerLogger } from './bundler-logger';\n\nexport const reportMessages = (\n messages: readonly string[],\n watchMode: boolean | undefined,\n logger: Pick<BundlerLogger, 'warn'>,\n) => {\n for (const message of messages) {\n if (watchMode === false) {\n throw new Error(message);\n }\n\n logger.warn(message);\n }\n};\n","import { formatDiagnostic, type NestBridgeDiagnostic } from '@nestbridge/core';\nimport type { BundlerLogger } from './bundler-logger';\nimport { reportMessages } from './report-messages';\n\nexport const reportDiagnostics = (\n diagnostics: readonly NestBridgeDiagnostic[],\n watchMode: boolean | undefined,\n logger: Pick<BundlerLogger, 'warn'>,\n) => {\n reportMessages(diagnostics.map(formatDiagnostic), watchMode, logger);\n};\n","import { createUnplugin, type UnpluginInstance, type UnpluginOptions } from 'unplugin';\nimport { generateConfigModule } from '../codegen';\nimport { type NestBridgePluginOptions, resolveNestBridgeOptions } from '../options';\nimport { CONFIG_VIRTUAL_MODULE_ID, RESOLVED_CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport type { BundlerLogger } from './bundler-logger';\nimport { consoleLogger } from './console-logger';\nimport { createLevelLogger } from './create-level-logger';\nimport { findOverlappingFiles } from './find-overlapping-files';\nimport { mostVerboseLogLevel } from './most-verbose-log-level';\nimport { createNestBridgeApp, type NestBridgeApp } from './nestbridge-app';\nimport { normalizePath } from './normalize-path';\nimport { reportDiagnostics } from './report-diagnostics';\nimport { reportMessages } from './report-messages';\n\nexport const nestBridgeUnplugin: UnpluginInstance<NestBridgePluginOptions, false> = createUnplugin<\n NestBridgePluginOptions,\n false\n>((options, meta) => {\n const entries = resolveNestBridgeOptions(options);\n\n let baseRoot = process.cwd();\n let bundlerRoot: string | undefined;\n let apps: NestBridgeApp[] = [];\n let bundlerLogger: BundlerLogger = consoleLogger;\n let readBundlerWatchMode: (() => boolean) | undefined;\n\n const isWatchMode = () => meta.watchMode ?? readBundlerWatchMode?.();\n\n const loggerOf = (app: NestBridgeApp) => createLevelLogger(app.options.logLevel, bundlerLogger);\n\n const log = (app: NestBridgeApp, message: string) => {\n if (app.options.debug) {\n const prefix = app.options.name === undefined ? '' : `${app.options.name}: `;\n loggerOf(app).info(`[nestbridge] ${prefix}${message}`);\n }\n };\n\n const analyzeApps = (targets: readonly NestBridgeApp[]) => {\n const watchMode = isWatchMode();\n\n for (const app of targets) {\n const { controllerCount, resolverCount, diagnostics, problems } = app.analyze();\n\n reportMessages(\n problems.map((problem) => `[nestbridge] ${problem}`),\n watchMode,\n loggerOf(app),\n );\n reportDiagnostics(diagnostics, watchMode, loggerOf(app));\n log(\n app,\n `analyzed ${controllerCount} controller(s), ${resolverCount} resolver(s), ` +\n `${diagnostics.length} diagnostic(s)`,\n );\n }\n\n reportMessages(\n findOverlappingFiles(apps).map((problem) => `[nestbridge] ${problem}`),\n watchMode,\n createLevelLogger(\n mostVerboseLogLevel(apps.map((app) => app.options.logLevel)),\n bundlerLogger,\n ),\n );\n };\n\n return {\n name: 'nestbridge',\n enforce: 'pre',\n\n buildStart() {\n apps = entries.map((entry) => createNestBridgeApp(entry, { baseRoot, bundlerRoot }));\n analyzeApps(apps);\n },\n\n resolveId(source) {\n if (source === CONFIG_VIRTUAL_MODULE_ID) {\n return RESOLVED_CONFIG_VIRTUAL_MODULE_ID;\n }\n\n return null;\n },\n\n load(id) {\n if (id === RESOLVED_CONFIG_VIRTUAL_MODULE_ID) {\n return generateConfigModule(entries);\n }\n\n return null;\n },\n\n transform(_code, id) {\n const absolutePath = normalizePath(id);\n\n for (const app of apps) {\n const code = app.transform(absolutePath);\n\n if (code !== undefined) {\n return code;\n }\n }\n\n return null;\n },\n\n watchChange(id) {\n const changedFile = normalizePath(id);\n const affectedApps = apps.filter((app) => app.isAffectedBy(changedFile));\n\n if (affectedApps.length === 0) {\n return;\n }\n\n analyzeApps(affectedApps);\n\n for (const app of affectedApps) {\n log(app, `nestbridge source changed: ${changedFile}`);\n }\n },\n\n vite: {\n configResolved(config) {\n baseRoot = config.root;\n bundlerRoot = config.root;\n bundlerLogger = config.logger;\n\n const watching = config.command === 'serve' || Boolean(config.build.watch);\n readBundlerWatchMode = () => watching;\n },\n },\n\n webpack(compiler) {\n bundlerRoot = compiler.options.context ?? bundlerRoot;\n bundlerLogger = compiler.getInfrastructureLogger('nestbridge');\n readBundlerWatchMode = () => compiler.watchMode;\n },\n } satisfies UnpluginOptions;\n});\n","{\n \"name\": \"@nestbridge/unplugin\",\n \"version\": \"2.6.0\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/MDReal32/nestbridge.git\",\n \"directory\": \"packages/unplugin\"\n },\n \"main\": \"./build/nestbridge.unplugin.js\",\n \"types\": \"./build/nestbridge.unplugin.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./build/nestbridge.unplugin.d.ts\",\n \"import\": \"./build/nestbridge.unplugin.js\"\n }\n },\n \"files\": [\n \"build\"\n ],\n \"scripts\": {\n \"build\": \"vite build\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc -p tsconfig.json --noEmit\",\n \"lint\": \"biome check .\"\n },\n \"dependencies\": {\n \"@nestbridge/core\": \"workspace:*\",\n \"unplugin\": \"^3.3.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^26.4.1\",\n \"rolldown-plugin-dts\": \"^0.28.5\",\n \"typescript\": \"^7.0.2\",\n \"vite\": \"^8.2.2\",\n \"vitest\": \"^5.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,eAAe,QAAQ;GACrB,WAAW,OAAO;GAClB,cAAc,OAAO;GACrB,gBAAgB,OAAO;GAEvB,MAAM,WAAW,OAAO,YAAY,WAAW,QAAQ,OAAO,MAAM,KAAK;GACzE,6BAA6B;EAC/B,EACF;EAEA,QAAQ,UAAU;GAChB,cAAc,SAAS,QAAQ,WAAW;GAC1C,gBAAgB,SAAS,wBAAwB,YAAY;GAC7D,6BAA6B,SAAS;EACxC;CACF;AACF,CAAC;;;AEvID,IAAa,UAAkB"}
|
|
1
|
+
{"version":3,"file":"nestbridge.unplugin.js","names":[],"sources":["../src/codegen/generate-config-module.ts","../src/virtual-modules/config-virtual-id.ts","../src/codegen/merge-named-parameters-expression.ts","../src/codegen/generate-body-expression.ts","../src/codegen/generate-headers-expression.ts","../src/codegen/message-runtime-function.ts","../src/codegen/generate-message-method.ts","../src/codegen/generate-parameter-list.ts","../src/codegen/generate-path-expression.ts","../src/codegen/generate-query-expression.ts","../src/codegen/generate-controller-module.ts","../src/codegen/generate-graphql-document.ts","../src/codegen/generate-resolver-argument-list.ts","../src/codegen/generate-resolver-module.ts","../src/options/log-level-ranks.ts","../src/options/resolve-global-prefix-option.ts","../src/options/resolve-versioning-option.ts","../src/options/resolve-nestbridge-entry.ts","../src/options/validate-nestbridge-entries.ts","../src/options/resolve-nestbridge-options.ts","../src/plugin/console-logger.ts","../src/plugin/create-level-logger.ts","../src/plugin/find-overlapping-files.ts","../src/plugin/most-verbose-log-level.ts","../src/declarations/mirrored-path.ts","../src/declarations/mirror-declaration-path.ts","../src/declarations/write-file-locked.ts","../src/declarations/write-controller-declarations.ts","../src/declarations/write-error-body-declaration.ts","../src/declarations/write-resolver-declarations.ts","../src/discovery/discover-files.ts","../src/discovery/discover-bootstrap-file.ts","../src/discovery/resolve-bootstrap-file.ts","../src/plugin/normalize-path.ts","../src/plugin/controller-registry.ts","../src/discovery/find-workspace-root.ts","../src/discovery/read-package-name.ts","../src/plugin/resolve-output-location.ts","../src/plugin/resolve-routing-option.ts","../src/plugin/resolver-registry.ts","../src/plugin/nestbridge-app.ts","../src/plugin/report-messages.ts","../src/plugin/report-diagnostics.ts","../src/plugin/nestbridge-unplugin-factory.ts","../package.json","../src/version.ts"],"sourcesContent":["import type { ResolvedNestBridgeOptions } from '../options';\n\nconst generateBaseURLStatement = (entry: ResolvedNestBridgeOptions) => {\n if (entry.baseURL === undefined) {\n return undefined;\n }\n\n if (entry.name === undefined) {\n return `setNestBridgeBaseURL(${JSON.stringify(entry.baseURL)});`;\n }\n\n return `setNestBridgeServiceBaseURL(${JSON.stringify(entry.name)}, ${JSON.stringify(entry.baseURL)});`;\n};\n\nexport const generateConfigModule = (entries: readonly ResolvedNestBridgeOptions[]) => {\n const statements = entries\n .map(generateBaseURLStatement)\n .filter((statement) => statement !== undefined);\n\n if (statements.length === 0) {\n return '';\n }\n\n const importedNames = ['setNestBridgeBaseURL', 'setNestBridgeServiceBaseURL'].filter((name) =>\n statements.some((statement) => statement.startsWith(`${name}(`)),\n );\n\n return [`import { ${importedNames.join(', ')} } from 'nestbridge';`, '', ...statements, ''].join(\n '\\n',\n );\n};\n","/**\n * Must not contain a colon: webpack treats any `letter+:` prefix as a URL\n * scheme and routes the request past its filesystem resolver entirely,\n * bypassing the resolveId hook this virtual module relies on.\n */\nexport const CONFIG_VIRTUAL_MODULE_ID = 'virtual-nestbridge-config';\n\nexport const RESOLVED_CONFIG_VIRTUAL_MODULE_ID = `\\0${CONFIG_VIRTUAL_MODULE_ID}`;\n","interface NamedParameterLike {\n name?: string;\n parameterName: string;\n}\n\nexport const mergeNamedParametersExpression = (parameters: readonly NamedParameterLike[]) => {\n if (parameters.length === 0) {\n return undefined;\n }\n\n const whole = parameters.find((parameter) => parameter.name === undefined);\n const named = parameters.filter((parameter) => parameter.name !== undefined);\n const namedEntries = named.map(\n (parameter) => `${JSON.stringify(parameter.name)}: ${parameter.parameterName}`,\n );\n\n if (whole === undefined) {\n return `{ ${namedEntries.join(', ')} }`;\n }\n\n if (named.length === 0) {\n return whole.parameterName;\n }\n\n return `{ ...${whole.parameterName}, ${namedEntries.join(', ')} }`;\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\nimport { mergeNamedParametersExpression } from './merge-named-parameters-expression';\n\nexport const generateBodyExpression = (parameters: readonly ControllerParameterDefinition[]) =>\n mergeNamedParametersExpression(parameters.filter((parameter) => parameter.kind === 'body'));\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\n\nexport const generateHeadersExpression = (parameters: readonly ControllerParameterDefinition[]) => {\n const headerParameters = parameters.filter((parameter) => parameter.kind === 'header');\n\n if (headerParameters.length === 0) {\n return undefined;\n }\n\n const entries = headerParameters.map(\n (parameter) => `${JSON.stringify(parameter.name)}: ${parameter.parameterName}`,\n );\n\n return `{ ${entries.join(', ')} }`;\n};\n","import type { MessageKind } from '@nestbridge/core';\n\nexport const messageRuntimeFunctionOf = (kind: MessageKind) =>\n kind === 'event' ? 'emitMessage' : 'sendMessage';\n","import type { MessageHandlerDefinition } from '@nestbridge/core';\nimport { messageRuntimeFunctionOf } from './message-runtime-function';\n\nconst PAYLOAD_PARAMETER = 'payload';\n\nconst EMPTY_PAYLOAD = '{}';\n\nexport const generateMessageMethod = (handler: MessageHandlerDefinition, service: string) => {\n const hasPayload = handler.payloadParameterIndex !== null;\n const messageProperties = [\n `service: ${JSON.stringify(service)}`,\n `pattern: ${JSON.stringify(handler.pattern)}`,\n hasPayload ? PAYLOAD_PARAMETER : `payload: ${EMPTY_PAYLOAD}`,\n ];\n\n return [\n ` ${handler.name}(${hasPayload ? PAYLOAD_PARAMETER : ''}) {`,\n ` return ${messageRuntimeFunctionOf(handler.kind)}({`,\n ...messageProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\n\nexport const generateParameterList = (parameters: readonly ControllerParameterDefinition[]) =>\n [...parameters]\n .sort((a, b) => a.index - b.index)\n .map((parameter) => parameter.parameterName)\n .join(', ');\n","import type { ControllerMethodDefinition } from '@nestbridge/core';\n\nconst PARAM_TOKEN_PATTERN = /:([A-Za-z0-9_]+)/;\nconst IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;\n\nconst generatePropertyAccess = (objectName: string, propertyName: string) =>\n IDENTIFIER_PATTERN.test(propertyName)\n ? `${objectName}.${propertyName}`\n : `${objectName}[${JSON.stringify(propertyName)}]`;\n\nexport const generatePathExpression = (method: ControllerMethodDefinition) => {\n const paramParameters = method.parameters.filter((parameter) => parameter.kind === 'param');\n const wholeParameter = paramParameters.find((parameter) => parameter.name === undefined);\n const parts = method.path.split(PARAM_TOKEN_PATTERN);\n const expressionParts: string[] = [];\n\n const generateTokenExpression = (token: string) => {\n const namedParameter = paramParameters.find((parameter) => parameter.name === token);\n\n if (namedParameter !== undefined) {\n return `encodeURIComponent(${namedParameter.parameterName})`;\n }\n\n if (wholeParameter !== undefined) {\n return `encodeURIComponent(${generatePropertyAccess(wholeParameter.parameterName, token)})`;\n }\n\n return JSON.stringify(`:${token}`);\n };\n\n parts.forEach((part, index) => {\n const isParamToken = index % 2 === 1;\n\n if (isParamToken) {\n expressionParts.push(generateTokenExpression(part));\n return;\n }\n\n if (part.length > 0) {\n expressionParts.push(JSON.stringify(part));\n }\n });\n\n return expressionParts.length > 0 ? expressionParts.join(' + ') : \"''\";\n};\n","import type { ControllerParameterDefinition } from '@nestbridge/core';\nimport { mergeNamedParametersExpression } from './merge-named-parameters-expression';\n\nexport const generateQueryExpression = (parameters: readonly ControllerParameterDefinition[]) =>\n mergeNamedParametersExpression(parameters.filter((parameter) => parameter.kind === 'query'));\n","import type { ControllerDefinition, ControllerMethodDefinition } from '@nestbridge/core';\nimport { CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport { generateBodyExpression } from './generate-body-expression';\nimport { generateHeadersExpression } from './generate-headers-expression';\nimport { generateMessageMethod } from './generate-message-method';\nimport { generateParameterList } from './generate-parameter-list';\nimport { generatePathExpression } from './generate-path-expression';\nimport { generateQueryExpression } from './generate-query-expression';\nimport { messageRuntimeFunctionOf } from './message-runtime-function';\n\nconst generateMethod = (method: ControllerMethodDefinition, service: string | undefined) => {\n const requestProperties = [\n `method: ${JSON.stringify(method.httpMethod)}`,\n `path: ${generatePathExpression(method)}`,\n ];\n\n if (service !== undefined) {\n requestProperties.push(`service: ${JSON.stringify(service)}`);\n }\n\n const queryExpression = generateQueryExpression(method.parameters);\n if (queryExpression !== undefined) {\n requestProperties.push(`query: ${queryExpression}`);\n }\n\n const bodyExpression = generateBodyExpression(method.parameters);\n if (bodyExpression !== undefined) {\n requestProperties.push(`body: ${bodyExpression}`);\n }\n\n const headersExpression = generateHeadersExpression(method.parameters);\n if (headersExpression !== undefined) {\n requestProperties.push(`headers: ${headersExpression}`);\n }\n\n if (method.responseKind === 'stream') {\n requestProperties.push(`responseType: \"blob\"`);\n }\n\n return [\n ` ${method.name}(${generateParameterList(method.parameters)}) {`,\n ' return request({',\n ...requestProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n\nconst generateMessageMethods = (controller: ControllerDefinition, service: string | undefined) => {\n if (controller.messageHandlers.length === 0) {\n return [];\n }\n\n if (service === undefined) {\n throw new Error(\n `[nestbridge] ${controller.name} has message handlers, but its app has no \\`name\\` to address the service by.`,\n );\n }\n\n return controller.messageHandlers.map((handler) => generateMessageMethod(handler, service));\n};\n\nexport const generateControllerModule = (controller: ControllerDefinition, service?: string) => {\n const methods = [\n ...controller.methods.map((method) => generateMethod(method, service)),\n ...generateMessageMethods(controller, service),\n ].join('\\n\\n');\n const messageRuntimeFunctions = Array.from(\n new Set(controller.messageHandlers.map((handler) => messageRuntimeFunctionOf(handler.kind))),\n ).sort();\n\n return [\n `import '${CONFIG_VIRTUAL_MODULE_ID}';`,\n \"import { request } from 'nestbridge';\",\n ...(messageRuntimeFunctions.length > 0\n ? [`import { ${messageRuntimeFunctions.join(', ')} } from 'nestbridge/microservices';`]\n : []),\n '',\n `export class ${controller.name} {`,\n ' constructor() {}',\n '',\n methods,\n '}',\n '',\n ].join('\\n');\n};\n","import type { ResolverMethodDefinition, SelectionField } from '@nestbridge/core';\n\nconst capitalize = (value: string) => `${value.charAt(0).toUpperCase()}${value.slice(1)}`;\n\nconst renderSelectionSet = (fields: readonly SelectionField[]): string => {\n const rendered = fields.map((field) =>\n field.children === undefined\n ? field.name\n : `${field.name} ${renderSelectionSet(field.children)}`,\n );\n\n return `{ ${rendered.join(' ')} }`;\n};\n\nexport const generateGraphqlDocument = (method: ResolverMethodDefinition) => {\n const variableDeclarations = method.arguments\n .map((argument) => `$${argument.name}: ${argument.graphqlType}`)\n .join(', ');\n const fieldArguments = method.arguments\n .map((argument) => `${argument.name}: $${argument.name}`)\n .join(', ');\n\n const variablesClause = variableDeclarations.length > 0 ? `(${variableDeclarations})` : '';\n const fieldArgumentsClause = fieldArguments.length > 0 ? `(${fieldArguments})` : '';\n const fieldSelection =\n method.selection.length > 0 ? ` ${renderSelectionSet(method.selection)}` : '';\n\n return `${method.operationKind} ${capitalize(method.name)}${variablesClause} { ${method.operationName}${fieldArgumentsClause}${fieldSelection} }`;\n};\n","import type { ResolverArgumentDefinition } from '@nestbridge/core';\n\nexport const generateResolverArgumentList = (\n resolverArguments: readonly ResolverArgumentDefinition[],\n) =>\n [...resolverArguments]\n .sort((a, b) => a.index - b.index)\n .map((argument) => argument.parameterName)\n .join(', ');\n","import type {\n ResolverArgumentDefinition,\n ResolverDefinition,\n ResolverMethodDefinition,\n} from '@nestbridge/core';\nimport { CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport { generateGraphqlDocument } from './generate-graphql-document';\nimport { generateResolverArgumentList } from './generate-resolver-argument-list';\n\nconst generateVariablesExpression = (resolverArguments: readonly ResolverArgumentDefinition[]) => {\n if (resolverArguments.length === 0) {\n return undefined;\n }\n\n const entries = resolverArguments.map(\n (argument) => `${JSON.stringify(argument.name)}: ${argument.parameterName}`,\n );\n\n return `{ ${entries.join(', ')} }`;\n};\n\nconst generateMethod = (method: ResolverMethodDefinition, service: string | undefined) => {\n const requestProperties = [\n `document: ${JSON.stringify(generateGraphqlDocument(method))}`,\n `field: ${JSON.stringify(method.operationName)}`,\n ];\n\n if (service !== undefined) {\n requestProperties.push(`service: ${JSON.stringify(service)}`);\n }\n\n const variablesExpression = generateVariablesExpression(method.arguments);\n if (variablesExpression !== undefined) {\n requestProperties.push(`variables: ${variablesExpression}`);\n }\n\n return [\n ` ${method.name}(${generateResolverArgumentList(method.arguments)}) {`,\n ' return graphqlRequest({',\n ...requestProperties.map((property) => ` ${property},`),\n ' });',\n ' }',\n ].join('\\n');\n};\n\nexport const generateResolverModule = (resolver: ResolverDefinition, service?: string) => {\n const methods = resolver.methods.map((method) => generateMethod(method, service)).join('\\n\\n');\n\n return [\n `import '${CONFIG_VIRTUAL_MODULE_ID}';`,\n \"import { graphqlRequest } from 'nestbridge';\",\n '',\n `export class ${resolver.name} {`,\n ' constructor() {}',\n '',\n methods,\n '}',\n '',\n ].join('\\n');\n};\n","import type { NestBridgeLogLevel } from './nestbridge-log-level';\n\nexport const LOG_LEVEL_RANKS: Record<NestBridgeLogLevel, number> = {\n silent: 0,\n error: 1,\n warn: 2,\n info: 3,\n};\n","import type { GlobalPrefix } from '@nestbridge/core';\nimport type { NestBridgeOptions } from './nestbridge-options';\n\nexport const resolveGlobalPrefixOption = (\n option: NestBridgeOptions['globalPrefix'],\n): GlobalPrefix | false | undefined => {\n if (option === undefined || option === false) {\n return option;\n }\n\n if (typeof option === 'string') {\n return { prefix: option, exclude: [] };\n }\n\n return {\n prefix: option.prefix,\n exclude: (option.exclude ?? []).map((entry) =>\n typeof entry === 'string' ? { path: entry } : entry,\n ),\n };\n};\n","import type { UriVersioning } from '@nestbridge/core';\nimport type { NestBridgeOptions } from './nestbridge-options';\n\nconst DEFAULT_VERSION_PREFIX = 'v';\n\nexport const resolveVersioningOption = (\n option: NestBridgeOptions['versioning'],\n): UriVersioning | false | undefined => {\n if (option === undefined || option === false) {\n return option;\n }\n\n return {\n prefix: option.prefix ?? DEFAULT_VERSION_PREFIX,\n defaultVersion: option.defaultVersion,\n };\n};\n","import type { NestBridgeOptions } from './nestbridge-options';\nimport { resolveGlobalPrefixOption } from './resolve-global-prefix-option';\nimport { resolveVersioningOption } from './resolve-versioning-option';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\n\nconst toArray = (value: string | string[] | undefined) => {\n if (value === undefined) {\n return [];\n }\n\n return Array.isArray(value) ? value : [value];\n};\n\nexport const resolveNestBridgeEntry = (options: NestBridgeOptions): ResolvedNestBridgeOptions => ({\n name: options.name,\n controllers: toArray(options.controllers),\n resolvers: toArray(options.resolvers),\n messagePatterns: options.messagePatterns ?? false,\n baseURL: options.baseURL,\n bootstrap: options.bootstrap,\n globalPrefix: resolveGlobalPrefixOption(options.globalPrefix),\n versioning: resolveVersioningOption(options.versioning),\n debug: options.debug ?? false,\n logLevel: options.logLevel,\n outputDir: options.outputDir,\n root: options.root,\n});\n","import { LOG_LEVEL_RANKS } from './log-level-ranks';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\n\nconst NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;\n\nexport const validateNestBridgeEntries = (entries: readonly ResolvedNestBridgeOptions[]): void => {\n if (entries.length === 0) {\n throw new Error('[nestbridge] Pass at least one app to the plugin options.');\n }\n\n const seenNames = new Set<string>();\n\n entries.forEach((entry, index) => {\n if (entry.logLevel !== undefined && !Object.hasOwn(LOG_LEVEL_RANKS, entry.logLevel)) {\n throw new Error(\n `[nestbridge] Invalid logLevel \"${entry.logLevel}\". Use one of: ${Object.keys(LOG_LEVEL_RANKS).join(', ')}.`,\n );\n }\n\n if (entry.messagePatterns && entry.name === undefined) {\n throw new Error(\n `[nestbridge] App #${index + 1} sets \\`messagePatterns\\` and needs a \\`name\\`, the service its message client is looked up by.`,\n );\n }\n\n if (entry.name === undefined) {\n if (entries.length > 1) {\n throw new Error(\n `[nestbridge] App #${index + 1} needs a \\`name\\` because several apps are configured.`,\n );\n }\n\n return;\n }\n\n if (!NAME_PATTERN.test(entry.name)) {\n throw new Error(\n `[nestbridge] Invalid app name \"${entry.name}\". Start with a letter and use only letters, digits, \"-\" and \"_\".`,\n );\n }\n\n if (seenNames.has(entry.name)) {\n throw new Error(\n `[nestbridge] Duplicate app name \"${entry.name}\". Each app needs its own name.`,\n );\n }\n\n seenNames.add(entry.name);\n });\n};\n","import type { NestBridgePluginOptions } from './nestbridge-plugin-options';\nimport { resolveNestBridgeEntry } from './resolve-nestbridge-entry';\nimport type { ResolvedNestBridgeOptions } from './resolved-nestbridge-options';\nimport { validateNestBridgeEntries } from './validate-nestbridge-entries';\n\nexport const resolveNestBridgeOptions = (\n options: NestBridgePluginOptions,\n): ResolvedNestBridgeOptions[] => {\n const entries = (Array.isArray(options) ? options : [options]).map(resolveNestBridgeEntry);\n\n validateNestBridgeEntries(entries);\n\n return entries;\n};\n","import type { BundlerLogger } from './bundler-logger';\n\nexport const consoleLogger: BundlerLogger = {\n info: (message) => console.log(message),\n warn: (message) => console.warn(message),\n};\n","import { LOG_LEVEL_RANKS, type NestBridgeLogLevel } from '../options';\nimport type { BundlerLogger } from './bundler-logger';\n\nexport const createLevelLogger = (level: NestBridgeLogLevel | undefined, logger: BundlerLogger) => {\n const rank = LOG_LEVEL_RANKS[level ?? 'info'];\n\n return {\n info: (message) => {\n if (rank >= LOG_LEVEL_RANKS.info) {\n logger.info(message);\n }\n },\n warn: (message) => {\n if (rank >= LOG_LEVEL_RANKS.warn) {\n logger.warn(message);\n }\n },\n } satisfies BundlerLogger;\n};\n","import type { NestBridgeApp } from './nestbridge-app';\n\nconst describeOwner = (app: NestBridgeApp) =>\n app.options.name === undefined ? 'the app' : `\"${app.options.name}\"`;\n\nexport const findOverlappingFiles = (apps: readonly NestBridgeApp[]) => {\n const ownersByFile = new Map<string, NestBridgeApp[]>();\n\n for (const app of apps) {\n for (const filePath of app.ownedFiles()) {\n ownersByFile.set(filePath, [...(ownersByFile.get(filePath) ?? []), app]);\n }\n }\n\n return [...ownersByFile.entries()]\n .filter(([, owners]) => owners.length > 1)\n .map(\n ([filePath, owners]) =>\n `${filePath} is matched by several apps (${owners.map(describeOwner).join(', ')}). ` +\n 'Narrow their controllers and resolvers globs so each file belongs to one app.',\n );\n};\n","import { LOG_LEVEL_RANKS, type NestBridgeLogLevel } from '../options';\n\nexport const mostVerboseLogLevel = (levels: readonly (NestBridgeLogLevel | undefined)[]) =>\n levels.reduce<NestBridgeLogLevel | undefined>((mostVerbose, level) => {\n if (mostVerbose === undefined || level === undefined) {\n return undefined;\n }\n\n return LOG_LEVEL_RANKS[level] > LOG_LEVEL_RANKS[mostVerbose] ? level : mostVerbose;\n }, 'silent');\n","import { join, relative } from 'node:path';\n\nconst stripLeadingParentSegments = (relativePath: string) => {\n const segments = relativePath.split(/[\\\\/]/);\n const firstOwnedIndex = segments.findIndex((segment) => segment !== '..');\n return segments.slice(firstOwnedIndex === -1 ? segments.length : firstOwnedIndex).join('/');\n};\n\nexport const mirroredPath = (sourceRoot: string, resolvedOutputDir: string, sourcePath: string) =>\n join(resolvedOutputDir, stripLeadingParentSegments(relative(sourceRoot, sourcePath)));\n","import { mirroredPath } from './mirrored-path';\n\nexport const mirroredDeclarationPath = (\n sourceRoot: string,\n resolvedOutputDir: string,\n controllerFilePath: string,\n) => mirroredPath(sourceRoot, resolvedOutputDir, controllerFilePath).replace(/\\.ts$/, '.d.ts');\n","import {\n closeSync,\n existsSync,\n openSync,\n readFileSync,\n renameSync,\n rmSync,\n statSync,\n writeFileSync,\n} from 'node:fs';\n\nexport const LOCK_FILE_SUFFIX = '.lock';\n\nconst DEFAULT_LOCK_TIMEOUT_MS = 5_000;\nconst DEFAULT_STALE_LOCK_MS = 10_000;\nconst LOCK_RETRY_INTERVAL_MS = 10;\n\nexport interface WriteFileLockedOptions {\n timeoutMs?: number;\n staleAfterMs?: number;\n}\n\nconst sleep = (milliseconds: number) => {\n Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, milliseconds);\n};\n\nconst isErrnoException = (error: unknown): error is NodeJS.ErrnoException =>\n error instanceof Error && 'code' in error;\n\nconst isStale = (lockPath: string, staleAfterMs: number) => {\n try {\n return Date.now() - statSync(lockPath).mtimeMs > staleAfterMs;\n } catch (error) {\n if (isErrnoException(error) && error.code === 'ENOENT') {\n return true;\n }\n\n throw error;\n }\n};\n\nconst acquireLock = (lockPath: string, options: Required<WriteFileLockedOptions>) => {\n const deadline = Date.now() + options.timeoutMs;\n\n while (true) {\n try {\n const descriptor = openSync(lockPath, 'wx');\n\n return {\n [Symbol.dispose]: () => {\n closeSync(descriptor);\n rmSync(lockPath, { force: true });\n },\n };\n } catch (error) {\n if (!isErrnoException(error) || error.code !== 'EEXIST') {\n throw error;\n }\n }\n\n if (isStale(lockPath, options.staleAfterMs)) {\n rmSync(lockPath, { force: true });\n continue;\n }\n\n if (Date.now() >= deadline) {\n throw new Error(\n `[NestBridge] Timed out after ${options.timeoutMs}ms waiting for ${lockPath}. Delete it if no other NestBridge process is running.`,\n );\n }\n\n sleep(LOCK_RETRY_INTERVAL_MS);\n }\n};\n\nconst hasContent = (filePath: string, content: string) =>\n existsSync(filePath) && readFileSync(filePath, 'utf-8') === content;\n\nexport const writeFileLocked = (\n filePath: string,\n content: string,\n options: WriteFileLockedOptions = {},\n) => {\n if (hasContent(filePath, content)) {\n return;\n }\n\n const lockPath = `${filePath}${LOCK_FILE_SUFFIX}`;\n using _lock = acquireLock(lockPath, {\n timeoutMs: options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS,\n staleAfterMs: options.staleAfterMs ?? DEFAULT_STALE_LOCK_MS,\n });\n\n if (hasContent(filePath, content)) {\n return;\n }\n\n const temporaryPath = `${filePath}.${process.pid}.tmp`;\n\n try {\n writeFileSync(temporaryPath, content, 'utf-8');\n renameSync(temporaryPath, filePath);\n } finally {\n rmSync(temporaryPath, { force: true });\n }\n};\n","import { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { type ControllerDefinition, generateControllerDeclaration } from '@nestbridge/core';\nimport { mirroredDeclarationPath } from './mirror-declaration-path';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const writeControllerDeclarations = (\n controllers: readonly ControllerDefinition[],\n sourceRoot: string,\n resolvedOutputDir: string,\n) => {\n for (const controller of controllers) {\n const outputFilePath = mirroredDeclarationPath(\n sourceRoot,\n resolvedOutputDir,\n controller.sourceFile,\n );\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(outputFilePath, generateControllerDeclaration(controller, outputFilePath));\n }\n};\n","import { mkdirSync, rmSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { type ErrorResponseShapeDetection, generateErrorBodyDeclaration } from '@nestbridge/core';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const ERROR_BODY_DECLARATION_FILE_NAME = 'error-body.d.ts';\n\nexport const errorBodyDeclarationPath = (resolvedOutputDir: string) =>\n join(resolvedOutputDir, ERROR_BODY_DECLARATION_FILE_NAME);\n\nexport const writeErrorBodyDeclaration = (\n resolvedOutputDir: string,\n errorResponseShape?: ErrorResponseShapeDetection,\n) => {\n const outputFilePath = errorBodyDeclarationPath(resolvedOutputDir);\n\n if (errorResponseShape === undefined) {\n rmSync(outputFilePath, { force: true });\n return;\n }\n\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(\n outputFilePath,\n generateErrorBodyDeclaration(errorResponseShape.errorBodyTypeSource),\n );\n};\n","import { mkdirSync } from 'node:fs';\nimport { dirname } from 'node:path';\nimport { generateControllerDeclaration, type ResolverDefinition } from '@nestbridge/core';\nimport { mirroredDeclarationPath } from './mirror-declaration-path';\nimport { writeFileLocked } from './write-file-locked';\n\nexport const writeResolverDeclarations = (\n resolvers: readonly ResolverDefinition[],\n sourceRoot: string,\n resolvedOutputDir: string,\n) => {\n for (const resolver of resolvers) {\n const outputFilePath = mirroredDeclarationPath(\n sourceRoot,\n resolvedOutputDir,\n resolver.sourceFile,\n );\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileLocked(outputFilePath, generateControllerDeclaration(resolver, outputFilePath));\n }\n};\n","import { globSync } from 'node:fs';\nimport { resolve } from 'node:path';\n\nexport const discoverFiles = (\n patterns: readonly string[],\n root: string,\n exclude?: (filePath: string) => boolean,\n) => {\n const matches = globSync([...patterns], { cwd: root, exclude });\n return [...new Set(matches.map((match) => resolve(root, match)))].sort();\n};\n","import { resolve, sep } from 'node:path';\nimport { discoverFiles } from './discover-files';\n\nconst BOOTSTRAP_FILE_PATTERN = '**/main.ts';\n\nexport const discoverBootstrapFile = (root: string, resolvedOutputDir: string) => {\n const isExcluded = (filePath: string) => {\n if (filePath.split(/[\\\\/]/).includes('node_modules')) {\n return true;\n }\n\n const resolvedPath = resolve(root, filePath);\n return (\n resolvedPath === resolvedOutputDir || resolvedPath.startsWith(`${resolvedOutputDir}${sep}`)\n );\n };\n\n const matches = discoverFiles([BOOTSTRAP_FILE_PATTERN], root, isExcluded);\n\n return matches.length === 1 ? matches[0] : undefined;\n};\n","import { resolve } from 'node:path';\nimport { discoverBootstrapFile } from './discover-bootstrap-file';\n\nexport const resolveBootstrapFile = (\n root: string,\n resolvedOutputDir: string,\n bootstrap: string | undefined,\n): string | undefined =>\n bootstrap === undefined\n ? discoverBootstrapFile(root, resolvedOutputDir)\n : resolve(root, bootstrap);\n","import { posix } from 'node:path';\n\nconst isWindows = process.platform === 'win32';\n\nexport const normalizePath = (filePath: string) =>\n posix.normalize(isWindows ? filePath.replaceAll('\\\\', '/') : filePath);\n","import {\n type ApplicationRouting,\n analyzeControllers,\n applyApplicationRouting,\n type ControllerAnalysisOptions,\n type ControllerDefinition,\n type NestBridgeDiagnostic,\n} from '@nestbridge/core';\nimport { discoverFiles } from '../discovery';\nimport { normalizePath } from './normalize-path';\n\nexport interface ControllerRegistryRefreshResult {\n controllers: ControllerDefinition[];\n diagnostics: NestBridgeDiagnostic[];\n interceptorFiles: string[];\n}\n\nexport interface ControllerRegistry {\n refresh: (\n routing?: ApplicationRouting,\n bootstrapFilePath?: string,\n ) => ControllerRegistryRefreshResult;\n get: (filePath: string) => ControllerDefinition | undefined;\n has: (filePath: string) => boolean;\n all: () => ControllerDefinition[];\n}\n\nexport const createControllerRegistry = (\n patterns: readonly string[],\n root: string,\n analysisOptions: ControllerAnalysisOptions,\n): ControllerRegistry => {\n const controllersByFile = new Map<string, ControllerDefinition>();\n\n const refresh = (routing: ApplicationRouting = {}, bootstrapFilePath?: string) => {\n controllersByFile.clear();\n\n const files = discoverFiles(patterns, root);\n const {\n controllers: analyzed,\n diagnostics,\n interceptorFiles,\n } = analyzeControllers(files, { ...analysisOptions, bootstrapFilePath });\n const controllers = applyApplicationRouting(analyzed, routing);\n\n for (const controller of controllers) {\n controllersByFile.set(normalizePath(controller.sourceFile), controller);\n }\n\n return { controllers, diagnostics, interceptorFiles };\n };\n\n return {\n refresh,\n get: (filePath) => controllersByFile.get(filePath),\n has: (filePath) => controllersByFile.has(filePath),\n all: () => [...controllersByFile.values()],\n };\n};\n","import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nconst WORKSPACE_MARKER_FILES = ['nx.json', 'pnpm-workspace.yaml', 'turbo.json', 'lerna.json'];\n\nconst declaresWorkspaces = (directory: string) => {\n const manifestPath = join(directory, 'package.json');\n\n if (!existsSync(manifestPath)) {\n return false;\n }\n\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n\n return typeof manifest === 'object' && manifest !== null && 'workspaces' in manifest;\n};\n\nconst isWorkspaceRoot = (directory: string) =>\n WORKSPACE_MARKER_FILES.some((file) => existsSync(join(directory, file))) ||\n declaresWorkspaces(directory);\n\nexport const findWorkspaceRoot = (startDirectory: string) => {\n let directory = startDirectory;\n\n while (true) {\n if (isWorkspaceRoot(directory)) {\n return directory;\n }\n\n const parent = dirname(directory);\n\n if (parent === directory) {\n return undefined;\n }\n\n directory = parent;\n }\n};\n","import { existsSync, readFileSync } from 'node:fs';\nimport { join } from 'node:path';\n\nconst missingName = (root: string) =>\n new Error(\n `[NestBridge] ${join(root, 'package.json')} has no \"name\". NestBridge names a server's ` +\n 'declaration folder after its package: point `root` at the server package, or give it a name.',\n );\n\nexport const readPackageName = (root: string) => {\n const manifestPath = join(root, 'package.json');\n\n if (!existsSync(manifestPath)) {\n throw missingName(root);\n }\n\n const manifest: unknown = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n\n if (\n typeof manifest !== 'object' ||\n manifest === null ||\n !('name' in manifest) ||\n typeof manifest.name !== 'string' ||\n manifest.name === ''\n ) {\n throw missingName(root);\n }\n\n return manifest.name;\n};\n","import { join, resolve } from 'node:path';\nimport { findWorkspaceRoot } from '../discovery/find-workspace-root';\nimport { readPackageName } from '../discovery/read-package-name';\n\nexport const DEFAULT_OUTPUT_DIR = '.nestbridge';\n\ninterface OutputLocationInput {\n outputDir: string | undefined;\n root: string;\n bundlerRoot: string | undefined;\n}\n\nexport interface OutputLocation {\n outputDir: string;\n declarationDir: string;\n}\n\nconst resolveOutputDir = (input: OutputLocationInput) => {\n const projectRoot = input.bundlerRoot ?? input.root;\n\n if (input.outputDir !== undefined) {\n return resolve(projectRoot, input.outputDir);\n }\n\n return resolve(findWorkspaceRoot(projectRoot) ?? projectRoot, DEFAULT_OUTPUT_DIR);\n};\n\n/**\n * Every server gets one folder, named after the package at its `root`, so any number of clients of\n * that server share the same declarations.\n */\nexport const resolveOutputLocation = (input: OutputLocationInput): OutputLocation => {\n const outputDir = resolveOutputDir(input);\n\n return { outputDir, declarationDir: join(outputDir, readPackageName(input.root)) };\n};\n","import type { BootstrapDetection } from '@nestbridge/core';\n\nexport const resolveRoutingOption = <T>(\n explicit: T | false | undefined,\n bootstrapFile: string | undefined,\n detect: (bootstrapFilePath: string) => BootstrapDetection<T>,\n): BootstrapDetection<T> => {\n if (explicit === false) {\n return { value: undefined, diagnostics: [] };\n }\n\n if (explicit !== undefined) {\n return { value: explicit, diagnostics: [] };\n }\n\n return bootstrapFile === undefined\n ? { value: undefined, diagnostics: [] }\n : detect(bootstrapFile);\n};\n","import {\n analyzeResolvers,\n type NestBridgeDiagnostic,\n type ResolverDefinition,\n} from '@nestbridge/core';\nimport { discoverFiles } from '../discovery';\nimport { normalizePath } from './normalize-path';\n\nexport interface ResolverRegistryRefreshResult {\n resolvers: ResolverDefinition[];\n diagnostics: NestBridgeDiagnostic[];\n}\n\nexport interface ResolverRegistry {\n refresh: () => ResolverRegistryRefreshResult;\n get: (filePath: string) => ResolverDefinition | undefined;\n has: (filePath: string) => boolean;\n all: () => ResolverDefinition[];\n}\n\nexport const createResolverRegistry = (\n patterns: readonly string[],\n root: string,\n): ResolverRegistry => {\n const resolversByFile = new Map<string, ResolverDefinition>();\n\n const refresh = () => {\n resolversByFile.clear();\n\n const files = discoverFiles(patterns, root);\n const { resolvers, diagnostics } = analyzeResolvers(files);\n\n for (const resolver of resolvers) {\n resolversByFile.set(normalizePath(resolver.sourceFile), resolver);\n }\n\n return { resolvers, diagnostics };\n };\n\n return {\n refresh,\n get: (filePath) => resolversByFile.get(filePath),\n has: (filePath) => resolversByFile.has(filePath),\n all: () => [...resolversByFile.values()],\n };\n};\n","import { existsSync } from 'node:fs';\nimport { resolve } from 'node:path';\nimport {\n type ApplicationRouting,\n detectErrorResponseShape,\n detectGlobalPrefix,\n detectVersioning,\n} from '@nestbridge/core';\nimport { generateControllerModule, generateResolverModule } from '../codegen';\nimport {\n writeControllerDeclarations,\n writeErrorBodyDeclaration,\n writeResolverDeclarations,\n} from '../declarations';\nimport { discoverFiles, resolveBootstrapFile } from '../discovery';\nimport type { ResolvedNestBridgeOptions } from '../options';\nimport { createControllerRegistry } from './controller-registry';\nimport type { NestBridgeAppAnalysis } from './nestbridge-app-analysis';\nimport type { NestBridgeAppLocation } from './nestbridge-app-location';\nimport { normalizePath } from './normalize-path';\nimport { resolveOutputLocation } from './resolve-output-location';\nimport { resolveRoutingOption } from './resolve-routing-option';\nimport { createResolverRegistry } from './resolver-registry';\n\nexport interface NestBridgeApp {\n options: ResolvedNestBridgeOptions;\n analyze: () => NestBridgeAppAnalysis;\n transform: (filePath: string) => string | undefined;\n ownedFiles: () => string[];\n supportFiles: () => string[];\n isAffectedBy: (changedFile: string) => boolean;\n}\n\nexport const createNestBridgeApp = (\n options: ResolvedNestBridgeOptions,\n location: NestBridgeAppLocation,\n): NestBridgeApp => {\n const root =\n options.root === undefined ? location.baseRoot : resolve(location.baseRoot, options.root);\n const output = resolveOutputLocation({\n outputDir: options.outputDir,\n root,\n bundlerRoot: location.bundlerRoot,\n });\n const controllerRegistry = createControllerRegistry(options.controllers, root, {\n messagePatterns: true,\n });\n const resolverRegistry = createResolverRegistry(options.resolvers, root);\n let bootstrapFilePath: string | undefined;\n let interceptorFiles: ReadonlySet<string> = new Set();\n\n const describeApp = () => (options.name === undefined ? 'the app' : `app \"${options.name}\"`);\n\n const locateBootstrapFile = (problems: string[]) => {\n const bootstrapFile = resolveBootstrapFile(root, output.outputDir, options.bootstrap);\n\n if (\n bootstrapFile !== undefined &&\n options.bootstrap !== undefined &&\n !existsSync(bootstrapFile)\n ) {\n problems.push(`Bootstrap file of ${describeApp()} not found: ${bootstrapFile}`);\n return undefined;\n }\n\n return bootstrapFile;\n };\n\n const matchesPatterns = (patterns: readonly string[], filePath: string) =>\n discoverFiles(patterns, root).map(normalizePath).includes(filePath);\n\n const isBootstrapFile = (filePath: string) => {\n const bootstrapFile = resolveBootstrapFile(root, output.outputDir, options.bootstrap);\n return bootstrapFile !== undefined && normalizePath(bootstrapFile) === filePath;\n };\n\n const analyze = (): NestBridgeAppAnalysis => {\n const problems: string[] = [];\n const bootstrapFile = locateBootstrapFile(problems);\n bootstrapFilePath = bootstrapFile === undefined ? undefined : normalizePath(bootstrapFile);\n\n const globalPrefix = resolveRoutingOption(\n options.globalPrefix,\n bootstrapFile,\n detectGlobalPrefix,\n );\n const versioning = resolveRoutingOption(options.versioning, bootstrapFile, detectVersioning);\n const routing: ApplicationRouting = {\n globalPrefix: globalPrefix.value,\n versioning: versioning.value,\n };\n const errorResponseShape =\n bootstrapFile === undefined ? undefined : detectErrorResponseShape(bootstrapFile);\n\n const {\n controllers,\n diagnostics: controllerDiagnostics,\n interceptorFiles: analyzedInterceptorFiles,\n } = controllerRegistry.refresh(routing, bootstrapFile);\n interceptorFiles = new Set(analyzedInterceptorFiles.map(normalizePath));\n const { resolvers, diagnostics: resolverDiagnostics } = resolverRegistry.refresh();\n const reportedControllerDiagnostics = options.messagePatterns\n ? controllerDiagnostics\n : controllerDiagnostics.filter(({ code }) => code !== 'unsupported-message-pattern');\n\n writeControllerDeclarations(controllers, root, output.declarationDir);\n writeResolverDeclarations(resolvers, root, output.declarationDir);\n writeErrorBodyDeclaration(output.declarationDir, errorResponseShape);\n\n return {\n controllerCount: controllers.length,\n resolverCount: resolvers.length,\n diagnostics: [\n ...globalPrefix.diagnostics,\n ...versioning.diagnostics,\n ...reportedControllerDiagnostics,\n ...resolverDiagnostics,\n ],\n problems,\n };\n };\n\n const transform = (filePath: string) => {\n const controller = controllerRegistry.get(filePath);\n if (controller !== undefined) {\n return generateControllerModule(\n options.messagePatterns ? controller : { ...controller, messageHandlers: [] },\n options.name,\n );\n }\n\n const resolver = resolverRegistry.get(filePath);\n if (resolver !== undefined) {\n return generateResolverModule(resolver, options.name);\n }\n\n return undefined;\n };\n\n const ownedFiles = () => [\n ...controllerRegistry.all().map((controller) => normalizePath(controller.sourceFile)),\n ...resolverRegistry.all().map((resolver) => normalizePath(resolver.sourceFile)),\n ];\n\n const supportFiles = () => [\n ...(bootstrapFilePath === undefined ? [] : [bootstrapFilePath]),\n ...interceptorFiles,\n ];\n\n const isAffectedBy = (changedFile: string) =>\n controllerRegistry.has(changedFile) ||\n resolverRegistry.has(changedFile) ||\n changedFile === bootstrapFilePath ||\n interceptorFiles.has(changedFile) ||\n matchesPatterns(options.controllers, changedFile) ||\n matchesPatterns(options.resolvers, changedFile) ||\n isBootstrapFile(changedFile);\n\n return { options, analyze, transform, ownedFiles, supportFiles, isAffectedBy };\n};\n","import type { BundlerLogger } from './bundler-logger';\n\nexport const reportMessages = (\n messages: readonly string[],\n watchMode: boolean | undefined,\n logger: Pick<BundlerLogger, 'warn'>,\n) => {\n for (const message of messages) {\n if (watchMode === false) {\n throw new Error(message);\n }\n\n logger.warn(message);\n }\n};\n","import { formatDiagnostic, type NestBridgeDiagnostic } from '@nestbridge/core';\nimport type { BundlerLogger } from './bundler-logger';\nimport { reportMessages } from './report-messages';\n\nexport const reportDiagnostics = (\n diagnostics: readonly NestBridgeDiagnostic[],\n watchMode: boolean | undefined,\n logger: Pick<BundlerLogger, 'warn'>,\n) => {\n reportMessages(diagnostics.map(formatDiagnostic), watchMode, logger);\n};\n","import {\n createUnplugin,\n type UnpluginBuildContext,\n type UnpluginInstance,\n type UnpluginOptions,\n} from 'unplugin';\nimport { generateConfigModule } from '../codegen';\nimport { type NestBridgePluginOptions, resolveNestBridgeOptions } from '../options';\nimport { CONFIG_VIRTUAL_MODULE_ID, RESOLVED_CONFIG_VIRTUAL_MODULE_ID } from '../virtual-modules';\nimport type { BundlerLogger } from './bundler-logger';\nimport { consoleLogger } from './console-logger';\nimport { createLevelLogger } from './create-level-logger';\nimport { findOverlappingFiles } from './find-overlapping-files';\nimport { mostVerboseLogLevel } from './most-verbose-log-level';\nimport { createNestBridgeApp, type NestBridgeApp } from './nestbridge-app';\nimport { normalizePath } from './normalize-path';\nimport { reportDiagnostics } from './report-diagnostics';\nimport { reportMessages } from './report-messages';\n\nexport const nestBridgeUnplugin: UnpluginInstance<NestBridgePluginOptions, false> = createUnplugin<\n NestBridgePluginOptions,\n false\n>((options, meta) => {\n const entries = resolveNestBridgeOptions(options);\n\n let baseRoot = process.cwd();\n let bundlerRoot: string | undefined;\n let apps: NestBridgeApp[] = [];\n let bundlerLogger: BundlerLogger = consoleLogger;\n let readBundlerWatchMode: (() => boolean) | undefined;\n\n const isWatchMode = () => meta.watchMode ?? readBundlerWatchMode?.();\n\n const loggerOf = (app: NestBridgeApp) => createLevelLogger(app.options.logLevel, bundlerLogger);\n\n const log = (app: NestBridgeApp, message: string) => {\n if (app.options.debug) {\n const prefix = app.options.name === undefined ? '' : `${app.options.name}: `;\n loggerOf(app).info(`[nestbridge] ${prefix}${message}`);\n }\n };\n\n const analyzeApps = (\n targets: readonly NestBridgeApp[],\n context: Pick<UnpluginBuildContext, 'addWatchFile'>,\n ) => {\n const watchMode = isWatchMode();\n\n for (const app of targets) {\n const { controllerCount, resolverCount, diagnostics, problems } = app.analyze();\n\n for (const supportFile of app.supportFiles()) {\n context.addWatchFile(supportFile);\n }\n\n reportMessages(\n problems.map((problem) => `[nestbridge] ${problem}`),\n watchMode,\n loggerOf(app),\n );\n reportDiagnostics(diagnostics, watchMode, loggerOf(app));\n log(\n app,\n `analyzed ${controllerCount} controller(s), ${resolverCount} resolver(s), ` +\n `${diagnostics.length} diagnostic(s)`,\n );\n }\n\n reportMessages(\n findOverlappingFiles(apps).map((problem) => `[nestbridge] ${problem}`),\n watchMode,\n createLevelLogger(\n mostVerboseLogLevel(apps.map((app) => app.options.logLevel)),\n bundlerLogger,\n ),\n );\n };\n\n return {\n name: 'nestbridge',\n enforce: 'pre',\n\n buildStart() {\n apps = entries.map((entry) => createNestBridgeApp(entry, { baseRoot, bundlerRoot }));\n analyzeApps(apps, this);\n },\n\n resolveId(source) {\n if (source === CONFIG_VIRTUAL_MODULE_ID) {\n return RESOLVED_CONFIG_VIRTUAL_MODULE_ID;\n }\n\n return null;\n },\n\n load(id) {\n if (id === RESOLVED_CONFIG_VIRTUAL_MODULE_ID) {\n return generateConfigModule(entries);\n }\n\n return null;\n },\n\n transform(_code, id) {\n const absolutePath = normalizePath(id);\n\n for (const app of apps) {\n const code = app.transform(absolutePath);\n\n if (code !== undefined) {\n return code;\n }\n }\n\n return null;\n },\n\n watchChange(id) {\n const changedFile = normalizePath(id);\n const affectedApps = apps.filter((app) => app.isAffectedBy(changedFile));\n\n if (affectedApps.length === 0) {\n return;\n }\n\n analyzeApps(affectedApps, this);\n\n for (const app of affectedApps) {\n log(app, `nestbridge source changed: ${changedFile}`);\n }\n },\n\n vite: {\n configResolved(config) {\n baseRoot = config.root;\n bundlerRoot = config.root;\n bundlerLogger = config.logger;\n\n const watching = config.command === 'serve' || Boolean(config.build.watch);\n readBundlerWatchMode = () => watching;\n },\n },\n\n webpack(compiler) {\n bundlerRoot = compiler.options.context ?? bundlerRoot;\n bundlerLogger = compiler.getInfrastructureLogger('nestbridge');\n readBundlerWatchMode = () => compiler.watchMode;\n },\n } satisfies UnpluginOptions;\n});\n","{\n \"name\": \"@nestbridge/unplugin\",\n \"version\": \"3.0.0\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/MDReal32/nestbridge.git\",\n \"directory\": \"packages/unplugin\"\n },\n \"main\": \"./build/nestbridge.unplugin.js\",\n \"types\": \"./build/nestbridge.unplugin.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./build/nestbridge.unplugin.d.ts\",\n \"import\": \"./build/nestbridge.unplugin.js\"\n }\n },\n \"files\": [\n \"build\"\n ],\n \"scripts\": {\n \"build\": \"vite build\",\n \"test\": \"vitest run\",\n \"typecheck\": \"tsc -p tsconfig.json --noEmit\",\n \"lint\": \"biome check .\"\n },\n \"dependencies\": {\n \"@nestbridge/core\": \"workspace:*\",\n \"unplugin\": \"^3.3.0\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^26.4.1\",\n \"rolldown-plugin-dts\": \"^0.28.5\",\n \"typescript\": \"^7.0.2\",\n \"vite\": \"^8.2.2\",\n \"vitest\": \"^5.0.0\"\n }\n}\n","import { version } from '../package.json';\n\nexport const VERSION: string = version;\n"],"mappings":";;;;;AAEA,IAAM,4BAA4B,UAAqC;CACrE,IAAI,MAAM,YAAY,KAAA,GACpB;CAGF,IAAI,MAAM,SAAS,KAAA,GACjB,OAAO,wBAAwB,KAAK,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26,7 +26,7 @@
|
|
|
26
26
|
"lint": "biome check ."
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@nestbridge/core": "
|
|
29
|
+
"@nestbridge/core": "3.0.0",
|
|
30
30
|
"unplugin": "^3.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|