Skip to content

Commit 5aed022

Browse files
authored
Merge pull request #62 from hirosystems/develop
create first beta release
2 parents 0aa93b4 + 53673b2 commit 5aed022

File tree

92 files changed

+38626
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+38626
-0
lines changed

.commitlintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"]
3+
}

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/node_modules
2+
**/tmp

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[{*.ts,*.json}]
5+
charset = utf-8
6+
end_of_line = lf
7+
insert_final_newline = true
8+
indent_style = space
9+
indent_size = 2

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# See src/env.ts for environment variable documentation.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.eslintrc.js

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@stacks/eslint-config', 'prettier'],
4+
overrides: [],
5+
parser: '@typescript-eslint/parser',
6+
parserOptions: {
7+
tsconfigRootDir: __dirname,
8+
project: './tsconfig.json',
9+
ecmaVersion: 2020,
10+
sourceType: 'module',
11+
},
12+
ignorePatterns: ['*.config.js', 'config/*', '*.mjs', 'tests/*.js'],
13+
plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'prettier'],
14+
rules: {
15+
'prettier/prettier': 'error',
16+
'@typescript-eslint/no-inferrable-types': 'off',
17+
'@typescript-eslint/camelcase': 'off',
18+
'@typescript-eslint/no-empty-function': 'off',
19+
'@typescript-eslint/no-use-before-define': ['error', 'nofunc'],
20+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
21+
'no-warning-comments': 'warn',
22+
'tsdoc/syntax': 'error',
23+
// TODO: Remove this when `any` abi type is fixed.
24+
'@typescript-eslint/no-unsafe-assignment': 'off',
25+
'@typescript-eslint/no-unsafe-member-access': 'off',
26+
'@typescript-eslint/no-unsafe-call': 'off',
27+
'@typescript-eslint/restrict-template-expressions': 'off',
28+
},
29+
};

