Skip to content

Commit

Permalink
swc plugin enhancements (#1802)
Browse files Browse the repository at this point in the history
* refactor swc plugin to make it more test-able; also throw helpful error when users swc dep is too old

* fmt

* fix

* fix import assertions

* fix
  • Loading branch information
cspotcode authored Jul 2, 2022
1 parent 91110cd commit ab15063
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 185 deletions.
150 changes: 74 additions & 76 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
"homepage": "https://typestrong.org/ts-node",
"devDependencies": {
"@microsoft/api-extractor": "^7.19.4",
"@swc/core": ">=1.2.50",
"@swc/wasm": ">=1.2.50",
"@swc/core": ">=1.2.205",
"@swc/wasm": ">=1.2.205",
"@types/diff": "^4.0.2",
"@types/lodash": "^4.14.151",
"@types/node": "13.13.5",
Expand All @@ -131,14 +131,15 @@
"lodash": "^4.17.15",
"ntypescript": "^1.201507091536.1",
"nyc": "^15.0.1",
"outdent": "^0.8.0",
"proper-lockfile": "^4.1.2",
"proxyquire": "^2.0.0",
"react": "^16.14.0",
"rimraf": "^3.0.0",
"semver": "^7.1.3",
"throat": "^6.0.1",
"typedoc": "^0.22.10",
"typescript": "4.7.2",
"typescript": "4.7.4",
"typescript-json-schema": "^0.53.0",
"util.promisify": "^1.0.1"
},
Expand Down
2 changes: 2 additions & 0 deletions src/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ export const tsSupportsStableNodeNextNode16 =
// TS 4.5 is first version to understand .cts, .mts, .cjs, and .mjs extensions
export const tsSupportsMtsCtsExtensions = semver.gte(ts.version, '4.5.0');
export const tsSupportsImportAssertions = semver.gte(ts.version, '4.5.0');
// TS 4.1 added jsx=react-jsx and react-jsxdev: https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#react-17-jsx-factories
export const tsSupportsReact17JsxFactories = semver.gte(ts.version, '4.1.0');
//#endregion

export const xfs = new NodeFS(fs);
Expand Down
Loading

0 comments on commit ab15063

Please sign in to comment.