projen 0.34.18 → 0.34.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +87 -32
- package/API.md +42 -14
- package/docs/awscdk-apps.md +15 -0
- package/docs/awscdk-construct.md +39 -63
- package/docs/awscdk.md +176 -0
- package/lib/awscdk/auto-discover.js +1 -1
- package/lib/awscdk/cdk-config.js +1 -1
- package/lib/awscdk/cdk-tasks.js +1 -1
- package/lib/awscdk/java-app.js +1 -1
- package/lib/awscdk/lambda-function.js +2 -2
- package/lib/awscdk-app-ts.js +1 -1
- package/lib/awscdk-construct.js +2 -2
- package/lib/cdk8s-app-ts.js +1 -1
- package/lib/cdk8s-construct.js +1 -1
- package/lib/cdktf-construct.js +1 -1
- package/lib/component.js +1 -1
- package/lib/construct-lib.js +1 -1
- package/lib/deps/dependencies.js +1 -1
- package/lib/dev-env.js +1 -1
- package/lib/docker-compose.js +2 -2
- package/lib/eslint.js +1 -1
- package/lib/file.js +1 -1
- package/lib/git/gitattributes.js +1 -1
- package/lib/github/auto-approve.js +1 -1
- package/lib/github/auto-merge.js +1 -1
- package/lib/github/dependabot.js +1 -1
- package/lib/github/github.d.ts +0 -1
- package/lib/github/github.js +5 -9
- package/lib/github/mergify.js +1 -1
- package/lib/github/pr-template.js +1 -1
- package/lib/github/pull-request-lint.js +1 -1
- package/lib/github/stale.js +1 -1
- package/lib/github/task-workflow.js +1 -1
- package/lib/github/workflows.d.ts +24 -0
- package/lib/github/workflows.js +25 -3
- package/lib/gitpod.js +1 -1
- package/lib/ignore-file.js +1 -1
- package/lib/ini.js +1 -1
- package/lib/java/java-project.js +1 -1
- package/lib/java/junit.js +1 -1
- package/lib/java/maven-compile.js +1 -1
- package/lib/java/maven-packaging.js +1 -1
- package/lib/java/maven-sample.js +1 -1
- package/lib/java/pom.js +1 -1
- package/lib/java/projenrc.js +1 -1
- package/lib/javascript/bundler.js +1 -1
- package/lib/javascript/npm-config.js +1 -1
- package/lib/javascript/projenrc.js +1 -1
- package/lib/jest.js +1 -1
- package/lib/jsii-project.js +1 -1
- package/lib/json/projenrc.js +1 -1
- package/lib/json.js +1 -1
- package/lib/license.js +1 -1
- package/lib/logger.js +1 -1
- package/lib/makefile.js +1 -1
- package/lib/node-package.js +1 -1
- package/lib/node-project.js +1 -1
- package/lib/object-file.js +1 -1
- package/lib/project-build.js +1 -1
- package/lib/project.js +2 -2
- package/lib/projects.js +1 -1
- package/lib/python/pip.js +1 -1
- package/lib/python/poetry.js +2 -2
- package/lib/python/projenrc.js +1 -1
- package/lib/python/pytest.js +1 -1
- package/lib/python/python-project.js +1 -1
- package/lib/python/python-sample.js +1 -1
- package/lib/python/requirements-file.js +1 -1
- package/lib/python/setuppy.js +1 -1
- package/lib/python/setuptools.js +1 -1
- package/lib/python/venv.js +1 -1
- package/lib/readme.js +1 -1
- package/lib/release/publisher.d.ts +4 -4
- package/lib/release/publisher.js +7 -7
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.d.ts +0 -6
- package/lib/release/release.js +15 -19
- package/lib/sample-file.js +2 -2
- package/lib/semver.js +1 -1
- package/lib/source-code.js +1 -1
- package/lib/tasks/runtime.js +1 -1
- package/lib/tasks/task.js +1 -1
- package/lib/tasks/tasks.js +1 -1
- package/lib/textfile.js +1 -1
- package/lib/toml.js +1 -1
- package/lib/typescript/projenrc.js +1 -1
- package/lib/typescript-config.js +1 -1
- package/lib/typescript.js +3 -3
- package/lib/upgrade-dependencies.js +4 -4
- package/lib/version.js +1 -1
- package/lib/vscode/devcontainer.js +1 -1
- package/lib/vscode/launch-config.js +1 -1
- package/lib/vscode/vscode.js +1 -1
- package/lib/web/next.js +3 -3
- package/lib/web/postcss.js +1 -1
- package/lib/web/react.js +4 -4
- package/lib/web/tailwind.js +1 -1
- package/lib/xmlfile.js +1 -1
- package/lib/yaml.js +1 -1
- package/package.json +2 -2
- package/docs/aws-lambda.md +0 -104
package/.jsii
CHANGED
|
@@ -19541,7 +19541,7 @@
|
|
|
19541
19541
|
},
|
|
19542
19542
|
"locationInModule": {
|
|
19543
19543
|
"filename": "src/github/github.ts",
|
|
19544
|
-
"line":
|
|
19544
|
+
"line": 59
|
|
19545
19545
|
},
|
|
19546
19546
|
"parameters": [
|
|
19547
19547
|
{
|
|
@@ -19571,7 +19571,7 @@
|
|
|
19571
19571
|
},
|
|
19572
19572
|
"locationInModule": {
|
|
19573
19573
|
"filename": "src/github/github.ts",
|
|
19574
|
-
"line":
|
|
19574
|
+
"line": 95
|
|
19575
19575
|
},
|
|
19576
19576
|
"name": "addDependabot",
|
|
19577
19577
|
"parameters": [
|
|
@@ -19595,7 +19595,7 @@
|
|
|
19595
19595
|
},
|
|
19596
19596
|
"locationInModule": {
|
|
19597
19597
|
"filename": "src/github/github.ts",
|
|
19598
|
-
"line":
|
|
19598
|
+
"line": 91
|
|
19599
19599
|
},
|
|
19600
19600
|
"name": "addPullRequestTemplate",
|
|
19601
19601
|
"parameters": [
|
|
@@ -19622,7 +19622,7 @@
|
|
|
19622
19622
|
},
|
|
19623
19623
|
"locationInModule": {
|
|
19624
19624
|
"filename": "src/github/github.ts",
|
|
19625
|
-
"line":
|
|
19625
|
+
"line": 86
|
|
19626
19626
|
},
|
|
19627
19627
|
"name": "addWorkflow",
|
|
19628
19628
|
"parameters": [
|
|
@@ -19650,7 +19650,7 @@
|
|
|
19650
19650
|
},
|
|
19651
19651
|
"locationInModule": {
|
|
19652
19652
|
"filename": "src/github/github.ts",
|
|
19653
|
-
"line":
|
|
19653
|
+
"line": 103
|
|
19654
19654
|
},
|
|
19655
19655
|
"name": "tryFindWorkflow",
|
|
19656
19656
|
"parameters": [
|
|
@@ -19683,7 +19683,7 @@
|
|
|
19683
19683
|
"immutable": true,
|
|
19684
19684
|
"locationInModule": {
|
|
19685
19685
|
"filename": "src/github/github.ts",
|
|
19686
|
-
"line":
|
|
19686
|
+
"line": 76
|
|
19687
19687
|
},
|
|
19688
19688
|
"name": "workflows",
|
|
19689
19689
|
"type": {
|
|
@@ -19906,7 +19906,7 @@
|
|
|
19906
19906
|
},
|
|
19907
19907
|
"locationInModule": {
|
|
19908
19908
|
"filename": "src/github/workflows.ts",
|
|
19909
|
-
"line":
|
|
19909
|
+
"line": 57
|
|
19910
19910
|
},
|
|
19911
19911
|
"parameters": [
|
|
19912
19912
|
{
|
|
@@ -19943,7 +19943,7 @@
|
|
|
19943
19943
|
},
|
|
19944
19944
|
"locationInModule": {
|
|
19945
19945
|
"filename": "src/github/workflows.ts",
|
|
19946
|
-
"line":
|
|
19946
|
+
"line": 89
|
|
19947
19947
|
},
|
|
19948
19948
|
"name": "addJobs",
|
|
19949
19949
|
"parameters": [
|
|
@@ -19963,6 +19963,29 @@
|
|
|
19963
19963
|
}
|
|
19964
19964
|
]
|
|
19965
19965
|
},
|
|
19966
|
+
{
|
|
19967
|
+
"docs": {
|
|
19968
|
+
"remarks": "Useful if a component creates jobs that\nmay not be all available until project synthesis time.",
|
|
19969
|
+
"stability": "experimental",
|
|
19970
|
+
"summary": "Add jobs from a dynamic source."
|
|
19971
|
+
},
|
|
19972
|
+
"locationInModule": {
|
|
19973
|
+
"filename": "src/github/workflows.ts",
|
|
19974
|
+
"line": 110
|
|
19975
|
+
},
|
|
19976
|
+
"name": "addJobsLater",
|
|
19977
|
+
"parameters": [
|
|
19978
|
+
{
|
|
19979
|
+
"docs": {
|
|
19980
|
+
"summary": "Source of jobs."
|
|
19981
|
+
},
|
|
19982
|
+
"name": "provider",
|
|
19983
|
+
"type": {
|
|
19984
|
+
"fqn": "projen.github.IJobProvider"
|
|
19985
|
+
}
|
|
19986
|
+
}
|
|
19987
|
+
]
|
|
19988
|
+
},
|
|
19966
19989
|
{
|
|
19967
19990
|
"docs": {
|
|
19968
19991
|
"stability": "experimental",
|
|
@@ -19970,7 +19993,7 @@
|
|
|
19970
19993
|
},
|
|
19971
19994
|
"locationInModule": {
|
|
19972
19995
|
"filename": "src/github/workflows.ts",
|
|
19973
|
-
"line":
|
|
19996
|
+
"line": 77
|
|
19974
19997
|
},
|
|
19975
19998
|
"name": "on",
|
|
19976
19999
|
"parameters": [
|
|
@@ -20023,6 +20046,7 @@
|
|
|
20023
20046
|
},
|
|
20024
20047
|
{
|
|
20025
20048
|
"docs": {
|
|
20049
|
+
"remarks": "May not exist if `workflowsEnabled` is false on `GitHub`.",
|
|
20026
20050
|
"stability": "experimental",
|
|
20027
20051
|
"summary": "The workflow YAML file."
|
|
20028
20052
|
},
|
|
@@ -20097,6 +20121,45 @@
|
|
|
20097
20121
|
],
|
|
20098
20122
|
"symbolId": "src/github/workflows:GithubWorkflowOptions"
|
|
20099
20123
|
},
|
|
20124
|
+
"projen.github.IJobProvider": {
|
|
20125
|
+
"assembly": "projen",
|
|
20126
|
+
"docs": {
|
|
20127
|
+
"stability": "experimental"
|
|
20128
|
+
},
|
|
20129
|
+
"fqn": "projen.github.IJobProvider",
|
|
20130
|
+
"kind": "interface",
|
|
20131
|
+
"locationInModule": {
|
|
20132
|
+
"filename": "src/github/workflows.ts",
|
|
20133
|
+
"line": 234
|
|
20134
|
+
},
|
|
20135
|
+
"methods": [
|
|
20136
|
+
{
|
|
20137
|
+
"abstract": true,
|
|
20138
|
+
"docs": {
|
|
20139
|
+
"stability": "experimental",
|
|
20140
|
+
"summary": "Generates a collection of named GitHub workflow jobs."
|
|
20141
|
+
},
|
|
20142
|
+
"locationInModule": {
|
|
20143
|
+
"filename": "src/github/workflows.ts",
|
|
20144
|
+
"line": 238
|
|
20145
|
+
},
|
|
20146
|
+
"name": "renderJobs",
|
|
20147
|
+
"returns": {
|
|
20148
|
+
"type": {
|
|
20149
|
+
"collection": {
|
|
20150
|
+
"elementtype": {
|
|
20151
|
+
"fqn": "projen.github.workflows.Job"
|
|
20152
|
+
},
|
|
20153
|
+
"kind": "map"
|
|
20154
|
+
}
|
|
20155
|
+
}
|
|
20156
|
+
}
|
|
20157
|
+
}
|
|
20158
|
+
],
|
|
20159
|
+
"name": "IJobProvider",
|
|
20160
|
+
"namespace": "github",
|
|
20161
|
+
"symbolId": "src/github/workflows:IJobProvider"
|
|
20162
|
+
},
|
|
20100
20163
|
"projen.github.Mergify": {
|
|
20101
20164
|
"assembly": "projen",
|
|
20102
20165
|
"base": "projen.Component",
|
|
@@ -29037,7 +29100,7 @@
|
|
|
29037
29100
|
"kind": "interface",
|
|
29038
29101
|
"locationInModule": {
|
|
29039
29102
|
"filename": "src/release/release.ts",
|
|
29040
|
-
"line":
|
|
29103
|
+
"line": 472
|
|
29041
29104
|
},
|
|
29042
29105
|
"name": "BranchOptions",
|
|
29043
29106
|
"namespace": "release",
|
|
@@ -29051,7 +29114,7 @@
|
|
|
29051
29114
|
"immutable": true,
|
|
29052
29115
|
"locationInModule": {
|
|
29053
29116
|
"filename": "src/release/release.ts",
|
|
29054
|
-
"line":
|
|
29117
|
+
"line": 482
|
|
29055
29118
|
},
|
|
29056
29119
|
"name": "majorVersion",
|
|
29057
29120
|
"type": {
|
|
@@ -29068,7 +29131,7 @@
|
|
|
29068
29131
|
"immutable": true,
|
|
29069
29132
|
"locationInModule": {
|
|
29070
29133
|
"filename": "src/release/release.ts",
|
|
29071
|
-
"line":
|
|
29134
|
+
"line": 489
|
|
29072
29135
|
},
|
|
29073
29136
|
"name": "prerelease",
|
|
29074
29137
|
"optional": true,
|
|
@@ -29087,7 +29150,7 @@
|
|
|
29087
29150
|
"immutable": true,
|
|
29088
29151
|
"locationInModule": {
|
|
29089
29152
|
"filename": "src/release/release.ts",
|
|
29090
|
-
"line":
|
|
29153
|
+
"line": 503
|
|
29091
29154
|
},
|
|
29092
29155
|
"name": "tagPrefix",
|
|
29093
29156
|
"optional": true,
|
|
@@ -29105,7 +29168,7 @@
|
|
|
29105
29168
|
"immutable": true,
|
|
29106
29169
|
"locationInModule": {
|
|
29107
29170
|
"filename": "src/release/release.ts",
|
|
29108
|
-
"line":
|
|
29171
|
+
"line": 477
|
|
29109
29172
|
},
|
|
29110
29173
|
"name": "workflowName",
|
|
29111
29174
|
"optional": true,
|
|
@@ -29965,6 +30028,9 @@
|
|
|
29965
30028
|
}
|
|
29966
30029
|
]
|
|
29967
30030
|
},
|
|
30031
|
+
"interfaces": [
|
|
30032
|
+
"projen.github.IJobProvider"
|
|
30033
|
+
],
|
|
29968
30034
|
"kind": "class",
|
|
29969
30035
|
"locationInModule": {
|
|
29970
30036
|
"filename": "src/release/publisher.ts",
|
|
@@ -30146,7 +30212,8 @@
|
|
|
30146
30212
|
"filename": "src/release/publisher.ts",
|
|
30147
30213
|
"line": 98
|
|
30148
30214
|
},
|
|
30149
|
-
"name": "
|
|
30215
|
+
"name": "renderJobs",
|
|
30216
|
+
"overrides": "projen.github.IJobProvider",
|
|
30150
30217
|
"returns": {
|
|
30151
30218
|
"type": {
|
|
30152
30219
|
"collection": {
|
|
@@ -30468,7 +30535,7 @@
|
|
|
30468
30535
|
},
|
|
30469
30536
|
"locationInModule": {
|
|
30470
30537
|
"filename": "src/release/release.ts",
|
|
30471
|
-
"line":
|
|
30538
|
+
"line": 306
|
|
30472
30539
|
},
|
|
30473
30540
|
"name": "addBranch",
|
|
30474
30541
|
"parameters": [
|
|
@@ -30499,7 +30566,7 @@
|
|
|
30499
30566
|
},
|
|
30500
30567
|
"locationInModule": {
|
|
30501
30568
|
"filename": "src/release/release.ts",
|
|
30502
|
-
"line":
|
|
30569
|
+
"line": 335
|
|
30503
30570
|
},
|
|
30504
30571
|
"name": "addJobs",
|
|
30505
30572
|
"parameters": [
|
|
@@ -30518,18 +30585,6 @@
|
|
|
30518
30585
|
}
|
|
30519
30586
|
}
|
|
30520
30587
|
]
|
|
30521
|
-
},
|
|
30522
|
-
{
|
|
30523
|
-
"docs": {
|
|
30524
|
-
"stability": "experimental",
|
|
30525
|
-
"summary": "Called before synthesis."
|
|
30526
|
-
},
|
|
30527
|
-
"locationInModule": {
|
|
30528
|
-
"filename": "src/release/release.ts",
|
|
30529
|
-
"line": 328
|
|
30530
|
-
},
|
|
30531
|
-
"name": "preSynthesize",
|
|
30532
|
-
"overrides": "projen.Component"
|
|
30533
30588
|
}
|
|
30534
30589
|
],
|
|
30535
30590
|
"name": "Release",
|
|
@@ -30543,7 +30598,7 @@
|
|
|
30543
30598
|
"immutable": true,
|
|
30544
30599
|
"locationInModule": {
|
|
30545
30600
|
"filename": "src/release/release.ts",
|
|
30546
|
-
"line":
|
|
30601
|
+
"line": 344
|
|
30547
30602
|
},
|
|
30548
30603
|
"name": "branches",
|
|
30549
30604
|
"type": {
|
|
@@ -34356,6 +34411,6 @@
|
|
|
34356
34411
|
"symbolId": "src/web/tailwind:TailwindConfigOptions"
|
|
34357
34412
|
}
|
|
34358
34413
|
},
|
|
34359
|
-
"version": "0.34.
|
|
34360
|
-
"fingerprint": "
|
|
34414
|
+
"version": "0.34.22",
|
|
34415
|
+
"fingerprint": "x/1mXr1IMBj652BwWBgcQq7pcqSSdgbMCIndy9wg0Ds="
|
|
34361
34416
|
}
|
package/API.md
CHANGED
|
@@ -284,6 +284,7 @@ Name|Description
|
|
|
284
284
|
[IDockerComposeVolumeConfig](#projen-idockercomposevolumeconfig)|Storage for volume configuration.
|
|
285
285
|
[IResolvable](#projen-iresolvable)|*No description*
|
|
286
286
|
[IResolver](#projen-iresolver)|API for resolving tokens when synthesizing file content.
|
|
287
|
+
[github.IJobProvider](#projen-github-ijobprovider)|*No description*
|
|
287
288
|
[python.IPackageProvider](#projen-python-ipackageprovider)|*No description*
|
|
288
289
|
[python.IPythonDeps](#projen-python-ipythondeps)|*No description*
|
|
289
290
|
[python.IPythonEnv](#projen-python-ipythonenv)|*No description*
|
|
@@ -5834,6 +5835,22 @@ addJobs(jobs: Map<string, Job>): void
|
|
|
5834
5835
|
|
|
5835
5836
|
|
|
5836
5837
|
|
|
5838
|
+
#### addJobsLater(provider)🔹 <a id="projen-github-githubworkflow-addjobslater"></a>
|
|
5839
|
+
|
|
5840
|
+
Add jobs from a dynamic source.
|
|
5841
|
+
|
|
5842
|
+
Useful if a component creates jobs that
|
|
5843
|
+
may not be all available until project synthesis time.
|
|
5844
|
+
|
|
5845
|
+
```ts
|
|
5846
|
+
addJobsLater(provider: IJobProvider): void
|
|
5847
|
+
```
|
|
5848
|
+
|
|
5849
|
+
* **provider** (<code>[github.IJobProvider](#projen-github-ijobprovider)</code>) Source of jobs.
|
|
5850
|
+
|
|
5851
|
+
|
|
5852
|
+
|
|
5853
|
+
|
|
5837
5854
|
#### on(events)🔹 <a id="projen-github-githubworkflow-on"></a>
|
|
5838
5855
|
|
|
5839
5856
|
Add events to triggers the workflow.
|
|
@@ -7211,6 +7228,7 @@ Implements GitHub jobs for publishing modules to package managers.
|
|
|
7211
7228
|
|
|
7212
7229
|
Under the hood, it uses https://github.com/aws/jsii-release
|
|
7213
7230
|
|
|
7231
|
+
__Implements__: [github.IJobProvider](#projen-github-ijobprovider)
|
|
7214
7232
|
__Submodule__: release
|
|
7215
7233
|
|
|
7216
7234
|
__Extends__: [Component](#projen-component)
|
|
@@ -7371,12 +7389,12 @@ publishToPyPi(options?: PyPiPublishOptions): void
|
|
|
7371
7389
|
|
|
7372
7390
|
|
|
7373
7391
|
|
|
7374
|
-
####
|
|
7392
|
+
#### renderJobs()🔹 <a id="projen-release-publisher-renderjobs"></a>
|
|
7375
7393
|
|
|
7376
7394
|
Renders a set of workflow jobs for all the publishers.
|
|
7377
7395
|
|
|
7378
7396
|
```ts
|
|
7379
|
-
|
|
7397
|
+
renderJobs(): Map<string, Job>
|
|
7380
7398
|
```
|
|
7381
7399
|
|
|
7382
7400
|
|
|
@@ -7476,18 +7494,6 @@ addJobs(jobs: Map<string, Job>): void
|
|
|
7476
7494
|
|
|
7477
7495
|
|
|
7478
7496
|
|
|
7479
|
-
#### preSynthesize()🔹 <a id="projen-release-release-presynthesize"></a>
|
|
7480
|
-
|
|
7481
|
-
Called before synthesis.
|
|
7482
|
-
|
|
7483
|
-
```ts
|
|
7484
|
-
preSynthesize(): void
|
|
7485
|
-
```
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
7497
|
|
|
7492
7498
|
|
|
7493
7499
|
## class ReleaseTrigger 🔹 <a id="projen-release-releasetrigger"></a>
|
|
@@ -11993,6 +11999,28 @@ Name | Type | Description
|
|
|
11993
11999
|
|
|
11994
12000
|
|
|
11995
12001
|
|
|
12002
|
+
## interface IJobProvider 🔹 <a id="projen-github-ijobprovider"></a>
|
|
12003
|
+
|
|
12004
|
+
__Implemented by__: [release.Publisher](#projen-release-publisher)
|
|
12005
|
+
|
|
12006
|
+
|
|
12007
|
+
### Methods
|
|
12008
|
+
|
|
12009
|
+
|
|
12010
|
+
#### renderJobs()🔹 <a id="projen-github-ijobprovider-renderjobs"></a>
|
|
12011
|
+
|
|
12012
|
+
Generates a collection of named GitHub workflow jobs.
|
|
12013
|
+
|
|
12014
|
+
```ts
|
|
12015
|
+
renderJobs(): Map<string, Job>
|
|
12016
|
+
```
|
|
12017
|
+
|
|
12018
|
+
|
|
12019
|
+
__Returns__:
|
|
12020
|
+
* <code>Map<string, [github.workflows.Job](#projen-github-workflows-job)></code>
|
|
12021
|
+
|
|
12022
|
+
|
|
12023
|
+
|
|
11996
12024
|
## struct MergifyConditionalOperator 🔹 <a id="projen-github-mergifyconditionaloperator"></a>
|
|
11997
12025
|
|
|
11998
12026
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# AWS CDK Applications
|
|
2
|
+
|
|
3
|
+
Project types: `awscdk-app-java`, `awscdk-app-ts`.
|
|
4
|
+
|
|
5
|
+
## Deployment (NOT IMPLEMENTED YET)
|
|
6
|
+
|
|
7
|
+
CDK application projects produce complete cloud applications. When a commit is
|
|
8
|
+
merged into the default branch, the app is rolled out by the release workflow to
|
|
9
|
+
AWS environments.
|
|
10
|
+
|
|
11
|
+
## Dev Stage (NOT IMPLEMENTED YET)
|
|
12
|
+
|
|
13
|
+
Every app includes an instance of the application stage which can be deployed to
|
|
14
|
+
a development AWS account. This allows each developer to use their AWS account
|
|
15
|
+
as part of their development environment.
|
package/docs/awscdk-construct.md
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
# AWS CDK Construct Library
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
AWS CDK library projects produce artifacts with reusable constructs which can be
|
|
4
|
+
consumed by other AWS CDK libraries or apps. Library artifacts are published to
|
|
5
|
+
private or public package managers under a semantic version.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
By default, for every commit to the default branch, a new version is released
|
|
8
|
+
(trunk-based development). This includes the following steps:
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
1. Compile, lint and test the code.
|
|
11
|
+
1. Use [JSII](https://github.com/aws/jsii) to produce library artifacts for all
|
|
12
|
+
target languages.
|
|
13
|
+
1. Determine the next minor/patch version based on [conventional
|
|
14
|
+
commits](https://www.conventionalcommits.org). Major versions must be
|
|
15
|
+
explicitly bumped to protect consumers against breaking changes.
|
|
16
|
+
1. A changelog entry is generated based on commit history.
|
|
17
|
+
1. Packages are published to all target package managers.
|
|
10
18
|
|
|
11
|
-
|
|
12
|
-
* [Standard Node Module Fields](#standard-node-module-fields)
|
|
13
|
-
* [Dependencies](#dependencies)
|
|
14
|
-
* [jsii Publishing](#jsii-publishing)
|
|
15
|
-
* [Workflows](#workflows)
|
|
16
|
-
* [Scripts](#scripts)
|
|
17
|
-
* [Construct Catalog](#construct-catalog)
|
|
18
|
-
* [API Documentation](#api-documentation)
|
|
19
|
-
* [Project structure](#project-structure)
|
|
20
|
-
* [Migrating existing projects](#migrating-existing-projects)
|
|
21
|
-
* [Feedback](#feedback)
|
|
22
|
-
|
|
23
|
-
# Getting Started
|
|
19
|
+
## Getting Started
|
|
24
20
|
|
|
25
21
|
Start like all projen projects:
|
|
26
22
|
|
|
@@ -46,7 +42,7 @@ keywords: ['cloudwatch', 'monitoring']
|
|
|
46
42
|
```
|
|
47
43
|
|
|
48
44
|
All are pretty standard setup and nothing CDK-specific at this point. The `keywords` automatically gets 'cdk' so you don't
|
|
49
|
-
need to specify it.
|
|
45
|
+
need to specify it.
|
|
50
46
|
|
|
51
47
|
## Dependencies
|
|
52
48
|
|
|
@@ -60,11 +56,11 @@ cdkDependencies: ['@aws-cdk/aws-ec2'],
|
|
|
60
56
|
cdkTestDependencies: ['@aws-cdk/assert'],
|
|
61
57
|
```
|
|
62
58
|
|
|
63
|
-
`cdkDependencies` will add both dependencies and peerDependencies to your package.json file with a caret semver
|
|
64
|
-
requirement (e.g. `^1.67.0`). CDK dependencies must be both direct and peer dependencies,
|
|
65
|
-
see [this issue](https://github.com/aws/aws-cdk/issues/5064). You can set `cdkVersionPinning` to `true` to use a fixed
|
|
66
|
-
version, but this means that any consumer of your library will have to use this exact CDK version.
|
|
67
|
-
Likewise, `cdkTestDependencies` will add dependencies to the `devDependencies`.
|
|
59
|
+
`cdkDependencies` will add both dependencies and peerDependencies to your package.json file with a caret semver
|
|
60
|
+
requirement (e.g. `^1.67.0`). CDK dependencies must be both direct and peer dependencies,
|
|
61
|
+
see [this issue](https://github.com/aws/aws-cdk/issues/5064). You can set `cdkVersionPinning` to `true` to use a fixed
|
|
62
|
+
version, but this means that any consumer of your library will have to use this exact CDK version.
|
|
63
|
+
Likewise, `cdkTestDependencies` will add dependencies to the `devDependencies`.
|
|
68
64
|
|
|
69
65
|
Additionally, you can add CDK dependencies using the methods:
|
|
70
66
|
|
|
@@ -77,9 +73,9 @@ project.addCdkTestDependencies('aws-cdk/something-else');
|
|
|
77
73
|
|
|
78
74
|
### Depending on other modules
|
|
79
75
|
|
|
80
|
-
If your library consumes other jsii modules, you should declare them thorugh the `deps` or `peerDeps` options. `deps` should be used if
|
|
81
|
-
types from the consumed module is _not_ part of the public API of the library (the module is used as an implementation detail),
|
|
82
|
-
while `peerDeps` _must_ be used if types from the consumed module are exported as part of your library's API. You can read more
|
|
76
|
+
If your library consumes other jsii modules, you should declare them thorugh the `deps` or `peerDeps` options. `deps` should be used if
|
|
77
|
+
types from the consumed module is _not_ part of the public API of the library (the module is used as an implementation detail),
|
|
78
|
+
while `peerDeps` _must_ be used if types from the consumed module are exported as part of your library's API. You can read more
|
|
83
79
|
[here](https://github.com/aws/jsii/blob/master/docs/configuration.md#dependency-considerations).
|
|
84
80
|
|
|
85
81
|
```ts
|
|
@@ -88,10 +84,10 @@ deps: [ 'cdk-time-bomb' ]
|
|
|
88
84
|
|
|
89
85
|
A [dependabot](https://dependabot.com/) file will be added unless `dependabot` is set to 'false'.
|
|
90
86
|
|
|
91
|
-
##
|
|
87
|
+
## Publishing
|
|
92
88
|
|
|
93
|
-
As this is a [jsii project](./jsii.md), it will cross-compile to other languages. You can set up
|
|
94
|
-
any number of jsii target languages.
|
|
89
|
+
As this is a [jsii project](./jsii.md), it will cross-compile to other languages. You can set up
|
|
90
|
+
any number of jsii target languages.
|
|
95
91
|
|
|
96
92
|
```typescript
|
|
97
93
|
dotnet: {
|
|
@@ -122,19 +118,19 @@ For help in getting these secrets for your project, read the [jsii-release](http
|
|
|
122
118
|
|
|
123
119
|
If you don't want to publish a particular package, do not include the `dotnet`, `java`, or `python` field.
|
|
124
120
|
|
|
125
|
-
|
|
121
|
+
## Workflows
|
|
126
122
|
|
|
127
123
|
Two workflows will be created as Github Actions:
|
|
128
124
|
|
|
129
125
|
* The Build workflow - controlled by the `buildWorkflow` field. On a 'pull_request' or 'workflow_dispatch' the library
|
|
130
126
|
will be built and checked for anti-tamper (ensure no manual changes to generated files).
|
|
131
127
|
* The Release workflow - controlled by the `releaseWorkflow` field. On a push to `main` (overridden at
|
|
132
|
-
`props.defaultReleaseBranch`) the library is built, anti-tampered, version bumped with a commit, pushed back to git,
|
|
128
|
+
`props.defaultReleaseBranch`) the library is built, anti-tampered, version bumped with a commit, pushed back to git,
|
|
133
129
|
and then published to the configured artifact repositories (e.g. npm, pypi).
|
|
134
130
|
|
|
135
|
-
|
|
131
|
+
## Tasks
|
|
136
132
|
|
|
137
|
-
There are a number of package scripts that are created for you. Any of them can be overwritten using the `addScript*`
|
|
133
|
+
There are a number of package scripts that are created for you. Any of them can be overwritten using the `addScript*`
|
|
138
134
|
methods.
|
|
139
135
|
|
|
140
136
|
script|description
|
|
@@ -157,38 +153,24 @@ docgen|generate documentation
|
|
|
157
153
|
|
|
158
154
|
As you develop your library you'll likely be using the `test:watch` command the most.
|
|
159
155
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Finally, a field for setting up publishing to the [construct catalog](https://awscdk.io):
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
catalog: {
|
|
166
|
-
announce: true,
|
|
167
|
-
twitter: '@yourhandle'
|
|
168
|
-
}
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
These values are optional but allow the construct catalog's Twitter account to mention your handle on the tweet. Setting `announce`
|
|
172
|
-
to 'false' will stop all tweets about the library. However, the library will still be indexed.
|
|
173
|
-
|
|
174
|
-
# API Documentation
|
|
156
|
+
## API Documentation
|
|
175
157
|
|
|
176
158
|
Docs will be generated from [Typescript comments](https://typedoc.org/guides/doccomments/) and saved in the `API.md` file.
|
|
177
|
-
Please review this file regularly and document your constructs liberally.
|
|
159
|
+
Please review this file regularly and document your constructs liberally.
|
|
178
160
|
|
|
179
|
-
|
|
161
|
+
## Project structure
|
|
180
162
|
|
|
181
163
|
```
|
|
182
164
|
.
|
|
183
|
-
|--lib/ (
|
|
165
|
+
|--lib/ (build output)
|
|
184
166
|
|--src/
|
|
185
167
|
|--main.ts
|
|
186
168
|
|--test/
|
|
187
169
|
|--main.test.ts
|
|
188
170
|
```
|
|
189
171
|
|
|
190
|
-
Source .ts files should reside in the `src` directory. Constructs should be exported from the main.ts file.
|
|
191
|
-
Compiled files will be put in the `lib` directory. Tests are in the `test` directory. If you need additional
|
|
172
|
+
Source .ts files should reside in the `src` directory. Constructs should be exported from the main.ts file.
|
|
173
|
+
Compiled files will be put in the `lib` directory. Tests are in the `test` directory. If you need additional
|
|
192
174
|
resources that are packaged with your library, add those to a `resources` directory that is besides the `src` directory
|
|
193
175
|
and modify your references accordingly:
|
|
194
176
|
|
|
@@ -196,24 +178,18 @@ and modify your references accordingly:
|
|
|
196
178
|
const thing = require('../resources/some-resource.json')
|
|
197
179
|
```
|
|
198
180
|
|
|
199
|
-
|
|
181
|
+
## Migrating existing projects
|
|
200
182
|
|
|
201
183
|
Your existing CDK constructs likely have a different file structure than what this projen project expects. Projen projects
|
|
202
184
|
are highly opinionated. There are a few expectations of this project you should modify your existing library to conform to:
|
|
203
185
|
|
|
204
|
-
* All .ts files are expected to be in the `src/` directory. Existing constructs should all be moved there. However,
|
|
186
|
+
* All .ts files are expected to be in the `src/` directory. Existing constructs should all be moved there. However,
|
|
205
187
|
you can override this directory by setting `srcdir`.
|
|
206
188
|
* Compiled .js and .d.ts files will go into the `lib/` directory. This directory will be removed and rebuilt each build.
|
|
207
189
|
Do not store source .ts files in your `lib/` or 'libdir'.
|
|
208
|
-
* The entrypoint file for all constructs should be `src/main.ts`. If your existing library is not in the main.ts file,
|
|
190
|
+
* The entrypoint file for all constructs should be `src/main.ts`. If your existing library is not in the main.ts file,
|
|
209
191
|
you can add the following to export it:
|
|
210
192
|
|
|
211
193
|
```typescript
|
|
212
194
|
export * from './our-s3-bucket'
|
|
213
195
|
```
|
|
214
|
-
|
|
215
|
-
# Feedback
|
|
216
|
-
|
|
217
|
-
If you find there is anything we missed, please submit Issues or (better yet) Pull Requests on Github.
|
|
218
|
-
|
|
219
|
-
|