Skip to content

Commit

Permalink
Merge pull request #1 from tablelandnetwork/joe/init-setup
Browse files Browse the repository at this point in the history
Use consistent CI tooling.  Include recent `local` single-repo feature.
  • Loading branch information
joewagner authored Aug 21, 2023
2 parents 1f46bb7 + 1cac967 commit f123ece
Show file tree
Hide file tree
Showing 133 changed files with 19,158 additions and 7,498 deletions.
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"env": {
"browser": false,
"es2022": true,
"mocha": true,
"node": true
},
"plugins": ["@typescript-eslint", "import"],
"extends": ["standard-with-typescript", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"project": "./lint.tsconfig.json"
},
"ignorePatterns": [
"**/dist/",
"**/coverage/",
"**/docs/",
"packages/sdk/src/validator/client/*",
"packages/local/registry/*",
"*.d.ts"
],
"globals": {
// mocha
"before": true,
"after": true,
"beforeEach": true,
"afterEach": true,
"describe": true,
"it": true
},
"rules": {
"import/order": "warn",
"@typescript-eslint/no-confusing-void-expression": "off",
"node/no-unpublished-import": "off",
"node/no-missing-import": "off", // TODO: If available, find solution to turn this lint rule back on
"node/shebang": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
// We use currently all `== null` as a way to check for undefined or null, might as well turn this check off
"@typescript-eslint/no-non-null-assertion": "off",

// TODO: these two "off" rules should be removed once we fully transition to the monorepo
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/restrict-template-expressions": "off"
}
}
5 changes: 4 additions & 1 deletion packages/local/.github/CODEOWNERS → .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
# the repo. Unless a later match takes precedence.
# By convention in @tablelandnetwork repos, the first listed
# CODEOWNER is the repo DRI (directly responsible individual)
* @joewagner @carsonfarmer @awmuncy
* @carsonfarmer @joewagner
/packages/sdk/ @carsonfarmer @joewagner
/packages/cli/ @carsonfarmer @joewagner @sanderpick @dtbuchholz
/packages/local/ @joewagner @carsonfarmer
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/packages/cli"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/packages/local"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/packages/sdk"
schedule:
interval: "weekly"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docs
name: SDK Docs
on:
push:
branches:
Expand All @@ -11,6 +11,9 @@ concurrency:
jobs:
docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/sdk

steps:
- name: Checkout 🛎️
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ jobs:
- name: Lint/Format 🙈
run: npm run prettier && npm run lint

- name: Docs 📓
- name: SDK Docs 📓
working-directory: ./packages/sdk
run: npm run docs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- main
pull_request:

# enable test runners to know where they are
env:
CI: true

concurrency:
group: test-${{github.ref}}
cancel-in-progress: true
Expand All @@ -23,6 +27,9 @@ jobs:
with:
persist-credentials: false

# - name: Setup upterm session
# uses: lhotari/action-upterm@v1

- name: Cache 📦
uses: actions/cache@v1
with:
Expand All @@ -42,7 +49,7 @@ jobs:
run: npm install

- name: Build 🛠
run: npm run build
run: npx lerna run build

- name: Test/Coverage 🧪
run: npm run coverage
run: TEST_TIMEOUT_FACTOR=3 npm test
45 changes: 44 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,44 @@
node_modules/
# general
.DS_Store
node_modules/

# config
.vscode
.idea
.env
.envrc
.tableland*

# build
dist/
docs/
tmp/
typechain/
typechain-types/
cache/
artifacts/
.openzeppelin/*

# test
coverage/
test-results/
playwright-report/
playwright/.cache/
coverage.json

### sdk ###
packages/sdk/test/aliases/json-file-aliases.json
packages/sdk/test/validator/database.db
packages/sdk/test/validator/*.db
packages/sdk/test/validator/*.db*
packages/sdk/test/validator/backups

### local ###

# Validator artifacts
packages/local/validator/*.db
packages/local/validator/*.db*
packages/local/validator/backups

# registry artifacts
packages/local/registry/.openzeppelin/
3 changes: 3 additions & 0 deletions packages/local/.prettierignore → .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
node_modules
dist
coverage
docs
registry/artifacts
registry/cache
packages/*/src/validator/client/*
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"trailingComma": "es5",
"plugins": ["prettier-plugin-solidity"]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.0"
"version": "independent"
}
20 changes: 20 additions & 0 deletions lint.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"include": [
"packages/**/src",
"packages/**/test",
"packages/sdk/playwright.config.js"
],
"exclude": ["packages/**/dist", "packages/sdk/src/validator/client/*"],
"compilerOptions": {
"target": "ES2020",
"module": "ES2022",
"lib": ["DOM", "ES2022"],
"importHelpers": false,
"moduleResolution": "Node",
"esModuleInterop": true,
"strict": true,
"allowJs": true,
"skipLibCheck": true,
"declaration": true
}
}
19 changes: 19 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["lint", "prettier", "test", "coverage", "build"]
}
}
},
"targetDefaults": {
"test": {
"dependsOn": ["build"]
},
"build": {
"dependsOn": ["^build"],
"outputs": ["{projectRoot}/dist"]
}
}
}
Loading

0 comments on commit f123ece

Please sign in to comment.