@constructive-io/graphql-codegen 2.28.2 → 2.28.3
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.
|
@@ -59,7 +59,6 @@ export declare function writeGeneratedFiles(files: GeneratedFile[], outputDir: s
|
|
|
59
59
|
/**
|
|
60
60
|
* Format generated files using prettier
|
|
61
61
|
* Runs prettier on the output directory after all files are written
|
|
62
|
-
* Uses bundled config with sensible defaults (singleQuote, trailingComma, etc.)
|
|
63
62
|
*/
|
|
64
63
|
export declare function formatOutput(outputDir: string): {
|
|
65
64
|
success: boolean;
|
package/cli/commands/generate.js
CHANGED
|
@@ -414,27 +414,17 @@ async function writeGeneratedFiles(files, outputDir, subdirs, options = {}) {
|
|
|
414
414
|
/**
|
|
415
415
|
* Format generated files using prettier
|
|
416
416
|
* Runs prettier on the output directory after all files are written
|
|
417
|
-
* Uses bundled config with sensible defaults (singleQuote, trailingComma, etc.)
|
|
418
417
|
*/
|
|
419
418
|
function formatOutput(outputDir) {
|
|
420
|
-
// Resolve to absolute path for reliable execution
|
|
421
419
|
const absoluteOutputDir = path.resolve(outputDir);
|
|
422
420
|
try {
|
|
423
|
-
|
|
424
|
-
// prettier is a dependency of @constructive-io/graphql-codegen
|
|
425
|
-
const prettierPkgPath = require.resolve('prettier/package.json');
|
|
426
|
-
const prettierDir = path.dirname(prettierPkgPath);
|
|
427
|
-
const prettierBin = path.join(prettierDir, 'bin', 'prettier.cjs');
|
|
428
|
-
// Use bundled config with sensible defaults
|
|
429
|
-
const configPath = path.join(__dirname, 'codegen-prettier.json');
|
|
430
|
-
(0, node_child_process_1.execSync)(`"${prettierBin}" --write --config "${configPath}" "${absoluteOutputDir}"`, {
|
|
421
|
+
(0, node_child_process_1.execSync)(`npx prettier --write --single-quote --trailing-comma all --tab-width 2 --semi "${absoluteOutputDir}"`, {
|
|
431
422
|
stdio: 'pipe',
|
|
432
423
|
encoding: 'utf-8',
|
|
433
424
|
});
|
|
434
425
|
return { success: true };
|
|
435
426
|
}
|
|
436
427
|
catch (err) {
|
|
437
|
-
// prettier may fail if files have syntax errors or if not installed
|
|
438
428
|
const message = err instanceof Error ? err.message : String(err);
|
|
439
429
|
return { success: false, error: message };
|
|
440
430
|
}
|
|
@@ -59,7 +59,6 @@ export declare function writeGeneratedFiles(files: GeneratedFile[], outputDir: s
|
|
|
59
59
|
/**
|
|
60
60
|
* Format generated files using prettier
|
|
61
61
|
* Runs prettier on the output directory after all files are written
|
|
62
|
-
* Uses bundled config with sensible defaults (singleQuote, trailingComma, etc.)
|
|
63
62
|
*/
|
|
64
63
|
export declare function formatOutput(outputDir: string): {
|
|
65
64
|
success: boolean;
|
|
@@ -376,27 +376,17 @@ export async function writeGeneratedFiles(files, outputDir, subdirs, options = {
|
|
|
376
376
|
/**
|
|
377
377
|
* Format generated files using prettier
|
|
378
378
|
* Runs prettier on the output directory after all files are written
|
|
379
|
-
* Uses bundled config with sensible defaults (singleQuote, trailingComma, etc.)
|
|
380
379
|
*/
|
|
381
380
|
export function formatOutput(outputDir) {
|
|
382
|
-
// Resolve to absolute path for reliable execution
|
|
383
381
|
const absoluteOutputDir = path.resolve(outputDir);
|
|
384
382
|
try {
|
|
385
|
-
|
|
386
|
-
// prettier is a dependency of @constructive-io/graphql-codegen
|
|
387
|
-
const prettierPkgPath = require.resolve('prettier/package.json');
|
|
388
|
-
const prettierDir = path.dirname(prettierPkgPath);
|
|
389
|
-
const prettierBin = path.join(prettierDir, 'bin', 'prettier.cjs');
|
|
390
|
-
// Use bundled config with sensible defaults
|
|
391
|
-
const configPath = path.join(__dirname, 'codegen-prettier.json');
|
|
392
|
-
execSync(`"${prettierBin}" --write --config "${configPath}" "${absoluteOutputDir}"`, {
|
|
383
|
+
execSync(`npx prettier --write --single-quote --trailing-comma all --tab-width 2 --semi "${absoluteOutputDir}"`, {
|
|
393
384
|
stdio: 'pipe',
|
|
394
385
|
encoding: 'utf-8',
|
|
395
386
|
});
|
|
396
387
|
return { success: true };
|
|
397
388
|
}
|
|
398
389
|
catch (err) {
|
|
399
|
-
// prettier may fail if files have syntax errors or if not installed
|
|
400
390
|
const message = err instanceof Error ? err.message : String(err);
|
|
401
391
|
return { success: false, error: message };
|
|
402
392
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/graphql-codegen",
|
|
3
|
-
"version": "2.28.
|
|
3
|
+
"version": "2.28.3",
|
|
4
4
|
"description": "CLI-based GraphQL SDK generator for PostGraphile endpoints with React Query hooks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"graphql",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"tsx": "^4.21.0",
|
|
89
89
|
"typescript": "^5.9.3"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "06cc06455356911bf9a24245849138892267b87d"
|
|
92
92
|
}
|