@stryke/capnp 0.4.3 → 0.4.4
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/bin/capnpc.cjs +6 -7
- package/bin/capnpc.js +6 -7
- package/package.json +1 -1
package/bin/capnpc.cjs
CHANGED
|
@@ -1134,7 +1134,7 @@ async function compileAction(options) {
|
|
|
1134
1134
|
const schema = [];
|
|
1135
1135
|
for (const schemaPath of options.schema) {
|
|
1136
1136
|
if (!schemaPath || !schemaPath.includes("*") && !existsSync2(schemaPath)) {
|
|
1137
|
-
(0, import_console.writeFatal)(`\
|
|
1137
|
+
(0, import_console.writeFatal)(`\u2716 The schema path "${schemaPath}" is invalid. Please provide a valid path.`, {
|
|
1138
1138
|
logLevel: "all"
|
|
1139
1139
|
});
|
|
1140
1140
|
return;
|
|
@@ -1142,7 +1142,7 @@ async function compileAction(options) {
|
|
|
1142
1142
|
schema.push(...await listFiles(schemaPath));
|
|
1143
1143
|
}
|
|
1144
1144
|
if (schema.length === 0) {
|
|
1145
|
-
(0, import_console.writeFatal)(`\
|
|
1145
|
+
(0, import_console.writeFatal)(`\u2716 No Cap'n Proto schema files found in the specified source paths: ${options.schema.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
|
|
1146
1146
|
logLevel: "all"
|
|
1147
1147
|
});
|
|
1148
1148
|
return;
|
|
@@ -1150,8 +1150,7 @@ async function compileAction(options) {
|
|
|
1150
1150
|
const result = await capnpc({
|
|
1151
1151
|
...options,
|
|
1152
1152
|
tsconfig,
|
|
1153
|
-
schema
|
|
1154
|
-
output: options.output ? options.output : schema.length > 0 && schema[0] ? findFilePath(schema[0]) : process.cwd()
|
|
1153
|
+
schema
|
|
1155
1154
|
});
|
|
1156
1155
|
if (result.files.size === 0) {
|
|
1157
1156
|
(0, import_console.writeInfo)("\u26A0\uFE0F No files were generated. Please check your schema files.", {
|
|
@@ -1171,13 +1170,13 @@ void (async () => {
|
|
|
1171
1170
|
await program.parseAsync(process.argv);
|
|
1172
1171
|
(0, import_utilities.exitWithSuccess)();
|
|
1173
1172
|
} catch (error) {
|
|
1174
|
-
(0, import_console.writeFatal)(
|
|
1175
|
-
${error?.message ? error.message : JSON.stringify(error)}${error?.stack ? `
|
|
1173
|
+
(0, import_console.writeFatal)(`\u2716 A fatal error occurred while running the Storm Cap'n Proto compiler tool:
|
|
1174
|
+
${error?.message ? error?.name ? `[${error.name}]: ${error.message}` : error.message : JSON.stringify(error)}${error?.stack ? `
|
|
1175
|
+
|
|
1176
1176
|
Stack Trace: ${error.stack}` : ""}`, {
|
|
1177
1177
|
logLevel: "all"
|
|
1178
1178
|
});
|
|
1179
1179
|
(0, import_utilities.exitWithError)();
|
|
1180
|
-
process.exit(1);
|
|
1181
1180
|
}
|
|
1182
1181
|
})();
|
|
1183
1182
|
// Annotate the CommonJS export names for ESM import in node:
|
package/bin/capnpc.js
CHANGED
|
@@ -1102,7 +1102,7 @@ async function compileAction(options) {
|
|
|
1102
1102
|
const schema = [];
|
|
1103
1103
|
for (const schemaPath of options.schema) {
|
|
1104
1104
|
if (!schemaPath || !schemaPath.includes("*") && !existsSync2(schemaPath)) {
|
|
1105
|
-
writeFatal(`\
|
|
1105
|
+
writeFatal(`\u2716 The schema path "${schemaPath}" is invalid. Please provide a valid path.`, {
|
|
1106
1106
|
logLevel: "all"
|
|
1107
1107
|
});
|
|
1108
1108
|
return;
|
|
@@ -1110,7 +1110,7 @@ async function compileAction(options) {
|
|
|
1110
1110
|
schema.push(...await listFiles(schemaPath));
|
|
1111
1111
|
}
|
|
1112
1112
|
if (schema.length === 0) {
|
|
1113
|
-
writeFatal(`\
|
|
1113
|
+
writeFatal(`\u2716 No Cap'n Proto schema files found in the specified source paths: ${options.schema.join(", ")}. Please ensure that the paths are correct and contain .capnp files.`, {
|
|
1114
1114
|
logLevel: "all"
|
|
1115
1115
|
});
|
|
1116
1116
|
return;
|
|
@@ -1118,8 +1118,7 @@ async function compileAction(options) {
|
|
|
1118
1118
|
const result = await capnpc({
|
|
1119
1119
|
...options,
|
|
1120
1120
|
tsconfig,
|
|
1121
|
-
schema
|
|
1122
|
-
output: options.output ? options.output : schema.length > 0 && schema[0] ? findFilePath(schema[0]) : process.cwd()
|
|
1121
|
+
schema
|
|
1123
1122
|
});
|
|
1124
1123
|
if (result.files.size === 0) {
|
|
1125
1124
|
writeInfo("\u26A0\uFE0F No files were generated. Please check your schema files.", {
|
|
@@ -1139,13 +1138,13 @@ void (async () => {
|
|
|
1139
1138
|
await program.parseAsync(process.argv);
|
|
1140
1139
|
exitWithSuccess();
|
|
1141
1140
|
} catch (error) {
|
|
1142
|
-
writeFatal(
|
|
1143
|
-
${error?.message ? error.message : JSON.stringify(error)}${error?.stack ? `
|
|
1141
|
+
writeFatal(`\u2716 A fatal error occurred while running the Storm Cap'n Proto compiler tool:
|
|
1142
|
+
${error?.message ? error?.name ? `[${error.name}]: ${error.message}` : error.message : JSON.stringify(error)}${error?.stack ? `
|
|
1143
|
+
|
|
1144
1144
|
Stack Trace: ${error.stack}` : ""}`, {
|
|
1145
1145
|
logLevel: "all"
|
|
1146
1146
|
});
|
|
1147
1147
|
exitWithError();
|
|
1148
|
-
process.exit(1);
|
|
1149
1148
|
}
|
|
1150
1149
|
})();
|
|
1151
1150
|
export {
|
package/package.json
CHANGED