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

fix: upgrade wrangler #128

Merged
merged 1 commit into from
Jun 1, 2022
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
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
4 changes: 4 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ jobs:
node-version: ${{ matrix.node }}
- run: pnpm install
if: ${{ steps.tag-release.outputs.releases_created }}
- run: pnpm exec wrangler pages publish --project-name nftstorage-link --branch master ./packages/website/out
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT }}
- run: npx dnslink-cloudflare --record _dnslink --domain nftstorage.link --link /ipfs/${{ needs.build.outputs.cid }}
env:
CF_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }}
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
67 changes: 0 additions & 67 deletions packages/tools/cli.js

This file was deleted.

38 changes: 0 additions & 38 deletions packages/tools/package.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/tools/types.d.ts

This file was deleted.

Loading