Skip to content

Commit ed2bd1b

Browse files
committed
Merge branch 'main' into ts7-release
# Conflicts: # Herebyfile.mjs
2 parents 6a26a70 + 8873075 commit ed2bd1b

28 files changed

Lines changed: 772 additions & 89 deletions

tsc/.dprint.jsonc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@
5858
// Note: if adding new languages, make sure settings.template.json is updated too.
5959
// Also, if updating typescript, update the one in package.json.
6060
"plugins": [
61-
"https://plugins.dprint.dev/typescript-0.96.1.wasm",
62-
"https://plugins.dprint.dev/json-0.22.0.wasm",
63-
"https://plugins.dprint.dev/g-plane/pretty_yaml-v0.6.0.wasm",
64-
"https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.12.wasm"
61+
"npm:@dprint/typescript@0.96.1",
62+
"npm:@dprint/json@0.22.0",
63+
"npm:dprint-plugin-yaml@0.6.0",
64+
"npm:@jakebailey/dprint-plugin-gofumpt@0.0.13"
6565
]
6666
}

tsc/.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@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
51+
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
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@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
61+
uses: github/codeql-action/autobuild@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
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@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
75+
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,3 @@ jobs:
3636
- run: npm i -g @playwright/mcp@0.0.28
3737
- run: go install golang.org/x/tools/gopls@latest
3838
- run: npm ci
39-
# pull dprint caches before network access is blocked
40-
- run: npx hereby check:format || true

tsc/Herebyfile.mjs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ const options = /** @type {Options} */ (rawOptions);
8888
// package flavor. Main's defaults publish @typescript/native-preview.
8989
const nativePreviewReleaseProfile = /** @type {"native-preview" | "typescript"} */ ("typescript");
9090
const nativePreviewReleaseVersion = /** @type {string | undefined} */ ("7.0.3");
91-
const produceNativePreviewVsix = /** @type {boolean} */ (false);
91+
const produceNativePreviewVsix = /** @type {boolean} */ (true);
92+
const produceTypeScriptNightlyVsix = /** @type {boolean} */ (false);
93+
const produceAnyVsix = produceNativePreviewVsix || produceTypeScriptNightlyVsix;
9294
const publishAsTypescript = nativePreviewReleaseProfile === "typescript";
9395

9496
if (publishAsTypescript && !nativePreviewReleaseVersion) {
9597
throw new Error("Publishing as 'typescript' requires hardcoding nativePreviewReleaseVersion.");
9698
}
9799

