Skip to content

Commit 446cca0

Browse files
committed
Merge branch 'main' into guyllian.gomez/yarn-pnp
2 parents 4acc00f + 24753aa commit 446cca0

1,289 files changed

Lines changed: 64713 additions & 36218 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.

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
},
1414
"ghcr.io/devcontainers-extra/features/dprint-asdf:2": {
1515
"version": "latest"
16-
}
16+
},
17+
"ghcr.io/devcontainers/features/github-cli:1": {}
1718
},
1819

1920
// Use 'forwardPorts' to make a list of ports inside the container available locally.

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

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ inputs:
55
go-version:
66
description: Go version to set up in go-install.ps1 format
77
default: 'go1.26'
8-
create:
9-
description: Create the cache
10-
default: 'false'
11-
lint-cache:
12-
description: Restore the golangci-lint cache
13-
default: 'false'
148

159
runs:
1610
using: composite
@@ -54,117 +48,3 @@ runs:
5448
GOBIN="$(go env GOPATH)/bin"
5549
fi
5650
echo "$GOBIN" >> $GITHUB_PATH
57-
58-
# Avoid hardcoding the cache keys more than once.
59-
- name: Get cache info
60-
shell: bash
61-
id: cache-info
62-
env:
63-
MODULES_KEY: go-modules-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
64-
LINT_KEY: golangci-lint-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}-${{ hashFiles('**/go.sum', '**/.custom-gcl.yml') }}
65-
BUILD_KEY: go-build-cache-${{ runner.os }}-msft-${{ steps.install-go.outputs.go-version }}
66-
run: |
67-
echo "modules-key=$MODULES_KEY" >> $GITHUB_OUTPUT
68-
echo "lint-key=$LINT_KEY" >> $GITHUB_OUTPUT
69-
echo "build-key=$BUILD_KEY" >> $GITHUB_OUTPUT
70-
echo "GOLANGCI_LINT_CACHE=$RUNNER_TEMP/golangci-lint-cache" >> $GITHUB_ENV
71-
72-
- if: ${{ inputs.create != 'true' }}
73-
name: Restore Go modules
74-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
75-
with:
76-
key: ${{ steps.cache-info.outputs.modules-key }}
77-
path: |
78-
~/go/pkg/mod
79-
80-
- if: ${{ inputs.create != 'true' }}
81-
name: Restore Go build cache
82-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
83-
with:
84-
key: unused-key-${{ github.run_id }}
85-
restore-keys: ${{ steps.cache-info.outputs.build-key }}-
86-
path: |
87-
~/.cache/go-build
88-
~/Library/Caches/go-build
89-
~/AppData/Local/go-build
90-
91-
- if: ${{ inputs.create != 'true' && inputs.lint-cache == 'true' }}
92-
name: Restore golangci-lint cache
93-
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
94-
with:
95-
key: unused-key-${{ github.run_id }}
96-
restore-keys: ${{ steps.cache-info.outputs.lint-key }}-
97-
path: ${{ env.GOLANGCI_LINT_CACHE }}
98-
99-
- name: Set mtimes
100-
shell: bash
101-
run: |
102-
find . -type f ! -path ./.git/\*\* | go run github.com/slsyy/mtimehash/cmd/mtimehash@v1.0.0 || true
103-
find . -type d ! -path ./.git/\*\* -exec touch -d '1970-01-01T00:00:01Z' {} + || true
104-
105-
# All steps below are only run if the cache is being created.
106-
107-
- if: ${{ inputs.create == 'true' }}
108-
shell: bash
109-
run: npm ci
110-
111-
- if: ${{ inputs.create == 'true' }}
112-
shell: bash
113-
run: |
114-
go mod download
115-
cd _tools
116-
go mod download
117-
118-
- if: ${{ inputs.create == 'true' }}
119-
shell: bash
120-
run: npx hereby build
121-
122-
- if: ${{ inputs.create == 'true' }}
123-
shell: bash
124-
id: setup-go-test
125-
run: npx hereby test
126-
127-
- if: ${{ failure() && inputs.create == 'true' && steps.setup-go-test.conclusion == 'failure' }}
128-
shell: bash
129-
run: git diff --diff-filter=AM --no-index ./testdata/baselines/reference ./testdata/baselines/local
130-
131-
- if: ${{ inputs.create == 'true' }}
132-
shell: bash
133-
run: npx hereby test --coverage
134-
135-
- if: ${{ inputs.create == 'true' }}
136-
shell: bash
137-
run: npx hereby lint
138-
139-
- if: ${{ inputs.create == 'true' }}
140-
shell: bash
141-
run: npx hereby lint --noembed
142-
143-
- if: ${{ inputs.create == 'true' }}
144-
shell: bash
145-
run: npx dprint check
146-
147-
- if: ${{ inputs.create == 'true' }}
148-
name: Save Go modules
149-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
150-
with:
151-
key: ${{ steps.cache-info.outputs.modules-key }}
152-
path: |
153-
~/go/pkg/mod
154-
155-
- if: ${{ inputs.create == 'true' }}
156-
name: Save Go build cache
157-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
158-
with:
159-
key: ${{ steps.cache-info.outputs.build-key }}-${{ github.run_id }}
160-
path: |
161-
~/.cache/go-build
162-
~/Library/Caches/go-build
163-
~/AppData/Local/go-build
164-
165-
- if: ${{ inputs.create == 'true' }}
166-
name: Save golangci-lint cache
167-
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
168-
with:
169-
key: ${{ steps.cache-info.outputs.lint-key }}-${{ github.run_id }}
170-
path: ${{ env.GOLANGCI_LINT_CACHE }}

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176

