From 43e61d24cb0d7c4e7689f7d7405fd55986fd386a Mon Sep 17 00:00:00 2001 From: blaine-arcjet <146491715+blaine-arcjet@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:09:37 -0700 Subject: [PATCH] chore(ci): Add newer examples to required checks (#299) This adds our newer examples to the CI matrix and required checks. --- .github/workflows/reusable-examples.yml | 126 ++++++++++++++++++ .trunk/trunk.yaml | 3 + examples/nextjs-14-clerk-rl/app/page.tsx | 4 +- examples/nextjs-14-clerk-rl/middleware.ts | 4 +- .../nextjs-14-clerk-shield/package-lock.json | 90 ++++++------- examples/nextjs-14-clerk-shield/package.json | 2 +- 6 files changed, 179 insertions(+), 50 deletions(-) diff --git a/.github/workflows/reusable-examples.yml b/.github/workflows/reusable-examples.yml index 9cc63192e..ca3e90696 100644 --- a/.github/workflows/reusable-examples.yml +++ b/.github/workflows/reusable-examples.yml @@ -123,6 +123,132 @@ jobs: working-directory: examples/nextjs-14-app-dir-validate-email run: npm run build + nextjs-14-clerk-rl: + name: Next.js 14 + Clerk + Rate Limit + runs-on: ubuntu-latest + permissions: + contents: read + steps: + # Environment security + - name: Harden Runner + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + fonts.googleapis.com:443 + fonts.gstatic.com:443 + github.com:443 + registry.npmjs.org:443 + + # Checkout + # Most toolchains require checkout first + - name: Checkout + uses: actions/checkout@v4 + + # Language toolchains + - name: Install Node + uses: actions/setup-node@v4.0.0 + with: + node-version: 20 + + # Workflow + + - name: Install dependencies + run: npm ci + + - name: Install example dependencies + working-directory: examples/nextjs-14-clerk-rl + run: npm ci + + - name: Build + working-directory: examples/nextjs-14-clerk-rl + run: npm run build + + nextjs-14-clerk-shield: + name: Next.js 14 + Clerk + Shield + runs-on: ubuntu-latest + permissions: + contents: read + steps: + # Environment security + - name: Harden Runner + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + fonts.googleapis.com:443 + fonts.gstatic.com:443 + github.com:443 + registry.npmjs.org:443 + + # Checkout + # Most toolchains require checkout first + - name: Checkout + uses: actions/checkout@v4 + + # Language toolchains + - name: Install Node + uses: actions/setup-node@v4.0.0 + with: + node-version: 20 + + # Workflow + + - name: Install dependencies + run: npm ci + + - name: Install example dependencies + working-directory: examples/nextjs-14-clerk-shield + run: npm ci + + - name: Build + working-directory: examples/nextjs-14-clerk-shield + run: npm run build + + nextjs-14-decorate: + name: Next.js 14 + Decorate + runs-on: ubuntu-latest + permissions: + contents: read + steps: + # Environment security + - name: Harden Runner + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + with: + disable-sudo: true + egress-policy: block + allowed-endpoints: > + fonts.googleapis.com:443 + fonts.gstatic.com:443 + github.com:443 + registry.npmjs.org:443 + + # Checkout + # Most toolchains require checkout first + - name: Checkout + uses: actions/checkout@v4 + + # Language toolchains + - name: Install Node + uses: actions/setup-node@v4.0.0 + with: + node-version: 20 + + # Workflow + + - name: Install dependencies + run: npm ci + + - name: Install example dependencies + working-directory: examples/nextjs-14-decorate + run: npm ci + + - name: Build + working-directory: examples/nextjs-14-decorate + run: npm run build + nextjs-14-openai: name: Next.js 14 + OpenAI runs-on: ubuntu-latest diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 741402582..2966f6fe4 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -63,5 +63,8 @@ merge: # - Build examples / Next.js 13 + Page Router + withArcjet - Build examples / Next.js 14 + App Router + Rate Limit - Build examples / Next.js 14 + App Router + Validate Email + - Build examples / Next.js 14 + Clerk + Rate Limit + - Build examples / Next.js 14 + Clerk + Shield + - Build examples / Next.js 14 + Decorate - Build examples / Next.js 14 + OpenAI - Build examples / Next.js 14 + Page Router + withArcjet diff --git a/examples/nextjs-14-clerk-rl/app/page.tsx b/examples/nextjs-14-clerk-rl/app/page.tsx index ff062c898..30f3d220e 100644 --- a/examples/nextjs-14-clerk-rl/app/page.tsx +++ b/examples/nextjs-14-clerk-rl/app/page.tsx @@ -45,8 +45,8 @@ export default function Home() {
- curl -v http://localhost:3000/api/arcjet -H "Authorization: Bearer - TOKENHERE" + curl -v http://localhost:3000/api/arcjet -H "Authorization: Bearer + TOKENHERE"diff --git a/examples/nextjs-14-clerk-rl/middleware.ts b/examples/nextjs-14-clerk-rl/middleware.ts index 7c87ef323..42582ea79 100644 --- a/examples/nextjs-14-clerk-rl/middleware.ts +++ b/examples/nextjs-14-clerk-rl/middleware.ts @@ -1,11 +1,11 @@ import { authMiddleware } from "@clerk/nextjs"; - + export default authMiddleware({ // Routes that can be accessed while signed out publicRoutes: ["/", '/api/public'], apiRoutes: ["/api/private"], }); - + export const config = { // Protects all routes, including api/trpc. // See https://clerk.com/docs/references/nextjs/auth-middleware diff --git a/examples/nextjs-14-clerk-shield/package-lock.json b/examples/nextjs-14-clerk-shield/package-lock.json index 358246121..bbac9ba63 100644 --- a/examples/nextjs-14-clerk-shield/package-lock.json +++ b/examples/nextjs-14-clerk-shield/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@arcjet/next": "file:../../arcjet-next", "@clerk/nextjs": "^4.29.9", - "next": "14.1.0", + "next": "14.1.1", "react": "^18", "react-dom": "^18" }, @@ -34,7 +34,7 @@ "@arcjet/ip": "1.0.0-alpha.8", "@connectrpc/connect-web": "1.4.0", "arcjet": "1.0.0-alpha.8", - "next": "14.1.0" + "next": "14.1.1" }, "devDependencies": { "@arcjet/eslint-config": "1.0.0-alpha.8", @@ -391,9 +391,9 @@ } }, "node_modules/@next/env": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.0.tgz", - "integrity": "sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==" + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.1.tgz", + "integrity": "sha512-7CnQyD5G8shHxQIIg3c7/pSeYFeMhsNbpU/bmvH7ZnDql7mNRgg8O2JZrhrc/soFnfBnKP4/xXNiiSIPn2w8gA==" }, "node_modules/@next/eslint-plugin-next": { "version": "14.1.1", @@ -405,9 +405,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.0.tgz", - "integrity": "sha512-nUDn7TOGcIeyQni6lZHfzNoo9S0euXnu0jhsbMOmMJUBfgsnESdjN97kM7cBqQxZa8L/bM9om/S5/1dzCrW6wQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.1.tgz", + "integrity": "sha512-yDjSFKQKTIjyT7cFv+DqQfW5jsD+tVxXTckSe1KIouKk75t1qZmj/mV3wzdmFb0XHVGtyRjDMulfVG8uCKemOQ==", "cpu": [ "arm64" ], @@ -420,9 +420,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.0.tgz", - "integrity": "sha512-1jgudN5haWxiAl3O1ljUS2GfupPmcftu2RYJqZiMJmmbBT5M1XDffjUtRUzP4W3cBHsrvkfOFdQ71hAreNQP6g==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.1.tgz", + "integrity": "sha512-KCQmBL0CmFmN8D64FHIZVD9I4ugQsDBBEJKiblXGgwn7wBCSe8N4Dx47sdzl4JAg39IkSN5NNrr8AniXLMb3aw==", "cpu": [ "x64" ], @@ -435,9 +435,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.0.tgz", - "integrity": "sha512-RHo7Tcj+jllXUbK7xk2NyIDod3YcCPDZxj1WLIYxd709BQ7WuRYl3OWUNG+WUfqeQBds6kvZYlc42NJJTNi4tQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.1.tgz", + "integrity": "sha512-YDQfbWyW0JMKhJf/T4eyFr4b3tceTorQ5w2n7I0mNVTFOvu6CGEzfwT3RSAQGTi/FFMTFcuspPec/7dFHuP7Eg==", "cpu": [ "arm64" ], @@ -450,9 +450,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.0.tgz", - "integrity": "sha512-v6kP8sHYxjO8RwHmWMJSq7VZP2nYCkRVQ0qolh2l6xroe9QjbgV8siTbduED4u0hlk0+tjS6/Tuy4n5XCp+l6g==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.1.tgz", + "integrity": "sha512-fiuN/OG6sNGRN/bRFxRvV5LyzLB8gaL8cbDH5o3mEiVwfcMzyE5T//ilMmaTrnA8HLMS6hoz4cHOu6Qcp9vxgQ==", "cpu": [ "arm64" ], @@ -465,9 +465,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.0.tgz", - "integrity": "sha512-zJ2pnoFYB1F4vmEVlb/eSe+VH679zT1VdXlZKX+pE66grOgjmKJHKacf82g/sWE4MQ4Rk2FMBCRnX+l6/TVYzQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.1.tgz", + "integrity": "sha512-rv6AAdEXoezjbdfp3ouMuVqeLjE1Bin0AuE6qxE6V9g3Giz5/R3xpocHoAi7CufRR+lnkuUjRBn05SYJ83oKNQ==", "cpu": [ "x64" ], @@ -480,9 +480,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.0.tgz", - "integrity": "sha512-rbaIYFt2X9YZBSbH/CwGAjbBG2/MrACCVu2X0+kSykHzHnYH5FjHxwXLkcoJ10cX0aWCEynpu+rP76x0914atg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.1.tgz", + "integrity": "sha512-YAZLGsaNeChSrpz/G7MxO3TIBLaMN8QWMr3X8bt6rCvKovwU7GqQlDu99WdvF33kI8ZahvcdbFsy4jAFzFX7og==", "cpu": [ "x64" ], @@ -495,9 +495,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.0.tgz", - "integrity": "sha512-o1N5TsYc8f/HpGt39OUQpQ9AKIGApd3QLueu7hXk//2xq5Z9OxmV6sQfNp8C7qYmiOlHYODOGqNNa0e9jvchGQ==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.1.tgz", + "integrity": "sha512-1L4mUYPBMvVDMZg1inUYyPvFSduot0g73hgfD9CODgbr4xiTYe0VOMTZzaRqYJYBA9mana0x4eaAaypmWo1r5A==", "cpu": [ "arm64" ], @@ -510,9 +510,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.0.tgz", - "integrity": "sha512-XXIuB1DBRCFwNO6EEzCTMHT5pauwaSj4SWs7CYnME57eaReAKBXCnkUE80p/pAZcewm7hs+vGvNqDPacEXHVkw==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.1.tgz", + "integrity": "sha512-jvIE9tsuj9vpbbXlR5YxrghRfMuG0Qm/nZ/1KDHc+y6FpnZ/apsgh+G6t15vefU0zp3WSpTMIdXRUsNl/7RSuw==", "cpu": [ "ia32" ], @@ -525,9 +525,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.0.tgz", - "integrity": "sha512-9WEbVRRAqJ3YFVqEZIxUqkiO8l1nool1LmNxygr5HWF8AcSYsEpneUDhmjUVJEzO2A04+oPtZdombzzPPkTtgg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.1.tgz", + "integrity": "sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A==", "cpu": [ "x64" ], @@ -3558,11 +3558,11 @@ "dev": true }, "node_modules/next": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/next/-/next-14.1.0.tgz", - "integrity": "sha512-wlzrsbfeSU48YQBjZhDzOwhWhGsy+uQycR8bHAOt1LY1bn3zZEcDyHQOEoN3aWzQ8LHCAJ1nqrWCc9XF2+O45Q==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.1.tgz", + "integrity": "sha512-McrGJqlGSHeaz2yTRPkEucxQKe5Zq7uPwyeHNmJaZNY4wx9E9QdxmTp310agFRoMuIYgQrCrT3petg13fSVOww==", "dependencies": { - "@next/env": "14.1.0", + "@next/env": "14.1.1", "@swc/helpers": "0.5.2", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", @@ -3577,15 +3577,15 @@ "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "14.1.0", - "@next/swc-darwin-x64": "14.1.0", - "@next/swc-linux-arm64-gnu": "14.1.0", - "@next/swc-linux-arm64-musl": "14.1.0", - "@next/swc-linux-x64-gnu": "14.1.0", - "@next/swc-linux-x64-musl": "14.1.0", - "@next/swc-win32-arm64-msvc": "14.1.0", - "@next/swc-win32-ia32-msvc": "14.1.0", - "@next/swc-win32-x64-msvc": "14.1.0" + "@next/swc-darwin-arm64": "14.1.1", + "@next/swc-darwin-x64": "14.1.1", + "@next/swc-linux-arm64-gnu": "14.1.1", + "@next/swc-linux-arm64-musl": "14.1.1", + "@next/swc-linux-x64-gnu": "14.1.1", + "@next/swc-linux-x64-musl": "14.1.1", + "@next/swc-win32-arm64-msvc": "14.1.1", + "@next/swc-win32-ia32-msvc": "14.1.1", + "@next/swc-win32-x64-msvc": "14.1.1" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", diff --git a/examples/nextjs-14-clerk-shield/package.json b/examples/nextjs-14-clerk-shield/package.json index 32792570d..2462252e4 100644 --- a/examples/nextjs-14-clerk-shield/package.json +++ b/examples/nextjs-14-clerk-shield/package.json @@ -11,7 +11,7 @@ "dependencies": { "@arcjet/next": "file:../../arcjet-next", "@clerk/nextjs": "^4.29.9", - "next": "14.1.0", + "next": "14.1.1", "react": "^18", "react-dom": "^18" },