You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsConditionalPackageExports(module=node16).errors.txt
+16-33Lines changed: 16 additions & 33 deletions
Original file line number
Diff line number
Diff 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.
11
3
12
4
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) ====
15
6
// esm format file
16
7
import * as cjs from "package/cjs";
17
-
~~~~~~~~~~~~~
18
-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
19
8
import * as mjs from "package/mjs";
20
-
~~~~~~~~~~~~~
21
-
!!! error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
22
9
import * as type from "package";
23
-
~~~~~~~~~
24
-
!!! error TS2307: Cannot find module 'package' or its corresponding type declarations.
25
10
cjs;
26
11
mjs;
27
12
type;
@@ -33,17 +18,11 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
33
18
mjsi.mjsSource;
34
19
typei.mjsSource;
35
20
ts.mjsSource;
36
-
==== index.mjs (3 errors) ====
21
+
==== index.mjs (0 errors) ====
37
22
// esm format file
38
23
import * as cjs from "package/cjs";
39
-
~~~~~~~~~~~~~
40
-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
41
24
import * as mjs from "package/mjs";
42
-
~~~~~~~~~~~~~
43
-
!!! error TS2307: Cannot find module 'package/mjs' or its corresponding type declarations.
44
25
import * as type from "package";
45
-
~~~~~~~~~
46
-
!!! error TS2307: Cannot find module 'package' or its corresponding type declarations.
47
26
cjs;
48
27
mjs;
49
28
type;
@@ -55,17 +34,15 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
55
34
mjsi.mjsSource;
56
35
typei.mjsSource;
57
36
ts.mjsSource;
58
-
==== index.cjs (3 errors) ====
37
+
==== index.cjs (2 errors) ====
59
38
// cjs format file
60
39
import * as cjs from "package/cjs";
61
-
~~~~~~~~~~~~~
62
-
!!! error TS2307: Cannot find module 'package/cjs' or its corresponding type declarations.
63
40
import * as mjs from "package/mjs";
64
41
~~~~~~~~~~~~~
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.
66
43
import * as type from "package";
67
44
~~~~~~~~~
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.
69
46
cjs;
70
47
mjs;
71
48
type;
@@ -78,6 +55,9 @@ index.mjs(4,23): error TS2307: Cannot find module 'package' or its corresponding
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsConditionalPackageExports(module=node16).js
Copy file name to clipboardExpand all lines: testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsConditionalPackageExports(module=node16).js.diff
0 commit comments