Slide 11
Slide 11 text
.projenrc.js example
11
• Apply changes with projen command
• No manual editing
• Build fails if edited manually
• e.g., publishToPypi
• python added to jsii configuration in
package.json
• Step to publish to PyPI added to
release.yml (GitHub Actions)
API Reference
https://projen.io/api/API.html#projen-awscdk-awscdkconstructlibrary
const { awscdk } = require('projen');
const cdkVersion = '2.25.0';
const project = new awscdk.AwsCdkConstructLibrary({
author: 'hayao-k',
authorAddress: '30886141+hayao-k@users.noreply.github.com',
cdkVersion,
defaultReleaseBranch: 'main',
name: 'cdk-sample-lib',
repositoryUrl: 'https://github.com/hayao-k/cdk-sample-lib.git',
description: 'Sample AWS CDK Construct Library by projen',
keywords: ['sample'],
license: 'Apache-2.0',
deps: [
`@aws-cdk/aws-apigatewayv2-alpha@${cdkVersion}-alpha.0`,
`@aws-cdk/aws-apigatewayv2-integrations-alpha@${cdkVersion}-alpha.0`,
'other-useful-lib'
],
publishToPypi: {
distName: 'cdk-sample-lib',
module: 'cdk_sample_lib',
},
});
project.synth();