File tree Expand file tree Collapse file tree 8 files changed +434
-422
lines changed
test/converter2/issues/gh2044 Expand file tree Collapse file tree 8 files changed +434
-422
lines changed Original file line number Diff line number Diff line change 31
31
"shiki" : " ^0.14.1"
32
32
},
33
33
"peerDependencies" : {
34
- "typescript" : " 4.6.x || 4.7.x || 4.8.x || 4.9.x"
34
+ "typescript" : " 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x "
35
35
},
36
36
"devDependencies" : {
37
37
"@types/lunr" : " ^2.3.4" ,
38
38
"@types/marked" : " ^4.0.8" ,
39
39
"@types/mocha" : " ^10.0.1" ,
40
40
"@types/node" : " 14" ,
41
- "@typescript-eslint/eslint-plugin" : " ^5.51 .0" ,
42
- "@typescript-eslint/parser" : " ^5.51 .0" ,
41
+ "@typescript-eslint/eslint-plugin" : " ^5.55 .0" ,
42
+ "@typescript-eslint/parser" : " ^5.55 .0" ,
43
43
"@typestrong/fs-fixture-builder" : " github:TypeStrong/fs-fixture-builder#5a9486bc66f6e36988106685768396281f6cbc10" ,
44
- "c8" : " ^7.12 .0" ,
45
- "esbuild" : " ^0.17.7 " ,
46
- "eslint" : " ^8.34 .0" ,
44
+ "c8" : " ^7.13 .0" ,
45
+ "esbuild" : " ^0.17.12 " ,
46
+ "eslint" : " ^8.36 .0" ,
47
47
"mocha" : " ^10.2.0" ,
48
48
"prettier" : " 2.8.4" ,
49
49
"puppeteer" : " ^13.5.2" ,
50
50
"ts-node" : " ^10.9.1" ,
51
- "typescript" : " 4.9.5 "
51
+ "typescript" : " 5.0.2 "
52
52
},
53
53
"files" : [
54
54
" /bin" ,
Original file line number Diff line number Diff line change @@ -1021,8 +1021,11 @@ function setModifiers(
1021
1021
) ;
1022
1022
reflection . setFlag (
1023
1023
ReflectionFlag . Readonly ,
1024
- hasAllFlags ( symbol . checkFlags ?? 0 , ts . CheckFlags . Readonly ) ||
1025
- hasAllFlags ( modifiers , ts . ModifierFlags . Readonly )
1024
+ hasAllFlags (
1025
+ // TS 4.9: symbol.checkFlags, links was introduced in 5.0
1026
+ symbol . checkFlags ?? symbol . links ?. checkFlags ?? 0 ,
1027
+ ts . CheckFlags . Readonly
1028
+ ) || hasAllFlags ( modifiers , ts . ModifierFlags . Readonly )
1026
1029
) ;
1027
1030
reflection . setFlag (
1028
1031
ReflectionFlag . Abstract ,
Original file line number Diff line number Diff line change @@ -10,8 +10,15 @@ declare module "typescript" {
10
10
}
11
11
12
12
interface Symbol {
13
+ // TS before 5.0
13
14
// https://github.com/microsoft/TypeScript/blob/v4.1.5/src/compiler/types.ts#L4734-L4737
14
15
checkFlags ?: CheckFlags ;
16
+
17
+ // TS 5.0
18
+ // https://github.com/microsoft/TypeScript/blob/5.0.2/src/compiler/types.ts#L5891-L5898
19
+ links ?: {
20
+ checkFlags : CheckFlags ;
21
+ } ;
15
22
}
16
23
17
24
interface TypeChecker {
Original file line number Diff line number Diff line change @@ -411,6 +411,8 @@ function getEntryPointsForPackages(
411
411
return ;
412
412
}
413
413
414
+ const packageName = packageJson [ "name" ] as string ;
415
+
414
416
if ( includeVersion && ! validate ( { version : String } , packageJson ) ) {
415
417
logger . warn (
416
418
`--includeVersion was specified, but "${ nicePath (
@@ -420,9 +422,7 @@ function getEntryPointsForPackages(
420
422
}
421
423
422
424
results . push ( {
423
- displayName :
424
- typedocPackageConfig ?. displayName ??
425
- ( packageJson [ "name" ] as string ) ,
425
+ displayName : typedocPackageConfig ?. displayName ?? packageName ,
426
426
version : includeVersion
427
427
? ( packageJson [ "version" ] as string | undefined )
428
428
: void 0 ,
Original file line number Diff line number Diff line change @@ -63,18 +63,21 @@ export function extractTypedocConfigFromPackageManifest(
63
63
}
64
64
if (
65
65
hasOwnProperty ( packageJson , "typedoc" ) &&
66
- typeof packageJson . typedoc == "object" &&
67
- packageJson . typedoc
66
+ typeof packageJson [ " typedoc" ] == "object" &&
67
+ packageJson [ " typedoc" ]
68
68
) {
69
69
if (
70
- ! validate ( typedocPackageManifestConfigSchema , packageJson . typedoc )
70
+ ! validate (
71
+ typedocPackageManifestConfigSchema ,
72
+ packageJson [ "typedoc" ]
73
+ )
71
74
) {
72
75
logger . error (
73
76
`Typedoc config extracted from package manifest file ${ packageJsonPath } is not valid`
74
77
) ;
75
78
return undefined ;
76
79
}
77
- return packageJson . typedoc ;
80
+ return packageJson [ " typedoc" ] ;
78
81
}
79
82
return undefined ;
80
83
}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export { other } from "./other";
5
5
6
6
/**
7
7
* @typedef {import("./other").Generic<T> } Generic
8
- * @template T
8
+ * @template {string} T
9
9
*/
10
10
11
11
/**
Original file line number Diff line number Diff line change 21
21
"noUnusedLocals" : true ,
22
22
"noUnusedParameters" : true ,
23
23
"forceConsistentCasingInFileNames" : true ,
24
- "importsNotUsedAsValues" : " error" ,
25
24
// Library
26
25
"preserveConstEnums" : true ,
27
26
"declaration" : true ,
28
27
"sourceMap" : true ,
29
- "isolatedModules" : true ,
30
28
"noImplicitOverride" : true ,
31
29
"noPropertyAccessFromIndexSignature" : true ,
32
30
// Output
35
33
"newLine" : " LF" ,
36
34
"jsx" : " react" ,
37
35
"jsxFactory" : " JSX.createElement" ,
38
- "jsxFragmentFactory" : " JSX.Fragment"
36
+ "jsxFragmentFactory" : " JSX.Fragment" ,
37
+
38
+ // TS 5 introduced verbatimModuleSyntax and deprecated importsNotUsedAsValues
39
+ // But that flag is intentionally very unfriendly to projects emitting CommonJS
40
+ // so for now, we're going to ignore that deprecation.
41
+ "ignoreDeprecations" : " 5.0" ,
42
+ "importsNotUsedAsValues" : " error" ,
43
+ "isolatedModules" : true
39
44
},
40
45
"include" : [" src" ],
41
46
"exclude" : [
You can’t perform that action at this time.
0 commit comments