projen 0.76.5 → 0.76.7

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.
Files changed (165) hide show
  1. package/.jsii +46 -46
  2. package/README.md +38 -33
  3. package/lib/awscdk/auto-discover.js +5 -5
  4. package/lib/awscdk/awscdk-app-java.js +1 -1
  5. package/lib/awscdk/awscdk-app-py.js +1 -1
  6. package/lib/awscdk/awscdk-app-ts.js +1 -1
  7. package/lib/awscdk/awscdk-construct.js +2 -2
  8. package/lib/awscdk/awscdk-deps-java.js +1 -1
  9. package/lib/awscdk/awscdk-deps-js.js +1 -1
  10. package/lib/awscdk/awscdk-deps-py.js +1 -1
  11. package/lib/awscdk/awscdk-deps.js +1 -1
  12. package/lib/awscdk/cdk-config.js +1 -1
  13. package/lib/awscdk/cdk-tasks.js +1 -1
  14. package/lib/awscdk/integration-test.js +1 -1
  15. package/lib/awscdk/lambda-extension.js +1 -1
  16. package/lib/awscdk/lambda-function.js +2 -2
  17. package/lib/build/build-workflow.js +1 -1
  18. package/lib/cdk/auto-discover-base.js +2 -2
  19. package/lib/cdk/construct-lib.js +1 -1
  20. package/lib/cdk/integration-test-base.js +1 -1
  21. package/lib/cdk/jsii-docgen.js +1 -1
  22. package/lib/cdk/jsii-project.js +1 -1
  23. package/lib/cdk8s/auto-discover.js +2 -2
  24. package/lib/cdk8s/cdk8s-app-py.js +1 -1
  25. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  26. package/lib/cdk8s/cdk8s-construct.js +1 -1
  27. package/lib/cdk8s/cdk8s-deps-py.js +1 -1
  28. package/lib/cdk8s/cdk8s-deps.js +1 -1
  29. package/lib/cdk8s/integration-test.js +1 -1
  30. package/lib/cdktf/cdktf-construct.js +1 -1
  31. package/lib/circleci/circleci.js +1 -1
  32. package/lib/component.js +1 -1
  33. package/lib/dependencies.js +1 -1
  34. package/lib/dev-env.js +1 -1
  35. package/lib/docker-compose/docker-compose-service.js +1 -1
  36. package/lib/docker-compose/docker-compose.js +1 -1
  37. package/lib/file.js +3 -3
  38. package/lib/gitattributes.js +1 -1
  39. package/lib/github/actions-provider.js +1 -1
  40. package/lib/github/auto-approve.js +1 -1
  41. package/lib/github/auto-merge.js +1 -1
  42. package/lib/github/dependabot.js +1 -1
  43. package/lib/github/github-credentials.js +1 -1
  44. package/lib/github/github-project.js +1 -1
  45. package/lib/github/github.js +1 -1
  46. package/lib/github/mergify.js +1 -1
  47. package/lib/github/pr-template.js +1 -1
  48. package/lib/github/pull-request-lint.js +1 -1
  49. package/lib/github/stale.js +1 -1
  50. package/lib/github/task-workflow.js +1 -1
  51. package/lib/github/workflow-actions.js +1 -1
  52. package/lib/github/workflow-jobs.js +1 -1
  53. package/lib/github/workflows.js +1 -1
  54. package/lib/gitlab/configuration.js +1 -1
  55. package/lib/gitlab/gitlab-configuration.js +1 -1
  56. package/lib/gitlab/nested-configuration.js +1 -1
  57. package/lib/gitpod.js +1 -1
  58. package/lib/ignore-file.js +1 -1
  59. package/lib/ini.js +1 -1
  60. package/lib/java/java-project.js +1 -1
  61. package/lib/java/junit.js +1 -1
  62. package/lib/java/maven-compile.js +1 -1
  63. package/lib/java/maven-packaging.js +1 -1
  64. package/lib/java/maven-sample.js +1 -1
  65. package/lib/java/pom.js +1 -1
  66. package/lib/java/projenrc.js +1 -1
  67. package/lib/javascript/bundler.js +1 -1
  68. package/lib/javascript/eslint.js +1 -1
  69. package/lib/javascript/jest.js +4 -4
  70. package/lib/javascript/node-package.js +1 -1
  71. package/lib/javascript/node-project.d.ts +2 -1
  72. package/lib/javascript/node-project.js +11 -6
  73. package/lib/javascript/npm-config.js +1 -1
  74. package/lib/javascript/prettier.js +1 -1
  75. package/lib/javascript/projenrc.js +1 -1
  76. package/lib/javascript/typescript-config.js +2 -2
  77. package/lib/javascript/upgrade-dependencies.d.ts +1 -1
  78. package/lib/javascript/upgrade-dependencies.js +3 -3
  79. package/lib/json-patch.js +1 -1
  80. package/lib/json.js +1 -1
  81. package/lib/license.js +1 -1
  82. package/lib/logger.js +1 -1
  83. package/lib/makefile.js +1 -1
  84. package/lib/object-file.js +1 -1
  85. package/lib/project-build.js +1 -1
  86. package/lib/project.d.ts +4 -4
  87. package/lib/project.js +6 -6
  88. package/lib/projects.js +1 -1
  89. package/lib/projenrc-json.js +2 -2
  90. package/lib/projenrc.js +1 -1
  91. package/lib/python/pip.js +1 -1
  92. package/lib/python/poetry.js +2 -2
  93. package/lib/python/projenrc.js +1 -1
  94. package/lib/python/pytest-sample.js +1 -1
  95. package/lib/python/pytest.js +1 -1
  96. package/lib/python/python-project.js +1 -1
  97. package/lib/python/python-sample.js +1 -1
  98. package/lib/python/requirements-file.js +1 -1
  99. package/lib/python/setuppy.js +1 -1
  100. package/lib/python/setuptools.js +1 -1
  101. package/lib/python/venv.js +1 -1
  102. package/lib/readme.js +1 -1
  103. package/lib/release/publisher.js +1 -1
  104. package/lib/release/release-trigger.js +1 -1
  105. package/lib/release/release.js +1 -1
  106. package/lib/renovatebot.js +1 -1
  107. package/lib/sample-file.js +2 -2
  108. package/lib/semver.js +1 -1
  109. package/lib/source-code.js +1 -1
  110. package/lib/task-runtime.js +1 -1
  111. package/lib/task.js +1 -1
  112. package/lib/tasks.js +1 -1
  113. package/lib/testing.js +1 -1
  114. package/lib/textfile.js +1 -1
  115. package/lib/toml.js +1 -1
  116. package/lib/typescript/projenrc-ts.js +1 -1
  117. package/lib/typescript/projenrc.js +1 -1
  118. package/lib/typescript/typescript-typedoc.js +1 -1
  119. package/lib/typescript/typescript.js +3 -3
  120. package/lib/util.d.ts +1 -0
  121. package/lib/util.js +2 -1
  122. package/lib/version.js +2 -2
  123. package/lib/vscode/devcontainer.js +1 -1
  124. package/lib/vscode/extensions.js +1 -1
  125. package/lib/vscode/launch-config.js +1 -1
  126. package/lib/vscode/settings.js +1 -1
  127. package/lib/vscode/vscode.js +1 -1
  128. package/lib/web/next.js +3 -3
  129. package/lib/web/postcss.js +1 -1
  130. package/lib/web/react.js +4 -4
  131. package/lib/web/tailwind.js +1 -1
  132. package/lib/xmlfile.js +1 -1
  133. package/lib/yaml.js +1 -1
  134. package/package.json +1 -1
  135. package/.prettierignore +0 -1
  136. package/.prettierrc.json +0 -3
  137. package/docs/CNAME +0 -1
  138. package/docs/README.md +0 -28
  139. package/docs/api/API.md +0 -21296
  140. package/docs/awscdk-apps.md +0 -18
  141. package/docs/awscdk-construct.md +0 -195
  142. package/docs/awscdk.md +0 -377
  143. package/docs/build.md +0 -55
  144. package/docs/bundling.md +0 -30
  145. package/docs/cdk8s.md +0 -39
  146. package/docs/circleci.md +0 -87
  147. package/docs/components.md +0 -21
  148. package/docs/deps.md +0 -62
  149. package/docs/eject.md +0 -30
  150. package/docs/escape-hatches.md +0 -113
  151. package/docs/github.md +0 -155
  152. package/docs/gitlab.md +0 -67
  153. package/docs/java.md +0 -213
  154. package/docs/node.md +0 -150
  155. package/docs/programmatic-api.md +0 -56
  156. package/docs/publisher.md +0 -148
  157. package/docs/python.md +0 -169
  158. package/docs/releases.md +0 -191
  159. package/docs/subproject.md +0 -37
  160. package/docs/tasks.md +0 -211
  161. package/docs/typescript.md +0 -119
  162. package/logo/projen.svg +0 -211
  163. package/rfcs/github-project-settings.md +0 -95
  164. package/rfcs/project-creation-prompt.md +0 -95
  165. package/version.json +0 -3
