Skip to content

Commit

Permalink
updates build system (#580)
Browse files Browse the repository at this point in the history
* automatically fetches calldata from `sign()`

* remove vitest form tsconfig to fix build

* remove extra script

* updates packages to latest and cleans up build output

* update to use pnpm

* update patched vitest loader

* fix linting issues

* fix patch

* fix deps for docs

* fix test paths

* bump node version

* re-add the bn.js pckg

* fix rejected tx
  • Loading branch information
netbonus authored Oct 25, 2024
1 parent dab6cf5 commit 0c31f37
Show file tree
Hide file tree
Showing 35 changed files with 5,641 additions and 8,561 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

34 changes: 0 additions & 34 deletions .eslintrc

This file was deleted.

21 changes: 13 additions & 8 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x

- name: Install NPM packages
run: npm ci
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Run linter
run: npm run lint
run: pnpm run lint

- name: Run tests
run: npm run test
run: pnpm run test

- name: Build project
run: npm run build
run: pnpm run build
21 changes: 13 additions & 8 deletions .github/workflows/docs-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,27 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x

- name: Install NPM packages for SDK
run: npm ci
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies for SDK
run: pnpm install

- name: Install NPM packages for Docs
- name: Install dependencies for Docs
run: npm ci
working-directory: ./docs

- name: Build project
run: npm run build
run: pnpm run build
working-directory: ./docs

- name: Upload production-ready build files
Expand All @@ -41,7 +46,7 @@ jobs:

steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: production-files
path: docs/build
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20.x
registry-url: 'https://registry.npmjs.org'

- name: Install NPM packages
run: npm ci
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Install dependencies
run: pnpm install

- name: Build project
run: npm run build
run: pnpm run build

- name: Publish to NPM
run: npm publish
run: pnpm publish --no-git-checks

env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
93 changes: 93 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import js from '@eslint/js';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';

export default [
js.configs.recommended,
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
plugins: {
'@typescript-eslint': tsPlugin,
prettier: prettierPlugin,
},
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
globals: {
Buffer: 'readonly',
URL: 'readonly',
fetch: 'readonly',
Response: 'readonly',
Request: 'readonly',
RequestInit: 'readonly',
AbortController: 'readonly',
caches: 'readonly',
setTimeout: 'readonly',
clearTimeout: 'readonly',
// Test globals
describe: 'readonly',
it: 'readonly',
test: 'readonly',
expect: 'readonly',
beforeAll: 'readonly',
afterAll: 'readonly',
beforeEach: 'readonly',
afterEach: 'readonly',
// Node.js globals
process: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
// Browser globals
window: 'readonly',
document: 'readonly',
console: 'readonly',
},
},
rules: {
...tsPlugin.configs.recommended.rules,
...prettierPlugin.configs.recommended.rules,
'prettier/prettier': 'error',
eqeqeq: ['error'],
'no-var': ['warn'],
'no-duplicate-imports': ['error'],
'prefer-const': ['error'],
'prefer-spread': ['error'],
'no-console': ['off'],
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' },
],
quotes: [
'warn',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
},
},
prettierConfig,
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'*.js',
'*.cjs',
'*.mjs',
'build/**',
'docs/**',
'patches/**',
'src/__test__/e2e/**',
'src/__test__/integration/**',
'src/__test__/utils/**',
],
},
];
1 change: 0 additions & 1 deletion forge/lib/openzeppelin-contracts
Submodule openzeppelin-contracts deleted from dbb610
Loading

0 comments on commit 0c31f37

Please sign in to comment.