@cedarjs/internal 5.0.0-canary.2385 → 5.0.0-canary.2387
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.
|
@@ -320,9 +320,9 @@ const generateTypeDefGlobalContext = () => {
|
|
|
320
320
|
};
|
|
321
321
|
const generateViteClientTypesDirective = () => {
|
|
322
322
|
const viteClientDirective = `/// <reference types="vite/client" />`;
|
|
323
|
-
const
|
|
323
|
+
const cedarProjectPaths = (0, import_project_config.getPaths)();
|
|
324
324
|
const viteClientDirectivePath = import_path.default.join(
|
|
325
|
-
|
|
325
|
+
cedarProjectPaths.generated.types.includes,
|
|
326
326
|
"web-vite-client.d.ts"
|
|
327
327
|
);
|
|
328
328
|
import_node_fs.default.writeFileSync(viteClientDirectivePath, viteClientDirective);
|
|
@@ -334,12 +334,9 @@ function generateStubStorybookTypes() {
|
|
|
334
334
|
export type StoryObj<T = any> = any
|
|
335
335
|
}
|
|
336
336
|
`;
|
|
337
|
-
const
|
|
337
|
+
const cedarProjectPaths = (0, import_project_config.getPaths)();
|
|
338
338
|
const packageJson = JSON.parse(
|
|
339
|
-
import_node_fs.default.readFileSync(
|
|
340
|
-
import_path.default.join(redwoodProjectPaths.base, "package.json"),
|
|
341
|
-
"utf-8"
|
|
342
|
-
)
|
|
339
|
+
import_node_fs.default.readFileSync(import_path.default.join(cedarProjectPaths.base, "package.json"), "utf-8")
|
|
343
340
|
);
|
|
344
341
|
const hasCliStorybookVite = Object.keys(
|
|
345
342
|
packageJson["devDependencies"]
|
|
@@ -348,7 +345,7 @@ function generateStubStorybookTypes() {
|
|
|
348
345
|
return [];
|
|
349
346
|
}
|
|
350
347
|
const stubStorybookTypesFilePath = import_path.default.join(
|
|
351
|
-
|
|
348
|
+
cedarProjectPaths.generated.types.includes,
|
|
352
349
|
"web-storybook.d.ts"
|
|
353
350
|
);
|
|
354
351
|
import_node_fs.default.writeFileSync(stubStorybookTypesFilePath, stubStorybookTypesFileContent);
|
|
@@ -79,11 +79,11 @@ function validateSchema(schemaDocumentNode, typesToCheck = ["Query", "Mutation"]
|
|
|
79
79
|
for (const field of typeNode.fields || []) {
|
|
80
80
|
const fieldName = field.name.value;
|
|
81
81
|
const fieldTypeName = typeNode.name.value;
|
|
82
|
-
const
|
|
82
|
+
const isLegacyRedwoodQuery = fieldName === "redwood" && fieldTypeName === "Query";
|
|
83
83
|
const isCedarQuery = fieldName === "cedar" && fieldTypeName === "Query" || // TODO: Remove this when I remove the root schema
|
|
84
84
|
fieldName === "cedarjs" && fieldTypeName === "Query";
|
|
85
85
|
const isCurrentUserQuery = fieldName === "currentUser" && fieldTypeName === "Query";
|
|
86
|
-
if (!(
|
|
86
|
+
if (!(isCedarQuery || isCurrentUserQuery || isLegacyRedwoodQuery)) {
|
|
87
87
|
const hasDirective = field.directives?.length;
|
|
88
88
|
if (!hasDirective) {
|
|
89
89
|
validationOutput.push(`${fieldName} ${fieldTypeName}`);
|
|
@@ -280,9 +280,9 @@ const generateTypeDefGlobalContext = () => {
|
|
|
280
280
|
};
|
|
281
281
|
const generateViteClientTypesDirective = () => {
|
|
282
282
|
const viteClientDirective = `/// <reference types="vite/client" />`;
|
|
283
|
-
const
|
|
283
|
+
const cedarProjectPaths = getPaths();
|
|
284
284
|
const viteClientDirectivePath = path.join(
|
|
285
|
-
|
|
285
|
+
cedarProjectPaths.generated.types.includes,
|
|
286
286
|
"web-vite-client.d.ts"
|
|
287
287
|
);
|
|
288
288
|
fs.writeFileSync(viteClientDirectivePath, viteClientDirective);
|
|
@@ -294,12 +294,9 @@ function generateStubStorybookTypes() {
|
|
|
294
294
|
export type StoryObj<T = any> = any
|
|
295
295
|
}
|
|
296
296
|
`;
|
|
297
|
-
const
|
|
297
|
+
const cedarProjectPaths = getPaths();
|
|
298
298
|
const packageJson = JSON.parse(
|
|
299
|
-
fs.readFileSync(
|
|
300
|
-
path.join(redwoodProjectPaths.base, "package.json"),
|
|
301
|
-
"utf-8"
|
|
302
|
-
)
|
|
299
|
+
fs.readFileSync(path.join(cedarProjectPaths.base, "package.json"), "utf-8")
|
|
303
300
|
);
|
|
304
301
|
const hasCliStorybookVite = Object.keys(
|
|
305
302
|
packageJson["devDependencies"]
|
|
@@ -308,7 +305,7 @@ function generateStubStorybookTypes() {
|
|
|
308
305
|
return [];
|
|
309
306
|
}
|
|
310
307
|
const stubStorybookTypesFilePath = path.join(
|
|
311
|
-
|
|
308
|
+
cedarProjectPaths.generated.types.includes,
|
|
312
309
|
"web-storybook.d.ts"
|
|
313
310
|
);
|
|
314
311
|
fs.writeFileSync(stubStorybookTypesFilePath, stubStorybookTypesFileContent);
|
package/dist/validateSchema.js
CHANGED
|
@@ -52,11 +52,11 @@ function validateSchema(schemaDocumentNode, typesToCheck = ["Query", "Mutation"]
|
|
|
52
52
|
for (const field of typeNode.fields || []) {
|
|
53
53
|
const fieldName = field.name.value;
|
|
54
54
|
const fieldTypeName = typeNode.name.value;
|
|
55
|
-
const
|
|
55
|
+
const isLegacyRedwoodQuery = fieldName === "redwood" && fieldTypeName === "Query";
|
|
56
56
|
const isCedarQuery = fieldName === "cedar" && fieldTypeName === "Query" || // TODO: Remove this when I remove the root schema
|
|
57
57
|
fieldName === "cedarjs" && fieldTypeName === "Query";
|
|
58
58
|
const isCurrentUserQuery = fieldName === "currentUser" && fieldTypeName === "Query";
|
|
59
|
-
if (!(
|
|
59
|
+
if (!(isCedarQuery || isCurrentUserQuery || isLegacyRedwoodQuery)) {
|
|
60
60
|
const hasDirective = field.directives?.length;
|
|
61
61
|
if (!hasDirective) {
|
|
62
62
|
validationOutput.push(`${fieldName} ${fieldTypeName}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/internal",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2387",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -159,13 +159,13 @@
|
|
|
159
159
|
"@babel/plugin-transform-react-jsx": "7.28.6",
|
|
160
160
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
161
161
|
"@babel/traverse": "7.29.0",
|
|
162
|
-
"@cedarjs/babel-config": "5.0.0-canary.
|
|
163
|
-
"@cedarjs/cli-helpers": "5.0.0-canary.
|
|
164
|
-
"@cedarjs/graphql-server": "5.0.0-canary.
|
|
165
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
166
|
-
"@cedarjs/router": "5.0.0-canary.
|
|
167
|
-
"@cedarjs/structure": "5.0.0-canary.
|
|
168
|
-
"@cedarjs/utils": "5.0.0-canary.
|
|
162
|
+
"@cedarjs/babel-config": "5.0.0-canary.2387",
|
|
163
|
+
"@cedarjs/cli-helpers": "5.0.0-canary.2387",
|
|
164
|
+
"@cedarjs/graphql-server": "5.0.0-canary.2387",
|
|
165
|
+
"@cedarjs/project-config": "5.0.0-canary.2387",
|
|
166
|
+
"@cedarjs/router": "5.0.0-canary.2387",
|
|
167
|
+
"@cedarjs/structure": "5.0.0-canary.2387",
|
|
168
|
+
"@cedarjs/utils": "5.0.0-canary.2387",
|
|
169
169
|
"@graphql-codegen/add": "6.0.1",
|
|
170
170
|
"@graphql-codegen/cli": "6.3.1",
|
|
171
171
|
"@graphql-codegen/client-preset": "5.3.0",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
},
|
|
200
200
|
"devDependencies": {
|
|
201
201
|
"@arethetypeswrong/cli": "0.18.2",
|
|
202
|
-
"@cedarjs/framework-tools": "5.0.0-canary.
|
|
202
|
+
"@cedarjs/framework-tools": "5.0.0-canary.2387",
|
|
203
203
|
"concurrently": "9.2.1",
|
|
204
204
|
"graphql-tag": "2.12.6",
|
|
205
205
|
"publint": "0.3.21",
|