@@ -1,119 +0,0 @@
1
- # TypeScript Projects
2
-
3
- To create a new TypeScript project, use `projen new typescript`:
4
-
5
- ```shell
6
- npx projen new typescript
7
- ```
8
-
9
- This will create a `.projenrc.js` file which defines your project. If you
10
- instead would like to define your project in TypeScript, use the
11
- `--projenrc-ts` flag to create a `.projenrc.ts` file:
12
-
13
- ```shell
14
- npx projen new typescript --projenrc-ts
15
- ```
16
-
17
- `projen new` will synthesize a standard project directory structure with some sample
18
- code.
19
-
20
- ```shell
21
- ├── src
22
- │   ├── index.ts
23
- ├── test
24
- │ ├── hello.test.ts
25
- ├── node_modules
26
- ├── package.json
27
- └── tsconfig.json
28
- ```
29
-
30
- The default options will set up your `tsconfig` root directory as `src` and your
31
- out directory as `lib`. By default the `test` directory is not compiled to
32
- JavaScript and instead compiled when `npx projen test` is executed.
33
-
34
- The `projen new` command will also generate a `.projenrc.js` file which includes
35
- the definition of your project with any options you specified in the command
36
- line:
37
-
38
- ```js
39
- const { typescript } = require('projen');
40
- const project = new typescript.TypeScriptProject({
41
- defaultReleaseBranch: 'main',
42
- name: 'my-project',
43
- });
44
- project.synth();
45
- ```
46
-
47
- To modify your project definitions, edit `.projenrc.js` and run `projen` again
48
- to re-synthesize your project. The following sections describe the various
49
- features of your TypeScript project.
50
-
51
- ## Dependencies
52
-
53
- You can specify dependencies in your project via the `deps`, `devDeps`, and
54
- `peerDeps` options similar to what you might expect in a `package.json` file.
55
-
56
- The recommendation is to only specify the module name here (e.g. `express`).
57
- This will behave similar to yarn add or npm install in the sense that it will
58
- add the module as a dependency to your package.json file with the latest version
59
- (`^`). You can specify semver requirements in the same syntax passed to npm i or
60
- yarn add (e.g. `express@^2`) and this will be what your `package.json` will
61
- eventually include.
62
-
63
- ## Migrating your TypeScript Project to Projen
64
-
65
- Projen provides some opinionated defaults that may be different than the defaults
66
- you rely on in your existing TypeScript Project. This section attempts to document
67
- some of the common themes to look out for when migrating an existing TypeScript
68
- project to Projen.
69
-
70
- ## Migrating .projenrc.js to .projenrc.ts
71
-
72
- If you'd like to upgrade an existing project that was creating using a JS-based
73
- projen RC file (.projenrc.js) to a TS-based projen RC file (.projenrc.ts):
74
-
75
- 1. Add `projenrcTs: true` to your project.
76
- 2. Run `npx projen`.
77
- 3. Rename `.projenrc.js` to `.projenrc.ts`.
78
- 4. Update `require`s to `import`s.
79
- 5. Run `npx projen`.
80
-
81
- ### Default Directory Structure
82
-
83
- The most important is the default project structure. Projen expects all source code
84
- to be in the `src` directory and will write compiled `.js` and `.d.ts` files to the
85
- `lib` directory. Test files are expected in the `test` directory and not compiled
86
- to javascript. Instead, Projen configures `Jest` to compile `.ts` files when testing.
87
-
88
- As this is only one of many structures for valid TypeScript projects, your migrated
89
- project may not work out-of-the-box with Projen. We recommend that you take the
90
- time to fully migrate to the expected project structure so that you can take full
91
- advantage of Projen management on your repository.
92
-
93
- However, you can also configure your `.projenrc.js` file to reflect your current
94
- project structure. A `TypeScriptProject` exposes all options in a `tsConfig` file
95
- so you can manually set the structure you want. Here is an example for specifying a
96
- structure where the TypeScript compiler finds all TypeScript files recursively in your
97
- repository:
98
-
99
- ```js
100
- const { typescript } = require('projen');
101
- const project = new typescript.TypeScriptProject({
102
- ...
103
- tsConfig: {
104
- compilerOptions: {
105
- rootDir: '.',
106
- outDir: '.',
107
- },
108
- include: ['**/*.ts'], // all typescript files recursively
109
- },
110
- });
111
- ```
112
-
113
- ### Dependency Versions
114
-
115
- As described in the section above, Projen recommends that you list your dependencies
116
- only by module name and have Projen install the latest version of the package. A
117
- consequence of this recommendation is that when migrating, you may unknowingly update
118
- your dependencies to incompatible versions. You can always specify specific semvar
119
- requirements (e.g. `express@^2`) if necessary.
package/logo/projen.svg DELETED
@@ -1,211 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg
3
- xmlns:dc="http://purl.org/dc/elements/1.1/"
4
- xmlns:cc="http://creativecommons.org/ns#"
5
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6
- xmlns:svg="http://www.w3.org/2000/svg"
7
- xmlns="http://www.w3.org/2000/svg"
8
- id="svg8"
9
- version="1.1"
10
- viewBox="0 0 57.296654 52.39449"
11
- height="52.394489mm"
12
- width="57.296654mm">
13
- <defs
14
- id="defs2" />
15
- <metadata
16
- id="metadata5">
17
- <rdf:RDF>
18
- <cc:Work
19
- rdf:about="">
20
- <dc:format>image/svg+xml</dc:format>
21
- <dc:type
22
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
23
- <dc:title></dc:title>
24
- </cc:Work>
25
- </rdf:RDF>
26
- </metadata>
27
- <g
28
- transform="translate(-75.785746,-87.205383)"
29
- id="layer1">
30
- <a
31
- id="a4574" />
32
- <g
33
- id="g1004">
34
- <g
35
- id="g1323">
36
- <g
37
- id="g1345">
38
- <g
39
- transform="translate(46.26548,27.572157)"
40
- id="g1046-6">
41
- <g
42
- transform="translate(55.907187,-58.285812)"
43
- id="g908-3">
44
- <g
45
- transform="translate(-122.4408,-65.271444)"
46
- id="g4623-0">
47
- <g
48
- id="g902-0"
49
- transform="translate(0.01909553)">
50
- <path
51
- id="path888-7"
52
- d="m 96.48484,212.0709 v 23.06401 h 28.19827 V 212.0709 l -4.16132,-5.39635 -20.40541,0.0343 z"
53
- style="fill:#fa983c;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
54
- </g>
55
- <path
56
- style="fill:#fcc161;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
57
- d="m 97.33592,211.61954 26.43699,0.002 -3.45765,-4.49827 -19.95968,0.0365 z"
58
- id="path906-9" />
59
- <g
60
- id="g928-9"
61
- transform="translate(-0.14519447,-25.082386)">
62
- <path
63
- style="fill:#cbdada;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
64
- d="m 107.25435,237.15231 v 5.6589 l 3.55655,-2.17491 3.43128,2.17491 v -5.6589 l -1.43039,-5.39389 -3.84281,0.0206 z"
65
- id="path930-0" />
66
- </g>
67
- </g>
68
- </g>
69
- <g
70
- id="g1015-6">
71
- <g
72
- id="g1009-3">
73
- <path
74
- style="fill:none;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
75
- d="m 96.48484,212.0709 h 28.19827"
76
- id="path890-7"
77
- transform="translate(-66.514517,-123.55726)" />
78
- <path
79
- id="path4561-7-1"
80
- d="m 53.781647,83.566014 3.45765,4.49827 -2.19301,0.001 -3.27537,-4.49 z"
81
- style="fill:#f9a63c;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
82
- <path
83
- style="fill:#ed862f;fill-opacity:1;stroke:none;stroke-width:0.96445072;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
84
- d="m 55.275299,88.963797 0.04122,22.153023 2.379277,-0.007 0.01451,-22.130415 z"
85
- id="path4565-5-5" />
86
- </g>
87
- </g>
88
- </g>
89
- <g
90
- id="g908-6"
91
- transform="translate(130.37094,-30.713651)">
92
- <g
93
- id="g4623-4"
94
- transform="translate(-122.4408,-65.271444)">
95
- <g
96
- transform="translate(0.01909553)"
97
- id="g902-5">
98
- <path
99
- style="fill:#fa983c;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
100
- d="m 96.48484,212.0709 v 23.06401 h 28.19827 V 212.0709 l -4.16132,-5.39635 -20.40541,0.0343 z"
101
- id="path888-3" />
102
- </g>
103
- <path
104
- id="path906-7"
105
- d="m 97.33592,211.61954 26.43699,0.002 -3.45765,-4.49827 -19.95968,0.0365 z"
106
- style="fill:#fcc161;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
107
- <g
108
- transform="translate(-0.14519447,-25.082386)"
109
- id="g928-1">
110
- <path
111
- id="path930-6"
112
- d="m 107.25435,237.15231 v 5.6589 l 3.55655,-2.17491 3.43128,2.17491 v -5.6589 l -1.43039,-5.39389 -3.84281,0.0206 z"
113
- style="fill:#cbdada;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
114
- </g>
115
- </g>
116
- </g>
117
- </g>
118
- <g
119
- id="g1009-5"
120
- transform="translate(74.46375,27.572161)">
121
- <path
122
- transform="translate(-66.514517,-123.55726)"
123
- id="path890-9"
124
- d="m 96.48484,212.0709 h 28.19827"
125
- style="fill:none;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
126
- <path
127
- style="fill:#f9a63c;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
128
- d="m 53.781647,83.566014 3.45765,4.49827 -2.19301,0.001 -3.27537,-4.49 z"
129
- id="path4561-7-2" />
130
- <path
131
- id="path4565-5-6"
132
- d="m 55.275299,88.963797 0.04122,22.153023 2.379277,-0.007 0.01451,-22.130415 z"
133
- style="fill:#ed862f;fill-opacity:1;stroke:none;stroke-width:0.96445072;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
134
- </g>
135
- <g
136
- id="g1046"
137
- transform="translate(60.364616,4.504308)">
138
- <g
139
- id="g908"
140
- transform="translate(55.907187,-58.285812)">
141
- <g
142
- id="g4623"
143
- transform="translate(-122.4408,-65.271444)">
144
- <g
145
- transform="translate(0.01909553)"
146
- id="g902">
147
- <path
148
- style="fill:#fa983c;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
149
- d="m 96.48484,212.0709 v 23.06401 h 28.19827 V 212.0709 l -4.16132,-5.39635 -20.40541,0.0343 z"
150
- id="path888" />
151
- </g>
152
- <path
153
- id="path906"
154
- d="m 97.33592,211.61954 26.43699,0.002 -3.45765,-4.49827 -19.95968,0.0365 z"
155
- style="fill:#fcc161;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
156
- <g
157
- transform="translate(-0.14519447,-25.082386)"
158
- id="g928">
159
- <path
160
- id="path930"
161
- d="m 107.25435,237.15231 v 5.6589 l 3.55655,-2.17491 3.43128,2.17491 v -5.6589 l -1.43039,-5.39389 -3.84281,0.0206 z"
162
- style="fill:#cbdada;fill-opacity:1;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
163
- </g>
164
- </g>
165
- </g>
166
- <g
167
- id="g1015">
168
- <g
169
- id="g1009">
170
- <path
171
- transform="translate(-66.514517,-123.55726)"
172
- id="path890"
173
- d="m 96.48484,212.0709 h 28.19827"
174
- style="fill:none;stroke:#66200b;stroke-width:0.90011251;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
175
- <path
176
- style="fill:#f9a63c;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
177
- d="m 53.781647,83.566014 3.45765,4.49827 -2.19301,0.001 -3.27537,-4.49 z"
178
- id="path4561-7" />
179
- <path
180
- id="path4565-5"
181
- d="m 55.275299,88.963797 0.04122,22.153023 2.379277,-0.007 0.01451,-22.130415 z"
182
- style="fill:#ed862f;fill-opacity:1;stroke:none;stroke-width:0.96445072;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
183
- </g>
184
- </g>
185
- </g>
186
- <g
187
- transform="translate(125.02229,-75.78176)"
188
- id="g4861">
189
- <g
190
- style="stroke-width:0.90011251;stroke-miterlimit:4;stroke-dasharray:none"
191
- id="g4623-5"
192
- transform="translate(-135.69803,-31.076619)" />
193
- <g
194
- id="g894"
195
- transform="translate(1.458479,-0.00413411)">
196
- <text
197
- id="text4787"
198
- y="209.54585"
199
- x="-14.349669"
200
- style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:2.82222223px;line-height:1.25;font-family:Arial;-inkscape-font-specification:Arial;letter-spacing:0px;word-spacing:0px;fill:#66200b;fill-opacity:1;stroke:none;stroke-width:0.26458332"
201
- xml:space="preserve"><tspan
202
- style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:14.46388912px;font-family:Arial;-inkscape-font-specification:'Arial Bold';fill:#66200b;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-opacity:1"
203
- y="209.54585"
204
- x="-14.349669"
205
- id="tspan4785">pj</tspan></text>
206
- </g>
207
- </g>
208
- </g>
209
- </g>
210
- </g>
211
- </svg>
@@ -1,95 +0,0 @@
1
- # External GitHub Repository Settings (RFC #1014)
2
-
3
- > **Author**: [@eladb](https://github.com/eladb), **Status**: Draft
4
-
5
- Projen is great for managing project-related configuration that is modeled in
6
- files within the git repository. Much of GitHub's configuration (such as issue
7
- templates, workflows, etc) is managed through files under `.github` and to that
8
- extend, projen lends itself well to maintain these files.
9
-
10
- However, there are some GitHub repository settings that are not managed through
11
- files in the repos. These include things like branch protection rules,
12
- auto-merge options, and most noteable are repository secrets. Projen heavily
13
- relies on repository secrets for things like publishing tokens.
14
-
15
- When maintaining many projects, manaing publishing secrets becomes a major
16
- burden. It is also error prone and has potential security implications. Ideally
17
- these secrets should be managed by tooling and not by humans.
18
-
19
- GitHub offers some support for centrally managing secrets but these require
20
- organization-level permissions which are not always available.
21
-
22
- ## README (working backwards)
23
-
24
- Let’s say we have a JSII project. By default, it does not publish to PyPI. Let's
25
- add Python publishing to our project.
26
-
27
- First, we need edit your `projenrc.js` file and add the `publishToPyPi` setting.
28
- Additionally, set the `secrets` option to tell Projen to retrieve secrets from
29
- AWS Secrets Manager (in the future other secret sources will be supported):
30
-
31
- ```js
32
- const projen = require('projen');
33
-
34
- const project = new projen.JsiiProject({
35
- // ...
36
-
37
- secrets: projen.Secrets.fromAwsSecretsManager('arn:aws:secretsmanager:us-east-1:111111111111:secret:projen-publishing-tokens'),
38
- publishToPyPi: {
39
- distName: 'foo-bar',
40
- module: 'foo_bar',
41
- },
42
- });
43
- ```
44
-
45
- > NOTE: not sure I like the union-like API, but we can debate that later.
46
-
47
- Now, as usual, execute `npx projen`.
48
-
49
- Under the hood, projen uses `gh secret list` to check if your repo has the
50
- desired secrets. If not, it will retrieve them from AWS Secrets Manager and
51
- store them in your repository via the GitHub API.
52
-
53
- ```shell
54
- $ npx projen
55
- Synthesizing project...
56
- Storing TWINE_USERNAME from arn:aws:secretsmanager:us-east-1:111111111111:secret:projen-publishing-tokens
57
- Storing TWINE_PASSWORD from arn:aws:secretsmanager:us-east-1:111111111111:secret:projen-publishing-tokens
58
- Done
59
- ```
60
-
61
- _not sure that’s feasible:_ You will also notice that your
62
- `.github/workflows/release.yml` workflow was updated and now includes a check
63
- that verifeis that your repository has the desired secrets. This is sort of an
64
- "anti-tamper check" for external settings. If your repository does not have the
65
- needed secerts, an error will be displayed with instructions on how to store
66
- them.
67
-
68
- A similar approach can be taken to configure other non-source-code repository
69
- settings such as branch protection rules:
70
-
71
- ```js
72
- # this should be the default probably
73
- project.addBranchProtection(project.defaultBranch);
74
- ```
75
-
76
- Similarly, during synth, given the proper credentials, projen can actually setup
77
- the project to align with the definition and a workflow on the default branch
78
- can be used to ensure that the project is compliant.
79
-
80
- **Prerequisites:** For this to work, you'll need your development box to have
81
- GitHub CLI installed and logged in, as well as default AWS credentials with
82
- access to a secret called `projen-publishing-token` secret in `us-east-1` (as
83
- defined by the ARN specified under `secrets`). Projen expects to find a field by
84
- the same name as the secret name (e.g. `TWINE_USERNAME` and `TWINE_PASSWORD`)
85
- stored in JSON format in the secret. Secrets can be stored using the AWS CLI or
86
- via the AWS Console.
87
-
88
- In the future we can offer a CLI command to store secrets:
89
-
90
- ```shell
91
- $ projen secrets store TWINE_USERNAME "Boom"
92
- $ projen secrets store TWINE_PASSWORD "Bam"
93
- ```
94
-
95
- Something like that.
@@ -1,95 +0,0 @@
1
- # Project Creation Prompts (RFC #1365)
2
-
3
- > **Author**: [@MarkMcCulloh](https://github.com/MarkMcCulloh), **Status**: Draft
4
-
5
- When hearing about projen for the first time, the typical comparisons one may think of are tools such as `yeoman` or the various projects making use of `npm init`.
6
- Obviously the underlying methodology of projen is quite different, but there is a great UX feature these other tools typically employ that projen can make use of: Guided prompts. This allows users to create a project from an opinionated set of options with friendly guidance. This is especially useful in scenarios where the project requires a value that has no reasonable default (and thus could not be created with projen as it is now without it being provided as a CLI arg).
7
-
8
- ## Example user flows
9
-
10
- Note: All prompts are assuming to be run from a TTY. We should check if in a TTY before a prompt is presented and error otherwise.
11
-
12
- `$ npx projen new`
13
- 1. User is shown a list of base projen project types
14
- 1. User selects the `typescript` project
15
- 1. Project is synthesized
16
-
17
- `$ npx projen new typescript`
18
- 1. No prompts are shown because a project is selected and the `typescript` project type has no `@featured` required options that do not also have a default
19
- 1. Project is synthesized
20
-
21
- `$ npx projen new typescript --prompt`
22
- 1. Prompts are shown for (currently) `packageName` and `description`, as those options are `@featured` and have no default value
23
- 1. Project is synthesized
24
-
25
- `$ npx projen new typescript --prompt --package-name cool-name --description 'Terse but useful'`
26
- 1. No prompts are shown because all `@featured` options have been given supplied values already
27
- 1. Project is synthesized
28
-
29
- ## Details
30
-
31
- ### Prompt library to use
32
-
33
- [Prompts](https://github.com/terkelg/prompts) is an extremely common library for CLI-based prompts. It's relatively small and has very few dependencies.
34
-
35
- ### Project type prompt
36
-
37
- A user should be prompted to select a project type to create. This should be prompted during `projen new` when:
38
-
39
- - A project id has not been specified
40
- - There is more than one project type available
41
-
42
- Currently projen will exit and show the user the help menu. Instead, it should show the user a list of available projects to choose from in the current context. After choosing a project, projen can continue is it normally would have if the user has provided it during the original invocation.
43
-
44
- [autocomplete](https://github.com/terkelg/prompts#autocompletemessage-choices-initial-suggest-limit-style) would be a good input type for this as it has a filtering feature.
45
-
46
- ### Project option prompts
47
-
48
- After a project type has been selected, the user can be shown a list of featured options to set interactively. For a project option to be available as a prompt during `projen new`:
49
-
50
- - `@featured` tag in property docstring
51
- - Must be able to be set via CLI arg (is a primitive or enum)
52
- - Must not have already been provided as a CLI arg
53
-
54
- By default, `projen new <project>` will not show prompts unless the `--prompt` flag is provided.
55
- There is one exception: If a project option meets the above criteria but is also:
56
-
57
- - Non-nullable
58
- - Not already provided as a CLI arg
59
-
60
- ### Prompt format
61
-
62
- By default, values sent to the `prompts` library will be derived by the information in the JSII. For example, enums should have their choices populated automatically.
63
-
64
- In case the default logic is insufficient, `@prompt...` doc tags can be added to override the default. See below for reference.
65
-
66
- #### Docstring tag reference
67
-
68
- <https://github.com/terkelg/prompts#multiselectmessage-choices-initial-max-hint-warn>
69
-
70
- - `@featured` - Functions as it did before, but now also signifies that this option is prompt-able
71
- - `@promptType` - The type of prompt (text, toggle, etc.). See <https://github.com/terkelg/prompts#-types>.
72
- - **Example:** An array type would have a default prompt type of [list](https://github.com/terkelg/prompts#listmessage-initial).
73
- `@promptType multiselect` would allow you to provide a set of distinct options instead.
74
- - `@promptMessage` - The actual prompt, derived from the docstring summary. See <https://github.com/terkelg/prompts#message>.
75
- - Can be used when the type documentation insufficient for use as a prompt.
76
- - `@promptChoices` - Comma-separated list of choices for this prompt.
77
- - Important for types that can't have their available choices automatically derived.
78
- - **Example:** `@promptChoices choice1,choice2` would limit a plain text field into only have those two choices.
79
-
80
- ## Testing
81
-
82
- `prompts` [provides a utility](https://github.com/terkelg/prompts#injectvalues) for injecting responses to prompts. This can be used for testing this functionality without any interaction.
83
-
84
- ## Documentation
85
-
86
- Usage of `--prompt` should be mentioned in the README. Documentation on specifics of this feature should be added into `/docs`.
87
-
88
- ## Proposed implementation phases
89
-
90
- To keep the implementation PRs small-ish:
91
-
92
- 1. Add `--prompt` flag to `projen new` that shows basic `text` prompts for `@featured` options
93
- 1. Show certain option prompts even when `--prompt` is not supplied (see above)
94
- 1. Add project type prompts
95
- 1. Derive specific option prompts (text, number, select, etc.) from JSII type info and `@prompt...` overrides
package/version.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "version": "0.17.52"
3
- }