graphile 5.0.0-0.7 → 5.0.0-1.2
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 +50 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/config/options/main.d.ts.map +1 -1
- package/dist/commands/config/options/main.js +23 -153
- package/dist/commands/config/options/main.js.map +1 -1
- package/dist/commands/inflection/cli.d.ts +5 -0
- package/dist/commands/inflection/cli.d.ts.map +1 -0
- package/dist/commands/inflection/cli.js +17 -0
- package/dist/commands/inflection/cli.js.map +1 -0
- package/dist/commands/inflection/list/cli.d.ts +7 -0
- package/dist/commands/inflection/list/cli.d.ts.map +1 -0
- package/dist/commands/inflection/list/cli.js +21 -0
- package/dist/commands/inflection/list/cli.js.map +1 -0
- package/dist/commands/inflection/list/main.d.ts +4 -0
- package/dist/commands/inflection/list/main.d.ts.map +1 -0
- package/dist/commands/inflection/list/main.js +89 -0
- package/dist/commands/inflection/list/main.js.map +1 -0
- package/dist/utils/typescriptVfs.d.ts +22 -0
- package/dist/utils/typescriptVfs.d.ts.map +1 -0
- package/dist/utils/typescriptVfs.js +262 -0
- package/dist/utils/typescriptVfs.js.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# graphile
|
|
2
2
|
|
|
3
|
+
## 5.0.0-1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#291](https://github.com/benjie/postgraphile-private/pull/291)
|
|
8
|
+
[`611f00140`](https://github.com/benjie/postgraphile-private/commit/611f00140d7f5b0620e274fc21869ec82055e080)
|
|
9
|
+
Thanks [@benjie](https://github.com/benjie)! - New `graphile inflection list`
|
|
10
|
+
command to list the available inflectors (and their docs/types) based on your
|
|
11
|
+
plugins and presets.
|
|
12
|
+
|
|
13
|
+
## 5.0.0-1.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#260](https://github.com/benjie/postgraphile-private/pull/260)
|
|
18
|
+
[`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c)
|
|
19
|
+
Thanks [@benjie](https://github.com/benjie)! - TypeScript v5 is now required
|
|
20
|
+
|
|
21
|
+
- [#271](https://github.com/benjie/postgraphile-private/pull/271)
|
|
22
|
+
[`261eb520b`](https://github.com/benjie/postgraphile-private/commit/261eb520b33fe3673fe3a7712085e50291aed1e5)
|
|
23
|
+
Thanks [@benjie](https://github.com/benjie)! - 🚨 **RENAME ALL THE THINGS**
|
|
24
|
+
|
|
25
|
+
The term 'source' was overloaded, and 'configs' was too vague, and
|
|
26
|
+
'databaseName' was misleading, and 'source' behaviours actually applied to
|
|
27
|
+
resources, and more. So, we've renamed lots of things as part of the API
|
|
28
|
+
stabilization work. You're probably only affected by the first 2 bullet
|
|
29
|
+
points.
|
|
30
|
+
|
|
31
|
+
- `pgConfigs` -> `pgServices` (also applies to related `pgConfig` terms such
|
|
32
|
+
as `makePgConfig` -> `makePgService`, `MakePgConfigOptions` ->
|
|
33
|
+
`MakePgServiceOptions`, etc) - see your `graphile.config.ts` or equivalent
|
|
34
|
+
file
|
|
35
|
+
- All `*:source:*` behaviors are now `*:resource:*` behaviors (use regexp
|
|
36
|
+
`/:source\b|\bsource:[a-z$]/` to find the places that need updating)
|
|
37
|
+
- `PgDatabaseConfiguration` -> `PgServiceConfiguration`
|
|
38
|
+
- `databaseName` -> `serviceName` (because it's not the name of the database,
|
|
39
|
+
it's the name of the `pgServices` (which was `pgConfigs`) entry)
|
|
40
|
+
- `PgResourceConfig::source` -> `PgResourceConfig.from` ('source' is
|
|
41
|
+
overloaded, so use a more direct term)
|
|
42
|
+
- `PgResource::source` -> `PgResource.from`
|
|
43
|
+
- `PgSelectPlanJoin::source` -> `PgSelectPlanJoin.from`
|
|
44
|
+
- `helpers.pgIntrospection.getDatabase` ->
|
|
45
|
+
`helpers.pgIntrospection.getService`
|
|
46
|
+
- `helpers.pgIntrospection.getExecutorForDatabase` ->
|
|
47
|
+
`helpers.pgIntrospection.getExecutorForService`
|
|
48
|
+
|
|
49
|
+
- Updated dependencies
|
|
50
|
+
[[`d5312e6b9`](https://github.com/benjie/postgraphile-private/commit/d5312e6b968fbeb46d074b82a41b4bdbc166598c)]:
|
|
51
|
+
- graphile-config@0.0.1-1.1
|
|
52
|
+
|
|
3
53
|
## 5.0.0-0.7
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAKjE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,YAuBlC;AACD,wBAAsB,GAAG,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,OAAO,CAAC,iBAE/D"}
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.run = exports.options = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const configCmd = tslib_1.__importStar(require("./commands/config/cli.js"));
|
|
6
|
+
const inflectionCmd = tslib_1.__importStar(require("./commands/inflection/cli.js"));
|
|
6
7
|
function options(yargs) {
|
|
7
8
|
return yargs
|
|
8
9
|
.parserConfiguration({
|
|
@@ -11,6 +12,7 @@ function options(yargs) {
|
|
|
11
12
|
})
|
|
12
13
|
.example("$0 config options -C graphile.config.ts", "Output the options available to be used in the given config file, based on the imports it contains.")
|
|
13
14
|
.command("config", "Tools for helping with config", (yargs) => configCmd.options(yargs), configCmd.run)
|
|
15
|
+
.command("inflection", "Tools for helping with inflection", (yargs) => inflectionCmd.options(yargs), inflectionCmd.run)
|
|
14
16
|
.demandCommand();
|
|
15
17
|
}
|
|
16
18
|
exports.options = options;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;AAEA,4EAAsD;AACtD,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,mBAAmB,CAAC;QACnB,yDAAyD;QACzD,2BAA2B,EAAE,KAAK;KACnC,CAAC;SACD,OAAO,CACN,yCAAyC,EACzC,qGAAqG,CACtG;SACA,OAAO,CACN,QAAQ,EACR,+BAA+B,EAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EACnC,SAAS,CAAC,GAAG,CACd;SACA,aAAa,EAAE,CAAC;AACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;AAEA,4EAAsD;AACtD,oFAA8D;AAE9D,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,mBAAmB,CAAC;QACnB,yDAAyD;QACzD,2BAA2B,EAAE,KAAK;KACnC,CAAC;SACD,OAAO,CACN,yCAAyC,EACzC,qGAAqG,CACtG;SACA,OAAO,CACN,QAAQ,EACR,+BAA+B,EAC/B,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EACnC,SAAS,CAAC,GAAG,CACd;SACA,OAAO,CACN,YAAY,EACZ,mCAAmC,EACnC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,EACvC,aAAa,CAAC,GAAG,CAClB;SACA,aAAa,EAAE,CAAC;AACrB,CAAC;AAvBD,0BAuBC;AACM,KAAK,UAAU,GAAG,CAAC,KAAsC;IAC9D,aAAa;AACf,CAAC;AAFD,kBAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/commands/config/options/main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/commands/config/options/main.ts"],"names":[],"mappings":"AASA,wBAAgB,IAAI,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,UA4OlD"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.main = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const vfs_1 = require("@typescript/vfs");
|
|
6
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const
|
|
6
|
+
const typescriptVfs_js_1 = require("../../../utils/typescriptVfs.js");
|
|
8
7
|
function main(options) {
|
|
9
|
-
const { filename
|
|
10
|
-
const
|
|
8
|
+
const { filename } = options;
|
|
9
|
+
const { getCompletions, getQuickInfo } = (0, typescriptVfs_js_1.configVfs)({
|
|
10
|
+
filename,
|
|
11
|
+
initialCode: `const preset: GraphileConfig.Preset`,
|
|
12
|
+
});
|
|
11
13
|
let outputText = ``;
|
|
12
14
|
let last = "";
|
|
13
15
|
let inCode = false;
|
|
@@ -38,43 +40,6 @@ from time to time (for example, when you upgrade a module, or add/remove
|
|
|
38
40
|
modules).\
|
|
39
41
|
`);
|
|
40
42
|
out();
|
|
41
|
-
const compilerOpts = {
|
|
42
|
-
module: ts.ModuleKind.Node16,
|
|
43
|
-
target: ts.ScriptTarget.ESNext,
|
|
44
|
-
strict: true,
|
|
45
|
-
esModuleInterop: true,
|
|
46
|
-
skipLibCheck: true,
|
|
47
|
-
skipDefaultLibCheck: true,
|
|
48
|
-
moduleResolution: ts.ModuleResolutionKind.Node16,
|
|
49
|
-
allowJs: true,
|
|
50
|
-
};
|
|
51
|
-
/*
|
|
52
|
-
const compilerOptions = {
|
|
53
|
-
strict: true,
|
|
54
|
-
target: ts.ScriptTarget.ES2015,
|
|
55
|
-
typeRoots: [],
|
|
56
|
-
lib: ["es5"],
|
|
57
|
-
skipDefaultLibCheck: true,
|
|
58
|
-
skipLibCheck: true,
|
|
59
|
-
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
60
|
-
module: ts.ModuleKind.ES2015,
|
|
61
|
-
};
|
|
62
|
-
*/
|
|
63
|
-
const fsMap = new Map();
|
|
64
|
-
const FAKE_FILENAME = "graphileConfigInspection.ts";
|
|
65
|
-
// If using imports where the types don't directly match up to their FS representation (like the
|
|
66
|
-
// imports for node) then use triple-slash directives to make sure globals are set up first.
|
|
67
|
-
const BASE_CONTENT = `\
|
|
68
|
-
/// <reference types="node" />
|
|
69
|
-
import "graphile-config";
|
|
70
|
-
import {} from './${filenameInJs}';
|
|
71
|
-
type Digest<T> = { [TKey in keyof T]: T[TKey] } & {};
|
|
72
|
-
const preset: GraphileConfig.Preset`;
|
|
73
|
-
fsMap.set(FAKE_FILENAME, BASE_CONTENT);
|
|
74
|
-
// By providing a project root, then the system knows how to resolve node_modules correctly
|
|
75
|
-
const projectRoot = process.cwd();
|
|
76
|
-
const system = (0, vfs_1.createFSBackedSystem)(fsMap, projectRoot, ts);
|
|
77
|
-
const env = (0, vfs_1.createVirtualTypeScriptEnvironment)(system, [FAKE_FILENAME, filename], ts, compilerOpts);
|
|
78
43
|
/*
|
|
79
44
|
{
|
|
80
45
|
const content = BASE_CONTENT;
|
|
@@ -102,14 +67,15 @@ const preset: GraphileConfig.Preset`;
|
|
|
102
67
|
*/
|
|
103
68
|
const keys = [];
|
|
104
69
|
{
|
|
105
|
-
const
|
|
106
|
-
env.updateFile(FAKE_FILENAME, content);
|
|
107
|
-
const completions = env.languageService.getCompletionsAtPosition(FAKE_FILENAME, content.length, {});
|
|
70
|
+
const completions = getCompletions(" = {");
|
|
108
71
|
if (completions?.entries) {
|
|
109
72
|
for (const entry of completions.entries) {
|
|
110
73
|
if (entry.kind === "property") {
|
|
111
74
|
keys.push(entry.name);
|
|
112
75
|
}
|
|
76
|
+
else {
|
|
77
|
+
console.error(`Did not understand '${entry.kind}' entry on GraphileConfig.Preset`);
|
|
78
|
+
}
|
|
113
79
|
}
|
|
114
80
|
}
|
|
115
81
|
//console.dir(completions);
|
|
@@ -122,15 +88,6 @@ const preset: GraphileConfig.Preset`;
|
|
|
122
88
|
}
|
|
123
89
|
keys.unshift(key);
|
|
124
90
|
});
|
|
125
|
-
const accessKey = (key) => {
|
|
126
|
-
// TODO: improve?
|
|
127
|
-
if (/^[A-Za-z0-9_]+$/.test(key)) {
|
|
128
|
-
return `.${key}`;
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
return `[${JSON.stringify(key)}]`;
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
91
|
let later = [];
|
|
135
92
|
function outLater(str) {
|
|
136
93
|
later.push(str);
|
|
@@ -142,32 +99,28 @@ const preset: GraphileConfig.Preset`;
|
|
|
142
99
|
"disablePlugins",
|
|
143
100
|
"plugins",
|
|
144
101
|
"extends",
|
|
145
|
-
"
|
|
102
|
+
"pgServices",
|
|
146
103
|
].includes(key);
|
|
147
104
|
if (isArray) {
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
const info = env.languageService.getQuickInfoAtPosition(FAKE_FILENAME, contentWithProperty.length);
|
|
151
|
-
entries.push(`${chalk_1.default.cyanBright(key)}?: ${prettyDisplayParts(info?.displayParts, ":")
|
|
105
|
+
const info = getQuickInfo(` = [];\npreset${(0, typescriptVfs_js_1.accessKey)(key)}`);
|
|
106
|
+
entries.push(`${chalk_1.default.cyanBright(key)}?: ${(0, typescriptVfs_js_1.prettyDisplayParts)(info?.displayParts, ":")
|
|
152
107
|
.replace(/\| undefined$/, "")
|
|
153
108
|
.trim()}`);
|
|
154
109
|
}
|
|
155
110
|
else {
|
|
156
111
|
const SUFFIX1 = ` = {`;
|
|
157
112
|
const SUFFIX2 = `};\n`;
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
entries.push(`${chalk_1.default.cyanBright(key)}?: ${prettyDisplayParts(info?.displayParts, ":")};`);
|
|
163
|
-
const completions = env.languageService.getCompletionsAtPosition(FAKE_FILENAME, contentWithProperty.length - SUFFIX2.length, {});
|
|
113
|
+
const withProperty = ` = Object.create(null);\npreset${(0, typescriptVfs_js_1.accessKey)(key)}${SUFFIX1}${SUFFIX2}`;
|
|
114
|
+
const info = getQuickInfo(withProperty, SUFFIX1.length + SUFFIX2.length);
|
|
115
|
+
entries.push(`${chalk_1.default.cyanBright(key)}?: ${(0, typescriptVfs_js_1.prettyDisplayParts)(info?.displayParts, ":")};`);
|
|
116
|
+
const completions = getCompletions(withProperty, SUFFIX2.length);
|
|
164
117
|
const relevant = completions?.entries
|
|
165
118
|
.filter((e) => e.kind === "property")
|
|
166
119
|
.map((r) => r.name)
|
|
167
120
|
.sort();
|
|
168
121
|
outLater(chalk_1.default.whiteBright.bold(`## ${chalk_1.default.cyanBright.bold(key)}`));
|
|
169
122
|
outLater();
|
|
170
|
-
outLater(prettyDocumentation(info?.documentation));
|
|
123
|
+
outLater((0, typescriptVfs_js_1.prettyDocumentation)(info?.documentation));
|
|
171
124
|
outLater();
|
|
172
125
|
if (relevant) {
|
|
173
126
|
const subentries = [];
|
|
@@ -176,11 +129,9 @@ const preset: GraphileConfig.Preset`;
|
|
|
176
129
|
laterStill.push(line);
|
|
177
130
|
};
|
|
178
131
|
for (const subkey of relevant) {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
const info = env.languageService.getQuickInfoAtPosition(FAKE_FILENAME, contentWithSubpropertyAccess.length);
|
|
183
|
-
subentries.push(`${chalk_1.default.greenBright.bold(subkey)}?: ${prettyDisplayParts(info?.displayParts, ":")
|
|
132
|
+
const withSubpropertyAccess = withProperty + `preset${(0, typescriptVfs_js_1.accessKey)(key)}!${(0, typescriptVfs_js_1.accessKey)(subkey)}`;
|
|
133
|
+
const info = getQuickInfo(withSubpropertyAccess);
|
|
134
|
+
subentries.push(`${chalk_1.default.greenBright.bold(subkey)}?: ${(0, typescriptVfs_js_1.prettyDisplayParts)(info?.displayParts, ":")
|
|
184
135
|
.replace(/\| undefined$/, "")
|
|
185
136
|
.trim()};`);
|
|
186
137
|
/*
|
|
@@ -204,12 +155,12 @@ const preset: GraphileConfig.Preset`;
|
|
|
204
155
|
*/
|
|
205
156
|
outLaterStill(chalk_1.default.whiteBright(`### ${chalk_1.default.cyanBright.bold(key)}.${chalk_1.default.greenBright.bold(subkey)}`));
|
|
206
157
|
outLaterStill();
|
|
207
|
-
const displayParts = prettyDisplayParts(info?.displayParts, ":");
|
|
158
|
+
const displayParts = (0, typescriptVfs_js_1.prettyDisplayParts)(info?.displayParts, ":");
|
|
208
159
|
outLaterStill(`${chalk_1.default.greenBright.bold("Type")}: \`${displayParts
|
|
209
160
|
? chalk_1.default.whiteBright(displayParts)
|
|
210
161
|
: chalk_1.default.gray("unknown")}\``);
|
|
211
162
|
outLaterStill();
|
|
212
|
-
outLaterStill(prettyDocumentation(info?.documentation));
|
|
163
|
+
outLaterStill((0, typescriptVfs_js_1.prettyDocumentation)(info?.documentation));
|
|
213
164
|
outLaterStill();
|
|
214
165
|
}
|
|
215
166
|
if (subentries.length) {
|
|
@@ -255,85 +206,4 @@ const preset: GraphileConfig.Preset`;
|
|
|
255
206
|
return outputText.trim() + "\n";
|
|
256
207
|
}
|
|
257
208
|
exports.main = main;
|
|
258
|
-
/*
|
|
259
|
-
debugger;
|
|
260
|
-
|
|
261
|
-
const host = createVirtualCompilerHost(system, compilerOpts, ts);
|
|
262
|
-
const program = ts.createProgram({
|
|
263
|
-
rootNames: [...fsMap.keys()],
|
|
264
|
-
options: compilerOpts,
|
|
265
|
-
host: host.compilerHost,
|
|
266
|
-
});
|
|
267
|
-
const checker = program.getTypeChecker();
|
|
268
|
-
|
|
269
|
-
// This will update the fsMap with new files
|
|
270
|
-
// for the .d.ts and .js files
|
|
271
|
-
program.emit();
|
|
272
|
-
|
|
273
|
-
// Now I can look at the AST for the .ts file too
|
|
274
|
-
const index = program.getSourceFile(FAKE_FILENAME)!;
|
|
275
|
-
const symbols = checker.getSymbolsInScope(index, ts.SymbolFlags.Variable);
|
|
276
|
-
const symbol = symbols.find((s) => s.name === "preset");
|
|
277
|
-
console.log(symbol);
|
|
278
|
-
if (symbol) {
|
|
279
|
-
const type = checker.getDeclaredTypeOfSymbol(symbol);
|
|
280
|
-
console.log(type.getApparentProperties());
|
|
281
|
-
console.dir(type.get);
|
|
282
|
-
const properties = type.getProperties();
|
|
283
|
-
console.dir(properties);
|
|
284
|
-
}
|
|
285
|
-
ts.forEachChild(index, (node) => {
|
|
286
|
-
if (isVariableStatement(node)) {
|
|
287
|
-
console.log(node.getText());
|
|
288
|
-
const node2 = node.declarationList.declarations[0];
|
|
289
|
-
console.log(node2.getText());
|
|
290
|
-
const type = checker.getTypeAtLocation(node2);
|
|
291
|
-
const properties = type.getProperties();
|
|
292
|
-
// const properties = checker.getDeclaredTypeOfSymbol(symbol).getProperties();
|
|
293
|
-
console.dir(properties);
|
|
294
|
-
}
|
|
295
|
-
});
|
|
296
|
-
*/
|
|
297
|
-
function prettyDisplayParts(displayParts, trimUntil = ":") {
|
|
298
|
-
if (!displayParts) {
|
|
299
|
-
return "";
|
|
300
|
-
}
|
|
301
|
-
let found = !trimUntil;
|
|
302
|
-
let depth = 0;
|
|
303
|
-
let str = "";
|
|
304
|
-
for (const { text } of displayParts) {
|
|
305
|
-
if (found) {
|
|
306
|
-
str += text;
|
|
307
|
-
}
|
|
308
|
-
else if (text === "(" || text === "[") {
|
|
309
|
-
depth++;
|
|
310
|
-
}
|
|
311
|
-
else if (text === ")" || text === "]") {
|
|
312
|
-
depth--;
|
|
313
|
-
}
|
|
314
|
-
else if (text === trimUntil && depth === 0) {
|
|
315
|
-
found = true;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return str.trim();
|
|
319
|
-
}
|
|
320
|
-
function prettyDocumentation(parts) {
|
|
321
|
-
if (!parts) {
|
|
322
|
-
return "";
|
|
323
|
-
}
|
|
324
|
-
let text = "";
|
|
325
|
-
for (const part of parts) {
|
|
326
|
-
switch (part.kind) {
|
|
327
|
-
case "text": {
|
|
328
|
-
text += part.text;
|
|
329
|
-
break;
|
|
330
|
-
}
|
|
331
|
-
default: {
|
|
332
|
-
text += part.text;
|
|
333
|
-
break;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return text.trim();
|
|
338
|
-
}
|
|
339
209
|
//# sourceMappingURL=main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/commands/config/options/main.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/commands/config/options/main.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,sEAKyC;AAEzC,SAAgB,IAAI,CAAC,OAA8B;IACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAA,4BAAS,EAAC;QACjD,QAAQ;QACR,WAAW,EAAE,qCAAqC;KACnD,CAAC,CAAC;IAEH,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,SAAS,GAAG,CAAC,IAAI,GAAG,EAAE;QACpB,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;YACzC,OAAO;SACR;QACD,IAAI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C;aACjB;SACF;QACD;;;;;;;;MAQF;KACC;IAED,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,GAAG,CAAC,OAAO,CAAC,CAAC;QACb,GAAG,CAAC,GAAG,CAAC,CAAC;QACT,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;YAC3B,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;SACnB;QACD,GAAG,CAAC,GAAG,CAAC,CAAC;QACT,GAAG,CAAC,KAAK,CAAC,CAAC;QACX,GAAG,EAAE,CAAC;KACP;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,GAAG,CAAC,IAAI,CAAC,CAAC;KACX;IACD,KAAK,GAAG,EAAE,CAAC;IACX,OAAO,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAClC,CAAC;AA5OD,oBA4OC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/commands/inflection/cli.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAIjE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI,YASlC;AAED,wBAAgB,GAAG,CAAC,KAAK,EAAE,eAAe,CAAC,OAAO,OAAO,CAAC,QAGzD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = exports.options = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const listCmd = tslib_1.__importStar(require("./list/cli.js"));
|
|
6
|
+
function options(yargs) {
|
|
7
|
+
return yargs
|
|
8
|
+
.command("list", "List the available inflectors", listCmd.options, listCmd.run)
|
|
9
|
+
.demandCommand();
|
|
10
|
+
}
|
|
11
|
+
exports.options = options;
|
|
12
|
+
function run(_args) {
|
|
13
|
+
// This should never happen, yargs handles it for us
|
|
14
|
+
throw new Error("Subcommand required");
|
|
15
|
+
}
|
|
16
|
+
exports.run = run;
|
|
17
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/commands/inflection/cli.ts"],"names":[],"mappings":";;;;AAEA,+DAAyC;AAEzC,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CACN,MAAM,EACN,+BAA+B,EAC/B,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,GAAG,CACZ;SACA,aAAa,EAAE,CAAC;AACrB,CAAC;AATD,0BASC;AAED,SAAgB,GAAG,CAAC,KAAsC;IACxD,oDAAoD;IACpD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;AACzC,CAAC;AAHD,kBAGC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="yargs" />
|
|
2
|
+
import type { ArgsFromOptions, Argv } from "graphile-config/cli";
|
|
3
|
+
export declare function options(yargs: Argv): Argv<{
|
|
4
|
+
config: string | undefined;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function run(args: ArgsFromOptions<typeof options>): void;
|
|
7
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../src/commands/inflection/list/cli.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAIjE,wBAAgB,OAAO,CAAC,KAAK,EAAE,IAAI;;GAYlC;AACD,wBAAgB,GAAG,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,OAAO,CAAC,QAGxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.run = exports.options = void 0;
|
|
4
|
+
const main_js_1 = require("./main.js");
|
|
5
|
+
function options(yargs) {
|
|
6
|
+
return yargs
|
|
7
|
+
.example("$0 -C graphile.config.ts", "Read and parse graphile.config.ts, and determine the inflectors available for plugins therein")
|
|
8
|
+
.option("config", {
|
|
9
|
+
alias: "C",
|
|
10
|
+
type: "string",
|
|
11
|
+
description: "The path to the config file",
|
|
12
|
+
normalize: true,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
exports.options = options;
|
|
16
|
+
function run(args) {
|
|
17
|
+
const text = (0, main_js_1.main)({ filename: args.config });
|
|
18
|
+
console.log(text);
|
|
19
|
+
}
|
|
20
|
+
exports.run = run;
|
|
21
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/commands/inflection/list/cli.ts"],"names":[],"mappings":";;;AAEA,uCAAiC;AAEjC,SAAgB,OAAO,CAAC,KAAW;IACjC,OAAO,KAAK;SACT,OAAO,CACN,0BAA0B,EAC1B,+FAA+F,CAChG;SACA,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,6BAA6B;QAC1C,SAAS,EAAE,IAAI;KAChB,CAAC,CAAC;AACP,CAAC;AAZD,0BAYC;AACD,SAAgB,GAAG,CAAC,IAAqC;IACvD,MAAM,IAAI,GAAG,IAAA,cAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAHD,kBAGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../src/commands/inflection/list/main.ts"],"names":[],"mappings":"AAWA,wBAAgB,IAAI,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,UA6FlD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.main = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const typescriptVfs_js_1 = require("../../../utils/typescriptVfs.js");
|
|
7
|
+
function main(options) {
|
|
8
|
+
const { filename } = options;
|
|
9
|
+
const { getCompletions, getQuickInfo } = (0, typescriptVfs_js_1.configVfs)({
|
|
10
|
+
filename,
|
|
11
|
+
initialCode: `\
|
|
12
|
+
const inflection: GraphileBuild.Inflection = null as any;
|
|
13
|
+
inflection`,
|
|
14
|
+
});
|
|
15
|
+
let outputText = ``;
|
|
16
|
+
let last = "";
|
|
17
|
+
let inCode = false;
|
|
18
|
+
function out(text = "") {
|
|
19
|
+
if (text === "" && last === "" && !inCode) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let exitCode = false;
|
|
23
|
+
if (!inCode && text.startsWith("```")) {
|
|
24
|
+
inCode = true;
|
|
25
|
+
}
|
|
26
|
+
else if (text.startsWith("```")) {
|
|
27
|
+
exitCode = true;
|
|
28
|
+
}
|
|
29
|
+
outputText += (inCode ? chalk_1.default.green(text) : text) + "\n";
|
|
30
|
+
last = text;
|
|
31
|
+
if (exitCode) {
|
|
32
|
+
inCode = false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
out(chalk_1.default.whiteBright.bold(`# Custom \`GraphileBuild.Inflection\` Reference`));
|
|
36
|
+
out();
|
|
37
|
+
out(`\
|
|
38
|
+
This reference was autogenerated by \`graphile inflection list\` using your
|
|
39
|
+
local configuration file to determine the inflectors that are available based
|
|
40
|
+
on the plugins and presets you use. You should regenerate it from time to time
|
|
41
|
+
(for example, when you upgrade a module, or add/remove modules).`);
|
|
42
|
+
out();
|
|
43
|
+
const completions = [...(getCompletions(".")?.entries ?? [])];
|
|
44
|
+
completions.sort((a, z) => a.name.localeCompare(z.name));
|
|
45
|
+
let later = [];
|
|
46
|
+
function outLater(str) {
|
|
47
|
+
later.push(str);
|
|
48
|
+
}
|
|
49
|
+
const entries = [];
|
|
50
|
+
const INDENT = 2;
|
|
51
|
+
for (const entry of completions) {
|
|
52
|
+
const key = entry.name;
|
|
53
|
+
const withProperty = (0, typescriptVfs_js_1.accessKey)(key);
|
|
54
|
+
const info = getQuickInfo(withProperty);
|
|
55
|
+
//entries.push(
|
|
56
|
+
// `${chalk.cyanBright(key)}${prettyQuickInfoDisplayParts(info)};`,
|
|
57
|
+
//);
|
|
58
|
+
const doc = (0, typescriptVfs_js_1.tightDocumentation)(info, 80 - INDENT - 7);
|
|
59
|
+
entries.push(`${doc
|
|
60
|
+
? chalk_1.default.gray(`/** ${doc} */
|
|
61
|
+
`)
|
|
62
|
+
: ``}${chalk_1.default.cyanBright(key)}${(0, typescriptVfs_js_1.tightDisplayParts)(info, 80 - INDENT - key.length)}`);
|
|
63
|
+
outLater(chalk_1.default.whiteBright.bold(`## ${chalk_1.default.cyanBright.bold(key)}`));
|
|
64
|
+
outLater();
|
|
65
|
+
outLater((0, typescriptVfs_js_1.prettyDocumentation)(info?.documentation));
|
|
66
|
+
outLater();
|
|
67
|
+
outLater("```ts");
|
|
68
|
+
outLater(key + (0, typescriptVfs_js_1.prettyQuickInfoDisplayParts)(info));
|
|
69
|
+
outLater("```");
|
|
70
|
+
outLater();
|
|
71
|
+
}
|
|
72
|
+
if (entries.length) {
|
|
73
|
+
out("```ts");
|
|
74
|
+
out(chalk_1.default.cyanBright(`interface GraphileBuild.Inflection`) + ` {`);
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
out(" " + entry.replace(/\n/g, "\n "));
|
|
77
|
+
}
|
|
78
|
+
out("}");
|
|
79
|
+
out("```");
|
|
80
|
+
out();
|
|
81
|
+
}
|
|
82
|
+
for (const line of later) {
|
|
83
|
+
out(line);
|
|
84
|
+
}
|
|
85
|
+
later = [];
|
|
86
|
+
return outputText.trim() + "\n";
|
|
87
|
+
}
|
|
88
|
+
exports.main = main;
|
|
89
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../../../src/commands/inflection/list/main.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,sEAOyC;AAEzC,SAAgB,IAAI,CAAC,OAA8B;IACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAA,4BAAS,EAAC;QACjD,QAAQ;QACR,WAAW,EAAE;;WAEN;KACR,CAAC,CAAC;IAEH,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,SAAS,GAAG,CAAC,IAAI,GAAG,EAAE;QACpB,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;YACzC,OAAO;SACR;QACD,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YACrC,MAAM,GAAG,IAAI,CAAC;SACf;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;YACjC,QAAQ,GAAG,IAAI,CAAC;SACjB;QACD,UAAU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QACzD,IAAI,GAAG,IAAI,CAAC;QACZ,IAAI,QAAQ,EAAE;YACZ,MAAM,GAAG,KAAK,CAAC;SAChB;IACH,CAAC;IACD,GAAG,CACD,eAAK,CAAC,WAAW,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAC1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M,eAAK,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACrE,QAAQ,EAAE,CAAC;QACX,QAAQ,CAAC,IAAA,sCAAmB,EAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;QACnD,QAAQ,EAAE,CAAC;QACX,QAAQ,CAAC,OAAO,CAAC,CAAC;QAClB,QAAQ,CAAC,GAAG,GAAG,IAAA,8CAA2B,EAAC,IAAI,CAAC,CAAC,CAAC;QAClD,QAAQ,CAAC,KAAK,CAAC,CAAC;QAChB,QAAQ,EAAE,CAAC;KACZ;IAED,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,GAAG,CAAC,OAAO,CAAC,CAAC;QACb,GAAG,CAAC,eAAK,CAAC,UAAU,CAAC,oCAAoC,CAAC,GAAG,IAAI,CAAC,CAAC;QACnE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;YAC3B,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;SAC1C;QACD,GAAG,CAAC,GAAG,CAAC,CAAC;QACT,GAAG,CAAC,KAAK,CAAC,CAAC;QACX,GAAG,EAAE,CAAC;KACP;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,GAAG,CAAC,IAAI,CAAC,CAAC;KACX;IACD,KAAK,GAAG,EAAE,CAAC;IACX,OAAO,UAAU,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC;AAClC,CAAC;AA7FD,oBA6FC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as ts from "typescript";
|
|
2
|
+
export declare function configVfs(options: {
|
|
3
|
+
filename?: string;
|
|
4
|
+
initialCode?: string;
|
|
5
|
+
}): {
|
|
6
|
+
env: import("@typescript/vfs").VirtualTypeScriptEnvironment;
|
|
7
|
+
FAKE_FILENAME: string;
|
|
8
|
+
BASE_CONTENT: string;
|
|
9
|
+
getCompletions: (additionalContent?: string, offsetFromEnd?: number) => ts.WithMetadata<ts.CompletionInfo> | undefined;
|
|
10
|
+
getQuickInfo: (additionalContent?: string, offsetFromEnd?: number) => ts.QuickInfo | undefined;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated use prettyQuickInfoDisplayParts instead
|
|
14
|
+
*/
|
|
15
|
+
export declare function prettyDisplayParts(displayParts: ReadonlyArray<ts.SymbolDisplayPart> | undefined, trimUntil?: string): string;
|
|
16
|
+
export declare function prettyQuickInfoDisplayParts(quickInfo: ts.QuickInfo | undefined, omitThis?: boolean): string;
|
|
17
|
+
export declare function prettyDocumentation(parts: ReadonlyArray<ts.SymbolDisplayPart> | undefined): string;
|
|
18
|
+
export declare function truncate(text: string, length?: number): string;
|
|
19
|
+
export declare function tightDocumentation(info: ts.QuickInfo | undefined, length?: number): string;
|
|
20
|
+
export declare function tightDisplayParts(info: ts.QuickInfo | undefined, length?: number): string;
|
|
21
|
+
export declare const accessKey: (key: string) => string;
|
|
22
|
+
//# sourceMappingURL=typescriptVfs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescriptVfs.d.ts","sourceRoot":"","sources":["../../src/utils/typescriptVfs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,wBAAgB,SAAS,CAAC,OAAO,EAAE;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;;EAyEA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,aAAa,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,SAAS,EAC7D,SAAS,SAAM,GACd,MAAM,CAmBR;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,EAAE,CAAC,SAAS,GAAG,SAAS,EACnC,QAAQ,UAAO,GACd,MAAM,CAiCR;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,iBAAiB,CAAC,GAAG,SAAS,GACrD,MAAM,CAkBR;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,CAM1D;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,EAAE,CAAC,SAAS,GAAG,SAAS,EAC9B,MAAM,SAAK,UAOZ;AAyCD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,GAAG,SAAS,EAAE,MAAM,SAAK,UAW5E;AAED,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,MAOvC,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.accessKey = exports.tightDisplayParts = exports.tightDocumentation = exports.truncate = exports.prettyDocumentation = exports.prettyQuickInfoDisplayParts = exports.prettyDisplayParts = exports.configVfs = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const vfs_1 = require("@typescript/vfs");
|
|
6
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
7
|
+
function configVfs(options) {
|
|
8
|
+
const { filename = "graphile.config.ts", initialCode = "" } = options;
|
|
9
|
+
const filenameInJs = filename.replace(/\.([mc]?)(ts)$/, ".$1js");
|
|
10
|
+
const compilerOpts = {
|
|
11
|
+
module: ts.ModuleKind.Node16,
|
|
12
|
+
target: ts.ScriptTarget.ESNext,
|
|
13
|
+
strict: true,
|
|
14
|
+
esModuleInterop: true,
|
|
15
|
+
skipLibCheck: true,
|
|
16
|
+
skipDefaultLibCheck: true,
|
|
17
|
+
moduleResolution: ts.ModuleResolutionKind.Node16,
|
|
18
|
+
allowJs: true,
|
|
19
|
+
};
|
|
20
|
+
/*
|
|
21
|
+
const compilerOptions = {
|
|
22
|
+
strict: true,
|
|
23
|
+
target: ts.ScriptTarget.ES2015,
|
|
24
|
+
typeRoots: [],
|
|
25
|
+
lib: ["es5"],
|
|
26
|
+
skipDefaultLibCheck: true,
|
|
27
|
+
skipLibCheck: true,
|
|
28
|
+
moduleResolution: ts.ModuleResolutionKind.NodeJs,
|
|
29
|
+
module: ts.ModuleKind.ES2015,
|
|
30
|
+
};
|
|
31
|
+
*/
|
|
32
|
+
const fsMap = new Map();
|
|
33
|
+
const FAKE_FILENAME = "graphileConfigInspection.ts";
|
|
34
|
+
// If using imports where the types don't directly match up to their FS representation (like the
|
|
35
|
+
// imports for node) then use triple-slash directives to make sure globals are set up first.
|
|
36
|
+
const BASE_CONTENT = `\
|
|
37
|
+
/// <reference types="node" />
|
|
38
|
+
import "graphile-config";
|
|
39
|
+
import {} from './${filenameInJs}';
|
|
40
|
+
type Digest<T> = { [TKey in keyof T]: T[TKey] } & {};
|
|
41
|
+
${initialCode}`;
|
|
42
|
+
fsMap.set(FAKE_FILENAME, BASE_CONTENT);
|
|
43
|
+
// By providing a project root, then the system knows how to resolve node_modules correctly
|
|
44
|
+
const projectRoot = process.cwd();
|
|
45
|
+
const system = (0, vfs_1.createFSBackedSystem)(fsMap, projectRoot, ts);
|
|
46
|
+
const env = (0, vfs_1.createVirtualTypeScriptEnvironment)(system, [FAKE_FILENAME, filename], ts, compilerOpts);
|
|
47
|
+
function getCompletions(additionalContent = "", offsetFromEnd = 0) {
|
|
48
|
+
const content = BASE_CONTENT + additionalContent;
|
|
49
|
+
env.updateFile(FAKE_FILENAME, content);
|
|
50
|
+
const completions = env.languageService.getCompletionsAtPosition(FAKE_FILENAME, content.length - offsetFromEnd, {});
|
|
51
|
+
return completions;
|
|
52
|
+
}
|
|
53
|
+
function getQuickInfo(additionalContent = "", offsetFromEnd = 0) {
|
|
54
|
+
const contentWithProperty = BASE_CONTENT + additionalContent;
|
|
55
|
+
env.updateFile(FAKE_FILENAME, contentWithProperty);
|
|
56
|
+
const info = env.languageService.getQuickInfoAtPosition(FAKE_FILENAME, contentWithProperty.length - offsetFromEnd);
|
|
57
|
+
return info;
|
|
58
|
+
}
|
|
59
|
+
return { env, FAKE_FILENAME, BASE_CONTENT, getCompletions, getQuickInfo };
|
|
60
|
+
}
|
|
61
|
+
exports.configVfs = configVfs;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated use prettyQuickInfoDisplayParts instead
|
|
64
|
+
*/
|
|
65
|
+
function prettyDisplayParts(displayParts, trimUntil = ":") {
|
|
66
|
+
if (!displayParts) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
let found = !trimUntil;
|
|
70
|
+
let depth = 0;
|
|
71
|
+
let str = "";
|
|
72
|
+
for (const { text } of displayParts) {
|
|
73
|
+
if (found) {
|
|
74
|
+
str += text;
|
|
75
|
+
}
|
|
76
|
+
else if (text === "(" || text === "[") {
|
|
77
|
+
depth++;
|
|
78
|
+
}
|
|
79
|
+
else if (text === ")" || text === "]") {
|
|
80
|
+
depth--;
|
|
81
|
+
}
|
|
82
|
+
else if (text === trimUntil && depth === 0) {
|
|
83
|
+
found = true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return str.trim();
|
|
87
|
+
}
|
|
88
|
+
exports.prettyDisplayParts = prettyDisplayParts;
|
|
89
|
+
function prettyQuickInfoDisplayParts(quickInfo, omitThis = true) {
|
|
90
|
+
if (!quickInfo || !quickInfo.displayParts) {
|
|
91
|
+
return "";
|
|
92
|
+
}
|
|
93
|
+
const fullText = quickInfo.displayParts.map((p) => p.text).join("");
|
|
94
|
+
function tidy(text) {
|
|
95
|
+
const withoutThis = omitThis
|
|
96
|
+
? text.replace(/this: [^,)]+(, |(?=[)]))/g, "")
|
|
97
|
+
: text;
|
|
98
|
+
return withoutThis.trim();
|
|
99
|
+
}
|
|
100
|
+
if (quickInfo.kind === "method") {
|
|
101
|
+
const secondBracket = fullText.indexOf("(", 1);
|
|
102
|
+
if (secondBracket < 0) {
|
|
103
|
+
throw new Error(`Do not understand TypeScript displayParts(${quickInfo.kind}) format '${fullText}'`);
|
|
104
|
+
}
|
|
105
|
+
return tidy(fullText.substring(secondBracket));
|
|
106
|
+
}
|
|
107
|
+
else if (quickInfo.kind === "property") {
|
|
108
|
+
const colon = fullText.indexOf("(", 1);
|
|
109
|
+
if (colon < 0) {
|
|
110
|
+
throw new Error(`Do not understand TypeScript displayParts(${quickInfo.kind}) format '${fullText}'`);
|
|
111
|
+
}
|
|
112
|
+
return ": " + tidy(fullText.substring(colon));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
console.error(`Do not understand TypeScript displayParts(${quickInfo.kind}). '${fullText}'`);
|
|
116
|
+
return tidy(fullText);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.prettyQuickInfoDisplayParts = prettyQuickInfoDisplayParts;
|
|
120
|
+
function prettyDocumentation(parts) {
|
|
121
|
+
if (!parts) {
|
|
122
|
+
return "";
|
|
123
|
+
}
|
|
124
|
+
let text = "";
|
|
125
|
+
for (const part of parts) {
|
|
126
|
+
switch (part.kind) {
|
|
127
|
+
case "text": {
|
|
128
|
+
text += part.text;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
default: {
|
|
132
|
+
text += part.text;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return text.trim();
|
|
138
|
+
}
|
|
139
|
+
exports.prettyDocumentation = prettyDocumentation;
|
|
140
|
+
function truncate(text, length = 80) {
|
|
141
|
+
if (text.length < length) {
|
|
142
|
+
return text;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return text.substring(0, length - 1) + "…";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.truncate = truncate;
|
|
149
|
+
function tightDocumentation(info, length = 60) {
|
|
150
|
+
if (!info)
|
|
151
|
+
return "";
|
|
152
|
+
return truncate(prettyDocumentation(info.documentation).replace(/[\r\n]+/g, " "), length);
|
|
153
|
+
}
|
|
154
|
+
exports.tightDocumentation = tightDocumentation;
|
|
155
|
+
function stripArgTypes(text) {
|
|
156
|
+
let depth = -1;
|
|
157
|
+
let result = "";
|
|
158
|
+
for (let i = 0, l = text.length; i < l; i++) {
|
|
159
|
+
const char = text[i];
|
|
160
|
+
if (depth < 0) {
|
|
161
|
+
if (char === "(") {
|
|
162
|
+
depth++;
|
|
163
|
+
}
|
|
164
|
+
result += char;
|
|
165
|
+
}
|
|
166
|
+
else if (depth === 0) {
|
|
167
|
+
if (char === ":") {
|
|
168
|
+
depth = 1;
|
|
169
|
+
}
|
|
170
|
+
else if (char === ")") {
|
|
171
|
+
depth--;
|
|
172
|
+
result += char;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
result += char;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
if (depth === 1 && char === ",") {
|
|
180
|
+
depth--;
|
|
181
|
+
result += char;
|
|
182
|
+
}
|
|
183
|
+
else if (depth === 1 && char === ")") {
|
|
184
|
+
depth--;
|
|
185
|
+
depth--;
|
|
186
|
+
result += char;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
if (char === "<" || char === "(" || char === "[") {
|
|
190
|
+
depth++;
|
|
191
|
+
}
|
|
192
|
+
else if (char === ">" || char === ")" || char === "]") {
|
|
193
|
+
depth--;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
function tightDisplayParts(info, length = 60) {
|
|
201
|
+
if (!info)
|
|
202
|
+
return "";
|
|
203
|
+
if (info.kind === "method" || info.kind === "property") {
|
|
204
|
+
const text = prettyQuickInfoDisplayParts(info);
|
|
205
|
+
const withoutArgTypes = stripArgTypes(text);
|
|
206
|
+
return truncate(withoutArgTypes, length);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
throw new Error(`Don't know how to print tightDisplayParts for ${info.kind}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
exports.tightDisplayParts = tightDisplayParts;
|
|
213
|
+
const accessKey = (key) => {
|
|
214
|
+
// TODO: improve?
|
|
215
|
+
if (/^[A-Za-z0-9_]+$/.test(key)) {
|
|
216
|
+
return `.${key}`;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return `[${JSON.stringify(key)}]`;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
exports.accessKey = accessKey;
|
|
223
|
+
/*
|
|
224
|
+
debugger;
|
|
225
|
+
|
|
226
|
+
const host = createVirtualCompilerHost(system, compilerOpts, ts);
|
|
227
|
+
const program = ts.createProgram({
|
|
228
|
+
rootNames: [...fsMap.keys()],
|
|
229
|
+
options: compilerOpts,
|
|
230
|
+
host: host.compilerHost,
|
|
231
|
+
});
|
|
232
|
+
const checker = program.getTypeChecker();
|
|
233
|
+
|
|
234
|
+
// This will update the fsMap with new files
|
|
235
|
+
// for the .d.ts and .js files
|
|
236
|
+
program.emit();
|
|
237
|
+
|
|
238
|
+
// Now I can look at the AST for the .ts file too
|
|
239
|
+
const index = program.getSourceFile(FAKE_FILENAME)!;
|
|
240
|
+
const symbols = checker.getSymbolsInScope(index, ts.SymbolFlags.Variable);
|
|
241
|
+
const symbol = symbols.find((s) => s.name === "preset");
|
|
242
|
+
console.log(symbol);
|
|
243
|
+
if (symbol) {
|
|
244
|
+
const type = checker.getDeclaredTypeOfSymbol(symbol);
|
|
245
|
+
console.log(type.getApparentProperties());
|
|
246
|
+
console.dir(type.get);
|
|
247
|
+
const properties = type.getProperties();
|
|
248
|
+
console.dir(properties);
|
|
249
|
+
}
|
|
250
|
+
ts.forEachChild(index, (node) => {
|
|
251
|
+
if (isVariableStatement(node)) {
|
|
252
|
+
console.log(node.getText());
|
|
253
|
+
const node2 = node.declarationList.declarations[0];
|
|
254
|
+
console.log(node2.getText());
|
|
255
|
+
const type = checker.getTypeAtLocation(node2);
|
|
256
|
+
const properties = type.getProperties();
|
|
257
|
+
// const properties = checker.getDeclaredTypeOfSymbol(symbol).getProperties();
|
|
258
|
+
console.dir(properties);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
*/
|
|
262
|
+
//# sourceMappingURL=typescriptVfs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescriptVfs.js","sourceRoot":"","sources":["../../src/utils/typescriptVfs.ts"],"names":[],"mappings":";;;;AAAA,yCAGyB;AACzB,uDAAiC;AAEjC,SAAgB,SAAS,CAAC,OAGzB;IACC,MAAM,EAAE,QAAQ,GAAG,oBAAoB,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;IACtE,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAEjE,MAAM,YAAY,GAAuB;QACvC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM;QAC5B,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM;QAE9B,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,mBAAmB,EAAE,IAAI;QACzB,gBAAgB,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM;QAChD,OAAO,EAAE,IAAI;KACd,CAAC;IACF;;;;;;;;;;;IAWA;IACA,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAExC,MAAM,aAAa,GAAG,6BAA6B,CAAC;IAEpD,gGAAgG;IAChG,4FAA4F;IAC5F,MAAM,YAAY,GAAG;;;oBAGH,YAAY;;EAE9B,WAAW,EAAE,CAAC;IACd,KAAK,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAEvC,2FAA2F;IAC3F,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAClC,MAAM,MAAM,GAAG,IAAA,0BAAoB,EAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IAC5D,MAAM,GAAG,GAAG,IAAA,wCAAkC,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I,KAAK,GAAG,EAAE;oBAChD,KAAK,EAAE,CAAC;iBACT;qBAAM,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;oBACvD,KAAK,EAAE,CAAC;iBACT;aACF;SACF;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,iBAAiB,CAAC,IAA8B,EAAE,MAAM,GAAG,EAAE;IAC3E,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;QACtD,MAAM,IAAI,GAAG,2BAA2B,CAAC,IAAI,CAAC,CAAC;QAC/C,MAAM,eAAe,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QAC5C,OAAO,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;KAC1C;SAAM;QACL,MAAM,IAAI,KAAK,CACb,iDAAiD,IAAI,CAAC,IAAI,EAAE,CAC7D,CAAC;KACH;AACH,CAAC;AAXD,8CAWC;AAEM,MAAM,SAAS,GAAG,CAAC,GAAW,EAAU,EAAE;IAC/C,iBAAiB;IACjB,IAAI,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC/B,OAAO,IAAI,GAAG,EAAE,CAAC;KAClB;SAAM;QACL,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC;KACnC;AACH,CAAC,CAAC;AAPW,QAAA,SAAS,aAOpB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsCE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-1.2",
|
|
4
4
|
"description": "Swiss army knife for dealing with all things Graphile",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "dist/cli-run.js",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@typescript/vfs": "^1.4.0",
|
|
35
35
|
"chalk": "^4.1.2",
|
|
36
|
-
"graphile-config": "^0.0.1-
|
|
36
|
+
"graphile-config": "^0.0.1-1.1",
|
|
37
37
|
"tslib": "^2.4.0",
|
|
38
38
|
"typescript": "^5.0.0-beta"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/jest": "^27.5.1",
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"jest": "^28.1.
|
|
42
|
+
"@types/node": "^18.15.5",
|
|
43
|
+
"jest": "^28.1.3",
|
|
44
44
|
"ts-node": "^10.9.1"
|
|
45
45
|
}
|
|
46
46
|
}
|