Skip to content

feat(cli): add single fred entrypoint with subcommands#1697

Merged
LeoMcA merged 1 commit into
mainfrom
fred-bin
Jul 10, 2026
Merged

feat(cli): add single fred entrypoint with subcommands#1697
LeoMcA merged 1 commit into
mainfrom
fred-bin

Conversation

@caugner

@caugner caugner commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description

Add a single fred binary that dispatches server/ssr subcommands, so @mdn/fred can be run as npx @mdn/fred ssr. The existing fred-server/fred-ssr binaries are kept as deprecated shims (which print a warning and delegate) for backward compatibility, and the publish-simulation workflow now uses npx @mdn/fred ssr.

  • Add bin/fred.js dispatcher (fred <server|ssr>).
  • Convert fred-server/fred-ssr bins to deprecation shims in bin/.
  • Point bin entries in package.json/package-lock.json at the new wrappers.
  • Drop the now-dead shebangs from scripts/server.js and build/ssr.js (no longer bin entries).
  • Switch the publish-simulation workflow to npx @mdn/fred ssr.

Motivation

Prevent the risk of bare npx fred-server/npx fred-ssr resolving to squatted registry packages when @mdn/fred is not installed locally, by steering consumers to the unambiguous npx @mdn/fred <command> (and npx --package=@mdn/fred fred-ssr during the deprecation window).

Additional details

Both target invocations are verified to work: npx @mdn/fred ssr produces byte-identical output to running build/ssr.js directly, and npx --package=@mdn/fred fred-ssr continues to work via the shim. The two standalone bins remain only as a temporary bridge and can be dropped in a future major.

Related issues and pull requests

Part of #1680.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

682f51a was deployed to: https://fred-pr1697.review.mdn.allizom.net/

Add a `fred` bin dispatching `server`/`ssr` subcommands so consumers
can run `npx @mdn/fred ssr` instead of the squattable bare-bin form
`npx fred-ssr`. Keep `fred-server`/`fred-ssr` as deprecated shims for
backward compatibility, and switch the publish-simulation workflow to
`npx @mdn/fred ssr`.
@caugner
caugner marked this pull request as ready for review July 7, 2026 08:54
@caugner
caugner requested review from a team and mdn-bot as code owners July 7, 2026 08:54
@caugner
caugner requested a review from LeoMcA July 7, 2026 08:54

@LeoMcA LeoMcA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, lgtm

@LeoMcA
LeoMcA merged commit ce53f48 into main Jul 10, 2026
14 checks passed
@LeoMcA
LeoMcA deleted the fred-bin branch July 10, 2026 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants