Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix edge-gateway build #223

Merged
merged 9 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: npx playwright install-deps
- run: pnpm test:api
env:
DATABASE_URL: http://localhost:3000
Expand All @@ -35,12 +35,13 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- name: Publish app
Expand All @@ -67,17 +68,17 @@ jobs:
release-type: node
monorepo-tags: true
package-name: api
- uses: actions/checkout@v2
- uses: actions/checkout@v4
if: ${{ steps.tag-release.outputs.releases_created }}
- uses: pnpm/action-setup@v2.0.1
- uses: pnpm/action-setup@v4
if: ${{ steps.tag-release.outputs.releases_created }}
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
if: ${{ steps.tag-release.outputs.releases_created }}
with:
cache: 'pnpm'
node-version: 16
node-version: 20
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
if: ${{ steps.tag-release.outputs.releases_created }}
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
name: Typecheck client
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
- run: pnpm install
- name: Typecheck
Expand All @@ -38,13 +38,13 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20
cache: 'pnpm'
- run: pnpm install
- name: Test (ES, Web, CJS, Bundlesize)
Expand Down
67 changes: 38 additions & 29 deletions .github/workflows/edge-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,33 @@ jobs:
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: npx playwright install-deps
- run: pnpm test:edge-gateway
deploy-staging:
name: Deploy Staging
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- name: Publish app
uses: cloudflare/wrangler-action@2.0.0
uses: cloudflare/wrangler-action@v3
env:
ENV: 'staging' # inform the build process what the env is
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
Expand All @@ -49,37 +52,43 @@ jobs:
apiToken: ${{secrets.CF_GATEWAY_TOKEN }}
workingDirectory: 'packages/edge-gateway'
environment: 'staging'
release:
changelog:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Release
name: Changelog
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
pull-requests: write
outputs:
paths_released: ${{ steps.tag-release.outputs.paths_released }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
- uses: googleapis/release-please-action@v4
id: tag-release
with:
path: packages/edge-gateway
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
monorepo-tags: true
package-name: edge-gateway
- uses: actions/checkout@v2
if: ${{ steps.tag-release.outputs.releases_created }}
- uses: pnpm/action-setup@v2.0.1
if: ${{ steps.tag-release.outputs.releases_created }}
include-component-in-tag: true
config-file: .github/release-please-config.json
manifest-file: .github/release-please-manifest.json
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(fromJson(needs.changelog.outputs.paths_released), 'packages/edge-gateway')
name: Release
runs-on: ubuntu-latest
needs:
- test
- changelog
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 6.32.x
- uses: actions/setup-node@v2
if: ${{ steps.tag-release.outputs.releases_created }}
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: pnpm install
if: ${{ steps.tag-release.outputs.releases_created }}
- name: Deploy
if: ${{ steps.tag-release.outputs.releases_created }}
uses: cloudflare/wrangler-action@2.0.0
uses: cloudflare/wrangler-action@v3
env:
ENV: 'production' # inform the build process what the env is
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7.0.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- name: Run build
Expand All @@ -50,14 +51,14 @@ jobs:
- packages/website/test-results
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.0.1
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7.0.x
- uses: actions/setup-node@v2
version: 9
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: ${{ matrix.node }}
cache: 'pnpm'
- run: pnpm install
env:
DEBUG: pw:install
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"ava": "^3.15.0",
"browser-env": "^3.3.0",
"dotenv": "^16.0.0",
"edge-gateway": "^1.5.5",
"edge-gateway": "workspace:*",
"esbuild": "^0.14.38",
"execa": "^5.1.1",
"git-rev-sync": "^3.0.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/client/src/perma-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class PermaCache {
static async put(
{ endpoint, token, rateLimiter = globalRateLimiter },
urls,
// @ts-ignore seems to be a spurious TS2463
{ onPut, maxRetries } = {}
) {
urls.forEach(validateUrl)
Expand Down Expand Up @@ -162,6 +163,7 @@ export class PermaCache {
*/
static async *list(
{ endpoint, token, rateLimiter = globalRateLimiter },
// @ts-ignore seems to be a spurious TS2463
{ sort = 'date', order = 'asc' } = {}
) {
const headers = PermaCache.headers(token)
Expand Down Expand Up @@ -205,6 +207,7 @@ export class PermaCache {
static async delete(
{ endpoint, token, rateLimiter = globalRateLimiter },
urls,
// @ts-ignore seems to be a spurious TS2463
{ onDelete, maxRetries } = {}
) {
urls.forEach(validateUrl)
Expand Down
1 change: 1 addition & 0 deletions packages/edge-gateway/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ main = "./dist/worker.js"
compatibility_date = "2022-07-01"
compatibility_flags = [ "url_standard" ]
no_bundle = true
logpush = true

[build]
command = "npm run build"
Expand Down
5 changes: 4 additions & 1 deletion packages/website/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": ["next/core-web-vitals", "prettier"]
"extends": ["next/core-web-vitals", "prettier"],
"rules": {
"react/no-unknown-property": "warn"
}
}
Loading
Loading