@nestbridge/vite 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/vite
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
@@ -18,9 +18,14 @@ This plugin is a thin `vite` binding around the bundler-agnostic
18
18
 
19
19
  ```bash
20
20
  yarn add -D @nestbridge/vite
21
- yarn add @nestbridge/runtime
21
+ yarn add nestbridge
22
22
  ```
23
23
 
24
+ The generated client modules and declarations import from `nestbridge`, so it
25
+ has to be a direct dependency of your app. If you would rather have one
26
+ dependency, `yarn add nestbridge` alone is enough: import the plugin from
27
+ `nestbridge/vite` (its default export) instead of `@nestbridge/vite`.
28
+
24
29
  ## Setup
25
30
 
26
31
  ```ts
@@ -53,7 +58,6 @@ files so the plugin can intercept them. A matching `paths` entry in
53
58
  ```json
54
59
  {
55
60
  "compilerOptions": {
56
- "baseUrl": ".",
57
61
  "paths": {
58
62
  "@server/*": ["./.nestbridge/server/src/*"]
59
63
  }
@@ -61,6 +65,9 @@ files so the plugin can intercept them. A matching `paths` entry in
61
65
  }
62
66
  ```
63
67
 
68
+ `paths` entries resolve relative to the `tsconfig.json` that declares them, so
69
+ no `baseUrl` is needed (TypeScript 7 removed that option).
70
+
64
71
  Add `.nestbridge/` (or your configured `outputDir`) to `.gitignore` — it's
65
72
  regenerated on every build and on every dev-server start.
66
73
 
@@ -68,11 +75,12 @@ regenerated on every build and on every dev-server start.
68
75
 
69
76
  ```ts
70
77
  interface NestBridgeOptions {
71
- controllers: string | string[]; // glob(s), resolved relative to the Vite root
78
+ controllers: string | string[]; // glob(s), resolved relative to `root`
72
79
  resolvers?: string | string[]; // glob(s) for GraphQL resolvers; defaults to none
73
- baseURL?: string; // informational; call configureNestBridge for the runtime effect
74
- debug?: boolean; // logs discovery/analysis/HMR activity
75
- outputDir?: string; // defaults to ".nestbridge"
80
+ baseURL?: string; // prefix for REST requests and the default GraphQL endpoint; applied to the runtime automatically
81
+ debug?: boolean; // logs discovery/analysis/watch activity
82
+ outputDir?: string; // defaults to ".nestbridge", resolved from the Vite root — independent of `root`
83
+ root?: string; // base for discovering controllers/resolvers and the bootstrap file; defaults to the Vite root
76
84
  }
77
85
  ```
78
86
 
@@ -80,9 +88,11 @@ Using webpack instead of Vite? See [`@nestbridge/webpack`'s README](../webpack/R
80
88
  for the equivalent setup — same options, same generated output, different
81
89
  bundler.
82
90
 
83
- Don't forget to call `configureNestBridge` from `@nestbridge/runtime` — this
84
- option only affects generated path text, not the runtime `fetch()`/GraphQL
85
- config (`baseURL`/`graphqlEndpoint`).
91
+ `baseURL` needs no extra runtime code: the plugin generates a module that
92
+ calls `setNestBridgeBaseURL(baseURL)` from `nestbridge`, and every generated
93
+ controller and resolver module imports it. Use `configureNestBridge` from
94
+ `nestbridge` only for headers, a custom `fetch`, or an explicit
95
+ `graphqlEndpoint`.
86
96
 
87
97
  ## License
88
98
 
@@ -1,19 +1,10 @@
1
+ import { NestBridgeOptions, NestBridgeOptions as NestBridgeOptions$1 } from "@nestbridge/unplugin";
1
2
  import { Plugin } from "vite";
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) => Plugin;
7
+ export declare const nestBridge: (options: NestBridgeOptions$1) => Plugin;
17
8
  //#endregion
18
9
  export type { NestBridgeOptions };
19
10
  //# sourceMappingURL=nestbridge.vite.d.ts.map