diff --git a/.github/workflows/publish-preview.yml b/.github/workflows/publish-preview.yml index 4ccabebde510ad2..d1d4d303b031a02 100644 --- a/.github/workflows/publish-preview.yml +++ b/.github/workflows/publish-preview.yml @@ -32,25 +32,19 @@ jobs: name: Build env: NODE_OPTIONS: --max-old-space-size=4096 - - run: npx wrangler versions upload - name: Deploy to Cloudflare Workers + - name: Deploy to Cloudflare Workers env: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - WRANGLER_OUTPUT_FILE_PATH: wrangler-logs.json - - name: Post preview URL on PR - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - PR=$(gh pr list --head ${{ github.ref_name }} --limit 1 --json number --jq '.[].number') - - if [ -n "$PR" ]; then - URL=$(cat wrangler-logs.json | jq -r 'select(.type=="version-upload") | .preview_url') + SHORT_SHA=$(git rev-parse --short=8 HEAD) + BRANCH_SLUG=$(git rev-parse --abbrev-ref HEAD | iconv -c -t ascii//TRANSLIT | sed -E 's/[~^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z) - if [ -n "$URL" ]; then - BODY="**Preview URL:** $URL" - gh pr comment "$PR" --edit-last --body "$BODY" || gh pr comment "$PR" --body "$BODY" - fi - fi + npx wrangler deploy --dispatch-namespace preview-deployments --name $SHORT_SHA + npx wrangler deploy --dispatch-namespace preview-deployments --name $BRANCH_SLUG + - name: Post preview URL on PR + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx tsx bin/post-preview-url-comment/index.ts - uses: actions/cache/save@v4 if: always() with: diff --git a/.github/workflows/show-changed-files.yml b/.github/workflows/show-changed-files.yml deleted file mode 100644 index 53b2d9b9b5b58a9..000000000000000 --- a/.github/workflows/show-changed-files.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Show Changed Files - -# **What it does**: Comments on a PR with before/after links for changes in the PR. -# **Why we have it**: Makes reviewing a PR much easier b/c you don't have to hunt for specific pages. -# **Who does it impact**: PCX team - -on: - issue_comment: - types: - - created - - edited - -jobs: - changed-files-links: - name: Show Changed Files - if: github.event.issue.pull_request && github.event.issue.state == 'open' && github.event.comment.user.id == 41898282 && contains(github.event.comment.body, '**Preview URL:**') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: "npm" - - run: npm ci - - run: npx tsx bin/show-changed-files/index.ts - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/show-changed-files/README.md b/bin/post-preview-url-comment/README.md similarity index 100% rename from bin/show-changed-files/README.md rename to bin/post-preview-url-comment/README.md diff --git a/bin/show-changed-files/constants.ts b/bin/post-preview-url-comment/constants.ts similarity index 74% rename from bin/show-changed-files/constants.ts rename to bin/post-preview-url-comment/constants.ts index b233dcb4799f174..66bc4bbc2309479 100644 --- a/bin/show-changed-files/constants.ts +++ b/bin/post-preview-url-comment/constants.ts @@ -1,5 +1,4 @@ export const GITHUB_ACTIONS_BOT_ID = 41898282; export const DOCS_BASE_URL = "https://developers.cloudflare.com"; export const CONTENT_BASE_PATH = "src/content"; -export const EXISTING_COMMENT_SUBSTRING = "| Original Link | Updated Link |"; export const PREVIEW_URL_REGEX = /^\*\*Preview URL:\*\* (.*)$/m; diff --git a/bin/post-preview-url-comment/index.node.test.ts b/bin/post-preview-url-comment/index.node.test.ts new file mode 100644 index 000000000000000..e2549d0e2f0a7ae --- /dev/null +++ b/bin/post-preview-url-comment/index.node.test.ts @@ -0,0 +1,75 @@ +import { describe, expect, test } from "vitest"; +import { DOCS_BASE_URL, PREVIEW_URL_REGEX } from "./constants"; +import { filenameToPath, branchToSubdomain } from "./util"; + +describe("PREVIEW_URL_REGEX", () => { + test("no changed files", () => { + const comment = + "**Preview URL:** https://e9c79bc3.preview.developers.cloudflare.com\n**Preview Branch URL:** https://kian-pcx-15803.preview.developers.cloudflare.com"; + + expect(PREVIEW_URL_REGEX.test(comment)).toBe(true); + }); + + test("changed files", () => { + const comment = + "**Preview URL:** https://e9c79bc3.preview.developers.cloudflare.com\n**Preview Branch URL:** https://kian-pcx-15803.preview.developers.cloudflare.com\n\n**Files with changes (up to 15)**\n\n| Original Link | Updated Link |\n| --- | --- |\n| [https://developers.cloudflare.com/workers/get-started/guide/](https://developers.cloudflare.com/workers/get-started/guide/) | [https://kian-pcx-15803.preview.developers.cloudflare.com/workers/get-started/guide/](https://kian-pcx-15803.preview.developers.cloudflare.com/workers/get-started/guide/) |"; + + expect(PREVIEW_URL_REGEX.test(comment)).toBe(true); + }); + + test("empty", () => { + expect(PREVIEW_URL_REGEX.test("")).toBe(false); + }); +}); + +describe("branchToSubdomain", () => { + test("slash", () => { + expect(branchToSubdomain("kian/pcx-15803")).toEqual("kian-pcx-15803"); + }); + + test("normal", () => { + expect(branchToSubdomain("pcx-15803")).toEqual("pcx-15803"); + }); + + test("capitalisation", () => { + expect(branchToSubdomain("PCX-15803")).toEqual("pcx-15803"); + }); +}); + +describe("filenameToPath", () => { + test("index", () => { + expect(filenameToPath("src/content/docs/workers/index.mdx")).toEqual( + "workers/", + ); + }); + + test("index base", () => { + expect( + `${DOCS_BASE_URL}/${filenameToPath("src/content/docs/workers/index.mdx")}`, + ).toEqual("https://developers.cloudflare.com/workers/"); + }); + + test("folder", () => { + expect( + filenameToPath("src/content/docs/workers/get-started/cli.mdx"), + ).toEqual("workers/get-started/cli/"); + }); + + test("1.1.1.1", () => { + expect(filenameToPath("src/content/docs/1111/index.mdx")).toEqual( + "1.1.1.1/", + ); + }); + + test("changelog", () => { + expect( + filenameToPath("src/content/changelogs-next/2025-02-05-title.mdx"), + ).toEqual("changelog/2025-02-05-title/"); + }); + + test("changelog base", () => { + expect( + `${DOCS_BASE_URL}/${filenameToPath("src/content/changelogs-next/2025-02-05-title.mdx")}`, + ).toEqual("https://developers.cloudflare.com/changelog/2025-02-05-title/"); + }); +}); diff --git a/bin/post-preview-url-comment/index.ts b/bin/post-preview-url-comment/index.ts new file mode 100644 index 000000000000000..5430a0f762f8984 --- /dev/null +++ b/bin/post-preview-url-comment/index.ts @@ -0,0 +1,136 @@ +import * as core from "@actions/core"; +import * as github from "@actions/github"; + +import { + CONTENT_BASE_PATH, + DOCS_BASE_URL, + GITHUB_ACTIONS_BOT_ID, + PREVIEW_URL_REGEX, +} from "./constants"; + +import { filenameToPath, branchToSubdomain } from "./util"; + +async function run(): Promise { + try { + if (!process.env.GITHUB_TOKEN) { + core.setFailed(`Could not find GITHUB_TOKEN in env`); + process.exit(); + } + + const octokit = github.getOctokit(process.env.GITHUB_TOKEN); + const ctx = github.context; + const branch = ctx.ref.replace("refs/heads/", ""); + + core.info(`Finding pull requests for ${ctx.ref}`); + + const { data: pulls } = await octokit.rest.pulls.list({ + ...ctx.repo, + head: `${ctx.repo.owner}:${branch}`, + }); + + const pull_number = pulls.at(0)?.number; + + if (!pull_number) { + core.setFailed(`Could not find pull requests for ${ctx.ref}`); + process.exit(); + } + + core.info(`Found ${pull_number}`); + + const files = await octokit.paginate(octokit.rest.pulls.listFiles, { + ...ctx.repo, + pull_number, + per_page: 100, + }); + + core.info(`Found ${files.length} changed files for ${pull_number}`); + + const { data: comments } = await octokit.rest.issues.listComments({ + ...ctx.repo, + issue_number: pull_number, + per_page: 100, + }); + + const existingComment = comments.find( + (comment) => + comment.user?.id === GITHUB_ACTIONS_BOT_ID && + PREVIEW_URL_REGEX.test(comment.body ?? ""), + ); + + if (existingComment) { + core.info(`Found existing comment with ID ${existingComment.id}`); + } else { + core.info(`No existing comment found`); + } + + const previewUrl = { + branch: `https://${branchToSubdomain(branch)}.preview.developers.cloudflare.com`, + commit: `https://${ctx.sha.slice(0, 8)}.preview.developers.cloudflare.com`, + }; + + core.info( + `Commit URL: ${previewUrl.commit}\nBranch URL: ${previewUrl.branch}`, + ); + + const changedFiles = files + .filter( + (file) => + file.filename.endsWith(".mdx") && + (file.filename.startsWith(`${CONTENT_BASE_PATH}/docs/`) || + file.filename.startsWith(`${CONTENT_BASE_PATH}/changelogs-next/`)), + ) + .sort((a, b) => b.changes - a.changes) + .slice(0, 15) // Limit to 15 entries + .map(({ filename }) => { + const original = `${DOCS_BASE_URL}/${filenameToPath(filename)}`; + const preview = `${previewUrl.branch}/${filenameToPath(filename)}`; + + core.info( + `Filename: ${filename}\nOriginal: ${original}\nPreview: ${preview}`, + ); + + return { original, preview }; + }); + + let comment = `**Preview URL:** ${previewUrl.commit}\n**Preview Branch URL:** ${previewUrl.branch}`; + if (changedFiles.length !== 0) { + core.info(`Found ${changedFiles.length} after filtering paths`); + + comment = comment.concat( + `\n\n**Files with changes (up to 15)**\n\n| Original Link | Updated Link |\n| --- | --- |\n${changedFiles + .map( + (file) => + `| [${file.original}](${file.original}) | [${file.preview}](${file.preview}) |`, + ) + .join("\n")}`, + ); + } + + if (existingComment) { + core.info( + `Updating ${existingComment.id} with ${JSON.stringify(comment)}`, + ); + await octokit.rest.issues.updateComment({ + owner: ctx.repo.owner, + repo: ctx.repo.repo, + comment_id: existingComment.id, + body: comment, + }); + } else { + core.info(`Creating new comment with ${JSON.stringify(comment)}`); + await octokit.rest.issues.createComment({ + owner: ctx.repo.owner, + repo: ctx.repo.repo, + issue_number: pull_number, + body: comment, + }); + } + } catch (error) { + if (error instanceof Error) { + core.setFailed(error.message); + } + process.exit(); + } +} + +run(); diff --git a/bin/show-changed-files/util.ts b/bin/post-preview-url-comment/util.ts similarity index 65% rename from bin/show-changed-files/util.ts rename to bin/post-preview-url-comment/util.ts index f783dc6123fd8bd..1640e482569c7ff 100644 --- a/bin/show-changed-files/util.ts +++ b/bin/post-preview-url-comment/util.ts @@ -1,5 +1,5 @@ import { slug } from "github-slugger"; - +import { execSync } from "node:child_process"; import { CONTENT_BASE_PATH } from "./constants"; export const filenameToPath = (filename: string) => { @@ -29,3 +29,10 @@ export const filenameToPath = (filename: string) => { .replace(/\/index$/, "") .concat("/"); }; + +export const branchToSubdomain = (branch: string) => { + return execSync( + `echo "${branch}" | iconv -c -t ascii//TRANSLIT | sed -E 's/[~^]+//g' | sed -E 's/[^a-zA-Z0-9]+/-/g' | sed -E 's/^-+|-+$//g' | tr A-Z a-z`, + { encoding: "utf-8" }, + ).trim(); +}; diff --git a/bin/show-changed-files/index.node.test.ts b/bin/show-changed-files/index.node.test.ts deleted file mode 100644 index 1ca15174c15b9e4..000000000000000 --- a/bin/show-changed-files/index.node.test.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { describe, expect, test } from "vitest"; -import { DOCS_BASE_URL, PREVIEW_URL_REGEX } from "./constants"; -import { filenameToPath } from "./util"; - -test("PREVIEW_URL_REGEX", () => { - const comment = - "**Preview URL:** https://ac148943-cloudflare-docs.cloudflare-docs.workers.dev"; - const matches = comment.match(PREVIEW_URL_REGEX); - - expect(matches).toBeDefined(); - expect(matches![1]).toEqual( - "https://ac148943-cloudflare-docs.cloudflare-docs.workers.dev", - ); -}); - -describe("filenameToPath", () => { - test("index", () => { - expect(filenameToPath("src/content/docs/workers/index.mdx")).toEqual( - "workers/", - ); - }); - - test("index base", () => { - expect( - `${DOCS_BASE_URL}/${filenameToPath("src/content/docs/workers/index.mdx")}`, - ).toEqual("https://developers.cloudflare.com/workers/"); - }); - - test("folder", () => { - expect( - filenameToPath("src/content/docs/workers/get-started/cli.mdx"), - ).toEqual("workers/get-started/cli/"); - }); - - test("1.1.1.1", () => { - expect(filenameToPath("src/content/docs/1111/index.mdx")).toEqual( - "1.1.1.1/", - ); - }); - - test("changelog", () => { - expect( - filenameToPath("src/content/changelogs-next/2025-02-05-title.mdx"), - ).toEqual("changelog/2025-02-05-title/"); - }); - - test("changelog base", () => { - expect( - `${DOCS_BASE_URL}/${filenameToPath("src/content/changelogs-next/2025-02-05-title.mdx")}`, - ).toEqual("https://developers.cloudflare.com/changelog/2025-02-05-title/"); - }); -}); diff --git a/bin/show-changed-files/index.ts b/bin/show-changed-files/index.ts deleted file mode 100644 index d708afc6b4d6ea7..000000000000000 --- a/bin/show-changed-files/index.ts +++ /dev/null @@ -1,123 +0,0 @@ -import * as core from "@actions/core"; -import * as github from "@actions/github"; - -import { - CONTENT_BASE_PATH, - DOCS_BASE_URL, - EXISTING_COMMENT_SUBSTRING, - GITHUB_ACTIONS_BOT_ID, - PREVIEW_URL_REGEX, -} from "./constants"; - -import { filenameToPath } from "./util"; - -async function run(): Promise { - try { - const token = core.getInput("GITHUB_TOKEN", { required: true }); - const octokit = github.getOctokit(token); - - const ctx = github.context; - - if (!ctx.payload.issue) { - core.setFailed(`Payload ${ctx.payload} is missing an 'issue' property`); - process.exit(); - } - - const issue = ctx.payload.issue.number; - - const files = await octokit.paginate(octokit.rest.pulls.listFiles, { - ...ctx.repo, - pull_number: issue, - per_page: 100, - }); - - const { data: comments } = await octokit.rest.issues.listComments({ - owner: ctx.repo.owner, - repo: ctx.repo.repo, - issue_number: issue, - per_page: 100, - }); - - const existingComment = comments.find( - (comment) => - comment.user?.id === GITHUB_ACTIONS_BOT_ID && - comment.body?.includes(EXISTING_COMMENT_SUBSTRING), - ); - - const urlComment = comments.find( - (comment) => - comment.user?.id === GITHUB_ACTIONS_BOT_ID && - PREVIEW_URL_REGEX.test(comment.body ?? ""), - ); - - if (!urlComment || !urlComment.body) { - core.setFailed( - `Could not find a comment from ${GITHUB_ACTIONS_BOT_ID} on ${issue}`, - ); - process.exit(); - } - - const match = urlComment.body.match(PREVIEW_URL_REGEX); - - if (!match) { - core.setFailed(`Could not extract URL from ${urlComment.body}`); - process.exit(); - } - - const previewUrl = match[1]; - - core.debug(previewUrl); - - const changedFiles = files - .filter( - (file) => - file.filename.endsWith(".mdx") && - (file.filename.startsWith(`${CONTENT_BASE_PATH}/docs/`) || - file.filename.startsWith(`${CONTENT_BASE_PATH}/changelogs-next/`)), - ) - .sort((a, b) => b.changes - a.changes) - .slice(0, 15) // Limit to 15 entries - .map(({ filename }) => { - const original = `${DOCS_BASE_URL}/${filenameToPath(filename)}`; - const preview = `${previewUrl}/${filenameToPath(filename)}`; - - core.debug([filename, original, preview].toString()); - - return { original, preview }; - }); - - if (changedFiles.length === 0) { - return; - } - - const commentBody = `**Files with changes (up to 15)**\n\n| Original Link | Updated Link |\n| --- | --- |\n${changedFiles - .map( - (file) => - `| [${file.original}](${file.original}) | [${file.preview}](${file.preview}) |`, - ) - .join("\n")}`; - - if (existingComment) { - await octokit.rest.issues.updateComment({ - owner: ctx.repo.owner, - repo: ctx.repo.repo, - comment_id: existingComment.id, - body: commentBody, - }); - } else { - await octokit.rest.issues.createComment({ - owner: ctx.repo.owner, - repo: ctx.repo.repo, - issue_number: issue, - body: commentBody, - }); - } - } catch (error) { - if (error instanceof Error) { - core.setFailed(error.message); - } - process.exit(); - } -} - -run(); diff --git a/package-lock.json b/package-lock.json index 0ba37a113a11164..0c5119de2ee37eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@astrojs/starlight-tailwind": "3.0.0", "@astrojs/tailwind": "5.1.5", "@cloudflare/vitest-pool-workers": "0.6.11", - "@cloudflare/workers-types": "4.20250121.0", + "@cloudflare/workers-types": "4.20250204.0", "@codingheads/sticky-header": "1.0.2", "@expressive-code/plugin-collapsible-sections": "0.40.1", "@iarna/toml": "2.2.5", @@ -90,7 +90,7 @@ "unist-util-visit": "5.0.0", "vite-tsconfig-paths": "5.1.4", "vitest": "2.1.6", - "wrangler": "3.103.2" + "wrangler": "3.107.3" }, "engines": { "node": ">=22" @@ -1157,135 +1157,6 @@ "vitest": "2.0.x - 2.1.x" } }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250129.0.tgz", - "integrity": "sha512-M+xETVnl+xy2dfDDWmp0XXr2rttl70a6bljQygl0EmYmNswFTcYbQWCaBuNBo9kabU59rLKr4a/b3QZ07NoL/g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250129.0.tgz", - "integrity": "sha512-c4PQUyIMp+bCMxZkAMBzXgTHjRZxeYCujDbb3staestqgRbenzcfauXsMd6np35ng+EE1uBgHNPV4+7fC0ZBfg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250129.0.tgz", - "integrity": "sha512-xJx8LwWFxsm5U3DETJwRuOmT5RWBqm4FmA4itYXvcEICca9pWJDB641kT4PnpypwDNmYOebhU7A+JUrCRucG0w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250129.0.tgz", - "integrity": "sha512-dR//npbaX5p323huBVNIy5gaWubQx6CC3aiXeK0yX4aD5ar8AjxQFb2U/Sgjeo65Rkt53hJWqC7IwRpK/eOxrA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250129.0.tgz", - "integrity": "sha512-OeO+1nPj/ocAE3adFar/tRFGRkbCrBnrOYXq0FUBSpyNHpDdA9/U3PAw5CN4zvjfTnqXZfTxTFeqoruqzRzbtg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/@cloudflare/workers-types": { - "version": "4.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250129.0.tgz", - "integrity": "sha512-H7g/sDB9GaV+fIPf3utNEYncFhryIvDThiBbfZtu0bZmVXcVd9ApP3OMqUYhNV8MShWQASvgWletKKBZGT9/oA==", - "dev": true, - "license": "MIT OR Apache-2.0", - "optional": true, - "peer": true - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/unenv": { - "version": "2.0.0-rc.1", - "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.1.tgz", - "integrity": "sha512-PU5fb40H8X149s117aB4ytbORcCvlASdtF97tfls4BPIyj4PeVxvpSuy1jAptqYHqB0vb2w2sHvzM0XWcp2OKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "defu": "^6.1.4", - "mlly": "^1.7.4", - "ohash": "^1.1.4", - "pathe": "^1.1.2", - "ufo": "^1.5.4" - } - }, - "node_modules/@cloudflare/vitest-pool-workers/node_modules/workerd": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250129.0.tgz", - "integrity": "sha512-Rprz8rxKTF4l6q/nYYI07lBetJnR19mGipx+u/a27GZOPKMG5SLIzA2NciZlJaB2Qd5YY+4p/eHOeKqo5keVWA==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20250129.0", - "@cloudflare/workerd-darwin-arm64": "1.20250129.0", - "@cloudflare/workerd-linux-64": "1.20250129.0", - "@cloudflare/workerd-linux-arm64": "1.20250129.0", - "@cloudflare/workerd-windows-64": "1.20250129.0" - } - }, "node_modules/@cloudflare/vitest-pool-workers/node_modules/wrangler": { "version": "3.107.2", "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.107.2.tgz", @@ -1323,9 +1194,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20241230.0.tgz", - "integrity": "sha512-BZHLg4bbhNQoaY1Uan81O3FV/zcmWueC55juhnaI7NAobiQth9RppadPNpxNAmS9fK2mR5z8xrwMQSQrHmztyQ==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250129.0.tgz", + "integrity": "sha512-M+xETVnl+xy2dfDDWmp0XXr2rttl70a6bljQygl0EmYmNswFTcYbQWCaBuNBo9kabU59rLKr4a/b3QZ07NoL/g==", "cpu": [ "x64" ], @@ -1340,9 +1211,9 @@ } }, "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20241230.0.tgz", - "integrity": "sha512-lllxycj7EzYoJ0VOJh8M3palUgoonVrILnzGrgsworgWlIpgjfXGS7b41tEGCw6AxSxL9prmTIGtfSPUvn/rjg==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250129.0.tgz", + "integrity": "sha512-c4PQUyIMp+bCMxZkAMBzXgTHjRZxeYCujDbb3staestqgRbenzcfauXsMd6np35ng+EE1uBgHNPV4+7fC0ZBfg==", "cpu": [ "arm64" ], @@ -1357,9 +1228,9 @@ } }, "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20241230.0.tgz", - "integrity": "sha512-Y3mHcW0KghOmWdNZyHYpEOG4Ba/ga8tht5vj1a+WXfagEjMO8Y98XhZUlCaYa9yB7Wh5jVcK5LM2jlO/BLgqpA==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250129.0.tgz", + "integrity": "sha512-xJx8LwWFxsm5U3DETJwRuOmT5RWBqm4FmA4itYXvcEICca9pWJDB641kT4PnpypwDNmYOebhU7A+JUrCRucG0w==", "cpu": [ "x64" ], @@ -1374,9 +1245,9 @@ } }, "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20241230.0.tgz", - "integrity": "sha512-IAjhsWPlHzhhkJ6I49sDG6XfMnhPvv0szKGXxTWQK/IWMrbGdHm4RSfNKBSoLQm67jGMIzbmcrX9UIkms27Y1g==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250129.0.tgz", + "integrity": "sha512-dR//npbaX5p323huBVNIy5gaWubQx6CC3aiXeK0yX4aD5ar8AjxQFb2U/Sgjeo65Rkt53hJWqC7IwRpK/eOxrA==", "cpu": [ "arm64" ], @@ -1391,9 +1262,9 @@ } }, "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20241230.0.tgz", - "integrity": "sha512-y5SPIk9iOb2gz+yWtHxoeMnjPnkYQswiCJ480oHC6zexnJLlKTpcmBCjDH1nWCT4pQi8F25gaH8thgElf4NvXQ==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250129.0.tgz", + "integrity": "sha512-OeO+1nPj/ocAE3adFar/tRFGRkbCrBnrOYXq0FUBSpyNHpDdA9/U3PAw5CN4zvjfTnqXZfTxTFeqoruqzRzbtg==", "cpu": [ "x64" ], @@ -1408,9 +1279,9 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20250121.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250121.0.tgz", - "integrity": "sha512-2bBosmudcwvUOKzuCL/Jum18LDh3QoU0QnTNMXIgcVwuq3LaNzyZnOW14bFXPhLU/84ZjNO3zO5R/U11Zgag2Q==", + "version": "4.20250204.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250204.0.tgz", + "integrity": "sha512-mWoQbYaP+nYztx9I7q9sgaiNlT54Cypszz0RfzMxYnT5W3NXDuwGcjGB+5B5H5VB8tEC2dYnBRpa70lX94ueaQ==", "dev": true, "license": "MIT OR Apache-2.0" }, @@ -6571,17 +6442,6 @@ ], "license": "CC-BY-4.0" }, - "node_modules/capnp-ts": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/capnp-ts/-/capnp-ts-0.7.0.tgz", - "integrity": "sha512-XKxXAC3HVPv7r674zP0VC3RTXz+/JKhfyw94ljvF80yynK6VkTnqE3jMuN8b3dUVmmc43TjyxjW4KTsmB3c86g==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^4.3.1", - "tslib": "^2.2.0" - } - }, "node_modules/ccount": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", @@ -13273,91 +13133,6 @@ "node": ">=16.13" } }, - "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20250129.0.tgz", - "integrity": "sha512-M+xETVnl+xy2dfDDWmp0XXr2rttl70a6bljQygl0EmYmNswFTcYbQWCaBuNBo9kabU59rLKr4a/b3QZ07NoL/g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/miniflare/node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20250129.0.tgz", - "integrity": "sha512-c4PQUyIMp+bCMxZkAMBzXgTHjRZxeYCujDbb3staestqgRbenzcfauXsMd6np35ng+EE1uBgHNPV4+7fC0ZBfg==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20250129.0.tgz", - "integrity": "sha512-xJx8LwWFxsm5U3DETJwRuOmT5RWBqm4FmA4itYXvcEICca9pWJDB641kT4PnpypwDNmYOebhU7A+JUrCRucG0w==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/miniflare/node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20250129.0.tgz", - "integrity": "sha512-dR//npbaX5p323huBVNIy5gaWubQx6CC3aiXeK0yX4aD5ar8AjxQFb2U/Sgjeo65Rkt53hJWqC7IwRpK/eOxrA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/miniflare/node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20250129.0.tgz", - "integrity": "sha512-OeO+1nPj/ocAE3adFar/tRFGRkbCrBnrOYXq0FUBSpyNHpDdA9/U3PAw5CN4zvjfTnqXZfTxTFeqoruqzRzbtg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, "node_modules/miniflare/node_modules/undici": { "version": "5.28.5", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", @@ -13371,27 +13146,6 @@ "node": ">=14.0" } }, - "node_modules/miniflare/node_modules/workerd": { - "version": "1.20250129.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250129.0.tgz", - "integrity": "sha512-Rprz8rxKTF4l6q/nYYI07lBetJnR19mGipx+u/a27GZOPKMG5SLIzA2NciZlJaB2Qd5YY+4p/eHOeKqo5keVWA==", - "dev": true, - "hasInstallScript": true, - "license": "Apache-2.0", - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20250129.0", - "@cloudflare/workerd-darwin-arm64": "1.20250129.0", - "@cloudflare/workerd-linux-64": "1.20250129.0", - "@cloudflare/workerd-linux-arm64": "1.20250129.0", - "@cloudflare/workerd-windows-64": "1.20250129.0" - } - }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -17769,15 +17523,14 @@ "license": "MIT" }, "node_modules/unenv": { - "name": "unenv-nightly", - "version": "2.0.0-20250109-100802-88ad671", - "resolved": "https://registry.npmjs.org/unenv-nightly/-/unenv-nightly-2.0.0-20250109-100802-88ad671.tgz", - "integrity": "sha512-Uij6gODNNNNsNBoDlnaMvZI99I6YlVJLRfYH8AOLMlbFrW7k2w872v9VLuIdch2vF8QBeSC4EftIh5sG4ibzdA==", + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.1.tgz", + "integrity": "sha512-PU5fb40H8X149s117aB4ytbORcCvlASdtF97tfls4BPIyj4PeVxvpSuy1jAptqYHqB0vb2w2sHvzM0XWcp2OKg==", "dev": true, "license": "MIT", "dependencies": { "defu": "^6.1.4", - "mlly": "^1.7.3", + "mlly": "^1.7.4", "ohash": "^1.1.4", "pathe": "^1.1.2", "ufo": "^1.5.4" @@ -19277,9 +19030,9 @@ } }, "node_modules/workerd": { - "version": "1.20241230.0", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20241230.0.tgz", - "integrity": "sha512-EgixXP0JGXGq6J9lz17TKIZtfNDUvJNG+cl9paPMfZuYWT920fFpBx+K04YmnbQRLnglsivF1GT9pxh1yrlWhg==", + "version": "1.20250129.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250129.0.tgz", + "integrity": "sha512-Rprz8rxKTF4l6q/nYYI07lBetJnR19mGipx+u/a27GZOPKMG5SLIzA2NciZlJaB2Qd5YY+4p/eHOeKqo5keVWA==", "dev": true, "hasInstallScript": true, "license": "Apache-2.0", @@ -19290,17 +19043,17 @@ "node": ">=16" }, "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20241230.0", - "@cloudflare/workerd-darwin-arm64": "1.20241230.0", - "@cloudflare/workerd-linux-64": "1.20241230.0", - "@cloudflare/workerd-linux-arm64": "1.20241230.0", - "@cloudflare/workerd-windows-64": "1.20241230.0" + "@cloudflare/workerd-darwin-64": "1.20250129.0", + "@cloudflare/workerd-darwin-arm64": "1.20250129.0", + "@cloudflare/workerd-linux-64": "1.20250129.0", + "@cloudflare/workerd-linux-arm64": "1.20250129.0", + "@cloudflare/workerd-windows-64": "1.20250129.0" } }, "node_modules/wrangler": { - "version": "3.103.2", - "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.103.2.tgz", - "integrity": "sha512-eYcnubPhPBU1QMZYTam+vfCLpaQx+x1EWA6nFbLhid1eqNDAk1dNwNlbo+ZryrOHDEX3XlOxn2Z3Fx8vVv3hKw==", + "version": "3.107.3", + "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.107.3.tgz", + "integrity": "sha512-N9ZMDHZ+DI5/B0yclr3bG57U/Zw7wSzGdpO2l7j6+3q8yUf+4Fk0Rvneo2t8rjLewKlvqgt9D9siFuo8MXJ55Q==", "dev": true, "license": "MIT OR Apache-2.0", "dependencies": { @@ -19309,10 +19062,10 @@ "@esbuild-plugins/node-modules-polyfill": "0.2.2", "blake3-wasm": "2.1.5", "esbuild": "0.17.19", - "miniflare": "3.20241230.2", + "miniflare": "3.20250129.0", "path-to-regexp": "6.3.0", - "unenv": "npm:unenv-nightly@2.0.0-20250109-100802-88ad671", - "workerd": "1.20241230.0" + "unenv": "2.0.0-rc.1", + "workerd": "1.20250129.0" }, "bin": { "wrangler": "bin/wrangler.js", @@ -19325,7 +19078,7 @@ "fsevents": "~2.3.2" }, "peerDependencies": { - "@cloudflare/workers-types": "^4.20241230.0" + "@cloudflare/workers-types": "^4.20250129.0" }, "peerDependenciesMeta": { "@cloudflare/workers-types": { @@ -19333,46 +19086,6 @@ } } }, - "node_modules/wrangler/node_modules/miniflare": { - "version": "3.20241230.2", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20241230.2.tgz", - "integrity": "sha512-gFC3IaUKrLGdtA6y6PLpC/QE5YAjB5ITCfBZHkosRyFZ9ApaCHKcHRvrEFMc/R19QxxtHD+G3tExEHp7MmtsYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@cspotcode/source-map-support": "0.8.1", - "acorn": "^8.8.0", - "acorn-walk": "^8.2.0", - "capnp-ts": "^0.7.0", - "exit-hook": "^2.2.1", - "glob-to-regexp": "^0.4.1", - "stoppable": "^1.1.0", - "undici": "^5.28.4", - "workerd": "1.20241230.0", - "ws": "^8.18.0", - "youch": "^3.2.2", - "zod": "^3.22.3" - }, - "bin": { - "miniflare": "bootstrap.js" - }, - "engines": { - "node": ">=16.13" - } - }, - "node_modules/wrangler/node_modules/undici": { - "version": "5.28.5", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz", - "integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/wrap-ansi": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", diff --git a/package.json b/package.json index 3177bf305b119e3..77efd553b8920ff 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "@astrojs/starlight-tailwind": "3.0.0", "@astrojs/tailwind": "5.1.5", "@cloudflare/vitest-pool-workers": "0.6.11", - "@cloudflare/workers-types": "4.20250121.0", + "@cloudflare/workers-types": "4.20250204.0", "@codingheads/sticky-header": "1.0.2", "@expressive-code/plugin-collapsible-sections": "0.40.1", "@iarna/toml": "2.2.5", @@ -107,7 +107,7 @@ "unist-util-visit": "5.0.0", "vite-tsconfig-paths": "5.1.4", "vitest": "2.1.6", - "wrangler": "3.103.2" + "wrangler": "3.107.3" }, "engines": { "node": ">=22"