Skip to content

Commit dea45fd

Browse files
authored
Update submodule, fix JSON syntax problems (#1285)
1 parent 8975084 commit dea45fd

File tree

111 files changed

+1325
-3871
lines changed

Some content is hidden

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

111 files changed

+1325
-3871
lines changed

_submodules/TypeScript

Submodule TypeScript updated 63 files

internal/fourslash/tests/gen/pathCompletionsPackageJsonExportsBundlerNoNodeCondition_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestPathCompletionsPackageJsonExportsBundlerNoNodeCondition(t *testing.T) {
2020
"./only-for-node": {
2121
"node": "./something.js"
2222
},
23-
"./for-everywhere": "./other.js",
23+
"./for-everywhere": "./other.js"
2424
}
2525
}
2626
// @Filename: /node_modules/foo/something.d.ts

internal/fourslash/tests/gen/pathCompletionsPackageJsonExportsCustomConditions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestPathCompletionsPackageJsonExportsCustomConditions(t *testing.T) {
2020
"exports": {
2121
"./only-with-custom-conditions": {
2222
"custom-condition": "./something.js"
23-
},
23+
}
2424
}
2525
}
2626
// @Filename: /node_modules/foo/something.d.ts

internal/fourslash/tests/gen/pathCompletionsPackageJsonImportsBundlerNoNodeCondition_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestPathCompletionsPackageJsonImportsBundlerNoNodeCondition(t *testing.T) {
2020
"#only-for-node": {
2121
"node": "./something.js"
2222
},
23-
"#for-everywhere": "./other.js",
23+
"#for-everywhere": "./other.js"
2424
}
2525
}
2626
// @Filename: /something.d.ts

internal/fourslash/tests/gen/pathCompletionsPackageJsonImportsCustomConditions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestPathCompletionsPackageJsonImportsCustomConditions(t *testing.T) {
2020
"imports": {
2121
"#only-with-custom-conditions": {
2222
"custom-condition": "./something.js"
23-
},
23+
}
2424
}
2525
}
2626
// @Filename: /something.d.ts

