diff --git a/.changeset/aggregate.mjs b/.changeset/aggregate.mjs deleted file mode 100644 index 6264e4ec..00000000 --- a/.changeset/aggregate.mjs +++ /dev/null @@ -1,50 +0,0 @@ -import { execSync } from "node:child_process"; -import fs from "node:fs/promises"; -import path from "node:path"; - -const THANKLESS_COMMITTERS = ["thdxr", "fwang", "jayair", "conico974"]; - -const { version } = JSON.parse( - await fs.readFile("./packages/open-next/package.json"), -); - -const changes = new Set(); - -// We only need to look for changes in packages/open-next -const changelog = path.join("packages", "open-next", "CHANGELOG.md"); -const lines = (await fs.readFile(changelog)).toString().split("\n"); -let start = false; -for (let line of lines) { - if (!start) { - if (line === `## ${version}`) { - start = true; - continue; - } - } - - if (start) { - if (line.startsWith("-") || line.startsWith("*")) { - if (line.includes("Updated dependencies")) continue; - if (line.includes("@serverless-stack/")) continue; - - for (const user of THANKLESS_COMMITTERS) { - line = line.replace( - `Thanks [@${user}](https://github.com/${user})! `, - "", - ); - } - changes.add(line); - continue; - } - - if (line.startsWith("## ")) break; - } -} - -const notes = ["#### Changes", ...changes]; -console.log(notes.join("\n")); -console.log(`::set-output name=notes::${notes.join("%0A")}`); -console.log(`::set-output name=version::v${version}`); - -execSync(`git tag v${version}`); -execSync("git push origin --tags"); diff --git a/.changeset/config.json b/.changeset/config.json index 07d8fe62..a6cea3e6 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,13 +2,14 @@ "$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json", "changelog": [ "@changesets/changelog-github", - { "repo": "opennextjs/opennextjs-aws" } + { "repo": "opennextjs/adapters-api" } ], "commit": false, - "fixed": [["@opennextjs/aws"]], + "fixed": [], "linked": [], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": [], + "privatePackages": false } diff --git a/.changeset/release b/.changeset/release deleted file mode 100755 index ca4a5dda..00000000 --- a/.changeset/release +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -pnpm build -#cp packages/open-next/package.json packages/open-next/dist/package.json -cp README.md packages/open-next/README.md -#sed -i.bak -e '2,5d' packages/open-next/dist/package.json -pnpm changeset publish \ No newline at end of file diff --git a/.changeset/version b/.changeset/version deleted file mode 100755 index 819bc6bf..00000000 --- a/.changeset/version +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -pnpm changeset version \ No newline at end of file diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml deleted file mode 100644 index 9df17b08..00000000 --- a/.github/actions/install-dependencies/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Install Dependencies" -description: "Install dependencies, fetching from cache when possible" -inputs: - node-version: - description: the version of Node.js to install - default: 22 - -runs: - using: "composite" - steps: - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install Node.js ${{ inputs.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ inputs.node-version }} - cache: "pnpm" - registry-url: "https://registry.npmjs.org" - - # Enable node compile cache (effective for Node 22+) - # See https://nodejs.org/docs/v24.11.1/api/module.html#module-compile-cache - - name: Enable Node Compile Cache - shell: bash - run: echo "NODE_COMPILE_CACHE=$HOME/.node_compile_cache" >> $GITHUB_ENV - - - name: Install NPM Dependencies - shell: bash - run: pnpm install --frozen-lockfile diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml deleted file mode 100644 index 4e4acea8..00000000 --- a/.github/actions/lint/action.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Lint codebase -description: Run biome to lint codebase and ensure code quality - -runs: - using: "composite" - steps: - - name: Setup Biome CLI - uses: biomejs/setup-biome@v2.2.1 - - - name: Run biome - run: biome ci --reporter=github - shell: bash diff --git a/.github/actions/local/build/action.yml b/.github/actions/local/build/action.yml deleted file mode 100644 index 2ce18f8c..00000000 --- a/.github/actions/local/build/action.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Build OpenNext package -description: Installs dependencies and builds OpenNext -runs: - using: 'composite' - steps: - # Build only the @opennextjs/aws package + its monorepo dependencies - - name: Build - shell: bash - run: pnpm --filter @opennextjs/aws... run build \ No newline at end of file diff --git a/.github/actions/local/e2e/action.yml b/.github/actions/local/e2e/action.yml deleted file mode 100644 index 6f54461e..00000000 --- a/.github/actions/local/e2e/action.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: E2E Local -description: Runs E2E tests locally with development overrides -runs: - using: 'composite' - steps: - - name: Setup Playwright - uses: ./.github/actions/setup-playwright - - - name: Build examples apps with local configuration - shell: bash - run: pnpm -r openbuild:local - - # Remember to add more ports here if we add new examples app - - name: Start the local OpenNext servers - shell: bash - run: | - pnpm -r openbuild:local:start & - for port in 3001 3002 3003 3004; do - echo "Checking port $port..." - for attempt in {1..20}; do - sleep 0.5 - if curl --silent --fail http://localhost:$port > /dev/null; then - echo "Server on $port is ready" - break - fi - if [ $attempt -eq 20 ]; then - echo "Server on $port failed to start" - exit 1 - fi - echo "Waiting for server on $port, attempt $attempt..." - done - done - - name: Run E2E Test locally - shell: bash - run: | - pnpm e2e:test - - ## Do we want to report to Discord? \ No newline at end of file diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3975236e..cf7646bf 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -3,47 +3,30 @@ description: Install's node, pnpm, restores cache, and then installs dependencie inputs: node-version: - default: 20.x - registry-url: - default: "https://registry.npmjs.org" + description: Node.js version to install + default: '24' runs: - using: 'composite' + using: composite steps: - # Install nodejs. https://github.com/actions/setup-node - - name: Setup Node.js - uses: actions/setup-node@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 with: - node-version: ${{ inputs.node-version }} - registry-url: ${{ inputs.registry-url }} - - # Ensure npm 11.5.1 or later is installed - # See https://docs.npmjs.com/trusted-publishers - # Note that pnpm publish runs npm publish - - name: Update npm - shell: bash - run: npm install -g npm@latest + version: 10 - # Install pnpm. https://github.com/pnpm/action-setup - - uses: pnpm/action-setup@v4 + - name: Install Node.js ${{ inputs.node-version }} + uses: actions/setup-node@v6 with: - version: 9 - # run_install: false + node-version: ${{ inputs.node-version }} + registry-url: https://registry.npmjs.org + cache: pnpm - # Get pnpm store path so we can cache it - - name: Get pnpm store directory + # Enable node compile cache (effective for Node 22+) + # See https://nodejs.org/docs/v24.11.1/api/module.html#module-compile-cache + - name: Enable Node Compile Cache shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v4 - name: Setup pnpm cache - with: - path: ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- + run: echo "NODE_COMPILE_CACHE=$HOME/.node_compile_cache" >> $GITHUB_ENV - name: Install dependencies - run: pnpm install - shell: bash \ No newline at end of file + shell: bash + run: pnpm install --frozen-lockfile diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml deleted file mode 100644 index 781d7314..00000000 --- a/.github/actions/test/action.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Unit tests -description: Run unit tests and ensure code quality - -runs: - using: 'composite' - steps: - - name: Run tests - run: pnpm test - shell: bash - - - name: Report test coverage - if: always() - uses: davelosert/vitest-coverage-report-action@v2 - with: - vite-config-path: ./packages/tests-unit/vitest.config.ts diff --git a/.github/workflows/changesets.yml b/.github/workflows/changesets.yml index 375eb5db..da19ba62 100644 --- a/.github/workflows/changesets.yml +++ b/.github/workflows/changesets.yml @@ -15,22 +15,22 @@ jobs: name: Handle Changesets runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: # See https://github.com/changesets/action/issues/187 - token: ${{ secrets.GH_ACCESS_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} fetch-depth: 0 + - uses: ./.github/actions/setup - - name: Install Dependencies - uses: ./.github/actions/install-dependencies - with: - # Needs 24 to get a version of npm that can handle trusted publishers - # See https://docs.npmjs.com/trusted-publishers - node-version: 24 + - name: Build packages + run: pnpm run build:opennext - - name: Build Cloudflare package - run: pnpm run build + # Ensure npm 11.5.1 or later is installed + # See https://docs.npmjs.com/trusted-publishers + # Note that pnpm publish runs npm publish + - name: Update npm + shell: bash + run: npm install -g npm@latest - name: Create Version PR or Publish to NPM id: changesets @@ -38,5 +38,5 @@ jobs: with: publish: pnpm exec changeset publish env: - GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - NODE_ENV: "production" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_ENV: production diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 408104e8..83a13b03 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -5,6 +5,10 @@ on: branches: [main, experimental] pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: checks: name: ${{ matrix.script }} @@ -14,11 +18,8 @@ jobs: matrix: script: ["prettier:check", "lint:check", "ts:check", "test"] steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup - name: ${{ matrix.script }} run: pnpm run ${{ matrix.script }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 09713748..a1f80914 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -11,6 +11,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 PLAYWRIGHT_BROWSERS_PATH: 0 diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index ceedbea6..33b12954 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -5,16 +5,17 @@ on: branches: [main] pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: timeout-minutes: 30 runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Install Dependencies - uses: ./.github/actions/install-dependencies + - uses: actions/checkout@v6 + - uses: ./.github/actions/setup - name: Install Playwright uses: ./.github/actions/setup-playwright diff --git a/.github/workflows/prereleases.yml b/.github/workflows/prereleases.yml index 68dd14fc..40225513 100644 --- a/.github/workflows/prereleases.yml +++ b/.github/workflows/prereleases.yml @@ -13,8 +13,6 @@ jobs: steps: - uses: actions/checkout@v6 - uses: ./.github/actions/setup - with: - node-version: 24 - name: Build packages run: pnpm build:opennext diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 6695e7db..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: Release - -on: - push: - branches: - - main - -concurrency: ${{ github.workflow }}-${{ github.ref }} - -permissions: - id-token: write - contents: write - pull-requests: write - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - # https://github.com/actions/checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: ./.github/actions/setup - with: - # Ensure npm 11.5.1 or later is installed - # See https://docs.npmjs.com/trusted-publishers - node-version: 24 - - - uses: ./.github/actions/lint - - - name: Create Release Pull Request or Publish to npm - id: changesets - # https://github.com/changesets/action - uses: changesets/action@v1 - with: - createGithubReleases: false - version: pnpm run version - publish: pnpm run release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: View outputs - run: echo ${{join(steps.changesets.outputs.*, ' ')}} - - - name: Aggregate - id: aggregate - if: steps.changesets.outputs.published == 'true' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - node ./.changeset/aggregate.mjs - - - name: Create Release - if: steps.changesets.outputs.published == 'true' - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.aggregate.outputs.version }} - release_name: ${{ steps.aggregate.outputs.version }} - body: ${{ steps.aggregate.outputs.notes }} - draft: false - prerelease: false diff --git a/package.json b/package.json index 8a696119..1c5e4cc0 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,6 @@ "e2e:dev": "pnpm build && pnpm -r e2e:dev", "install-playwright": "playwright install --with-deps", "benchmark": "pnpm run --filter benchmarking benchmark", - "version": "./.changeset/version", - "release": "./.changeset/release", "postinstall": "pnpm build:opennext" }, "devDependencies": {