Skip to content

Commit

Permalink
Initialize with frontend and indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
ryscheng committed Jul 28, 2023
0 parents commit c32868a
Show file tree
Hide file tree
Showing 90 changed files with 12,206 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"next/core-web-vitals"
],
"ignorePatterns": [
"**/vendor/*.js",
"vendor/**/*.js"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"react-hooks/exhaustive-deps": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
}
}
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/1.bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug Report
description: Create a bug report
labels: ['type:bug']
body:
- type: markdown
attributes:
value: If you leave out sections there is a high likelihood it will be moved to the [GitHub Discussions](https://github.com/hypercerts-org/oso/discussions).
- type: dropdown
attributes:
label: Which area(s) are affected? (leave empty if unsure)
multiple: true
options:
- 'Docs'
- 'Frontend'
- 'Indexer'
- 'Other'
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue. Screenshots can be provided in the issue body below.
validations:
required: true
- type: textarea
attributes:
label: Describe the Bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: markdown
attributes:
value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. Contributors should be able to follow the steps provided in order to reproduce the bug.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/2.feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Feature Request
description: Create a feature request
labels: 'type:featurerequest'
body:
- type: markdown
attributes:
value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible.
- type: markdown
attributes:
value: Please first verify that your feature was not already discussed on GitHub.
- type: textarea
attributes:
label: Describe the feature you'd like to request
description: A clear and concise description of what you want and what your use case is.
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/3.docs_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Docs Request'
description: A request to update or improve documentation
title: 'Docs: '
labels:
- 'category:docs'
body:
- type: textarea
attributes:
label: What is the improvement or update you wish to see?
description: 'Example: I would like to see more examples of how to use the SDK to detect hypercert claim collisions.'
validations:
required: true
- type: textarea
attributes:
label: Is there any context that might help us understand?
description: A clear description of any added context that might help us understand.
validations:
required: true
- type: input
attributes:
label: Does the docs page already exist? Please link to it.
description: 'Example: https://hypercerts.org/docs/api-reference/'
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/9.other.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: 'Other'
description: For internal use only
body:
- type: textarea
attributes:
label: What is it?
validations:
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/hypercerts-org/oso/discussions
about: Ask questions and discuss with other community members
78 changes: 78 additions & 0 deletions .github/workflows/ci-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: ci-default
env:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
NEXT_PUBLIC_DOMAIN: ${{ vars.NEXT_PUBLIC_DOMAIN }}
PLASMIC_PROJECT_ID: ${{ vars.PLASMIC_PROJECT_ID }}
PLASMIC_PROJECT_API_TOKEN: ${{ vars.PLASMIC_PROJECT_API_TOKEN }}
DOCKER_PLATFORM: "amd64"

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
# Or when a pull request event occurs for a pull request against one of the
# matched branches.
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Cancel in progress jobs on new pushes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-and-test:
# NOTE: This name appears in GitHub's Checks API.
name: test
environment: testing
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# Check out pull request's HEAD commit instead of the merge commit to
# prevent gitlint from failing due to too long commit message titles,
# e.g. "Merge 3e621938d65caaa67f8e35d145335d889d470fc8 into 19a39b2f66cd7a165082d1486b2f1eb36ec2354a".
ref: ${{ github.event.pull_request.head.sha }}
# Fetch all history so gitlint can check the relevant commits.
fetch-depth: "0"
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
node-version: "18.15.0"
cache: "yarn"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly-87bc53fc6c874bd4c92d97ed180b949e3a36d78c
- name: Install
run: |
yarn install --immutable
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Build
run: |
yarn build
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Lint
run: |
yarn lint
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Test
run: |
yarn test
# Always run this step so that all linting errors can be seen at once.
if: always()
36 changes: 36 additions & 0 deletions .github/workflows/deploy-indexer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# NOTE: This name appears in GitHub's Checks API and in workflow's status badge.
name: deploy-indexer
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

# Trigger the workflow when:
on:
# A push occurs to one of the matched branches.
push:
branches:
- main
paths:
- os-observer/prisma/**
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
deploy-os-observer:
# NOTE: This name appears in GitHub's Checks API.
name: deploy-indexer
environment: indexer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "18.x"
- name: Install
run: yarn install --immutable
- name: Run migrations
run: yarn deploy:indexer
31 changes: 31 additions & 0 deletions .github/workflows/indexer-autocrawl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: os-observer-autocrawl
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

# Trigger the workflow when:
on:
workflow_dispatch:
schedule:
# Every day at 14:00 UTC = 07:00 PDT
- cron: '0 14 * * *'

jobs:
fetch-data:
# NOTE: This name appears in GitHub's Checks API.
name: fetch-data
environment: indexer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "18.x"
- name: Install
run: yarn install --immutable
- name: Run
run: yarn start:indexer runAutocrawl
43 changes: 43 additions & 0 deletions .github/workflows/indexer-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: os-observer-manual
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}

# Trigger the workflow when:
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
command:
description: 'Command to run'
required: true
default: 'npmDownloads'
type: choice
options:
- "npmDownloads"
- "githubCommits"
args:
description: 'Arguments to pass to the command'
required: false
default: ''
type: string

jobs:
fetch-data:
# NOTE: This name appears in GitHub's Checks API.
name: fetch-data
environment: indexer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Node.js 18
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "18.x"
- name: Install
run: yarn install --immutable
- name: Run
run: yarn start:indexer ${{ inputs.command }} ${{ inputs.args }}
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules/
.pnp/
.pnp.*
npm-debug.log*
.pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions

# testing
coverage/
.eslintcache

# builds
out/
build/
dist/
.turbo/
.next/
.docusaurus/

# files
.DS_Store
*.pem
*.env
.env*.local
*.log
coverage.json

# typescript
*.tsbuildinfo
next-env.d.ts
.idea/
.vscode/
graph/.test.subgraph.yaml

# playwright
playwright-report/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn format:staged
7 changes: 7 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"**/*.{js,jsx,ts,tsx,sol}": [
"eslint --ignore-path .gitignore",
"prettier --write"
],
"**/*.{md,json}": ["prettier --write"]
}
Loading

1 comment on commit c32868a

@vercel
Copy link

@vercel vercel bot commented on c32868a Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.