Parcourir la source

fix(sdk): list create <source> and headless flags in usage help

dsh-sdk's usage template predates the create command and create-sdk's
predates --config/--config-json/--json, so --help hid both surfaces the
README already documents. Pin each with a help-output assertion.
imccyu il y a 2 mois
Parent
commit
78f21bf703

+ 3 - 0
packages/sdk/create-sdk/src/templates/assets/usage.txt.tpl

@@ -9,3 +9,6 @@ Options:
   --interface <acp|stdio|embed>
   --pm <npm|pnpm|yarn>
   --install / --no-install
+  --config <path>
+  --config-json <json>
+  --json

+ 1 - 0
packages/sdk/create-sdk/tests/create.spec.ts

@@ -477,6 +477,7 @@ describe('create command composition', () => {
     context.stdout.isTTY = false
     await expect(createProject(['--help'], context)).resolves.toBeUndefined()
     expect(context.readStdout()).toContain('Usage: create-sdk')
+    expect(context.readStdout()).toContain('--config-json <json>')
     expect(context.readStdout()).not.toContain('--link-workspace')
     await expect(createProject(argv('agent', false), context)).rejects.toThrow('interactive TTY')
     context.stdin.isTTY = true

+ 1 - 0
packages/sdk/scripts/src/templates/assets/usage.txt.tpl

@@ -5,3 +5,4 @@ Commands:
   dev [target] [-- args...]    Start with TypeScript and local-plugin source resolution
   build [args...] Run the project's installed tsdown
   config          Interactively edit project features
+  create <source> Add an external plugin dependency (pkg@version or github:owner/repo#ref) and mount it in cordis.yml

+ 1 - 0
packages/sdk/scripts/tests/scripts.spec.ts

@@ -168,6 +168,7 @@ describe('Commander launcher arguments', () => {
     await expect(runDshSdkCommand(['unknown'], context)).resolves.toBe(1)
     await expect(runDshSdkCommand([], context)).resolves.toBe(0)
     expect(context.readStdout()).toContain('Usage: dsh-sdk')
+    expect(context.readStdout()).toContain('create <source>')
 
     const defaults = commandContext(root)
     await writeFile(join(root, 'main.mjs'), 'export function main() { return "ok" }\n')