Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pooltogether/v4-autotasks
Monorepo regrouping OpenZeppelin Defender autotasks for V4
https://github.com/pooltogether/v4-autotasks
Last synced: about 2 months ago
JSON representation
Monorepo regrouping OpenZeppelin Defender autotasks for V4
- Host: GitHub
- URL: https://github.com/pooltogether/v4-autotasks
- Owner: pooltogether
- License: gpl-3.0
- Created: 2022-11-08T21:24:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-27T21:21:20.000Z (almost 2 years ago)
- Last Synced: 2024-05-23T09:03:01.413Z (8 months ago)
- Language: TypeScript
- Size: 2.59 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# v4-autotasks
Monorepo regrouping OpenZeppelin Defender autotasks for V4.
## Development
### Installation
This repository uses [Lerna](https://lerna.js.org/) to handle packages.
Install it globally or use `npx` to run `lerna` commands:
```
npm i -g lerna
```Install and link dependencies across packages with:
```
lerna bootstrap
```### Symlink all packages
To symlink together all packages while developing, run the following command:
```
lerna link
```### Add a package
To add a package, you need to run:
```
lerna create
```#### Setup TypeScript
This repository uses [TypeScript](https://www.typescriptlang.org/) and each packages reference the global [tsconfig.json](./tsconfig.json).
Add the following `tsconfig.json` file in your package:
```
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
},
"include": [
"./src"
]
}
```#### Setup Jest
Jest is being used to run tests.
Add the following `jest.config.js` file in your package:
```
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
```#### Setup package.json scripts
Once TypeScript and Jest have been setup, you need to add the following scripts to your package `package.json`:
```
"scripts": {
"format": "prettier --config ../../.prettierrc --ignore-path ../../.prettierignore --write \"**/*.{ts,js}\"",
"tsc": "tsc",
"test": "jest ./__tests__/index.ts"
},
```### Compile a package
In the package directory, run the following command:
```
npm run tsc
```If you wish to compile all packages, you can run the following command in the root directory of this project:
```
lerna run tsc
```### Publish a package
In the root directory of this project, run the following command:
```
npm run publish
```If it's the first time you publish this package, you will need to pass `--access public`:
```
npm run publish --access public
```### Tests
To run unit tests across all packages, run:
```
lerna run test
```### Code quality
[Prettier](https://prettier.io) is used to format TypeScript code. Use it by running:
```
lerna run format
```We also use [Husky](https://typicode.github.io/husky/#/) to run pre-commit hooks which are defined in [.husky/pre-commit](.husky/pre-commit).