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
+31-33Lines changed: 31 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,12 +129,12 @@ and instead only depend on having a working Docker install.
129
129
### Step 1: Open Issue
130
130
131
131
If there isn't one already, open an issue describing what you intend to contribute. It's useful to communicate in
132
-
advance, because sometimes, someone is already working in this space, so maybe it's worth collaborating with them
133
-
instead of duplicating the efforts.
132
+
advance because if someone is already working in this space, it may be worth collaborating with them
133
+
instead of duplicating the effort.
134
134
135
135
### Step 2: Design (optional)
136
136
137
-
In some cases, it is useful to seek for feedback by iterating on a design document. This is useful
137
+
In some cases, it is useful to seek feedback by iterating on a design document. This is useful
138
138
when you plan a big change or feature, or you want advice on what would be the best path forward.
139
139
140
140
Sometimes, the GitHub issue is sufficient for such discussions, and can be sufficient to get
@@ -166,7 +166,7 @@ Work your magic. Here are some guidelines:
166
166
* Every change requires a unit test
167
167
* If you change APIs, make sure to update the module's README file
168
168
* Try to maintain a single feature/bugfix per pull request. It's okay to introduce a little bit of housekeeping
169
-
changes along the way, but try to avoid conflating multiple features. Eventually all these are going to go into a
169
+
changes along the way, but try to avoid conflating multiple features. Eventually, all these are going to go into a
170
170
single commit, so you can use that to frame your scope.
171
171
* If your change introduces a new construct, take a look at the our
172
172
[example Construct Library](packages/@aws-cdk/example-construct-library) for an explanation of the common patterns we use.
@@ -249,7 +249,7 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now
249
249
250
250
### Step 5: Pull Request
251
251
252
-
* Push to a GitHub fork or to a branch (naming convention: `<user>/<feature-bug-name>`)
252
+
* Push to a GitHub fork or to a branch (naming convention: `<user>/<feature-bug-name>`).
253
253
* Submit a Pull Request on GitHub. A reviewer will later be assigned by the maintainers.
254
254
* Please follow the PR checklist written below. We trust our contributors to self-check, and this helps that process!
255
255
* Discuss review comments and iterate until you get at least one “Approve”. When iterating, push new commits to the
@@ -262,15 +262,15 @@ BREAKING CHANGE: Description of what broke and how to achieve this behavior now
262
262
263
263
### Step 6: Merge
264
264
265
-
* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs)
265
+
* Make sure your PR builds successfully (we have CodeBuild setup to automatically build all PRs).
266
266
* Once approved and tested, a maintainer will squash-merge to master and will use your PR title/description as the
267
267
commit message.
268
268
269
269
## Tools
270
270
271
-
The CDK is a big project, and, at the moment, all of the CDK modules are mastered in a single monolithic repository
271
+
The CDK is a big project, and at the moment, all of the CDK modules are mastered in a single monolithic repository
272
272
(uses [lerna](https://github.com/lerna/lerna)). There are pros and cons to this approach, and it's especially valuable
273
-
to maintain integrity in the early stage of the project where things constantly change across the stack. In the future
273
+
to maintain integrity in the early stage of the project where things constantly change across the stack. In the future,
274
274
we believe many of these modules will be extracted to their own repositories.
275
275
276
276
Another complexity is that the CDK is packaged using [jsii](https://github.com/aws/jsii) to multiple programming
@@ -328,7 +328,7 @@ They can also be executed independently of the build script. From the root of a
328
328
yarn lint
329
329
```
330
330
331
-
The following linters are used -
331
+
The following linters are used:
332
332
333
333
-[eslint](#eslint)
334
334
-[pkglint](#pkglint)
@@ -375,7 +375,7 @@ the [guidelines](./DESIGN_GUIDELINES.md).
375
375
Here are a few useful commands:
376
376
377
377
*`yarn awslint` in every module will run __awslint__ for that module.
378
-
*`yarn awslint list` prints all rules (details and rationale in the guidelines doc)
378
+
*`yarn awslint list` prints all rules (details and rationale in the guidelines doc).
379
379
*`scripts/foreach.sh yarn awslint` will start linting the entire repo, progressively. Rerun `scripts/foreach.sh` after fixing to continue.
380
380
*`lerna run awslint --no-bail --stream 2> awslint.txt` will run __awslint__ in all modules and collect all results into awslint.txt
381
381
*`lerna run awslint -- -i <RULE>` will run awslint throughout the repo and
@@ -391,7 +391,7 @@ examples are still accurate. Successfully building examples is also necessary to
391
391
other supported languages (`C#`, `Java`, `Python`, ...).
392
392
393
393
> Note that examples may use libraries that are not part of the `dependencies` or `devDependencies` of the documented
394
-
> package. For example `@aws-cdk/core` contains mainy examples that leverage libraries built *on top of it* (such as
394
+
> package. For example,`@aws-cdk/core` contains many examples that leverage libraries built *on top of it* (such as
395
395
> `@aws-cdk/aws-sns`). Such libraries must be built (using `yarn build`) before **jsii-rosetta** can verify that
396
396
> examples are correct.
397
397
@@ -426,7 +426,7 @@ Each module also has an npm script called `cfn2ts`:
426
426
### scripts/foreach.sh
427
427
428
428
This wonderful tool allows you to execute a command for all modules in this repo
429
-
in topological order, but has the incredible property of being stateful. this
429
+
in topological order, but has the incredible property of being stateful. This
430
430
means that if a command fails, you can fix the issue and resume from where you
431
431
left off.
432
432
@@ -437,7 +437,7 @@ $ scripts/foreach.sh COMMAND
437
437
```
438
438
439
439
This will execute "COMMAND" for each module in the repo (cwd will be the directory of the module).
440
-
if a task fails, it will stop, and then to resume, simply run `foreach.sh` again (with or without the same command).
440
+
If a task fails, it will stop. To resume, simply run `foreach.sh` again (with or without the same command).
441
441
442
442
To reset the session (either when all tasks finished or if you wish to run a different session), run:
443
443
@@ -452,11 +452,11 @@ $ cd packages/my-module
452
452
$ ../scripts/foreach.sh --up COMMAND
453
453
```
454
454
455
-
This will execute `COMMAND` against `my-module` and all it's deps (in a topological order of course).
455
+
This will execute `COMMAND` against `my-module` and all its deps (in a topological order, of course).
456
456
457
457
### Jetbrains support (WebStorm/IntelliJ)
458
458
459
-
This project uses lerna and utilizes symlinks inside nested node_modules directories. You may encounter an issue during
459
+
This project uses lerna and utilizes symlinks inside nested `node_modules` directories. You may encounter an issue during
460
460
indexing where the IDE attempts to index these directories and keeps following links until the process runs out of
461
461
available memory and crashes. To fix this, you can run ```node ./scripts/jetbrains-remove-node-modules.js``` to exclude
462
462
these directories.
@@ -528,12 +528,12 @@ $ cd packages/@aws-cdk/aws-ec2
528
528
$ ../../../scripts/buildup
529
529
```
530
530
531
-
Note that `buildup` uses `foreach.sh`, which means it's resumable. If your build fails and you wish to resume, just run
531
+
Note that `buildup` uses `foreach.sh`, which means it is resumable. If your build fails and you wish to resume, just run
532
532
`buildup --resume`. If you wish to restart, run `buildup` again.
533
533
534
534
### Partial pack
535
535
536
-
Packing involves generating CDK code in the various target languages, and packaged up ready to be published to the
536
+
Packing involves generating CDK code in the various target languages and packaging them up to be published to their
537
537
respective package managers. Once in a while, these will need to be generated either to test the experience of a new
538
538
feature, or reproduce a packaging failure.
539
539
@@ -569,14 +569,14 @@ Code...
569
569
570
570
Now to test, you can either use `yarn test` or invoke nodeunit/jest directly:
571
571
572
-
Running nodeunit tests directly on a module
572
+
Running nodeunit tests directly on a module:
573
573
```console
574
574
$ cd packages/@aws-cdk/aws-iam
575
575
$ nodeunit test/test.*.js
576
576
<BOOM>
577
577
```
578
578
579
-
Running jest tests directly on a module
579
+
Running jest tests directly on a module:
580
580
```console
581
581
$ cd packages/@aws-cdk/aws-iam
582
582
$ jest test/*test.js
@@ -599,7 +599,7 @@ One can use the `postinstall` script to symlink this repo:
599
599
```
600
600
601
601
This assumes this repo is a sibling of the target repo and will install the CDK as a linked dependency during
602
-
__yarn install__.
602
+
`yarn install`.
603
603
604
604
### Running integration tests in parallel
605
605
@@ -713,7 +713,7 @@ can be used in these cases.
713
713
#### Fixture Files
714
714
715
715
Examples typed in fenced code blocks (looking like `'''ts`, but then with backticks
716
-
instead of regular quotes) will be automatically extrated, compiled and translated
716
+
instead of regular quotes) will be automatically extracted, compiled and translated
717
717
to other languages when the bindings are generated.
718
718
719
719
To successfully do that, they must be compilable. The easiest way to do that is using
@@ -765,14 +765,14 @@ In order to offer a consistent documentation style throughout the AWS CDK
765
765
codebase, example code should follow the following recommendations (there may be
766
766
cases where some of those do not apply - good judgement is to be applied):
767
767
768
-
- Types from the documented module should be **un-qualified**
768
+
- Types from the documented module should be **un-qualified**:
769
769
770
770
```ts
771
771
// An example in the @aws-cdk/core library, which defines Duration
772
772
Duration.minutes(15);
773
773
```
774
774
775
-
- Types from other modules should be **qualified**
775
+
- Types from other modules should be **qualified**:
776
776
777
777
```ts
778
778
// An example in the @aws-cdk/core library, using something from @aws-cdk/aws-s3
@@ -880,7 +880,7 @@ this branch belongs to.
880
880
To reduce merge conflicts in automatic merges between version branches, the
881
881
current version number is stored under `version.vNN.json` (where `NN` is
882
882
`majorVersion`) and changelogs are stored under `CHANGELOG.NN.md` (for
883
-
historical reasons, the changelog for 1.x is under `CHANGELOG.md`). When we
883
+
historical reasons, the changelog for 1.x is under `CHANGELOG.md`). When we
884
884
fork to a new release branch (e.g. `v2-main`), we will update `release.json` in
885
885
this branch to reflect the new version line, and this information will be used
886
886
to determine how releases are cut.
@@ -931,8 +931,7 @@ $ yarn build
931
931
However, this will be time consuming. In this section we'll describe some common issues you may encounter and some more
932
932
targeted commands you can run to resolve your issue.
933
933
934
-
* The compiler is throwing errors on files that I renamed/it's running old tests that I meant to remove/code coverage is
935
-
low and I didn't change anything.
934
+
#### The compiler is throwing errors on files that I renamed/it's running old tests that I meant to remove/code coverage is low and I didn't change anything.
936
935
937
936
If you switch to a branch in which `.ts` files got renamed or deleted, the generated `.js` and `.d.ts` files from the
938
937
previous compilation run are still around and may in some cases still be picked up by the compiler or test runners.
@@ -943,27 +942,26 @@ Run the following to clear out stale build artifacts:
943
942
$ scripts/clean-stale-files.sh
944
943
```
945
944
946
-
* I added a dependency but it's not being picked up by the build
945
+
####I added a dependency but it's not being picked up by the build
947
946
948
947
You need to tell Lerna to update all dependencies:
949
948
950
949
```shell
951
950
$ node_modules/.bin/lerna bootstrap
952
951
```
953
952
954
-
* I added a dependency but it's not being picked up by a `watch` background compilation run.
953
+
####I added a dependency but it's not being picked up by a `watch` background compilation run.
955
954
956
955
No it's not. After re-bootstrapping you need to restart the watch command.
957
956
958
-
* I added a dependency but it's not being picked up by Visual Studio Code (I still get red underlines).
957
+
####I added a dependency but it's not being picked up by Visual Studio Code (I still get red underlines).
959
958
960
959
The TypeScript compiler that's running has cached your dependency tree. After re-bootstrapping,
961
960
restart the TypeScript compiler.
962
961
963
962
Hit F1, type `> TypeScript: Restart TS Server`.
964
963
965
-
* I'm doing refactorings between packages and compile times are killing me/I need to switch between
966
-
differently-verionsed branches a lot and rebuilds because of version errors are taking too long.
964
+
#### I'm doing refactorings between packages and compile times are killing me/I need to switch between differently-verionsed branches a lot and rebuilds because of version errors are taking too long.
967
965
968
966
Our build steps for each package do a couple of things, such as generating code and generating JSII assemblies. If
969
967
you've done a full build at least once to generate all source files, you can do a quicker TypeScript-only rebuild of the
@@ -996,7 +994,7 @@ $ CDK_TEST_BUILD=false lr test
996
994
To debug your CDK application along with the CDK repository,
997
995
998
996
1. Clone the CDK repository locally and build the repository. See [Workflows](#workflows) section for the different build options.
999
-
2. Build the CDK application using the appropriate npm script (typically, `yarn build`) and then run the `link-all.sh` script as so -
997
+
2. Build the CDK application using the appropriate npm script (typically, `yarn build`) and then run the `link-all.sh` script as follows:
1000
998
1001
999
```
1002
1000
cd /path/to/cdk/app
@@ -1036,7 +1034,7 @@ To debug your CDK application along with the CDK repository,
1036
1034
}
1037
1035
```
1038
1036
1039
-
*Go [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) for more about launch configurations.*
1037
+
*NOTE: Go [here](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) for more about launch configurations.*
1040
1038
1041
1039
6. The debug view, should now have a launch configuration called 'Debug hello-cdk' and launching that will start the debugger.
1042
1040
7. Any time you modify the CDK app or any of the CDK modules, they need to be re-built and depending on the change the `link-all.sh` script from step#2, may need to be re-run. Only then, would VS code recognize the change and potentially the breakpoint.
0 commit comments