introspeql 1.1.0 → 1.2.0
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/dist/introspeql.js +6 -6
- package/package.json +1 -1
package/dist/introspeql.js
CHANGED
|
@@ -107,8 +107,8 @@ function introspeql(config) {
|
|
|
107
107
|
return schemas_1.SchemaDefinitionFactory.createSchemaDefinition(schemaData, parsedConfig);
|
|
108
108
|
});
|
|
109
109
|
typeDefinitionFileContents = createTypeDefinitionFileContents(schemaDefinitions, parsedConfig);
|
|
110
|
-
if (!
|
|
111
|
-
return [4 /*yield*/, writeTypeDefinitionsFile(typeDefinitionFileContents,
|
|
110
|
+
if (!parsedConfig.writeToDisk) return [3 /*break*/, 5];
|
|
111
|
+
return [4 /*yield*/, writeTypeDefinitionsFile(typeDefinitionFileContents, parsedConfig.outFile)];
|
|
112
112
|
case 4:
|
|
113
113
|
_a.sent();
|
|
114
114
|
_a.label = 5;
|
|
@@ -126,12 +126,12 @@ function introspeql(config) {
|
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function createTypeDefinitionFileContents(schemaDefinitions,
|
|
129
|
+
function createTypeDefinitionFileContents(schemaDefinitions, parsedConfig) {
|
|
130
130
|
var fileContents = schemaDefinitions
|
|
131
131
|
.map(function (schemaDef) { return schemaDef.toString(); })
|
|
132
132
|
.join('\n\n');
|
|
133
|
-
if (
|
|
134
|
-
var header =
|
|
133
|
+
if (parsedConfig.header) {
|
|
134
|
+
var header = parsedConfig.header;
|
|
135
135
|
while (!header.endsWith('\n\n')) {
|
|
136
136
|
header += '\n';
|
|
137
137
|
}
|
|
@@ -147,7 +147,7 @@ function writeTypeDefinitionsFile(fileContents, outFile) {
|
|
|
147
147
|
case 0:
|
|
148
148
|
directoryPath = path.dirname(outFile);
|
|
149
149
|
if (!!(0, fs_1.existsSync)(directoryPath)) return [3 /*break*/, 2];
|
|
150
|
-
return [4 /*yield*/, (0, promises_1.mkdir)(directoryPath)];
|
|
150
|
+
return [4 /*yield*/, (0, promises_1.mkdir)(directoryPath, { recursive: true })];
|
|
151
151
|
case 1:
|
|
152
152
|
_a.sent();
|
|
153
153
|
_a.label = 2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "introspeql",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "IntrospeQL reads information about the schemas, tables, views, materialized views, functions and enums in your PostgreSQL database and produces a TypeScript file detailing type information for each object in the database.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|