98-
if (options.forRelease && !options.setPrerelease && (!nativePreviewReleaseVersion || produceNativePreviewVsix)) {
100+
if (options.forRelease && !options.setPrerelease && (!nativePreviewReleaseVersion || produceAnyVsix)) {
99101
throw new Error("forRelease requires setPrerelease unless nativePreviewReleaseVersion is hardcoded and VSIX production is disabled");
100102
}
101103

@@ -1237,6 +1239,7 @@ function getPublishTag() {
12371239
}
12381240

12391241
const extensionDir = path.resolve("./_extension");
1242+
const nightlyExtensionDir = path.resolve("./_extension-nightly");
12401243
const builtNpm = path.resolve("./built/npm");
12411244
const builtVsix = path.resolve("./built/vsix");
12421245
const builtSignTmp = path.resolve("./built/sign-tmp");
@@ -1489,7 +1492,8 @@ void 0;
14891492

14901493
/** @type {VsixExtensionPackage[]} */
14911494
const vsixExtensionPackages = [
1492-
{ name: "native-preview", sourceDir: extensionDir },
1495+
...(produceNativePreviewVsix ? [{ name: "native-preview", sourceDir: extensionDir }] : []),
1496+
...(produceTypeScriptNightlyVsix ? [{ name: "vscode-typescript-nightly", sourceDir: nightlyExtensionDir }] : []),
14931497
];
14941498

14951499
/**
@@ -1613,7 +1617,7 @@ const getPlatforms = memoize(() => {
16131617

16141618
/** @type {VsixExtension[]} */
16151619
let extensions = [];
1616-
if (produceNativePreviewVsix && vsix) {
1620+
if (produceAnyVsix && vsix) {
16171621
/** @type {string[]} */
16181622
const vscodeTargets = [`${os}-${arch === "arm" ? "armhf" : arch}`];
16191623
if (alpine) {
@@ -1812,6 +1816,22 @@ async function runBuildNativePreviewPackages() {
18121816
inputPackageJson.bin = {
18131817
tsc: "./bin/tsc",
18141818
};
1819+
inputPackageJson.description = "TypeScript is a language for application scale JavaScript development";
1820+
inputPackageJson.homepage = "https://www.typescriptlang.org/";
1821+
inputPackageJson.keywords = [
1822+
"TypeScript",
1823+
"Microsoft",
1824+
"compiler",
1825+
"language",
1826+
"javascript",
1827+
];
1828+
inputPackageJson.bugs = {
1829+
url: "https://github.com/microsoft/TypeScript/issues",
1830+
};
1831+
inputPackageJson.repository = {
1832+
type: "git",
1833+
url: "https://github.com/microsoft/TypeScript.git",
1834+
};
18151835
delete inputPackageJson.scripts;
18161836
delete inputPackageJson.devDependencies;
18171837
}
@@ -1842,6 +1862,7 @@ async function runBuildNativePreviewPackages() {
18421862
await fs.promises.rename(path.join(mainPackageDir, "lib", "tsgo.js"), path.join(mainPackageDir, "lib", "tsc.js"));
18431863
await fs.promises.writeFile(path.join(mainPackageDir, "bin", "tsc"), '#!/usr/bin/env node\nimport "../lib/tsc.js";\n');
18441864
await fs.promises.chmod(path.join(mainPackageDir, "bin", "tsc"), 0o755);
1865+
await fs.promises.copyFile(path.join(inputDir, "typescript-package-readme.md"), path.join(mainPackageDir, "README.md"));
18451866
}
18461867

18471868
await fs.promises.writeFile(path.join(mainPackageDir, "package.json"), JSON.stringify(mainPackage, undefined, 4));
@@ -2191,7 +2212,7 @@ export const nativePreviewRelease = task({
21912212
name: "native-preview:release",
21922213
hiddenFromTaskList: true,
21932214
run: async () => {
2194-
if (!options.forRelease || !options.setPrerelease && (!nativePreviewReleaseVersion || produceNativePreviewVsix)) {
2215+
if (!options.forRelease || !options.setPrerelease && (!nativePreviewReleaseVersion || produceAnyVsix)) {
21952216
throw new Error("native-preview:release requires --forRelease and --setPrerelease flags, unless nativePreviewReleaseVersion is hardcoded and VSIX production is disabled. Example: npx hereby native-preview:release --forRelease --setPrerelease=dev.1.0");
21962217
}
21972218
await runBuildNativePreviewPackages();

tsc/_extension-nightly/LICENSE

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Apache License
2+
3+
Version 2.0, January 2004
4+
5+
http://www.apache.org/licenses/
6+
7+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8+
9+
1. Definitions.
10+
11+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12+
13+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14+
15+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16+
17+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18+
19+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20+
21+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22+
23+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24+
25+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26+
27+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28+
29+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30+
31+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32+
33+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34+
35+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36+
37+
You must give any other recipients of the Work or Derivative Works a copy of this License; and
38+
39+
You must cause any modified files to carry prominent notices stating that You changed the files; and
40+
41+
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42+
43+
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44+
45+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46+
47+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48+
49+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50+
51+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52+
53+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54+
55+
END OF TERMS AND CONDITIONS

tsc/_extension-nightly/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# TypeScript 7 Nightly
2+
3+
VS Code extension that provides the nightly build of TypeScript for the TypeScript 7 extension.
4+
5+
> ⚠️ **You do not need this extension to work with JavaScript and TypeScript in VS Code**.
6+
>
7+
> This extension is **intended for advanced users** who want to test out the latest TypeScript 7 features before they are released. The TypeScript 7 extension includes its own built-in TypeScript version. You do not need this extension for editing JavaScript and TypeScript in VS Code.
8+
>
9+
> Please only install this extension if you understand what it does and are ok trading a potentially less stable experience for testing out new TypeScript language and tooling features early.
10+
11+
## Enabling
12+
13+
If installed, this extension's version of TypeScript will be used by the TypeScript 7 extension. It does not affect workspace versions of TypeScript or custom user `js/ts.tsdk.path` settings.
14+
15+
To make sure you are using TypeScript 7 Nightly:
16+
17+
1. Open a JavaScript or TypeScript file in VS Code.
18+
1. In the VS Code command palette, run the `TypeScript: Select TypeScript Version` command.
19+
1. Make sure you have `Use TypeScript 7` selected.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "vscode-typescript-nightly",
3+
"displayName": "TypeScript 7 Nightly",
4+
"publisher": "TypeScriptTeam",
5+
"description": "%description%",
6+
"private": true,
7+
"version": "0.0.0",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/microsoft/typescript-go"
11+
},
12+
"engines": {
13+
"vscode": "^1.126.0"
14+
},
15+
"extensionKind": [
16+
"workspace"
17+
],
18+
"capabilities": {
19+
"untrustedWorkspaces": {
20+
"supported": true
21+
}
22+
},
23+
"files": [
24+
"lib",
25+
"LICENSE",
26+
"NOTICE.txt",
27+
"README.md",
28+
"package.nls.json"
29+
]
30+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"description": "Nightly build of TypeScript for the TypeScript extension."
3+
}

tsc/_extension/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ You can enable this extension by modifying the following settings:
1818
// TypeScript 7 > Experimental: Use Tsgo
1919
"js/ts.experimental.useTsgo": true,
2020

21-
// Optional: use a local '@typescript/native-preview' package or 'tsgo' binary directory.
22-
"js/ts.tsdk.path": "./node_modules/@typescript/native-preview"
21+
// Optional: use a local TypeScript package directory.
22+
"js/ts.tsdk.path": "./node_modules/typescript"
2323
}
2424
```
2525

tsc/_extension/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,22 @@
174174
"tags": [
175175
"experimental"
176176
]
177+
},
178+
"js/ts.server.showFailedResponses": {
179+
"type": "string",
180+
"enum": [
181+
"always",
182+
"never",
183+
"auto"
184+
],
185+
"enumDescriptions": [
186+
"%native-preview.showFailedResponses.always%",
187+
"%native-preview.showFailedResponses.never%",
188+
"%native-preview.showFailedResponses.auto%"
189+
],
190+
"default": "auto",
191+
"description": "%native-preview.showFailedResponses.description%",
192+
"scope": "window"
177193
}
178194
}
179195
}

0 commit comments

Comments
 (0)