177177
- run: git add .
178178

179-
- uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
179+
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
180180
if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }}
181181
with:
182182
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
@@ -234,8 +234,6 @@ jobs:
234234
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
235235
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
236236
- uses: ./.github/actions/setup-go
237-
with:
238-
lint-cache: 'true'
239237

240238
# Avoid duplicate PR annotations.
241239
- if: ${{ ! matrix.config.main }}
@@ -282,8 +280,7 @@ jobs:
282280

283281
- run: npx hereby generate
284282
- run: npx hereby generate:enums
285-
- run: npm run -w @typescript/api generate:sync
286-
- run: npm run -w @typescript/ast generate:factory
283+
- run: npx hereby generate:ast
287284

288285
- run: node --experimental-strip-types ./internal/lsp/lsproto/_generate/fetchModel.mts
289286
- run: node --experimental-strip-types ./internal/lsp/lsproto/_generate/generate.mts
@@ -349,10 +346,15 @@ jobs:
349346
runs-on: ubuntu-latest
350347
steps:
351348
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
349+
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
352350
- uses: ./.github/actions/setup-go
353351

352+
- run: npm ci
353+
354354
- run: go -C ./_tools run ./cmd/checkmodpaths $PWD
355355

356+
- run: npx hereby check:scripts
357+
356358
required:
357359
runs-on: ubuntu-latest
358360
if: ${{ always() }}

.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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
51+
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
61+
uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
75+
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ jobs:
2929
with:
3030
node-version: '>=22.16.0'
3131
- uses: ./.github/actions/setup-go
32-
with:
33-
lint-cache: 'true'
3432
- run: npm i -g @playwright/mcp@0.0.28
3533
- run: go install golang.org/x/tools/gopls@latest
3634
- run: npm ci

.github/workflows/create-cache.yml

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

