joist-graphql-codegen 2.5.0-next.8 → 2.5.0-next.9
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/build/_virtual/_rolldown/runtime.cjs +1 -2
- package/build/generateEnumDetailResolvers.cjs +1 -2
- package/build/generateEnumDetailResolvers.d.cts +0 -2
- package/build/generateEnumDetailResolvers.d.cts.map +1 -1
- package/build/generateEnumDetailResolvers.d.mts +0 -2
- package/build/generateEnumDetailResolvers.d.mts.map +1 -1
- package/build/generateEnumDetailResolvers.js +1 -2
- package/build/generateEnumsGraphql.cjs +1 -2
- package/build/generateEnumsGraphql.d.cts +0 -2
- package/build/generateEnumsGraphql.d.cts.map +1 -1
- package/build/generateEnumsGraphql.d.mts +0 -2
- package/build/generateEnumsGraphql.d.mts.map +1 -1
- package/build/generateEnumsGraphql.js +1 -2
- package/build/generateGraphqlCodegen.cjs +1 -2
- package/build/generateGraphqlCodegen.d.cts +0 -2
- package/build/generateGraphqlCodegen.d.cts.map +1 -1
- package/build/generateGraphqlCodegen.d.mts +0 -2
- package/build/generateGraphqlCodegen.d.mts.map +1 -1
- package/build/generateGraphqlCodegen.js +1 -2
- package/build/generateGraphqlSchemaFiles.cjs +2 -3
- package/build/generateGraphqlSchemaFiles.d.cts +0 -2
- package/build/generateGraphqlSchemaFiles.d.cts.map +1 -1
- package/build/generateGraphqlSchemaFiles.d.mts +0 -2
- package/build/generateGraphqlSchemaFiles.d.mts.map +1 -1
- package/build/generateGraphqlSchemaFiles.js +2 -3
- package/build/generateObjectResolvers.cjs +1 -2
- package/build/generateObjectResolvers.d.cts +0 -2
- package/build/generateObjectResolvers.d.cts.map +1 -1
- package/build/generateObjectResolvers.d.mts +0 -2
- package/build/generateObjectResolvers.d.mts.map +1 -1
- package/build/generateObjectResolvers.js +1 -2
- package/build/generateQueryPageResolvers.cjs +1 -2
- package/build/generateQueryPageResolvers.d.cts +0 -2
- package/build/generateQueryPageResolvers.d.cts.map +1 -1
- package/build/generateQueryPageResolvers.d.mts +0 -2
- package/build/generateQueryPageResolvers.d.mts.map +1 -1
- package/build/generateQueryPageResolvers.js +1 -2
- package/build/generateQueryResolvers.cjs +1 -2
- package/build/generateQueryResolvers.d.cts +0 -2
- package/build/generateQueryResolvers.d.cts.map +1 -1
- package/build/generateQueryResolvers.d.mts +0 -2
- package/build/generateQueryResolvers.d.mts.map +1 -1
- package/build/generateQueryResolvers.js +1 -2
- package/build/generateResolverUtils.cjs +1 -2
- package/build/generateResolverUtils.d.cts +0 -2
- package/build/generateResolverUtils.d.cts.map +1 -1
- package/build/generateResolverUtils.d.mts +0 -2
- package/build/generateResolverUtils.d.mts.map +1 -1
- package/build/generateResolverUtils.js +1 -2
- package/build/generateSaveResolvers.cjs +1 -2
- package/build/generateSaveResolvers.d.cts +0 -2
- package/build/generateSaveResolvers.d.cts.map +1 -1
- package/build/generateSaveResolvers.d.mts +0 -2
- package/build/generateSaveResolvers.d.mts.map +1 -1
- package/build/generateSaveResolvers.js +1 -2
- package/build/graphqlUtils.cjs +1 -2
- package/build/graphqlUtils.d.cts +0 -2
- package/build/graphqlUtils.d.cts.map +1 -1
- package/build/graphqlUtils.d.mts +0 -2
- package/build/graphqlUtils.d.mts.map +1 -1
- package/build/graphqlUtils.js +1 -2
- package/build/history.cjs +5 -6
- package/build/history.cjs.map +1 -1
- package/build/history.d.cts +0 -2
- package/build/history.d.cts.map +1 -1
- package/build/history.d.mts +0 -2
- package/build/history.d.mts.map +1 -1
- package/build/history.js +1 -2
- package/build/index.cjs +3 -4
- package/build/index.d.cts +0 -2
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +0 -2
- package/build/index.d.mts.map +1 -1
- package/build/index.js +3 -4
- package/build/testUtils.cjs +1 -2
- package/build/testUtils.d.cts +0 -2
- package/build/testUtils.d.cts.map +1 -1
- package/build/testUtils.d.mts +0 -2
- package/build/testUtils.d.mts.map +1 -1
- package/build/testUtils.js +1 -2
- package/build/utils.cjs +1 -2
- package/build/utils.d.cts +0 -2
- package/build/utils.d.cts.map +1 -1
- package/build/utils.d.mts +0 -2
- package/build/utils.d.mts.map +1 -1
- package/build/utils.js +1 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -19,5 +19,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.__toESM = __toESM;
|
|
@@ -6,7 +6,7 @@ require("joist-codegen");
|
|
|
6
6
|
let pluralize = require("pluralize");
|
|
7
7
|
pluralize = require_runtime.__toESM(pluralize, 1);
|
|
8
8
|
let ts_poet = require("ts-poet");
|
|
9
|
-
|
|
9
|
+
// src/generateEnumDetailResolvers.ts
|
|
10
10
|
/** Generates a `src/resolvers/enumResolvers.ts` with a resolver for each of our domain's "enum detail" types. */
|
|
11
11
|
function generateEnumDetailResolvers(config, enums) {
|
|
12
12
|
const entitiesPath = require_utils.getEntitiesImportPath(config);
|
|
@@ -34,7 +34,6 @@ function generateEnumDetailResolvers(config, enums) {
|
|
|
34
34
|
`
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
exports.generateEnumDetailResolvers = generateEnumDetailResolvers;
|
|
39
38
|
|
|
40
39
|
//# sourceMappingURL=generateEnumDetailResolvers.cjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateEnumDetailResolvers.d.ts
|
|
4
3
|
/** Generates a `src/resolvers/enumResolvers.ts` with a resolver for each of our domain's "enum detail" types. */
|
|
5
4
|
export declare function generateEnumDetailResolvers(config: Config, enums: EnumMetadata): CodegenFile;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateEnumDetailResolvers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumDetailResolvers.d.cts","names":[],"sources":["../src/generateEnumDetailResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateEnumDetailResolvers.d.cts","names":[],"sources":["../src/generateEnumDetailResolvers.ts"],"mappings":";;;wBAQgB,4BAA4B,QAAQ,QAAQ,OAAO,eAAe"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateEnumDetailResolvers.d.ts
|
|
4
3
|
/** Generates a `src/resolvers/enumResolvers.ts` with a resolver for each of our domain's "enum detail" types. */
|
|
5
4
|
export declare function generateEnumDetailResolvers(config: Config, enums: EnumMetadata): CodegenFile;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateEnumDetailResolvers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumDetailResolvers.d.mts","names":[],"sources":["../src/generateEnumDetailResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateEnumDetailResolvers.d.mts","names":[],"sources":["../src/generateEnumDetailResolvers.ts"],"mappings":";;;wBAQgB,4BAA4B,QAAQ,QAAQ,OAAO,eAAe"}
|
|
@@ -3,7 +3,7 @@ import { camelCase } from "change-case";
|
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import pluralize from "pluralize";
|
|
5
5
|
import { code, imp } from "ts-poet";
|
|
6
|
-
|
|
6
|
+
// src/generateEnumDetailResolvers.ts
|
|
7
7
|
/** Generates a `src/resolvers/enumResolvers.ts` with a resolver for each of our domain's "enum detail" types. */
|
|
8
8
|
function generateEnumDetailResolvers(config, enums) {
|
|
9
9
|
const entitiesPath = getEntitiesImportPath(config);
|
|
@@ -31,7 +31,6 @@ function generateEnumDetailResolvers(config, enums) {
|
|
|
31
31
|
`
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
//#endregion
|
|
35
34
|
export { generateEnumDetailResolvers };
|
|
36
35
|
|
|
37
36
|
//# sourceMappingURL=generateEnumDetailResolvers.js.map
|
|
@@ -3,7 +3,7 @@ const require_graphqlUtils = require("./graphqlUtils.cjs");
|
|
|
3
3
|
let change_case = require("change-case");
|
|
4
4
|
require("joist-codegen");
|
|
5
5
|
require("ts-poet");
|
|
6
|
-
|
|
6
|
+
// src/generateEnumsGraphql.ts
|
|
7
7
|
/** Generates a `schema/enums.graphql` with GQL enums that match all of our domain enums. */
|
|
8
8
|
async function generateEnumsGraphql(enums) {
|
|
9
9
|
const contents = Object.values(enums).map(({ name, rows, extraPrimitives }) => {
|
|
@@ -23,7 +23,6 @@ async function generateEnumsGraphql(enums) {
|
|
|
23
23
|
contents: await require_graphqlUtils.formatGraphQL([...contents, allEnumDetails].join("\n"))
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
exports.generateEnumsGraphql = generateEnumsGraphql;
|
|
28
27
|
|
|
29
28
|
//# sourceMappingURL=generateEnumsGraphql.cjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateEnumsGraphql.d.ts
|
|
4
3
|
/** Generates a `schema/enums.graphql` with GQL enums that match all of our domain enums. */
|
|
5
4
|
export declare function generateEnumsGraphql(enums: EnumMetadata): Promise<CodegenFile>;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateEnumsGraphql.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumsGraphql.d.cts","names":[],"sources":["../src/generateEnumsGraphql.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateEnumsGraphql.d.cts","names":[],"sources":["../src/generateEnumsGraphql.ts"],"mappings":";;;wBAYsB,qBAAqB,OAAO,eAAe,QAAQ"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateEnumsGraphql.d.ts
|
|
4
3
|
/** Generates a `schema/enums.graphql` with GQL enums that match all of our domain enums. */
|
|
5
4
|
export declare function generateEnumsGraphql(enums: EnumMetadata): Promise<CodegenFile>;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateEnumsGraphql.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateEnumsGraphql.d.mts","names":[],"sources":["../src/generateEnumsGraphql.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateEnumsGraphql.d.mts","names":[],"sources":["../src/generateEnumsGraphql.ts"],"mappings":";;;wBAYsB,qBAAqB,OAAO,eAAe,QAAQ"}
|
|
@@ -2,7 +2,7 @@ import { formatGraphQL, isJsonbColumn, mapTypescriptTypeToGraphQLType } from "./
|
|
|
2
2
|
import { camelCase } from "change-case";
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import "ts-poet";
|
|
5
|
-
|
|
5
|
+
// src/generateEnumsGraphql.ts
|
|
6
6
|
/** Generates a `schema/enums.graphql` with GQL enums that match all of our domain enums. */
|
|
7
7
|
async function generateEnumsGraphql(enums) {
|
|
8
8
|
const contents = Object.values(enums).map(({ name, rows, extraPrimitives }) => {
|
|
@@ -22,7 +22,6 @@ async function generateEnumsGraphql(enums) {
|
|
|
22
22
|
contents: await formatGraphQL([...contents, allEnumDetails].join("\n"))
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
//#endregion
|
|
26
25
|
export { generateEnumsGraphql };
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=generateEnumsGraphql.js.map
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_utils = require("./utils.cjs");
|
|
3
3
|
require("joist-codegen");
|
|
4
4
|
let ts_poet = require("ts-poet");
|
|
5
|
-
|
|
5
|
+
// src/generateGraphqlCodegen.ts
|
|
6
6
|
/** Generates a `graphql-codegen-joist.js` (or .mjs for ESM) with the auto-generated mapped type/enum value settings. */
|
|
7
7
|
function generateGraphqlCodegen(config, entities, enums) {
|
|
8
8
|
const enumNames = Object.values(enums).map(({ name }) => name);
|
|
@@ -48,7 +48,6 @@ function sortObject(obj) {
|
|
|
48
48
|
return acc;
|
|
49
49
|
}, {});
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
exports.generateGraphqlCodegen = generateGraphqlCodegen;
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=generateGraphqlCodegen.cjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, EntityDbMetadata, EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateGraphqlCodegen.d.ts
|
|
4
3
|
/** Generates a `graphql-codegen-joist.js` (or .mjs for ESM) with the auto-generated mapped type/enum value settings. */
|
|
5
4
|
export declare function generateGraphqlCodegen(config: Config, entities: EntityDbMetadata[], enums: EnumMetadata): CodegenFile;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateGraphqlCodegen.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateGraphqlCodegen.d.cts","names":[],"sources":["../src/generateGraphqlCodegen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateGraphqlCodegen.d.cts","names":[],"sources":["../src/generateGraphqlCodegen.ts"],"mappings":";;;wBAMgB,uBAAuB,QAAQ,QAAQ,UAAU,oBAAoB,OAAO,eAAe"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, EntityDbMetadata, EnumMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateGraphqlCodegen.d.ts
|
|
4
3
|
/** Generates a `graphql-codegen-joist.js` (or .mjs for ESM) with the auto-generated mapped type/enum value settings. */
|
|
5
4
|
export declare function generateGraphqlCodegen(config: Config, entities: EntityDbMetadata[], enums: EnumMetadata): CodegenFile;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateGraphqlCodegen.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateGraphqlCodegen.d.mts","names":[],"sources":["../src/generateGraphqlCodegen.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateGraphqlCodegen.d.mts","names":[],"sources":["../src/generateGraphqlCodegen.ts"],"mappings":";;;wBAMgB,uBAAuB,QAAQ,QAAQ,UAAU,oBAAoB,OAAO,eAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getEntitiesImportPath } from "./utils.js";
|
|
2
2
|
import "joist-codegen";
|
|
3
3
|
import { code } from "ts-poet";
|
|
4
|
-
|
|
4
|
+
// src/generateGraphqlCodegen.ts
|
|
5
5
|
/** Generates a `graphql-codegen-joist.js` (or .mjs for ESM) with the auto-generated mapped type/enum value settings. */
|
|
6
6
|
function generateGraphqlCodegen(config, entities, enums) {
|
|
7
7
|
const enumNames = Object.values(enums).map(({ name }) => name);
|
|
@@ -47,7 +47,6 @@ function sortObject(obj) {
|
|
|
47
47
|
return acc;
|
|
48
48
|
}, {});
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { generateGraphqlCodegen };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=generateGraphqlCodegen.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
|
|
3
|
-
require("./utils.cjs");
|
|
4
3
|
const require_graphqlUtils = require("./graphqlUtils.cjs");
|
|
5
4
|
const require_history = require("./history.cjs");
|
|
5
|
+
require("./utils.cjs");
|
|
6
6
|
let change_case = require("change-case");
|
|
7
7
|
require("joist-codegen");
|
|
8
8
|
let pluralize = require("pluralize");
|
|
9
9
|
pluralize = require_runtime.__toESM(pluralize, 1);
|
|
10
10
|
let joist_utils = require("joist-utils");
|
|
11
|
-
|
|
11
|
+
// src/generateGraphqlSchemaFiles.ts
|
|
12
12
|
/**
|
|
13
13
|
* Generates `*.graphql` files based on the database schema.
|
|
14
14
|
*
|
|
@@ -485,7 +485,6 @@ function findBaseEntity(dbMeta, baseClassName) {
|
|
|
485
485
|
entities: dbMeta.entities.filter((e) => e.entity.name === baseClassName)
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
//#endregion
|
|
489
488
|
exports.generateGraphqlSchemaFiles = generateGraphqlSchemaFiles;
|
|
490
489
|
|
|
491
490
|
//# sourceMappingURL=generateGraphqlSchemaFiles.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fs } from "./utils.cjs";
|
|
2
2
|
import { Config, DbMetadata } from "joist-codegen";
|
|
3
|
-
//#region src/generateGraphqlSchemaFiles.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates `*.graphql` files based on the database schema.
|
|
6
5
|
*
|
|
@@ -10,5 +9,4 @@ import { Config, DbMetadata } from "joist-codegen";
|
|
|
10
9
|
* without this stomping over their changes.
|
|
11
10
|
*/
|
|
12
11
|
export declare function generateGraphqlSchemaFiles(config: Config, fs: Fs, dbMeta: DbMetadata): Promise<void>;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=generateGraphqlSchemaFiles.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateGraphqlSchemaFiles.d.cts","names":[],"sources":["../src/generateGraphqlSchemaFiles.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateGraphqlSchemaFiles.d.cts","names":[],"sources":["../src/generateGraphqlSchemaFiles.ts"],"mappings":";;;;;;;;;;wBAiBsB,2BAA2B,QAAQ,QAAQ,IAAI,IAAI,QAAQ,aAAa"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fs } from "./utils.mjs";
|
|
2
2
|
import { Config, DbMetadata } from "joist-codegen";
|
|
3
|
-
//#region src/generateGraphqlSchemaFiles.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates `*.graphql` files based on the database schema.
|
|
6
5
|
*
|
|
@@ -10,5 +9,4 @@ import { Config, DbMetadata } from "joist-codegen";
|
|
|
10
9
|
* without this stomping over their changes.
|
|
11
10
|
*/
|
|
12
11
|
export declare function generateGraphqlSchemaFiles(config: Config, fs: Fs, dbMeta: DbMetadata): Promise<void>;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=generateGraphqlSchemaFiles.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateGraphqlSchemaFiles.d.mts","names":[],"sources":["../src/generateGraphqlSchemaFiles.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateGraphqlSchemaFiles.d.mts","names":[],"sources":["../src/generateGraphqlSchemaFiles.ts"],"mappings":";;;;;;;;;;wBAiBsB,2BAA2B,QAAQ,QAAQ,IAAI,IAAI,QAAQ,aAAa"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./utils.js";
|
|
2
1
|
import { mapTypescriptTypeToGraphQLType, upsertIntoFile } from "./graphqlUtils.js";
|
|
3
2
|
import { loadHistory, writeHistory } from "./history.js";
|
|
3
|
+
import "./utils.js";
|
|
4
4
|
import { camelCase } from "change-case";
|
|
5
5
|
import "joist-codegen";
|
|
6
6
|
import pluralize from "pluralize";
|
|
7
7
|
import { groupBy } from "joist-utils";
|
|
8
|
-
|
|
8
|
+
// src/generateGraphqlSchemaFiles.ts
|
|
9
9
|
/**
|
|
10
10
|
* Generates `*.graphql` files based on the database schema.
|
|
11
11
|
*
|
|
@@ -482,7 +482,6 @@ function findBaseEntity(dbMeta, baseClassName) {
|
|
|
482
482
|
entities: dbMeta.entities.filter((e) => e.entity.name === baseClassName)
|
|
483
483
|
};
|
|
484
484
|
}
|
|
485
|
-
//#endregion
|
|
486
485
|
export { generateGraphqlSchemaFiles };
|
|
487
486
|
|
|
488
487
|
//# sourceMappingURL=generateGraphqlSchemaFiles.js.map
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
let change_case = require("change-case");
|
|
4
4
|
require("joist-codegen");
|
|
5
5
|
let ts_poet = require("ts-poet");
|
|
6
|
-
|
|
6
|
+
// src/generateObjectResolvers.ts
|
|
7
7
|
const entityResolver = (0, ts_poet.imp)("entityResolver@src/resolvers/utils.ts");
|
|
8
8
|
const makeRunObjectFields = (0, ts_poet.imp)("makeRunObjectFields@src/resolvers/testUtils.ts");
|
|
9
9
|
const makeRunObjectField = (0, ts_poet.imp)("makeRunObjectField@src/resolvers/testUtils.ts");
|
|
@@ -64,7 +64,6 @@ function generateObjectResolvers(config, entities) {
|
|
|
64
64
|
});
|
|
65
65
|
return [...resolvers, ...testFiles];
|
|
66
66
|
}
|
|
67
|
-
//#endregion
|
|
68
67
|
exports.generateObjectResolvers = generateObjectResolvers;
|
|
69
68
|
|
|
70
69
|
//# sourceMappingURL=generateObjectResolvers.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Config, EntityDbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateObjectResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates a base resolver using the entityResolver utility.
|
|
6
5
|
*
|
|
@@ -12,5 +11,4 @@ import { CodegenFile } from "ts-poet";
|
|
|
12
11
|
* [1]: https://github.com/homebound-team/graphql-typescript-resolver-scaffolding
|
|
13
12
|
*/
|
|
14
13
|
export declare function generateObjectResolvers(config: Config, entities: EntityDbMetadata[]): CodegenFile[];
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=generateObjectResolvers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateObjectResolvers.d.cts","names":[],"sources":["../src/generateObjectResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateObjectResolvers.d.cts","names":[],"sources":["../src/generateObjectResolvers.ts"],"mappings":";;;;;;;;;;;;wBAoBgB,wBAAwB,QAAQ,QAAQ,UAAU,qBAAqB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Config, EntityDbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateObjectResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates a base resolver using the entityResolver utility.
|
|
6
5
|
*
|
|
@@ -12,5 +11,4 @@ import { CodegenFile } from "ts-poet";
|
|
|
12
11
|
* [1]: https://github.com/homebound-team/graphql-typescript-resolver-scaffolding
|
|
13
12
|
*/
|
|
14
13
|
export declare function generateObjectResolvers(config: Config, entities: EntityDbMetadata[]): CodegenFile[];
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=generateObjectResolvers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateObjectResolvers.d.mts","names":[],"sources":["../src/generateObjectResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateObjectResolvers.d.mts","names":[],"sources":["../src/generateObjectResolvers.ts"],"mappings":";;;;;;;;;;;;wBAoBgB,wBAAwB,QAAQ,QAAQ,UAAU,qBAAqB"}
|
|
@@ -2,7 +2,7 @@ import { getEntitiesImportPath } from "./utils.js";
|
|
|
2
2
|
import { camelCase, sentenceCase } from "change-case";
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import { code, imp } from "ts-poet";
|
|
5
|
-
|
|
5
|
+
// src/generateObjectResolvers.ts
|
|
6
6
|
const entityResolver = imp("entityResolver@src/resolvers/utils.ts");
|
|
7
7
|
const makeRunObjectFields = imp("makeRunObjectFields@src/resolvers/testUtils.ts");
|
|
8
8
|
const makeRunObjectField = imp("makeRunObjectField@src/resolvers/testUtils.ts");
|
|
@@ -63,7 +63,6 @@ function generateObjectResolvers(config, entities) {
|
|
|
63
63
|
});
|
|
64
64
|
return [...resolvers, ...testFiles];
|
|
65
65
|
}
|
|
66
|
-
//#endregion
|
|
67
66
|
export { generateObjectResolvers };
|
|
68
67
|
|
|
69
68
|
//# sourceMappingURL=generateObjectResolvers.js.map
|
|
@@ -6,7 +6,7 @@ require("joist-codegen");
|
|
|
6
6
|
let pluralize = require("pluralize");
|
|
7
7
|
pluralize = require_runtime.__toESM(pluralize, 1);
|
|
8
8
|
let ts_poet = require("ts-poet");
|
|
9
|
-
|
|
9
|
+
// src/generateQueryPageResolvers.ts
|
|
10
10
|
const queryResolvers = (0, ts_poet.imp)("t:QueryResolvers@src/generated/graphql-types.ts");
|
|
11
11
|
const makeRunQuery = (0, ts_poet.imp)("makeRunQuery@src/resolvers/testUtils.ts");
|
|
12
12
|
/** Generates paginated top-level query resolvers. */
|
|
@@ -45,7 +45,6 @@ function generateQueryPageResolvers(config, db) {
|
|
|
45
45
|
}];
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
//#endregion
|
|
49
48
|
exports.generateQueryPageResolvers = generateQueryPageResolvers;
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=generateQueryPageResolvers.cjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateQueryPageResolvers.d.ts
|
|
4
3
|
/** Generates paginated top-level query resolvers. */
|
|
5
4
|
export declare function generateQueryPageResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateQueryPageResolvers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateQueryPageResolvers.d.cts","names":[],"sources":["../src/generateQueryPageResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateQueryPageResolvers.d.cts","names":[],"sources":["../src/generateQueryPageResolvers.ts"],"mappings":";;;wBAWgB,2BAA2B,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateQueryPageResolvers.d.ts
|
|
4
3
|
/** Generates paginated top-level query resolvers. */
|
|
5
4
|
export declare function generateQueryPageResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateQueryPageResolvers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateQueryPageResolvers.d.mts","names":[],"sources":["../src/generateQueryPageResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateQueryPageResolvers.d.mts","names":[],"sources":["../src/generateQueryPageResolvers.ts"],"mappings":";;;wBAWgB,2BAA2B,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -3,7 +3,7 @@ import { camelCase } from "change-case";
|
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import pluralize from "pluralize";
|
|
5
5
|
import { code, imp } from "ts-poet";
|
|
6
|
-
|
|
6
|
+
// src/generateQueryPageResolvers.ts
|
|
7
7
|
const queryResolvers = imp("t:QueryResolvers@src/generated/graphql-types.ts");
|
|
8
8
|
const makeRunQuery = imp("makeRunQuery@src/resolvers/testUtils.ts");
|
|
9
9
|
/** Generates paginated top-level query resolvers. */
|
|
@@ -42,7 +42,6 @@ function generateQueryPageResolvers(config, db) {
|
|
|
42
42
|
}];
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
export { generateQueryPageResolvers };
|
|
47
46
|
|
|
48
47
|
//# sourceMappingURL=generateQueryPageResolvers.js.map
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
let change_case = require("change-case");
|
|
4
4
|
require("joist-codegen");
|
|
5
5
|
let ts_poet = require("ts-poet");
|
|
6
|
-
|
|
6
|
+
// src/generateQueryResolvers.ts
|
|
7
7
|
const queryResolvers = (0, ts_poet.imp)("t:QueryResolvers@src/generated/graphql-types.ts");
|
|
8
8
|
const makeRunQuery = (0, ts_poet.imp)("makeRunQuery@src/resolvers/testUtils.ts");
|
|
9
9
|
/**
|
|
@@ -49,7 +49,6 @@ function generateQueryResolvers(config, db) {
|
|
|
49
49
|
});
|
|
50
50
|
return [...resolvers, ...testFiles];
|
|
51
51
|
}
|
|
52
|
-
//#endregion
|
|
53
52
|
exports.generateQueryResolvers = generateQueryResolvers;
|
|
54
53
|
|
|
55
54
|
//# sourceMappingURL=generateQueryResolvers.cjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateQueryResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates top-level query resolvers.
|
|
6
5
|
*/
|
|
7
6
|
export declare function generateQueryResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=generateQueryResolvers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateQueryResolvers.d.cts","names":[],"sources":["../src/generateQueryResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateQueryResolvers.d.cts","names":[],"sources":["../src/generateQueryResolvers.ts"],"mappings":";;;;;wBAYgB,uBAAuB,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateQueryResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates top-level query resolvers.
|
|
6
5
|
*/
|
|
7
6
|
export declare function generateQueryResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
8
|
-
//#endregion
|
|
9
7
|
//# sourceMappingURL=generateQueryResolvers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateQueryResolvers.d.mts","names":[],"sources":["../src/generateQueryResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateQueryResolvers.d.mts","names":[],"sources":["../src/generateQueryResolvers.ts"],"mappings":";;;;;wBAYgB,uBAAuB,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -2,7 +2,7 @@ import { getEntitiesImportPath } from "./utils.js";
|
|
|
2
2
|
import { camelCase, sentenceCase } from "change-case";
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import { code, imp } from "ts-poet";
|
|
5
|
-
|
|
5
|
+
// src/generateQueryResolvers.ts
|
|
6
6
|
const queryResolvers = imp("t:QueryResolvers@src/generated/graphql-types.ts");
|
|
7
7
|
const makeRunQuery = imp("makeRunQuery@src/resolvers/testUtils.ts");
|
|
8
8
|
/**
|
|
@@ -48,7 +48,6 @@ function generateQueryResolvers(config, db) {
|
|
|
48
48
|
});
|
|
49
49
|
return [...resolvers, ...testFiles];
|
|
50
50
|
}
|
|
51
|
-
//#endregion
|
|
52
51
|
export { generateQueryResolvers };
|
|
53
52
|
|
|
54
53
|
//# sourceMappingURL=generateQueryResolvers.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("joist-codegen");
|
|
3
3
|
let ts_poet = require("ts-poet");
|
|
4
|
-
|
|
4
|
+
// src/generateResolverUtils.ts
|
|
5
5
|
/** Generates project-level resolver utility exports. */
|
|
6
6
|
function generateResolverUtils(config) {
|
|
7
7
|
const paginate = (config.paginationStyle ?? "cursor") === "limit" ? "paginateLimit" : "paginateCursor";
|
|
@@ -30,7 +30,6 @@ function generateResolverUtils(config) {
|
|
|
30
30
|
`
|
|
31
31
|
}];
|
|
32
32
|
}
|
|
33
|
-
//#endregion
|
|
34
33
|
exports.generateResolverUtils = generateResolverUtils;
|
|
35
34
|
|
|
36
35
|
//# sourceMappingURL=generateResolverUtils.cjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateResolverUtils.d.ts
|
|
4
3
|
/** Generates project-level resolver utility exports. */
|
|
5
4
|
export declare function generateResolverUtils(config: Config): CodegenFile[];
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateResolverUtils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateResolverUtils.d.cts","names":[],"sources":["../src/generateResolverUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateResolverUtils.d.cts","names":[],"sources":["../src/generateResolverUtils.ts"],"mappings":";;;wBAIgB,sBAAsB,QAAQ,SAAS"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Config } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateResolverUtils.d.ts
|
|
4
3
|
/** Generates project-level resolver utility exports. */
|
|
5
4
|
export declare function generateResolverUtils(config: Config): CodegenFile[];
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=generateResolverUtils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateResolverUtils.d.mts","names":[],"sources":["../src/generateResolverUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateResolverUtils.d.mts","names":[],"sources":["../src/generateResolverUtils.ts"],"mappings":";;;wBAIgB,sBAAsB,QAAQ,SAAS"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "joist-codegen";
|
|
2
2
|
import { code, imp } from "ts-poet";
|
|
3
|
-
|
|
3
|
+
// src/generateResolverUtils.ts
|
|
4
4
|
/** Generates project-level resolver utility exports. */
|
|
5
5
|
function generateResolverUtils(config) {
|
|
6
6
|
const paginate = (config.paginationStyle ?? "cursor") === "limit" ? "paginateLimit" : "paginateCursor";
|
|
@@ -29,7 +29,6 @@ function generateResolverUtils(config) {
|
|
|
29
29
|
`
|
|
30
30
|
}];
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { generateResolverUtils };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=generateResolverUtils.js.map
|
|
@@ -3,7 +3,7 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
let change_case = require("change-case");
|
|
4
4
|
require("joist-codegen");
|
|
5
5
|
let ts_poet = require("ts-poet");
|
|
6
|
-
|
|
6
|
+
// src/generateSaveResolvers.ts
|
|
7
7
|
const saveEntity = (0, ts_poet.imp)("saveEntity@src/resolvers/utils.ts");
|
|
8
8
|
const mutationResolvers = (0, ts_poet.imp)("t:MutationResolvers@src/generated/graphql-types.ts");
|
|
9
9
|
const makeRunInputMutation = (0, ts_poet.imp)("makeRunInputMutation@src/resolvers/testUtils.ts");
|
|
@@ -51,7 +51,6 @@ function generateSaveResolvers(config, db) {
|
|
|
51
51
|
}];
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
//#endregion
|
|
55
54
|
exports.generateSaveResolvers = generateSaveResolvers;
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=generateSaveResolvers.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateSaveResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates a save resolver.
|
|
6
5
|
*
|
|
@@ -12,5 +11,4 @@ import { CodegenFile } from "ts-poet";
|
|
|
12
11
|
* [1]: https://github.com/homebound-team/graphql-typescript-resolver-scaffolding
|
|
13
12
|
*/
|
|
14
13
|
export declare function generateSaveResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=generateSaveResolvers.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSaveResolvers.d.cts","names":[],"sources":["../src/generateSaveResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateSaveResolvers.d.cts","names":[],"sources":["../src/generateSaveResolvers.ts"],"mappings":";;;;;;;;;;;;wBAoBgB,sBAAsB,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Config, DbMetadata } from "joist-codegen";
|
|
2
2
|
import { CodegenFile } from "ts-poet";
|
|
3
|
-
//#region src/generateSaveResolvers.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Generates a save resolver.
|
|
6
5
|
*
|
|
@@ -12,5 +11,4 @@ import { CodegenFile } from "ts-poet";
|
|
|
12
11
|
* [1]: https://github.com/homebound-team/graphql-typescript-resolver-scaffolding
|
|
13
12
|
*/
|
|
14
13
|
export declare function generateSaveResolvers(config: Config, db: DbMetadata): CodegenFile[];
|
|
15
|
-
//#endregion
|
|
16
14
|
//# sourceMappingURL=generateSaveResolvers.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSaveResolvers.d.mts","names":[],"sources":["../src/generateSaveResolvers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"generateSaveResolvers.d.mts","names":[],"sources":["../src/generateSaveResolvers.ts"],"mappings":";;;;;;;;;;;;wBAoBgB,sBAAsB,QAAQ,QAAQ,IAAI,aAAa"}
|
|
@@ -2,7 +2,7 @@ import { getEntitiesImportPath } from "./utils.js";
|
|
|
2
2
|
import { camelCase } from "change-case";
|
|
3
3
|
import "joist-codegen";
|
|
4
4
|
import { code, imp } from "ts-poet";
|
|
5
|
-
|
|
5
|
+
// src/generateSaveResolvers.ts
|
|
6
6
|
const saveEntity = imp("saveEntity@src/resolvers/utils.ts");
|
|
7
7
|
const mutationResolvers = imp("t:MutationResolvers@src/generated/graphql-types.ts");
|
|
8
8
|
const makeRunInputMutation = imp("makeRunInputMutation@src/resolvers/testUtils.ts");
|
|
@@ -50,7 +50,6 @@ function generateSaveResolvers(config, db) {
|
|
|
50
50
|
}];
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { generateSaveResolvers };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=generateSaveResolvers.js.map
|
package/build/graphqlUtils.cjs
CHANGED
|
@@ -7,7 +7,7 @@ let joist_utils = require("joist-utils");
|
|
|
7
7
|
let graphql = require("graphql");
|
|
8
8
|
let prettier = require("prettier");
|
|
9
9
|
prettier = require_runtime.__toESM(prettier, 1);
|
|
10
|
-
|
|
10
|
+
// src/graphqlUtils.ts
|
|
11
11
|
/** Given a `file` and `fields` to go in it (for potentially different objects), upserts into the existing types. */
|
|
12
12
|
async function upsertIntoFile(fs, file, fields) {
|
|
13
13
|
const byObjectName = (0, joist_utils.groupBy)(fields, (f) => f.objectName);
|
|
@@ -151,7 +151,6 @@ function mapTypescriptTypeToGraphQLType(fieldName, type) {
|
|
|
151
151
|
function isJsonbColumn(p) {
|
|
152
152
|
return p.fieldType === "Object" || p.fieldType instanceof ts_poet.Import;
|
|
153
153
|
}
|
|
154
|
-
//#endregion
|
|
155
154
|
exports.formatGraphQL = formatGraphQL;
|
|
156
155
|
exports.isJsonbColumn = isJsonbColumn;
|
|
157
156
|
exports.mapTypescriptTypeToGraphQLType = mapTypescriptTypeToGraphQLType;
|
package/build/graphqlUtils.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.cjs";
|
|
2
2
|
import { PrimitiveField, PrimitiveTypescriptType } from "joist-codegen";
|
|
3
3
|
import { Code, Import } from "ts-poet";
|
|
4
|
-
//#region src/graphqlUtils.d.ts
|
|
5
4
|
/** A type for the fields we want to add to `*.graphql` files. */
|
|
6
5
|
export type GqlField = {
|
|
7
6
|
file: string;
|
|
@@ -26,5 +25,4 @@ export type GraphQLType = "BigInt" | "Boolean" | "String" | "Int" | "Date" | "Da
|
|
|
26
25
|
export type SupportedTypescriptTypes = Exclude<PrimitiveTypescriptType, "Object" | Import>;
|
|
27
26
|
export declare function mapTypescriptTypeToGraphQLType(fieldName: string, type: PrimitiveTypescriptType | Import | Code): GraphQLType | undefined;
|
|
28
27
|
export declare function isJsonbColumn(p: PrimitiveField): boolean;
|
|
29
|
-
//#endregion
|
|
30
28
|
//# sourceMappingURL=graphqlUtils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlUtils.d.cts","names":[],"sources":["../src/graphqlUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphqlUtils.d.cts","names":[],"sources":["../src/graphqlUtils.ts"],"mappings":";;;;YAkBY;EACV;EACA;EACA;EACA;EACA;EAEA;EACA;;YAGU;EAAa;EAAc;EAAoB;EAAqB;;YAEpE,WAAW,WAAW;;wBAGZ,eAAe,IAAI,IAAI,cAAc,QAAQ,aAAa;wBAyB1D,cAAc,kBAAkB;YA+J1C;YAEA,2BAA2B,QAAQ,oCAAoC;wBAEnE,+BACd,mBACA,MAAM,0BAA0B,SAAS,OACxC;wBAoCa,cAAc,GAAG"}
|
package/build/graphqlUtils.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.mjs";
|
|
2
2
|
import { PrimitiveField, PrimitiveTypescriptType } from "joist-codegen";
|
|
3
3
|
import { Code, Import } from "ts-poet";
|
|
4
|
-
//#region src/graphqlUtils.d.ts
|
|
5
4
|
/** A type for the fields we want to add to `*.graphql` files. */
|
|
6
5
|
export type GqlField = {
|
|
7
6
|
file: string;
|
|
@@ -26,5 +25,4 @@ export type GraphQLType = "BigInt" | "Boolean" | "String" | "Int" | "Date" | "Da
|
|
|
26
25
|
export type SupportedTypescriptTypes = Exclude<PrimitiveTypescriptType, "Object" | Import>;
|
|
27
26
|
export declare function mapTypescriptTypeToGraphQLType(fieldName: string, type: PrimitiveTypescriptType | Import | Code): GraphQLType | undefined;
|
|
28
27
|
export declare function isJsonbColumn(p: PrimitiveField): boolean;
|
|
29
|
-
//#endregion
|
|
30
28
|
//# sourceMappingURL=graphqlUtils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlUtils.d.mts","names":[],"sources":["../src/graphqlUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphqlUtils.d.mts","names":[],"sources":["../src/graphqlUtils.ts"],"mappings":";;;;YAkBY;EACV;EACA;EACA;EACA;EACA;EAEA;EACA;;YAGU;EAAa;EAAc;EAAoB;EAAqB;;YAEpE,WAAW,WAAW;;wBAGZ,eAAe,IAAI,IAAI,cAAc,QAAQ,aAAa;wBAyB1D,cAAc,kBAAkB;YA+J1C;YAEA,2BAA2B,QAAQ,oCAAoC;wBAEnE,+BACd,mBACA,MAAM,0BAA0B,SAAS,OACxC;wBAoCa,cAAc,GAAG"}
|
package/build/graphqlUtils.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Code, Import } from "ts-poet";
|
|
|
4
4
|
import { groupBy } from "joist-utils";
|
|
5
5
|
import { parse, print, visit } from "graphql";
|
|
6
6
|
import prettier, { resolveConfig } from "prettier";
|
|
7
|
-
|
|
7
|
+
// src/graphqlUtils.ts
|
|
8
8
|
/** Given a `file` and `fields` to go in it (for potentially different objects), upserts into the existing types. */
|
|
9
9
|
async function upsertIntoFile(fs, file, fields) {
|
|
10
10
|
const byObjectName = groupBy(fields, (f) => f.objectName);
|
|
@@ -148,7 +148,6 @@ function mapTypescriptTypeToGraphQLType(fieldName, type) {
|
|
|
148
148
|
function isJsonbColumn(p) {
|
|
149
149
|
return p.fieldType === "Object" || p.fieldType instanceof Import;
|
|
150
150
|
}
|
|
151
|
-
//#endregion
|
|
152
151
|
export { formatGraphQL, isJsonbColumn, mapTypescriptTypeToGraphQLType, upsertIntoFile };
|
|
153
152
|
|
|
154
153
|
//# sourceMappingURL=graphqlUtils.js.map
|
package/build/history.cjs
CHANGED
|
@@ -3,22 +3,21 @@ const require_utils = require("./utils.cjs");
|
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
let _dprint_formatter = require("@dprint/formatter");
|
|
5
5
|
let _dprint_json = require("@dprint/json");
|
|
6
|
-
|
|
6
|
+
// src/history.ts
|
|
7
7
|
const jsonFormatter = (0, _dprint_formatter.createFromBuffer)((0, fs.readFileSync)((0, _dprint_json.getPath)()));
|
|
8
8
|
const configPath = ".history.json";
|
|
9
|
-
async function loadHistory(fs
|
|
10
|
-
const content = await fs
|
|
9
|
+
async function loadHistory(fs) {
|
|
10
|
+
const content = await fs.load(configPath);
|
|
11
11
|
return content ? JSON.parse(content.toString()) : {};
|
|
12
12
|
}
|
|
13
|
-
async function writeHistory(fs
|
|
13
|
+
async function writeHistory(fs, history) {
|
|
14
14
|
const input = JSON.stringify(require_utils.sortKeys(history));
|
|
15
15
|
const content = jsonFormatter.formatText({
|
|
16
16
|
filePath: "test.json",
|
|
17
17
|
fileText: input
|
|
18
18
|
});
|
|
19
|
-
await fs
|
|
19
|
+
await fs.save(configPath, content);
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
exports.loadHistory = loadHistory;
|
|
23
22
|
exports.writeHistory = writeHistory;
|
|
24
23
|
|
package/build/history.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.cjs","names":["createFromBuffer","readFileSync","getPath","
|
|
1
|
+
{"version":3,"file":"history.cjs","names":["createFromBuffer","readFileSync","getPath","sortKeys"],"sources":["../src/history.ts"],"sourcesContent":["import { readFileSync } from \"fs\";\n\nimport { createFromBuffer } from \"@dprint/formatter\";\nimport { getPath } from \"@dprint/json\";\n\nimport { type Fs, sortKeys } from \"./utils.ts\";\n\n/** A map from GraphQL object type name -> its field names that have already been scaffolded. */\nexport type History = Record<string, string[]>;\n\nconst jsonFormatter = createFromBuffer(readFileSync(getPath()));\nconst configPath = \".history.json\";\n\nexport async function loadHistory(fs: Fs): Promise<History> {\n const content = await fs.load(configPath);\n return content ? JSON.parse(content.toString()) : {};\n}\n\nexport async function writeHistory(fs: Fs, history: History): Promise<void> {\n const input = JSON.stringify(sortKeys(history));\n const content = jsonFormatter.formatText({ filePath: \"test.json\", fileText: input });\n await fs.save(configPath, content);\n}\n"],"mappings":";;;;;;AAUA,MAAM,iBAAA,GAAgBA,kBAAAA,iBAAAA,EAAAA,GAAiBC,GAAAA,aAAAA,EAAAA,GAAaC,aAAAA,QAAAA,CAAQ,CAAC,CAAC;AAC9D,MAAM,aAAa;AAEnB,eAAsB,YAAY,IAA0B;CAC1D,MAAM,UAAU,MAAM,GAAG,KAAK,UAAU;CACxC,OAAO,UAAU,KAAK,MAAM,QAAQ,SAAS,CAAC,IAAI,CAAC;AACrD;AAEA,eAAsB,aAAa,IAAQ,SAAiC;CAC1E,MAAM,QAAQ,KAAK,UAAUC,cAAAA,SAAS,OAAO,CAAC;CAC9C,MAAM,UAAU,cAAc,WAAW;EAAE,UAAU;EAAa,UAAU;CAAM,CAAC;CACnF,MAAM,GAAG,KAAK,YAAY,OAAO;AACnC"}
|
package/build/history.d.cts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.cjs";
|
|
2
|
-
//#region src/history.d.ts
|
|
3
2
|
/** A map from GraphQL object type name -> its field names that have already been scaffolded. */
|
|
4
3
|
export type History = Record<string, string[]>;
|
|
5
4
|
export declare function loadHistory(fs: Fs): Promise<History>;
|
|
6
5
|
export declare function writeHistory(fs: Fs, history: History): Promise<void>;
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=history.d.cts.map
|
package/build/history.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.cts","names":[],"sources":["../src/history.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.cts","names":[],"sources":["../src/history.ts"],"mappings":";;YAQY,UAAU;wBAKA,YAAY,IAAI,KAAK,QAAQ;wBAK7B,aAAa,IAAI,IAAI,SAAS,UAAU"}
|
package/build/history.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.mjs";
|
|
2
|
-
//#region src/history.d.ts
|
|
3
2
|
/** A map from GraphQL object type name -> its field names that have already been scaffolded. */
|
|
4
3
|
export type History = Record<string, string[]>;
|
|
5
4
|
export declare function loadHistory(fs: Fs): Promise<History>;
|
|
6
5
|
export declare function writeHistory(fs: Fs, history: History): Promise<void>;
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=history.d.mts.map
|
package/build/history.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.mts","names":[],"sources":["../src/history.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.mts","names":[],"sources":["../src/history.ts"],"mappings":";;YAQY,UAAU;wBAKA,YAAY,IAAI,KAAK,QAAQ;wBAK7B,aAAa,IAAI,IAAI,SAAS,UAAU"}
|
package/build/history.js
CHANGED
|
@@ -2,7 +2,7 @@ import { sortKeys } from "./utils.js";
|
|
|
2
2
|
import { readFileSync } from "fs";
|
|
3
3
|
import { createFromBuffer } from "@dprint/formatter";
|
|
4
4
|
import { getPath } from "@dprint/json";
|
|
5
|
-
|
|
5
|
+
// src/history.ts
|
|
6
6
|
const jsonFormatter = createFromBuffer(readFileSync(getPath()));
|
|
7
7
|
const configPath = ".history.json";
|
|
8
8
|
async function loadHistory(fs) {
|
|
@@ -17,7 +17,6 @@ async function writeHistory(fs, history) {
|
|
|
17
17
|
});
|
|
18
18
|
await fs.save(configPath, content);
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { loadHistory, writeHistory };
|
|
22
21
|
|
|
23
22
|
//# sourceMappingURL=history.js.map
|
package/build/index.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils = require("./utils.cjs");
|
|
3
2
|
const require_generateEnumDetailResolvers = require("./generateEnumDetailResolvers.cjs");
|
|
4
3
|
const require_generateEnumsGraphql = require("./generateEnumsGraphql.cjs");
|
|
5
4
|
const require_generateGraphqlCodegen = require("./generateGraphqlCodegen.cjs");
|
|
6
|
-
const require_history = require("./history.cjs");
|
|
7
5
|
const require_generateGraphqlSchemaFiles = require("./generateGraphqlSchemaFiles.cjs");
|
|
8
6
|
const require_generateObjectResolvers = require("./generateObjectResolvers.cjs");
|
|
9
7
|
const require_generateQueryPageResolvers = require("./generateQueryPageResolvers.cjs");
|
|
10
8
|
const require_generateQueryResolvers = require("./generateQueryResolvers.cjs");
|
|
11
9
|
const require_generateResolverUtils = require("./generateResolverUtils.cjs");
|
|
12
10
|
const require_generateSaveResolvers = require("./generateSaveResolvers.cjs");
|
|
11
|
+
const require_history = require("./history.cjs");
|
|
12
|
+
const require_utils = require("./utils.cjs");
|
|
13
13
|
require("joist-codegen");
|
|
14
14
|
require("ts-poet");
|
|
15
|
-
|
|
15
|
+
// src/index.ts
|
|
16
16
|
async function run(config, dbMeta) {
|
|
17
17
|
const fs = require_utils.newFsImpl("./schema");
|
|
18
18
|
await require_generateGraphqlSchemaFiles.generateGraphqlSchemaFiles(config, fs, dbMeta);
|
|
@@ -51,7 +51,6 @@ function contentToString(file, esmExt) {
|
|
|
51
51
|
importExtensions: esmExt || false
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
//#endregion
|
|
55
54
|
exports.run = run;
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=index.cjs.map
|
package/build/index.d.cts
CHANGED
package/build/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;wBAesB,IAAI,QAAQ,QAAQ,QAAQ,aAAa,QAAQ"}
|
package/build/index.d.mts
CHANGED
package/build/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;wBAesB,IAAI,QAAQ,QAAQ,QAAQ,aAAa,QAAQ"}
|
package/build/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { getImportExtension, newFsImpl } from "./utils.js";
|
|
2
1
|
import { generateEnumDetailResolvers } from "./generateEnumDetailResolvers.js";
|
|
3
2
|
import { generateEnumsGraphql } from "./generateEnumsGraphql.js";
|
|
4
3
|
import { generateGraphqlCodegen } from "./generateGraphqlCodegen.js";
|
|
5
|
-
import { loadHistory, writeHistory } from "./history.js";
|
|
6
4
|
import { generateGraphqlSchemaFiles } from "./generateGraphqlSchemaFiles.js";
|
|
7
5
|
import { generateObjectResolvers } from "./generateObjectResolvers.js";
|
|
8
6
|
import { generateQueryPageResolvers } from "./generateQueryPageResolvers.js";
|
|
9
7
|
import { generateQueryResolvers } from "./generateQueryResolvers.js";
|
|
10
8
|
import { generateResolverUtils } from "./generateResolverUtils.js";
|
|
11
9
|
import { generateSaveResolvers } from "./generateSaveResolvers.js";
|
|
10
|
+
import { loadHistory, writeHistory } from "./history.js";
|
|
11
|
+
import { getImportExtension, newFsImpl } from "./utils.js";
|
|
12
12
|
import "joist-codegen";
|
|
13
13
|
import "ts-poet";
|
|
14
|
-
|
|
14
|
+
// src/index.ts
|
|
15
15
|
async function run(config, dbMeta) {
|
|
16
16
|
const fs = newFsImpl("./schema");
|
|
17
17
|
await generateGraphqlSchemaFiles(config, fs, dbMeta);
|
|
@@ -50,7 +50,6 @@ function contentToString(file, esmExt) {
|
|
|
50
50
|
importExtensions: esmExt || false
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
53
|
export { run };
|
|
55
54
|
|
|
56
55
|
//# sourceMappingURL=index.js.map
|
package/build/testUtils.cjs
CHANGED
|
@@ -7,7 +7,7 @@ let pluralize = require("pluralize");
|
|
|
7
7
|
pluralize = require_runtime.__toESM(pluralize, 1);
|
|
8
8
|
let ts_poet = require("ts-poet");
|
|
9
9
|
let joist_utils = require("joist-utils");
|
|
10
|
-
|
|
10
|
+
// src/testUtils.ts
|
|
11
11
|
const { plural } = pluralize.default;
|
|
12
12
|
function newFs(files) {
|
|
13
13
|
return {
|
|
@@ -180,7 +180,6 @@ function renderCodegenFile(file, config) {
|
|
|
180
180
|
importExtensions: esmExt || false
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
//#endregion
|
|
184
183
|
exports.newDbMeta = newDbMeta;
|
|
185
184
|
exports.newEntityMetadata = newEntityMetadata;
|
|
186
185
|
exports.newEnumField = newEnumField;
|
package/build/testUtils.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.cjs";
|
|
2
2
|
import { Config, DbMetadata, EntityDbMetadata, EnumField, ManyToOneField, PolymorphicField, PrimitiveField } from "joist-codegen";
|
|
3
3
|
import { CodegenFile } from "ts-poet";
|
|
4
|
-
//#region src/testUtils.d.ts
|
|
5
4
|
export declare function newFs(files: Record<string, string>): Fs;
|
|
6
5
|
export declare function newDbMeta(opt: EntityDbMetadata[] | Partial<DbMetadata>): DbMetadata;
|
|
7
6
|
export declare function newPrimitiveField(fieldName: string, opts?: Partial<PrimitiveField>): PrimitiveField;
|
|
@@ -15,5 +14,4 @@ export declare function newPolymorphicField(fieldName: string, components: strin
|
|
|
15
14
|
* This reproduces the same logic used in production when saving files.
|
|
16
15
|
*/
|
|
17
16
|
export declare function renderCodegenFile(file: CodegenFile, config: Config): string;
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=testUtils.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.d.cts","names":[],"sources":["../src/testUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"testUtils.d.cts","names":[],"sources":["../src/testUtils.ts"],"mappings":";;;wBAmBgB,MAAM,OAAO,yBAAyB;wBAUtC,UAAU,KAAK,qBAAqB,QAAQ,cAAc;wBAsB1D,kBAAkB,mBAAmB,OAAM,QAAQ,kBAAuB;wBAyB1E,kBAAkB,cAAc,OAAM,QAAQ,oBAAyB;wBAsCvE,aAAa,mBAAmB,OAAM,QAAQ,aAAkB;wBA4BhE,kBACd,mBACA,qBACA,OAAM,QAAQ,kBACb;;wBAsBa,oBACd,mBACA,sBACA,OAAM,QAAQ,oBACb;;;;;wBAwBa,kBAAkB,MAAM,aAAa,QAAQ"}
|
package/build/testUtils.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Fs } from "./utils.mjs";
|
|
2
2
|
import { Config, DbMetadata, EntityDbMetadata, EnumField, ManyToOneField, PolymorphicField, PrimitiveField } from "joist-codegen";
|
|
3
3
|
import { CodegenFile } from "ts-poet";
|
|
4
|
-
//#region src/testUtils.d.ts
|
|
5
4
|
export declare function newFs(files: Record<string, string>): Fs;
|
|
6
5
|
export declare function newDbMeta(opt: EntityDbMetadata[] | Partial<DbMetadata>): DbMetadata;
|
|
7
6
|
export declare function newPrimitiveField(fieldName: string, opts?: Partial<PrimitiveField>): PrimitiveField;
|
|
@@ -15,5 +14,4 @@ export declare function newPolymorphicField(fieldName: string, components: strin
|
|
|
15
14
|
* This reproduces the same logic used in production when saving files.
|
|
16
15
|
*/
|
|
17
16
|
export declare function renderCodegenFile(file: CodegenFile, config: Config): string;
|
|
18
|
-
//#endregion
|
|
19
17
|
//# sourceMappingURL=testUtils.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.d.mts","names":[],"sources":["../src/testUtils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"testUtils.d.mts","names":[],"sources":["../src/testUtils.ts"],"mappings":";;;wBAmBgB,MAAM,OAAO,yBAAyB;wBAUtC,UAAU,KAAK,qBAAqB,QAAQ,cAAc;wBAsB1D,kBAAkB,mBAAmB,OAAM,QAAQ,kBAAuB;wBAyB1E,kBAAkB,cAAc,OAAM,QAAQ,oBAAyB;wBAsCvE,aAAa,mBAAmB,OAAM,QAAQ,aAAkB;wBA4BhE,kBACd,mBACA,qBACA,OAAM,QAAQ,kBACb;;wBAsBa,oBACd,mBACA,sBACA,OAAM,QAAQ,oBACb;;;;;wBAwBa,kBAAkB,MAAM,aAAa,QAAQ"}
|
package/build/testUtils.js
CHANGED
|
@@ -4,7 +4,7 @@ import { makeEntity } from "joist-codegen";
|
|
|
4
4
|
import pluralize from "pluralize";
|
|
5
5
|
import { imp } from "ts-poet";
|
|
6
6
|
import { keyBy } from "joist-utils";
|
|
7
|
-
|
|
7
|
+
// src/testUtils.ts
|
|
8
8
|
const { plural } = pluralize;
|
|
9
9
|
function newFs(files) {
|
|
10
10
|
return {
|
|
@@ -177,7 +177,6 @@ function renderCodegenFile(file, config) {
|
|
|
177
177
|
importExtensions: esmExt || false
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
//#endregion
|
|
181
180
|
export { newDbMeta, newEntityMetadata, newEnumField, newFs, newManyToOneField, newPolymorphicField, newPrimitiveField, renderCodegenFile };
|
|
182
181
|
|
|
183
182
|
//# sourceMappingURL=testUtils.js.map
|
package/build/utils.cjs
CHANGED
|
@@ -3,7 +3,7 @@ require("joist-codegen");
|
|
|
3
3
|
let fs = require("fs");
|
|
4
4
|
let path = require("path");
|
|
5
5
|
let joist_utils = require("joist-utils");
|
|
6
|
-
|
|
6
|
+
// src/utils.ts
|
|
7
7
|
/** A real implementation of `Fs` that writes to the `prefix` directory. */
|
|
8
8
|
function newFsImpl(prefix) {
|
|
9
9
|
return {
|
|
@@ -42,7 +42,6 @@ function getImportExtension(config) {
|
|
|
42
42
|
function getEntitiesImportPath(config) {
|
|
43
43
|
return config.esm ? "src/entities/index.ts" : "src/entities";
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.getEntitiesImportPath = getEntitiesImportPath;
|
|
47
46
|
exports.getImportExtension = getImportExtension;
|
|
48
47
|
exports.newFsImpl = newFsImpl;
|
package/build/utils.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config } from "joist-codegen";
|
|
2
|
-
//#region src/utils.d.ts
|
|
3
2
|
/** A super-simple file system abstraction for testing. */
|
|
4
3
|
export interface Fs {
|
|
5
4
|
load(fileName: string): Promise<string | undefined>;
|
|
@@ -11,5 +10,4 @@ export declare function newFsImpl(prefix: string): Fs;
|
|
|
11
10
|
export declare function sortKeys<T extends object>(o: T): T;
|
|
12
11
|
export declare function getImportExtension(config: Config): "ts" | "js" | null;
|
|
13
12
|
export declare function getEntitiesImportPath(config: Config): string;
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=utils.d.cts.map
|
package/build/utils.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.ts"],"mappings":";;iBAOiB;EACf,KAAK,mBAAmB;EACxB,KAAK,kBAAkB,kBAAkB;EACzC,OAAO,mBAAmB;;;wBAIZ,UAAU,iBAAiB;wBA2B3B,SAAS,kBAAkB,GAAG,IAAI;wBAmBlC,mBAAmB,QAAQ;wBAI3B,sBAAsB,QAAQ"}
|
package/build/utils.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Config } from "joist-codegen";
|
|
2
|
-
//#region src/utils.d.ts
|
|
3
2
|
/** A super-simple file system abstraction for testing. */
|
|
4
3
|
export interface Fs {
|
|
5
4
|
load(fileName: string): Promise<string | undefined>;
|
|
@@ -11,5 +10,4 @@ export declare function newFsImpl(prefix: string): Fs;
|
|
|
11
10
|
export declare function sortKeys<T extends object>(o: T): T;
|
|
12
11
|
export declare function getImportExtension(config: Config): "ts" | "js" | null;
|
|
13
12
|
export declare function getEntitiesImportPath(config: Config): string;
|
|
14
|
-
//#endregion
|
|
15
13
|
//# sourceMappingURL=utils.d.mts.map
|
package/build/utils.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.ts"],"mappings":";;iBAOiB;EACf,KAAK,mBAAmB;EACxB,KAAK,kBAAkB,kBAAkB;EACzC,OAAO,mBAAmB;;;wBAIZ,UAAU,iBAAiB;wBA2B3B,SAAS,kBAAkB,GAAG,IAAI;wBAmBlC,mBAAmB,QAAQ;wBAI3B,sBAAsB,QAAQ"}
|
package/build/utils.js
CHANGED
|
@@ -2,7 +2,7 @@ import "joist-codegen";
|
|
|
2
2
|
import { promises } from "fs";
|
|
3
3
|
import { dirname } from "path";
|
|
4
4
|
import { isPlainObject } from "joist-utils";
|
|
5
|
-
|
|
5
|
+
// src/utils.ts
|
|
6
6
|
/** A real implementation of `Fs` that writes to the `prefix` directory. */
|
|
7
7
|
function newFsImpl(prefix) {
|
|
8
8
|
return {
|
|
@@ -41,7 +41,6 @@ function getImportExtension(config) {
|
|
|
41
41
|
function getEntitiesImportPath(config) {
|
|
42
42
|
return config.esm ? "src/entities/index.ts" : "src/entities";
|
|
43
43
|
}
|
|
44
|
-
//#endregion
|
|
45
44
|
export { getEntitiesImportPath, getImportExtension, newFsImpl, sortKeys };
|
|
46
45
|
|
|
47
46
|
//# sourceMappingURL=utils.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joist-graphql-codegen",
|
|
3
|
-
"version": "2.5.0-next.
|
|
3
|
+
"version": "2.5.0-next.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"build"
|
|
40
40
|
],
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"joist-codegen": "2.5.0-next.
|
|
43
|
-
"joist-utils": "2.5.0-next.
|
|
42
|
+
"joist-codegen": "2.5.0-next.9",
|
|
43
|
+
"joist-utils": "2.5.0-next.9",
|
|
44
44
|
"pg-types": "^4.1.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"ts-poet": "^6.12.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@swc/core": "1.16.
|
|
56
|
+
"@swc/core": "1.16.21",
|
|
57
57
|
"@swc/jest": "^0.2.39",
|
|
58
58
|
"@types/jest": "^30.0.0",
|
|
59
|
-
"@types/node": "^26.6.
|
|
59
|
+
"@types/node": "^26.6.6",
|
|
60
60
|
"jest": "30.4.2",
|
|
61
61
|
"tsconfig-paths": "^4.2.0",
|
|
62
62
|
"typescript": "7.0.2"
|