@graphql-codegen/cli 3.2.2-alpha-20230306163648-8206bae40 → 3.2.2-alpha-20230306171438-3dbaac74b
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/cjs/config.js +9 -1
- package/esm/config.js +9 -1
- package/package.json +1 -1
package/cjs/config.js
CHANGED
|
@@ -6,6 +6,7 @@ const crypto_1 = require("crypto");
|
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const module_1 = require("module");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
+
const node_url_1 = require("node:url");
|
|
9
10
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
10
11
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
11
12
|
const jiti_1 = tslib_1.__importDefault(require("jiti"));
|
|
@@ -47,7 +48,14 @@ function customLoader(ext) {
|
|
|
47
48
|
return cosmiconfig_1.defaultLoaders['.js'](filepath, content);
|
|
48
49
|
}
|
|
49
50
|
if (ext === 'ts') {
|
|
50
|
-
|
|
51
|
+
let filename;
|
|
52
|
+
if (typeof __filename === 'undefined') {
|
|
53
|
+
filename = (0, node_url_1.fileURLToPath)(import.meta.url);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
filename = __filename;
|
|
57
|
+
}
|
|
58
|
+
const jitiLoader = (0, jiti_1.default)(filename, {
|
|
51
59
|
interopDefault: true,
|
|
52
60
|
});
|
|
53
61
|
return jitiLoader(filepath);
|
package/esm/config.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createHash } from 'crypto';
|
|
|
2
2
|
import { promises } from 'fs';
|
|
3
3
|
import { createRequire } from 'module';
|
|
4
4
|
import { resolve } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
5
6
|
import { createNoopProfiler, createProfiler, getCachedDocumentNodeFromSchema, } from '@graphql-codegen/plugin-helpers';
|
|
6
7
|
import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
|
|
7
8
|
import jiti from 'jiti';
|
|
@@ -42,7 +43,14 @@ function customLoader(ext) {
|
|
|
42
43
|
return defaultLoaders['.js'](filepath, content);
|
|
43
44
|
}
|
|
44
45
|
if (ext === 'ts') {
|
|
45
|
-
|
|
46
|
+
let filename;
|
|
47
|
+
if (typeof __filename === 'undefined') {
|
|
48
|
+
filename = fileURLToPath(import.meta.url);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
filename = __filename;
|
|
52
|
+
}
|
|
53
|
+
const jitiLoader = jiti(filename, {
|
|
46
54
|
interopDefault: true,
|
|
47
55
|
});
|
|
48
56
|
return jitiLoader(filepath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/cli",
|
|
3
|
-
"version": "3.2.2-alpha-
|
|
3
|
+
"version": "3.2.2-alpha-20230306171438-3dbaac74b",
|
|
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 || ^16.0.0"
|
|
6
6
|
},
|