This repository template helps you generate JSII construct library for AWS CDK and aims to simplify
the process to develop, build, test and eventually publish your AWS CDK construct lib to npmjs and pipy.
- src - all the typescript source code under this directory
- test - unit tests and integ tests
- lib - will be auto-generated from the
srcwhen you runyarn build
- customize your
.projenrc.js - run
npx projento project generate assets including theLICENSE,version.json,package.jsonand.github/workflowsfrom.projenrc.js. At this moment, your initialversionshould be0.0.0. yarn installto install all required npm packages
You can run the commands above like this:
$ npx projen && yarn installFrom now on, we will refer to this command as pj. Every time you modify .projenrc.js, just run pj.
Put this in your shell profile: alias pj='npx projen && yarn install'
- run
yarn watchin a seperate terminal - edit
test/integ.api.ts - Run
cdk diffandcdk deployto ensure it deploys with no error in your real aws environment.
cdk --app 'test/integ.api.js' diff
cdk --app 'test/integ.api.js' deploy- validate the stack
- edit
test/*.test.ts - run
yarn test
If yarn test is doing great with no error. Run yarn build to generate the lib and other assets.
$ git commit -am "chore(release): initial commit for the first release" To bump a specific release version number, i.e. v0.1.0
$ yarn bump --release-as v0.1.0or simply bump the minor version from version.json, in which case the version will bump from 0.0.0 to 0.0.1
$ yarn bumpand git push with the tags
$ git push --follow-tags origin masterOr just:
# this equals to `arn bump && git push --follow-tags origin master`, see package.json
$ yarn releaseIf you push successfully, go to your the Actions in your github repository, make sure the build and release workflows run successfully.
This template leverages the eladb/projen by Elad Ben-Israel. Check it out for more detials and usages for the projen command.