Skip to content

Commit

Permalink
Merge pull request #12 from privacy-scaling-explorations/dev
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
0xjei authored Dec 4, 2024
2 parents 2f8462b + e8516be commit 3851bbc
Show file tree
Hide file tree
Showing 121 changed files with 28,687 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const fs = require("node:fs")

Check warning on line 1 in .commitlintrc.js

View workflow job for this annotation

GitHub Actions / style

File ignored by default.
const path = require("node:path")

const packages = fs.readdirSync(path.resolve(__dirname, "packages"))
const apps = fs.readdirSync(path.resolve(__dirname, "apps"))

module.exports = {
extends: ["@commitlint/config-conventional"],
prompt: {
scopes: [...packages, ...apps],
markBreakingChangeMode: true,
allowCustomIssuePrefix: false,
allowEmptyIssuePrefix: false,
issuePrefixes: [
{
value: "re",
name: "re: ISSUES related"
}
]
}
}
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#root = true

[*]
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
indent_size = 4

[*.md]
trim_trailing_whitespace = false
37 changes: 37 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# dependencies
node_modules
package-lock.json
yarn.lock
.yarn

# testing
coverage
coverage.json

# hardhat
artifacts
cache
typechain-types

# foundry
cache_forge
out
docs

# production
dist
build
/docs

# Docusaurus cache and generated files
.docusaurus
.cache-loader

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
38 changes: 38 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"root": true,
"env": {
"es6": true
},
"extends": ["airbnb", "airbnb-typescript/base", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"project": ["./tsconfig.json", "./packages/**/tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"rules": {
"react/require-default-props": "off",
"react/jsx-props-no-spreading": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }],
"import/prefer-default-export": "off",
"import/extensions": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": "off",
"no-bitwise": "off",
"no-await-in-loop": "off",
"no-restricted-syntax": "off",
"no-console": ["warn", { "allow": ["info", "warn", "error"] }],
"@typescript-eslint/lines-between-class-members": "off",
"no-param-reassign": "off"
},
"overrides": [
{
"files": ["./scripts/*"],
"rules": {
"no-console": "off"
}
}
]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sol linguist-language=Solidity
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @privacy-scaling-explorations/excubiae
105 changes: 105 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: main

on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
style:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: yarn

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
docs:
- apps/docs/**/*
packages:
- packages/**/*.{js,json,ts}
- '!packages/{contracts}/**/*'
to_format:
- '**/*.{cjs,js,json,jsx,md,mdx,sol,ts,tsx,yaml,yml}'
to_lint:
- '**/*.{cjs,js,jsx,ts,tsx}'
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Compile and lint contracts
run: |
yarn compile:contracts
yarn workspace excubiae-contracts lint
- if: steps.changed-files.outputs.docs_any_changed == 'true'
name: Build and format docs
run: |
yarn workspace excubiae-docs build
yarn workspace excubiae-docs format
- if: steps.changed-files.outputs.packages_any_changed == 'true'
name: Build packages
run: yarn build:packages

- if: steps.changed-files.outputs.to_format_any_changed == 'true'
name: Format
run: yarn run prettier --check --ignore-unknown --no-error-on-unmatched-pattern ${{ steps.changed-files.outputs.to_format_all_changed_files }}

- if: steps.changed-files.outputs.to_lint_any_changed == 'true'
name: Run Eslint
run: yarn run eslint ${{ steps.changed-files.outputs.to_lint_all_changed_files }} --ext .cjs,.js,.jsx,.ts,.tsx

test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: yarn

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files_yaml: |
contracts:
- packages/contracts/**/*.{js,json,ts,sol}
- if: steps.changed-files.outputs.contracts_any_changed == 'true'
name: Build and Test contracts
run: |
yarn compile:contracts
yarn test:contracts
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release

permissions:
contents: write

on:
push:
tags:
- "*"

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
registry-url: "https://registry.npmjs.org"

- name: Authentication
run: |
echo npmAuthToken: "$NODE_AUTH_TOKEN" >> ./.yarnrc.yml
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Install dependencies
run: yarn

- name: Publish packages
run: yarn version:publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: yarn version:release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
93 changes: 93 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# IDE
.vscode
.idea

# Testing
coverage
coverage.json
*.lcov

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm
.DS_Store

# Output of 'npm pack'
*.tgz

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# Production
build
dist
/docs

# Docusaurus cache and generated files
.docusaurus
.cache-loader

# Hardhat
artifacts
cache
typechain-types

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# asdf
.tool-versions

# direnv
.envrc
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
3 changes: 3 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ "$NO_HOOK" != "1" ]; then
exec < /dev/tty && npx czg --hook || true
fi
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"**/*.{js,ts,jsx,tsx,md,json,sol,yaml,yml}": "prettier --write --no-error-on-unmatched-pattern",
"**/*.{js,ts,jsx,tsx}": "eslint"
}
Loading

0 comments on commit 3851bbc

Please sign in to comment.