You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,33 +10,50 @@ Our work is done directly on Github and PR's are sent to the GitHub repo by core
10
10
11
11
This section should get you running with **Amplify Codegen**.
12
12
13
-
### Setting up for local development
13
+
### Local Development
14
+
15
+
#### Environment Setup
14
16
15
17
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).
16
18
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).
> 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
24
26
25
-
3. Move into your project folder
27
+
1. Move into your project folder
26
28
27
29
```sh
28
30
$ cd amplify-codegen
29
31
```
30
32
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.
32
49
33
50
```sh
34
51
$ yarn setup-dev
35
52
```
36
53
37
54
> 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.
0 commit comments