@dudousxd/nestjs-inertia-codegen 1.0.6 → 2.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 +20 -0
- package/dist/cli/main.cjs +4 -2
- package/dist/cli/main.cjs.map +1 -1
- package/dist/cli/main.js +4 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog — @dudousxd/nestjs-inertia-codegen
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- feat(codegen): add queryKey() helper for typed cache invalidation — api.crew.getCrew.queryKey()
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies []:
|
|
12
|
+
- @dudousxd/nestjs-inertia@2.0.0
|
|
13
|
+
|
|
14
|
+
## 1.0.7
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- fix(core): use data-page="app" attribute on script tag for Inertia v3 protocol compatibility
|
|
19
|
+
|
|
20
|
+
- Updated dependencies []:
|
|
21
|
+
- @dudousxd/nestjs-inertia@1.0.7
|
|
22
|
+
|
|
3
23
|
## 1.0.6
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/cli/main.cjs
CHANGED
|
@@ -324,15 +324,17 @@ function emitApiObjectBlock(tree, indent) {
|
|
|
324
324
|
if (method === "GET") {
|
|
325
325
|
const typeAccess = buildRouterTypeAccess(c.name);
|
|
326
326
|
lines.push(`${pad}${objKey}: {`);
|
|
327
|
+
lines.push(`${pad} queryKey: (query?: ${typeAccess}['query']) => query !== undefined ? [${flatName}, query] as const : [${flatName}] as const,`);
|
|
327
328
|
lines.push(`${pad} queryOptions: (query?: ${typeAccess}['query']) =>`);
|
|
328
329
|
lines.push(`${pad} queryOptions({`);
|
|
329
|
-
lines.push(`${pad} queryKey: [${flatName}, query],`);
|
|
330
|
+
lines.push(`${pad} queryKey: query !== undefined ? [${flatName}, query] : [${flatName}],`);
|
|
330
331
|
lines.push(`${pad} queryFn: () => fetcher.get<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { query }),`);
|
|
331
332
|
lines.push(`${pad} }),`);
|
|
332
333
|
lines.push(`${pad}},`);
|
|
333
334
|
} else {
|
|
334
335
|
const typeAccess = buildRouterTypeAccess(c.name);
|
|
335
336
|
lines.push(`${pad}${objKey}: {`);
|
|
337
|
+
lines.push(`${pad} queryKey: () => [${flatName}] as const,`);
|
|
336
338
|
lines.push(`${pad} mutationOptions: () => ({`);
|
|
337
339
|
lines.push(`${pad} mutationFn: (body: ${typeAccess}['body']) => fetcher.${fetcherMethod}<${typeAccess}['response']>(route(${flatName} as never) || ${safePath}, { body }),`);
|
|
338
340
|
lines.push(`${pad} }),`);
|
|
@@ -1432,7 +1434,7 @@ async function watch(config, onChange) {
|
|
|
1432
1434
|
__name(watch, "watch");
|
|
1433
1435
|
|
|
1434
1436
|
// src/index.ts
|
|
1435
|
-
var VERSION = "
|
|
1437
|
+
var VERSION = "2.0.0";
|
|
1436
1438
|
|
|
1437
1439
|
// src/cli/codegen.ts
|
|
1438
1440
|
async function runCodegen(opts = {}) {
|