diff --git a/.changeset/spicy-cherries-happen.md b/.changeset/spicy-cherries-happen.md new file mode 100644 index 000000000000..0d0e71269e94 --- /dev/null +++ b/.changeset/spicy-cherries-happen.md @@ -0,0 +1,6 @@ +--- +"@cloudflare/pages-shared": minor +"wrangler": minor +--- + +chore: bump `miniflare` to [`3.20230821.0`](https://github.com/cloudflare/miniflare/releases/tag/v3.20230821.0) diff --git a/.github/workflows/codecov-context.yml b/.github/workflows/codecov-context.yml deleted file mode 100644 index 813f6752d7e3..000000000000 --- a/.github/workflows/codecov-context.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: CodeCov Main Context - -on: - push: - branches: [main] - -jobs: - codecov: - if: ${{ github.repository_owner == 'cloudflare' }} - name: CodeCov Main Branch Updater - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - ref: main - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build wrangler - run: npm run build - env: - NODE_ENV: "production" - - - name: Run tests & collect coverage - run: npm run test:ci -w wrangler - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Report Code Coverage - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/create-pullrequest-prerelease.yml b/.github/workflows/create-pullrequest-prerelease.yml deleted file mode 100644 index 31787d2ef887..000000000000 --- a/.github/workflows/create-pullrequest-prerelease.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: Create Pull Request Prerelease - -on: pull_request - -jobs: - build: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build & Publish a Prerelease to the Adhoc Registry - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Extract runtime versions - run: node .github/extract-runtime-versions.mjs # extract versions before modifying version to include commit hash - - - name: Upload runtime versions - uses: actions/upload-artifact@v3 - with: - name: runtime-versions.md - path: runtime-versions.md - - - name: Modify package.json version - run: node .github/version-script.js - - - name: Build - run: npm run build - env: - NODE_ENV: "production" - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }} - - - name: Pack wrangler - run: npm pack - working-directory: packages/wrangler - - - name: Upload packaged wrangler artifact - uses: actions/upload-artifact@v3 - with: - name: npm-package-wrangler-${{ github.event.number }} # encode the PR number into the artifact name - path: packages/wrangler/wrangler-*.tgz - - - name: Pack @cloudflare/pages-shared - run: npm pack - working-directory: packages/pages-shared - - - name: Upload packaged @cloudflare/pages-shared artifact - uses: actions/upload-artifact@v3 - with: - name: npm-package-cloudflare-pages-shared-${{ github.event.number }} # encode the PR number into the artifact name - path: packages/pages-shared/cloudflare-pages-shared-*.tgz - - - name: Pack @cloudflare/create-cloudflare - run: npm pack - working-directory: packages/create-cloudflare - - - name: Upload packaged @cloudflare/create-cloudflare artifact - uses: actions/upload-artifact@v3 - with: - name: npm-package-create-cloudflare-${{ github.event.number }} # encode the PR number into the artifact name - path: packages/create-cloudflare/create-cloudflare-*.tgz diff --git a/.github/workflows/d1.yml b/.github/workflows/d1.yml deleted file mode 100644 index ae0d7f87438a..000000000000 --- a/.github/workflows/d1.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: D1 -on: - push: - branches: - - d1 - -jobs: - release: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Release - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Modify package.json version - run: node .github/version-script.js - - - name: Publish to NPM - run: npm publish --tag d1 - env: - NODE_ENV: "production" - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - working-directory: packages/wrangler diff --git a/.github/workflows/devtools.yml b/.github/workflows/devtools.yml deleted file mode 100644 index 7785b0d0ed07..000000000000 --- a/.github/workflows/devtools.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Publish Devtools - -on: - push: - branches: - - main - - "devtools/**" - - "**-devtools" - -jobs: - publish: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build & Publish a branch preview of devtools to Cloudflare - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Run Devtools release & publish - run: cd packages/wrangler-devtools && make publish - env: - CLOUDFLARE_ACCOUNT_ID: "e35fd947284363a46fd7061634477114" - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index e601b233c2f7..000000000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: E2E tests - -on: - push: - branches: - - main - - changeset-release/main - pull_request: - types: [synchronize, opened, reopened, labeled, unlabeled] - repository_dispatch: - -jobs: - e2e-test: - if: github.repository_owner == 'cloudflare' && (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && contains(github.event.*.labels.*.name, 'e2e' )) || (github.event_name == 'pull_request' && github.head_ref == 'changeset-release/main')) - name: "E2E Test" - strategy: - matrix: - os: [ - # macos-11, - # macos-12, - macos-13, - windows-2019, - windows-2022, - # ubuntu-20.04, - ubuntu-22.04, - ] - node: ["16", "18"] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - cache: "npm" - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - # Attempt to cache all the node_modules directories based on the OS and package lock. - - name: Cache node_modules - id: npm-cache - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - key: ${{ runner.os }}-${{ matrix.node }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - path: "**/node_modules" - - # If the cache missed then install using `npm ci` to follow package lock exactly - - if: ${{ steps.npm-cache.outputs.cache-hit != 'true'}} - name: Install NPM Dependencies - run: npm ci - - - name: Run builds - run: npm run build - env: - NODE_ENV: "production" - - - name: Build Wrangler package for npm - run: cd packages/wrangler && npm pack - env: - NODE_ENV: "production" - - - name: Move Wrangler package to tmp directory - shell: bash - id: "move-wrangler" - run: | - cp packages/wrangler/wrangler-*.tgz $HOME - echo "dir=$(ls $HOME/wrangler-*.tgz)" >> $GITHUB_OUTPUT; - env: - NODE_ENV: "production" - - - name: Run tests - id: e2e-1 - continue-on-error: true - run: npm run -w wrangler test:e2e - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - WRANGLER: npm install ${{ steps.move-wrangler.outputs.dir}} && npx --prefer-offline wrangler - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Retry tests - if: steps.e2e-1.outcome == 'failure' - run: npm run -w wrangler test:e2e - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.TEST_CLOUDFLARE_ACCOUNT_ID }} - WRANGLER: npm install ${{ steps.move-wrangler.outputs.dir}} && npx --prefer-offline wrangler - NODE_OPTIONS: "--max_old_space_size=8192" diff --git a/.github/workflows/edge-preview-authenticated-proxy.yml b/.github/workflows/edge-preview-authenticated-proxy.yml deleted file mode 100644 index 5a1efceeda27..000000000000 --- a/.github/workflows/edge-preview-authenticated-proxy.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Edge Preview Authenticated Proxy Worker - -on: - push: - branches: - - main -jobs: - publish_worker: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Publish Worker - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build wrangler - run: npm run build - env: - NODE_ENV: "production" - - - name: Build & Publish Worker - run: npm run publish - env: - NODE_ENV: "production" - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - working-directory: packages/edge-preview-authenticated-proxy diff --git a/.github/workflows/experimental-wasm-release.yml b/.github/workflows/experimental-wasm-release.yml deleted file mode 100644 index a5a73264c55e..000000000000 --- a/.github/workflows/experimental-wasm-release.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: WASM Experimental builds -on: - push: - branches: - - experimental-wasm -jobs: - build: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build and release `wrangler@wasm` to NPM - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Modify package.json version - run: node .github/version-script.js - - - name: Build - run: npm run build - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Publish `wrangler@wasm` to NPM - run: npm publish --tag wasm - env: - NODE_ENV: "production" - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - working-directory: packages/wrangler diff --git a/.github/workflows/format-errors.yml b/.github/workflows/format-errors.yml deleted file mode 100644 index 33f1e739645c..000000000000 --- a/.github/workflows/format-errors.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Error Formatting Worker - -on: - push: - branches: - - main -jobs: - publish_worker: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Publish Worker - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - name: Install NPM Dependencies - run: npm ci - - - name: Build wrangler - run: npm run build - env: - NODE_ENV: "production" - - - name: Build & Publish Worker - run: npm run publish - env: - NODE_ENV: "production" - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - working-directory: packages/format-errors diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml deleted file mode 100644 index b1ac0f0e6c8a..000000000000 --- a/.github/workflows/issues.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Add issues to DevProd project - -on: - issues: - types: - - opened - -jobs: - add-to-project: - name: Add issue to project - runs-on: ubuntu-latest - steps: - - uses: actions/add-to-project@v0.3.0 - with: - project-url: https://github.com/orgs/cloudflare/projects/1 - github-token: ${{ secrets.GH_ACCESS_TOKEN }} - labeled: bug, enhancement - label-operator: OR - - uses: actions/add-to-project@v0.3.0 - with: - project-url: https://github.com/orgs/cloudflare/projects/2 - github-token: ${{ secrets.GH_ACCESS_TOKEN }} - labeled: pages - - uses: actions/add-to-project@v0.3.0 - with: - project-url: https://github.com/orgs/cloudflare/projects/6 - github-token: ${{ secrets.GH_ACCESS_TOKEN }} - labeled: d1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index ef3bda93e55e..000000000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Main branch - -# This flow will re-run tests on the main branch after a PR has been merged. - -on: - push: - branches: - - main - -jobs: - test: - if: ${{ github.repository_owner == 'cloudflare' }} - name: "Tests" - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Run builds - run: npm run build - env: - NODE_ENV: "production" - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Run tests - run: npm run test:ci - env: - TMP_CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - TMP_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - NODE_OPTIONS: "--max_old_space_size=8192" diff --git a/.github/workflows/prerelease-create-cloudflare.yml b/.github/workflows/prerelease-create-cloudflare.yml deleted file mode 100644 index 3bdbad9afc83..000000000000 --- a/.github/workflows/prerelease-create-cloudflare.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Prerelease create-cloudflare - -on: - repository_dispatch: - types: [pre-release-create-cloudflare] - push: - branches: - - main - -jobs: - prerelease: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build & Publish a beta release of create-cloudflare to NPM - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Modify package.json version - run: node .github/version-script.js create-cloudflare - - - name: Build packages - run: npm run build - env: - NODE_ENV: "production" - - - name: Publish Beta to NPM - run: npm publish --tag beta - env: - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - working-directory: packages/create-cloudflare diff --git a/.github/workflows/prereleases.yml b/.github/workflows/prereleases.yml deleted file mode 100644 index c7d79f758659..000000000000 --- a/.github/workflows/prereleases.yml +++ /dev/null @@ -1,102 +0,0 @@ -name: Prerelease - -on: - push: - branches: - - main -jobs: - prerelease: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build & Publish a beta release to NPM - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Modify package.json version - run: node .github/version-script.js - - - name: Build - run: npm run build - env: - NODE_ENV: "production" - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Publish Beta to NPM - run: npm publish --tag beta - env: - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - # this is the "test/staging" key for sparrow analytics - SPARROW_SOURCE_KEY: "5adf183f94b3436ba78d67f506965998" - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }} - working-directory: packages/wrangler - - - name: Get Package Version - run: echo "WRANGLER_VERSION=$(npm view wrangler@beta version)" >> $GITHUB_ENV - working-directory: packages/wrangler - - publish_prerelease_registry: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Publish Prerelease Registry - needs: prerelease - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build wrangler - run: npm run build - env: - NODE_ENV: "production" - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }} - - - name: Build & Publish Prerelease Registry - run: npm run publish - env: - NODE_ENV: "production" - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - working-directory: packages/prerelease-registry diff --git a/.github/workflows/pullrequests.yml b/.github/workflows/pullrequests.yml index c0050a74e46e..3b95d94e7f26 100644 --- a/.github/workflows/pullrequests.yml +++ b/.github/workflows/pullrequests.yml @@ -5,65 +5,11 @@ on: pull_request env: node-version: 16.13 jobs: - check: - name: "Checks" - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js ${{ env.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ env.node-version }} - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: ESlint and Typescript caching - uses: actions/cache@v3 - id: eslint-cache - with: - path: | - .eslintcache - tsconfig.tsbuildinfo - key: ${{ runner.os }}-eslint-tsbuildinfo-${{ hashFiles('**/*.ts','**/*.js', 'package.json', 'tsconfig.json') }} - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - # Attempt to cache all the node_modules directories based on the OS and package lock. - - name: Cache node_modules - id: npm-cache - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - key: ${{ runner.os }}-${{ env.node-version }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - path: "**/node_modules" - - # If the cache missed then install using `npm ci` to follow package lock exactly - - if: ${{ steps.npm-cache.outputs.cache-hit != 'true'}} - name: Install NPM Dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - test: name: "Tests" strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [windows-latest] runs-on: ${{ matrix.os }} steps: - name: Checkout Repo @@ -77,35 +23,23 @@ jobs: node-version: ${{ env.node-version }} cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - # Attempt to cache all the node_modules directories based on the OS and package lock. - - name: Cache node_modules - id: npm-cache - uses: actions/cache@v3 - env: - cache-name: cache-node-modules - with: - key: ${{ runner.os }}-${{ env.node-version }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - path: "**/node_modules" - - # If the cache missed then install using `npm ci` to follow package lock exactly - - if: ${{ steps.npm-cache.outputs.cache-hit != 'true'}} - name: Install NPM Dependencies + - name: Install NPM Dependencies run: npm ci + - if: ${{ runner.os == 'Windows' }} + name: Use `workerd` debug build + run: | + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest "https://drive.google.com/uc?export=download&id=1Z7SEO4tTHJ-G7rOHQopAx22V8CyK5KfM&confirm=t&uuid=7c5df451-e8d2-4c11-99c6-20f68db36cab&at=AB6BwCAHFh6Y91KJ0uOaO9Dk39p9:1692976594101" -OutFile workerd-debug.zip + Expand-Archive -Force -Path .\workerd-debug.zip -DestinationPath .\packages\wrangler\node_modules\@cloudflare\workerd-windows-64\bin\ + - name: Run builds run: npm run build env: NODE_ENV: "production" - name: Run tests & collect coverage - run: npm run test:ci + run: npm run test:ci -- --force env: TMP_CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} TMP_CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} diff --git a/.github/workflows/queues.yml b/.github/workflows/queues.yml deleted file mode 100644 index 5de9dfa330bc..000000000000 --- a/.github/workflows/queues.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Queues Experimental builds -on: - push: - branches: - - queues - -jobs: - build: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build and release `wrangler@queues` to NPM - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Check for errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Modify package.json version - run: node .github/version-script.js - - - name: Publish `wrangler@queues` to NPM - run: npm publish --tag queues - env: - NODE_ENV: "production" - NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - working-directory: packages/wrangler diff --git a/.github/workflows/quick-edit.yml b/.github/workflows/quick-edit.yml deleted file mode 100644 index 4505c74670ed..000000000000 --- a/.github/workflows/quick-edit.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Publish Quick Edit - -on: - push: - branches: - - main - - "quick-edit/**" - -jobs: - publish: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Build & Publish Quick Edit to Cloudflare Pages - runs-on: ubuntu-latest - - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Build Wrangler - run: npm run build - - - name: Build Quick Edit - run: cd packages/quick-edit && yarn setup && yarn custom:build - - - name: Publish Quick Edit - run: npm -w packages/quick-edit run publish - env: - CLOUDFLARE_ACCOUNT_ID: "e35fd947284363a46fd7061634477114" - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 077fd66c2d27..000000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -jobs: - release: - if: ${{ github.repository_owner == 'cloudflare' }} - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js 16.13 - uses: actions/setup-node@v3 - with: - node-version: 16.13 - cache: "npm" # cache ~/.npm in case 'npm ci' needs to run - - - name: Install workerd Dependencies - if: ${{ runner.os == 'Linux' }} - run: | - export DEBIAN_FRONTEND=noninteractive - sudo apt-get update - sudo apt-get install -y libc++1 - - - name: Install NPM Dependencies - run: npm ci - - - name: Check the build - run: npm run build - - - name: Check for other errors - run: npm run check - env: - NODE_OPTIONS: "--max_old_space_size=8192" - - - name: Create Version PR or Publish to NPM - id: changesets - uses: changesets/action@v1 - with: - version: node .github/changeset-version.js - publish: npx changeset publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} - ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }} - NODE_ENV: "production" - # This is the "production" key for sparrow analytics. - # Include this here because this step will rebuild Wrangler and needs to have this available - SPARROW_SOURCE_KEY: "50598e014ed44c739ec8074fdc16057c" diff --git a/.github/workflows/test-c3.yml b/.github/workflows/test-c3.yml deleted file mode 100644 index b59ee12bf315..000000000000 --- a/.github/workflows/test-c3.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: C3 Tests - -on: - pull_request: - paths: - - packages/create-cloudflare/** - -env: - node-version: 16.14 - -jobs: - check: - name: "Checks" - strategy: - matrix: - # TODO: add back windows - # os: [ubuntu-latest, windows-latest, macos-latest] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - - - name: Check Types - run: npm run check:type -w create-cloudflare - - - name: Lint - run: npm run check:lint -w create-cloudflare - - - name: Unit Tests - run: npm run test:unit -w create-cloudflare - - cleanup: - if: ${{ github.repository_owner == 'cloudflare' }} - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - - - name: Cleanup E2E test projects - run: npm run test:e2e:cleanup -w create-cloudflare - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }} - - e2e: - needs: cleanup - name: "E2E" - strategy: - matrix: - # TODO: add back windows - # os: [ubuntu-latest, windows-latest, macos-latest] - os: [ubuntu-latest] - # pm: [npm, yarn, pnpm] - pm: [npm, pnpm] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - - - name: E2E Tests - run: npm run test:e2e:${{matrix.pm}} -w create-cloudflare - env: - CLOUDFLARE_API_TOKEN: ${{ secrets.C3_TEST_CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.C3_TEST_CLOUDFLARE_ACCOUNT_ID }} diff --git a/.github/workflows/test-old-node-error.yml b/.github/workflows/test-old-node-error.yml deleted file mode 100644 index 91dd7d3dd940..000000000000 --- a/.github/workflows/test-old-node-error.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Test old Node.js version - -on: pull_request - -jobs: - check: - name: "Checks" - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Use Node.js v10 - uses: actions/setup-node@v3 - with: - node-version: 10.24.1 - - - name: Check for error message - run: node packages/wrangler/src/__tests__/test-old-node-version.js diff --git a/.github/workflows/write-prerelease-comment.yml b/.github/workflows/write-prerelease-comment.yml deleted file mode 100644 index 78fc34201873..000000000000 --- a/.github/workflows/write-prerelease-comment.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Write prerelease comment - -on: - workflow_run: - workflows: ["Create Pull Request Prerelease"] - types: - - completed - -jobs: - comment: - if: ${{ github.repository_owner == 'cloudflare' }} - runs-on: ubuntu-latest - name: Write comment to the PR - steps: - - name: "Put PR and workflow ID on the environment" - uses: actions/github-script@v6 - with: - script: | - // Copied from .github/extract-pr-and-workflow-id.js - const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: context.payload.workflow_run.id, - }); - - for (const artifact of allArtifacts.data.artifacts) { - // Extract the PR number from the artifact name - const match = /^npm-package-(.+)-(\d+)$/.exec(artifact.name); - if (match) { - const packageName = match[1].toUpperCase(); - require("fs").appendFileSync( - process.env.GITHUB_ENV, - `\nWORKFLOW_RUN_PR_FOR_${packageName}=${match[2]}` + - `\nWORKFLOW_RUN_ID_FOR_${packageName}=${context.payload.workflow_run.id}` - ); - break; - } - } - - - name: "Download runtime versions" - # Regular `actions/download-artifact` doesn't support downloading - # artifacts from another workflow - uses: dawidd6/action-download-artifact@v2 - with: - run_id: ${{ github.event.workflow_run.id }} - name: runtime-versions.md - - - name: "Put runtime versions on the environment" - id: runtime_versions - run: | - { - echo 'RUNTIME_VERSIONS<> "$GITHUB_ENV" - - - name: "Comment on PR with Wrangler link" - env: - WORKFLOW_RUN_PR_FOR_WRANGLER: ${{env.WORKFLOW_RUN_PR_FOR_WRANGLER || env.WORKFLOW_RUN_PR_FOR_CLOUDFLARE-PAGES-SHARED}} - WORKFLOW_RUN_ID_FOR_WRANGLER: ${{env.WORKFLOW_RUN_ID_FOR_WRANGLER || env.WORKFLOW_RUN_ID_FOR_CLOUDFLARE-PAGES-SHARED}} - - uses: marocchino/sticky-pull-request-comment@v2 - with: - number: ${{ env.WORKFLOW_RUN_PR_FOR_WRANGLER}} - message: | - A wrangler prerelease is available for testing. You can install this latest build in your project with: - - ```sh - npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/${{ env.WORKFLOW_RUN_ID_FOR_WRANGLER }}/npm-package-wrangler-${{ env.WORKFLOW_RUN_PR_FOR_WRANGLER }} - ``` - - You can reference the automatically updated head of this PR with: - - ```sh - npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/${{ env.WORKFLOW_RUN_ID_FOR_WRANGLER }}/npm-package-wrangler-${{ env.WORKFLOW_RUN_PR_FOR_WRANGLER }} - ``` - - Or you can use `npx` with this latest build directly: - - ```sh - npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/${{ env.WORKFLOW_RUN_ID_FOR_WRANGLER }}/npm-package-wrangler-${{ env.WORKFLOW_RUN_PR_FOR_WRANGLER }} dev path/to/script.js - ``` - -
Additional artifacts: - - ```sh - npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/${{ env.WORKFLOW_RUN_ID_FOR_WRANGLER }}/npm-package-cloudflare-pages-shared-${{ env.WORKFLOW_RUN_PR_FOR_WRANGLER }} - ``` - - Note that these links will no longer work once [the GitHub Actions artifact expires](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization). - -
- - --- - - ${{ env.RUNTIME_VERSIONS }} - - - name: "Comment on PR with C3 link" - uses: marocchino/sticky-pull-request-comment@v2 - with: - number: ${{ env.WORKFLOW_RUN_PR_FOR_CREATE_CLOUDFLARE }} - message: | - A create-cloudflare (C3) prerelease is available for testing. - You can use `npx` with this latest build directly: - - ```sh - npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/${{ env.WORKFLOW_RUN_ID_FOR_CREATE_CLOUDFLARE }}/npm-package-create-cloudflare-${{ env.WORKFLOW_RUN_PR_FOR_CREATE_CLOUDFLARE }} - ``` - - Note that these links will no longer work once [the GitHub Actions artifact expires](https://docs.github.com/en/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization). diff --git a/fixtures/node-app-pages/tests/index.test.ts b/fixtures/node-app-pages/tests/index.test.ts index 5b9df6f26e00..e9c1d1d2458a 100644 --- a/fixtures/node-app-pages/tests/index.test.ts +++ b/fixtures/node-app-pages/tests/index.test.ts @@ -12,12 +12,14 @@ describe("Pages Dev", () => { "public", ["--node-compat", "--port=0"] ); - const response = await fetch(`http://${ip}:${port}/stripe`); + try { + const response = await fetch(`http://${ip}:${port}/stripe`); - await expect(response.text()).resolves.toContain( - `"PATH":"path/to/some-file","STRIPE_OBJECT"` - ); - - await stop(); + await expect(response.text()).resolves.toContain( + `"PATH":"path/to/some-file","STRIPE_OBJECT"` + ); + } finally { + await stop(); + } }); }); diff --git a/fixtures/pages-functions-app/tests/index.test.ts b/fixtures/pages-functions-app/tests/index.test.ts index 6076f513e3e6..3c3ad7a6e045 100644 --- a/fixtures/pages-functions-app/tests/index.test.ts +++ b/fixtures/pages-functions-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Functions", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -20,7 +20,7 @@ describe("Pages Functions", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("renders static pages", async ({ expect }) => { diff --git a/fixtures/pages-functions-wasm-app/tests/index.test.ts b/fixtures/pages-functions-wasm-app/tests/index.test.ts index 9de41e8b75b7..4ab617ea67ec 100644 --- a/fixtures/pages-functions-wasm-app/tests/index.test.ts +++ b/fixtures/pages-functions-wasm-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Functions with wasm module imports", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages Functions with wasm module imports", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("should render static pages", async ({ expect }) => { diff --git a/fixtures/pages-functions-with-routes-app/tests/index.test.ts b/fixtures/pages-functions-with-routes-app/tests/index.test.ts index d24a5cd83c6a..a27f3acac751 100644 --- a/fixtures/pages-functions-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-functions-with-routes-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Functions with custom _routes.json", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages Functions with custom _routes.json", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("should render static pages", async ({ expect }) => { diff --git a/fixtures/pages-simple-assets/tests/index.test.ts b/fixtures/pages-simple-assets/tests/index.test.ts index d51e4b2fa835..8971777f0770 100644 --- a/fixtures/pages-simple-assets/tests/index.test.ts +++ b/fixtures/pages-simple-assets/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, afterAll, beforeAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Functions", async () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages Functions", async () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("renders static pages", async ({ expect }) => { diff --git a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts index 96d8fe49ffb4..0c57ef2a841f 100644 --- a/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-and-functions-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages project with `_worker.js` and `/functions` directory", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages project with `_worker.js` and `/functions` directory", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("renders static pages", async ({ expect }) => { diff --git a/fixtures/pages-workerjs-app/tests/index.test.ts b/fixtures/pages-workerjs-app/tests/index.test.ts index 1eb40a4927f3..cefc89e00471 100644 --- a/fixtures/pages-workerjs-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-app/tests/index.test.ts @@ -35,10 +35,13 @@ describe("Pages _worker.js", () => { "./workerjs-test", ["--no-bundle=false", "--port=0"] ); - await expect( - fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) - ).resolves.toContain("test"); - await stop(); + try { + await expect( + fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) + ).resolves.toContain("test"); + } finally { + await stop(); + } }); it("should not throw an error when the _worker.js file imports something if --bundle is true", async ({ @@ -49,9 +52,12 @@ describe("Pages _worker.js", () => { "./workerjs-test", ["--bundle", "--port=0"] ); - await expect( - fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) - ).resolves.toContain("test"); - await stop(); + try { + await expect( + fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) + ).resolves.toContain("test"); + } finally { + await stop(); + } }); }); diff --git a/fixtures/pages-workerjs-directory/tests/index.test.ts b/fixtures/pages-workerjs-directory/tests/index.test.ts index 94780a1b7632..02df3426086d 100644 --- a/fixtures/pages-workerjs-directory/tests/index.test.ts +++ b/fixtures/pages-workerjs-directory/tests/index.test.ts @@ -24,36 +24,41 @@ describe("Pages _worker.js/ directory", () => { "--r2=R2_REF=other_r2", ] ); - await expect( - fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) - ).resolves.toContain("Hello, world!"); - await expect( - fetch(`http://${ip}:${port}/wasm`).then((resp) => resp.text()) - ).resolves.toContain("3"); - await expect( - fetch(`http://${ip}:${port}/static-js`).then((resp) => resp.text()) - ).resolves.toEqual("static import text (via js): 'js static'"); - await expect( - fetch(`http://${ip}:${port}/static-mjs`).then((resp) => resp.text()) - ).resolves.toEqual("static import text (via mjs): 'mjs static'"); - await expect( - fetch(`http://${ip}:${port}/other-script.js`).then((resp) => resp.text()) - ).resolves.toContain("other-script-test"); - await expect( - fetch(`http://${ip}:${port}/other-other-script.mjs`).then((resp) => - resp.text() - ) - ).resolves.toContain("other-other-script-test"); - await expect( - fetch(`http://${ip}:${port}/d1`).then((resp) => resp.text()) - ).resolves.toContain('{"1":1}'); - await expect( - fetch(`http://${ip}:${port}/kv`).then((resp) => resp.text()) - ).resolves.toContain("saved"); - await expect( - fetch(`http://${ip}:${port}/r2`).then((resp) => resp.text()) - ).resolves.toContain("saved"); - await stop(); + try { + await expect( + fetch(`http://${ip}:${port}/`).then((resp) => resp.text()) + ).resolves.toContain("Hello, world!"); + await expect( + fetch(`http://${ip}:${port}/wasm`).then((resp) => resp.text()) + ).resolves.toContain("3"); + await expect( + fetch(`http://${ip}:${port}/static-js`).then((resp) => resp.text()) + ).resolves.toEqual("static import text (via js): 'js static'"); + await expect( + fetch(`http://${ip}:${port}/static-mjs`).then((resp) => resp.text()) + ).resolves.toEqual("static import text (via mjs): 'mjs static'"); + await expect( + fetch(`http://${ip}:${port}/other-script.js`).then((resp) => + resp.text() + ) + ).resolves.toContain("other-script-test"); + await expect( + fetch(`http://${ip}:${port}/other-other-script.mjs`).then((resp) => + resp.text() + ) + ).resolves.toContain("other-other-script-test"); + await expect( + fetch(`http://${ip}:${port}/d1`).then((resp) => resp.text()) + ).resolves.toContain('{"1":1}'); + await expect( + fetch(`http://${ip}:${port}/kv`).then((resp) => resp.text()) + ).resolves.toContain("saved"); + await expect( + fetch(`http://${ip}:${port}/r2`).then((resp) => resp.text()) + ).resolves.toContain("saved"); + } finally { + await stop(); + } expect(existsSync(join(tmpDir, "./v3/d1/D1"))).toBeTruthy(); expect(existsSync(join(tmpDir, "./v3/d1/elsewhere"))).toBeTruthy(); diff --git a/fixtures/pages-workerjs-wasm-app/tests/index.test.ts b/fixtures/pages-workerjs-wasm-app/tests/index.test.ts index ef1c505acde6..a92423b8f163 100644 --- a/fixtures/pages-workerjs-wasm-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-wasm-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Advanced Mode with wasm module imports", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages Advanced Mode with wasm module imports", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("should render static pages", async ({ expect }) => { diff --git a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts index de4638cbf67f..141b91585420 100644 --- a/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts +++ b/fixtures/pages-workerjs-with-routes-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerPagesDev } from "../../shared/src/run-wrangler-long-lived"; describe("Pages Advanced Mode with custom _routes.json", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerPagesDev( @@ -15,7 +15,7 @@ describe("Pages Advanced Mode with custom _routes.json", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("renders static pages", async ({ expect }) => { diff --git a/fixtures/pages-ws-app/package.json b/fixtures/pages-ws-app/package.json index bffd109204b5..ab9504ad4850 100644 --- a/fixtures/pages-ws-app/package.json +++ b/fixtures/pages-ws-app/package.json @@ -16,7 +16,7 @@ }, "devDependencies": { "@cloudflare/workers-tsconfig": "*", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "wrangler": "*", "ws": "^8.8.0" }, diff --git a/fixtures/remix-pages-app/tests/index.test.ts b/fixtures/remix-pages-app/tests/index.test.ts index 2859c3e89c9e..1ce0e61971f2 100644 --- a/fixtures/remix-pages-app/tests/index.test.ts +++ b/fixtures/remix-pages-app/tests/index.test.ts @@ -9,7 +9,7 @@ const isWindows = process.platform === "win32"; describe("Remix", () => { let ip: string; let port: number; - let stop: () => void; + let stop: (() => Promise) | undefined; beforeAll(async () => { spawnSync("npm", ["run", "build"], { @@ -23,7 +23,9 @@ describe("Remix", () => { )); }); - afterAll(async () => await stop()); + afterAll(async () => { + await stop?.(); + }); it("renders", async ({ expect }) => { const response = await fetch(`http://${ip}:${port}/`); diff --git a/fixtures/shared/src/run-wrangler-long-lived.ts b/fixtures/shared/src/run-wrangler-long-lived.ts index 9136998c59ab..4b52330215a9 100644 --- a/fixtures/shared/src/run-wrangler-long-lived.ts +++ b/fixtures/shared/src/run-wrangler-long-lived.ts @@ -29,25 +29,46 @@ export async function runWranglerDev(cwd: string, options: string[]) { } async function runLongLivedWrangler(command: string[], cwd: string) { + let settledReadyPromise = false; let resolveReadyPromise: (value: { ip: string; port: number }) => void; + let rejectReadyPromise: (reason: unknown) => void; - const ready = new Promise<{ ip: string; port: number }>( - (resolve) => (resolveReadyPromise = resolve) - ); + const ready = new Promise<{ ip: string; port: number }>((resolve, reject) => { + resolveReadyPromise = resolve; + rejectReadyPromise = reject; + }); const wranglerProcess = fork( "../../packages/wrangler/bin/wrangler.js", command, { - stdio: ["ignore", "ignore", "ignore", "ipc"], - // If you have a test timing out unexpectedly, then try using this line to find out what is happening in Wrangler. - // stdio: ["inherit", "inherit", "inherit", "ipc"], + stdio: [/*stdin*/ "ignore", /*stdout*/ "inherit", /*stderr*/ "inherit", "ipc"], cwd, } ).on("message", (message) => { + if (settledReadyPromise) return; + settledReadyPromise = true; + clearTimeout(timeoutHandle); resolveReadyPromise(JSON.parse(message.toString())); }); + const chunks: Buffer[] = []; + wranglerProcess.stdout?.on("data", (chunk) => chunks.push(chunk)); + wranglerProcess.stderr?.on("data", (chunk) => chunks.push(chunk)); + + const timeoutHandle = setTimeout(() => { + if (settledReadyPromise) return; + settledReadyPromise = true; + const separator = "=".repeat(80); + const message = [ + "Timed out starting long-lived Wrangler:", + separator, + Buffer.concat(chunks).toString(), + separator, + ].join("\n"); + rejectReadyPromise(new Error(message)); + }, 10_000); + async function stop() { return new Promise((resolve, reject) => { wranglerProcess.once("exit", (code) => { diff --git a/fixtures/worker-app/tests/index.test.ts b/fixtures/worker-app/tests/index.test.ts index 8606ad033dce..679c0f7d2977 100644 --- a/fixtures/worker-app/tests/index.test.ts +++ b/fixtures/worker-app/tests/index.test.ts @@ -4,7 +4,7 @@ import { describe, it, beforeAll, afterAll } from "vitest"; import { runWranglerDev } from "../../shared/src/run-wrangler-long-lived"; describe("'wrangler dev' correctly renders pages", () => { - let ip: string, port: number, stop: () => Promise; + let ip: string, port: number, stop: (() => Promise) | undefined; beforeAll(async () => { ({ ip, port, stop } = await runWranglerDev(resolve(__dirname, ".."), [ @@ -14,7 +14,7 @@ describe("'wrangler dev' correctly renders pages", () => { }); afterAll(async () => { - await stop(); + await stop?.(); }); it("renders ", async ({ expect }) => { diff --git a/package-lock.json b/package-lock.json index a895828b3acb..7968ed583bda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -260,7 +260,7 @@ "version": "0.1.1", "devDependencies": { "@cloudflare/workers-tsconfig": "*", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "wrangler": "*", "ws": "^8.8.0" }, @@ -268,6 +268,144 @@ "node": ">=14" } }, + "fixtures/pages-ws-app/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "fixtures/pages-ws-app/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "fixtures/pages-ws-app/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "fixtures/pages-ws-app/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "fixtures/pages-ws-app/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "fixtures/pages-ws-app/node_modules/miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "engines": { + "node": ">=16.13" + } + }, + "fixtures/pages-ws-app/node_modules/undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "dev": true, + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "fixtures/pages-ws-app/node_modules/workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "dev": true, + "hasInstallScript": true, + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, "fixtures/pages-ws-app/node_modules/ws": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", @@ -2577,7 +2715,7 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "dev": true, + "extraneous": true, "inBundle": true, "license": "MIT", "engines": { @@ -2642,81 +2780,6 @@ "io-ts": "^2.0.1" } }, - "node_modules/@cloudflare/workerd-darwin-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230814.1.tgz", - "integrity": "sha512-aQUO7q7qXl+SVtOiMMlVKLNOSeL6GX43RKeflwzsD74dGgyHPiSfw5KCvXhkVbyN7u+yYF6HyFdaIvHLfn5jyA==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-darwin-arm64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230814.1.tgz", - "integrity": "sha512-U2mcgi+AiuI/4EY5Wk/GmygiNoCNw/V2mcHmxESqe4r6XbJYOzBdEsjnqJ05rqd0JlEM8m64jRtE6/qBnQHygg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-linux-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230814.1.tgz", - "integrity": "sha512-Q4kITXLTCuG2i2Z01fbb5AjVRRIf3+lS4ZVsFbTbIwtcOOG4Ozcw7ee7tKsFES7hFqR4Eg9gMG4/aS0mmi+L2g==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-linux-arm64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230814.1.tgz", - "integrity": "sha512-BX5SaksXw+pkREVw3Rw2eSNXplqZw+14CcwW/5x/4oq/C6yn5qCvKxJfM7pukJGMI4wkJPOYops7B3g27FB/HA==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16" - } - }, - "node_modules/@cloudflare/workerd-windows-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230814.1.tgz", - "integrity": "sha512-GWHqfyhsG/1wm2W8afkYX3q3fWXUWWD8NGtHfAs6ZVTHdW3mmYyMhKR0lc6ptBwz5i5aXRlP2S+CxxxwwDbKpw==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16" - } - }, "node_modules/@cloudflare/workers-tsconfig": { "resolved": "packages/workers-tsconfig", "link": true @@ -21316,52 +21379,6 @@ "node": ">=4" } }, - "node_modules/miniflare": { - "version": "3.20230814.1", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230814.1.tgz", - "integrity": "sha512-LMgqd1Ut0+fnlvQepVbbBYQczQnyuuap8bgUwOyPETka0S9NR9NxMQSNaBgVZ0uOaG7xMJ/OVTRlz+TGB86PWA==", - "dependencies": { - "acorn": "^8.8.0", - "acorn-walk": "^8.2.0", - "better-sqlite3": "^8.1.0", - "capnp-ts": "^0.7.0", - "exit-hook": "^2.2.1", - "glob-to-regexp": "^0.4.1", - "http-cache-semantics": "^4.1.0", - "kleur": "^4.1.5", - "set-cookie-parser": "^2.6.0", - "source-map-support": "0.5.21", - "stoppable": "^1.1.0", - "undici": "^5.13.0", - "workerd": "1.20230814.1", - "ws": "^8.11.0", - "youch": "^3.2.2", - "zod": "^3.20.6" - }, - "engines": { - "node": ">=16.13" - } - }, - "node_modules/miniflare/node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -27873,6 +27890,7 @@ "version": "5.20.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "dev": true, "dependencies": { "busboy": "^1.6.0" }, @@ -29833,25 +29851,6 @@ "resolved": "fixtures/worker-ts", "link": true }, - "node_modules/workerd": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230814.1.tgz", - "integrity": "sha512-zJeSEteXuAD+bpYJT8WvzTAHvIAkKPVxOV+Jy6zCLKz5e08N3OUbAF+wrvGWc8b2aB1sj+IYsdXfkv4puH+qXQ==", - "hasInstallScript": true, - "bin": { - "workerd": "bin/workerd" - }, - "engines": { - "node": ">=16" - }, - "optionalDependencies": { - "@cloudflare/workerd-darwin-64": "1.20230814.1", - "@cloudflare/workerd-darwin-arm64": "1.20230814.1", - "@cloudflare/workerd-linux-64": "1.20230814.1", - "@cloudflare/workerd-linux-arm64": "1.20230814.1", - "@cloudflare/workerd-windows-64": "1.20230814.1" - } - }, "node_modules/workers-chat-demo": { "resolved": "fixtures/workers-chat-demo", "link": true @@ -31182,7 +31181,7 @@ "name": "@cloudflare/pages-shared", "version": "0.8.1", "dependencies": { - "miniflare": "3.20230814.1" + "miniflare": "3.20230821.0" }, "devDependencies": { "@cloudflare/workers-tsconfig": "*", @@ -31194,6 +31193,81 @@ "wrangler": "*" } }, + "packages/pages-shared/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/pages-shared/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/pages-shared/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/pages-shared/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/pages-shared/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, "packages/pages-shared/node_modules/@cloudflare/workers-types": { "version": "4.20230511.0", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230511.0.tgz", @@ -31228,6 +31302,31 @@ "url": "https://github.com/sponsors/isaacs" } }, + "packages/pages-shared/node_modules/miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "dependencies": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "engines": { + "node": ">=16.13" + } + }, "packages/pages-shared/node_modules/minimatch": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", @@ -31240,6 +31339,56 @@ "node": ">=10" } }, + "packages/pages-shared/node_modules/undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "packages/pages-shared/node_modules/workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "hasInstallScript": true, + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, + "packages/pages-shared/node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "packages/prerelease-registry": { "name": "@cloudflare/prerelease-registry", "version": "0.0.2", @@ -32171,7 +32320,7 @@ "blake3-wasm": "^2.1.5", "chokidar": "^3.5.3", "esbuild": "0.16.3", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.2.0", "selfsigned": "^2.0.1", @@ -32275,6 +32424,81 @@ "wrangler": "^3.0.0" } }, + "packages/wrangler/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/wrangler/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/wrangler/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/wrangler/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/wrangler/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, "packages/wrangler/node_modules/@cloudflare/workers-types": { "version": "4.20230724.0", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230724.0.tgz", @@ -32344,6 +32568,42 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/wrangler/node_modules/miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "dependencies": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "engines": { + "node": ">=16.13" + } + }, + "packages/wrangler/node_modules/miniflare/node_modules/undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, "packages/wrangler/node_modules/minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", @@ -32418,11 +32678,29 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "packages/wrangler/node_modules/workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "hasInstallScript": true, + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, "packages/wrangler/node_modules/ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, "engines": { "node": ">=10.0.0" }, @@ -35510,7 +35788,7 @@ "is-unicode-supported": { "version": "1.3.0", "bundled": true, - "dev": true + "extraneous": true } } }, @@ -35547,11 +35825,41 @@ "@types/service-worker-mock": "^2.0.1", "concurrently": "^7.3.0", "glob": "^8.0.3", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "service-worker-mock": "^2.0.5", "wrangler": "*" }, "dependencies": { + "@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "optional": true + }, "@cloudflare/workers-types": { "version": "4.20230511.0", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230511.0.tgz", @@ -35580,6 +35888,28 @@ "once": "^1.3.0" } }, + "miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "requires": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + } + }, "minimatch": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.1.tgz", @@ -35588,6 +35918,32 @@ "requires": { "brace-expansion": "^2.0.1" } + }, + "undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "requires": { + "busboy": "^1.6.0" + } + }, + "workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "requires": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, + "ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "requires": {} } } }, @@ -35710,36 +36066,6 @@ "io-ts": "^2.0.1" } }, - "@cloudflare/workerd-darwin-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230814.1.tgz", - "integrity": "sha512-aQUO7q7qXl+SVtOiMMlVKLNOSeL6GX43RKeflwzsD74dGgyHPiSfw5KCvXhkVbyN7u+yYF6HyFdaIvHLfn5jyA==", - "optional": true - }, - "@cloudflare/workerd-darwin-arm64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230814.1.tgz", - "integrity": "sha512-U2mcgi+AiuI/4EY5Wk/GmygiNoCNw/V2mcHmxESqe4r6XbJYOzBdEsjnqJ05rqd0JlEM8m64jRtE6/qBnQHygg==", - "optional": true - }, - "@cloudflare/workerd-linux-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230814.1.tgz", - "integrity": "sha512-Q4kITXLTCuG2i2Z01fbb5AjVRRIf3+lS4ZVsFbTbIwtcOOG4Ozcw7ee7tKsFES7hFqR4Eg9gMG4/aS0mmi+L2g==", - "optional": true - }, - "@cloudflare/workerd-linux-arm64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230814.1.tgz", - "integrity": "sha512-BX5SaksXw+pkREVw3Rw2eSNXplqZw+14CcwW/5x/4oq/C6yn5qCvKxJfM7pukJGMI4wkJPOYops7B3g27FB/HA==", - "optional": true - }, - "@cloudflare/workerd-windows-64": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230814.1.tgz", - "integrity": "sha512-GWHqfyhsG/1wm2W8afkYX3q3fWXUWWD8NGtHfAs6ZVTHdW3mmYyMhKR0lc6ptBwz5i5aXRlP2S+CxxxwwDbKpw==", - "optional": true - }, "@cloudflare/workers-tsconfig": { "version": "file:packages/workers-tsconfig" }, @@ -49061,37 +49387,6 @@ "min-indent": { "version": "1.0.1" }, - "miniflare": { - "version": "3.20230814.1", - "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230814.1.tgz", - "integrity": "sha512-LMgqd1Ut0+fnlvQepVbbBYQczQnyuuap8bgUwOyPETka0S9NR9NxMQSNaBgVZ0uOaG7xMJ/OVTRlz+TGB86PWA==", - "requires": { - "acorn": "^8.8.0", - "acorn-walk": "^8.2.0", - "better-sqlite3": "^8.1.0", - "capnp-ts": "^0.7.0", - "exit-hook": "^2.2.1", - "glob-to-regexp": "^0.4.1", - "http-cache-semantics": "^4.1.0", - "kleur": "^4.1.5", - "set-cookie-parser": "^2.6.0", - "source-map-support": "0.5.21", - "stoppable": "^1.1.0", - "undici": "^5.13.0", - "workerd": "1.20230814.1", - "ws": "^8.11.0", - "youch": "^3.2.2", - "zod": "^3.20.6" - }, - "dependencies": { - "ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "requires": {} - } - } - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -50168,11 +50463,91 @@ "version": "file:fixtures/pages-ws-app", "requires": { "@cloudflare/workers-tsconfig": "*", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "wrangler": "*", "ws": "^8.8.0" }, "dependencies": { + "@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "dev": true, + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "dev": true, + "optional": true + }, + "miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "dev": true, + "requires": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + } + }, + "undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "dev": true, + "requires": { + "busboy": "^1.6.0" + } + }, + "workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "dev": true, + "requires": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, "ws": { "version": "8.11.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", @@ -54037,6 +54412,7 @@ "version": "5.20.0", "resolved": "https://registry.npmjs.org/undici/-/undici-5.20.0.tgz", "integrity": "sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==", + "dev": true, "requires": { "busboy": "^1.6.0" } @@ -55382,18 +55758,6 @@ } } }, - "workerd": { - "version": "1.20230814.1", - "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230814.1.tgz", - "integrity": "sha512-zJeSEteXuAD+bpYJT8WvzTAHvIAkKPVxOV+Jy6zCLKz5e08N3OUbAF+wrvGWc8b2aB1sj+IYsdXfkv4puH+qXQ==", - "requires": { - "@cloudflare/workerd-darwin-64": "1.20230814.1", - "@cloudflare/workerd-darwin-arm64": "1.20230814.1", - "@cloudflare/workerd-linux-64": "1.20230814.1", - "@cloudflare/workerd-linux-arm64": "1.20230814.1", - "@cloudflare/workerd-windows-64": "1.20230814.1" - } - }, "workers-chat-demo": { "version": "file:fixtures/workers-chat-demo" }, @@ -55473,7 +55837,7 @@ "jest-fetch-mock": "^3.0.3", "jest-websocket-mock": "^2.3.0", "mime": "^3.0.0", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "minimatch": "^5.1.0", "msw": "^0.49.1", "nanoid": "^3.3.3", @@ -55507,6 +55871,36 @@ "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz" }, "dependencies": { + "@cloudflare/workerd-darwin-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230821.0.tgz", + "integrity": "sha512-P41/PwGU09AwjIg4HyadMxFHZgpibZ7LUzpnXGU+WvgqOQwxhY05xHlsXqDDR2oVkY1IIY+ReghBzn7OEwvppw==", + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230821.0.tgz", + "integrity": "sha512-g0dPoHN7QOekp0zWnknkoObYCVnZ9qcpWW+VNFGG08lL/j730IQWY4dnbeho99yPHyoEW8SsiYGlB75CUL38gw==", + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230821.0.tgz", + "integrity": "sha512-snHR2jzXR00XZSQ3mPBcWWMvqwSRI/ZjlJuEFU+VSkEg/SJKaftM3XApGG8fUSdcRifdd3BkSzpIrzsek8T6sg==", + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230821.0.tgz", + "integrity": "sha512-U/M0Aw0bPcVZn/Ok921BmAnyu9VYBJO7ToeAqXkS7+riV1QtM7awep1wvoJVfjqpicInZZu6g9bsJo1W6vzyNg==", + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230821.0.tgz", + "integrity": "sha512-+QRkgLp+zMBaIGcCzFidTV0gLe7w0vswxCzgvY9QAWx0DRWrR1ihvLYdOWduFtD4RxhjRydIMTK2oZgjRpA7/w==", + "optional": true + }, "@cloudflare/workers-types": { "version": "4.20230724.0", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20230724.0.tgz", @@ -55551,6 +55945,38 @@ "p-locate": "^6.0.0" } }, + "miniflare": { + "version": "3.20230821.0", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230821.0.tgz", + "integrity": "sha512-V+p/f2T6Yj5n/3t1Szl+0MZFeuqRTQ7r1KcLU6bPj2cCX6woE2CoHbiMHHWkg/dIyv/yX0QuZgayr7ci+y3KwQ==", + "requires": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "better-sqlite3": "^8.1.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "http-cache-semantics": "^4.1.0", + "kleur": "^4.1.5", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20230821.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "dependencies": { + "undici": { + "version": "5.23.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.23.0.tgz", + "integrity": "sha512-1D7w+fvRsqlQ9GscLBwcAJinqcZGHUKjbOmXdlE/v8BvEGXjeWAax+341q44EuTcHXXnfyKNbKRq4Lg7OzhMmg==", + "requires": { + "busboy": "^1.6.0" + } + } + } + }, "minimatch": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.0.tgz", @@ -55591,11 +56017,22 @@ "version": "9.2.2", "dev": true }, + "workerd": { + "version": "1.20230821.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230821.0.tgz", + "integrity": "sha512-jLqa4zjQihfgkzoNMwkq39izZ3iAHrQQISPWVLc642j/J0mCus1HuKl89U3zbMNwWytwe0lcpMXNFTRYR8PR7A==", + "requires": { + "@cloudflare/workerd-darwin-64": "1.20230821.0", + "@cloudflare/workerd-darwin-arm64": "1.20230821.0", + "@cloudflare/workerd-linux-64": "1.20230821.0", + "@cloudflare/workerd-linux-arm64": "1.20230821.0", + "@cloudflare/workerd-windows-64": "1.20230821.0" + } + }, "ws": { "version": "8.13.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, "requires": {} }, "yocto-queue": { diff --git a/packages/pages-shared/package.json b/packages/pages-shared/package.json index 6e4c3e95bb70..9580ba872305 100644 --- a/packages/pages-shared/package.json +++ b/packages/pages-shared/package.json @@ -18,7 +18,7 @@ "test:ci": "vitest run" }, "dependencies": { - "miniflare": "3.20230814.1" + "miniflare": "3.20230821.0" }, "devDependencies": { "@cloudflare/workers-tsconfig": "*", diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index 0b3ceac83536..b95bacce68a0 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -103,7 +103,7 @@ "blake3-wasm": "^2.1.5", "chokidar": "^3.5.3", "esbuild": "0.16.3", - "miniflare": "3.20230814.1", + "miniflare": "3.20230821.0", "nanoid": "^3.3.3", "path-to-regexp": "^6.2.0", "selfsigned": "^2.0.1", diff --git a/packages/wrangler/src/r2/index.ts b/packages/wrangler/src/r2/index.ts index 7b1a92b05244..4dde7aaf1274 100644 --- a/packages/wrangler/src/r2/index.ts +++ b/packages/wrangler/src/r2/index.ts @@ -1,7 +1,11 @@ import { Blob } from "node:buffer"; import * as fs from "node:fs"; import * as stream from "node:stream"; -import { createFileReadableStream, R2ObjectBody, R2Object } from "miniflare"; +import { + createFileReadableStream, + InternalR2ObjectBody as MiniflareR2ObjectBody, + InternalR2Object as MiniflareR2Object, +} from "miniflare"; import prettyBytes from "pretty-bytes"; import { readConfig } from "../config"; @@ -85,9 +89,9 @@ export function r2(r2Yargs: CommonYargsArgv) { bucket ); const object = await gateway.get(key); - if (object instanceof R2ObjectBody) { + if (object instanceof MiniflareR2ObjectBody) { input = object.body; - } else if (object instanceof R2Object) { + } else if (object instanceof MiniflareR2Object) { input = object.encode().value; } } else {