Skip to content

fix(plugin-cli): normalise multi-word flags to kebab-case#1091

Merged
ascorbic merged 1 commit into
mainfrom
fix/plugin-cli-kebab-flags
May 18, 2026
Merged

fix(plugin-cli): normalise multi-word flags to kebab-case#1091
ascorbic merged 1 commit into
mainfrom
fix/plugin-cli-kebab-flags

Conversation

@ascorbic
Copy link
Copy Markdown
Collaborator

What does this PR do?

Normalises multi-word CLI flags on @emdash-cms/plugin-cli to kebab-case for consistency with the publish subcommand and standard Unix CLI convention.

Today the CLI has both styles side-by-side:

  • publish: --author-name, --author-url, --security-email, --no-manifest (kebab)
  • build / dev / bundle: --outDir, --validateOnly (camel)

After this change, the three outliers use kebab too:

  • --outDir -> --out-dir
  • --validateOnly -> --validate-only

The short alias -o for --out-dir is unchanged. The programmatic API options on bundlePlugin() / buildPlugin() stay camelCase — they're JS function options, not CLI flags.

Surfaced during review of #1059 (plugin authoring docs). The docs branch documents the kebab form, so this PR needs to land before — or together with — the docs PR.

Closes #

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion: https://github.com/emdash-cms/emdash/discussions/...

AI-generated code disclosure

  • This PR includes AI-generated code — model/tool: Claude Opus 4.7

Screenshots / test output

=== build ===
  --dir="..."             Plugin directory (default: current directory)
  -o, --out-dir="dist"    Output directory (default: ./dist)
=== dev ===
  --dir="..."             Plugin directory (default: current directory)
  -o, --out-dir="dist"    Output directory (default: ./dist)
=== bundle ===
  --dir="..."             Plugin directory (default: current directory)
  -o, --out-dir="dist"    Output directory for the tarball (default: ./dist)
  --validate-only         Run validation only, skip tarball creation

Tests: 256/256 passing in packages/plugin-cli. Typecheck clean.

The 'publish' subcommand uses kebab-case for multi-word flags
('--author-name', '--no-manifest', ...) while 'build', 'dev', and
'bundle' use camelCase ('--outDir', '--validateOnly'). Standardise on
kebab-case across all subcommands.

- --outDir -> --out-dir
- --validateOnly -> --validate-only

The programmatic API options on bundlePlugin / buildPlugin remain
camelCase (they are JS function options, not CLI flags).
Copilot AI review requested due to automatic review settings May 18, 2026 14:45
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 18, 2026

🦋 Changeset detected

Latest commit: 3c8c895

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@emdash-cms/plugin-cli Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-perf-coordinator 3c8c895 May 18 2026, 02:45 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-i18n 3c8c895 May 18 2026, 02:46 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
docs 3c8c895 May 18 2026, 02:46 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-demo-cache 3c8c895 May 18 2026, 02:47 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 18, 2026

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@1091

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@1091

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@1091

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@1091

emdash

npm i https://pkg.pr.new/emdash@1091

create-emdash

npm i https://pkg.pr.new/create-emdash@1091

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@1091

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@1091

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@1091

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@1091

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@1091

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@1091

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@1091

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@1091

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@1091

commit: 3c8c895

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 3c8c895 May 18 2026, 02:48 PM

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates @emdash-cms/plugin-cli command-line flag spelling so multi-word flags use kebab-case while keeping programmatic API option names camelCase.

Changes:

  • Renames build, dev, and bundle CLI option definitions from camelCase to kebab-case.
  • Updates command handlers to read the new citty argument keys.
  • Adds a changeset and adjusts a test comment to reference --out-dir.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.changeset/plugin-cli-kebab-flags.md Documents the CLI flag rename for release notes.
