Skip to content

Add central deprecation-warning pass for v1 removals - #1532

Open
ricardo-devis-agullo wants to merge 1 commit into
masterfrom
deprecation-warning-pass
Open

Add central deprecation-warning pass for v1 removals#1532
ricardo-devis-agullo wants to merge 1 commit into
masterfrom
deprecation-warning-pass

Conversation

@ricardo-devis-agullo

@ricardo-devis-agullo ricardo-devis-agullo commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements #1529 (v1 Track 1 / non-breaking 0.x deprecation-warning work, see V1.md).

  • Add a shared deprecate() utility (packages/oc/src/utils/deprecate.ts) that emits a consistent, once-per-process DeprecationWarning via process.emitWarning, naming the deprecated option and its replacement. This honors Node's standard --no-deprecation opt-out with no bespoke env var needed.
  • Wire it into the registry config entry seam (options-sanitiser.ts) for: the s3 shortcut, refreshInterval, and the boolean form of discovery.
  • Wire it into the CLI/local config entry seam (oc.json parser, ocConfig.ts) for the deprecated mocks block.
  • No behavioral change: every deprecated option keeps resolving/merging exactly as before; the notices are purely additive.

Out of scope (tracked separately)

Test plan

  • New unit tests for the deprecate utility (dedup-per-id, message formatting) - test/unit/utils-deprecate.js
  • New unit tests asserting the registry config seam calls deprecate for s3/refreshInterval/boolean discovery, and does not for well-formed config - test/unit/registry-domain-options-sanitiser-deprecation.js
  • Extended test/unit/cli-domain-ocConfig.js to assert the mocks block triggers exactly one deprecation notice, and that normal config doesn't
  • npm run build -w oc
  • npm run test -w oc (953 passing)
  • Added a changeset (oc: patch)

Generated with Devin

Implements #1529 (v1 Track 1, non-breaking 0.x work).

- Add a shared `deprecate()` utility (packages/oc/src/utils/deprecate.ts)
  that emits a consistent, once-per-process `DeprecationWarning` via
  `process.emitWarning`, naming the deprecated option and its
  replacement. Honors Node's standard `--no-deprecation` opt-out with
  no bespoke env var needed.
- Wire it into the registry config entry seam (options-sanitiser) for
  the `s3` shortcut, `refreshInterval`, and the boolean form of
  `discovery`.
- Wire it into the CLI/local config entry seam (oc.json parser) for the
  deprecated `mocks` block.
- No behavior changes: every deprecated option keeps resolving exactly
  as before; the notices are purely additive.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant