Skip to content

Commit ab15063

Browse files
authored
swc plugin enhancements (#1802)
* 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
1 parent 91110cd commit ab15063

File tree

5 files changed

+369
-185
lines changed

5 files changed

+369
-185
lines changed

package-lock.json

Lines changed: 74 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@
112112
"homepage": "https://typestrong.org/ts-node",
113113
"devDependencies": {
114114
"@microsoft/api-extractor": "^7.19.4",
115-
"@swc/core": ">=1.2.50",
116-
"@swc/wasm": ">=1.2.50",
115+
"@swc/core": ">=1.2.205",
116+
"@swc/wasm": ">=1.2.205",
117117
"@types/diff": "^4.0.2",
118118
"@types/lodash": "^4.14.151",
119119
"@types/node": "13.13.5",
@@ -131,14 +131,15 @@
131131
"lodash": "^4.17.15",
132132
"ntypescript": "^1.201507091536.1",
133133
"nyc": "^15.0.1",
134+
"outdent": "^0.8.0",
134135
"proper-lockfile": "^4.1.2",
135136
"proxyquire": "^2.0.0",
136137
"react": "^16.14.0",
137138
"rimraf": "^3.0.0",
138139
"semver": "^7.1.3",
139140
"throat": "^6.0.1",
140141
"typedoc": "^0.22.10",
141-
"typescript": "4.7.2",
142+
"typescript": "4.7.4",
142143
"typescript-json-schema": "^0.53.0",
143144
"util.promisify": "^1.0.1"
144145
},

src/test/helpers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ export const tsSupportsStableNodeNextNode16 =
9999
// TS 4.5 is first version to understand .cts, .mts, .cjs, and .mjs extensions
100100
export const tsSupportsMtsCtsExtensions = semver.gte(ts.version, '4.5.0');
101101
export const tsSupportsImportAssertions = semver.gte(ts.version, '4.5.0');
102+
// TS 4.1 added jsx=react-jsx and react-jsxdev: https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#react-17-jsx-factories
103+
export const tsSupportsReact17JsxFactories = semver.gte(ts.version, '4.1.0');
102104
//#endregion
103105

104106
export const xfs = new NodeFS(fs);

0 commit comments

Comments
 (0)