Repository navigation
fix(upgrade): bring an extension's TypeScript in line with the 4.9 Flarum builds with - #59
Merged
Merged
Conversation
…arum builds with - Pin typescript to ^4.9.5 in the upgrade and the scaffold, and say why when it comes down from TypeScript 5. - Drop the tsconfig.json compiler options and values TypeScript 4.9 doesn't have, from a list generated from typescript@4.9.5, and flag an extends list. - Put a @todo above syntax 4.9 can't compile: const type parameters, using declarations, export type *, and import attributes. - Make post-build-typings work with BSD sed as well as GNU sed. - Read JSON with a trailing comma before ], as tsconfig.json allows.
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.
Fixes: no issue.
Changes proposed in this pull request:
Flarum 2.0 builds and checks its typings with TypeScript 4.9: core's
^4.5.4resolves to 4.9.5. The upgrade now pins an extension'stypescriptto^4.9.5, like the scaffold, and says why when it comes down from TypeScript 5.It also handles what TypeScript 4.9 can't read:
tsconfig.jsoncompiler options and values 4.9 doesn't have, using a list generated from typescript@4.9.5 itself, and reports what it removed;extendslist;@TODOabove syntax 4.9 can't compile:consttype parameters,using,export type *and import attributes. TypeScript sources are only searched line by line, never parsed or reformatted.post-build-typingsnow works with macOS's BSDsedas well as GNUsed, in the upgrade and the scaffold. JSON with a trailing comma before], whichtsconfig.jsonallows, no longer fails the step.Reviewers should focus on:
accessor,satisfiesandimport … assert, which 4.9 has.tsconfig.jsons: only fof/links and fof/polls change, losingmoduleResolution: "bundler". Six FoF configs with a trailing,]used to fail the JSON parse; they now load.Screenshot
N/A
Necessity
Confirmed
yarn testinjs/). (yarn test: 244 tests, plus Prettier, ESLint andtsc.)post-build-typingsfor real, so CI checks it with GNUsed.)composer test). (N/A)Required changes:
None.