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
+58-13Lines changed: 58 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,52 @@ Thank you for your interest in contributing to our project! 💛
4
4
5
5
Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community. Please read through these guidelines carefully before submitting a PR or issue and let us know if it's not up-to-date (or even better, submit a PR with your proposed corrections 😉).
6
6
7
-
#Development Process
7
+
## Getting Started
8
8
9
9
Our work is done directly on Github and PR's are sent to the GitHub repo by core team members and contributors. Everyone undergoes the same review process to get their changes into the repo.
10
10
11
-
# Setting up for local development
11
+
This section should get you running with **Amplify Codegen**.
12
12
13
-
This section should get you running with **Amplify Codegen**. 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).
13
+
### Setting up for local development
14
14
15
-
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).
15
+
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
16
17
-
```
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).
> 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
+
25
+
3. Move into your project folder
26
+
27
+
```sh
19
28
$ cd amplify-codegen
29
+
```
30
+
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.
20
32
21
-
$ yarn run setup-dev
33
+
```sh
34
+
$ yarn setup-dev
22
35
```
23
36
24
-
# Bugs
37
+
> 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.
38
+
39
+
### Architecture of the codebase
40
+
41
+
Amplify Codegen is a monorepo built with [Yarn Workspaces](https://yarnpkg.com/features/workspaces) and [Lerna](https://github.com/lerna/lerna). All packages live within the `packages/` directory in the root. Each category inside packages has its own `src/` and `package.json`.
42
+
43
+
### Steps towards contribution
44
+
45
+
- Make changes to required file.
46
+
- Write unit tests
47
+
- Run `yarn build` to compile your changes
48
+
-[Run test suite](#tests)
49
+
- Test in sample app using [amplify-dev](#tests)
50
+
- Submit a PR
51
+
52
+
## Bugs
25
53
26
54
Bug reports and feature suggestions are always welcome. Good bug reports are extremely helpful, so thanks in advance!
27
55
@@ -40,20 +68,20 @@ Guidelines for bug reports:
40
68
- Format any code snippets using [Markdown](https://docs.github.com/en/github/writing-on-github/creating-and-highlighting-code-blocks) syntax
41
69
- If you're not using the latest version of the CLI, see if the issue still persists after upgrading - this helps to isolate regressions!
42
70
43
-
# Pull Requests
44
-
71
+
## Pull Requests
45
72
46
73
Pull requests are welcome!
47
74
48
-
You should open an issue to discuss your pull request, unless it's a trivial change. It's best to ensure that your proposed change would be accepted so that you don't waste your own time. If you would like to implement support for a significant feature that is not yet available, please talk to us beforehand to avoid any duplication of effort.
75
+
You should open an issue to discuss your pull request, unless it's a trivial change. It's best to ensure that your proposed change would be accepted so that you don't waste your own time. If you would like to implement support for a significant feature that is not yet available, please talk to us beforehand to avoid any duplication of effort.
49
76
50
77
Pull requests should generally be opened against **master**.
51
78
52
-
Only include ***src*** files in your PR. Don't include any build files i.e. dist/. These will be built upon publish to npm and when a release is created on GitHub.
79
+
Don't include any build files i.e. `dist/`, `lib/`. These will be built upon publish to npm and when a release is created on GitHub.
53
80
54
81
Before submitting PR make sure to run `yarn` on the root of monorepo to ensure that commit lint and husky are installed.
55
82
56
83
Make sure you follow [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/) commit message structure. You can automatically generate conventional commit message by running `yarn commit` in the root of the amplify mono repo. This will run through series of question shown below
84
+
57
85
```
58
86
? Select the type of change that you're committing: <type of commit (if its a feature, bug fix etc.,>
59
87
? What is the scope of this change (e.g. component or file name)? <package name if change is only in one package>
@@ -67,7 +95,25 @@ Make sure you follow [conventional commits](https://www.conventionalcommits.org/
67
95
68
96
## Tests
69
97
70
-
Please ensure that your change still passes unit tests, and ideally integration/UI tests. Use `yarn run test-ci` to run the test suite like it would in our CI environment. It's OK if you're still working on tests at the time that you submit, but be prepared to be asked about them. Wherever possible, pull requests should contain tests as appropriate. Bugfixes should contain tests that exercise the corrected behavior (i.e., the test should fail without the bugfix and pass with it), and new features should be accompanied by tests exercising the feature.
98
+
Please ensure that your change still passes unit tests, and ideally integration/UI tests. It's OK if you're still working on tests at the time that you submit, but be prepared to be asked about them. Wherever possible, pull requests should contain tests as appropriate. Bugfixes should contain tests that exercise the corrected behavior (i.e., the test should fail without the bugfix and pass with it), and new features should be accompanied by tests exercising the feature.
99
+
100
+
To run the test suite:
101
+
102
+
```sh
103
+
# Unit tests
104
+
$ yarn test
105
+
106
+
# Tests in CI environment
107
+
$ yarn test-ci
108
+
```
109
+
110
+
To test in a sample application with `amplify-dev`:
111
+
112
+
```sh
113
+
$ cd<your-test-frontend-project>
114
+
$ amplify-dev init
115
+
$ amplify-dev codegen <subcommand>
116
+
```
71
117
72
118
## Code Style
73
119
@@ -92,7 +138,6 @@ For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of
92
138
93
139
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue.
94
140
95
-
96
141
## Licensing
97
142
98
143
AWS Amplify Codegen is [Apache 2.0](LICENSE)-licensed. Contributions you submit will be released under that license.
0 commit comments