@nestbridge/webpack 2.1.2 → 2.1.4

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @nestbridge/webpack
2
2
 
3
+ ## 2.1.4
4
+
5
+ ### Patch Changes
6
+
7
+ - @nestbridge/unplugin@2.1.4
8
+
9
+ ## 2.1.3
10
+
11
+ ### Patch Changes
12
+
13
+ - cec7886: Fix `Cannot find module '.../typescript/unstable/ast'` when loading `@nestbridge/vite` or `@nestbridge/webpack` in a project that has its own `typescript` (for example 6.x) installed. Each package previously bundled a private copy of its internal `@nestbridge/*` dependencies, so core's `typescript@7` import was resolved against the host project's `typescript` instead of the one core declares. Internal packages are now external, so imports resolve through the declared dependency chain and the bundles shrink accordingly.
14
+ - Updated dependencies [cec7886]
15
+ - @nestbridge/unplugin@2.1.3
16
+
3
17
  ## 2.1.2
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -19,9 +19,14 @@ and declaration writing behave identically across both bundlers.
19
19
 
20
20
  ```bash
21
21
  yarn add -D @nestbridge/webpack
22
- yarn add @nestbridge/runtime
22
+ yarn add nestbridge
23
23
  ```
24
24
 
25
+ The generated client modules and declarations import from `nestbridge`, so it
26
+ has to be a direct dependency of your app. If you would rather have one
27
+ dependency, `yarn add nestbridge` alone is enough: import the plugin from
28
+ `nestbridge/webpack` (its default export) instead of `@nestbridge/webpack`.
29
+
25
30
  ## Setup
26
31
 
27
32
  ```js
@@ -56,7 +61,6 @@ files so the plugin can intercept them. A matching `paths` entry in
56
61
  ```json
57
62
  {
58
63
  "compilerOptions": {
59
- "baseUrl": ".",
60
64
  "paths": {
61
65
  "@server/*": ["./.nestbridge/server/src/*"]
62
66
  }
@@ -64,6 +68,9 @@ files so the plugin can intercept them. A matching `paths` entry in
64
68
  }
65
69
  ```
66
70
 
71
+ `paths` entries resolve relative to the `tsconfig.json` that declares them, so
72
+ no `baseUrl` is needed (TypeScript 7 removed that option).
73
+
67
74
  Add `.nestbridge/` (or your configured `outputDir`) to `.gitignore` — it's
68
75
  regenerated on every build and on every dev-server start.
69
76
 
@@ -78,16 +85,18 @@ directory your `controllers`/`resolvers` globs are relative to.
78
85
  interface NestBridgeOptions {
79
86
  controllers: string | string[]; // glob(s), resolved relative to `root`
80
87
  resolvers?: string | string[]; // glob(s) for GraphQL resolvers; defaults to none
81
- baseURL?: string; // informational; call configureNestBridge for the runtime effect
82
- debug?: boolean; // logs discovery/analysis/HMR activity
83
- outputDir?: string; // defaults to ".nestbridge"
88
+ baseURL?: string; // prefix for REST requests and the default GraphQL endpoint; applied to the runtime automatically
89
+ debug?: boolean; // logs discovery/analysis/watch activity
90
+ outputDir?: string; // defaults to ".nestbridge", resolved from webpack's `context` — independent of `root`
84
91
  root?: string; // defaults to process.cwd()
85
92
  }
86
93
  ```
87
94
 
88
- Don't forget to call `configureNestBridge` from `@nestbridge/runtime` — this
89
- option only affects generated path text, not the runtime `fetch()`/GraphQL
90
- config (`baseURL`/`graphqlEndpoint`).
95
+ `baseURL` needs no extra runtime code: the plugin generates a module that
96
+ calls `setNestBridgeBaseURL(baseURL)` from `nestbridge`, and every generated
97
+ controller and resolver module imports it. Use `configureNestBridge` from
98
+ `nestbridge` only for headers, a custom `fetch`, or an explicit
99
+ `graphqlEndpoint`.
91
100
 
92
101
  ## License
93
102
 
@@ -1,19 +1,10 @@
1
+ import { NestBridgeOptions, NestBridgeOptions as NestBridgeOptions$1 } from "@nestbridge/unplugin";
1
2
  import { WebpackPluginInstance } from "webpack";
2
- //#region ../unplugin/src/options/nestbridge-options.d.ts
3
- interface NestBridgeOptions {
4
- controllers: string | string[];
5
- resolvers?: string | string[];
6
- baseURL?: string;
7
- debug?: boolean;
8
- outputDir?: string;
9
- root?: string;
10
- }
11
- //#endregion
12
3
  //#region src/version.d.ts
13
4
  export declare const VERSION: string;
14
5
  //#endregion
15
6
  //#region src/main.d.ts
16
- export declare const nestBridge: (options: NestBridgeOptions) => WebpackPluginInstance;
7
+ export declare const nestBridge: (options: NestBridgeOptions$1) => WebpackPluginInstance;
17
8
  //#endregion
18
9
  export type { NestBridgeOptions };
19
10
  //# sourceMappingURL=nestbridge.webpack.d.ts.map