dekit-cli 0.2.3 → 0.3.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/bin/dekit.ts CHANGED
@@ -11,13 +11,14 @@ Commands:
11
11
  init [path] Initialize a new design project
12
12
  add <type> <name> Add a page or component
13
13
  ls List pages and components
14
- serve Start the preview server (default)
14
+ serve Start the preview server (default, port 7980)
15
15
  screenshot <ref> Take a screenshot of a page or element
16
16
  resolve <ref> Resolve a ref to file path and line range
17
17
  usage Print the agent usage guide
18
18
 
19
19
  Options:
20
20
  -c, --config Path to dekit.yaml
21
+ -p, --port Editor server port (default: 7980)
21
22
  -h, --help Show this help message
22
23
 
23
24
  Run 'dekit <command> --help' for command-specific help.
@@ -102,16 +103,10 @@ async function main() {
102
103
  }
103
104
  case "serve": {
104
105
  const config = await loadConfig(configArg);
105
- const port = parseInt(
106
- commandArgs.find((_, i, a) => a[i - 1] === "-p") ?? "3000",
107
- 10
108
- );
109
- const designPort = parseInt(
110
- commandArgs.find((_, i, a) => a[i - 1] === "--design-port") ?? "3001",
111
- 10
112
- );
106
+ const portArg = commandArgs.find((_, i, a) => a[i - 1] === "-p");
107
+ const port = portArg ? parseInt(portArg, 10) : undefined;
113
108
  const noOpen = commandArgs.includes("--no-open");
114
- await startServers({ config, port, designPort, noOpen });
109
+ await startServers({ config, port, noOpen });
115
110
  break;
116
111
  }
117
112
  case "screenshot": {