Skip to content

Commit

Permalink
fix: upgrade wrangler
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed May 31, 2022
1 parent 94b391b commit fffa86c
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 199 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ jobs:
cache: 'pnpm'
- run: pnpm install
- name: Publish app
# FIXME: uses Node.js 16 not 12 (upcoming release).
# FIXME: update to tag > 1.3.0 when released.
uses: cloudflare/wrangler-action@6f62debcf8abf8e33e41343df9d7ab49612c324d
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'staging' # inform the build process what the env is
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
Expand Down Expand Up @@ -85,9 +83,7 @@ jobs:
if: ${{ steps.tag-release.outputs.releases_created }}
- name: Deploy
if: ${{ steps.tag-release.outputs.releases_created }}
# FIXME: uses Node.js 16 not 12 (upcoming release).
# FIXME: update to tag > 1.3.0 when released.
uses: cloudflare/wrangler-action@6f62debcf8abf8e33e41343df9d7ab49612c324d
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'production' # inform the build process what the env is
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/edge-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ jobs:
cache: 'pnpm'
- run: pnpm install
- name: Publish app
# FIXME: uses Node.js 16 not 12 (upcoming release).
# FIXME: update to tag > 1.3.0 when released.
uses: cloudflare/wrangler-action@6f62debcf8abf8e33e41343df9d7ab49612c324d
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'staging' # inform the build process what the env is
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}}
Expand Down Expand Up @@ -81,9 +79,7 @@ jobs:
if: ${{ steps.tag-release.outputs.releases_created }}
- name: Deploy
if: ${{ steps.tag-release.outputs.releases_created }}
# FIXME: uses Node.js 16 not 12 (upcoming release).
# FIXME: update to tag > 1.3.0 when released.
uses: cloudflare/wrangler-action@6f62debcf8abf8e33e41343df9d7ab49612c324d
uses: cloudflare/wrangler-action@2.0.0
env:
ENV: 'production' # inform the build process what the env is
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"esbuild": "^0.14.2",
"execa": "^5.1.1",
"git-rev-sync": "^3.0.1",
"miniflare": "^2.2.0",
"miniflare": "^2.5.0",
"nft.storage-api": "https://gitpkg.now.sh/nftstorage/nft.storage/packages/api?019a505e8f4bb93a24b8c480646779f5e4b66326",
"npm-run-all": "^4.1.5",
"pg": "^8.7.3",
Expand Down
1 change: 1 addition & 0 deletions packages/api/test/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function getMiniflare() {

return new Miniflare({
envPath,
scriptPath: 'dist/worker.mjs',
port: 8788,
packagePath: true,
wranglerConfigPath: true,
Expand Down
14 changes: 1 addition & 13 deletions packages/api/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
# nftstorage.link api wrangler config.
name = "nftstorage-link-api"

# `javascript` means our we'll send pre-built javascript code.
# ...as opposed to `webpack` where wrangler builds our code for us.
type = "javascript"

account_id = ""
watch_dir = "src"
main = "./dist/worker.mjs"
compatibility_date = "2022-05-11"

[build]
command = "npm run build"
[build.upload]
format = "modules"
dir = "dist"
main = "worker.mjs"

# PROD!
[env.production]
# name = "nftstorage-link-api-production"
account_id = "fffa4b4363a7e5250af8357087263b3a" # Protocol Labs CF account
zone_id = "c7795a0adce7609a95d62fec04705aff" # nftstorage.link zone
route = "api.nftstorage.link/*"
kv_namespaces = [
{ binding = "DENYLIST", id = "785cf627e913468ca5319523ae929def" }
Expand All @@ -42,7 +31,6 @@ binding = "SUPERHOT"
[env.staging]
# name = "nftstorage-link-api-staging"
account_id = "fffa4b4363a7e5250af8357087263b3a" # Protocol Labs CF account
zone_id = "c7795a0adce7609a95d62fec04705aff" # nftstorage.link zone
route = "api-staging.nftstorage.link/*"
kv_namespaces = [
{ binding = "DENYLIST", id = "f4eb0eca32e14e28b643604a82e00cb3" }
Expand Down
2 changes: 1 addition & 1 deletion packages/edge-gateway/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"git-rev-sync": "^3.0.1",
"ipfs-http-client": "^55.0.0",
"ipfs-utils": "^9.0.4",
"miniflare": "^2.2.0",
"miniflare": "^2.5.0",
"npm-run-all": "^4.1.5",
"p-wait-for": "^4.1.0",
"sade": "^1.7.4",
Expand Down
1 change: 1 addition & 0 deletions packages/edge-gateway/test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export function getMiniflare() {
return new Miniflare({
// Autoload configuration from `.env`, `package.json` and `wrangler.toml`
envPath: true,
scriptPath: 'dist/worker.mjs',
packagePath: true,
wranglerConfigPath: true,
// We don't want to rebuild our worker for each test, we're already doing
Expand Down
16 changes: 2 additions & 14 deletions packages/edge-gateway/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
# nftstorage.link wrangler config.
name = "gateway-nft-storage"

# `javascript` means our we'll send pre-built javascript code.
# ...as opposed to `webpack` where wrangler builds our code for us.
type = "javascript"

account_id = ""
watch_dir = "src"
compatibility_date = "2022-04-26"
main = "./dist/worker.mjs"
compatibility_date = "2022-05-11"

[build]
command = "npm run build"
[build.upload]
format = "modules"
dir = "dist"
main = "worker.mjs"

[durable_objects]
bindings = [
Expand All @@ -28,7 +18,6 @@ bindings = [
[env.production]
# name = "gateway-nft-storage-production"
account_id = "fffa4b4363a7e5250af8357087263b3a" # Protocol Labs CF account
zone_id = "c7795a0adce7609a95d62fec04705aff" # nftstorage.link zone
route = "*.ipfs.nftstorage.link/*"
kv_namespaces = [{ binding = "DENYLIST", id = "785cf627e913468ca5319523ae929def" }]

Expand All @@ -55,7 +44,6 @@ binding = "SUPERHOT"
[env.staging]
# name = "gateway-nft-storage-staging"
account_id = "fffa4b4363a7e5250af8357087263b3a" # Protocol Labs CF account
zone_id = "c7795a0adce7609a95d62fec04705aff" # nftstorage.link zone
route = "*.ipfs-staging.nftstorage.link/*"
kv_namespaces = [{ binding = "DENYLIST", id = "f4eb0eca32e14e28b643604a82e00cb3" }]

Expand Down
Loading

0 comments on commit fffa86c

Please sign in to comment.