Skip to content

Commit

Permalink
Update paima-engine to use a single workspace (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt authored Sep 29, 2023
1 parent 604b65e commit 02208e4
Show file tree
Hide file tree
Showing 462 changed files with 38,413 additions and 92,072 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

159 changes: 0 additions & 159 deletions .eslintrc.js

This file was deleted.

50 changes: 23 additions & 27 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ name: NodeJS Continuous Health Check

on:
push:
branches: [ master ]
branches: [master]
paths-ignore:
- "documentation/**"
- "README.md"
- "errors.log"
- 'documentation/**'
- 'README.md'
- 'errors.log'
pull_request:
branches: [ master ]
branches: [master]
paths-ignore:
- "documentation/**"
- "README.md"
- "errors.log"
- 'documentation/**'
- 'README.md'
- 'errors.log'

jobs:
node_ci:
runs-on: ${{ matrix.os }}
env:
NODE_CACHE: "npm"
NODE_CACHE: 'npm'

strategy:
fail-fast: false
Expand All @@ -27,30 +27,26 @@ jobs:
node: [18]

steps:
-
name: Check out repository
- name: Check out repository
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
uses: actions/checkout@v3
-
name: Setup node env
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- name: Setup node env
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: false
registry-url: https://registry.npmjs.org
# cache: ${{ env.NODE_CACHE }}
# cache-dependency-path: ${{ matrix.dir }}/package-lock.json
-
name: Cleanup for node > 16
if: ${{ matrix.node!='16' }}
shell: bash -e -l {0}
run: |
sh wipe.sh keep-package-lock
npm i --no-audit
-
name: Build workspace
shell: bash -e -l {0}
run: |
npm ci --prefer-offline --no-audit
npm run --if-present build
npm run --if-present cilint
- uses: nrwl/nx-set-shas@v3
- name: Install deps
run: npm ci --prefer-offline --no-audit
- name: Lint affected
run: npm run lint
- name: Test affected
run: npx nx affected -t test
- name: Build affected
run: npm run build
11 changes: 10 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,14 @@
"semi": true,
"singleQuote": true,
"printWidth": 100,
"arrowParens": "avoid"
"arrowParens": "avoid",
"plugins": ["prettier-plugin-solidity", "prettier-plugin-organize-imports"],
"overrides": [
{
"files": "*.sol",
"options": {
"parser": "solidity-parse"
}
}
]
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
},
"[json][jsonc][json5]": {
"editor.formatOnSave": true
}
},
"eslint.experimental.useFlatConfig": true,
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ The `Paima Contract` is deployed on-chain which allows users to submit game inpu

Paima Engine is a TypeScript monorepo implemented with npm (not Yarn nor Lerna) workspaces. The `package.json` file at the root indicates all the common dependencies (mostly devDependencies like TypeScript, ESLint etc.), and the root `tsconfig.json` indicates the common TypeScript configuration. Every package has also its own `package.json` and `tsconfig.json` files indicating their particular configuration.

1. Setup an ssh agent so you don't have to enter your Git ssh key every time (`eval "$(ssh-agent -s)"` followed by `ssh-add ~/.ssh/your_github_key`)
1. `npm install` (generate the common `node_modules` folder with all the combined dependencies of all packages)
1. `npm run build` (to see if the build succeeds)
1. `npm run release` (for production builds. see `bin` folder for build result)
1. (executable) `npm run release:bin` (for production builds. see `bin` folder for build result)
1. (libraries) `npm run release:lib`
14 changes: 0 additions & 14 deletions batcher/.eslintrc.js

This file was deleted.

18 changes: 0 additions & 18 deletions batcher/address-validator/package.json

This file was deleted.

17 changes: 0 additions & 17 deletions batcher/batched-transaction-poster/package.json

This file was deleted.

62 changes: 0 additions & 62 deletions batcher/batcher-standalone/scripts/prepare_standalone_folders.sh

This file was deleted.

Loading

0 comments on commit 02208e4

Please sign in to comment.