Skip to content

Commit

Permalink
typescript & yarn monorepo (#703)
Browse files Browse the repository at this point in the history
* refactor to typescript & yarn monorepo

* remove prettier

* update eslint

* make sure new rules work

* husky

* remove builds

* update dockerfile wip

* fix yarn ignore

* update gh action

* update node engine

* update docker compose

* fix healthchek

* update dockers

* update gh action

* update gh action

* fix ci test

* fix e2e test

* test new setup

* print docker logs

* fix

* fix test order

* update action

* update action

* update action

* increase wait time

* install yarn

* docker fixes

* test with ubuntu-latest

* fix

* test

* dump each failed docker

* test

* test

* test new setup

* test new setup

* separate tests

* fix hardhat test

* run on self-hosted

* update action

* update action

* update action

* update action

* try on self-hosted

* updates

* use localhost instead

* Revert "use localhost instead"

This reverts commit 04cd875.

* update test

* update action

* update publish action

* fix build path

* update readme

* fix NFT deps

* Update package.json

* update truffle
  • Loading branch information
ermalkaleci authored Apr 18, 2023
1 parent 58cea1d commit 4dd921b
Show file tree
Hide file tree
Showing 243 changed files with 34,151 additions and 33,037 deletions.
9 changes: 1 addition & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
bodhi.Dockerfile
docker-compose.yml

common/deploy/
common/autoinstallers/*/.npmrc
common/changes
common/temp

**/node_modules
**/.rush/temp/
**/dist
**/lib
**/cache/solcjs
**/temp
**/build
**/Dockerfile
**/*.log
**/*.log
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.eslintrc.js
node_modules/
bin/
lib/
dist/
examples/
evm-subql/
scripts/
40 changes: 33 additions & 7 deletions eth-rpc-adapter/.eslintrc.js → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// This is a workaround for https://github.com/eslint/eslint/issues/3458
require('@rushstack/eslint-config/patch/modern-module-resolution');

module.exports = {
extends: ['@rushstack/eslint-config/profile/node-trusted-tool'], // <---- put your profile string here
parserOptions: { tsconfigRootDir: __dirname },
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import', 'sort-imports-es6-autofix'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/typescript'
],
rules: {
indent: [2, 2, { SwitchCase: 1 }],
quotes: [2, 'single'],
Expand All @@ -21,8 +25,6 @@ module.exports = {
}],

/* ---------- turn off ---------- */
'@rushstack/typedef-var': 0,
'@rushstack/no-new-null': 0, // can use null as return type
'@typescript-eslint/no-extra-semi': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
Expand All @@ -34,5 +36,29 @@ module.exports = {
'@typescript-eslint/typedef': 0,
'no-unused-expressions': 0, // short ciucuit if
'max-lines': 0,
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'sort-imports-es6-autofix/sort-imports-es6': 'warn',
'@typescript-eslint/ban-ts-comment': 'off',
'no-useless-escape': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'import/no-named-as-default-member': 'off',
'import/no-named-as-default': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': [
'off'
// {
// argsIgnorePattern: '^_',
// varsIgnorePattern: '^_',
// caughtErrorsIgnorePattern: '^_'
// }
]
},
settings: {
'import/resolver': {
typescript: {
project: 'tsconfig.json'
}
}
}
};
8 changes: 0 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@ pnpm-lock.yaml merge=binary linguist-generated=true
shrinkwrap.yaml merge=binary linguist-generated=true
npm-shrinkwrap.json merge=binary linguist-generated=true
yarn.lock merge=binary linguist-generated=true

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/microsoft/rushstack/issues/1088
#
*.json linguist-language=JSON-with-Comments
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
file: eth-rpc-adapter/Dockerfile
file: packages/eth-rpc-adapter/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
33 changes: 26 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: 'recursive'

Expand All @@ -20,18 +20,37 @@ jobs:
run: git config --local user.name Bodhibot

- name: setup node env
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '14.x'
node-version: 16
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
run: node common/scripts/install-run-rush.js update
run: yarn install --immutable

- name: build packages
run: node common/scripts/install-run-rush.js build --verbose --to @acala-network/bodhi --to @acala-network/eth-rpc-adapter
run: yarn build

- name: publish
run: node common/scripts/install-run-rush.js publish --apply --publish --include-all --target-branch master --add-commit-details --set-access-level public -n ${{ secrets.NPM_AUTH_TOKEN }}
- run: |
echo npmAuthToken: "\${NPM_AUTH_TOKEN}" >> ./.yarnrc.yml
- name: publish @acala-network/eth-transactions
run: yarn workspace @acala-network/eth-transactions npm publish --tolerate-republish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: publish @acala-network/eth-providers
run: yarn workspace @acala-network/eth-providers npm publish --tolerate-republish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: publish @acala-network/eth-rpc-adapter
run: yarn workspace @acala-network/eth-rpc-adapter npm publish --tolerate-republish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: publish @acala-network/bodhi
run: yarn workspace @acala-network/bodhi npm publish --tolerate-republish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
Loading

0 comments on commit 4dd921b

Please sign in to comment.