graphile-export 0.0.2-beta.2 → 0.0.2-beta.21
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/CHANGELOG.md +284 -0
- package/README.md +5 -2
- package/dist/exportSchema.d.ts +4 -1
- package/dist/exportSchema.d.ts.map +1 -1
- package/dist/exportSchema.js +273 -100
- package/dist/exportSchema.js.map +1 -1
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +2 -1
- package/dist/helpers.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/optimize/index.d.ts +1 -1
- package/dist/optimize/index.d.ts.map +1 -1
- package/dist/optimize/index.js +69 -25
- package/dist/optimize/index.js.map +1 -1
- package/dist/reservedWords.d.ts +2 -0
- package/dist/reservedWords.d.ts.map +1 -0
- package/dist/reservedWords.js +100 -0
- package/dist/reservedWords.js.map +1 -0
- package/dist/wellKnown.d.ts +0 -19
- package/dist/wellKnown.d.ts.map +1 -1
- package/dist/wellKnown.js +15 -13
- package/dist/wellKnown.js.map +1 -1
- package/package.json +23 -19
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservedWords.js","sourceRoot":"","sources":["../src/reservedWords.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,oBAAoB;IACpB,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,UAAU;IACV,UAAU;IACV,SAAS;IACT,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,QAAQ;IACR,SAAS;IACT,OAAO;IACP,SAAS;IACT,KAAK;IACL,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,KAAK;IACL,QAAQ;IACR,OAAO;IAEP,wBAAwB;IACxB,MAAM;IACN,YAAY;IACZ,WAAW;IACX,SAAS;IACT,SAAS;IACT,WAAW;IACX,QAAQ;IAER,UAAU;IACV,SAAS;IACT,MAAM;IACN,MAAM;IACN,QAAQ;IACR,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,QAAQ;IACR,OAAO;IACP,cAAc;IACd,QAAQ;IACR,WAAW;IACX,UAAU;IAEV,UAAU;IACV,WAAW;IACX,IAAI;IACJ,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,MAAM;IACN,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,MAAM;IACN,WAAW;IACX,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,OAAO;IAEP,YAAY;IACZ,OAAO;IAEP,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,SAAS;IACT,QAAQ;IACR,aAAa;IACb,OAAO;CACR,CAAwB,CAAC"}
|
package/dist/wellKnown.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import type { ExportOptions } from "./interfaces.js";
|
|
2
|
-
interface $$Export {
|
|
3
|
-
moduleName: string;
|
|
4
|
-
exportName: string | "default" | "*" | string[];
|
|
5
|
-
}
|
|
6
|
-
declare function makeWellKnownFromOptions(options: ExportOptions): {
|
|
7
|
-
namespaces: any;
|
|
8
|
-
wellKnownMap: Map<unknown, $$Export>;
|
|
9
|
-
};
|
|
10
|
-
declare const $$wellKnown: unique symbol;
|
|
11
1
|
declare module "./interfaces.js" {
|
|
12
2
|
interface ExportOptions {
|
|
13
|
-
/** @internal */
|
|
14
|
-
[$$wellKnown]?: ReturnType<typeof makeWellKnownFromOptions>;
|
|
15
3
|
}
|
|
16
4
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Determines if the thing is something well known (like a Node.js builtin); if
|
|
19
|
-
* so, returns the export description of it.
|
|
20
|
-
*
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare function wellKnown(options: ExportOptions, thing: unknown): $$Export | undefined;
|
|
24
5
|
export {};
|
|
25
6
|
//# sourceMappingURL=wellKnown.d.ts.map
|
package/dist/wellKnown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wellKnown.d.ts","sourceRoot":"","sources":["../src/wellKnown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wellKnown.d.ts","sourceRoot":"","sources":["../src/wellKnown.ts"],"names":[],"mappings":"AA6EA,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,aAAa;KAGtB;CACF"}
|
package/dist/wellKnown.js
CHANGED
|
@@ -2,33 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wellKnown = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-duplicate-imports
|
|
7
|
-
const _crypto = tslib_1.__importStar(require("crypto"));
|
|
5
|
+
const cryptoStar = tslib_1.__importStar(require("crypto"));
|
|
8
6
|
const grafastStar = tslib_1.__importStar(require("grafast"));
|
|
9
7
|
const graphqlStar = tslib_1.__importStar(require("grafast/graphql"));
|
|
10
|
-
const
|
|
8
|
+
const utilStar = tslib_1.__importStar(require("util"));
|
|
11
9
|
function makeWellKnownFromOptions(options) {
|
|
10
|
+
const namespaces = Object.create(null);
|
|
12
11
|
const wellKnownMap = new Map();
|
|
13
|
-
function exportAll(
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
function exportAll(moduleStar, moduleName, preferViaDefault = false) {
|
|
13
|
+
namespaces[moduleName] = moduleStar;
|
|
14
|
+
for (const exportName of Object.keys(moduleStar)) {
|
|
15
|
+
if (!wellKnownMap.has(moduleStar[exportName])) {
|
|
16
16
|
/**
|
|
17
17
|
* ESM is still a bit flaky, so though `import { foo } from 'bar';` may
|
|
18
18
|
* work in some contexts, in raw Node it's often required to do
|
|
19
19
|
* `import bar from 'bar'; const foo = bar.foo;`. This code determines
|
|
20
20
|
* if this latter approach is desired.
|
|
21
21
|
*/
|
|
22
|
-
const viaDefault = preferViaDefault &&
|
|
23
|
-
|
|
22
|
+
const viaDefault = preferViaDefault &&
|
|
23
|
+
exportName !== "default" &&
|
|
24
|
+
moduleStar[exportName] === moduleStar["default"]?.[exportName];
|
|
25
|
+
wellKnownMap.set(moduleStar[exportName], {
|
|
24
26
|
moduleName,
|
|
25
27
|
exportName: viaDefault ? ["default", exportName] : exportName,
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
if (!wellKnownMap.has(moduleStar)) {
|
|
32
|
+
wellKnownMap.set(moduleStar, { moduleName, exportName: "*" });
|
|
33
|
+
}
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
wellKnownMap.set(util_1.default, { moduleName: "util", exportName: "default" });
|
|
35
|
+
exportAll(cryptoStar, "crypto");
|
|
32
36
|
exportAll(grafastStar, "grafast");
|
|
33
37
|
exportAll(graphqlStar, "graphql");
|
|
34
38
|
exportAll(utilStar, "util");
|
|
@@ -47,12 +51,10 @@ function makeWellKnownFromOptions(options) {
|
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
|
-
const namespaces = Object.assign(Object.create(null), { crypto: _crypto });
|
|
51
54
|
// Now process options
|
|
52
55
|
if (options.modules) {
|
|
53
56
|
for (const [moduleName, moduleStar] of Object.entries(options.modules)) {
|
|
54
57
|
exportAll(moduleStar, moduleName, true);
|
|
55
|
-
namespaces[moduleName] = moduleStar;
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
return { namespaces, wellKnownMap };
|
package/dist/wellKnown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wellKnown.js","sourceRoot":"","sources":["../src/wellKnown.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"wellKnown.js","sourceRoot":"","sources":["../src/wellKnown.ts"],"names":[],"mappings":";;;;AAAA,2DAAqC;AACrC,6DAAuC;AACvC,qEAA+C;AAC/C,uDAAiC;AASjC,SAAS,wBAAwB,CAAC,OAAsB;IACtD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,IAAI,GAAG,EAAqB,CAAC;IAElD,SAAS,SAAS,CAChB,UAA+B,EAC/B,UAAkB,EAClB,gBAAgB,GAAG,KAAK;QAExB,UAAU,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;QACpC,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YAChD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE;gBAC7C;;;;;mBAKG;gBACH,MAAM,UAAU,GACd,gBAAgB;oBAChB,UAAU,KAAK,SAAS;oBACxB,UAAU,CAAC,UAAU,CAAC,KAAK,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;gBACjE,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;oBACvC,UAAU;oBACV,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU;iBAC9D,CAAC,CAAC;aACJ;SACF;QACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;YACjC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;SAC/D;IACH,CAAC;IAED,SAAS,CAAC,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,CAAC,OAAO,CAAC,CAAC;IAEtE,wCAAwC;IACxC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC;KACf;IAED,kDAAkD;IAClD,KAAK,MAAM,UAAU,IAAI,UAAU,EAAE;QACnC,IAAI,eAAe,CAAC,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE;YAClD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC;SACxC;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AApBD,8BAoBC;AAED,SAAS,eAAe,CACtB,KAAc,EACd,SAAqB;IAErB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,EAAE;QAC9C,OAAO,KAAK,CAAC;KACd;IACD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACvC,IAAI,SAAS,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE;QACvC,OAAO,KAAK,CAAC;KACd;IACD,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;QACzB,IAAK,KAA6B,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,EAAE;YAC1D,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-export",
|
|
3
|
-
"version": "0.0.2-beta.
|
|
3
|
+
"version": "0.0.2-beta.21",
|
|
4
4
|
"description": "Export in-memory generated GraphQL schemas to JS files when built with our helpers.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/graphile/
|
|
23
|
+
"url": "git+https://github.com/graphile/crystal.git"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"graphql",
|
|
@@ -36,27 +36,31 @@
|
|
|
36
36
|
"author": "Benjie Gillam <code@benjiegillam.com>",
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/graphile/
|
|
39
|
+
"url": "https://github.com/graphile/crystal/issues"
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://graphile.org/",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@babel/generator": "^7.
|
|
44
|
-
"@babel/parser": "^7.
|
|
45
|
-
"@babel/template": "^7.
|
|
46
|
-
"@babel/traverse": "^7.
|
|
47
|
-
"@babel/types": "^7.
|
|
48
|
-
"@types/node": "^
|
|
49
|
-
"prettier": "^
|
|
50
|
-
"tslib": "^2.
|
|
43
|
+
"@babel/generator": "^7.25.6",
|
|
44
|
+
"@babel/parser": "^7.25.6",
|
|
45
|
+
"@babel/template": "^7.25.0",
|
|
46
|
+
"@babel/traverse": "^7.25.6",
|
|
47
|
+
"@babel/types": "^7.25.6",
|
|
48
|
+
"@types/node": "^20.5.7",
|
|
49
|
+
"prettier": "^3.0.3",
|
|
50
|
+
"tslib": "^2.6.2"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": ">=16"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"
|
|
57
|
-
"
|
|
56
|
+
"eslint": "^8.48.0",
|
|
57
|
+
"grafast": "^0.1.1-beta.16",
|
|
58
|
+
"pg-sql2": "^5.0.0-beta.6"
|
|
58
59
|
},
|
|
59
60
|
"peerDependenciesMeta": {
|
|
61
|
+
"eslint": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
60
64
|
"pg-sql2": {
|
|
61
65
|
"optional": true
|
|
62
66
|
}
|
|
@@ -65,12 +69,12 @@
|
|
|
65
69
|
"dist"
|
|
66
70
|
],
|
|
67
71
|
"devDependencies": {
|
|
68
|
-
"@types/babel__generator": "^7.6.
|
|
69
|
-
"@types/babel__template": "^7.4.
|
|
70
|
-
"@types/jest": "^
|
|
71
|
-
"@types/prettier": "^
|
|
72
|
-
"jest": "^
|
|
72
|
+
"@types/babel__generator": "^7.6.8",
|
|
73
|
+
"@types/babel__template": "^7.4.4",
|
|
74
|
+
"@types/jest": "^29.5.4",
|
|
75
|
+
"@types/prettier": "^3.0.0",
|
|
76
|
+
"jest": "^29.6.4",
|
|
73
77
|
"ts-node": "^10.9.1",
|
|
74
|
-
"typescript": "^5.
|
|
78
|
+
"typescript": "^5.2.2"
|
|
75
79
|
}
|
|
76
80
|
}
|