1 | ### Package file generation
|
2 |
|
3 | This tasks does lots of work to install handful of packages and update `package.json` file.
|
4 |
|
5 | The list of operations is based on my personal learnings while maintaining open source projects.
|
6 |
|
7 | #### Testing
|
8 |
|
9 | The [japa](https://github.com/thetutlage/japa) test runner is installed along side with `japaFile.js`.
|
10 |
|
11 | #### Typescript setup
|
12 |
|
13 | We create a `tsconfig.json` file and install following dependencies.
|
14 |
|
15 | 1. `@types/node`
|
16 | 2. `typescript`
|
17 | 3. `@adonisjs/require-ts`
|
18 |
|
19 | #### Scripts
|
20 | The following scripts are defined inside the `package.json` file.
|
21 |
|
22 | 1. `clean` to clean the build folder before starting the build. We also install `del-cli` npm package for this script to work
|
23 | 2. `compile` to compile the TypeScript code to JavaScript
|
24 | 3. `build` runs compile
|
25 | 4. `prePublishOnly` to compile before publishing to npm.
|