Herebyfile.mjs

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,11 @@ const enumDefs = [
314314
{ name: "SignatureKind", goPrefix: "SignatureKind", goFile: "internal/checker/types.go", outDir: "_packages/api/src/enums" },
315315
{ name: "ElementFlags", goPrefix: "ElementFlags", goFile: "internal/checker/types.go", outDir: "_packages/api/src/enums" },
316316
{ name: "TypePredicateKind", goPrefix: "TypePredicateKind", goFile: "internal/checker/types.go", outDir: "_packages/api/src/enums" },
317+
{ name: "DiagnosticCategory", goPrefix: "Category", goFile: "internal/diagnostics/diagnostics.go", outDir: "_packages/api/src/enums" },
317318
// @typescript/ast enums
318-
{ name: "SyntaxKind", goPrefix: "Kind", goFile: "internal/ast/kind.go", outDir: "_packages/ast/src/enums" },
319+
{ name: "SyntaxKind", goPrefix: "Kind", goFile: "internal/ast/kind_generated.go", outDir: "_packages/ast/src/enums" },
319320
{ name: "NodeFlags", goPrefix: "NodeFlags", goFile: "internal/ast/nodeflags.go", outDir: "_packages/ast/src/enums" },
321+
{ name: "OuterExpressionKinds", goPrefix: "OEK", goFile: "internal/ast/utilities.go", outDir: "_packages/ast/src/enums" },
320322
{ name: "ModifierFlags", goPrefix: "ModifierFlags", goFile: "internal/ast/modifierflags.go", outDir: "_packages/ast/src/enums" },
321323
{ name: "TokenFlags", goPrefix: "TokenFlags", goFile: "internal/ast/tokenflags.go", outDir: "_packages/ast/src/enums", constEnum: true },
322324
];
@@ -435,17 +437,7 @@ function topoSortMembers(members) {
435437
* @returns {string}
436438
*/
437439
function renderEnumTS(def, members) {
438-
const header = [
439-
"//",
440-
"// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
441-
"// !!! THIS FILE IS AUTO-GENERATED — DO NOT EDIT !!!",
442-
"// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
443-
"//",
444-
`// Source: ${def.goFile}`,
445-
"// Regenerate: npx hereby generate:enums",
446-
"//",
447-
"",
448-
].join("\n");
440+
const header = `// Code generated by Herebyfile.mjs generate:enums from ${def.goFile}. DO NOT EDIT.\n\n`;
449441

450442
const constKeyword = def.constEnum ? "const " : "";
451443
const lines = members.map(m => ` ${m.name} = ${m.value},`);
@@ -508,6 +500,12 @@ export const generateEnums = task({
508500
run: runGenerateEnums,
509501
});
510502

503+
export const generateAST = task({
504+
name: "generate:ast",
505+
description: "Generates AST and encoder files from ast.json.",
506+
run: () => $`node --experimental-strip-types --no-warnings ./_scripts/generate.ts`,
507+
});
508+
511509
const coverageDir = path.join(__dirname, "coverage");
512510

513511
const ensureCoverageDirExists = memoize(() => {
@@ -856,6 +854,23 @@ export const checkFormat = task({
856854
},
857855
});
858856

857+
const scriptTsconfigs = [
858+
"./_scripts/tsconfig.json",
859+
"./internal/fourslash/_scripts/tsconfig.json",
860+
"./internal/lsp/lsproto/_generate/tsconfig.json",
861+
];
862+
863+
export const checkScripts = task({
864+
name: "check:scripts",
865+
description: "Type-checks TypeScript scripts.",
866+
run: async () => {
867+
for (const tsconfig of scriptTsconfigs) {
868+
console.log(`Type-checking ${tsconfig}`);
869+
await $`tsc -p ${tsconfig}`;
870+
}
871+
},
872+
});
873+
859874
/**
860875
* @param {string} localBaseline Path to the local copy of the baselines
861876
* @param {string} refBaseline Path to the reference copy of the baselines

NOTICE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,24 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
379379

380380
---------------------------------------------------------
381381

382+
---------------------------------------------------------
383+
384+
github.com/mackerelio/go-osstat v0.2.7 - Apache-2.0
385+
386+
387+
Copyright 2017-2019 Hatena Co., Ltd.
388+
389+
Licensed under the Apache License, Version 2.0 (the "License");
390+
you may not use this file except in compliance with the License.
391+
You may obtain a copy of the License at
392+
393+
http://www.apache.org/licenses/LICENSE-2.0
394+
395+
Unless required by applicable law or agreed to in writing, software
396+
distributed under the License is distributed on an "AS IS" BASIS,
397+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
398+
See the License for the specific language governing permissions and
399+
limitations under the License.
400+
401+
---------------------------------------------------------
402+

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ This is still a work in progress and is not yet at full feature parity with Type
3434
| Type checking | done | Same errors, locations, and messages as TS 6.0. Types printback in errors may display differently. |
3535
| JavaScript-specific inference and JSDoc | in progress | Mostly complete, but intentionally lacking some features. Declaration emit not complete. |
3636
| JSX | done | - |
37-
| Declaration emit | in progress | Most common features are in place, but some edge cases and feature flags are still unhandled. |
38-
| Emit (JS output) | in progress | `target: esnext` well-supported, other targets may have gaps. |
37+
| Declaration emit | in progress | Done for TypeScript files. Not yet complete for JavaScript files. |
38+
| Emit (JS output) | done | - |
3939
| Watch mode | prototype | Watches files and rebuilds, but no incremental rechecking. Not optimized. |
4040
| Build mode / project references | done | - |
4141
| Incremental build | done | - |
42-
| Language service (LSP) | in progress | Most functionality. More features coming soon. |
42+
| Language service (LSP) | in progress | Nearly all features implemented. |
4343
| API | not ready | - |
4444

4545
Definitions:

0 commit comments

Comments
 (0)