Skip to content

Commit b20fd8e

Browse files
authored
chore: document new --unstable protocol for CLI features (#31612)
New protocol for `--unstable` is documented here and being used in #31611 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 00cdbcb commit b20fd8e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,24 @@ grantAwesomePowerBeta1()
954954
When we decide it's time to graduate the API, the latest preview version will
955955
be deprecated and the final version - `grantAwesomePower` will be added.
956956

957+
### Adding new experimental CLI features
958+
959+
In order to move fast when developing new CLI features, we may decide to release
960+
functionality as "experimental" or "incremental." In this scenario we can utilize
961+
explicit opt-in via an `--unstable` flag.
962+
963+
Explicit opt-ins would look something like this:
964+
965+
```bash
966+
cdk new-command --unstable='new-command'
967+
968+
cdk bootstrap --unstable='new-funky-bootstrap'
969+
```
970+
971+
And can be simply added as an additional flag on the CLI command that is being worked on.
972+
When the time comes to stabilize the command, we remove the requirement that such a flag
973+
is set.
974+
957975
## Documentation
958976

959977
Every module's README is rendered as the landing page of the official documentation. For example, this is

packages/aws-cdk/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ The AWS CDK Toolkit provides the `cdk` command-line interface that can be used t
3333
- [SSO Support](#sso-support)
3434
- [Configuration](#configuration)
3535
- [Running in CI](#running-in-ci)
36+
- [Stability](#stability)
37+
- [Changing the default TypeScript transpiler](#Changing-the-default-TypeScript-transpiler)
3638

3739

3840
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
@@ -1067,6 +1069,20 @@ The CLI will attempt to detect whether it is being run in CI by looking for the
10671069
environment variable `CI=true`. This can be forced by passing the `--ci` flag. By default the CLI
10681070
sends most of its logs to `stderr`, but when `ci=true` it will send the logs to `stdout` instead.
10691071

1072+
### Stability
1073+
1074+
Sometimes the CDK team will release experimental or incremental features. In these scenarios we will
1075+
require explicit opt-in from users via the `--unstable` flag. For example, if we are working on a new
1076+
bootstrap feature and decide to release it incrementally, we will "hide" its functionality.
1077+
Opting in would look something like this:
1078+
1079+
```bash
1080+
cdk bootstrap --unstable='new-funky-bootstrap'
1081+
```
1082+
1083+
When the feature is stabilized, explicit opt-in is no longer necessary but the feature will continue
1084+
to work with the `--unstable` flag set.
1085+
10701086
### Changing the default TypeScript transpiler
10711087

10721088
The ts-node package used to synthesize and deploy CDK apps supports an alternate transpiler that might improve transpile times. The SWC transpiler is written in Rust and has no type checking. The SWC transpiler should be enabled by experienced TypeScript developers.

0 commit comments

Comments
 (0)