Repository navigation
fix(metadata): keep RowFields as a deprecated alias of StoredRow - #131
Merged
Merged
Conversation
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.
Why
interface-dms 0.12 and 0.13 name
RowFieldsfrom@antelopejs/interface-data-api/metadatain their published declarations, as the result type of theirgetandeditroutes. 0.7.0 removed that name in favour ofStoredRow(#126). Every consumer type-checking interface-dms against data-api 0.7.x then fails with TS2694. This PR brings the name back as a deprecated alias, so interface-dms 0.13.3 type-checks as it is until ANT-2384 moves it toStoredRow. It is the alias commit that reached #129's branch after that PR merged, cherry-picked onto main.What
src/internal/field-types.ts:export type RowFields = StoredRow, documented@deprecated Use StoredRow. It is a real type, notunknown.src/metadata.tsexports it next toStoredRow.src/tests/index/consumer_declarations.test.ts: the consumer module also importsRowFields, assigns aStoredRowto it, and checks thatDefaultRoutes.Getanswers aRowFields.Attention
One addition to the published declarations, no removal:
RowFieldsinmetadata(and in its@internalsource module). Runtime exports are unchanged.antelopejs-api-diffreports the addition as a difference; the output is below.Proof
Both ways, against interface-dms 0.13.3. A scratch project with this head packed,
@antelopejs/interface-dms0.13.3, decorators 0.5.2 and interface-core 0.5.1, one copy of each. It runstscwithskipLibCheck: falseover every interface-dms module that namesRowFields: the index,data-controllers/roles,data-controllers/members,base/table-view/routesandbase/table-view/internal/guards.With the alias: no diagnostics, exit 0.
With
RowFieldsremoved from the packeddist/metadata.d.ts:In-repo consumer test, with
RowFieldsremoved from the builtdist/metadata.d.ts:On this head it passes, inside
pnpm run checks: 11 passed, 0 failed.