Skip to content

Commit 7a0bf26

Browse files
authored
Merge pull request #2 from arcanis/guyllian.gomez/yarn-pnp-support
Merge upstream
2 parents 53c7edc + 545e075 commit 7a0bf26

File tree

14,884 files changed

+250733
-512343
lines changed

Some content is hidden

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

14,884 files changed

+250733
-512343
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json
22

3-
version: v2.3.0
3+
version: v2.4.0
44

55
destination: ./_tools
66

.dprint.jsonc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"cwd": "${configDir}",
4242
"cacheKey": "4",
4343
"commands": [
44-
{ "command": "go tool mvdan.cc/gofumpt -lang=go1.24", "exts": ["go"] }
44+
{ "command": "go tool mvdan.cc/gofumpt -lang=go1.25", "exts": ["go"] }
4545
]
4646
},
4747
"excludes": [
@@ -59,7 +59,7 @@
5959
// Note: if adding new languages, make sure settings.template.json is updated too.
6060
// Also, if updating typescript, update the one in package.json.
6161
"plugins": [
62-
"https://plugins.dprint.dev/typescript-0.95.8.wasm",
62+
"https://plugins.dprint.dev/typescript-0.95.9.wasm",
6363
"https://plugins.dprint.dev/json-0.20.0.wasm",
6464
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.5.1.wasm",
6565
"https://plugins.dprint.dev/exec-0.5.1.json@492414e39dea4dccc07b4af796d2f4efdb89e84bae2bd4e1e924c0cc050855bf"

.github/actions/setup-go/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Setup Go
44
inputs:
55
go-version:
66
description: Go version range to set up.
7-
default: '>=1.24.0'
7+
default: '>=1.25.0'
88
create:
99
description: Create the cache
1010
default: 'false'
@@ -89,8 +89,13 @@ runs:
8989

9090
- if: ${{ inputs.create == 'true' }}
9191
shell: bash
92+
id: setup-go-test
9293
run: npx hereby test
9394

95+
- if: ${{ failure() && inputs.create == 'true' && steps.setup-go-test.conclusion == 'failure' }}
96+
shell: bash
97+
run: git diff --diff-filter=AM --no-index ./testdata/baselines/reference ./testdata/baselines/local
98+
9499
- if: ${{ inputs.create == 'true' }}
95100
shell: bash
96101
run: npx hereby test --coverage

.github/copilot-instructions.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ Most of our development takes place in the `internal` directory, and most behavi
99

1010
Most development on the codebase is in Go.
1111
Standard Go commands and practices apply, but we primarily use a tool called `hereby` to build, run tests, and other tasks.
12-
Run `npx hereby --list` to see all available commands.
12+
Run `npx hereby --tasks` to see all available commands.
1313

1414
```sh
15-
npx hereby build # Build the project
15+
npx hereby build # Build the tsgo binary (not required for tests)
1616
npx hereby test # Run tests
1717
npx hereby format # Format the code
1818
npx hereby lint # Run linters
1919

2020
# To run a specific compiler test:
21-
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For submodule tests in _submodules/TypeScript
22-
go test -run='TestLocal/<test name>' ./internal/testrunner # For local tests in testdata/tests/cases
21+
go test -run='TestSubmodule/<test name>' ./internal/testrunner # For pre-existing "submodule" tests in _submodules/TypeScript
22+
go test -run='TestLocal/<test name>' ./internal/testrunner # For new "local" tests created in testdata/tests/cases
2323
```
2424

25-
Always make sure code is formatted, linted, and tested before sending a pull request.
26-
25+
Always make sure code is formatted, linted, and tested before sending a pull request.
26+
2727
## Compiler Features, Fixes, and Tests
2828

2929
When fixing a bug or implementing a new feature, at least one minimal test case should always be added in advance to verify the fix.
@@ -56,10 +56,10 @@ export interface Person {
5656
function greet(person) {
5757
console.log(`Hello, ${person.name}!`);
5858
}
59-
```
60-
61-
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62-
59+
```
60+
61+
**New compiler tests should always enable strict mode (`@strict: true`) unless the bug specifically involves non-strict mode behavior.**
62+
6363
Tests don't always need the above `@option`s specified, but they are common to specify or modify.
6464
Tests can be run with multiple settings for a given option by using a comma-separated list (e.g. `@option: settingA,settingB`).
6565
`@filename` is only required when a test has multiple files, or when writing a test for a single JavaScript file (where `allowJs` or `checkJs` is enabled).

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
build:
2525
runs-on: ubuntu-latest
2626
steps:
27-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2828
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2929
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
3030
- uses: ./.github/actions/setup-go
@@ -44,7 +44,7 @@ jobs:
4444
extension:
4545
runs-on: ubuntu-latest
4646
steps:
47-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
47+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4949
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
5050

@@ -102,7 +102,7 @@ jobs:
102102
- run: git config --system core.longpaths true
103103
if: ${{ matrix.config.os == 'windows-latest' }}
104104

105-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
105+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
106106
with:
107107
submodules: ${{ !matrix.config.no-submodules }}
108108
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -191,7 +191,7 @@ jobs:
191191
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
192192

193193
steps:
194-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
194+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
195195
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
196196
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
197197
- uses: ./.github/actions/setup-go
@@ -214,7 +214,7 @@ jobs:
214214
format:
215215
runs-on: ubuntu-latest
216216
steps:
217-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
217+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
218218
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
219219
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
220220
- uses: ./.github/actions/setup-go
@@ -226,7 +226,7 @@ jobs:
226226
generate:
227227
runs-on: ubuntu-latest
228228
steps:
229-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
229+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
230230
with:
231231
submodules: true
232232
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -251,7 +251,7 @@ jobs:
251251
tidy:
252252
runs-on: ubuntu-latest
253253
steps:
254-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
254+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
255255
- uses: ./.github/actions/setup-go
256256

257257
- run: go mod tidy -diff
@@ -260,7 +260,7 @@ jobs:
260260
smoke:
261261
runs-on: ubuntu-latest
262262
steps:
263-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
263+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
264264
with:
265265
submodules: true
266266
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
@@ -288,15 +288,15 @@ jobs:
288288
misc:
289289
runs-on: ubuntu-latest
290290
steps:
291-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
291+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
292292
- uses: ./.github/actions/setup-go
293293

294294
- run: go -C ./_tools run ./cmd/checkmodpaths $PWD
295295

296296
baselines:
297297
runs-on: ubuntu-latest
298298
steps:
299-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
299+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
300300
with:
301301
submodules: true
302302
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444

4545
steps:
4646
- name: Checkout repository
47-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
47+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
51+
uses: github/codeql-action/init@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5
5252
with:
5353
config-file: ./.github/codeql/codeql-configuration.yml
5454
# Override language selection by uncommenting this and choosing your languages
@@ -58,7 +58,7 @@ jobs:
5858
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5959
# If this step fails, then you should remove it and run the build manually (see below).
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
61+
uses: github/codeql-action/autobuild@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
7272
# make release
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@76621b61decf072c1cee8dd1ce2d2a82d33c17ed # v3.29.5
75+
uses: github/codeql-action/analyze@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,13 @@ jobs:
1616
# You can define any steps you want, and they will run before the agent starts.
1717
# If you do not check out your code, Copilot will do this for you.
1818
steps:
19-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
19+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2020
with:
2121
submodules: true
2222
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2323
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
2424
- uses: ./.github/actions/setup-go
2525
with:
26-
# Updated to 1.25.0-rc.1 to improve compilation time
27-
go-version: '>=1.25.0-rc.1'
2826
lint-cache: 'true'
2927
- run: npm i -g @playwright/[email protected]
3028
- run: npm ci

.github/workflows/create-cache.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ jobs:
2828
- windows-latest
2929
- macos-latest
3030
go-version:
31-
- '>=1.24.0'
32-
33-
include:
34-
# Temporary for the Copilot setup steps
35-
- os: ubuntu-latest
36-
go-version: '>=1.25.0-rc.1'
31+
- '>=1.25.0'
3732

3833
runs-on: ${{ matrix.os }}
3934

4035
steps:
4136
- run: git config --system core.longpaths true
4237
if: ${{ matrix.os == 'windows-latest' }}
4338

44-
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
39+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4540
with:
4641
submodules: true
4742
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
## How to Build and Run
4+
5+
This repo uses [Go 1.25 or higher](https://go.dev/dl/), [Rust 1.85 or higher](https://www.rust-lang.org/tools/install), [Node.js with npm](https://nodejs.org/), and [`hereby`](https://www.npmjs.com/package/hereby).
6+
7+
For tests and code generation, this repo contains a git submodule to the main TypeScript repo pointing to the commit being ported.
8+
When cloning, you'll want to clone with submodules:
9+
10+
```sh
11+
git clone --recurse-submodules https://github.com/microsoft/typescript-go.git
12+
```
13+
14+
If you have already cloned the repo, you can initialize the submodule with:
15+
16+
```sh
17+
git submodule update --init --recursive
18+
```
19+
20+
With the submodule in place and `npm ci`, you can run tasks via `hereby`, similar to the TypeScript repo:
21+
22+
```sh
23+
hereby build # Build the tsgo binary (not required for tests)
24+
hereby test # Run tests
25+
hereby format # Format the code
26+
hereby lint # Run linters
27+
hereby install-tools # Install additional tools such as linters
28+
hereby generate # Generate all Go code (e.g. diagnostics, committed to repo)
29+
```
30+
31+
Additional tasks are a work in progress.
32+
33+
`hereby` is not required to work on the repo; the regular `go` tooling (e.g., `go build`, `go test ./...`) will work as expected.
34+
`hereby` tasks are provided as a convenience for those familiar with the TypeScript repo.
35+
36+
### Running `tsgo`
37+
38+
After running `hereby build`, you can run `built/local/tsgo`, which behaves mostly the same as `tsc`.
39+
40+
### LSP Server
41+
42+
To debug and run the VS Code extension without installing it globally:
43+
44+
* Run VS Code in the repo workspace (`code .`)
45+
* Copy `.vscode/launch.template.json` to `.vscode/launch.json`
46+
* <kbd>F5</kbd> (or `Debug: Start Debugging` from the command palette)
47+
48+
This will launch a new VS Code instance which uses the Corsa LS as the backend. If correctly set up, you should see "tsgo" in the status bar when a TypeScript or JavaScript file is open:
49+
50+
![LSP Server Screenshot](.github/ls-screenshot.png)

0 commit comments

Comments
 (0)