@cedarjs/internal 3.0.0-canary.13612 → 3.0.0-canary.13614
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 +17 -23
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/project.d.ts +0 -1
- package/dist/cjs/project.d.ts.map +1 -1
- package/dist/cjs/project.js +0 -24
- package/dist/generate/graphqlCodeGen.d.ts.map +1 -1
- package/dist/generate/graphqlCodeGen.js +18 -24
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/project.d.ts +0 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +1 -24
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAgBA,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,
|
|
1
|
+
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAgBA,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,CAiFvE,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CAwDvE,CAAA;AAmCD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;SACD,MAAM;GAQ5D;AA8JD,eAAO,MAAM,iBAAiB,4RAe7B,CAAA"}
|
|
@@ -82,7 +82,7 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
82
82
|
const prismaImports = Object.keys(prismaModels).map((key) => {
|
|
83
83
|
return `${key} as Prisma${key}`;
|
|
84
84
|
});
|
|
85
|
-
const prismaImportSource =
|
|
85
|
+
const prismaImportSource = "src/lib/db";
|
|
86
86
|
const extraPlugins = [
|
|
87
87
|
{
|
|
88
88
|
name: "add",
|
|
@@ -145,7 +145,7 @@ const generateTypeDefGraphQLWeb = async () => {
|
|
|
145
145
|
{
|
|
146
146
|
name: "add",
|
|
147
147
|
options: {
|
|
148
|
-
content: `import { Prisma } from "$
|
|
148
|
+
content: `import { Prisma } from "$api/src/lib/db"`,
|
|
149
149
|
placement: "prepend"
|
|
150
150
|
},
|
|
151
151
|
codegenPlugin: addPlugin
|
|
@@ -204,10 +204,11 @@ function getLoadDocumentsOptions(filename) {
|
|
|
204
204
|
}
|
|
205
205
|
async function importGeneratedPrismaClient() {
|
|
206
206
|
const cacheBuster = `?t=${Date.now()}`;
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
207
|
+
const { clientPath, error } = await (0, import_project_config.resolveGeneratedPrismaClient)();
|
|
208
|
+
if (!clientPath) {
|
|
209
|
+
throw new Error(error);
|
|
210
|
+
}
|
|
211
|
+
const fileUrl = (0, import_node_url.pathToFileURL)(clientPath).href + cacheBuster;
|
|
211
212
|
const freshPrisma = await import(fileUrl);
|
|
212
213
|
return freshPrisma;
|
|
213
214
|
}
|
|
@@ -217,19 +218,20 @@ function isModelNameRecord(value) {
|
|
|
217
218
|
}
|
|
218
219
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
219
220
|
}
|
|
220
|
-
function getModelName(
|
|
221
|
-
if (typeof
|
|
221
|
+
function getModelName(mod) {
|
|
222
|
+
if (typeof mod !== "object" || mod === null || !("Prisma" in mod)) {
|
|
222
223
|
return null;
|
|
223
224
|
}
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
225
|
+
const prismaModule = mod.Prisma;
|
|
226
|
+
if (typeof prismaModule !== "object" || prismaModule === null || !("ModelName" in prismaModule)) {
|
|
227
|
+
return null;
|
|
227
228
|
}
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
const modelName = prismaModule.ModelName;
|
|
230
|
+
if (typeof modelName !== "object" || modelName === null) {
|
|
231
|
+
return null;
|
|
230
232
|
}
|
|
231
|
-
if (
|
|
232
|
-
return
|
|
233
|
+
if (isModelNameRecord(modelName)) {
|
|
234
|
+
return modelName;
|
|
233
235
|
}
|
|
234
236
|
return null;
|
|
235
237
|
}
|
|
@@ -242,14 +244,6 @@ async function getPrismaClient() {
|
|
|
242
244
|
}
|
|
243
245
|
} catch {
|
|
244
246
|
}
|
|
245
|
-
try {
|
|
246
|
-
const packagePrisma = await import("@prisma/client");
|
|
247
|
-
const modelName = getModelName(packagePrisma);
|
|
248
|
-
if (modelName) {
|
|
249
|
-
return { ModelName: modelName };
|
|
250
|
-
}
|
|
251
|
-
} catch {
|
|
252
|
-
}
|
|
253
247
|
import_execa.default.sync("yarn", ["cedar", "prisma", "generate"]);
|
|
254
248
|
try {
|
|
255
249
|
const freshPrisma = await importGeneratedPrismaClient();
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
export * from './files.js';
|
|
7
6
|
export { generate } from './generate/generate.js';
|
|
8
7
|
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;AAE3B,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,7 +20,6 @@ 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,
|
|
24
23
|
generate: () => import_generate.generate,
|
|
25
24
|
listQueryTypeFieldsInProject: () => import_gql.listQueryTypeFieldsInProject
|
|
26
25
|
});
|
|
@@ -29,7 +28,6 @@ __reExport(src_exports, require("@cedarjs/project-config"), module.exports);
|
|
|
29
28
|
__reExport(src_exports, require("./ts2js.js"), module.exports);
|
|
30
29
|
__reExport(src_exports, require("./dev.js"), module.exports);
|
|
31
30
|
__reExport(src_exports, require("./routes.js"), module.exports);
|
|
32
|
-
var import_project = require("./project.js");
|
|
33
31
|
__reExport(src_exports, require("./files.js"), module.exports);
|
|
34
32
|
var import_generate = require("./generate/generate.js");
|
|
35
33
|
var import_api = require("./build/api.js");
|
|
@@ -39,7 +37,6 @@ var import_gql = require("./gql.js");
|
|
|
39
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
38
|
0 && (module.exports = {
|
|
41
39
|
buildApi,
|
|
42
|
-
dbReexportsPrismaClient,
|
|
43
40
|
generate,
|
|
44
41
|
listQueryTypeFieldsInProject,
|
|
45
42
|
...require("@cedarjs/project-config"),
|
package/dist/cjs/project.d.ts
CHANGED
|
@@ -5,5 +5,4 @@ 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;
|
|
9
8
|
//# 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"}
|
package/dist/cjs/project.js
CHANGED
|
@@ -28,7 +28,6 @@ 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,
|
|
32
31
|
getTsConfigs: () => getTsConfigs,
|
|
33
32
|
isRealtimeSetup: () => isRealtimeSetup,
|
|
34
33
|
isServerFileSetup: () => isServerFileSetup,
|
|
@@ -74,31 +73,8 @@ const isRealtimeSetup = () => {
|
|
|
74
73
|
);
|
|
75
74
|
return import_node_fs.default.existsSync(realtimePath);
|
|
76
75
|
};
|
|
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
|
-
const prismaClientImportMatch = content.match(
|
|
84
|
-
/import\s+{[^}]*\bPrismaClient\b[^}]*}\s+from\s+['"](.*?)['"]/
|
|
85
|
-
);
|
|
86
|
-
const prismaClientLocation = prismaClientImportMatch?.[1];
|
|
87
|
-
if (!prismaClientLocation) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
return new RegExp(
|
|
91
|
-
// @ts-expect-error - old types. This is supported in Node 24, which is the
|
|
92
|
-
// minimum supported version of Node for CedarJS.
|
|
93
|
-
// RegExp.escape has been added to the newer ES2025 target, but I'm not
|
|
94
|
-
// ready to change that just yet
|
|
95
|
-
// https://github.com/microsoft/TypeScript/pull/63046
|
|
96
|
-
`export \\* from ['"]${RegExp.escape(prismaClientLocation)}['"]`
|
|
97
|
-
).test(content);
|
|
98
|
-
};
|
|
99
76
|
// Annotate the CommonJS export names for ESM import in node:
|
|
100
77
|
0 && (module.exports = {
|
|
101
|
-
dbReexportsPrismaClient,
|
|
102
78
|
getTsConfigs,
|
|
103
79
|
isRealtimeSetup,
|
|
104
80
|
isServerFileSetup,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAgBA,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,
|
|
1
|
+
{"version":3,"file":"graphqlCodeGen.d.ts","sourceRoot":"","sources":["../../src/generate/graphqlCodeGen.ts"],"names":[],"mappings":"AAgBA,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,CAiFvE,CAAA;AAED,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,aAAa,CAwDvE,CAAA;AAmCD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM;SACD,MAAM;GAQ5D;AA8JD,eAAO,MAAM,iBAAiB,4RAe7B,CAAA"}
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getConfig,
|
|
17
17
|
resolveGeneratedPrismaClient
|
|
18
18
|
} from "@cedarjs/project-config";
|
|
19
|
-
import { getTsConfigs
|
|
19
|
+
import { getTsConfigs } from "../project.js";
|
|
20
20
|
import * as rwTypescriptResolvers from "./plugins/rw-typescript-resolvers/index.js";
|
|
21
21
|
var CodegenSide = /* @__PURE__ */ ((CodegenSide2) => {
|
|
22
22
|
CodegenSide2[CodegenSide2["API"] = 0] = "API";
|
|
@@ -50,7 +50,7 @@ const generateTypeDefGraphQLApi = async () => {
|
|
|
50
50
|
const prismaImports = Object.keys(prismaModels).map((key) => {
|
|
51
51
|
return `${key} as Prisma${key}`;
|
|
52
52
|
});
|
|
53
|
-
const prismaImportSource =
|
|
53
|
+
const prismaImportSource = "src/lib/db";
|
|
54
54
|
const extraPlugins = [
|
|
55
55
|
{
|
|
56
56
|
name: "add",
|
|
@@ -113,7 +113,7 @@ const generateTypeDefGraphQLWeb = async () => {
|
|
|
113
113
|
{
|
|
114
114
|
name: "add",
|
|
115
115
|
options: {
|
|
116
|
-
content: `import { Prisma } from "$
|
|
116
|
+
content: `import { Prisma } from "$api/src/lib/db"`,
|
|
117
117
|
placement: "prepend"
|
|
118
118
|
},
|
|
119
119
|
codegenPlugin: addPlugin
|
|
@@ -172,10 +172,11 @@ function getLoadDocumentsOptions(filename) {
|
|
|
172
172
|
}
|
|
173
173
|
async function importGeneratedPrismaClient() {
|
|
174
174
|
const cacheBuster = `?t=${Date.now()}`;
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
const { clientPath, error } = await resolveGeneratedPrismaClient();
|
|
176
|
+
if (!clientPath) {
|
|
177
|
+
throw new Error(error);
|
|
178
|
+
}
|
|
179
|
+
const fileUrl = pathToFileURL(clientPath).href + cacheBuster;
|
|
179
180
|
const freshPrisma = await import(fileUrl);
|
|
180
181
|
return freshPrisma;
|
|
181
182
|
}
|
|
@@ -185,19 +186,20 @@ function isModelNameRecord(value) {
|
|
|
185
186
|
}
|
|
186
187
|
return Object.values(value).every((entry) => typeof entry === "string");
|
|
187
188
|
}
|
|
188
|
-
function getModelName(
|
|
189
|
-
if (typeof
|
|
189
|
+
function getModelName(mod) {
|
|
190
|
+
if (typeof mod !== "object" || mod === null || !("Prisma" in mod)) {
|
|
190
191
|
return null;
|
|
191
192
|
}
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
return
|
|
193
|
+
const prismaModule = mod.Prisma;
|
|
194
|
+
if (typeof prismaModule !== "object" || prismaModule === null || !("ModelName" in prismaModule)) {
|
|
195
|
+
return null;
|
|
195
196
|
}
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
const modelName = prismaModule.ModelName;
|
|
198
|
+
if (typeof modelName !== "object" || modelName === null) {
|
|
199
|
+
return null;
|
|
198
200
|
}
|
|
199
|
-
if (
|
|
200
|
-
return
|
|
201
|
+
if (isModelNameRecord(modelName)) {
|
|
202
|
+
return modelName;
|
|
201
203
|
}
|
|
202
204
|
return null;
|
|
203
205
|
}
|
|
@@ -210,14 +212,6 @@ async function getPrismaClient() {
|
|
|
210
212
|
}
|
|
211
213
|
} catch {
|
|
212
214
|
}
|
|
213
|
-
try {
|
|
214
|
-
const packagePrisma = await import("@prisma/client");
|
|
215
|
-
const modelName = getModelName(packagePrisma);
|
|
216
|
-
if (modelName) {
|
|
217
|
-
return { ModelName: modelName };
|
|
218
|
-
}
|
|
219
|
-
} catch {
|
|
220
|
-
}
|
|
221
215
|
execa.sync("yarn", ["cedar", "prisma", "generate"]);
|
|
222
216
|
try {
|
|
223
217
|
const freshPrisma = await importGeneratedPrismaClient();
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ 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';
|
|
6
5
|
export * from './files.js';
|
|
7
6
|
export { generate } from './generate/generate.js';
|
|
8
7
|
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;AAE3B,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,7 +2,6 @@ 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";
|
|
6
5
|
export * from "./files.js";
|
|
7
6
|
import { generate } from "./generate/generate.js";
|
|
8
7
|
import { buildApi } from "./build/api.js";
|
|
@@ -11,7 +10,6 @@ export * from "@cedarjs/babel-config";
|
|
|
11
10
|
import { listQueryTypeFieldsInProject } from "./gql.js";
|
|
12
11
|
export {
|
|
13
12
|
buildApi,
|
|
14
|
-
dbReexportsPrismaClient,
|
|
15
13
|
generate,
|
|
16
14
|
listQueryTypeFieldsInProject
|
|
17
15
|
};
|
package/dist/project.d.ts
CHANGED
|
@@ -5,5 +5,4 @@ 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;
|
|
9
8
|
//# 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"}
|
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
|
|
4
|
+
import { getPaths } 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,30 +37,7 @@ 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
|
-
const prismaClientImportMatch = content.match(
|
|
47
|
-
/import\s+{[^}]*\bPrismaClient\b[^}]*}\s+from\s+['"](.*?)['"]/
|
|
48
|
-
);
|
|
49
|
-
const prismaClientLocation = prismaClientImportMatch?.[1];
|
|
50
|
-
if (!prismaClientLocation) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return new RegExp(
|
|
54
|
-
// @ts-expect-error - old types. This is supported in Node 24, which is the
|
|
55
|
-
// minimum supported version of Node for CedarJS.
|
|
56
|
-
// RegExp.escape has been added to the newer ES2025 target, but I'm not
|
|
57
|
-
// ready to change that just yet
|
|
58
|
-
// https://github.com/microsoft/TypeScript/pull/63046
|
|
59
|
-
`export \\* from ['"]${RegExp.escape(prismaClientLocation)}['"]`
|
|
60
|
-
).test(content);
|
|
61
|
-
};
|
|
62
40
|
export {
|
|
63
|
-
dbReexportsPrismaClient,
|
|
64
41
|
getTsConfigs,
|
|
65
42
|
isRealtimeSetup,
|
|
66
43
|
isServerFileSetup,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/internal",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.13614+99cf90d23",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
"@babel/plugin-transform-react-jsx": "7.28.6",
|
|
150
150
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
151
151
|
"@babel/traverse": "7.29.0",
|
|
152
|
-
"@cedarjs/babel-config": "3.0.0-canary.
|
|
153
|
-
"@cedarjs/graphql-server": "3.0.0-canary.
|
|
154
|
-
"@cedarjs/project-config": "3.0.0-canary.
|
|
155
|
-
"@cedarjs/router": "3.0.0-canary.
|
|
156
|
-
"@cedarjs/structure": "3.0.0-canary.
|
|
152
|
+
"@cedarjs/babel-config": "3.0.0-canary.13614",
|
|
153
|
+
"@cedarjs/graphql-server": "3.0.0-canary.13614",
|
|
154
|
+
"@cedarjs/project-config": "3.0.0-canary.13614",
|
|
155
|
+
"@cedarjs/router": "3.0.0-canary.13614",
|
|
156
|
+
"@cedarjs/structure": "3.0.0-canary.13614",
|
|
157
157
|
"@graphql-codegen/add": "6.0.0",
|
|
158
158
|
"@graphql-codegen/cli": "6.2.1",
|
|
159
159
|
"@graphql-codegen/client-preset": "5.2.4",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
186
|
"@arethetypeswrong/cli": "0.18.2",
|
|
187
|
-
"@cedarjs/framework-tools": "3.0.0-canary.
|
|
187
|
+
"@cedarjs/framework-tools": "3.0.0-canary.13614",
|
|
188
188
|
"concurrently": "9.2.1",
|
|
189
189
|
"graphql-tag": "2.12.6",
|
|
190
190
|
"publint": "0.3.18",
|
|
@@ -194,5 +194,5 @@
|
|
|
194
194
|
"publishConfig": {
|
|
195
195
|
"access": "public"
|
|
196
196
|
},
|
|
197
|
-
"gitHead": "
|
|
197
|
+
"gitHead": "99cf90d2348c5ba8f3f2f6883bfb629566114ad5"
|
|
198
198
|
}
|