Skip to content

Commit 63257a8

Browse files
committed
fix: intrim
the result does not match. Need to investigate
1 parent 346d725 commit 63257a8

File tree

128 files changed

+1173
-2600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1173
-2600
lines changed

β€Žpackages/tester/ts/app.tsβ€Ž

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ export const app = cli({ name: 'tester', version: '0.0.1' })
1616
moduleTypes: ['commonjs', 'es2015', 'es2020', 'es2022', 'esnext', 'node16', 'nodenext']
1717
})
1818
.extend(getProjectPath)
19-
.extend(getTSConfig)
2019
.extend(readPackageJson)
20+
.extend(getTypeScriptInfo)
2121
.extend(getTestSubjects)
2222
.extend(getTestResults)
2323
.build()
2424

2525
fs.writeFileSync(
26-
path.join(ctx.projectPath, 'test-result.md'),
26+
path.join(ctx.projectPath, `test-result.${ctx.tsVersion}.md`),
2727
[genTestConfiguration(ctx),
2828
genTestSubjects(ctx),
2929
genLegends(),
@@ -32,13 +32,19 @@ export const app = cli({ name: 'tester', version: '0.0.1' })
3232
}
3333
})
3434

35-
function getTSConfig(ctx: { projectPath: string }) {
35+
function getTypeScriptInfo(ctx: { packageJson: any, projectPath: string }) {
3636
const tsconfigPath = path.join(ctx.projectPath, 'tsconfig.base.json')
3737
return {
38-
tsconfig: parse(fs.readFileSync(tsconfigPath, 'utf8'))
38+
tsconfig: parse(fs.readFileSync(tsconfigPath, 'utf8')),
39+
tsVersion: getTSVersion(ctx.packageJson)
3940
}
4041
}
4142

43+
function getTSVersion(packageJson: any) {
44+
const version = packageJson.devDependencies['typescript']
45+
return /^[0-9]/.test(version) ? version : version.slice(1)
46+
}
47+
4248
function genTestConfiguration({ tsconfig }: { tsconfig: any }) {
4349
const template = compile(fs.readFileSync(path.join(__dirname, '../templates/test-configuration.hbs'), 'utf8'))
4450
return template(tsconfig.compilerOptions)

β€Žpackages/tester/ts/logic/project.tsβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export function getTestSubjects({
2121
projectPath: string
2222
}) {
2323
const dependencies = getDependencies(packageJson)
24+
// `assert` is not a package
25+
dependencies.unshift('assert')
2426
return {
2527
subjects: dependencies.map(name => ({
2628
name,

β€Žtests/node/test-result.mdβ€Ž renamed to β€Žtests/node-allow/test-result.5.0.0-dev.20230103.mdβ€Ž

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
```js
44
{
55
"compilerOptions": {
6-
"allowSyntheticDefaultImports": false,
7-
"esModuleInterop": false,
6+
"allowSyntheticDefaultImports": true,
7+
"esModuleInterop": ,
88
"moduleResolution": "Node"
99
}
1010
}
@@ -75,6 +75,8 @@ m.default(1)
7575

7676
```
7777

78+
### [color-map](../../README.md#color-map)
79+
7880
### [es-cjs](../../README.md#es-cjs)
7981

8082
[es-cjs.default-as.all.ts](./ts/es-cjs.default-as.all.ts):
@@ -187,95 +189,104 @@ Import Syntax:
187189
| | | πŸƒ runtime | 🟒 | 🟒 | πŸ”΄ type-not-fn |
188190
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
189191
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
192+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
193+
| | | πŸƒ runtime | βž– | βž– | βž– |
190194
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
191195
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
192196
| | esm | πŸ’» compile | βž– | βž– | βž– |
193197
| | | πŸƒ runtime | βž– | βž– | βž– |
194198
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
195199
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
196-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-e-1 | 🟒 | πŸ”΄ TS2497-e |
200+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-e |
197201
| | | πŸƒ runtime | πŸ”΄ type-not-fn-1 | πŸ”΄ type-not-fn-1 | πŸ”΄ type-not-fn-2 |
198202
| es2015 | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
199203
| | | πŸƒ runtime | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn |
200204
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
201205
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
206+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
207+
| | | πŸƒ runtime | βž– | βž– | βž– |
202208
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
203209
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
204210
| | esm | πŸ’» compile | βž– | βž– | βž– |
205211
| | | πŸƒ runtime | βž– | βž– | βž– |
206212
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
207213
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
208-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
214+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
209215
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
210216
| es2020 | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
211217
| | | πŸƒ runtime | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn |
212218
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
213219
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
220+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
221+
| | | πŸƒ runtime | βž– | βž– | βž– |
214222
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
215223
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
216224
| | esm | πŸ’» compile | βž– | βž– | βž– |
217225
| | | πŸƒ runtime | βž– | βž– | βž– |
218226
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
219227
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
220-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
228+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
221229
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
222230
| es2022 | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
223231
| | | πŸƒ runtime | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn |
224232
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
225233
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
234+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
235+
| | | πŸƒ runtime | βž– | βž– | βž– |
226236
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
227237
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
228238
| | esm | πŸ’» compile | βž– | βž– | βž– |
229239
| | | πŸƒ runtime | βž– | βž– | βž– |
230240
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
231241
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
232-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
242+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
233243
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
234244
| esnext | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
235245
| | | πŸƒ runtime | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn | πŸ”΄ type-not-fn |
236246
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
237247
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
248+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
249+
| | | πŸƒ runtime | βž– | βž– | βž– |
238250
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
239251
| | | πŸƒ runtime | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-3 | πŸ”΄ type-not-fn-4 |
240252
| | esm | πŸ’» compile | βž– | βž– | βž– |
241253
| | | πŸƒ runtime | βž– | βž– | βž– |
242254
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
243255
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
244-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
256+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
245257
| | | πŸƒ runtime | 🟒 | 🟒 | 🟒 |
246258
| node16 | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
247259
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
248260
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
249261
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
262+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
263+
| | | πŸƒ runtime | βž– | βž– | βž– |
250264
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
251265
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
252266
| | esm | πŸ’» compile | βž– | βž– | βž– |
253267
| | | πŸƒ runtime | βž– | βž– | βž– |
254268
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
255269
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
256-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
270+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
257271
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
258272
| nodenext | assertron | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2339 |
259273
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
260274
| | cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
261275
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
276+
| | color-map | πŸ’» compile | βž– | βž– | βž– |
277+
| | | πŸƒ runtime | βž– | βž– | βž– |
262278
| | es-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
263279
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
264280
| | esm | πŸ’» compile | βž– | βž– | βž– |
265281
| | | πŸƒ runtime | βž– | βž– | βž– |
266282
| | esm-cjs | πŸ’» compile | 🟒 | 🟒 | 🟒 |
267283
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
268-
| | param-case | πŸ’» compile | πŸ”΄ TS1259-a-1 | 🟒 | πŸ”΄ TS2497-a |
284+
| | param-case | πŸ’» compile | 🟒 | 🟒 | πŸ”΄ TS2497-a |
269285
| | | πŸƒ runtime | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined | πŸ”΄ ref-not-defined |
270286

271-
- `TS1259-a`: Module '"assert"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
272-
- `TS1259-a-1`: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/param-case@1.1.2/node_modules/param-case/param-case"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
273-
- `TS1259-a-t`: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/assertion-error@1.1.0/node_modules/assertion-error/index"' can only be default-imported using the 'allowSyntheticDefaultImports' flag
274-
- `TS1259-e`: Module '"assert"' can only be default-imported using the 'esModuleInterop' flag
275-
- `TS1259-e-1`: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/param-case@1.1.2/node_modules/param-case/param-case"' can only be default-imported using the 'esModuleInterop' flag
276-
- `TS1259-e-t`: Module '"/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/assertion-error@1.1.0/node_modules/assertion-error/index"' can only be default-imported using the 'esModuleInterop' flag
277287
- `TS2339`: Property 'truthy' does not exist on type 'typeof import("/home/homa/code/cyberuni/ts-esm-interop/node_modules/.pnpm/assertron@7.1.3/node_modules/assertron/lib/index")'.
278288
- `TS2339-1`: Property 'default' does not exist on type '(value: string, locale?: string | undefined) => string'.
289+
- `TS2349`: This expression is not callable.
279290
- `TS2497-a`: This module can only be referenced with ECMAScript imports/exports by turning on the 'allowSyntheticDefaultImports' flag and referencing its default export.
280291
- `TS2497-e`: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export.
281292
- `ref-not-defined`: ReferenceError: exports is not defined in ES module scope

0 commit comments

Comments
Β (0)