Skip to content

Commit 46513b5

Browse files
authored
Merge branch 'main' into fix/1374
2 parents 5f6eb6e + f14b7dd commit 46513b5

File tree

275 files changed

+4778
-13629
lines changed

Some content is hidden

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

275 files changed

+4778
-13629
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Strada to Corsa Port Expert
3+
description: A Go and TypeScript expert who can easily figure out how to port PRs from one language to another
4+
---
5+
6+
This repository is a port of `microsoft/TypeScript` from TypeScript to Go. Since the port began, the following pull request was applied to microsoft/TypeScript. An equivalent change now needs to be applied here. The user will give you a link to the PR and you will need to try to port it to this repo.
7+
8+
Instructions
9+
- Use `curl` to fetch e.g. `https://api.github.com/repos/microsoft/typescript/pulls/59767` to view the merge commit SHA
10+
- Then use `curl` to fetch e.g. `https://github.com/microsoft/TypeScript/commit/bd3d70058c30253209199cc9dfeb85e72330d79b.patch` to download the diff patch
11+
- Use Playwright MCP if you have other information from github you need, since you won't have MCP access to the TypeScript repo
12+
- Apply the edits made in that PR to this codebase, translating them from TypeScript to Go.
13+
- The change may or may not be applicable. It may have already been ported. Do not make any significant changes outside the scope of the diff. If the change cannot be applied without significant out-of-scope changes, explain why and stop working.
14+
- Tip: search for functions and identifiers from the diff to find the right location to apply edits. Some files in microsoft/TypeScript have been split into multiple.
15+
- Tip: some changes have already been ported, like changes to diagnostic message text. Tests do not need to be ported as they are imported from the submodule.
16+
- Check that the code builds by running npx hereby build in the terminal.
17+
- Run tests. It is expected that tests will fail due to baseline changes.
18+
- Run `npx hereby test` in a terminal. They should fail with messages about baseline changes.
19+
- Tip: to run a single baseline test from the submodule, run go test ./internal/testrunner -run '^TestSubmodule/NAME_OF_TEST_FILE'
20+
- Run npx hereby baseline-accept to adopt the baseline changes.
21+
- Run git diff 'testdata/**/*.diff'. If your change is correct, these diff files will be reduced or completely deleted.
22+
- Iterate until you are satisfied with your change. Commit everything, including the baseline changes in testdata, and open a PR.

_submodules/TypeScript

Submodule TypeScript updated 157 files

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

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate.
2-
index.cjs(2,22): error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
3-
index.cjs(3,22): error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
4-
index.cjs(4,23): error TS2307: Cannot find module 'package' or its corresponding type declarations.
5-
index.js(2,22): error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
6-
index.js(3,22): error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
7-
index.js(4,23): error TS2307: Cannot find module 'package' or its corresponding type declarations.
8-
index.mjs(2,22): error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
9-
index.mjs(3,22): error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
10-
index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding type declarations.
1+
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.
2+
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.
113

124

