Add central deprecation-warning pass for v1 removals - #1532
Open
ricardo-devis-agullo wants to merge 1 commit into
Open
Add central deprecation-warning pass for v1 removals#1532ricardo-devis-agullo wants to merge 1 commit into
ricardo-devis-agullo wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #1529 (v1 Track 1 / non-breaking 0.x deprecation-warning work, see
V1.md).deprecate()utility (packages/oc/src/utils/deprecate.ts) that emits a consistent, once-per-processDeprecationWarningviaprocess.emitWarning, naming the deprecated option and its replacement. This honors Node's standard--no-deprecationopt-out with no bespoke env var needed.options-sanitiser.ts) for: thes3shortcut,refreshInterval, and the boolean form ofdiscovery.oc.jsonparser,ocConfig.ts) for the deprecatedmocksblock.Out of scope (tracked separately)
tarExtractModecorrection and adapter-neutral error codes.Test plan
deprecateutility (dedup-per-id, message formatting) -test/unit/utils-deprecate.jsdeprecatefors3/refreshInterval/booleandiscovery, and does not for well-formed config -test/unit/registry-domain-options-sanitiser-deprecation.jstest/unit/cli-domain-ocConfig.jsto assert themocksblock triggers exactly one deprecation notice, and that normal config doesn'tnpm run build -w ocnpm run test -w oc(953 passing)oc: patch)Generated with Devin