@cedarjs/internal 2.6.1-next.0 → 2.7.0-rc.107
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/dist/cjs/generate/graphqlCodeGen.d.ts.map +1 -1
- package/dist/cjs/generate/graphqlCodeGen.js +9 -12
- package/dist/cjs/generate/templates/all-gqlorm.d.ts.template +7 -0
- package/dist/cjs/generate/typeDefinitions.d.ts +1 -0
- package/dist/cjs/generate/typeDefinitions.d.ts.map +1 -1
- package/dist/cjs/generate/typeDefinitions.js +6 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/project.d.ts +1 -0
- package/dist/cjs/project.d.ts.map +1 -1
- package/dist/cjs/project.js +10 -0
- package/dist/generate/graphqlCodeGen.d.ts.map +1 -1
- package/dist/generate/graphqlCodeGen.js +15 -14
- package/dist/generate/templates/all-gqlorm.d.ts.template +7 -0
- package/dist/generate/typeDefinitions.d.ts +1 -0
- package/dist/generate/typeDefinitions.d.ts.map +1 -1
- package/dist/generate/typeDefinitions.js +5 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/project.d.ts +1 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +10 -1
- package/package.json +20 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAkB9D,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CAmFvE,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CA0DvE,CAAA;AAiCD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;SACD,MAAM;GAQ5D;AAkHD,eAAO,MAAM,iBAAiB,4RAe7B,CAAA"}
|
|
@@ -63,13 +63,12 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
63
63
|
const dtsFiles = [];
|
|
64
64
|
try {
|
|
65
65
|
const output = await sdlCodegen.runFullCodegen("redwood", { paths });
|
|
66
|
-
dtsFiles.
|
|
66
|
+
dtsFiles.push(...output.paths);
|
|
67
67
|
} catch (e) {
|
|
68
68
|
if (e instanceof Error) {
|
|
69
|
-
errors.push({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
69
|
+
errors.push({ message: e.message, error: e });
|
|
70
|
+
} else {
|
|
71
|
+
throw e;
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
@@ -82,14 +81,15 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
82
81
|
const prismaImports = Object.keys(prismaModels).map((key) => {
|
|
83
82
|
return `${key} as Prisma${key}`;
|
|
84
83
|
});
|
|
84
|
+
const prismaImportSource = (0, import_project.dbReexportsPrismaClient)() ? "src/lib/db" : "@prisma/client";
|
|
85
85
|
const extraPlugins = [
|
|
86
86
|
{
|
|
87
87
|
name: "add",
|
|
88
88
|
options: {
|
|
89
89
|
content: [
|
|
90
|
-
|
|
90
|
+
`import { Prisma } from "${prismaImportSource}"`,
|
|
91
91
|
"import { MergePrismaWithSdlTypes, MakeRelationsOptional } from '@cedarjs/api'",
|
|
92
|
-
`import { ${prismaImports.join(", ")} } from '
|
|
92
|
+
`import { ${prismaImports.join(", ")} } from '${prismaImportSource}'`
|
|
93
93
|
],
|
|
94
94
|
placement: "prepend"
|
|
95
95
|
},
|
|
@@ -144,7 +144,7 @@ const generateTypeDefGraphQLWeb = async () => {
|
|
|
144
144
|
{
|
|
145
145
|
name: "add",
|
|
146
146
|
options: {
|
|
147
|
-
content:
|
|
147
|
+
content: `import { Prisma } from "${(0, import_project.dbReexportsPrismaClient)() ? "$api/src/lib/db" : "@prisma/client"}"`,
|
|
148
148
|
placement: "prepend"
|
|
149
149
|
},
|
|
150
150
|
codegenPlugin: addPlugin
|
|
@@ -204,10 +204,7 @@ async function getPrismaClient(hasGenerated = false) {
|
|
|
204
204
|
let localPrisma;
|
|
205
205
|
if (hasGenerated) {
|
|
206
206
|
const cacheBuster = `?t=${Date.now()}`;
|
|
207
|
-
const prismaClientPath =
|
|
208
|
-
process.cwd(),
|
|
209
|
-
"node_modules/.prisma/client/index.js"
|
|
210
|
-
);
|
|
207
|
+
const prismaClientPath = (0, import_project_config.resolveGeneratedPrismaClient)({ mustExist: true });
|
|
211
208
|
const { default: freshPrisma } = await import(`file://${prismaClientPath}${cacheBuster}`);
|
|
212
209
|
localPrisma = freshPrisma;
|
|
213
210
|
} else {
|
|
@@ -18,6 +18,7 @@ export declare const generateMirrorCell: (p: string, rwjsPaths?: import("@cedarj
|
|
|
18
18
|
export declare const generateTypeDefRouterRoutes: () => string[];
|
|
19
19
|
export declare const generateTypeDefRouterPages: () => string[];
|
|
20
20
|
export declare const generateTypeDefCurrentUser: () => string[];
|
|
21
|
+
export declare const generateTypeDefGqlorm: () => string[];
|
|
21
22
|
export declare const generateTypeDefScenarios: () => string[];
|
|
22
23
|
export declare const generateTypeDefTestMocks: () => string[];
|
|
23
24
|
export declare const generateTypeDefGlobImports: () => string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.d.ts","sourceRoot":"","sources":["../../../src/generate/typeDefinitions.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;
|
|
1
|
+
{"version":3,"file":"typeDefinitions.d.ts","sourceRoot":"","sources":["../../../src/generate/typeDefinitions.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;EA0B5B,CAAA;AAED,eAAO,MAAM,mCAAmC,gBAK/C,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,GAAG,MAAM,EACT,mDAAsB,aASvB,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,GAAG,MAAM,EACT,mDAAsB,WAoDvB,CAAA;AAED,eAAO,MAAM,mBAAmB,gBAG/B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,mDAAsB,aAQlE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,EAAE,mDAAsB,WA8DnE,CAAA;AAiBD,eAAO,MAAM,2BAA2B,gBAmEvC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBA8CtC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBAEtC,CAAA;AAED,eAAO,MAAM,qBAAqB,gBAEjC,CAAA;AAED,eAAO,MAAM,wBAAwB,gBAEpC,CAAA;AAED,eAAO,MAAM,wBAAwB,gBAKpC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBAEtC,CAAA;AAED,eAAO,MAAM,4BAA4B,gBAExC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,gBAW5C,CAAA"}
|
|
@@ -35,6 +35,7 @@ __export(typeDefinitions_exports, {
|
|
|
35
35
|
generateTypeDefCurrentUser: () => generateTypeDefCurrentUser,
|
|
36
36
|
generateTypeDefGlobImports: () => generateTypeDefGlobImports,
|
|
37
37
|
generateTypeDefGlobalContext: () => generateTypeDefGlobalContext,
|
|
38
|
+
generateTypeDefGqlorm: () => generateTypeDefGqlorm,
|
|
38
39
|
generateTypeDefRouterPages: () => generateTypeDefRouterPages,
|
|
39
40
|
generateTypeDefRouterRoutes: () => generateTypeDefRouterRoutes,
|
|
40
41
|
generateTypeDefScenarios: () => generateTypeDefScenarios,
|
|
@@ -64,6 +65,7 @@ const generateTypeDefs = async () => {
|
|
|
64
65
|
...generateMirrorCells(),
|
|
65
66
|
...generateTypeDefRouterPages(),
|
|
66
67
|
...generateTypeDefCurrentUser(),
|
|
68
|
+
...generateTypeDefGqlorm(),
|
|
67
69
|
...generateTypeDefRouterRoutes(),
|
|
68
70
|
...generateTypeDefGlobImports(),
|
|
69
71
|
...generateTypeDefGlobalContext(),
|
|
@@ -298,6 +300,9 @@ const generateTypeDefRouterPages = () => {
|
|
|
298
300
|
const generateTypeDefCurrentUser = () => {
|
|
299
301
|
return writeTypeDefIncludeFile("all-currentUser.d.ts.template");
|
|
300
302
|
};
|
|
303
|
+
const generateTypeDefGqlorm = () => {
|
|
304
|
+
return writeTypeDefIncludeFile("all-gqlorm.d.ts.template");
|
|
305
|
+
};
|
|
301
306
|
const generateTypeDefScenarios = () => {
|
|
302
307
|
return writeTypeDefIncludeFile("api-scenarios.d.ts.template");
|
|
303
308
|
};
|
|
@@ -358,6 +363,7 @@ function generateStubStorybookTypes() {
|
|
|
358
363
|
generateTypeDefCurrentUser,
|
|
359
364
|
generateTypeDefGlobImports,
|
|
360
365
|
generateTypeDefGlobalContext,
|
|
366
|
+
generateTypeDefGqlorm,
|
|
361
367
|
generateTypeDefRouterPages,
|
|
362
368
|
generateTypeDefRouterRoutes,
|
|
363
369
|
generateTypeDefScenarios,
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from '@cedarjs/project-config';
|
|
|
2
2
|
export * from './ts2js.js';
|
|
3
3
|
export * from './dev.js';
|
|
4
4
|
export * from './routes.js';
|
|
5
|
+
export { dbReexportsPrismaClient } from './project.js';
|
|
5
6
|
export * from './files.js';
|
|
6
7
|
export { generate } from './generate/generate.js';
|
|
7
8
|
export { buildApi } from './build/api.js';
|
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,uBAAuB,CAAA;AAErC,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var src_exports = {};
|
|
21
21
|
__export(src_exports, {
|
|
22
22
|
buildApi: () => import_api.buildApi,
|
|
23
|
+
dbReexportsPrismaClient: () => import_project.dbReexportsPrismaClient,
|
|
23
24
|
generate: () => import_generate.generate,
|
|
24
25
|
listQueryTypeFieldsInProject: () => import_gql.listQueryTypeFieldsInProject
|
|
25
26
|
});
|
|
@@ -28,6 +29,7 @@ __reExport(src_exports, require("@cedarjs/project-config"), module.exports);
|
|
|
28
29
|
__reExport(src_exports, require("./ts2js.js"), module.exports);
|
|
29
30
|
__reExport(src_exports, require("./dev.js"), module.exports);
|
|
30
31
|
__reExport(src_exports, require("./routes.js"), module.exports);
|
|
32
|
+
var import_project = require("./project.js");
|
|
31
33
|
__reExport(src_exports, require("./files.js"), module.exports);
|
|
32
34
|
var import_generate = require("./generate/generate.js");
|
|
33
35
|
var import_api = require("./build/api.js");
|
|
@@ -37,6 +39,7 @@ var import_gql = require("./gql.js");
|
|
|
37
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
40
|
0 && (module.exports = {
|
|
39
41
|
buildApi,
|
|
42
|
+
dbReexportsPrismaClient,
|
|
40
43
|
generate,
|
|
41
44
|
listQueryTypeFieldsInProject,
|
|
42
45
|
...require("@cedarjs/project-config"),
|
package/dist/cjs/project.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export declare const getTsConfigs: () => {
|
|
|
5
5
|
export declare const isTypeScriptProject: () => boolean;
|
|
6
6
|
export declare const isServerFileSetup: () => boolean;
|
|
7
7
|
export declare const isRealtimeSetup: () => boolean;
|
|
8
|
+
export declare const dbReexportsPrismaClient: () => boolean;
|
|
8
9
|
//# sourceMappingURL=project.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/project.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;CAuBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,iBAAiB,eAO7B,CAAA;AAED,eAAO,MAAM,eAAe,eAO3B,CAAA"}
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/project.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;CAuBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,iBAAiB,eAO7B,CAAA;AAED,eAAO,MAAM,eAAe,eAO3B,CAAA;AAED,eAAO,MAAM,uBAAuB,eAUnC,CAAA"}
|
package/dist/cjs/project.js
CHANGED
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var project_exports = {};
|
|
30
30
|
__export(project_exports, {
|
|
31
|
+
dbReexportsPrismaClient: () => dbReexportsPrismaClient,
|
|
31
32
|
getTsConfigs: () => getTsConfigs,
|
|
32
33
|
isRealtimeSetup: () => isRealtimeSetup,
|
|
33
34
|
isServerFileSetup: () => isServerFileSetup,
|
|
@@ -73,8 +74,17 @@ const isRealtimeSetup = () => {
|
|
|
73
74
|
);
|
|
74
75
|
return import_node_fs.default.existsSync(realtimePath);
|
|
75
76
|
};
|
|
77
|
+
const dbReexportsPrismaClient = () => {
|
|
78
|
+
const dbPath = (0, import_project_config.resolveFile)(import_path.default.join((0, import_project_config.getPaths)().api.lib, "db"));
|
|
79
|
+
if (!dbPath) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const content = import_node_fs.default.readFileSync(dbPath, "utf-8");
|
|
83
|
+
return /export\s+\*\s+from\s+['"]@prisma\/client['"]/.test(content);
|
|
84
|
+
};
|
|
76
85
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
86
|
0 && (module.exports = {
|
|
87
|
+
dbReexportsPrismaClient,
|
|
78
88
|
getTsConfigs,
|
|
79
89
|
isRealtimeSetup,
|
|
80
90
|
isServerFileSetup,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAkB9D,KAAK,aAAa,GAAG;IACnB,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CAmFvE,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CA0DvE,CAAA;AAiCD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;SACD,MAAM;GAQ5D;AAkHD,eAAO,MAAM,iBAAiB,4RAe7B,CAAA"}
|
|
@@ -10,8 +10,12 @@ import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader";
|
|
|
10
10
|
import { loadDocuments, loadSchemaSync } from "@graphql-tools/load";
|
|
11
11
|
import execa from "execa";
|
|
12
12
|
import { Kind } from "graphql";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
getPaths,
|
|
15
|
+
getConfig,
|
|
16
|
+
resolveGeneratedPrismaClient
|
|
17
|
+
} from "@cedarjs/project-config";
|
|
18
|
+
import { getTsConfigs, dbReexportsPrismaClient } from "../project.js";
|
|
15
19
|
import * as rwTypescriptResolvers from "./plugins/rw-typescript-resolvers/index.js";
|
|
16
20
|
var CodegenSide = /* @__PURE__ */ ((CodegenSide2) => {
|
|
17
21
|
CodegenSide2[CodegenSide2["API"] = 0] = "API";
|
|
@@ -27,13 +31,12 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
27
31
|
const dtsFiles = [];
|
|
28
32
|
try {
|
|
29
33
|
const output = await sdlCodegen.runFullCodegen("redwood", { paths });
|
|
30
|
-
dtsFiles.
|
|
34
|
+
dtsFiles.push(...output.paths);
|
|
31
35
|
} catch (e) {
|
|
32
36
|
if (e instanceof Error) {
|
|
33
|
-
errors.push({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
+
errors.push({ message: e.message, error: e });
|
|
38
|
+
} else {
|
|
39
|
+
throw e;
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
return {
|
|
@@ -46,14 +49,15 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
46
49
|
const prismaImports = Object.keys(prismaModels).map((key) => {
|
|
47
50
|
return `${key} as Prisma${key}`;
|
|
48
51
|
});
|
|
52
|
+
const prismaImportSource = dbReexportsPrismaClient() ? "src/lib/db" : "@prisma/client";
|
|
49
53
|
const extraPlugins = [
|
|
50
54
|
{
|
|
51
55
|
name: "add",
|
|
52
56
|
options: {
|
|
53
57
|
content: [
|
|
54
|
-
|
|
58
|
+
`import { Prisma } from "${prismaImportSource}"`,
|
|
55
59
|
"import { MergePrismaWithSdlTypes, MakeRelationsOptional } from '@cedarjs/api'",
|
|
56
|
-
`import { ${prismaImports.join(", ")} } from '
|
|
60
|
+
`import { ${prismaImports.join(", ")} } from '${prismaImportSource}'`
|
|
57
61
|
],
|
|
58
62
|
placement: "prepend"
|
|
59
63
|
},
|
|
@@ -108,7 +112,7 @@ const generateTypeDefGraphQLWeb = async () => {
|
|
|
108
112
|
{
|
|
109
113
|
name: "add",
|
|
110
114
|
options: {
|
|
111
|
-
content:
|
|
115
|
+
content: `import { Prisma } from "${dbReexportsPrismaClient() ? "$api/src/lib/db" : "@prisma/client"}"`,
|
|
112
116
|
placement: "prepend"
|
|
113
117
|
},
|
|
114
118
|
codegenPlugin: addPlugin
|
|
@@ -168,10 +172,7 @@ async function getPrismaClient(hasGenerated = false) {
|
|
|
168
172
|
let localPrisma;
|
|
169
173
|
if (hasGenerated) {
|
|
170
174
|
const cacheBuster = `?t=${Date.now()}`;
|
|
171
|
-
const prismaClientPath =
|
|
172
|
-
process.cwd(),
|
|
173
|
-
"node_modules/.prisma/client/index.js"
|
|
174
|
-
);
|
|
175
|
+
const prismaClientPath = resolveGeneratedPrismaClient({ mustExist: true });
|
|
175
176
|
const { default: freshPrisma } = await import(`file://${prismaClientPath}${cacheBuster}`);
|
|
176
177
|
localPrisma = freshPrisma;
|
|
177
178
|
} else {
|
|
@@ -18,6 +18,7 @@ export declare const generateMirrorCell: (p: string, rwjsPaths?: import("@cedarj
|
|
|
18
18
|
export declare const generateTypeDefRouterRoutes: () => string[];
|
|
19
19
|
export declare const generateTypeDefRouterPages: () => string[];
|
|
20
20
|
export declare const generateTypeDefCurrentUser: () => string[];
|
|
21
|
+
export declare const generateTypeDefGqlorm: () => string[];
|
|
21
22
|
export declare const generateTypeDefScenarios: () => string[];
|
|
22
23
|
export declare const generateTypeDefTestMocks: () => string[];
|
|
23
24
|
export declare const generateTypeDefGlobImports: () => string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeDefinitions.d.ts","sourceRoot":"","sources":["../../src/generate/typeDefinitions.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;
|
|
1
|
+
{"version":3,"file":"typeDefinitions.d.ts","sourceRoot":"","sources":["../../src/generate/typeDefinitions.ts"],"names":[],"mappings":"AAyCA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;EA0B5B,CAAA;AAED,eAAO,MAAM,mCAAmC,gBAK/C,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,GAAG,MAAM,EACT,mDAAsB,aASvB,CAAA;AAED,eAAO,MAAM,kCAAkC,GAC7C,GAAG,MAAM,EACT,mDAAsB,WAoDvB,CAAA;AAED,eAAO,MAAM,mBAAmB,gBAG/B,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,mDAAsB,aAQlE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,MAAM,EAAE,mDAAsB,WA8DnE,CAAA;AAiBD,eAAO,MAAM,2BAA2B,gBAmEvC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBA8CtC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBAEtC,CAAA;AAED,eAAO,MAAM,qBAAqB,gBAEjC,CAAA;AAED,eAAO,MAAM,wBAAwB,gBAEpC,CAAA;AAED,eAAO,MAAM,wBAAwB,gBAKpC,CAAA;AAED,eAAO,MAAM,0BAA0B,gBAEtC,CAAA;AAED,eAAO,MAAM,4BAA4B,gBAExC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gCAAgC,gBAW5C,CAAA"}
|
|
@@ -25,6 +25,7 @@ const generateTypeDefs = async () => {
|
|
|
25
25
|
...generateMirrorCells(),
|
|
26
26
|
...generateTypeDefRouterPages(),
|
|
27
27
|
...generateTypeDefCurrentUser(),
|
|
28
|
+
...generateTypeDefGqlorm(),
|
|
28
29
|
...generateTypeDefRouterRoutes(),
|
|
29
30
|
...generateTypeDefGlobImports(),
|
|
30
31
|
...generateTypeDefGlobalContext(),
|
|
@@ -259,6 +260,9 @@ const generateTypeDefRouterPages = () => {
|
|
|
259
260
|
const generateTypeDefCurrentUser = () => {
|
|
260
261
|
return writeTypeDefIncludeFile("all-currentUser.d.ts.template");
|
|
261
262
|
};
|
|
263
|
+
const generateTypeDefGqlorm = () => {
|
|
264
|
+
return writeTypeDefIncludeFile("all-gqlorm.d.ts.template");
|
|
265
|
+
};
|
|
262
266
|
const generateTypeDefScenarios = () => {
|
|
263
267
|
return writeTypeDefIncludeFile("api-scenarios.d.ts.template");
|
|
264
268
|
};
|
|
@@ -318,6 +322,7 @@ export {
|
|
|
318
322
|
generateTypeDefCurrentUser,
|
|
319
323
|
generateTypeDefGlobImports,
|
|
320
324
|
generateTypeDefGlobalContext,
|
|
325
|
+
generateTypeDefGqlorm,
|
|
321
326
|
generateTypeDefRouterPages,
|
|
322
327
|
generateTypeDefRouterRoutes,
|
|
323
328
|
generateTypeDefScenarios,
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from '@cedarjs/project-config';
|
|
|
2
2
|
export * from './ts2js.js';
|
|
3
3
|
export * from './dev.js';
|
|
4
4
|
export * from './routes.js';
|
|
5
|
+
export { dbReexportsPrismaClient } from './project.js';
|
|
5
6
|
export * from './files.js';
|
|
6
7
|
export { generate } from './generate/generate.js';
|
|
7
8
|
export { buildApi } from './build/api.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AAEvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,uBAAuB,CAAA;AAErC,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from "@cedarjs/project-config";
|
|
|
2
2
|
export * from "./ts2js.js";
|
|
3
3
|
export * from "./dev.js";
|
|
4
4
|
export * from "./routes.js";
|
|
5
|
+
import { dbReexportsPrismaClient } from "./project.js";
|
|
5
6
|
export * from "./files.js";
|
|
6
7
|
import { generate } from "./generate/generate.js";
|
|
7
8
|
import { buildApi } from "./build/api.js";
|
|
@@ -10,6 +11,7 @@ export * from "@cedarjs/babel-config";
|
|
|
10
11
|
import { listQueryTypeFieldsInProject } from "./gql.js";
|
|
11
12
|
export {
|
|
12
13
|
buildApi,
|
|
14
|
+
dbReexportsPrismaClient,
|
|
13
15
|
generate,
|
|
14
16
|
listQueryTypeFieldsInProject
|
|
15
17
|
};
|
package/dist/project.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export declare const getTsConfigs: () => {
|
|
|
5
5
|
export declare const isTypeScriptProject: () => boolean;
|
|
6
6
|
export declare const isServerFileSetup: () => boolean;
|
|
7
7
|
export declare const isRealtimeSetup: () => boolean;
|
|
8
|
+
export declare const dbReexportsPrismaClient: () => boolean;
|
|
8
9
|
//# sourceMappingURL=project.d.ts.map
|
package/dist/project.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;CAuBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,iBAAiB,eAO7B,CAAA;AAED,eAAO,MAAM,eAAe,eAO3B,CAAA"}
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY;;;CAuBxB,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,iBAAiB,eAO7B,CAAA;AAED,eAAO,MAAM,eAAe,eAO3B,CAAA;AAED,eAAO,MAAM,uBAAuB,eAUnC,CAAA"}
|
package/dist/project.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { parseConfigFileTextToJson } from "typescript";
|
|
4
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
4
|
+
import { getPaths, resolveFile } from "@cedarjs/project-config";
|
|
5
5
|
const getTsConfigs = () => {
|
|
6
6
|
const rwPaths = getPaths();
|
|
7
7
|
const apiTsConfigPath = path.join(rwPaths.api.base, "tsconfig.json");
|
|
@@ -37,7 +37,16 @@ const isRealtimeSetup = () => {
|
|
|
37
37
|
);
|
|
38
38
|
return fs.existsSync(realtimePath);
|
|
39
39
|
};
|
|
40
|
+
const dbReexportsPrismaClient = () => {
|
|
41
|
+
const dbPath = resolveFile(path.join(getPaths().api.lib, "db"));
|
|
42
|
+
if (!dbPath) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const content = fs.readFileSync(dbPath, "utf-8");
|
|
46
|
+
return /export\s+\*\s+from\s+['"]@prisma\/client['"]/.test(content);
|
|
47
|
+
};
|
|
40
48
|
export {
|
|
49
|
+
dbReexportsPrismaClient,
|
|
41
50
|
getTsConfigs,
|
|
42
51
|
isRealtimeSetup,
|
|
43
52
|
isServerFileSetup,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/internal",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0-rc.107",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -60,6 +60,16 @@
|
|
|
60
60
|
"default": "./dist/cjs/gql.js"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
+
"./dist/project": {
|
|
64
|
+
"import": {
|
|
65
|
+
"types": "./dist/project.d.ts",
|
|
66
|
+
"default": "./dist/project.js"
|
|
67
|
+
},
|
|
68
|
+
"require": {
|
|
69
|
+
"types": "./dist/cjs/project.d.ts",
|
|
70
|
+
"default": "./dist/cjs/project.js"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
63
73
|
"./dist/routes.js": {
|
|
64
74
|
"import": {
|
|
65
75
|
"types": "./dist/routes.d.ts",
|
|
@@ -140,10 +150,10 @@
|
|
|
140
150
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
141
151
|
"@babel/runtime-corejs3": "7.29.0",
|
|
142
152
|
"@babel/traverse": "7.29.0",
|
|
143
|
-
"@cedarjs/babel-config": "2.
|
|
144
|
-
"@cedarjs/graphql-server": "2.
|
|
145
|
-
"@cedarjs/project-config": "2.
|
|
146
|
-
"@cedarjs/router": "2.
|
|
153
|
+
"@cedarjs/babel-config": "2.7.0-rc.107",
|
|
154
|
+
"@cedarjs/graphql-server": "2.7.0-rc.107",
|
|
155
|
+
"@cedarjs/project-config": "2.7.0-rc.107",
|
|
156
|
+
"@cedarjs/router": "2.7.0-rc.107",
|
|
147
157
|
"@graphql-codegen/add": "4.0.1",
|
|
148
158
|
"@graphql-codegen/cli": "3.3.1",
|
|
149
159
|
"@graphql-codegen/client-preset": "4.8.3",
|
|
@@ -162,20 +172,20 @@
|
|
|
162
172
|
"deepmerge": "4.3.1",
|
|
163
173
|
"esbuild": "0.21.5",
|
|
164
174
|
"fast-glob": "3.3.3",
|
|
165
|
-
"graphql": "16.
|
|
175
|
+
"graphql": "16.13.0",
|
|
166
176
|
"kill-port": "1.6.1",
|
|
167
177
|
"prettier": "3.8.1",
|
|
168
|
-
"rimraf": "6.1.
|
|
178
|
+
"rimraf": "6.1.3",
|
|
169
179
|
"source-map": "0.7.6",
|
|
170
180
|
"string-env-interpolation": "1.0.1",
|
|
171
|
-
"systeminformation": "5.
|
|
181
|
+
"systeminformation": "5.31.1",
|
|
172
182
|
"termi-link": "1.1.0",
|
|
173
183
|
"ts-node": "10.9.2",
|
|
174
184
|
"typescript": "5.9.3"
|
|
175
185
|
},
|
|
176
186
|
"devDependencies": {
|
|
177
187
|
"@arethetypeswrong/cli": "0.18.2",
|
|
178
|
-
"@cedarjs/framework-tools": "2.
|
|
188
|
+
"@cedarjs/framework-tools": "2.7.0-rc.107",
|
|
179
189
|
"concurrently": "9.2.1",
|
|
180
190
|
"graphql-tag": "2.12.6",
|
|
181
191
|
"publint": "0.3.17",
|
|
@@ -185,5 +195,5 @@
|
|
|
185
195
|
"publishConfig": {
|
|
186
196
|
"access": "public"
|
|
187
197
|
},
|
|
188
|
-
"gitHead": "
|
|
198
|
+
"gitHead": "e4c28ed97a1f4859162b32aaede569ab4412e06b"
|
|
189
199
|
}
|