packages/plugin-cli/src/build/command.ts Changes build output flag to --out-dir.
packages/plugin-cli/src/dev/command.ts Changes dev output flag handling and watcher comments to --out-dir.
packages/plugin-cli/src/bundle/command.ts Changes bundle flags to --out-dir and --validate-only.
packages/plugin-cli/tests/bundle.test.ts Updates a comment mentioning the output flag spelling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .changeset/plugin-cli-kebab-flags.md
Comment on lines +18 to 19
* concurrent runs don't collide, and so `--out-dir` resolution works as
* advertised (it can be either absolute or relative to `dir`).
@ascorbic ascorbic merged commit 6725e91 into main May 18, 2026
44 checks passed
@ascorbic ascorbic deleted the fix/plugin-cli-kebab-flags branch May 18, 2026 15:03
ascorbic added a commit that referenced this pull request May 18, 2026
- Manifest profile prose lists author and security contact as required,
  matching the table and the actual ManifestSchema (.refine() rules in
  packages/plugin-cli/src/manifest/schema.ts require one of author/
  authors and one of security/securityContacts).
- Publishing prerequisites match the same required-fields story.
- Bundle flag documentation uses kebab-case (--out-dir, --validate-only)
  to match the post-rename CLI (#1091).
- your-first-plugin scaffolding example bumps emdash to >=0.13.0 (the
  first release exposing the emdash/plugin entrypoint) and pins
  @emdash-cms/plugin-cli to 0.2.0 (exact pin per the publishing page's
  experimental-registry guidance).
ascorbic added a commit that referenced this pull request May 18, 2026
* docs(plugins): document the plugin CLI, manifest, and authoring-shape changes (#1040, #1057)

Adds migration guides for site operators and plugin authors, new
reference pages for emdash-plugin.jsonc and the emdash-plugin CLI, and
rewrites the sandboxed-plugin guides to the new default-export shape.
Migration guides follow Astro's breaking-changes format; Atmosphere
account terminology used throughout.

* docs(plugins): apply definition-by-negation / builder-salience standard

Self-review of #1059 against the standards formalized since it was written.
Removed definition-by-negation and bundle-internal framing from the guide
pages (migration guides left as-is — comparison/changelog is their purpose):

- 'You do not write a descriptor or a build script' -> dropped (the positive
  sentence already says what build does)
- 'the build produces both, so you never hand-write either' -> 'generates both'
- 'type-only, so the emdash runtime does not enter the plugin bundle' /
  'the bundler erases them — no emdash runtime enters' -> 'provides only
  types, so a sandboxed plugin has no runtime dependency on emdash'
- 'you never write it by hand' -> 'EmDash derives ... automatically'
- 'init never requires extra flags to succeed' -> 'A slug is the only
  required input'
- 'wire-side filename' -> '(the filename the registry expects)'
- 'The registry never stores your plugin's code' lead -> dropped; the
  positive 'you host the tarball; registry stores a link' carries it

Tropes scan clean; em-dashes appositive; bold bullets definitional.

* docs(plugins): address review feedback on #1059

- Manifest profile prose lists author and security contact as required,
  matching the table and the actual ManifestSchema (.refine() rules in
  packages/plugin-cli/src/manifest/schema.ts require one of author/
  authors and one of security/securityContacts).
- Publishing prerequisites match the same required-fields story.
- Bundle flag documentation uses kebab-case (--out-dir, --validate-only)
  to match the post-rename CLI (#1091).
- your-first-plugin scaffolding example bumps emdash to >=0.13.0 (the
  first release exposing the emdash/plugin entrypoint) and pins
  @emdash-cms/plugin-cli to 0.2.0 (exact pin per the publishing page's
  experimental-registry guidance).

* docs(plugins): address second round of review feedback on #1059

- api-routes: clarify that the route URL segment is the plugin's slug
  (the same value as ctx.plugin.id at runtime) — previously phrased as
  <plugin-id> without explaining what that is.
- api-routes: SandboxedRouteContext is non-generic in emdash/plugin
  (input is unknown; authors narrow with a route-level Zod schema). The
  earlier reference snippet showed a TInput generic that doesn't exist
  in the exported type.
- cli: --json is supported by the non-interactive output commands
  (whoami, validate, search, info, login, publish), not all commands —
  logout, switch, init, build, dev, bundle do not define a json arg.

* docs(plugins): align discovery flag and prose on registry terminology

The CLI flag for overriding the discovery endpoint is being renamed
from --aggregator to --registry-url in #1092, matching the
EMDASH_REGISTRY_URL env var and the user-facing concept of a registry.
Update the docs to use the new flag name and drop the user-facing
mention of 'aggregator' in publishing.mdx in favour of 'registry'.
@emdashbot emdashbot Bot mentioned this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants