From 2b29c2e39e27d136c498417b2f1def68b1d55ec9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 21:34:35 -0700 Subject: [PATCH 1/9] Bump the github-actions group with 3 updates (#3359) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/CI.yml | 4 ++-- .github/workflows/codeql.yml | 6 +++--- .github/workflows/deploy-preview.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d0ab2171..1da6debc 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: # Verify it compiles - run: pnpm build-site - - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' with: name: site @@ -71,7 +71,7 @@ jobs: - name: Upload diff artifact if: ${{ failure() && steps.check-diff.conclusion == 'failure' }} - uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: missing.patch path: missing.patch diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9c31590c..19488e87 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,7 +44,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 + uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3b174f0d..918fd78b 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -131,7 +131,7 @@ jobs: - name: Download site build from PR if: ${{ steps.get-info.outputs.result != 'null' }} - uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9 + uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1 with: name: site path: site From 9d447358e4fc67c881202fb40115cd8adf70daad Mon Sep 17 00:00:00 2001 From: Yifan Pan Date: Mon, 31 Mar 2025 19:31:55 -0400 Subject: [PATCH 2/9] Update module-reference/Reference.md (#3362) --- packages/documentation/copy/en/modules-reference/Reference.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/documentation/copy/en/modules-reference/Reference.md b/packages/documentation/copy/en/modules-reference/Reference.md index 20fd7adf..082d8918 100644 --- a/packages/documentation/copy/en/modules-reference/Reference.md +++ b/packages/documentation/copy/en/modules-reference/Reference.md @@ -295,6 +295,7 @@ While it’s rare to need to mix imports and require calls in the same file, thi #### Examples ```ts +// @Filename: main.ts import x, { y, z } from "mod"; import mod = require("mod"); const dynamic = import("mod"); @@ -304,6 +305,7 @@ export default "default export"; ``` ```js +// @Filename: main.js import x, { y, z } from "mod"; const mod = require("mod"); const dynamic = import("mod"); From a392d40e3d5e146c10b4c8f89023ef3b21ca1434 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:19:39 -0700 Subject: [PATCH 3/9] Bump github/codeql-action from 3.28.13 to 3.28.15 in the github-actions group (#3366) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 19488e87..d48ed1c2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -44,7 +44,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 with: config-file: ./.github/codeql/codeql-configuration.yml # Override language selection by uncommenting this and choosing your languages @@ -54,7 +54,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below). - name: Autobuild - uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/autobuild@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 # ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -68,4 +68,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13 + uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 From 912791acd5cec95cd262b304af66e33cbc6a9334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Thu, 10 Apr 2025 18:33:31 +0200 Subject: [PATCH 4/9] Fix broken link to module specifier section (#3368) --- packages/documentation/copy/en/modules-reference/Theory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/documentation/copy/en/modules-reference/Theory.md b/packages/documentation/copy/en/modules-reference/Theory.md index 270de633..ddcb5103 100644 --- a/packages/documentation/copy/en/modules-reference/Theory.md +++ b/packages/documentation/copy/en/modules-reference/Theory.md @@ -254,7 +254,7 @@ Remember the three components of TypeScript’s [job](#typescripts-job-concernin 2. Ensure that imports in those **outputs** will **resolve successfully** 3. Know what **type** to assign to **imported names**. -Module resolution is needed to accomplish last two. But when we spend most of our time working in input files, it can be easy to forget about (2)—that a key component of module resolution is validating that the imports or `require` calls in the output files, containing the [same module specifiers as the input files](#module-specifiers-are-not-transformed), will actually work at runtime. Let’s look at a new example with multiple files: +Module resolution is needed to accomplish last two. But when we spend most of our time working in input files, it can be easy to forget about (2)—that a key component of module resolution is validating that the imports or `require` calls in the output files, containing the [same module specifiers as the input files](#module-specifiers-are-not-transformed-by-default), will actually work at runtime. Let’s look at a new example with multiple files: ```ts // @Filename: math.ts @@ -296,7 +296,7 @@ Node.js ESM `import` declarations use a strict module resolution algorithm that ![A flowchart diagram with identical structure to the one above. There are two groups of files: Input files and Output files. src/main.mts (an input file) maps to output file dist/main.mjs, which resolves through module specifier "./math.mjs" to dist/math.mjs (another output file), which maps back to input file src/math.mts.](./diagrams/theory.md-3.svg) -Understanding this mental model may not immediately eliminate the strangeness of seeing output file extensions in input files, and it’s natural to think in terms of shortcuts: _`"./math.mjs"` refers to the input file `math.mts`. I have to write the output extension, but the compiler knows to look for `.mts` when I write `.mjs`._ This shortcut is even how the compiler works internally, but the more robust mental model explains _why_ module resolution in TypeScript works this way: given the constraint that the module specifier in the output file will be [the same](#module-specifiers-are-not-transformed) as the module specifier in the input file, this is the only process that accomplishes our two goals of validating output files and assigning types. +Understanding this mental model may not immediately eliminate the strangeness of seeing output file extensions in input files, and it’s natural to think in terms of shortcuts: _`"./math.mjs"` refers to the input file `math.mts`. I have to write the output extension, but the compiler knows to look for `.mts` when I write `.mjs`._ This shortcut is even how the compiler works internally, but the more robust mental model explains _why_ module resolution in TypeScript works this way: given the constraint that the module specifier in the output file will be [the same](#module-specifiers-are-not-transformed-by-default) as the module specifier in the input file, this is the only process that accomplishes our two goals of validating output files and assigning types. ### The role of declaration files From a1a6517111f87f59533c2f2557d3e7677229585b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 20:24:46 -0700 Subject: [PATCH 5/9] Bump actions/setup-node from 4.3.0 to 4.4.0 in the github-actions group (#3369) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/CI.yml | 4 ++-- .github/workflows/deploy-prod-static.yml | 2 +- .github/workflows/publish-packages.yml | 2 +- .github/workflows/weekly-stats.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1da6debc..8afbb4c1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "18.x" - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 'lts/*' - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 diff --git a/.github/workflows/deploy-prod-static.yml b/.github/workflows/deploy-prod-static.yml index 24801523..de21d355 100644 --- a/.github/workflows/deploy-prod-static.yml +++ b/.github/workflows/deploy-prod-static.yml @@ -30,7 +30,7 @@ jobs: with: # Fetch the full history, to build attribution.json fetch-depth: 0 - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "18.x" diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index c4794e39..e36ab37c 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -21,7 +21,7 @@ jobs: fetch-depth: 0 filter: blob:none token: ${{ secrets.TS_BOT_TOKEN }} - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "18.x" registry-url: "https://registry.npmjs.org/" diff --git a/.github/workflows/weekly-stats.yml b/.github/workflows/weekly-stats.yml index 6e8d2ff8..bd7cb74f 100644 --- a/.github/workflows/weekly-stats.yml +++ b/.github/workflows/weekly-stats.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: "18.x" From 17edf17efd665b95fc5340769475ed5636f63a4e Mon Sep 17 00:00:00 2001 From: Mayada <115709272+Maddily@users.noreply.github.com> Date: Mon, 21 Apr 2025 18:53:53 +0200 Subject: [PATCH 6/9] Fix a typo in "The Basics" document (#3370) --- packages/documentation/copy/en/handbook-v2/Basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/documentation/copy/en/handbook-v2/Basics.md b/packages/documentation/copy/en/handbook-v2/Basics.md index 9375b284..79b870e7 100644 --- a/packages/documentation/copy/en/handbook-v2/Basics.md +++ b/packages/documentation/copy/en/handbook-v2/Basics.md @@ -83,7 +83,7 @@ Or if we were lucky enough to witness the error, we might have ended up doing la Ideally, we could have a tool that helps us find these bugs _before_ our code runs. That's what a static type-checker like TypeScript does. -_Static types systems_ describe the shapes and behaviors of what our values will be when we run our programs. +_Static type systems_ describe the shapes and behaviors of what our values will be when we run our programs. A type-checker like TypeScript uses that information and tells us when things might be going off the rails. ```ts twoslash From fc7677a1310bf73c6bce81857e6416a6009c4471 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 24 Apr 2025 09:33:30 -0700 Subject: [PATCH 7/9] Fix rewriteRelativeImportExtensions oneline (#3373) --- .../documentation/copy/en/project-config/Compiler Options.md | 2 +- .../copy/en/options/rewriteRelativeImportExtensions.md | 4 ++-- packages/tsconfig-reference/scripts/schema/result/schema.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/documentation/copy/en/project-config/Compiler Options.md b/packages/documentation/copy/en/project-config/Compiler Options.md index 4f9f475b..852e58f8 100644 --- a/packages/documentation/copy/en/project-config/Compiler Options.md +++ b/packages/documentation/copy/en/project-config/Compiler Options.md @@ -1279,7 +1279,7 @@ tsc app.ts util.ts --target esnext --outfile index.js -

Does something

+

Rewrite .ts, .tsx, .mts, and .cts file extensions in relative import paths to their JavaScript equivalent in output files.

diff --git a/packages/tsconfig-reference/copy/en/options/rewriteRelativeImportExtensions.md b/packages/tsconfig-reference/copy/en/options/rewriteRelativeImportExtensions.md index 930afacb..20dc9952 100644 --- a/packages/tsconfig-reference/copy/en/options/rewriteRelativeImportExtensions.md +++ b/packages/tsconfig-reference/copy/en/options/rewriteRelativeImportExtensions.md @@ -1,8 +1,8 @@ --- display: "rewriteRelativeImportExtensions" -oneline: "Does something" +oneline: "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files." --- Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files. -For more information, see the [TypeScript 5.7 release notes](/docs/handbook/release-notes/typescript-5-7.html#path-rewriting-for-relative-paths). \ No newline at end of file +For more information, see the [TypeScript 5.7 release notes](/docs/handbook/release-notes/typescript-5-7.html#path-rewriting-for-relative-paths). diff --git a/packages/tsconfig-reference/scripts/schema/result/schema.json b/packages/tsconfig-reference/scripts/schema/result/schema.json index 7f4fd724..a65d8a46 100644 --- a/packages/tsconfig-reference/scripts/schema/result/schema.json +++ b/packages/tsconfig-reference/scripts/schema/result/schema.json @@ -1039,10 +1039,10 @@ "markdownDescription": "Built-in iterators are instantiated with a TReturn type of undefined instead of any.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBuiltinIteratorReturn" }, "rewriteRelativeImportExtensions": { - "description": "Does something", + "description": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.", "type": "boolean", "default": false, - "markdownDescription": "Does something\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions" + "markdownDescription": "Rewrite `.ts`, `.tsx`, `.mts`, and `.cts` file extensions in relative import paths to their JavaScript equivalent in output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions" } } } From 98ce24207d992b2b1a31f5e6b941d946175d48f6 Mon Sep 17 00:00:00 2001 From: Connor Bray Date: Tue, 6 May 2025 23:20:40 -0400 Subject: [PATCH 8/9] fix: mobile styles on documentation page and missing react key (#3380) --- packages/typescriptlang-org/gatsby-ssr.js | 2 +- .../src/templates/documentation.scss | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/typescriptlang-org/gatsby-ssr.js b/packages/typescriptlang-org/gatsby-ssr.js index a82670bf..065df32d 100644 --- a/packages/typescriptlang-org/gatsby-ssr.js +++ b/packages/typescriptlang-org/gatsby-ssr.js @@ -38,5 +38,5 @@ const CustomColorSwitcherCode = () => { } exports.onRenderBody = ({ setPreBodyComponents }) => { - setPreBodyComponents() + setPreBodyComponents() } diff --git a/packages/typescriptlang-org/src/templates/documentation.scss b/packages/typescriptlang-org/src/templates/documentation.scss index 6f3ccb1c..f7e32428 100644 --- a/packages/typescriptlang-org/src/templates/documentation.scss +++ b/packages/typescriptlang-org/src/templates/documentation.scss @@ -48,6 +48,19 @@ flex-direction: row; width: 100%; + aside.handbook-toc { + @media (max-width: $screen-xs) { + padding: 0 0.5rem; + box-sizing: border-box; + } + } + + .whitespace.raised { + width: fill-available; + width: -moz-available; + width: -webkit-fill-available; + } + @media (max-width: 999px) { flex-direction: column; } From 70bf492500c6b2f2296ec28fc0d825d5a98ffd86 Mon Sep 17 00:00:00 2001 From: NotWearingPants <26556598+NotWearingPants@users.noreply.github.com> Date: Thu, 15 May 2025 03:21:49 +0300 Subject: [PATCH 9/9] fix grammar in verbatimModuleSyntax: "an ES modules" (#3382) --- .../tsconfig-reference/copy/en/options/verbatimModuleSyntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tsconfig-reference/copy/en/options/verbatimModuleSyntax.md b/packages/tsconfig-reference/copy/en/options/verbatimModuleSyntax.md index be3cf359..b5bf19b0 100644 --- a/packages/tsconfig-reference/copy/en/options/verbatimModuleSyntax.md +++ b/packages/tsconfig-reference/copy/en/options/verbatimModuleSyntax.md @@ -140,7 +140,7 @@ module.exports = { While this is a limitation, it does help make some issues more obvious. For example, it's very common to forget to set the [`type` field in `package.json`](https://nodejs.org/api/packages.html#type) under `--module node16`. -As a result, developers would start writing CommonJS modules instead of an ES modules without realizing it, giving surprising lookup rules and JavaScript output. +As a result, developers would start writing CommonJS modules instead of ES modules without realizing it, giving surprising lookup rules and JavaScript output. This new flag ensures that you're intentional about the file type you're using because the syntax is intentionally different. Because `--verbatimModuleSyntax` provides a more consistent story than `--importsNotUsedAsValues` and `--preserveValueImports`, those two existing flags are being deprecated in its favor.