@walkeros/cli 0.5.1-next.0 → 0.7.0-next.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/CHANGELOG.md +19 -0
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler-helpers.test.js +151 -0
- package/dist/__tests__/bundle/bundler-helpers.test.js.map +1 -0
- package/dist/__tests__/bundle/bundler.test.d.ts +2 -0
- package/dist/__tests__/bundle/bundler.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/bundler.test.js +353 -0
- package/dist/__tests__/bundle/bundler.test.js.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts +2 -0
- package/dist/__tests__/bundle/programmatic.test.d.ts.map +1 -0
- package/dist/__tests__/bundle/programmatic.test.js +148 -0
- package/dist/__tests__/bundle/programmatic.test.js.map +1 -0
- package/dist/__tests__/cli-e2e.test.d.ts +8 -0
- package/dist/__tests__/cli-e2e.test.d.ts.map +1 -0
- package/dist/__tests__/cli-e2e.test.js +130 -0
- package/dist/__tests__/cli-e2e.test.js.map +1 -0
- package/dist/__tests__/cli.test.d.ts +2 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/cli.test.js +180 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/__tests__/config-loader.test.d.ts +7 -0
- package/dist/__tests__/config-loader.test.d.ts.map +1 -0
- package/dist/__tests__/config-loader.test.js +414 -0
- package/dist/__tests__/config-loader.test.js.map +1 -0
- package/dist/__tests__/core/asset-resolver.test.d.ts +2 -0
- package/dist/__tests__/core/asset-resolver.test.d.ts.map +1 -0
- package/dist/__tests__/core/asset-resolver.test.js +14 -0
- package/dist/__tests__/core/asset-resolver.test.js.map +1 -0
- package/dist/__tests__/core/build-cache.test.d.ts +2 -0
- package/dist/__tests__/core/build-cache.test.d.ts.map +1 -0
- package/dist/__tests__/core/build-cache.test.js +55 -0
- package/dist/__tests__/core/build-cache.test.js.map +1 -0
- package/dist/__tests__/core/cache-utils.test.d.ts +2 -0
- package/dist/__tests__/core/cache-utils.test.d.ts.map +1 -0
- package/dist/__tests__/core/cache-utils.test.js +70 -0
- package/dist/__tests__/core/cache-utils.test.js.map +1 -0
- package/dist/__tests__/core/config.test.d.ts +2 -0
- package/dist/__tests__/core/config.test.d.ts.map +1 -0
- package/dist/__tests__/core/config.test.js +72 -0
- package/dist/__tests__/core/config.test.js.map +1 -0
- package/dist/__tests__/core/docker-url.test.d.ts +2 -0
- package/dist/__tests__/core/docker-url.test.d.ts.map +1 -0
- package/dist/__tests__/core/docker-url.test.js +54 -0
- package/dist/__tests__/core/docker-url.test.js.map +1 -0
- package/dist/__tests__/core/logger.test.d.ts +2 -0
- package/dist/__tests__/core/logger.test.d.ts.map +1 -0
- package/dist/__tests__/core/logger.test.js +53 -0
- package/dist/__tests__/core/logger.test.js.map +1 -0
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts +8 -0
- package/dist/__tests__/integration/bundle-run.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/bundle-run.integration.test.js +54 -0
- package/dist/__tests__/integration/bundle-run.integration.test.js.map +1 -0
- package/dist/__tests__/push/push.test.d.ts +7 -0
- package/dist/__tests__/push/push.test.d.ts.map +1 -0
- package/dist/__tests__/push/push.test.js +197 -0
- package/dist/__tests__/push/push.test.js.map +1 -0
- package/dist/__tests__/simulate/env-loader.test.d.ts +2 -0
- package/dist/__tests__/simulate/env-loader.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/env-loader.test.js +47 -0
- package/dist/__tests__/simulate/env-loader.test.js.map +1 -0
- package/dist/__tests__/simulate/node-executor.test.d.ts +5 -0
- package/dist/__tests__/simulate/node-executor.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/node-executor.test.js +25 -0
- package/dist/__tests__/simulate/node-executor.test.js.map +1 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts +5 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.js +58 -0
- package/dist/__tests__/simulate/server-simulate.integration.test.js.map +1 -0
- package/dist/__tests__/smoke/production.smoke.test.d.ts +8 -0
- package/dist/__tests__/smoke/production.smoke.test.d.ts.map +1 -0
- package/dist/__tests__/smoke/production.smoke.test.js +65 -0
- package/dist/__tests__/smoke/production.smoke.test.js.map +1 -0
- package/dist/commands/bundle/bundler.d.ts +32 -0
- package/dist/commands/bundle/bundler.d.ts.map +1 -0
- package/dist/commands/bundle/bundler.js +583 -0
- package/dist/commands/bundle/bundler.js.map +1 -0
- package/dist/commands/bundle/index.d.ts +57 -0
- package/dist/commands/bundle/index.d.ts.map +1 -0
- package/dist/commands/bundle/index.js +200 -0
- package/dist/commands/bundle/index.js.map +1 -0
- package/dist/commands/bundle/package-manager.d.ts +8 -0
- package/dist/commands/bundle/package-manager.d.ts.map +1 -0
- package/dist/commands/bundle/package-manager.js +197 -0
- package/dist/commands/bundle/package-manager.js.map +1 -0
- package/dist/commands/bundle/stats.d.ts +23 -0
- package/dist/commands/bundle/stats.d.ts.map +1 -0
- package/dist/commands/bundle/stats.js +52 -0
- package/dist/commands/bundle/stats.js.map +1 -0
- package/dist/commands/cache.d.ts +3 -0
- package/dist/commands/cache.d.ts.map +1 -0
- package/dist/commands/cache.js +44 -0
- package/dist/commands/cache.js.map +1 -0
- package/dist/commands/push/index.d.ts +7 -0
- package/dist/commands/push/index.d.ts.map +1 -0
- package/dist/commands/push/index.js +257 -0
- package/dist/commands/push/index.js.map +1 -0
- package/dist/commands/push/types.d.ts +21 -0
- package/dist/commands/push/types.d.ts.map +1 -0
- package/dist/commands/push/types.js +2 -0
- package/dist/commands/push/types.js.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts +8 -0
- package/dist/commands/run/__tests__/run.integration.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/run.integration.test.js +52 -0
- package/dist/commands/run/__tests__/run.integration.test.js.map +1 -0
- package/dist/commands/run/__tests__/validators.test.d.ts +2 -0
- package/dist/commands/run/__tests__/validators.test.d.ts.map +1 -0
- package/dist/commands/run/__tests__/validators.test.js +80 -0
- package/dist/commands/run/__tests__/validators.test.js.map +1 -0
- package/dist/commands/run/execution.d.ts +14 -0
- package/dist/commands/run/execution.d.ts.map +1 -0
- package/dist/commands/run/execution.js +41 -0
- package/dist/commands/run/execution.js.map +1 -0
- package/dist/commands/run/index.d.ts +39 -0
- package/dist/commands/run/index.d.ts.map +1 -0
- package/dist/commands/run/index.js +191 -0
- package/dist/commands/run/index.js.map +1 -0
- package/dist/commands/run/types.d.ts +60 -0
- package/dist/commands/run/types.d.ts.map +1 -0
- package/dist/commands/run/types.js +7 -0
- package/dist/commands/run/types.js.map +1 -0
- package/dist/commands/run/utils.d.ts +29 -0
- package/dist/commands/run/utils.d.ts.map +1 -0
- package/dist/commands/run/utils.js +52 -0
- package/dist/commands/run/utils.js.map +1 -0
- package/dist/commands/run/validators.d.ts +33 -0
- package/dist/commands/run/validators.d.ts.map +1 -0
- package/dist/commands/run/validators.js +58 -0
- package/dist/commands/run/validators.js.map +1 -0
- package/dist/commands/simulate/env-loader.d.ts +19 -0
- package/dist/commands/simulate/env-loader.d.ts.map +1 -0
- package/dist/commands/simulate/env-loader.js +46 -0
- package/dist/commands/simulate/env-loader.js.map +1 -0
- package/dist/commands/simulate/index.d.ts +48 -0
- package/dist/commands/simulate/index.d.ts.map +1 -0
- package/dist/commands/simulate/index.js +116 -0
- package/dist/commands/simulate/index.js.map +1 -0
- package/dist/commands/simulate/jsdom-executor.d.ts +37 -0
- package/dist/commands/simulate/jsdom-executor.d.ts.map +1 -0
- package/dist/commands/simulate/jsdom-executor.js +137 -0
- package/dist/commands/simulate/jsdom-executor.js.map +1 -0
- package/dist/commands/simulate/node-executor.d.ts +28 -0
- package/dist/commands/simulate/node-executor.d.ts.map +1 -0
- package/dist/commands/simulate/node-executor.js +94 -0
- package/dist/commands/simulate/node-executor.js.map +1 -0
- package/dist/commands/simulate/simulator.d.ts +14 -0
- package/dist/commands/simulate/simulator.d.ts.map +1 -0
- package/dist/commands/simulate/simulator.js +162 -0
- package/dist/commands/simulate/simulator.js.map +1 -0
- package/dist/commands/simulate/tracker.d.ts +30 -0
- package/dist/commands/simulate/tracker.d.ts.map +1 -0
- package/dist/commands/simulate/tracker.js +96 -0
- package/dist/commands/simulate/tracker.js.map +1 -0
- package/dist/commands/simulate/types.d.ts +18 -0
- package/dist/commands/simulate/types.d.ts.map +1 -0
- package/dist/commands/simulate/types.js +2 -0
- package/dist/commands/simulate/types.js.map +1 -0
- package/dist/config/build-defaults.d.ts +49 -0
- package/dist/config/build-defaults.d.ts.map +1 -0
- package/dist/config/build-defaults.js +70 -0
- package/dist/config/build-defaults.js.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +15 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +81 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +155 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/utils.d.ts +114 -0
- package/dist/config/utils.d.ts.map +1 -0
- package/dist/config/utils.js +257 -0
- package/dist/config/utils.js.map +1 -0
- package/dist/config/validators.d.ts +52 -0
- package/dist/config/validators.d.ts.map +1 -0
- package/dist/config/validators.js +85 -0
- package/dist/config/validators.js.map +1 -0
- package/dist/core/asset-resolver.d.ts +34 -0
- package/dist/core/asset-resolver.d.ts.map +1 -0
- package/dist/core/asset-resolver.js +70 -0
- package/dist/core/asset-resolver.js.map +1 -0
- package/dist/core/build-cache.d.ts +23 -0
- package/dist/core/build-cache.d.ts.map +1 -0
- package/dist/core/build-cache.js +43 -0
- package/dist/core/build-cache.js.map +1 -0
- package/dist/core/cache-utils.d.ts +27 -0
- package/dist/core/cache-utils.d.ts.map +1 -0
- package/dist/core/cache-utils.js +60 -0
- package/dist/core/cache-utils.js.map +1 -0
- package/dist/core/docker.d.ts +102 -0
- package/dist/core/docker.d.ts.map +1 -0
- package/dist/core/docker.js +278 -0
- package/dist/core/docker.js.map +1 -0
- package/dist/core/execution.d.ts +34 -0
- package/dist/core/execution.d.ts.map +1 -0
- package/dist/core/execution.js +64 -0
- package/dist/core/execution.js.map +1 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +10 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/local-packages.d.ts +19 -0
- package/dist/core/local-packages.d.ts.map +1 -0
- package/dist/core/local-packages.js +60 -0
- package/dist/core/local-packages.js.map +1 -0
- package/dist/core/logger.d.ts +28 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +88 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/output.d.ts +30 -0
- package/dist/core/output.d.ts.map +1 -0
- package/dist/core/output.js +46 -0
- package/dist/core/output.js.map +1 -0
- package/dist/core/temp-manager.d.ts +51 -0
- package/dist/core/temp-manager.d.ts.map +1 -0
- package/dist/core/temp-manager.js +73 -0
- package/dist/core/temp-manager.js.map +1 -0
- package/dist/core/timer.d.ts +14 -0
- package/dist/core/timer.d.ts.map +1 -0
- package/dist/core/timer.js +29 -0
- package/dist/core/timer.js.map +1 -0
- package/dist/core/utils.d.ts +10 -0
- package/dist/core/utils.d.ts.map +1 -0
- package/dist/core/utils.js +12 -0
- package/dist/core/utils.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +128 -96
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +9 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +9 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/primitives.d.ts +37 -0
- package/dist/schemas/primitives.d.ts.map +1 -0
- package/dist/schemas/primitives.js +43 -0
- package/dist/schemas/primitives.js.map +1 -0
- package/dist/schemas/run.d.ts +23 -0
- package/dist/schemas/run.d.ts.map +1 -0
- package/dist/schemas/run.js +20 -0
- package/dist/schemas/run.js.map +1 -0
- package/dist/types/bundle.d.ts +141 -0
- package/dist/types/bundle.d.ts.map +1 -0
- package/dist/types/bundle.js +10 -0
- package/dist/types/bundle.js.map +1 -0
- package/dist/types/global.d.ts +51 -0
- package/dist/types/global.d.ts.map +1 -0
- package/dist/types/global.js +30 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +8 -0
- package/dist/types/index.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +27 -0
- package/dist/version.js.map +1 -0
- package/dist/walker.js +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2,10 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
+
import { VERSION as DOCKER_VERSION2 } from "@walkeros/docker";
|
|
6
|
+
|
|
7
|
+
// src/version.ts
|
|
5
8
|
import { readFileSync } from "fs";
|
|
6
|
-
import { fileURLToPath
|
|
9
|
+
import { fileURLToPath } from "url";
|
|
7
10
|
import { dirname, join } from "path";
|
|
8
|
-
|
|
11
|
+
var versionFilename = fileURLToPath(import.meta.url);
|
|
12
|
+
var versionDirname = dirname(versionFilename);
|
|
13
|
+
function findPackageJson() {
|
|
14
|
+
const paths = [
|
|
15
|
+
join(versionDirname, "../package.json"),
|
|
16
|
+
// dist/ or src/
|
|
17
|
+
join(versionDirname, "../../package.json")
|
|
18
|
+
// src/core/ (not used, but safe)
|
|
19
|
+
];
|
|
20
|
+
for (const p of paths) {
|
|
21
|
+
try {
|
|
22
|
+
return readFileSync(p, "utf-8");
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return JSON.stringify({ version: "0.0.0" });
|
|
27
|
+
}
|
|
28
|
+
var VERSION = JSON.parse(findPackageJson()).version;
|
|
9
29
|
|
|
10
30
|
// src/commands/bundle/index.ts
|
|
11
31
|
import path9 from "path";
|
|
@@ -135,6 +155,7 @@ function formatBytes(bytes) {
|
|
|
135
155
|
// src/core/docker.ts
|
|
136
156
|
import { spawn } from "child_process";
|
|
137
157
|
import path2 from "path";
|
|
158
|
+
import fs2 from "fs-extra";
|
|
138
159
|
import { VERSION as DOCKER_VERSION } from "@walkeros/docker";
|
|
139
160
|
|
|
140
161
|
// src/config/utils.ts
|
|
@@ -264,8 +285,7 @@ async function loadJsonFromSource(source, options) {
|
|
|
264
285
|
}
|
|
265
286
|
|
|
266
287
|
// src/core/docker.ts
|
|
267
|
-
var
|
|
268
|
-
var CLI_DOCKER_IMAGE = process.env.WALKEROS_CLI_DOCKER_IMAGE || `walkeros/cli:${CLI_VERSION}`;
|
|
288
|
+
var CLI_DOCKER_IMAGE = process.env.WALKEROS_CLI_DOCKER_IMAGE || `walkeros/cli:${VERSION}`;
|
|
269
289
|
var RUNTIME_DOCKER_IMAGE = process.env.WALKEROS_RUNTIME_DOCKER_IMAGE || `walkeros/docker:${DOCKER_VERSION}`;
|
|
270
290
|
function buildCommonDockerArgs(options) {
|
|
271
291
|
const args = [options.config];
|
|
@@ -305,29 +325,44 @@ function buildDockerCommand(command, args, options = {}, configFile) {
|
|
|
305
325
|
return cmd;
|
|
306
326
|
}
|
|
307
327
|
async function executeInDocker(command, args, options = {}, configFile) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
328
|
+
let tempFile;
|
|
329
|
+
let effectiveConfigFile = configFile;
|
|
330
|
+
try {
|
|
331
|
+
if (configFile && isUrl(configFile)) {
|
|
332
|
+
tempFile = await downloadFromUrl(configFile);
|
|
333
|
+
effectiveConfigFile = tempFile;
|
|
334
|
+
}
|
|
335
|
+
const containerArgs = [...args, "--local"];
|
|
336
|
+
const dockerCmd = buildDockerCommand(
|
|
337
|
+
command,
|
|
338
|
+
containerArgs,
|
|
339
|
+
options,
|
|
340
|
+
effectiveConfigFile
|
|
341
|
+
);
|
|
342
|
+
return await new Promise((resolve, reject) => {
|
|
343
|
+
const proc = spawn(dockerCmd[0], dockerCmd.slice(1), {
|
|
344
|
+
stdio: options.silent ? "ignore" : "inherit",
|
|
345
|
+
shell: false
|
|
346
|
+
});
|
|
347
|
+
proc.on("error", (error) => {
|
|
348
|
+
reject(new Error(`Docker execution failed: ${error.message}`));
|
|
349
|
+
});
|
|
350
|
+
proc.on("exit", (code) => {
|
|
351
|
+
if (code === 0) {
|
|
352
|
+
resolve();
|
|
353
|
+
} else {
|
|
354
|
+
process.exit(code || 1);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
322
357
|
});
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
358
|
+
} finally {
|
|
359
|
+
if (tempFile) {
|
|
360
|
+
try {
|
|
361
|
+
await fs2.remove(tempFile);
|
|
362
|
+
} catch {
|
|
328
363
|
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
331
366
|
}
|
|
332
367
|
async function isDockerAvailable() {
|
|
333
368
|
return new Promise((resolve) => {
|
|
@@ -440,16 +475,16 @@ async function executeCommand(localHandler, dockerCommand, dockerArgs, options,
|
|
|
440
475
|
|
|
441
476
|
// src/core/temp-manager.ts
|
|
442
477
|
import { getHashServer } from "@walkeros/server-core";
|
|
443
|
-
import
|
|
478
|
+
import fs3 from "fs-extra";
|
|
444
479
|
|
|
445
480
|
// src/core/asset-resolver.ts
|
|
446
|
-
import { fileURLToPath } from "url";
|
|
481
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
447
482
|
import { existsSync } from "fs";
|
|
448
483
|
import path3 from "path";
|
|
449
484
|
var cachedAssetDir;
|
|
450
485
|
function getAssetDir() {
|
|
451
486
|
if (cachedAssetDir) return cachedAssetDir;
|
|
452
|
-
const currentFile =
|
|
487
|
+
const currentFile = fileURLToPath2(import.meta.url);
|
|
453
488
|
let dir = path3.dirname(currentFile);
|
|
454
489
|
while (dir !== path3.dirname(dir)) {
|
|
455
490
|
if (existsSync(path3.join(dir, "examples"))) {
|
|
@@ -462,6 +497,9 @@ function getAssetDir() {
|
|
|
462
497
|
return cachedAssetDir;
|
|
463
498
|
}
|
|
464
499
|
function resolveAsset(assetPath, assetType, baseDir) {
|
|
500
|
+
if (isUrl(assetPath)) {
|
|
501
|
+
return assetPath;
|
|
502
|
+
}
|
|
465
503
|
if (!assetPath.includes("/") && !assetPath.includes("\\")) {
|
|
466
504
|
const assetDir = getAssetDir();
|
|
467
505
|
return path3.join(assetDir, "examples", assetPath);
|
|
@@ -479,22 +517,22 @@ function getErrorMessage(error) {
|
|
|
479
517
|
|
|
480
518
|
// src/core/local-packages.ts
|
|
481
519
|
import path4 from "path";
|
|
482
|
-
import
|
|
520
|
+
import fs4 from "fs-extra";
|
|
483
521
|
async function resolveLocalPackage(packageName, localPath, configDir, logger2) {
|
|
484
522
|
const absolutePath = path4.isAbsolute(localPath) ? localPath : path4.resolve(configDir, localPath);
|
|
485
|
-
if (!await
|
|
523
|
+
if (!await fs4.pathExists(absolutePath)) {
|
|
486
524
|
throw new Error(
|
|
487
525
|
`Local package path not found: ${localPath} (resolved to ${absolutePath})`
|
|
488
526
|
);
|
|
489
527
|
}
|
|
490
528
|
const pkgJsonPath = path4.join(absolutePath, "package.json");
|
|
491
|
-
if (!await
|
|
529
|
+
if (!await fs4.pathExists(pkgJsonPath)) {
|
|
492
530
|
throw new Error(
|
|
493
531
|
`No package.json found at ${absolutePath}. Is this a valid package directory?`
|
|
494
532
|
);
|
|
495
533
|
}
|
|
496
534
|
const distPath = path4.join(absolutePath, "dist");
|
|
497
|
-
const hasDistFolder = await
|
|
535
|
+
const hasDistFolder = await fs4.pathExists(distPath);
|
|
498
536
|
if (!hasDistFolder) {
|
|
499
537
|
logger2.warn(
|
|
500
538
|
`\u26A0\uFE0F ${packageName}: No dist/ folder found. Using package root.`
|
|
@@ -509,18 +547,18 @@ async function resolveLocalPackage(packageName, localPath, configDir, logger2) {
|
|
|
509
547
|
}
|
|
510
548
|
async function copyLocalPackage(localPkg, targetDir, logger2) {
|
|
511
549
|
const packageDir = path4.join(targetDir, "node_modules", localPkg.name);
|
|
512
|
-
await
|
|
513
|
-
await
|
|
550
|
+
await fs4.ensureDir(path4.dirname(packageDir));
|
|
551
|
+
await fs4.copy(
|
|
514
552
|
path4.join(localPkg.absolutePath, "package.json"),
|
|
515
553
|
path4.join(packageDir, "package.json")
|
|
516
554
|
);
|
|
517
555
|
if (localPkg.hasDistFolder) {
|
|
518
|
-
await
|
|
556
|
+
await fs4.copy(localPkg.distPath, path4.join(packageDir, "dist"));
|
|
519
557
|
} else {
|
|
520
|
-
const entries = await
|
|
558
|
+
const entries = await fs4.readdir(localPkg.absolutePath);
|
|
521
559
|
for (const entry of entries) {
|
|
522
560
|
if (!["node_modules", ".turbo", ".git"].includes(entry)) {
|
|
523
|
-
await
|
|
561
|
+
await fs4.copy(
|
|
524
562
|
path4.join(localPkg.absolutePath, entry),
|
|
525
563
|
path4.join(packageDir, entry)
|
|
526
564
|
);
|
|
@@ -587,7 +625,7 @@ function getDefaultOutput(platform) {
|
|
|
587
625
|
|
|
588
626
|
// src/config/loader.ts
|
|
589
627
|
import path5 from "path";
|
|
590
|
-
import
|
|
628
|
+
import fs5 from "fs-extra";
|
|
591
629
|
import { getFlowConfig, getPlatform } from "@walkeros/core";
|
|
592
630
|
var DEFAULT_INCLUDE_FOLDER = "./shared";
|
|
593
631
|
function loadBundleConfig(rawConfig, options) {
|
|
@@ -614,7 +652,7 @@ function loadBundleConfig(rawConfig, options) {
|
|
|
614
652
|
let includes = setup.include;
|
|
615
653
|
if (!includes) {
|
|
616
654
|
const defaultIncludePath = path5.resolve(configDir, DEFAULT_INCLUDE_FOLDER);
|
|
617
|
-
if (
|
|
655
|
+
if (fs5.pathExistsSync(defaultIncludePath)) {
|
|
618
656
|
includes = [DEFAULT_INCLUDE_FOLDER];
|
|
619
657
|
}
|
|
620
658
|
}
|
|
@@ -677,13 +715,13 @@ function loadAllFlows(rawConfig, options) {
|
|
|
677
715
|
// src/commands/bundle/bundler.ts
|
|
678
716
|
import esbuild from "esbuild";
|
|
679
717
|
import path8 from "path";
|
|
680
|
-
import
|
|
718
|
+
import fs8 from "fs-extra";
|
|
681
719
|
import { packageNameToVariable } from "@walkeros/core";
|
|
682
720
|
|
|
683
721
|
// src/commands/bundle/package-manager.ts
|
|
684
722
|
import pacote from "pacote";
|
|
685
723
|
import path6 from "path";
|
|
686
|
-
import
|
|
724
|
+
import fs6 from "fs-extra";
|
|
687
725
|
|
|
688
726
|
// src/core/cache-utils.ts
|
|
689
727
|
import { getHashServer as getHashServer2 } from "@walkeros/server-core";
|
|
@@ -726,7 +764,7 @@ async function getCachedPackagePath(pkg, tempDir) {
|
|
|
726
764
|
}
|
|
727
765
|
async function isPackageCached(pkg, tempDir) {
|
|
728
766
|
const cachedPath = await getCachedPackagePath(pkg, tempDir);
|
|
729
|
-
return
|
|
767
|
+
return fs6.pathExists(cachedPath);
|
|
730
768
|
}
|
|
731
769
|
function validateNoDuplicatePackages(packages) {
|
|
732
770
|
const packageMap = /* @__PURE__ */ new Map();
|
|
@@ -761,11 +799,11 @@ async function resolveDependencies(pkg, packageDir, logger2, visited = /* @__PUR
|
|
|
761
799
|
visited.add(pkgKey);
|
|
762
800
|
try {
|
|
763
801
|
const packageJsonPath = path6.join(packageDir, "package.json");
|
|
764
|
-
if (await
|
|
765
|
-
const
|
|
802
|
+
if (await fs6.pathExists(packageJsonPath)) {
|
|
803
|
+
const packageJson = await fs6.readJson(packageJsonPath);
|
|
766
804
|
const deps = {
|
|
767
|
-
...
|
|
768
|
-
...
|
|
805
|
+
...packageJson.dependencies,
|
|
806
|
+
...packageJson.peerDependencies
|
|
769
807
|
};
|
|
770
808
|
for (const [name, versionSpec] of Object.entries(deps)) {
|
|
771
809
|
if (typeof versionSpec === "string") {
|
|
@@ -789,7 +827,7 @@ async function downloadPackages(packages, targetDir, logger2, useCache = true, c
|
|
|
789
827
|
}
|
|
790
828
|
}
|
|
791
829
|
validateNoDuplicatePackages(packages);
|
|
792
|
-
await
|
|
830
|
+
await fs6.ensureDir(targetDir);
|
|
793
831
|
while (downloadQueue.length > 0) {
|
|
794
832
|
const pkg = downloadQueue.shift();
|
|
795
833
|
const pkgKey = `${pkg.name}@${pkg.version}`;
|
|
@@ -824,8 +862,8 @@ async function downloadPackages(packages, targetDir, logger2, useCache = true, c
|
|
|
824
862
|
if (useCache && await isPackageCached(pkg, targetDir)) {
|
|
825
863
|
logger2.debug(`Using cached ${packageSpec}...`);
|
|
826
864
|
try {
|
|
827
|
-
await
|
|
828
|
-
await
|
|
865
|
+
await fs6.ensureDir(path6.dirname(packageDir));
|
|
866
|
+
await fs6.copy(cachedPath, packageDir);
|
|
829
867
|
packagePaths.set(pkg.name, packageDir);
|
|
830
868
|
const deps = await resolveDependencies(pkg, packageDir, logger2);
|
|
831
869
|
for (const dep of deps) {
|
|
@@ -843,7 +881,7 @@ async function downloadPackages(packages, targetDir, logger2, useCache = true, c
|
|
|
843
881
|
}
|
|
844
882
|
logger2.debug(`Downloading ${packageSpec}...`);
|
|
845
883
|
try {
|
|
846
|
-
await
|
|
884
|
+
await fs6.ensureDir(path6.dirname(packageDir));
|
|
847
885
|
const cacheDir = process.env.NPM_CACHE_DIR || path6.join(process.cwd(), ".npm-cache");
|
|
848
886
|
await pacote.extract(packageSpec, packageDir, {
|
|
849
887
|
// Force npm registry download, prevent workspace resolution
|
|
@@ -857,8 +895,8 @@ async function downloadPackages(packages, targetDir, logger2, useCache = true, c
|
|
|
857
895
|
});
|
|
858
896
|
if (useCache) {
|
|
859
897
|
try {
|
|
860
|
-
await
|
|
861
|
-
await
|
|
898
|
+
await fs6.ensureDir(path6.dirname(cachedPath));
|
|
899
|
+
await fs6.copy(packageDir, cachedPath);
|
|
862
900
|
logger2.debug(`Cached ${packageSpec} for future use`);
|
|
863
901
|
} catch (cacheError) {
|
|
864
902
|
logger2.debug(`Failed to cache ${packageSpec}: ${cacheError}`);
|
|
@@ -880,7 +918,7 @@ async function downloadPackages(packages, targetDir, logger2, useCache = true, c
|
|
|
880
918
|
}
|
|
881
919
|
|
|
882
920
|
// src/core/build-cache.ts
|
|
883
|
-
import
|
|
921
|
+
import fs7 from "fs-extra";
|
|
884
922
|
import path7 from "path";
|
|
885
923
|
var BUILD_CACHE_DIR = path7.join(".tmp", "cache", "builds");
|
|
886
924
|
async function getBuildCachePath(configContent, cacheDir = BUILD_CACHE_DIR) {
|
|
@@ -889,17 +927,17 @@ async function getBuildCachePath(configContent, cacheDir = BUILD_CACHE_DIR) {
|
|
|
889
927
|
}
|
|
890
928
|
async function isBuildCached(configContent, cacheDir = BUILD_CACHE_DIR) {
|
|
891
929
|
const cachePath = await getBuildCachePath(configContent, cacheDir);
|
|
892
|
-
return
|
|
930
|
+
return fs7.pathExists(cachePath);
|
|
893
931
|
}
|
|
894
932
|
async function cacheBuild(configContent, buildOutput, cacheDir = BUILD_CACHE_DIR) {
|
|
895
933
|
const cachePath = await getBuildCachePath(configContent, cacheDir);
|
|
896
|
-
await
|
|
897
|
-
await
|
|
934
|
+
await fs7.ensureDir(path7.dirname(cachePath));
|
|
935
|
+
await fs7.writeFile(cachePath, buildOutput, "utf-8");
|
|
898
936
|
}
|
|
899
937
|
async function getCachedBuild(configContent, cacheDir = BUILD_CACHE_DIR) {
|
|
900
938
|
const cachePath = await getBuildCachePath(configContent, cacheDir);
|
|
901
|
-
if (await
|
|
902
|
-
return await
|
|
939
|
+
if (await fs7.pathExists(cachePath)) {
|
|
940
|
+
return await fs7.readFile(cachePath, "utf-8");
|
|
903
941
|
}
|
|
904
942
|
return null;
|
|
905
943
|
}
|
|
@@ -910,8 +948,8 @@ async function copyIncludes(includes, sourceDir, outputDir, logger2) {
|
|
|
910
948
|
const sourcePath = path8.resolve(sourceDir, include);
|
|
911
949
|
const folderName = path8.basename(include);
|
|
912
950
|
const destPath = path8.join(outputDir, folderName);
|
|
913
|
-
if (await
|
|
914
|
-
await
|
|
951
|
+
if (await fs8.pathExists(sourcePath)) {
|
|
952
|
+
await fs8.copy(sourcePath, destPath);
|
|
915
953
|
logger2.debug(`Copied ${include} to output`);
|
|
916
954
|
} else {
|
|
917
955
|
logger2.debug(`Include folder not found: ${include}`);
|
|
@@ -941,12 +979,12 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
941
979
|
if (cachedBuild) {
|
|
942
980
|
logger2.info("\u2728 Using cached build");
|
|
943
981
|
const outputPath = path8.resolve(buildOptions.output);
|
|
944
|
-
await
|
|
945
|
-
await
|
|
982
|
+
await fs8.ensureDir(path8.dirname(outputPath));
|
|
983
|
+
await fs8.writeFile(outputPath, cachedBuild);
|
|
946
984
|
logger2.gray(`Output: ${outputPath}`);
|
|
947
985
|
logger2.success("\u2705 Build completed (from cache)");
|
|
948
986
|
if (showStats) {
|
|
949
|
-
const stats = await
|
|
987
|
+
const stats = await fs8.stat(outputPath);
|
|
950
988
|
const packageStats = Object.entries(buildOptions.packages).map(
|
|
951
989
|
([name, pkg]) => ({
|
|
952
990
|
name: `${name}@${pkg.version || "latest"}`,
|
|
@@ -967,7 +1005,7 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
967
1005
|
}
|
|
968
1006
|
try {
|
|
969
1007
|
if (!buildOptions.tempDir) {
|
|
970
|
-
await
|
|
1008
|
+
await fs8.emptyDir(TEMP_DIR);
|
|
971
1009
|
}
|
|
972
1010
|
logger2.debug("Cleaned temporary directory");
|
|
973
1011
|
logger2.info("\u{1F4E5} Downloading packages...");
|
|
@@ -990,7 +1028,7 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
990
1028
|
for (const [pkgName, pkgPath] of packagePaths.entries()) {
|
|
991
1029
|
if (pkgName.startsWith("@walkeros/")) {
|
|
992
1030
|
const pkgJsonPath = path8.join(pkgPath, "package.json");
|
|
993
|
-
const pkgJson = await
|
|
1031
|
+
const pkgJson = await fs8.readJSON(pkgJsonPath);
|
|
994
1032
|
if (!pkgJson.exports && pkgJson.module) {
|
|
995
1033
|
pkgJson.exports = {
|
|
996
1034
|
".": {
|
|
@@ -998,12 +1036,12 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
998
1036
|
require: pkgJson.main
|
|
999
1037
|
}
|
|
1000
1038
|
};
|
|
1001
|
-
await
|
|
1039
|
+
await fs8.writeJSON(pkgJsonPath, pkgJson, { spaces: 2 });
|
|
1002
1040
|
}
|
|
1003
1041
|
}
|
|
1004
1042
|
}
|
|
1005
1043
|
const packageJsonPath = path8.join(TEMP_DIR, "package.json");
|
|
1006
|
-
await
|
|
1044
|
+
await fs8.writeFile(
|
|
1007
1045
|
packageJsonPath,
|
|
1008
1046
|
JSON.stringify({ type: "module" }, null, 2)
|
|
1009
1047
|
);
|
|
@@ -1014,10 +1052,10 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
1014
1052
|
packagePaths
|
|
1015
1053
|
);
|
|
1016
1054
|
const entryPath = path8.join(TEMP_DIR, "entry.js");
|
|
1017
|
-
await
|
|
1055
|
+
await fs8.writeFile(entryPath, entryContent);
|
|
1018
1056
|
logger2.info("\u26A1 Bundling with esbuild...");
|
|
1019
1057
|
const outputPath = path8.resolve(buildOptions.output);
|
|
1020
|
-
await
|
|
1058
|
+
await fs8.ensureDir(path8.dirname(outputPath));
|
|
1021
1059
|
const esbuildOptions = createEsbuildOptions(
|
|
1022
1060
|
buildOptions,
|
|
1023
1061
|
entryPath,
|
|
@@ -1037,7 +1075,7 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
1037
1075
|
logger2.gray(`Output: ${outputPath}`);
|
|
1038
1076
|
if (buildOptions.cache !== false) {
|
|
1039
1077
|
const configContent = generateCacheKeyContent(flowConfig, buildOptions);
|
|
1040
|
-
const buildOutput = await
|
|
1078
|
+
const buildOutput = await fs8.readFile(outputPath, "utf-8");
|
|
1041
1079
|
await cacheBuild(configContent, buildOutput);
|
|
1042
1080
|
logger2.debug("Build cached for future use");
|
|
1043
1081
|
}
|
|
@@ -1060,20 +1098,20 @@ async function bundleCore(flowConfig, buildOptions, logger2, showStats = false)
|
|
|
1060
1098
|
);
|
|
1061
1099
|
}
|
|
1062
1100
|
if (!buildOptions.tempDir) {
|
|
1063
|
-
await
|
|
1101
|
+
await fs8.remove(TEMP_DIR);
|
|
1064
1102
|
logger2.debug("Cleaned up temporary files");
|
|
1065
1103
|
}
|
|
1066
1104
|
return stats;
|
|
1067
1105
|
} catch (error) {
|
|
1068
1106
|
if (!buildOptions.tempDir) {
|
|
1069
|
-
await
|
|
1107
|
+
await fs8.remove(TEMP_DIR).catch(() => {
|
|
1070
1108
|
});
|
|
1071
1109
|
}
|
|
1072
1110
|
throw error;
|
|
1073
1111
|
}
|
|
1074
1112
|
}
|
|
1075
1113
|
async function collectBundleStats(outputPath, packages, startTime, entryContent) {
|
|
1076
|
-
const stats = await
|
|
1114
|
+
const stats = await fs8.stat(outputPath);
|
|
1077
1115
|
const totalSize = stats.size;
|
|
1078
1116
|
const buildTime = Date.now() - startTime;
|
|
1079
1117
|
const packageStats = Object.entries(packages).map(([name, pkg]) => {
|
|
@@ -1587,7 +1625,7 @@ async function bundle(configOrPath, options = {}) {
|
|
|
1587
1625
|
|
|
1588
1626
|
// src/commands/simulate/simulator.ts
|
|
1589
1627
|
import path10 from "path";
|
|
1590
|
-
import
|
|
1628
|
+
import fs10 from "fs-extra";
|
|
1591
1629
|
import { getPlatform as getPlatform2 } from "@walkeros/core";
|
|
1592
1630
|
|
|
1593
1631
|
// src/commands/simulate/tracker.ts
|
|
@@ -1670,7 +1708,7 @@ var CallTracker = class {
|
|
|
1670
1708
|
|
|
1671
1709
|
// src/commands/simulate/jsdom-executor.ts
|
|
1672
1710
|
import { JSDOM, VirtualConsole } from "jsdom";
|
|
1673
|
-
import
|
|
1711
|
+
import fs9 from "fs-extra";
|
|
1674
1712
|
function buildSandboxFromEnvs(envs, destinations, tracker) {
|
|
1675
1713
|
const baseBrowserMocks = {
|
|
1676
1714
|
Image: class MockImage {
|
|
@@ -1739,7 +1777,7 @@ async function executeInJSDOM(bundlePath, destinations, event, tracker, envs, ti
|
|
|
1739
1777
|
const sandbox = buildSandboxFromEnvs(envs, destinations, tracker);
|
|
1740
1778
|
Object.assign(window, sandbox.window);
|
|
1741
1779
|
Object.assign(window.document, sandbox.document);
|
|
1742
|
-
const bundleCode = await
|
|
1780
|
+
const bundleCode = await fs9.readFile(bundlePath, "utf8");
|
|
1743
1781
|
try {
|
|
1744
1782
|
window.eval(bundleCode);
|
|
1745
1783
|
} catch (error) {
|
|
@@ -1946,7 +1984,7 @@ async function executeSimulation(event, configPath) {
|
|
|
1946
1984
|
);
|
|
1947
1985
|
}
|
|
1948
1986
|
const typedEvent = event;
|
|
1949
|
-
await
|
|
1987
|
+
await fs10.ensureDir(tempDir);
|
|
1950
1988
|
const rawConfig = await loadJsonConfig(configPath);
|
|
1951
1989
|
const { flowConfig, buildOptions } = loadBundleConfig(rawConfig, {
|
|
1952
1990
|
configPath
|
|
@@ -2020,7 +2058,7 @@ async function executeSimulation(event, configPath) {
|
|
|
2020
2058
|
};
|
|
2021
2059
|
} finally {
|
|
2022
2060
|
if (tempDir) {
|
|
2023
|
-
await
|
|
2061
|
+
await fs10.remove(tempDir).catch(() => {
|
|
2024
2062
|
});
|
|
2025
2063
|
}
|
|
2026
2064
|
}
|
|
@@ -2098,7 +2136,7 @@ async function simulate(configOrPath, event, options = {}) {
|
|
|
2098
2136
|
// src/commands/push/index.ts
|
|
2099
2137
|
import path11 from "path";
|
|
2100
2138
|
import { JSDOM as JSDOM2, VirtualConsole as VirtualConsole2 } from "jsdom";
|
|
2101
|
-
import
|
|
2139
|
+
import fs11 from "fs-extra";
|
|
2102
2140
|
import { getPlatform as getPlatform3 } from "@walkeros/core";
|
|
2103
2141
|
import { schemas as schemas2 } from "@walkeros/core/dev";
|
|
2104
2142
|
async function pushCommand(options) {
|
|
@@ -2148,7 +2186,7 @@ async function pushCommand(options) {
|
|
|
2148
2186
|
".tmp",
|
|
2149
2187
|
`push-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
2150
2188
|
);
|
|
2151
|
-
await
|
|
2189
|
+
await fs11.ensureDir(tempDir);
|
|
2152
2190
|
const tempPath = path11.join(
|
|
2153
2191
|
tempDir,
|
|
2154
2192
|
`bundle.${platform === "web" ? "js" : "mjs"}`
|
|
@@ -2213,7 +2251,7 @@ async function pushCommand(options) {
|
|
|
2213
2251
|
}
|
|
2214
2252
|
}
|
|
2215
2253
|
try {
|
|
2216
|
-
await
|
|
2254
|
+
await fs11.remove(tempDir);
|
|
2217
2255
|
} catch {
|
|
2218
2256
|
}
|
|
2219
2257
|
} catch (error) {
|
|
@@ -2258,7 +2296,7 @@ async function executeWebPush(bundlePath, event, logger2) {
|
|
|
2258
2296
|
});
|
|
2259
2297
|
const { window } = dom;
|
|
2260
2298
|
logger2.debug("Loading bundle...");
|
|
2261
|
-
const bundleCode = await
|
|
2299
|
+
const bundleCode = await fs11.readFile(bundlePath, "utf8");
|
|
2262
2300
|
window.eval(bundleCode);
|
|
2263
2301
|
logger2.debug("Waiting for elb...");
|
|
2264
2302
|
await waitForWindowProperty2(
|
|
@@ -2399,7 +2437,7 @@ function validatePort(port) {
|
|
|
2399
2437
|
|
|
2400
2438
|
// src/commands/run/utils.ts
|
|
2401
2439
|
import path12 from "path";
|
|
2402
|
-
import
|
|
2440
|
+
import fs12 from "fs-extra";
|
|
2403
2441
|
async function prepareBundleForRun(configPath, options) {
|
|
2404
2442
|
const configDir = path12.dirname(path12.resolve(configPath));
|
|
2405
2443
|
const tempDir = path12.join(
|
|
@@ -2407,7 +2445,7 @@ async function prepareBundleForRun(configPath, options) {
|
|
|
2407
2445
|
".tmp",
|
|
2408
2446
|
`run-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
2409
2447
|
);
|
|
2410
|
-
await
|
|
2448
|
+
await fs12.ensureDir(tempDir);
|
|
2411
2449
|
const tempPath = path12.join(tempDir, "bundle.mjs");
|
|
2412
2450
|
await bundle(configPath, {
|
|
2413
2451
|
cache: true,
|
|
@@ -2594,20 +2632,20 @@ async function run(mode, options) {
|
|
|
2594
2632
|
}
|
|
2595
2633
|
|
|
2596
2634
|
// src/commands/cache.ts
|
|
2597
|
-
import
|
|
2635
|
+
import fs13 from "fs-extra";
|
|
2598
2636
|
import path14 from "path";
|
|
2599
2637
|
var CACHE_DIR = path14.join(".tmp", "cache");
|
|
2600
2638
|
function registerCacheCommand(program2) {
|
|
2601
2639
|
const cache = program2.command("cache").description("Manage the CLI cache");
|
|
2602
2640
|
cache.command("clear").description("Clear all cached packages and builds").option("--packages", "Clear only package cache").option("--builds", "Clear only build cache").action(async (options) => {
|
|
2603
2641
|
if (options.packages) {
|
|
2604
|
-
await
|
|
2642
|
+
await fs13.remove(path14.join(CACHE_DIR, "packages"));
|
|
2605
2643
|
console.log("Package cache cleared");
|
|
2606
2644
|
} else if (options.builds) {
|
|
2607
|
-
await
|
|
2645
|
+
await fs13.remove(path14.join(CACHE_DIR, "builds"));
|
|
2608
2646
|
console.log("Build cache cleared");
|
|
2609
2647
|
} else {
|
|
2610
|
-
await
|
|
2648
|
+
await fs13.remove(CACHE_DIR);
|
|
2611
2649
|
console.log("All caches cleared");
|
|
2612
2650
|
}
|
|
2613
2651
|
});
|
|
@@ -2622,18 +2660,12 @@ function registerCacheCommand(program2) {
|
|
|
2622
2660
|
});
|
|
2623
2661
|
}
|
|
2624
2662
|
async function countEntries(dir) {
|
|
2625
|
-
if (!await
|
|
2626
|
-
const entries = await
|
|
2663
|
+
if (!await fs13.pathExists(dir)) return 0;
|
|
2664
|
+
const entries = await fs13.readdir(dir);
|
|
2627
2665
|
return entries.length;
|
|
2628
2666
|
}
|
|
2629
2667
|
|
|
2630
2668
|
// src/index.ts
|
|
2631
|
-
var __filename = fileURLToPath2(import.meta.url);
|
|
2632
|
-
var __dirname = dirname(__filename);
|
|
2633
|
-
var packageJson = JSON.parse(
|
|
2634
|
-
readFileSync(join(__dirname, "../package.json"), "utf-8")
|
|
2635
|
-
);
|
|
2636
|
-
var VERSION = packageJson.version;
|
|
2637
2669
|
var program = new Command();
|
|
2638
2670
|
program.name("walkeros").description("walkerOS CLI - Bundle and deploy walkerOS components").version(VERSION);
|
|
2639
2671
|
program.hook("preAction", (thisCommand, actionCommand) => {
|