From ce2f2e949641730c0f24993471ab9caf216c02bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:08:25 +0000 Subject: [PATCH 1/4] Bump the github-actions group across 1 directory with 2 updates (#3194) 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-prod-static.yml | 2 +- .github/workflows/publish-packages.yml | 2 +- .github/workflows/weekly-stats.yml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e25d73e7..4997bddb 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: "18.x" - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: 'lts/*' - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f50c5c80..fbb1e903 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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 + uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 + uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.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@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11 + uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 diff --git a/.github/workflows/deploy-prod-static.yml b/.github/workflows/deploy-prod-static.yml index b69e097e..863ceb01 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@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: "18.x" diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index ebee60e4..d6a0a186 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.GITHUB_BOT_TOKEN }} - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 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 124d3e0c..9c1ba0c3 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 with: node-version: "18.x" From 1d0af97318b79943fe0bfa8871ee6e8c584c9af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= <9092381+Renegade334@users.noreply.github.com> Date: Tue, 30 Jul 2024 01:37:05 +0100 Subject: [PATCH 2/4] ATA: `node:` module resolution (#3191) Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> --- .changeset/plenty-deers-visit.md | 5 +++++ packages/ata/src/edgeCases.ts | 3 ++- packages/ata/tests/edgeCases.spec.ts | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/plenty-deers-visit.md diff --git a/.changeset/plenty-deers-visit.md b/.changeset/plenty-deers-visit.md new file mode 100644 index 00000000..e9963003 --- /dev/null +++ b/.changeset/plenty-deers-visit.md @@ -0,0 +1,5 @@ +--- +"@typescript/ata": patch +--- + +Always treat `node:` modules as Node, expand list of known Node modules diff --git a/packages/ata/src/edgeCases.ts b/packages/ata/src/edgeCases.ts index 5bc0a931..a3399078 100644 --- a/packages/ata/src/edgeCases.ts +++ b/packages/ata/src/edgeCases.ts @@ -24,6 +24,7 @@ export const mapModuleNameToModule = (moduleSpecifier: string) => { "http2", "https", "inspector", + "inspector/promises", "module", "net", "os", @@ -57,7 +58,7 @@ export const mapModuleNameToModule = (moduleSpecifier: string) => { "zlib", ] - if (builtInNodeMods.includes(moduleSpecifier.replace("node:", ""))) { + if (moduleSpecifier.indexOf("node:") === 0 || builtInNodeMods.includes(moduleSpecifier)) { return "node" } diff --git a/packages/ata/tests/edgeCases.spec.ts b/packages/ata/tests/edgeCases.spec.ts index 201a2f48..adf26b02 100644 --- a/packages/ata/tests/edgeCases.spec.ts +++ b/packages/ata/tests/edgeCases.spec.ts @@ -9,6 +9,11 @@ describe(mapModuleNameToModule, () => { expect(mapModuleNameToModule("node:fs")).toEqual("node") }) + it("handles mandatorily-prefixed node: identifiers", () => { + expect(mapModuleNameToModule("node:test")).toEqual("node") + expect(mapModuleNameToModule("test")).toEqual("test") + }) + it("strips module filepaths", () => { expect(mapModuleNameToModule("lodash/identity")).toEqual("lodash") expect(mapModuleNameToModule("@org/lodash/identity")).toEqual("@org/lodash") From 9ef7fcda64cdb565b335b3a0a1431b550fa9e18f Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Fri, 2 Aug 2024 13:01:53 -0700 Subject: [PATCH 3/4] Version Packages (#3195) Co-authored-by: github-actions[bot] --- .changeset/plenty-deers-visit.md | 5 ----- packages/ata/CHANGELOG.md | 6 ++++++ packages/ata/package.json | 2 +- packages/sandbox/CHANGELOG.md | 7 +++++++ packages/sandbox/package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/plenty-deers-visit.md diff --git a/.changeset/plenty-deers-visit.md b/.changeset/plenty-deers-visit.md deleted file mode 100644 index e9963003..00000000 --- a/.changeset/plenty-deers-visit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@typescript/ata": patch ---- - -Always treat `node:` modules as Node, expand list of known Node modules diff --git a/packages/ata/CHANGELOG.md b/packages/ata/CHANGELOG.md index 01263854..ba464505 100644 --- a/packages/ata/CHANGELOG.md +++ b/packages/ata/CHANGELOG.md @@ -1,5 +1,11 @@ # @typescript/ata +## 0.9.7 + +### Patch Changes + +- [#3191](https://github.com/microsoft/TypeScript-Website/pull/3191) [`1d0af97`](https://github.com/microsoft/TypeScript-Website/commit/1d0af97318b79943fe0bfa8871ee6e8c584c9af5) Thanks [@Renegade334](https://github.com/Renegade334)! - Always treat `node:` modules as Node, expand list of known Node modules + ## 0.9.6 ### Patch Changes diff --git a/packages/ata/package.json b/packages/ata/package.json index 29092cee..68f964ed 100644 --- a/packages/ata/package.json +++ b/packages/ata/package.json @@ -1,6 +1,6 @@ { "name": "@typescript/ata", - "version": "0.9.6", + "version": "0.9.7", "license": "MIT", "homepage": "https://github.com/microsoft/TypeScript-Website", "repository": { diff --git a/packages/sandbox/CHANGELOG.md b/packages/sandbox/CHANGELOG.md index a6c696bb..4f8f971d 100644 --- a/packages/sandbox/CHANGELOG.md +++ b/packages/sandbox/CHANGELOG.md @@ -1,5 +1,12 @@ # @typescript/sandbox +## 0.1.7 + +### Patch Changes + +- Updated dependencies [[`1d0af97`](https://github.com/microsoft/TypeScript-Website/commit/1d0af97318b79943fe0bfa8871ee6e8c584c9af5)]: + - @typescript/ata@0.9.7 + ## 0.1.6 ### Patch Changes diff --git a/packages/sandbox/package.json b/packages/sandbox/package.json index 370823c3..856ef62b 100644 --- a/packages/sandbox/package.json +++ b/packages/sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@typescript/sandbox", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "author": "TypeScript team", "homepage": "https://github.com/microsoft/TypeScript-Website", From 3fee598ec28789e39dd25be951d083d09e3dd088 Mon Sep 17 00:00:00 2001 From: Xavi Lee Date: Sun, 4 Aug 2024 10:48:30 +0800 Subject: [PATCH 4/4] fix conflicts --- .github/workflows/CI.yml | 120 ----------------------- .github/workflows/codeql.yml | 71 -------------- .github/workflows/deploy-prod-static.yml | 70 ------------- .github/workflows/publish-packages.yml | 41 -------- .github/workflows/weekly-stats.yml | 31 ------ 5 files changed, 333 deletions(-) delete mode 100644 .github/workflows/CI.yml delete mode 100644 .github/workflows/codeql.yml delete mode 100644 .github/workflows/deploy-prod-static.yml delete mode 100644 .github/workflows/publish-packages.yml delete mode 100644 .github/workflows/weekly-stats.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index 4997bddb..00000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: CI -on: - pull_request: - branches: - - v2 - -# Ensure scripts are run with pipefail. See: -# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference -defaults: - run: - shell: bash - -jobs: - tests: - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: "18.x" - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - run: pnpm install - - # Grab localizations - - run: pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1 - - # Build the packages - - run: pnpm bootstrap - - run: pnpm build - - # Verify it compiles - - run: pnpm build-site - - - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest' - with: - name: site - path: packages/typescriptlang-org/public - - # Run all the package's tests - - run: pnpm test - - # danger for PR builds - - if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id && matrix.os == 'ubuntu-latest' - run: "pnpm danger ci" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - run: | - git add . - if ! git diff --staged --exit-code --quiet; then - echo "This PR is missing some generated changes. Please update locally or merge the patch artifact." - echo "" - git diff --staged - git diff --staged > missing.patch - exit 1 - fi - name: Check for uncommitted changes - id: check-diff - if: github.event_name == 'pull_request' - - - name: Upload diff artifact - if: ${{ failure() && steps.check-diff.conclusion == 'failure' }} - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 - with: - name: missing.patch - path: missing.patch - - changesets: - name: changesets - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: 'lts/*' - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - run: pnpm install - - - name: Check for missing changesets - run: | - PR_CHANGESETS=$(ls .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) - MAIN_CHANGESETS=$(git ls-tree -r origin/v2 .changeset | (grep -v -E 'README\.md|config\.json' || true) | wc -l) - - # If the PR has no changesets, but main has changesets, assume this is PR is a versioning PR and exit - if [[ $PR_CHANGESETS -eq 0 && $MAIN_CHANGESETS -gt 0 ]]; then - echo "This PR is a versioning PR, exiting" - exit 0 - fi - - # git switch -c changesets-temp - # git checkout origin/v2 -- - pnpm changeset status --since=origin/v2 - - required: - runs-on: ubuntu-latest - if: ${{ always() }} - needs: - - tests - - changesets - - steps: - - name: Check required jobs - env: - NEEDS: ${{ toJson(needs) }} - run: | - ! echo $NEEDS | jq -e 'to_entries[] | { job: .key, result: .value.result } | select(.result != "success")' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index fbb1e903..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: 'Code Scanning - Action' - -on: - push: - branches: - - v2 - pull_request: - branches: - - v2 - schedule: - # ┌───────────── minute (0 - 59) - # │ ┌───────────── hour (0 - 23) - # │ │ ┌───────────── day of the month (1 - 31) - # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) - # │ │ │ │ │ - # │ │ │ │ │ - # │ │ │ │ │ - # * * * * * - - cron: '30 1 * * 0' - -permissions: - contents: read - -# Ensure scripts are run with pipefail. See: -# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference -defaults: - run: - shell: bash - -jobs: - CodeQL-Build: - # CodeQL runs on ubuntu-latest, windows-latest, and macos-latest - runs-on: ubuntu-latest - if: github.repository == 'microsoft/TypeScript-Website' - - permissions: - # required for all workflows - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 - with: - config-file: ./.github/codeql/codeql-configuration.yml - # Override language selection by uncommenting this and choosing your languages - # with: - # languages: go, javascript, csharp, python, cpp, java - - # 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@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.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 - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following - # three lines and modify them (or add more) to build your code if your - # project uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # v3.25.15 diff --git a/.github/workflows/deploy-prod-static.yml b/.github/workflows/deploy-prod-static.yml deleted file mode 100644 index 863ceb01..00000000 --- a/.github/workflows/deploy-prod-static.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: Deploy to GitHub Pages - -on: - push: - branches: - - v2 - workflow_dispatch: - schedule: - # https://crontab.guru/#0_12_*_*_1 - - cron: "0 12 * * 1" - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - # Fetch the full history, to build attribution.json - fetch-depth: 0 - - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: "18.x" - - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - # Builds the modules, and boostraps the other modules - - name: Build website - run: | - pnpm install - pnpm docs-sync pull microsoft/TypeScript-Website-localizations#main 1 - pnpm bootstrap - pnpm run --filter=typescriptlang-org setup-playground-cache-bust - pnpm build - - - name: Makes the site - run: | - pnpm build-site - cp -r packages/typescriptlang-org/public site - - - name: Setup Pages - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 - - - name: Upload artifact - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 - with: - path: './site' - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml deleted file mode 100644 index d6a0a186..00000000 --- a/.github/workflows/publish-packages.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Publish packages - -on: - push: - branches: [v2] - workflow_dispatch: - -permissions: - contents: write - pull-requests: write - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - filter: blob:none - token: ${{ secrets.GITHUB_BOT_TOKEN }} - - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: "18.x" - registry-url: "https://registry.npmjs.org/" - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - name: Prepare website v2 - run: | - pnpm install - pnpm bootstrap - pnpm build - - - uses: changesets/action@aba318e9165b45b7948c60273e0b72fce0a64eb9 # v1.4.7 - with: - publish: pnpm ci:publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} diff --git a/.github/workflows/weekly-stats.yml b/.github/workflows/weekly-stats.yml deleted file mode 100644 index 9c1ba0c3..00000000 --- a/.github/workflows/weekly-stats.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Publish Weekly Stats - -on: - schedule: - # https://crontab.guru/#0_12_*_*_1 - - cron: "0 12 * * 1" - workflow_dispatch: - -permissions: - contents: read - comments: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 - with: - node-version: "18.x" - - - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 - - - run: pnpm install - - # Update the site stats - - run: node packages/typescriptlang-org/scripts/updateAppInsightsGitHubIssue.js - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - APP_INSIGHTS_API_KEY: ${{ secrets.APP_INSIGHTS_API_KEY }} - APP_INSIGHTS_ID: ${{ secrets.APP_INSIGHTS_ID }} \ No newline at end of file