.github/workflows/ci.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
- beta
9+
tags-ignore:
10+
- '**'
11+
paths-ignore:
12+
- '**/CHANGELOG.md'
13+
- '**/package.json'
14+
pull_request:
15+
workflow_dispatch:
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Use Node.js
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version-file: '.nvmrc'
27+
28+
- name: Cache node modules
29+
uses: actions/cache@v2
30+
env:
31+
cache-name: cache-node-modules
32+
with:
33+
path: |
34+
~/.npm
35+
**/node_modules
36+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
37+
restore-keys: |
38+
${{ runner.os }}-build-${{ env.cache-name }}-
39+
${{ runner.os }}-build-
40+
${{ runner.os }}-
41+
42+
- name: Install deps
43+
run: npm ci --audit=false
44+
45+
- name: Lint ESLint
46+
run: npm run lint:eslint
47+
48+
- name: Lint Prettier
49+
run: npm run lint:prettier
50+
51+
test:
52+
runs-on: ubuntu-latest
53+
env:
54+
API_HOST: 127.0.0.1
55+
API_PORT: 3000
56+
PGHOST: 127.0.0.1
57+
PGPORT: 5432
58+
PGUSER: postgres
59+
PGPASSWORD: postgres
60+
PGDATABASE: postgres
61+
BLOCKCHAIN_API_PGHOST: 127.0.0.1
62+
BLOCKCHAIN_API_PGPORT: 5432
63+
BLOCKCHAIN_API_PGUSER: postgres
64+
BLOCKCHAIN_API_PGPASSWORD: postgres
65+
BLOCKCHAIN_API_PGDATABASE: postgres
66+
STACKS_NODE_RPC_HOST: 127.0.0.1
67+
STACKS_NODE_RPC_PORT: 24440
68+
steps:
69+
- uses: actions/checkout@v2
70+
with:
71+
fetch-depth: 0
72+
73+
- name: Use Node.js
74+
uses: actions/setup-node@v2
75+
with:
76+
node-version-file: '.nvmrc'
77+
78+
- name: Cache node modules
79+
uses: actions/cache@v2
80+
env:
81+
cache-name: cache-node-modules
82+
with:
83+
path: |
84+
~/.npm
85+
**/node_modules
86+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
87+
restore-keys: |
88+
${{ runner.os }}-build-${{ env.cache-name }}-
89+
${{ runner.os }}-build-
90+
${{ runner.os }}-
91+
92+
- name: Install deps
93+
run: npm ci --audit=false
94+
95+
- name: Setup integration environment
96+
run: |
97+
sudo ufw disable
98+
npm run testenv:run -- -d
99+
npm run testenv:logs -- --no-color &> docker-compose-logs.txt &
100+
101+
- name: Run tests
102+
run: npm run test
103+
104+
- name: Print integration environment logs
105+
run: cat docker-compose-logs.txt
106+
if: failure()
107+
108+
- name: Teardown integration environment
109+
run: npm run testenv:stop
110+
if: always()
111+
112+
build-publish:
113+
runs-on: ubuntu-latest
114+
needs:
115+
- lint
116+
- test
117+
steps:
118+
- uses: actions/checkout@v2
119+
with:
120+
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
121+
fetch-depth: 0
122+
persist-credentials: false
123+
124+
- name: Semantic Release
125+
uses: cycjimmy/[email protected]
126+
id: semantic
127+
# Only run on non-PR events or only PRs that aren't from forks
128+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
129+
env:
130+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
131+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
132+
SEMANTIC_RELEASE_PACKAGE: ${{ github.event.repository.name }}
133+
with:
134+
semantic_version: 19
135+
extra_plugins: |
136+
@semantic-release/changelog
137+
@semantic-release/git
138+
@semantic-release/exec
139+
conventional-changelog-conventionalcommits
140+
141+
- name: Set up Docker Buildx
142+
uses: docker/setup-buildx-action@v1
143+
144+
- name: Docker Meta
145+
id: meta
146+
uses: docker/metadata-action@v3
147+
with:
148+
images: |
149+
hirosystems/${{ github.event.repository.name }}
150+
tags: |
151+
type=ref,event=branch
152+
type=ref,event=pr
153+
type=semver,pattern={{version}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
154+
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
155+
156+
- name: Login to DockerHub
157+
uses: docker/login-action@v1
158+
with:
159+
username: ${{ secrets.DOCKERHUB_USERNAME }}
160+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
161+
162+
- name: Build/Tag/Push Image
163+
uses: docker/build-push-action@v2
164+
with:
165+
context: .
166+
tags: ${{ steps.meta.outputs.tags }}
167+
labels: ${{ steps.meta.outputs.labels }}
168+
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
169+
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

.github/workflows/vercel.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Vercel
2+
3+
env:
4+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
6+
7+
on:
8+
push:
9+
branches-ignore:
10+
- master
11+
12+
jobs:
13+
vercel:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Use Node.js
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version-file: '.nvmrc'
25+
26+
- name: Cache node modules
27+
uses: actions/cache@v2
28+
env:
29+
cache-name: cache-node-modules
30+
with:
31+
path: |
32+
~/.npm
33+
**/node_modules
34+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-build-${{ env.cache-name }}-
37+
${{ runner.os }}-build-
38+
${{ runner.os }}-
39+
40+
- name: Install deps
41+
run: npm ci --audit=false
42+
43+
- name: Install Vercel CLI
44+
run: npm install --global vercel@latest
45+
46+
- name: Pull Vercel environment information
47+
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
48+
49+
- name: Build project artifacts
50+
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
51+
52+
- name: Deploy project artifacts to Vercel
53+
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
*.swp
10+
11+
pids
12+
logs
13+
results
14+
tmp
15+
16+
# Build
17+
public/css/main.css
18+
19+
# Coverage reports
20+
coverage
21+
22+
# API keys and secrets
23+
.env
24+
25+
# Dependency directory
26+
node_modules
27+
bower_components
28+
29+
# Editors
30+
.idea
31+
*.iml
32+
33+
# OS metadata
34+
.DS_Store
35+
Thumbs.db
36+
37+
# Ignore built ts files
38+
dist/**/*
39+
40+
# ignore yarn.lock
41+
yarn.lock
42+
43+
.git-info

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npx commitlint --edit

0 commit comments

Comments
 (0)