Skip to content

Commit 8e79c4f

Browse files
committed
Merge branch 'main' into guyllian.gomez/yarn-pnp
2 parents fb1dc16 + 515d036 commit 8e79c4f

1,405 files changed

Lines changed: 19124 additions & 5523 deletions

File tree

Some content is hidden

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

.dprint.jsonc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@
5151
"internal/lsp/lsproto/_generate/*.json",
5252
"internal/lsp/lsproto/_generate/metaModelSchema.mts",
5353
// Needs to be LF to have a working shebang.
54-
"_packages/native-preview/bin/tsgo.js"
54+
"_packages/native-preview/bin/tsgo.js",
55+
"_packages/native-preview/vendor/**"
5556
],
5657
// Note: if adding new languages, make sure settings.template.json is updated too.
5758
// Also, if updating typescript, update the one in package.json.
5859
"plugins": [
5960
"https://plugins.dprint.dev/typescript-0.95.15.wasm",
60-
"https://plugins.dprint.dev/json-0.21.1.wasm",
61+
"https://plugins.dprint.dev/json-0.21.3.wasm",
6162
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm",
62-
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.7.wasm"
63+
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.8.wasm"
6364
]
6465
}

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
swap-storage: false
3232
dotnet: false
3333
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
34+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
3535
- uses: ./.github/actions/setup-go
3636

3737
# Avoid duplicate PR annotations.
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: TypeScript-1ES-GitHub-XL-2
5252
steps:
5353
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
54+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
5555
with:
5656
node-version: 'lts/*'
5757
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
steps:
7575
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
76-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
76+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7777

7878
- run: npm ci
7979

@@ -140,7 +140,7 @@ jobs:
140140
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
141141
with:
142142
submodules: ${{ !matrix.config.no-submodules }}
143-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
143+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
144144
with:
145145
node-version: 'lts/*'
146146
- uses: ./.github/actions/setup-go
@@ -232,7 +232,7 @@ jobs:
232232
swap-storage: false
233233
dotnet: false
234234
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
235-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
235+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
236236
- uses: ./.github/actions/setup-go
237237

238238
# Avoid duplicate PR annotations.
@@ -249,10 +249,10 @@ jobs:
249249
- run: npx hereby lint
250250

251251
format:
252-
runs-on: ubuntu-latest
252+
runs-on: ubuntu-slim
253253
steps:
254254
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
255-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
255+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
256256
- uses: ./.github/actions/setup-go
257257

258258
- run: npm ci
@@ -271,7 +271,7 @@ jobs:
271271
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
272272
with:
273273
submodules: true
274-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
274+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
275275
with:
276276
node-version: '>=22.16.0'
277277
- uses: ./.github/actions/setup-go
@@ -301,7 +301,7 @@ jobs:
301301
- run: git diff --staged --exit-code --stat
302302

303303
tidy:
304-
runs-on: ubuntu-latest
304+
runs-on: ubuntu-slim
305305
steps:
306306
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
307307
- uses: ./.github/actions/setup-go
@@ -321,7 +321,7 @@ jobs:
321321
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
322322
with:
323323
submodules: true
324-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
324+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
325325
- uses: ./.github/actions/setup-go
326326

327327
# Avoid duplicate PR annotations.
@@ -346,7 +346,7 @@ jobs:
346346
runs-on: ubuntu-latest
347347
steps:
348348
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
349-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
349+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
350350
- uses: ./.github/actions/setup-go
351351

352352
- run: npm ci
@@ -356,7 +356,7 @@ jobs:
356356
- run: npx hereby check:scripts
357357

358358
required:
359-
runs-on: ubuntu-latest
359+
runs-on: ubuntu-slim
360360
if: ${{ always() }}
361361
needs:
362362
- build

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Initializes the CodeQL tools for scanning.
5050
- name: Initialize CodeQL
51-
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
51+
uses: github/codeql-action/init@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
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@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
61+
uses: github/codeql-action/autobuild@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
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@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
75+
uses: github/codeql-action/analyze@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2626
with:
2727
submodules: true
28-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
28+
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
2929
with:
3030
node-version: '>=22.16.0'
3131
- uses: ./.github/actions/setup-go

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ custom-gcl.hash
194194
.idea
195195

196196
!testdata/submoduleAccepted.txt
197+
!testdata/submoduleTriaged.txt
197198

198199
!NOTICE.txt
199200

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ linters:
6565
customlint:
6666
type: module
6767

68+
modernize:
69+
disable:
70+
- slicesbackward # https://github.com/golang/go/issues/78829
71+
6872
depguard:
6973
rules:
7074
main:

.vscode/launch.template.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@
6161
"-testDir",
6262
"path_to_project_dir"
6363
]
64+
},
65+
{
66+
"name": "Launch tsgo CLI",
67+
"type": "go",
68+
"request": "launch",
69+
"mode": "debug",
70+
"program": "${workspaceFolder}/cmd/tsgo",
71+
"cwd": "${workspaceFolder}",
72+
"args": "${input:tsgoArgs}"
73+
},
74+
{
75+
"name": "Attach to Go process",
76+
"type": "go",
77+
"request": "attach",
78+
"mode": "local",
79+
"processId": "${command:pickGoProcess}"
80+
}
81+
],
82+
"inputs": [
83+
{
84+
"id": "tsgoArgs",
85+
"type": "promptString",
86+
"description": "Enter arguments for tsgo"
6487
}
6588
]
6689
}

CHANGES.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ function f() {}
2828
f.called = false;
2929
```
3030

31+
## Declaration Emit
32+
33+
We've fundamentally rewritten core parts of the declaration emit *and* JavaScript parsing components.
34+
As a result, declaration (`.d.ts`) emit based on `.js` input files has substantially changed behavior.
35+
While it's still expected that supported tags (see below) are emitted with correct semantics in Corsa, it's a non-goal to exactly match Strada's output.
36+
37+
This also has effects on how `.d.ts` is emitted in the presence of errors, which tends to be more common in `.js` and JSDoc scenarios.
38+
Declaration file generation isn't well-defined in the presence of errors (including those suppressed with `ts-ignore`/`ts-expect-error`), and you can expect Corsa and Strada to be quite different depending on the situation.
39+
40+
However, if you see **_incorrect_** `.d.ts` output from a `.js` file, **please file an issue**.
41+
3142
## JSDoc Tags and Types
3243

3344
| Name | Example | Substitute | Note |
@@ -123,18 +134,6 @@ function f(x) {
123134
f(); // Still allowed
124135
```
125136

126-
#### Strada's JS-specific rules for inferring type arguments no longer apply in Corsa.
127-
128-
Inferred type arguments may change. For example:
129-
130-
```js
131-
/** @type {any} */
132-
var x = { a: 1, b: 2 };
133-
var entries = Object.entries(x);
134-
```
135-
136-
In Strada, `entries: Array<[string, any]>`. In Corsa it has type `Array<[string, unknown]>`, the same as in TypeScript.
137-
138137
#### Values are no longer resolved as types in JSDoc type positions.
139138

140139
```js
@@ -346,3 +345,7 @@ exports.foo = exports.bar = void 0;
346345
exports.foo = 123 // Exported type is `123`
347346
exports.bar = "abc" // Exported type is `"abc"`
348347
```
348+
349+
#### Mixing module.exports assignments
350+
351+
Corsa does not permit CommonJS modules to mix assignments to the full `module.exports` with assignments to `module.exports.xxx` properties. A CommonJS module must either contain an assignment to `module.exports` or a series of assignments to `module.exports.xxx` properties, but not both.

0 commit comments

Comments
 (0)