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

chore: scaffolding #1

Merged
merged 9 commits into from
Oct 19, 2023
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
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.docusaurus/
build/
node_modules/
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: {
node: true,
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
rules: {
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
'prefer-const': 'off',
},
};
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
The title should summarise what the purpose of this change,

⚠️**NOTE:** The title must conform to the conventional commit message format outlined in CONTRIBUTING.md document, at the root of the project. This is to ensure the merge commit to the main branch is picked up by the CI and creates an entry in the CHANGELOG.md.
-->

# Description
<!-- Describe your changes in detail -->

# Type of change
<!-- What type of change does this change introduce? Put an 'x' in all the boxes that apply. -->

- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] πŸ—οΈ Build configuration (CI configuration, scaffolding etc.)
- [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
- [ ] πŸ“ Documentation update(s)
- [ ] πŸ“¦ Dependency update(s)
- [ ] πŸ‘©πŸ½β€πŸ’» Improve developer experience
- [ ] ⚑ Improve performance
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] β™» Refactor
- [ ] βͺ Revert changes
- [ ] πŸ§ͺ New tests or updates to existing tests
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
release:
types: [released] # triggered on main branch releases

jobs:
deploy:
name: "Deploy"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: "πŸ“¦ Install"
run: yarn install --frozen-lockfile
- name: "πŸ—οΈ Build"
run: yarn build
- name: "πŸš€ Deploy"
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.WRITE_REPOS_TOKEN }}
publish_dir: ./build
user_name: agoralabs-bot
user_email: [email protected]
24 changes: 24 additions & 0 deletions .github/workflows/lint_build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request Checks

on:
pull_request:

jobs:
lint_build_test:
name: "Lint, Build & Test"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
- name: "πŸ“¦ Install"
run: yarn install --ignore-scripts
- name: "πŸ‘• Lint"
run: yarn lint
- name: "πŸ—οΈ Build"
run: yarn build
- name: "πŸ§ͺ Test"
run: yarn test
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: "Release"
runs-on: ubuntu-latest
steps:
- name: "πŸ›Ž Checkout"
uses: actions/checkout@v3
- name: "πŸ”§ Setup"
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: "πŸ“¦ Install"
run: yarn global add semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/npm @semantic-release/github @semantic-release/git @semantic-release/changelog
- name: "πŸ—οΈ Build"
run: yarn build
- name: "πŸ”– Release"
env:
# appears on the release commits
GIT_AUTHOR_NAME: agoralabs-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: agoralabs-bot
GIT_COMMITTER_EMAIL: [email protected]
# used to push the release commit and create the tags
GITHUB_TOKEN: ${{ secrets.WRITE_REPOS_TOKEN }}
run: semantic-release
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ fabric.properties

### Miscellaneous

# docusaurus
.docusaurus
.cache-loader
/build

# dependencies
.npmrc
/.pnp
Expand Down
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

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

yarn lint-staged
6 changes: 6 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
}
4 changes: 4 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
'**/*.{js,json,ts,tsx}': (filenames) =>
`prettier --write ${filenames.join(' ')}`,
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.docusaurus/
build/
node_modules/
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"endOfLine": "lf",
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "es5"
}
22 changes: 22 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
}
],
[
"@semantic-release/github",
{
"releasedLabels": ["πŸš€ released"]
}
]
]
}
Loading