13-
!!! error TS2209: The project root is ambiguous, but is required to resolve export map entry '.' in file 'package.json'. Supply the `rootDir` compiler option to disambiguate.
14-
==== index.js (3 errors) ====
5+
==== index.js (0 errors) ====
156
// esm format file
167
import * as cjs from "package/cjs";
17-
~~~~~~~~~~~~~
18-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
198
import * as mjs from "package/mjs";
20-
~~~~~~~~~~~~~
21-
!!! error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
229
import * as type from "package";
23-
~~~~~~~~~
24-
!!! error TS2307: Cannot find module 'package' or its corresponding type declarations.
2510
cjs;
2611
mjs;
2712
type;
@@ -33,17 +18,11 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
3318
mjsi.mjsSource;
3419
typei.mjsSource;
3520
ts.mjsSource;
36-
==== index.mjs (3 errors) ====
21+
==== index.mjs (0 errors) ====
3722
// esm format file
3823
import * as cjs from "package/cjs";
39-
~~~~~~~~~~~~~
40-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
4124
import * as mjs from "package/mjs";
42-
~~~~~~~~~~~~~
43-
!!! error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
4425
import * as type from "package";
45-
~~~~~~~~~
46-
!!! error TS2307: Cannot find module 'package' or its corresponding type declarations.
4726
cjs;
4827
mjs;
4928
type;
@@ -55,17 +34,15 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
5534
mjsi.mjsSource;
5635
typei.mjsSource;
5736
ts.mjsSource;
58-
==== index.cjs (3 errors) ====
37+
==== index.cjs (2 errors) ====
5938
// cjs format file
6039
import * as cjs from "package/cjs";
61-
~~~~~~~~~~~~~
62-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
6340
import * as mjs from "package/mjs";
6441
~~~~~~~~~~~~~
65-
!!! error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
42+
!!! 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.
6643
import * as type from "package";
6744
~~~~~~~~~
68-
!!! error TS2307: Cannot find module 'package' or its corresponding type declarations.
45+
!!! 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.
6946
cjs;
7047
mjs;
7148
type;
@@ -78,6 +55,9 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
7855
typei.implicitCjsSource;
7956
ts.cjsSource;
8057
==== node_modules/inner/index.d.ts (0 errors) ====
58+
// cjs format file
59+
export const implicitCjsSource = true;
60+
==== node_modules/inner/test.d.ts (0 errors) ====
8161
// cjs format file
8262
import * as cjs from "inner/a";
8363
import * as mjs from "inner/b";
@@ -87,8 +67,10 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
8767
export { mjs };
8868
export { type };
8969
export { ts };
90-
export const implicitCjsSource = true;
9170
==== node_modules/inner/index.d.mts (0 errors) ====
71+
// esm format file
72+
export const mjsSource = true;
73+
==== node_modules/inner/test.d.mts (0 errors) ====
9274
// esm format file
9375
import * as cjs from "inner/a";
9476
import * as mjs from "inner/b";
@@ -98,8 +80,10 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
9880
export { mjs };
9981
export { type };
10082
export { ts };
101-
export const mjsSource = true;
10283
==== node_modules/inner/index.d.cts (0 errors) ====
84+
// cjs format file
85+
export const cjsSource = true;
86+
==== node_modules/inner/test.d.cts (0 errors) ====
10387
// cjs format file
10488
import * as cjs from "inner/a";
10589
import * as mjs from "inner/b";
@@ -109,7 +93,6 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
10993
export { mjs };
11094
export { type };
11195
export { ts };
112-
export const cjsSource = true;
11396
==== package.json (0 errors) ====
11497
{
11598
"name": "package",

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

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,43 @@ typei.implicitCjsSource;
5050
ts.cjsSource;
5151
//// [index.d.ts]
5252
// cjs format file
53+
export const implicitCjsSource = true;
54+
//// [test.d.ts]
55+
// cjs format file
5356
import * as cjs from "inner/a";
5457
import * as mjs from "inner/b";
5558
import * as type from "inner";
5659
import * as ts from "inner/types";
5760
export { cjs };
5861
export { mjs };
5962
export { type };
60-
export { ts };
61-
export const implicitCjsSource = true;
63+
export { ts };
6264
//// [index.d.mts]
6365
// esm format file
66+
export const mjsSource = true;
67+
//// [test.d.mts]
68+
// esm format file
6469
import * as cjs from "inner/a";
6570
import * as mjs from "inner/b";
6671
import * as type from "inner";
6772
import * as ts from "inner/types";
6873
export { cjs };
6974
export { mjs };
7075
export { type };
71-
export { ts };
72-
export const mjsSource = true;
76+
export { ts };
7377
//// [index.d.cts]
7478
// cjs format file
79+
export const cjsSource = true;
80+
//// [test.d.cts]
81+
// cjs format file
7582
import * as cjs from "inner/a";
7683
import * as mjs from "inner/b";
7784
import * as type from "inner";
7885
import * as ts from "inner/types";
7986
export { cjs };
8087
export { mjs };
8188
export { type };
82-
export { ts };
83-
export const cjsSource = true;
89+
export { ts };
8490
//// [package.json]
8591
{
8692
"name": "package",
@@ -123,22 +129,6 @@ export const cjsSource = true;
123129
}
124130

125131

126-
//// [index.js]
127-
// esm format file
128-
import * as cjs from "package/cjs";
129-
import * as mjs from "package/mjs";
130-
import * as type from "package";
131-
cjs;
132-
mjs;
133-
type;
134-
import * as cjsi from "inner/a";
135-
import * as mjsi from "inner/b";
136-
import * as typei from "inner";
137-
import * as ts from "inner/types";
138-
cjsi.mjsSource;
139-
mjsi.mjsSource;
140-
typei.mjsSource;
141-
ts.mjsSource;
142132
//// [index.mjs]
143133
// esm format file
144134
import * as cjs from "package/cjs";
@@ -206,11 +196,27 @@ cjsi.cjsSource;
206196
mjsi.cjsSource;
207197
typei.implicitCjsSource;
208198
ts.cjsSource;
199+
//// [index.js]
200+
// esm format file
201+
import * as cjs from "package/cjs";
202+
import * as mjs from "package/mjs";
203+
import * as type from "package";
204+
cjs;
205+
mjs;
206+
type;
207+
import * as cjsi from "inner/a";
208+
import * as mjsi from "inner/b";
209+
import * as typei from "inner";
210+
import * as ts from "inner/types";
211+
cjsi.mjsSource;
212+
mjsi.mjsSource;
213+
typei.mjsSource;
214+
ts.mjsSource;
209215

210216

211-
//// [index.d.ts]
212-
export {};
213217
//// [index.d.mts]
214218
export {};
215219
//// [index.d.cts]
216220
export {};
221+
//// [index.d.ts]
222+
export {};

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

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

0 commit comments

Comments
 (0)