graphql-data-generator 0.3.1-alpha.2 → 0.3.1-alpha.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.
- package/esm/init.js +3 -3
- package/package.json +1 -1
- package/script/init.js +3 -3
package/esm/init.js
CHANGED
|
@@ -11,13 +11,13 @@ const files = {};
|
|
|
11
11
|
const loadFile = (path) => {
|
|
12
12
|
if (files[path])
|
|
13
13
|
return files[path];
|
|
14
|
-
const raw =
|
|
14
|
+
const raw = readFileSync(path, "utf-8");
|
|
15
15
|
const imports = Array.from(raw.matchAll(/#import "(.*)"/gm), ([, importPath]) => loadFile(require.resolve(importPath.startsWith(".")
|
|
16
16
|
? resolve(dntShim.Deno.cwd(), dirname(path), importPath)
|
|
17
17
|
: importPath, { paths: [dntShim.Deno.cwd()] })));
|
|
18
18
|
if (!imports.length)
|
|
19
|
-
return raw;
|
|
20
|
-
return [raw, ...imports].join("\n\n");
|
|
19
|
+
return files[path] = raw;
|
|
20
|
+
return files[path] = [raw, ...imports].join("\n\n");
|
|
21
21
|
};
|
|
22
22
|
const getOperationContentMap = {};
|
|
23
23
|
const getOperationContent = (path, operationName) => {
|
package/package.json
CHANGED
package/script/init.js
CHANGED
|
@@ -37,13 +37,13 @@ const files = {};
|
|
|
37
37
|
const loadFile = (path) => {
|
|
38
38
|
if (files[path])
|
|
39
39
|
return files[path];
|
|
40
|
-
const raw =
|
|
40
|
+
const raw = (0, node_fs_1.readFileSync)(path, "utf-8");
|
|
41
41
|
const imports = Array.from(raw.matchAll(/#import "(.*)"/gm), ([, importPath]) => loadFile(require.resolve(importPath.startsWith(".")
|
|
42
42
|
? (0, node_path_1.resolve)(dntShim.Deno.cwd(), (0, node_path_1.dirname)(path), importPath)
|
|
43
43
|
: importPath, { paths: [dntShim.Deno.cwd()] })));
|
|
44
44
|
if (!imports.length)
|
|
45
|
-
return raw;
|
|
46
|
-
return [raw, ...imports].join("\n\n");
|
|
45
|
+
return files[path] = raw;
|
|
46
|
+
return files[path] = [raw, ...imports].join("\n\n");
|
|
47
47
|
};
|
|
48
48
|
const getOperationContentMap = {};
|
|
49
49
|
const getOperationContent = (path, operationName) => {
|