Skip to content

Commit d594541

Browse files
authored
chore: improve docs on iterative builds while developing (#603)
1 parent bb51593 commit d594541

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

CONTRIBUTING.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,50 @@ Our work is done directly on Github and PR's are sent to the GitHub repo by core
1010

1111
This section should get you running with **Amplify Codegen**.
1212

13-
### Setting up for local development
13+
### Local Development
14+
15+
#### Environment Setup
1416

1517
1. You will need the latest version of [nodejs](https://nodejs.org/en/) on your system and developing locally also requires `yarn` workspaces. You can install it [here](https://classic.yarnpkg.com/en/docs/install#mac-stable).
1618

17-
2. Start by [Forking](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the main branch of [amplify-codegen](https://github.com/aws-amplify/amplify-codegen).
19+
1. Start by [Forking](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the main branch of [amplify-codegen](https://github.com/aws-amplify/amplify-codegen).
1820

1921
```sh
2022
$ git clone [email protected]:[username]/amplify-codegen.git
2123
```
2224

2325
> NOTE: Make sure to always [sync your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) with _main_ branch of amplify-codegen
2426
25-
3. Move into your project folder
27+
1. Move into your project folder
2628

2729
```sh
2830
$ cd amplify-codegen
2931
```
3032

31-
4. Run `setup-dev` script to installs dependencies and perform initial configuration. This command will also link a `amplify-dev` binary for your local testing.
33+
#### Building and Running Tests
34+
35+
1. To build local packages and verify your change is valid and doesn't break the build, you can run :
36+
37+
```sh
38+
yarn # Install all dependencies for the workspace
39+
yarn build # Build all packages in the repo
40+
yarn test # Run tests for all packages in the repo
41+
```
42+
43+
1. Note: once you've run an initial `yarn` unless you're changing dependencies in a package, re-running should not be necessary.
44+
1. After an initial build, if you're testing changes to a single package, you can run `yarn build` and `yarn test` specifically from that directory (e.g. `/packages/appsync-modelgen-plugin`) in order to speed up your iteration cycle.
45+
46+
#### Building the CLI Locally for functional testing
47+
48+
1. Run `setup-dev` script to installs dependencies and perform initial configuration. This command will also link a `amplify-dev` binary for your local testing.
3249

3350
```sh
3451
$ yarn setup-dev
3552
```
3653

3754
> NOTE: The `amplify-dev` binary is built based on the latest amplify cli from npm registry and your local codegen packages. All your local changes from codegen can be reflected (typescript files need to be build by `tsc`). In addition, if you are a developer of cli repo, you can run the same command to override the `amplify-dev` binary.
3855
39-
5. Ensure `amplify-dev` exists on your path.
56+
1. Ensure `amplify-dev` exists on your path.
4057

4158
```sh
4259
$ yarn global bin # retrieve yarn path

0 commit comments

Comments
 (0)