relq 1.0.11 → 1.0.12
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/cjs/cli/index.cjs
CHANGED
|
@@ -42,6 +42,7 @@ exports.getSchemaPath = getSchemaPath;
|
|
|
42
42
|
exports.requireValidConfig = requireValidConfig;
|
|
43
43
|
exports.requireValidSchema = requireValidSchema;
|
|
44
44
|
const config_1 = require("../../config/config.cjs");
|
|
45
|
+
const cli_utils_1 = require("./cli-utils.cjs");
|
|
45
46
|
const env_loader_1 = require("./env-loader.cjs");
|
|
46
47
|
const fs = __importStar(require("fs"));
|
|
47
48
|
const path = __importStar(require("path"));
|
|
@@ -116,9 +117,10 @@ function validateConfig(config) {
|
|
|
116
117
|
}
|
|
117
118
|
return errors;
|
|
118
119
|
}
|
|
119
|
-
function getSchemaPath(config
|
|
120
|
-
if (!config)
|
|
121
|
-
return
|
|
120
|
+
function getSchemaPath(config) {
|
|
121
|
+
if (!config) {
|
|
122
|
+
return (0, cli_utils_1.fatal)('Configuration is required', 'Schema path must be defined in relq.config.ts');
|
|
123
|
+
}
|
|
122
124
|
if (typeof config.schema === 'string' && config.schema.length > 0) {
|
|
123
125
|
return config.schema;
|
|
124
126
|
}
|
|
@@ -131,7 +133,7 @@ function getSchemaPath(config, defaultPath = './db/schema.ts') {
|
|
|
131
133
|
if (config.typeGeneration?.output) {
|
|
132
134
|
return config.typeGeneration.output;
|
|
133
135
|
}
|
|
134
|
-
return
|
|
136
|
+
return (0, cli_utils_1.fatal)('Schema path not configured', "Add schema: './path/to/schema.ts' to relq.config.ts");
|
|
135
137
|
}
|
|
136
138
|
async function requireValidConfig(config, options) {
|
|
137
139
|
const errors = validateConfig(config);
|
package/dist/esm/cli/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { loadConfig as baseLoadConfig } from "../../config/config.js";
|
|
2
|
+
import { fatal } from "./cli-utils.js";
|
|
2
3
|
import { loadEnvConfig } from "./env-loader.js";
|
|
3
4
|
import * as fs from 'fs';
|
|
4
5
|
import * as path from 'path';
|
|
@@ -73,9 +74,10 @@ export function validateConfig(config) {
|
|
|
73
74
|
}
|
|
74
75
|
return errors;
|
|
75
76
|
}
|
|
76
|
-
export function getSchemaPath(config
|
|
77
|
-
if (!config)
|
|
78
|
-
return
|
|
77
|
+
export function getSchemaPath(config) {
|
|
78
|
+
if (!config) {
|
|
79
|
+
return fatal('Configuration is required', 'Schema path must be defined in relq.config.ts');
|
|
80
|
+
}
|
|
79
81
|
if (typeof config.schema === 'string' && config.schema.length > 0) {
|
|
80
82
|
return config.schema;
|
|
81
83
|
}
|
|
@@ -88,7 +90,7 @@ export function getSchemaPath(config, defaultPath = './db/schema.ts') {
|
|
|
88
90
|
if (config.typeGeneration?.output) {
|
|
89
91
|
return config.typeGeneration.output;
|
|
90
92
|
}
|
|
91
|
-
return
|
|
93
|
+
return fatal('Schema path not configured', "Add schema: './path/to/schema.ts' to relq.config.ts");
|
|
92
94
|
}
|
|
93
95
|
export async function requireValidConfig(config, options) {
|
|
94
96
|
const errors = validateConfig(config);
|