|
3 | 3 | 1. Create empty package: `npx lerna create @cdk-seed/<package-name>` |
4 | 4 | 1. Prepare package: `npx jsii-config-p ./packages/<package-name>/package.json` |
5 | 5 |
|
| 6 | +All TypeScript tooling is managed by [`jsii`](https://github.com/aws/jsii) and generated by running `npm build`. There is no need to add or modify TypeScript build configuration (e.g. `tsconfig.json`). |
| 7 | + |
| 8 | +## Documentation |
| 9 | + |
| 10 | +To support others who want to use our distributed constructs, we want to ensure that each package distributed by CDK Seed is well documented. |
| 11 | + |
| 12 | +### README |
| 13 | + |
| 14 | +Each package should contain a `README.md` at its root. We use [Github Flavored Markdown](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) to render the content into HTML. The README should be formatted as follows: |
| 15 | + |
| 16 | +```markdown |
| 17 | +# <!--Construct Name --> |
| 18 | + |
| 19 | +<!-- A brief description of what the construct's purpose --> |
| 20 | + |
| 21 | +## Use Cases |
| 22 | + |
| 23 | +<!-- Some examples of when a user may want to utilize this construct --> |
| 24 | + |
| 25 | +## Examples |
| 26 | + |
| 27 | +<!-- Examples of how to use the construct --> |
| 28 | + |
| 29 | +## Requirements |
| 30 | + |
| 31 | +<!-- Expectations of user's VPC configuration, etc --> |
| 32 | +``` |
| 33 | + |
| 34 | +Code samples can be included alongside text within in markdown files as such: |
| 35 | + |
| 36 | + <div class="code-example"> |
| 37 | + |
| 38 | + Below is an example of doing something with code! |
| 39 | + |
| 40 | + </div> |
| 41 | + |
| 42 | + ```ts |
| 43 | + console.log("Look, I'm doing something!") |
| 44 | + ``` |
| 45 | + |
| 46 | +For more UI components, see the [Just the Docs](https://pmarsceill.github.io/just-the-docs/docs/ui-components) documentation. |
| 47 | + |
| 48 | +_NOTE: Just the Docs' examples utilize Kramdown to render its markdown, not Github Flavored Markdown. Being that we use Github Flavored Markdown, shorthand such as `{: .btn }` is not available. Any non-standard markdown should be written as HTML._ |
| 49 | + |
| 50 | +### JSDocs |
| 51 | + |
| 52 | +Code documentation is generated automatically from the [JSDoc](https://jsdoc.app/) comment blocks provided within the TypeScript source code. At a minimum, every member of the `props` interface and the exported `Construct` should be annotated with JSDoc information. |
| 53 | + |
| 54 | + _NOTE: At time of writing, it appears that only the `@deprecated` tag makes its way from the JSDoc annotations to the rendered markdown. As such, content from other tags (e.g. `@default`) should be duplicated within the textual messaging of the JSDoc description._ |
| 55 | + |
6 | 56 | ## Additional Resources |
7 | 57 |
|
8 | 58 | - [jsii - Getting Started](https://github.com/aws/jsii#getting-started) |
|
0 commit comments