Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f5b984
commit 3b8bd4f
Showing
59 changed files
with
8,632 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[*] | ||
end_of_line = lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: 'kind/bug,need/triage' | ||
assignees: '' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: Need Help? | ||
url: https://discord.com/invite/KKucsCpZmY | ||
about: Chat with us in \#nft-storage on IPFS discord. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: 'kind/enhancement,need/triage' | ||
assignees: '' | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Check Conventional Commits' | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v4 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Cron sync deny list | ||
|
||
on: | ||
schedule: | ||
- cron: '13 0,5,10,15,20 * * *' | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/edge-gateway/denylist.json' | ||
|
||
jobs: | ||
update: | ||
name: Sync deny list with KV store | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
env: ['staging', 'production'] | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- uses: bahmutov/npm-install@v1 | ||
- name: Run job | ||
env: | ||
CF_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }} | ||
run: node packages/edge-gateway/scripts/cli.js denylist sync --env ${{ matrix.env }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: edge-gateway | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'packages/edge-gateway/**' | ||
- '.github/workflows/edge-gateway.yml' | ||
pull_request: | ||
paths: | ||
- 'packages/edge-gateway/**' | ||
- '.github/workflows/edge-gateway.yml' | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Test | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- uses: bahmutov/npm-install@v1 | ||
- run: npx playwright install-deps | ||
- run: yarn 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: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
- uses: bahmutov/npm-install@v1 | ||
- 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 | ||
env: | ||
ENV: 'staging' # inform the build process what the env is | ||
SENTRY_TOKEN: ${{secrets.SENTRY_TOKEN}} | ||
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }} | ||
with: | ||
apiToken: ${{secrets.CF_GATEWAY_TOKEN }} | ||
workingDirectory: 'packages/edge-gateway' | ||
environment: 'staging' | ||
release: | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v3 | ||
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: actions/setup-node@v2 | ||
if: ${{ steps.tag-release.outputs.releases_created }} | ||
with: | ||
node-version: '16' | ||
registry-url: https://registry.npmjs.org/ | ||
- uses: bahmutov/npm-install@v1 | ||
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 | ||
env: | ||
ENV: 'production' # inform the build process what the env is | ||
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }} | ||
SENTRY_UPLOAD: ${{ secrets.SENTRY_UPLOAD }} | ||
with: | ||
apiToken: ${{ secrets.CF_GATEWAY_TOKEN }} | ||
workingDirectory: 'packages/edge-gateway' | ||
environment: 'production' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# testing | ||
coverage | ||
.nyc_output | ||
|
||
# next.js | ||
.next | ||
out | ||
|
||
# production | ||
build | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.production.env | ||
.env | ||
|
||
dist | ||
node_modules | ||
worker | ||
package-lock.json | ||
site/public | ||
.cluster | ||
*.http | ||
.local | ||
.supabase | ||
|
||
packages/website/public/robots.txt | ||
packages/website/public/sitemap.xml | ||
packages/api/docker/compose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
node_modules | ||
coverage | ||
out | ||
build | ||
dist | ||
worker | ||
site/public | ||
docs | ||
*.sql | ||
*.sh | ||
*.svg | ||
*.png | ||
CHANGELOG.md | ||
.next | ||
.supabase | ||
.prettierignore | ||
.gitignore | ||
.editorconfig | ||
.gitattributes | ||
**/yarn.lock* | ||
*.toml | ||
packages/client/src/lib/interface.ts | ||
*.mdx | ||
packages/website/public/robots.txt | ||
packages/website/public/sitemap.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# nftstorage.link Developer's Guide | ||
|
||
This doc should contain everything you need to know to get a working development environment up and running. If it doesn't and you know what's missing, please open a PR or issue to update the guide! | ||
|
||
## Pre-requisites | ||
|
||
You'll need at least the following: | ||
|
||
- Node.js v16+ | ||
- [yarn](https://yarnpkg.com/) | ||
- Docker | ||
|
||
## Getting Started | ||
|
||
We use `yarn` in this project and commit the `yarn.lock` file. | ||
|
||
1. Install dependencies. | ||
```bash | ||
# install all dependencies in the mono-repo | ||
yarn | ||
# setup git hooks | ||
npx simple-git-hooks | ||
``` | ||
2. Run locally by starting the following processes. | ||
1. API server (`yarn dev` in `/packages/edge-gateway`). | ||
2. Web server (`yarn dev` in `/packages/website`). | ||
|
||
## Release | ||
|
||
[Release Please](https://github.com/googleapis/release-please) automates CHANGELOG generation, the creation of GitHub releases, | ||
and version bumps for our packages. Release Please does so by parsing your | ||
git history, looking for [Conventional Commit messages](https://www.conventionalcommits.org/), | ||
and creating release PRs. | ||
|
||
### What's a Release PR? | ||
|
||
Rather than continuously releasing what's landed to our default branch, release-please maintains Release PRs: | ||
|
||
These Release PRs are kept up-to-date as additional work is merged. When we're ready to tag a release, we simply merge the release PR. | ||
|
||
When the release PR is merged the release job is triggered to create a new tag, a new github release and run other package specific jobs. Only merge ONE release PR at a time and wait for CI to finish before merging another. | ||
|
||
Release PRs are created individually for each package in the mono repo. | ||
|
||
### How should I write my commits? | ||
|
||
Release Please assumes you are using [Conventional Commit messages](https://www.conventionalcommits.org/). | ||
|
||
The most important prefixes you should have in mind are: | ||
|
||
- `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) | ||
patch. | ||
- `feat:` which represents a new feature, and correlates to a SemVer minor. | ||
- `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change | ||
(indicated by the `!`) and will result in a SemVer major. |
Oops, something went wrong.