@atscript/typescript 0.1.86 → 0.1.87
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/cli.cjs +19 -19
- package/package.json +6 -6
package/dist/cli.cjs
CHANGED
|
@@ -2460,15 +2460,15 @@ async function getConfig(configFile, logger) {
|
|
|
2460
2460
|
if (configFile) {
|
|
2461
2461
|
const c = path.default.join(root, configFile);
|
|
2462
2462
|
if (!(0, fs.existsSync)(c)) {
|
|
2463
|
-
logger.error(`Config file ${
|
|
2463
|
+
logger.error(`Config file ${__DYE_UNDERSCORE__}${configFile}${__DYE_UNDERSCORE_OFF__} not found`);
|
|
2464
2464
|
process.exit(1);
|
|
2465
2465
|
}
|
|
2466
|
-
logger.log(`Using config file ${
|
|
2466
|
+
logger.log(`Using config file ${__DYE_CYAN__}${configFile}${__DYE_COLOR_OFF__}`);
|
|
2467
2467
|
return (0, __atscript_core.loadConfig)(c);
|
|
2468
2468
|
} else {
|
|
2469
2469
|
const resolved = await (0, __atscript_core.resolveConfigFile)(root);
|
|
2470
2470
|
if (resolved) {
|
|
2471
|
-
logger.log(`Using config file ${
|
|
2471
|
+
logger.log(`Using config file ${__DYE_CYAN__}${resolved}${__DYE_COLOR_OFF__}`);
|
|
2472
2472
|
return (0, __atscript_core.loadConfig)(resolved);
|
|
2473
2473
|
}
|
|
2474
2474
|
logger.log(`No atscript config file found`);
|
|
@@ -2509,7 +2509,7 @@ var Commands = class {
|
|
|
2509
2509
|
async default(configFile, format, noEmit, skipDiag) {
|
|
2510
2510
|
const config = await getConfig(configFile, this.logger);
|
|
2511
2511
|
config.format = format || __atscript_core.DEFAULT_FORMAT;
|
|
2512
|
-
this.logger.log(`Format: ${
|
|
2512
|
+
this.logger.log(`Format: ${__DYE_CYAN__}${config.format}${__DYE_COLOR_OFF__}`);
|
|
2513
2513
|
const builder = await (0, __atscript_core.build)(config);
|
|
2514
2514
|
let errorCount = 0;
|
|
2515
2515
|
let warningCount = 0;
|
|
@@ -2526,12 +2526,12 @@ else if (m.severity === 2) warningCount++;
|
|
|
2526
2526
|
}
|
|
2527
2527
|
if (!noEmit) {
|
|
2528
2528
|
const out = await builder.write(config);
|
|
2529
|
-
for (const { target } of out) this.logger.log(`✅ created ${
|
|
2529
|
+
for (const { target } of out) this.logger.log(`✅ created ${__DYE_GREEN__}${target}${__DYE_COLOR_OFF__}`);
|
|
2530
2530
|
}
|
|
2531
2531
|
if (errorCount > 0 || warningCount > 0) {
|
|
2532
2532
|
const parts = [];
|
|
2533
|
-
if (errorCount > 0) parts.push(`${
|
|
2534
|
-
if (warningCount > 0) parts.push(`${
|
|
2533
|
+
if (errorCount > 0) parts.push(`${__DYE_RED__}${errorCount} error${errorCount > 1 ? "s" : ""}${__DYE_COLOR_OFF__}`);
|
|
2534
|
+
if (warningCount > 0) parts.push(`${__DYE_YELLOW__}${warningCount} warning${warningCount > 1 ? "s" : ""}${__DYE_COLOR_OFF__}`);
|
|
2535
2535
|
this.logger.log(`\nFound ${parts.join(" and ")}`);
|
|
2536
2536
|
}
|
|
2537
2537
|
if (errorCount > 0) process.exit(1);
|
|
@@ -2589,13 +2589,13 @@ else obj[key] = value;
|
|
|
2589
2589
|
return obj;
|
|
2590
2590
|
}
|
|
2591
2591
|
const DYE_COLORS = {
|
|
2592
|
-
green: (s) => `${
|
|
2593
|
-
red: (s) => `${
|
|
2594
|
-
cyan: (s) => `${
|
|
2595
|
-
yellow: (s) => `${
|
|
2596
|
-
bold: (s) => `${
|
|
2597
|
-
dim: (s) => `${
|
|
2598
|
-
underline: (s) => `${
|
|
2592
|
+
green: (s) => `${__DYE_GREEN__}${s}${__DYE_COLOR_OFF__}`,
|
|
2593
|
+
red: (s) => `${__DYE_RED__}${s}${__DYE_COLOR_OFF__}`,
|
|
2594
|
+
cyan: (s) => `${__DYE_CYAN__}${s}${__DYE_COLOR_OFF__}`,
|
|
2595
|
+
yellow: (s) => `${__DYE_YELLOW__}${s}${__DYE_COLOR_OFF__}`,
|
|
2596
|
+
bold: (s) => `${__DYE_BOLD__}${s}${__DYE_BOLD_OFF__}`,
|
|
2597
|
+
dim: (s) => `${__DYE_DIM__}${s}${__DYE_DIM_OFF__}`,
|
|
2598
|
+
underline: (s) => `${__DYE_UNDERSCORE__}${s}${__DYE_UNDERSCORE_OFF__}`
|
|
2599
2599
|
};
|
|
2600
2600
|
const BANNER = DYE_COLORS.cyan(`
|
|
2601
2601
|
|
|
@@ -2762,7 +2762,7 @@ var DbSyncController = class {
|
|
|
2762
2762
|
}
|
|
2763
2763
|
async dbSync(configFile, dryRun, yes, force, safe, check, format, out) {
|
|
2764
2764
|
if (format && format !== "json" && format !== "markdown") {
|
|
2765
|
-
this.logger.error(`${
|
|
2765
|
+
this.logger.error(`${__DYE_RED__}Unknown --format "${format}". Use "json" or "markdown".${__DYE_COLOR_OFF__}`);
|
|
2766
2766
|
process.exit(1);
|
|
2767
2767
|
}
|
|
2768
2768
|
this.quiet = Boolean(format) && !out;
|
|
@@ -2770,7 +2770,7 @@ var DbSyncController = class {
|
|
|
2770
2770
|
const cfgLogger = this.quiet ? Object.create(this.logger, { log: { value: () => {} } }) : this.logger;
|
|
2771
2771
|
const config = await getConfig(configFile, cfgLogger);
|
|
2772
2772
|
if (!config.db) {
|
|
2773
|
-
this.logger.error(`${
|
|
2773
|
+
this.logger.error(`${__DYE_RED__}No "db" field in atscript config. ` + `Add a db configuration to use schema sync.${__DYE_COLOR_OFF__}`);
|
|
2774
2774
|
process.exit(1);
|
|
2775
2775
|
}
|
|
2776
2776
|
const [dbSpace, dbTypes] = await Promise.all([this.resolveDbSpace(config.db), this.compileAndLoadTypes(config)]);
|
|
@@ -2883,16 +2883,16 @@ else {
|
|
|
2883
2883
|
return await dbConfig();
|
|
2884
2884
|
}
|
|
2885
2885
|
const { adapter, connection, options } = dbConfig;
|
|
2886
|
-
this.info(`Using adapter: ${
|
|
2886
|
+
this.info(`Using adapter: ${__DYE_CYAN__}${adapter}${__DYE_COLOR_OFF__}`);
|
|
2887
2887
|
let mod;
|
|
2888
2888
|
try {
|
|
2889
2889
|
mod = await this.importFromCwd(adapter);
|
|
2890
2890
|
} catch {
|
|
2891
|
-
this.logger.error(`${
|
|
2891
|
+
this.logger.error(`${__DYE_RED__}Could not import adapter package "${adapter}". Is it installed?${__DYE_COLOR_OFF__}`);
|
|
2892
2892
|
process.exit(1);
|
|
2893
2893
|
}
|
|
2894
2894
|
if (typeof mod.createAdapter !== "function") {
|
|
2895
|
-
this.logger.error(`${
|
|
2895
|
+
this.logger.error(`${__DYE_RED__}Adapter package "${adapter}" does not export a createAdapter function.${__DYE_COLOR_OFF__}`);
|
|
2896
2896
|
process.exit(1);
|
|
2897
2897
|
}
|
|
2898
2898
|
const resolvedConnection = typeof connection === "function" ? await connection() : connection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/typescript",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.87",
|
|
4
4
|
"description": "Atscript: typescript-gen support.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"annotations",
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
"./package.json": "./package.json"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@moostjs/event-cli": "^0.6.
|
|
67
|
-
"moost": "^0.6.
|
|
66
|
+
"@moostjs/event-cli": "^0.6.35",
|
|
67
|
+
"moost": "^0.6.35"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@atscript/db": "^0.1.
|
|
70
|
+
"@atscript/db": "^0.1.125",
|
|
71
71
|
"@uniqu/core": "^0.1.7",
|
|
72
|
-
"vitest": "3.2.
|
|
72
|
+
"vitest": "3.2.7"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@atscript/db": "^0.1.97",
|
|
76
|
-
"@atscript/core": "^0.1.
|
|
76
|
+
"@atscript/core": "^0.1.87"
|
|
77
77
|
},
|
|
78
78
|
"peerDependenciesMeta": {
|
|
79
79
|
"@atscript/db": {
|