graphql-config
Advanced tools
Comparing version 4.5.0-alpha-20230303172027-c80ecbf to 4.5.0-alpha-20230304025109-5dcd2ee
@@ -34,19 +34,5 @@ "use strict"; | ||
const loadTypeScript = (...args) => { | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader'); | ||
return TypeScriptLoader({ transpileOnly: true })(...args); | ||
} | ||
catch (err) { | ||
if (isRequireESMError(err)) { | ||
return jitiLoader(...args); | ||
} | ||
} | ||
}; | ||
const jitiLoader = (filepath) => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const jiti = require('jiti')(__filename, { | ||
interopDefault: true, | ||
}); | ||
return jiti(filepath); | ||
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader'); | ||
return TypeScriptLoader({ transpileOnly: true })(...args); | ||
}; | ||
@@ -62,4 +48,2 @@ const loadToml = (...args) => { | ||
'#.config.ts', | ||
'#.config.cts', | ||
'#.config.mts', | ||
'#.config.js', | ||
@@ -73,4 +57,2 @@ '#.config.cjs', | ||
'.#rc.ts', | ||
'.#rc.cts', | ||
'.#rc.mts', | ||
'.#rc.js', | ||
@@ -93,4 +75,2 @@ '.#rc.cjs', | ||
'.ts': loadTypeScript, | ||
'.mts': createCustomLoader(jitiLoader), | ||
'.cts': createCustomLoader(jitiLoader), | ||
'.js': cosmiconfig_1.defaultLoaders['.js'], | ||
@@ -105,4 +85,1 @@ '.json': createCustomLoader(cosmiconfig_1.defaultLoaders['.json']), | ||
} | ||
function isRequireESMError(err) { | ||
return typeof err.stack === 'string' && err.stack.startsWith('Error [ERR_REQUIRE_ESM]:'); | ||
} |
@@ -30,19 +30,5 @@ import { createRequire } from 'module'; | ||
const loadTypeScript = (...args) => { | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader'); | ||
return TypeScriptLoader({ transpileOnly: true })(...args); | ||
} | ||
catch (err) { | ||
if (isRequireESMError(err)) { | ||
return jitiLoader(...args); | ||
} | ||
} | ||
}; | ||
const jitiLoader = (filepath) => { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const jiti = require('jiti')(__filename, { | ||
interopDefault: true, | ||
}); | ||
return jiti(filepath); | ||
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader'); | ||
return TypeScriptLoader({ transpileOnly: true })(...args); | ||
}; | ||
@@ -58,4 +44,2 @@ const loadToml = (...args) => { | ||
'#.config.ts', | ||
'#.config.cts', | ||
'#.config.mts', | ||
'#.config.js', | ||
@@ -69,4 +53,2 @@ '#.config.cjs', | ||
'.#rc.ts', | ||
'.#rc.cts', | ||
'.#rc.mts', | ||
'.#rc.js', | ||
@@ -89,4 +71,2 @@ '.#rc.cjs', | ||
'.ts': loadTypeScript, | ||
'.mts': createCustomLoader(jitiLoader), | ||
'.cts': createCustomLoader(jitiLoader), | ||
'.js': defaultLoaders['.js'], | ||
@@ -101,4 +81,1 @@ '.json': createCustomLoader(defaultLoaders['.json']), | ||
} | ||
function isRequireESMError(err) { | ||
return typeof err.stack === 'string' && err.stack.startsWith('Error [ERR_REQUIRE_ESM]:'); | ||
} |
{ | ||
"name": "graphql-config", | ||
"version": "4.5.0-alpha-20230303172027-c80ecbf", | ||
"version": "4.5.0-alpha-20230304025109-5dcd2ee", | ||
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)", | ||
@@ -27,3 +27,2 @@ "sideEffects": false, | ||
"cosmiconfig": "8.0.0", | ||
"jiti": "1.17.1", | ||
"minimatch": "4.2.1", | ||
@@ -30,0 +29,0 @@ "string-env-interpolation": "1.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13
82520
1740
+ Added@types/node@22.10.0(transitive)
+ Addedundici-types@6.20.0(transitive)
- Removedjiti@1.17.1
- Removed@types/node@22.9.1(transitive)
- Removedjiti@1.17.1(transitive)
- Removedundici-types@6.19.8(transitive)