@stryke/capnp 0.10.7 → 0.10.9
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 +14 -148
- package/bin/capnpc.js +11 -145
- package/dist/{chunk-GTDJDX77.cjs → chunk-4G5JV6WG.cjs} +6 -24
- package/dist/{chunk-FP42YKAZ.js → chunk-5QODNLKN.js} +6 -24
- package/dist/{chunk-SH2ISQVR.cjs → chunk-SL27DJSC.cjs} +3 -125
- package/dist/{chunk-NKATTHKT.js → chunk-U6Y2C7CE.js} +0 -122
- package/dist/compile.cjs +3 -3
- package/dist/compile.js +2 -2
- package/dist/helpers.cjs +2 -2
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +2 -2
- package/package.json +4 -4
- package/schemas/{chunk-YDIMDO2B.js → chunk-KDEFD3VP.js} +12 -12
- package/schemas/persistent.cjs +20 -20
- package/schemas/persistent.js +1 -1
- package/schemas/rpc-twoparty.cjs +32 -32
- package/schemas/rpc-twoparty.js +1 -1
- package/schemas/rpc.cjs +495 -495
- package/schemas/rpc.js +1 -1
- package/schemas/schema.cjs +675 -675
- package/schemas/schema.js +1 -1
- package/schemas/{chunk-Z7HGBQR4.cjs → chunk-A5PAMTED.cjs} +11 -11
package/bin/capnpc.cjs
CHANGED
|
@@ -43,9 +43,6 @@ var import_promises = require("fs/promises");
|
|
|
43
43
|
var existsSync = /* @__PURE__ */ __name((filePath) => {
|
|
44
44
|
return (0, import_node_fs.existsSync)(filePath);
|
|
45
45
|
}, "existsSync");
|
|
46
|
-
var exists = /* @__PURE__ */ __name(async (filePath) => {
|
|
47
|
-
return (0, import_promises.access)(filePath, import_promises.constants.F_OK).then(() => true).catch(() => false);
|
|
48
|
-
}, "exists");
|
|
49
46
|
|
|
50
47
|
// ../types/src/base.ts
|
|
51
48
|
var EMPTY_STRING = "";
|
|
@@ -196,20 +193,6 @@ function slash(path) {
|
|
|
196
193
|
}
|
|
197
194
|
__name(slash, "slash");
|
|
198
195
|
|
|
199
|
-
// ../path/src/is-file.ts
|
|
200
|
-
function isFile(path, additionalPath) {
|
|
201
|
-
return Boolean((0, import_node_fs2.statSync)(additionalPath ? joinPaths(additionalPath, path) : path, {
|
|
202
|
-
throwIfNoEntry: false
|
|
203
|
-
})?.isFile());
|
|
204
|
-
}
|
|
205
|
-
__name(isFile, "isFile");
|
|
206
|
-
function isDirectory(path, additionalPath) {
|
|
207
|
-
return Boolean((0, import_node_fs2.statSync)(additionalPath ? joinPaths(additionalPath, path) : path, {
|
|
208
|
-
throwIfNoEntry: false
|
|
209
|
-
})?.isDirectory());
|
|
210
|
-
}
|
|
211
|
-
__name(isDirectory, "isDirectory");
|
|
212
|
-
|
|
213
196
|
// ../path/src/correct-path.ts
|
|
214
197
|
function normalizeWindowsPath2(input = "") {
|
|
215
198
|
if (!input) {
|
|
@@ -222,99 +205,6 @@ __name(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
|
222
205
|
// ../path/src/get-workspace-root.ts
|
|
223
206
|
var import_config_tools = require("@storm-software/config-tools");
|
|
224
207
|
|
|
225
|
-
// ../path/src/get-parent-path.ts
|
|
226
|
-
var resolveParentPath = /* @__PURE__ */ __name((path, count = 1) => {
|
|
227
|
-
let parentPath = path.replaceAll(/\/+$/g, "");
|
|
228
|
-
for (let i = 0; i < count; i++) {
|
|
229
|
-
parentPath = joinPaths(parentPath, "..");
|
|
230
|
-
}
|
|
231
|
-
return parentPath;
|
|
232
|
-
}, "resolveParentPath");
|
|
233
|
-
var getParentPath = /* @__PURE__ */ __name((name, cwd, options) => {
|
|
234
|
-
const ignoreCase = options?.ignoreCase ?? true;
|
|
235
|
-
const skipCwd = options?.skipCwd ?? false;
|
|
236
|
-
const targetType = options?.targetType ?? "both";
|
|
237
|
-
let dir = cwd;
|
|
238
|
-
if (skipCwd) {
|
|
239
|
-
dir = resolveParentPath(cwd);
|
|
240
|
-
}
|
|
241
|
-
let names = Array.isArray(name) ? name : [
|
|
242
|
-
name
|
|
243
|
-
];
|
|
244
|
-
if (ignoreCase) {
|
|
245
|
-
names = names.map((name2) => name2.toLowerCase());
|
|
246
|
-
}
|
|
247
|
-
while (true) {
|
|
248
|
-
const target = names.find((name2) => isFile(joinPaths(dir, name2)) && (targetType === "file" || targetType === "both") || isDirectory(joinPaths(dir, name2)) && (targetType === "directory" || targetType === "both"));
|
|
249
|
-
if (target) {
|
|
250
|
-
return joinPaths(dir, target);
|
|
251
|
-
}
|
|
252
|
-
const parentDir = resolveParentPath(dir);
|
|
253
|
-
if (parentDir === dir) {
|
|
254
|
-
return void 0;
|
|
255
|
-
}
|
|
256
|
-
dir = parentDir;
|
|
257
|
-
}
|
|
258
|
-
}, "getParentPath");
|
|
259
|
-
|
|
260
|
-
// ../path/src/is-root-dir.ts
|
|
261
|
-
var isSystemRoot = /* @__PURE__ */ __name((dir) => {
|
|
262
|
-
return Boolean(dir === "/" || dir === "c:\\" || dir === "C:\\");
|
|
263
|
-
}, "isSystemRoot");
|
|
264
|
-
|
|
265
|
-
// ../path/src/get-workspace-root.ts
|
|
266
|
-
var WORKSPACE_ROOT_CONTENT = [
|
|
267
|
-
"package-lock.json",
|
|
268
|
-
"yarn.lock",
|
|
269
|
-
"pnpm-lock.yaml",
|
|
270
|
-
"bun.lock",
|
|
271
|
-
"nx.json",
|
|
272
|
-
"knip.json",
|
|
273
|
-
"pnpm-workspace.yaml",
|
|
274
|
-
"LICENSE",
|
|
275
|
-
".all-contributorsrc",
|
|
276
|
-
".whitesource",
|
|
277
|
-
"syncpack.config.js",
|
|
278
|
-
"syncpack.json",
|
|
279
|
-
"socket.yaml",
|
|
280
|
-
"lefthook.yaml",
|
|
281
|
-
".npmrc",
|
|
282
|
-
".log4brains.yml",
|
|
283
|
-
".huskyrc",
|
|
284
|
-
".husky",
|
|
285
|
-
".lintstagedrc",
|
|
286
|
-
".commitlintrc",
|
|
287
|
-
"lefthook.yml",
|
|
288
|
-
".github",
|
|
289
|
-
".nx",
|
|
290
|
-
".vscode",
|
|
291
|
-
"patches"
|
|
292
|
-
];
|
|
293
|
-
function getWorkspaceRoot(dir = process.cwd()) {
|
|
294
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
295
|
-
return process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
|
|
296
|
-
}
|
|
297
|
-
const root = (0, import_config_tools.findWorkspaceRootSafe)(dir);
|
|
298
|
-
if (root) {
|
|
299
|
-
return root;
|
|
300
|
-
}
|
|
301
|
-
let result = getParentPath(WORKSPACE_ROOT_CONTENT, dir);
|
|
302
|
-
if (result) {
|
|
303
|
-
return result;
|
|
304
|
-
}
|
|
305
|
-
result = dir;
|
|
306
|
-
while (result && !isSystemRoot(result)) {
|
|
307
|
-
result = getParentPath("storm-workspace.json", result, {
|
|
308
|
-
skipCwd: true
|
|
309
|
-
});
|
|
310
|
-
if (result) {
|
|
311
|
-
return result;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
return dir;
|
|
315
|
-
}
|
|
316
|
-
__name(getWorkspaceRoot, "getWorkspaceRoot");
|
|
317
|
-
|
|
318
208
|
// ../path/src/file-path-fns.ts
|
|
319
209
|
function findFileName(filePath, options = {}) {
|
|
320
210
|
const { requireExtension = false, withExtension = true } = options;
|
|
@@ -348,34 +238,6 @@ var import_promises5 = require("fs/promises");
|
|
|
348
238
|
// src/compile.ts
|
|
349
239
|
var import_console2 = require("@storm-software/config-tools/logger/console");
|
|
350
240
|
|
|
351
|
-
// ../fs/src/helpers.ts
|
|
352
|
-
var import_nanotar = require("nanotar");
|
|
353
|
-
var import_node_fs3 = require("fs");
|
|
354
|
-
var import_promises2 = require("fs/promises");
|
|
355
|
-
async function createDirectory(path) {
|
|
356
|
-
if (await exists(path)) {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
return (0, import_promises2.mkdir)(path, {
|
|
360
|
-
recursive: true
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
__name(createDirectory, "createDirectory");
|
|
364
|
-
|
|
365
|
-
// ../path/src/is-parent-path.ts
|
|
366
|
-
function isParentPath(childPath, parentPath) {
|
|
367
|
-
const normalizedChild = slash(childPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
368
|
-
const normalizedParent = slash(parentPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
369
|
-
return normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
|
|
370
|
-
}
|
|
371
|
-
__name(isParentPath, "isParentPath");
|
|
372
|
-
|
|
373
|
-
// ../path/src/replace.ts
|
|
374
|
-
function replacePath(childPath, parentPath = process.cwd()) {
|
|
375
|
-
return isParentPath(childPath, parentPath) ? slash(childPath).replace(slash(parentPath), "").replace(/^\//, "") : childPath;
|
|
376
|
-
}
|
|
377
|
-
__name(replacePath, "replacePath");
|
|
378
|
-
|
|
379
241
|
// ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
|
|
380
242
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
381
243
|
|
|
@@ -7987,14 +7849,14 @@ var isError = /* @__PURE__ */ __name((obj) => {
|
|
|
7987
7849
|
}, "isError");
|
|
7988
7850
|
|
|
7989
7851
|
// ../fs/src/read-file.ts
|
|
7990
|
-
var
|
|
7991
|
-
var
|
|
7992
|
-
var
|
|
7852
|
+
var import_node_fs3 = require("fs");
|
|
7853
|
+
var import_promises2 = require("fs/promises");
|
|
7854
|
+
var readFile = /* @__PURE__ */ __name(async (filePath) => {
|
|
7993
7855
|
try {
|
|
7994
7856
|
if (!filePath) {
|
|
7995
7857
|
throw new Error("No file path provided to read data");
|
|
7996
7858
|
}
|
|
7997
|
-
return await (0,
|
|
7859
|
+
return await (0, import_promises2.readFile)(filePath, {
|
|
7998
7860
|
encoding: "utf8"
|
|
7999
7861
|
});
|
|
8000
7862
|
} catch {
|
|
@@ -8006,9 +7868,14 @@ var readFile2 = /* @__PURE__ */ __name(async (filePath) => {
|
|
|
8006
7868
|
var import_node_fs5 = require("fs");
|
|
8007
7869
|
var import_promises4 = require("fs/promises");
|
|
8008
7870
|
|
|
7871
|
+
// ../fs/src/helpers.ts
|
|
7872
|
+
var import_nanotar = require("nanotar");
|
|
7873
|
+
var import_node_fs4 = require("fs");
|
|
7874
|
+
var import_promises3 = require("fs/promises");
|
|
7875
|
+
|
|
8009
7876
|
// ../fs/src/json.ts
|
|
8010
7877
|
async function readJsonFile(path, options) {
|
|
8011
|
-
const content = await
|
|
7878
|
+
const content = await readFile(path);
|
|
8012
7879
|
if (options) {
|
|
8013
7880
|
options.endsWithNewline = content.codePointAt(content.length - 1) === 10;
|
|
8014
7881
|
}
|
|
@@ -8126,13 +7993,12 @@ async function capnpc(options) {
|
|
|
8126
7993
|
}
|
|
8127
7994
|
if (dataBuf.byteLength === 0) {
|
|
8128
7995
|
const opts = [];
|
|
8129
|
-
if (output) {
|
|
8130
|
-
if (!existsSync(output)) {
|
|
8131
|
-
(0, import_console2.writeWarning)(`Output directory "${output}" does not exist, it will be created...`);
|
|
8132
|
-
await createDirectory(replacePath(output, getWorkspaceRoot()));
|
|
8133
|
-
}
|
|
7996
|
+
if (output && existsSync(output)) {
|
|
8134
7997
|
opts.push(`-o-:${output}`);
|
|
8135
7998
|
} else {
|
|
7999
|
+
if (output && !existsSync(output)) {
|
|
8000
|
+
(0, import_console2.writeWarning)(`Output directory "${output}" does not exist, will write to schema path...`);
|
|
8001
|
+
}
|
|
8136
8002
|
opts.push("-o-");
|
|
8137
8003
|
}
|
|
8138
8004
|
dataBuf = await new Promise((resolve) => {
|
package/bin/capnpc.js
CHANGED
|
@@ -12,9 +12,6 @@ import { access, constants } from "node:fs/promises";
|
|
|
12
12
|
var existsSync = /* @__PURE__ */ __name((filePath) => {
|
|
13
13
|
return existsSyncFs(filePath);
|
|
14
14
|
}, "existsSync");
|
|
15
|
-
var exists = /* @__PURE__ */ __name(async (filePath) => {
|
|
16
|
-
return access(filePath, constants.F_OK).then(() => true).catch(() => false);
|
|
17
|
-
}, "exists");
|
|
18
15
|
|
|
19
16
|
// ../types/src/base.ts
|
|
20
17
|
var EMPTY_STRING = "";
|
|
@@ -165,20 +162,6 @@ function slash(path) {
|
|
|
165
162
|
}
|
|
166
163
|
__name(slash, "slash");
|
|
167
164
|
|
|
168
|
-
// ../path/src/is-file.ts
|
|
169
|
-
function isFile(path, additionalPath) {
|
|
170
|
-
return Boolean(statSync(additionalPath ? joinPaths(additionalPath, path) : path, {
|
|
171
|
-
throwIfNoEntry: false
|
|
172
|
-
})?.isFile());
|
|
173
|
-
}
|
|
174
|
-
__name(isFile, "isFile");
|
|
175
|
-
function isDirectory(path, additionalPath) {
|
|
176
|
-
return Boolean(statSync(additionalPath ? joinPaths(additionalPath, path) : path, {
|
|
177
|
-
throwIfNoEntry: false
|
|
178
|
-
})?.isDirectory());
|
|
179
|
-
}
|
|
180
|
-
__name(isDirectory, "isDirectory");
|
|
181
|
-
|
|
182
165
|
// ../path/src/correct-path.ts
|
|
183
166
|
function normalizeWindowsPath2(input = "") {
|
|
184
167
|
if (!input) {
|
|
@@ -191,99 +174,6 @@ __name(normalizeWindowsPath2, "normalizeWindowsPath");
|
|
|
191
174
|
// ../path/src/get-workspace-root.ts
|
|
192
175
|
import { findWorkspaceRootSafe } from "@storm-software/config-tools";
|
|
193
176
|
|
|
194
|
-
// ../path/src/get-parent-path.ts
|
|
195
|
-
var resolveParentPath = /* @__PURE__ */ __name((path, count = 1) => {
|
|
196
|
-
let parentPath = path.replaceAll(/\/+$/g, "");
|
|
197
|
-
for (let i = 0; i < count; i++) {
|
|
198
|
-
parentPath = joinPaths(parentPath, "..");
|
|
199
|
-
}
|
|
200
|
-
return parentPath;
|
|
201
|
-
}, "resolveParentPath");
|
|
202
|
-
var getParentPath = /* @__PURE__ */ __name((name, cwd, options) => {
|
|
203
|
-
const ignoreCase = options?.ignoreCase ?? true;
|
|
204
|
-
const skipCwd = options?.skipCwd ?? false;
|
|
205
|
-
const targetType = options?.targetType ?? "both";
|
|
206
|
-
let dir = cwd;
|
|
207
|
-
if (skipCwd) {
|
|
208
|
-
dir = resolveParentPath(cwd);
|
|
209
|
-
}
|
|
210
|
-
let names = Array.isArray(name) ? name : [
|
|
211
|
-
name
|
|
212
|
-
];
|
|
213
|
-
if (ignoreCase) {
|
|
214
|
-
names = names.map((name2) => name2.toLowerCase());
|
|
215
|
-
}
|
|
216
|
-
while (true) {
|
|
217
|
-
const target = names.find((name2) => isFile(joinPaths(dir, name2)) && (targetType === "file" || targetType === "both") || isDirectory(joinPaths(dir, name2)) && (targetType === "directory" || targetType === "both"));
|
|
218
|
-
if (target) {
|
|
219
|
-
return joinPaths(dir, target);
|
|
220
|
-
}
|
|
221
|
-
const parentDir = resolveParentPath(dir);
|
|
222
|
-
if (parentDir === dir) {
|
|
223
|
-
return void 0;
|
|
224
|
-
}
|
|
225
|
-
dir = parentDir;
|
|
226
|
-
}
|
|
227
|
-
}, "getParentPath");
|
|
228
|
-
|
|
229
|
-
// ../path/src/is-root-dir.ts
|
|
230
|
-
var isSystemRoot = /* @__PURE__ */ __name((dir) => {
|
|
231
|
-
return Boolean(dir === "/" || dir === "c:\\" || dir === "C:\\");
|
|
232
|
-
}, "isSystemRoot");
|
|
233
|
-
|
|
234
|
-
// ../path/src/get-workspace-root.ts
|
|
235
|
-
var WORKSPACE_ROOT_CONTENT = [
|
|
236
|
-
"package-lock.json",
|
|
237
|
-
"yarn.lock",
|
|
238
|
-
"pnpm-lock.yaml",
|
|
239
|
-
"bun.lock",
|
|
240
|
-
"nx.json",
|
|
241
|
-
"knip.json",
|
|
242
|
-
"pnpm-workspace.yaml",
|
|
243
|
-
"LICENSE",
|
|
244
|
-
".all-contributorsrc",
|
|
245
|
-
".whitesource",
|
|
246
|
-
"syncpack.config.js",
|
|
247
|
-
"syncpack.json",
|
|
248
|
-
"socket.yaml",
|
|
249
|
-
"lefthook.yaml",
|
|
250
|
-
".npmrc",
|
|
251
|
-
".log4brains.yml",
|
|
252
|
-
".huskyrc",
|
|
253
|
-
".husky",
|
|
254
|
-
".lintstagedrc",
|
|
255
|
-
".commitlintrc",
|
|
256
|
-
"lefthook.yml",
|
|
257
|
-
".github",
|
|
258
|
-
".nx",
|
|
259
|
-
".vscode",
|
|
260
|
-
"patches"
|
|
261
|
-
];
|
|
262
|
-
function getWorkspaceRoot(dir = process.cwd()) {
|
|
263
|
-
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
264
|
-
return process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH;
|
|
265
|
-
}
|
|
266
|
-
const root = findWorkspaceRootSafe(dir);
|
|
267
|
-
if (root) {
|
|
268
|
-
return root;
|
|
269
|
-
}
|
|
270
|
-
let result = getParentPath(WORKSPACE_ROOT_CONTENT, dir);
|
|
271
|
-
if (result) {
|
|
272
|
-
return result;
|
|
273
|
-
}
|
|
274
|
-
result = dir;
|
|
275
|
-
while (result && !isSystemRoot(result)) {
|
|
276
|
-
result = getParentPath("storm-workspace.json", result, {
|
|
277
|
-
skipCwd: true
|
|
278
|
-
});
|
|
279
|
-
if (result) {
|
|
280
|
-
return result;
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return dir;
|
|
284
|
-
}
|
|
285
|
-
__name(getWorkspaceRoot, "getWorkspaceRoot");
|
|
286
|
-
|
|
287
177
|
// ../path/src/file-path-fns.ts
|
|
288
178
|
function findFileName(filePath, options = {}) {
|
|
289
179
|
const { requireExtension = false, withExtension = true } = options;
|
|
@@ -317,34 +207,6 @@ import { writeFile as writeFile2 } from "node:fs/promises";
|
|
|
317
207
|
// src/compile.ts
|
|
318
208
|
import { writeWarning as writeWarning2 } from "@storm-software/config-tools/logger/console";
|
|
319
209
|
|
|
320
|
-
// ../fs/src/helpers.ts
|
|
321
|
-
import { parseTar, parseTarGzip } from "nanotar";
|
|
322
|
-
import { createWriteStream, mkdirSync, rmSync } from "node:fs";
|
|
323
|
-
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
324
|
-
async function createDirectory(path) {
|
|
325
|
-
if (await exists(path)) {
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
return mkdir(path, {
|
|
329
|
-
recursive: true
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
__name(createDirectory, "createDirectory");
|
|
333
|
-
|
|
334
|
-
// ../path/src/is-parent-path.ts
|
|
335
|
-
function isParentPath(childPath, parentPath) {
|
|
336
|
-
const normalizedChild = slash(childPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
337
|
-
const normalizedParent = slash(parentPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
338
|
-
return normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
|
|
339
|
-
}
|
|
340
|
-
__name(isParentPath, "isParentPath");
|
|
341
|
-
|
|
342
|
-
// ../path/src/replace.ts
|
|
343
|
-
function replacePath(childPath, parentPath = process.cwd()) {
|
|
344
|
-
return isParentPath(childPath, parentPath) ? slash(childPath).replace(slash(parentPath), "").replace(/^\//, "") : childPath;
|
|
345
|
-
}
|
|
346
|
-
__name(replacePath, "replacePath");
|
|
347
|
-
|
|
348
210
|
// ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
|
|
349
211
|
import ts from "typescript";
|
|
350
212
|
|
|
@@ -7958,7 +7820,7 @@ var isError = /* @__PURE__ */ __name((obj) => {
|
|
|
7958
7820
|
// ../fs/src/read-file.ts
|
|
7959
7821
|
import { existsSync as existsSync2, readFileSync as readFileSyncFs } from "node:fs";
|
|
7960
7822
|
import { readFile as readFileFs } from "node:fs/promises";
|
|
7961
|
-
var
|
|
7823
|
+
var readFile = /* @__PURE__ */ __name(async (filePath) => {
|
|
7962
7824
|
try {
|
|
7963
7825
|
if (!filePath) {
|
|
7964
7826
|
throw new Error("No file path provided to read data");
|
|
@@ -7975,9 +7837,14 @@ var readFile2 = /* @__PURE__ */ __name(async (filePath) => {
|
|
|
7975
7837
|
import { writeFileSync as writeFileSyncFs } from "node:fs";
|
|
7976
7838
|
import { writeFile as writeFileFs } from "node:fs/promises";
|
|
7977
7839
|
|
|
7840
|
+
// ../fs/src/helpers.ts
|
|
7841
|
+
import { parseTar, parseTarGzip } from "nanotar";
|
|
7842
|
+
import { createWriteStream, mkdirSync, rmSync } from "node:fs";
|
|
7843
|
+
import { mkdir, readFile as readFile2, rm } from "node:fs/promises";
|
|
7844
|
+
|
|
7978
7845
|
// ../fs/src/json.ts
|
|
7979
7846
|
async function readJsonFile(path, options) {
|
|
7980
|
-
const content = await
|
|
7847
|
+
const content = await readFile(path);
|
|
7981
7848
|
if (options) {
|
|
7982
7849
|
options.endsWithNewline = content.codePointAt(content.length - 1) === 10;
|
|
7983
7850
|
}
|
|
@@ -8095,13 +7962,12 @@ async function capnpc(options) {
|
|
|
8095
7962
|
}
|
|
8096
7963
|
if (dataBuf.byteLength === 0) {
|
|
8097
7964
|
const opts = [];
|
|
8098
|
-
if (output) {
|
|
8099
|
-
if (!existsSync(output)) {
|
|
8100
|
-
writeWarning2(`Output directory "${output}" does not exist, it will be created...`);
|
|
8101
|
-
await createDirectory(replacePath(output, getWorkspaceRoot()));
|
|
8102
|
-
}
|
|
7965
|
+
if (output && existsSync(output)) {
|
|
8103
7966
|
opts.push(`-o-:${output}`);
|
|
8104
7967
|
} else {
|
|
7968
|
+
if (output && !existsSync(output)) {
|
|
7969
|
+
writeWarning2(`Output directory "${output}" does not exist, will write to schema path...`);
|
|
7970
|
+
}
|
|
8105
7971
|
opts.push("-o-");
|
|
8106
7972
|
}
|
|
8107
7973
|
dataBuf = await new Promise((resolve) => {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18; var _class19; var _class20; var _class21; var _class22; var _class23; var _class24; var _class25; var _class26; var _class27; var _class28; var _class29; var _class30; var _class31; var _class32; var _class33; var _class34; var _class35; var _class36; var _class37;
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkSH2ISQVRcjs = require('./chunk-SH2ISQVR.cjs');
|
|
4
|
+
var _chunkSL27DJSCcjs = require('./chunk-SL27DJSC.cjs');
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
|
|
@@ -58,20 +55,6 @@ var _chunkUSNT2KNTcjs = require('./chunk-USNT2KNT.cjs');
|
|
|
58
55
|
// src/compile.ts
|
|
59
56
|
var _console = require('@storm-software/config-tools/logger/console');
|
|
60
57
|
|
|
61
|
-
// ../path/src/is-parent-path.ts
|
|
62
|
-
function isParentPath(childPath, parentPath) {
|
|
63
|
-
const normalizedChild = _chunkSH2ISQVRcjs.slash.call(void 0, childPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
64
|
-
const normalizedParent = _chunkSH2ISQVRcjs.slash.call(void 0, parentPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
65
|
-
return normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
|
|
66
|
-
}
|
|
67
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, isParentPath, "isParentPath");
|
|
68
|
-
|
|
69
|
-
// ../path/src/replace.ts
|
|
70
|
-
function replacePath(childPath, parentPath = process.cwd()) {
|
|
71
|
-
return isParentPath(childPath, parentPath) ? _chunkSH2ISQVRcjs.slash.call(void 0, childPath).replace(_chunkSH2ISQVRcjs.slash.call(void 0, parentPath), "").replace(/^\//, "") : childPath;
|
|
72
|
-
}
|
|
73
|
-
_chunkUSNT2KNTcjs.__name.call(void 0, replacePath, "replacePath");
|
|
74
|
-
|
|
75
58
|
// ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
|
|
76
59
|
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
|
|
77
60
|
|
|
@@ -4070,13 +4053,12 @@ async function capnpc(options) {
|
|
|
4070
4053
|
}
|
|
4071
4054
|
if (dataBuf.byteLength === 0) {
|
|
4072
4055
|
const opts = [];
|
|
4073
|
-
if (output) {
|
|
4074
|
-
if (!_chunkSH2ISQVRcjs.existsSync.call(void 0, output)) {
|
|
4075
|
-
_console.writeWarning.call(void 0, `Output directory "${output}" does not exist, it will be created...`);
|
|
4076
|
-
await _chunkSH2ISQVRcjs.createDirectory.call(void 0, replacePath(output, _chunkSH2ISQVRcjs.getWorkspaceRoot.call(void 0, )));
|
|
4077
|
-
}
|
|
4056
|
+
if (output && _chunkSL27DJSCcjs.existsSync.call(void 0, output)) {
|
|
4078
4057
|
opts.push(`-o-:${output}`);
|
|
4079
4058
|
} else {
|
|
4059
|
+
if (output && !_chunkSL27DJSCcjs.existsSync.call(void 0, output)) {
|
|
4060
|
+
_console.writeWarning.call(void 0, `Output directory "${output}" does not exist, will write to schema path...`);
|
|
4061
|
+
}
|
|
4080
4062
|
opts.push("-o-");
|
|
4081
4063
|
}
|
|
4082
4064
|
dataBuf = await new Promise((resolve) => {
|
|
@@ -4102,7 +4084,7 @@ async function capnpc(options) {
|
|
|
4102
4084
|
}
|
|
4103
4085
|
_chunkUSNT2KNTcjs.__name.call(void 0, capnpc, "capnpc");
|
|
4104
4086
|
async function compile(dataBuf, options) {
|
|
4105
|
-
const resolvedOptions = await
|
|
4087
|
+
const resolvedOptions = await _chunkSL27DJSCcjs.resolveOptions.call(void 0, options);
|
|
4106
4088
|
if (!resolvedOptions) {
|
|
4107
4089
|
_console.writeWarning.call(void 0, "\u2716 Unable to resolve Cap'n Proto compiler options - the program will terminate", {
|
|
4108
4090
|
logLevel: "all"
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createDirectory,
|
|
3
2
|
existsSync,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
slash
|
|
7
|
-
} from "./chunk-NKATTHKT.js";
|
|
3
|
+
resolveOptions
|
|
4
|
+
} from "./chunk-U6Y2C7CE.js";
|
|
8
5
|
import {
|
|
9
6
|
CompositeList,
|
|
10
7
|
Message,
|
|
@@ -58,20 +55,6 @@ import {
|
|
|
58
55
|
// src/compile.ts
|
|
59
56
|
import { writeWarning } from "@storm-software/config-tools/logger/console";
|
|
60
57
|
|
|
61
|
-
// ../path/src/is-parent-path.ts
|
|
62
|
-
function isParentPath(childPath, parentPath) {
|
|
63
|
-
const normalizedChild = slash(childPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
64
|
-
const normalizedParent = slash(parentPath.replace(/\\/g, "/").replace(/\/$/, ""));
|
|
65
|
-
return normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
|
|
66
|
-
}
|
|
67
|
-
__name(isParentPath, "isParentPath");
|
|
68
|
-
|
|
69
|
-
// ../path/src/replace.ts
|
|
70
|
-
function replacePath(childPath, parentPath = process.cwd()) {
|
|
71
|
-
return isParentPath(childPath, parentPath) ? slash(childPath).replace(slash(parentPath), "").replace(/^\//, "") : childPath;
|
|
72
|
-
}
|
|
73
|
-
__name(replacePath, "replacePath");
|
|
74
|
-
|
|
75
58
|
// ../../node_modules/.pnpm/capnp-es@0.0.11_patch_hash=503a440bd2bef41c0cb22819bc4ced5a7f04993fb999f0d944e284220f14916b_typescript@5.9.2/node_modules/capnp-es/dist/shared/capnp-es.CbTQkT9D.mjs
|
|
76
59
|
import ts from "typescript";
|
|
77
60
|
|
|
@@ -4070,13 +4053,12 @@ async function capnpc(options) {
|
|
|
4070
4053
|
}
|
|
4071
4054
|
if (dataBuf.byteLength === 0) {
|
|
4072
4055
|
const opts = [];
|
|
4073
|
-
if (output) {
|
|
4074
|
-
if (!existsSync(output)) {
|
|
4075
|
-
writeWarning(`Output directory "${output}" does not exist, it will be created...`);
|
|
4076
|
-
await createDirectory(replacePath(output, getWorkspaceRoot()));
|
|
4077
|
-
}
|
|
4056
|
+
if (output && existsSync(output)) {
|
|
4078
4057
|
opts.push(`-o-:${output}`);
|
|
4079
4058
|
} else {
|
|
4059
|
+
if (output && !existsSync(output)) {
|
|
4060
|
+
writeWarning(`Output directory "${output}" does not exist, will write to schema path...`);
|
|
4061
|
+
}
|
|
4080
4062
|
opts.push("-o-");
|
|
4081
4063
|
}
|
|
4082
4064
|
dataBuf = await new Promise((resolve) => {
|