File tree Expand file tree Collapse file tree 13 files changed +492
-187
lines changed
code-gen/src/experimental
store/src/generated/common Expand file tree Collapse file tree 13 files changed +492
-187
lines changed Original file line number Diff line number Diff line change 7
7
fileContextRemoveLinePrefix ,
8
8
fileContextSetIndent ,
9
9
} from "../file/context.js" ;
10
- import { fileFormatInlineComment } from "../file/format .js" ;
10
+ import { fileFormatInlineComment } from "../file/docs .js" ;
11
11
import { fileWrite , fileWriteInline } from "../file/write.js" ;
12
12
import { referenceUtilsGetProperty } from "../processors/reference-utils.js" ;
13
13
import { structureResolveReference } from "../processors/structure.js" ;
@@ -497,6 +497,7 @@ export function reactQueryGenerateFunction(
497
497
${ parameterListWithExtraction ( {
498
498
prefix : "opts" ,
499
499
withRequestConfig : true ,
500
+ defaultToNull : false ,
500
501
} ) }
501
502
);
502
503
}, options);` ,
@@ -550,6 +551,7 @@ ${hookName}.queryKey = (
550
551
${ parameterListWithExtraction ( {
551
552
prefix : "opts" ,
552
553
withRequestConfig : true ,
554
+ defaultToNull : false ,
553
555
} ) }
554
556
));
555
557
}
@@ -572,6 +574,7 @@ ${hookName}.queryKey = (
572
574
${ parameterListWithExtraction ( {
573
575
prefix : "opts" ,
574
576
withRequestConfig : true ,
577
+ defaultToNull : false ,
575
578
} ) }
576
579
));
577
580
}
@@ -675,6 +678,7 @@ ${hookName}.setQueryData = (
675
678
${ parameterListWithExtraction ( {
676
679
prefix : "variables" ,
677
680
withRequestConfig : true ,
681
+ defaultToNull : false ,
678
682
} ) }
679
683
), options);
680
684
` ,
Original file line number Diff line number Diff line change 7
7
fileContextRemoveLinePrefix ,
8
8
fileContextSetIndent ,
9
9
} from "../file/context.js" ;
10
- import { fileFormatInlineComment } from "../file/format .js" ;
10
+ import { fileFormatInlineComment } from "../file/docs .js" ;
11
11
import { fileWrite } from "../file/write.js" ;
12
12
import {
13
13
crudInformationGetHasCustomReadableType ,
Original file line number Diff line number Diff line change 7
7
fileContextRemoveLinePrefix ,
8
8
fileContextSetIndent ,
9
9
} from "../file/context.js" ;
10
- import { fileFormatInlineComment } from "../file/format .js" ;
10
+ import { fileFormatInlineComment } from "../file/docs .js" ;
11
11
import { fileWrite , fileWriteInline } from "../file/write.js" ;
12
12
import { modelKeyGetPrimary } from "../processors/model-keys.js" ;
13
13
import {
Original file line number Diff line number Diff line change 4
4
fileContextCreateGeneric ,
5
5
fileContextSetIndent ,
6
6
} from "../file/context.js" ;
7
- import { fileFormatInlineComment } from "../file/format .js" ;
7
+ import { fileFormatInlineComment } from "../file/docs .js" ;
8
8
import { fileWrite , fileWriteInline } from "../file/write.js" ;
9
9
import {
10
10
modelKeyGetPrimary ,
Original file line number Diff line number Diff line change 1
1
import { AppError } from "@compas/stdlib" ;
2
- import { fileFormatInlineComment } from "./format .js" ;
2
+ import { fileFormatInlineComment } from "./docs .js" ;
3
3
import {
4
4
fileImportsAddPlaceholder ,
5
5
fileImportsStringifyImports ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Format the provided contents as an inline comment for the specific file.
3
+ *
4
+ * @param {import("./context").GenerateFile } file
5
+ * @param {string } contents
6
+ * @returns {string }
7
+ */
8
+ export function fileFormatInlineComment (
9
+ file : import ( "./context" ) . GenerateFile ,
10
+ contents : string ,
11
+ ) : string ;
12
+ /**
13
+ * Format the provided contents as a doc block comment. Compatible with things like JSDoc
14
+ * blocks.
15
+ *
16
+ * @param {import("./context").GenerateFile } file
17
+ * @param {string } contents
18
+ * @returns {void }
19
+ */
20
+ export function fileWriteDocBlock (
21
+ file : import ( "./context" ) . GenerateFile ,
22
+ contents : string ,
23
+ ) : void ;
24
+ //# sourceMappingURL=docs.d.ts.map
Original file line number Diff line number Diff line change
1
+ import {
2
+ fileContextAddLinePrefix ,
3
+ fileContextRemoveLinePrefix ,
4
+ } from "./context.js" ;
5
+ import { fileWrite } from "./write.js" ;
6
+
7
+ /**
8
+ * Format the provided contents as an inline comment for the specific file.
9
+ *
10
+ * @param {import("./context").GenerateFile } file
11
+ * @param {string } contents
12
+ * @returns {string }
13
+ */
14
+ export function fileFormatInlineComment ( file , contents ) {
15
+ return `${ file . inlineCommentPrefix } ${ contents . replace (
16
+ / \n / g,
17
+ `\n${ file . inlineCommentPrefix } ` ,
18
+ ) } `;
19
+ }
20
+
21
+ /**
22
+ * Format the provided contents as a doc block comment. Compatible with things like JSDoc
23
+ * blocks.
24
+ *
25
+ * @param {import("./context").GenerateFile } file
26
+ * @param {string } contents
27
+ * @returns {void }
28
+ */
29
+ export function fileWriteDocBlock ( file , contents ) {
30
+ fileWrite ( file , `/**` ) ;
31
+ fileContextAddLinePrefix ( file , " * " ) ;
32
+ fileWrite ( file , contents ) ;
33
+
34
+ fileContextRemoveLinePrefix ( file , 3 ) ;
35
+ fileWrite ( file , " */" ) ;
36
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments