From 7b3253a6a6b7908838fbd4821acc00d43bd5ef1d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 13:25:41 +0000 Subject: [PATCH 1/5] Initial plan From f4cabbf617d20066ce492b3e6d8ae151cb8b5a2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 13:31:03 +0000 Subject: [PATCH 2/5] Update GitHub Actions workflows for npm trusted publishers Co-authored-by: MichaelDeBoey <6643991+MichaelDeBoey@users.noreply.github.com> --- .github/workflows/validate.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index a54cb89..d13965a 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,17 +16,17 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [12, 14, 16, 17] + node: [lts/-1, lts/*, latest] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs uses: styfle/cancel-workflow-action@0.11.0 - name: ⬇️ Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: ⎔ Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node }} @@ -44,6 +44,11 @@ jobs: release: needs: main runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + id-token: write # to enable use of OIDC for npm provenance + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests if: ${{ github.repository == 'remark-embedder/transformer-codesandbox' && contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', @@ -53,12 +58,12 @@ jobs: uses: styfle/cancel-workflow-action@0.11.0 - name: ⬇️ Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v5 - name: ⎔ Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v6 with: - node-version: 16 + node-version: lts/* - name: 📥 Download deps uses: bahmutov/npm-install@v1 @@ -69,9 +74,9 @@ jobs: run: npm run build - name: 🚀 Release - uses: cycjimmy/semantic-release-action@v3 + uses: cycjimmy/semantic-release-action@v5.0.2 with: - semantic_version: 18 + semantic_version: 25 branches: | [ '+([0-9])?(.{+([0-9]),x}).x', @@ -83,4 +88,3 @@ jobs: ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From a23280e2de5d279840af2cfa15dfe93da7805532 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 21:03:30 +0000 Subject: [PATCH 3/5] Fix Node.js version matrix to use only LTS versions Co-authored-by: kentcdodds <1500684+kentcdodds@users.noreply.github.com> --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d13965a..64f4757 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,7 +16,7 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [lts/-1, lts/*, latest] + node: [lts/-2, lts/-1, lts/*] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs From 4a92bbfe431cf963692f8cd0f7e076b1bfaff46a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 21:41:05 +0000 Subject: [PATCH 4/5] Use Node 16 and 18 to maintain TypeScript 4.7 compatibility Co-authored-by: kentcdodds <1500684+kentcdodds@users.noreply.github.com> --- .github/workflows/validate.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 64f4757..d60bb6b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,7 +16,7 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [lts/-2, lts/-1, lts/*] + node: [16, 18] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs @@ -63,7 +63,7 @@ jobs: - name: ⎔ Setup node uses: actions/setup-node@v6 with: - node-version: lts/* + node-version: 18 - name: 📥 Download deps uses: bahmutov/npm-install@v1 From 69ebeef66b1ccece37366c3fa6d0e18dcd213304 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Oct 2025 22:02:02 +0000 Subject: [PATCH 5/5] Update TypeScript to 5.9.3 and fix type errors Co-authored-by: kentcdodds <1500684+kentcdodds@users.noreply.github.com> --- .github/workflows/validate.yml | 4 ++-- package.json | 2 +- src/__tests__/index.ts | 6 ++++-- src/index.ts | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index d60bb6b..c248d67 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,7 +16,7 @@ jobs: if: ${{ !contains(github.head_ref, 'all-contributors') }} strategy: matrix: - node: [16, 18] + node: [lts/-1, lts/*] runs-on: ubuntu-latest steps: - name: 🛑 Cancel Previous Runs @@ -63,7 +63,7 @@ jobs: - name: ⎔ Setup node uses: actions/setup-node@v6 with: - node-version: 18 + node-version: lts/* - name: 📥 Download deps uses: bahmutov/npm-install@v1 diff --git a/package.json b/package.json index cc89782..d52b06a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "kcd-scripts": "^12.2.0", "remark": "^14.0.2", "remark-html": "^15.0.1", - "typescript": "^4.7.4" + "typescript": "^5.9.3" }, "peerDependencies": { "@remark-embedder/core": "^3.0.0" diff --git a/src/__tests__/index.ts b/src/__tests__/index.ts index f53eb3a..dd8262f 100644 --- a/src/__tests__/index.ts +++ b/src/__tests__/index.ts @@ -12,12 +12,14 @@ const unquoteSerializer = { expect.addSnapshotSerializer(unquoteSerializer) test('smoke test', async () => { - const result = await remark() + const processor = remark() .use(remarkEmbedder, { transformers: [CodeSandboxTransformer], }) + // @ts-expect-error - Type inference issue with remark plugins .use(remarkHTML, {sanitize: false}) - .process( + + const result = await processor.process( ` This is a CodeSandbox: diff --git a/src/index.ts b/src/index.ts index 373683c..d95c9ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import type {Transformer} from '@remark-embedder/core' +import {type Transformer} from '@remark-embedder/core' const transformer: Transformer = { getHTML: urlString => {