1
0
Fork 0
toolkit/README.md

54 lines
2.2 KiB
Markdown
Raw Normal View History

2019-04-20 14:56:56 +00:00
# Actions Toolkit 🛠
## Packages
| Package | Description |
| ------- | ----------- |
2019-06-14 15:43:06 +00:00
| [@actions/core](packages/core) | Core functions for setting results, logging, secrets and environment variables |
| [@actions/exec](packages/exec) | Functions necessary for running tools on the command line |
2019-04-20 14:56:56 +00:00
| [@actions/exit](packages/exit) | Provides utilities for exiting from an action |
2019-06-14 15:43:06 +00:00
| [@actions/io](packages/io) | Core functions for CLI filesystem scenarios |
| [@actions/tool-cache](packages/tool-cache) | Functions necessary for downloading and caching tools |
2019-04-20 14:56:56 +00:00
| [@actions/toolkit](packages/toolkit) | A general-purpose toolkit for writing actions |
2019-04-22 15:46:19 +00:00
## Development
This repository uses [Lerna](https://github.com/lerna/lerna#readme) to manage multiple packages. Read the documentation there to begin contributing.
2019-06-25 11:23:37 +00:00
Note that before a PR will be accepted, you must ensure:
- all tests are passing
- `npm run format` reports no issues
- `npm run lint` reports no issues
2019-04-22 15:46:19 +00:00
### Useful Scripts
- `npm run bootstrap` This runs `lerna bootstrap` which will install dependencies in this repository's packages and cross-link packages where necessary.
- `npm run build` This compiles TypeScript code in each package (this is especially important if one package relies on changes in another when you're running tests). This is just an alias for `lerna run tsc`.
- `npm run format` This checks that formatting has been applied with Prettier.
- `npm test` This runs all Jest tests in all packages in this repository.
- If you need to run tests for only one package, you can pass normal Jest CLI options:
```console
$ npm test -- packages/toolkit
```
- `npm run create-package [name]` This runs a script that automates a couple of parts of creating a new package.
2019-04-22 15:46:19 +00:00
### Creating a Package
1. In a new branch, create a new Lerna package:
```console
2019-04-22 15:54:05 +00:00
$ npm run create-package new-package
2019-04-22 15:46:19 +00:00
```
This will ask you some questions about the new package. Start with `0.0.0` as the first version (look generally at some of the other packages for how the package.json is structured).
2019-04-22 16:02:40 +00:00
2. Add `tsc` script to the new package's package.json file:
2019-04-22 15:46:19 +00:00
```json
"scripts": {
"tsc": "tsc"
}
```
2019-04-22 16:02:40 +00:00
3. Start developing 😄 and open a pull request.