@cadence-aria/cli 0.0.1 → 0.0.2

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.
Files changed (2) hide show
  1. package/bin/aria.js +7 -0
  2. package/package.json +4 -4
package/bin/aria.js CHANGED
@@ -3,6 +3,7 @@
3
3
 
4
4
  const { spawn } = require("node:child_process");
5
5
  const http = require("node:http");
6
+ const { homedir } = require("node:os");
6
7
  const { resolveBinary } = require("../lib/platform.js");
7
8
  const { planInvocation } = require("../lib/args.js");
8
9
  const { pickFreePort } = require("../lib/port.js");
@@ -48,6 +49,11 @@ function waitForReady(port, timeoutMs = 30000) {
48
49
  });
49
50
  }
50
51
 
52
+ function withDefaultWorkspace(args) {
53
+ if (args[0] !== "web" || args.includes("--workspace")) return args;
54
+ return ["web", "--workspace", homedir(), ...args.slice(1)];
55
+ }
56
+
51
57
  async function main() {
52
58
  const argv = process.argv.slice(2);
53
59
  const plan = planInvocation(argv);
@@ -68,6 +74,7 @@ async function main() {
68
74
  port = await pickFreePort();
69
75
  forwardArgs = ["web", "--port", String(port), "--host", "127.0.0.1"];
70
76
  }
77
+ forwardArgs = withDefaultWorkspace(forwardArgs);
71
78
 
72
79
  const child = spawn(binary, forwardArgs, { stdio: "inherit" });
73
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cadence-aria/cli",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Aria 本地化工作台 — 通过 npx 一键启动",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -20,8 +20,8 @@
20
20
  "node": ">=18"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@cadence-aria/cli-linux-x64": "0.0.1",
24
- "@cadence-aria/cli-darwin-x64": "0.0.1",
25
- "@cadence-aria/cli-darwin-arm64": "0.0.1"
23
+ "@cadence-aria/cli-linux-x64": "0.0.2",
24
+ "@cadence-aria/cli-darwin-x64": "0.0.2",
25
+ "@cadence-aria/cli-darwin-arm64": "0.0.2"
26
26
  }
27
27
  }