@graphql-codegen/cli 2.3.0-alpha-f3053e3b7.0 → 2.3.0-alpha-166ea3cc1.0

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/bin.js CHANGED
@@ -580,9 +580,12 @@ function customLoader(ext) {
580
580
  }
581
581
  return loader;
582
582
  }
583
- async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName = 'codegen', searchPlaces: additionalSearchPlaces = [], packageProp = moduleName, loaders: customLoaders = {}, }) {
583
+ async function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: additionalSearchPlaces, packageProp, loaders: customLoaders, }) {
584
+ configFilePath = configFilePath || process.cwd();
585
+ moduleName = moduleName || 'codegen';
586
+ packageProp = packageProp || moduleName;
584
587
  const cosmi = cosmiconfig.cosmiconfig(moduleName, {
585
- searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces),
588
+ searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces || []),
586
589
  packageProp,
587
590
  loaders: {
588
591
  '.json': customLoader('json'),
@@ -594,7 +597,7 @@ async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName =
594
597
  },
595
598
  });
596
599
  const pathStats = await lstat(configFilePath);
597
- return pathStats.isDirectory ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
600
+ return pathStats.isDirectory() ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
598
601
  }
599
602
  async function loadContext(configFilePath) {
600
603
  const graphqlConfig = await findAndLoadGraphQLConfig(configFilePath);
package/index.js CHANGED
@@ -498,9 +498,12 @@ function customLoader(ext) {
498
498
  }
499
499
  return loader;
500
500
  }
501
- async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName = 'codegen', searchPlaces: additionalSearchPlaces = [], packageProp = moduleName, loaders: customLoaders = {}, }) {
501
+ async function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: additionalSearchPlaces, packageProp, loaders: customLoaders, }) {
502
+ configFilePath = configFilePath || process.cwd();
503
+ moduleName = moduleName || 'codegen';
504
+ packageProp = packageProp || moduleName;
502
505
  const cosmi = cosmiconfig.cosmiconfig(moduleName, {
503
- searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces),
506
+ searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces || []),
504
507
  packageProp,
505
508
  loaders: {
506
509
  '.json': customLoader('json'),
@@ -512,7 +515,7 @@ async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName =
512
515
  },
513
516
  });
514
517
  const pathStats = await lstat(configFilePath);
515
- return pathStats.isDirectory ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
518
+ return pathStats.isDirectory() ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
516
519
  }
517
520
  async function loadContext(configFilePath) {
518
521
  const graphqlConfig = await findAndLoadGraphQLConfig(configFilePath);
package/index.mjs CHANGED
@@ -471,9 +471,12 @@ function customLoader(ext) {
471
471
  }
472
472
  return loader;
473
473
  }
474
- async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName = 'codegen', searchPlaces: additionalSearchPlaces = [], packageProp = moduleName, loaders: customLoaders = {}, }) {
474
+ async function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: additionalSearchPlaces, packageProp, loaders: customLoaders, }) {
475
+ configFilePath = configFilePath || process.cwd();
476
+ moduleName = moduleName || 'codegen';
477
+ packageProp = packageProp || moduleName;
475
478
  const cosmi = cosmiconfig(moduleName, {
476
- searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces),
479
+ searchPlaces: generateSearchPlaces(moduleName).concat(additionalSearchPlaces || []),
477
480
  packageProp,
478
481
  loaders: {
479
482
  '.json': customLoader('json'),
@@ -485,7 +488,7 @@ async function loadCodegenConfig({ configFilePath = process.cwd(), moduleName =
485
488
  },
486
489
  });
487
490
  const pathStats = await lstat(configFilePath);
488
- return pathStats.isDirectory ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
491
+ return pathStats.isDirectory() ? cosmi.search(configFilePath) : cosmi.load(configFilePath);
489
492
  }
490
493
  async function loadContext(configFilePath) {
491
494
  const graphqlConfig = await findAndLoadGraphQLConfig(configFilePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/cli",
3
- "version": "2.3.0-alpha-f3053e3b7.0",
3
+ "version": "2.3.0-alpha-166ea3cc1.0",
4
4
  "peerDependencies": {
5
5
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"
6
6
  },