Skip to content

Commit cb55a08

Browse files
Merge branch 'upstream/main' into escape-sequence
2 parents 8fa60d8 + 700452d commit cb55a08

File tree

3,180 files changed

+369471
-234834
lines changed

Some content is hidden

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

3,180 files changed

+369471
-234834
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.js linguist-language=TypeScript
2+
**/*.json linguist-language=jsonc
23
* -text

.github/workflows/ci.yml

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

1717
strategy:
1818
matrix:
19-
# Test the latest version of Node.js plus the last two LTS versions.
2019
node-version:
21-
- "*"
22-
- lts/*
23-
- lts/-1
20+
- "19"
21+
- "18"
22+
- "16"
23+
- "14"
2424
bundle:
2525
- "true"
2626
include:

Herebyfile.mjs

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { task } from "hereby";
66
import _glob from "glob";
77
import util from "util";
88
import chalk from "chalk";
9+
import fsExtra from "fs-extra";
910
import { Debouncer, Deferred, exec, getDiffTool, getDirSize, memoize, needsUpdate, readJson } from "./scripts/build/utils.mjs";
1011
import { localBaseline, localRwcBaseline, refBaseline, refRwcBaseline, runConsoleTests } from "./scripts/build/tests.mjs";
1112
import { buildProject, cleanProject, watchProject } from "./scripts/build/projects.mjs";
@@ -162,7 +163,7 @@ async function runDtsBundler(entrypoint, output) {
162163
* @typedef BundlerTaskOptions
163164
* @property {boolean} [exportIsTsObject]
164165
* @property {boolean} [treeShaking]
165-
* @property {esbuild.WatchMode} [watchMode]
166+
* @property {() => void} [onWatchRebuild]
166167
*/
167168
function createBundler(entrypoint, outfile, taskOptions = {}) {
168169
const getOptions = memoize(async () => {
@@ -219,7 +220,30 @@ function createBundler(entrypoint, outfile, taskOptions = {}) {
219220

220221
return {
221222
build: async () => esbuild.build(await getOptions()),
222-
watch: async () => esbuild.build({ ...await getOptions(), watch: taskOptions.watchMode ?? true, logLevel: "info" }),
223+
watch: async () => {
224+
/** @type {esbuild.BuildOptions} */
225+
const options = { ...await getOptions(), logLevel: "info" };
226+
if (taskOptions.onWatchRebuild) {
227+
const onRebuild = taskOptions.onWatchRebuild;
228+
options.plugins = (options.plugins?.slice(0) ?? []).concat([{
229+
name: "watch",
230+
setup: (build) => {
231+
let firstBuild = true;
232+
build.onEnd(() => {
233+
if (firstBuild) {
234+
firstBuild = false;
235+
}
236+
else {
237+
onRebuild();
238+
}
239+
});
240+
}
241+
}]);
242+
}
243+
244+
const ctx = await esbuild.context(options);
245+
ctx.watch();
246+
},
223247
};
224248
}
225249

@@ -425,10 +449,8 @@ const { main: tests, watch: watchTests } = entrypointBuildTask({
425449
bundlerOptions: {
426450
// Ensure we never drop any dead code, which might be helpful while debugging.
427451
treeShaking: false,
428-
watchMode: {
429-
onRebuild() {
430-
watchTestsEmitter.emit("rebuild");
431-
}
452+
onWatchRebuild() {
453+
watchTestsEmitter.emit("rebuild");
432454
}
433455
},
434456
});
@@ -818,13 +840,6 @@ export const lkg = task({
818840
dependencies: [produceLKG],
819841
});
820842

821-
export const generateSpec = task({
822-
name: "generate-spec",
823-
description: "Generates a Markdown version of the Language Specification",
824-
hiddenFromTaskList: true,
825-
run: () => exec("cscript", ["//nologo", "scripts/word2md.mjs", path.resolve("doc/TypeScript Language Specification - ARCHIVED.docx"), path.resolve("doc/spec-ARCHIVED.md")]),
826-
});
827-
828843
export const cleanBuilt = task({
829844
name: "clean-built",
830845
hiddenFromTaskList: true,
@@ -861,3 +876,14 @@ export const help = task({
861876
hiddenFromTaskList: true,
862877
run: () => exec("hereby", ["--tasks"], { hidePrompt: true }),
863878
});
879+
880+
export const bumpLkgToNightly = task({
881+
name: "bump-lkg-to-nightly",
882+
description: "Bumps typescript in package.json to the latest nightly and copies it to LKG.",
883+
run: async () => {
884+
await exec("npm", ["install", "--save-dev", "--save-exact", "typescript@next"]);
885+
await fs.promises.rm("lib", { recursive: true, force: true });
886+
await fsExtra.copy("node_modules/typescript/lib", "lib");
887+
await fs.promises.writeFile("lib/.gitattributes", "* text eol=lf");
888+
}
889+
});

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob
3333
* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
3434
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
3535
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
36-
* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
37-
[pdf](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)).
3836

3937
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
4038
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)

doc/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

doc/handbook/README.md

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

doc/images/image1.png

-11.4 KB
Binary file not shown.

doc/images/image2.png

-10 KB
Binary file not shown.

doc/images/image3.png

-5.86 KB
Binary file not shown.

doc/images/image4.png

-15.7 KB
Binary file not shown.

doc/logo.svg

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

0 commit comments

Comments
 (0)