internal/packagejson/packagejson.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type Fields struct {
3636
func Parse(data []byte) (Fields, error) {
3737
var f Fields
3838
if err := json2.Unmarshal(data, &f); err != nil {
39-
return f, err
39+
return Fields{}, err
4040
}
4141
return f, nil
4242
}

internal/project/projectreferencesprogram_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func filesForSymlinkReferences(preserveSymlinks bool, scope string) (files map[s
283283
files = map[string]any{
284284
"/user/username/projects/myproject/packages/B/package.json": `{
285285
"main": "lib/index.js",
286-
"types": "lib/index.d.ts",
286+
"types": "lib/index.d.ts"
287287
}`,
288288
aTest: fmt.Sprintf(`
289289
import { foo } from '%sb';

testdata/baselines/reference/submodule/compiler/awaitedTypeNoLib.errors.txt.diff

Lines changed: 0 additions & 20 deletions
This file was deleted.

testdata/baselines/reference/submodule/compiler/narrowingUnionToUnion.types.diff

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
--- old.narrowingUnionToUnion.types
22
+++ new.narrowingUnionToUnion.types
3-
@@= skipped -32, +32 lines =@@
4-
>x : T | undefined
5-
6-
x; // T & Falsy | undefined
7-
->x : (T & null) | (T & "") | (T & 0) | (T & false) | (T & 0n) | undefined
8-
+>x : (T & null) | (T & "") | (T & 0) | (T & 0n) | (T & false) | undefined
9-
}
10-
}
11-
12-
@@= skipped -212, +212 lines =@@
3+
@@= skipped -244, +244 lines =@@
134
}
145
},
156
(value?: string) => {

testdata/baselines/reference/submodule/compiler/reactJsxReactResolvedNodeNext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const a = <div></div>;
77
"name": "@types/react",
88
"version": "0.0.1",
99
"main": "",
10-
"types": "index.d.ts",
10+
"types": "index.d.ts"
1111
}
1212
//// [index.d.ts]
1313
declare namespace JSX {

testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=bundler).errors.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=node16).errors.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.

testdata/baselines/reference/submodule/conformance/conditionalExportsResolutionFallback(moduleresolution=nodenext).errors.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
11
index.cjs(3,22): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package/mjs")' call instead.
22
index.cjs(4,23): error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("package")' call instead.
3-
index.cjs(8,23): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
4-
index.cjs(9,23): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
5-
index.cjs(11,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
6-
index.js(8,23): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
7-
index.js(9,23): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
8-
index.js(11,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
9-
index.js(14,7): error TS2339: Property 'mjsSource' does not exist on type 'typeof import("node_modules/inner/index")'.
10-
index.mjs(8,23): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
11-
index.mjs(9,23): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
12-
index.mjs(11,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
13-
index.mjs(14,7): error TS2339: Property 'mjsSource' does not exist on type 'typeof import("node_modules/inner/index")'.
14-
node_modules/inner/index.d.cts(2,22): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
15-
node_modules/inner/index.d.cts(3,22): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
16-
node_modules/inner/index.d.cts(5,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
17-
node_modules/inner/index.d.mts(2,22): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
18-
node_modules/inner/index.d.mts(3,22): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
19-
node_modules/inner/index.d.mts(5,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
20-
node_modules/inner/index.d.ts(2,22): error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
21-
node_modules/inner/index.d.ts(3,22): error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
22-
node_modules/inner/index.d.ts(5,21): error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
233

244

25-
==== index.js (4 errors) ====
5+
==== index.js (0 errors) ====
266
// esm format file
277
import * as cjs from "package/cjs";
288
import * as mjs from "package/mjs";
@@ -31,22 +11,14 @@ node_modules/inner/index.d.ts(5,21): error TS2307: Cannot find module 'inner/typ
3111
mjs;
3212
type;
3313
import * as cjsi from "inner/a";
34-
~~~~~~~~~
35-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
3614
import * as mjsi from "inner/b";
37-
~~~~~~~~~
38-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
3915
import * as typei from "inner";
4016
import * as ts from "inner/types";
41-
~~~~~~~~~~~~~
42-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
4317
cjsi.mjsSource;
4418
mjsi.mjsSource;
4519
typei.mjsSource;
46-
~~~~~~~~~
47-
!!! error TS2339: Property 'mjsSource' does not exist on type 'typeof import("node_modules/inner/index")'.
4820
ts.mjsSource;
49-
==== index.mjs (4 errors) ====
21+
==== index.mjs (0 errors) ====
5022
// esm format file
5123
import * as cjs from "package/cjs";
5224
import * as mjs from "package/mjs";
@@ -55,22 +27,14 @@ node_modules/inner/index.d.ts(5,21): error TS2307: Cannot find module 'inner/typ
5527
mjs;
5628
type;
5729
import * as cjsi from "inner/a";
58-
~~~~~~~~~
59-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
6030
import * as mjsi from "inner/b";
61-
~~~~~~~~~
62-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
6331
import * as typei from "inner";
6432
import * as ts from "inner/types";
65-
~~~~~~~~~~~~~
66-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
6733
cjsi.mjsSource;
6834
mjsi.mjsSource;
6935
typei.mjsSource;
70-
~~~~~~~~~
71-
!!! error TS2339: Property 'mjsSource' does not exist on type 'typeof import("node_modules/inner/index")'.
7236
ts.mjsSource;
73-
==== index.cjs (5 errors) ====
37+
==== index.cjs (2 errors) ====
7438
// cjs format file
7539
import * as cjs from "package/cjs";
7640
import * as mjs from "package/mjs";
@@ -83,65 +47,41 @@ node_modules/inner/index.d.ts(5,21): error TS2307: Cannot find module 'inner/typ
8347
mjs;
8448
type;
8549
import * as cjsi from "inner/a";
86-
~~~~~~~~~
87-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
8850
import * as mjsi from "inner/b";
89-
~~~~~~~~~
90-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
9151
import * as typei from "inner";
9252
import * as ts from "inner/types";
93-
~~~~~~~~~~~~~
94-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
9553
cjsi.cjsSource;
9654
mjsi.cjsSource;
9755
typei.implicitCjsSource;
9856
ts.cjsSource;
99-
==== node_modules/inner/index.d.ts (3 errors) ====
57+
==== node_modules/inner/index.d.ts (0 errors) ====
10058
// cjs format file
10159
import * as cjs from "inner/a";
102-
~~~~~~~~~
103-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
10460
import * as mjs from "inner/b";
105-
~~~~~~~~~
106-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
10761
import * as type from "inner";
10862
import * as ts from "inner/types";
109-
~~~~~~~~~~~~~
110-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
11163
export { cjs };
11264
export { mjs };
11365
export { type };
11466
export { ts };
11567
export const implicitCjsSource = true;
116-
==== node_modules/inner/index.d.mts (3 errors) ====
68+
==== node_modules/inner/index.d.mts (0 errors) ====
11769
// esm format file
11870
import * as cjs from "inner/a";
119-
~~~~~~~~~
120-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
12171
import * as mjs from "inner/b";
122-
~~~~~~~~~
123-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
12472
import * as type from "inner";
12573
import * as ts from "inner/types";
126-
~~~~~~~~~~~~~
127-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
12874
export { cjs };
12975
export { mjs };
13076
export { type };
13177
export { ts };
13278
export const mjsSource = true;
133-
==== node_modules/inner/index.d.cts (3 errors) ====
79+
==== node_modules/inner/index.d.cts (0 errors) ====
13480
// cjs format file
13581
import * as cjs from "inner/a";
136-
~~~~~~~~~
137-
!!! error TS2307: Cannot find module 'inner/a' or its corresponding type declarations.
13882
import * as mjs from "inner/b";
139-
~~~~~~~~~
140-
!!! error TS2307: Cannot find module 'inner/b' or its corresponding type declarations.
14183
import * as type from "inner";
14284
import * as ts from "inner/types";
143-
~~~~~~~~~~~~~
144-
!!! error TS2307: Cannot find module 'inner/types' or its corresponding type declarations.
14585
export { cjs };
14686
export { mjs };
14787
export { type };
@@ -178,12 +118,13 @@ node_modules/inner/index.d.ts(5,21): error TS2307: Cannot find module 'inner/typ
178118
"./types": {
179119
"types": {
180120
"import": "./index.d.mts",
181-
"require": "./index.d.cts",
121+
"require": "./index.d.cts"
182122
},
183123
"node": {
184124
"import": "./index.mjs",
185125
"require": "./index.cjs"
186126
}
187127
}
188128
}
189-
}
129+
}
130+

testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsConditionalPackageExports(module=node16).js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,16 @@ export const cjsSource = true;
112112
"./types": {
113113
"types": {
114114
"import": "./index.d.mts",
115-
"require": "./index.d.cts",
115+
"require": "./index.d.cts"
116116
},
117117
"node": {
118118
"import": "./index.mjs",
119119
"require": "./index.cjs"
120120
}
121121
}
122122
}
123-
}
123+
}
124+
124125

125126
//// [index.mjs]
126127
// esm format file

0 commit comments

Comments
 (0)