projen 0.34.12 → 0.34.16
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 +4 -4
- 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 +3 -2
- 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.js +1 -1
- 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.js +1 -1
- 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.js +1 -1
- package/lib/release/release-trigger.js +1 -1
- package/lib/release/release.js +1 -1
- 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 +2 -2
- 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 +5 -5
- package/rfcs/github-project-settings.md +95 -0
package/package.json
CHANGED
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"eslint-plugin-import": "^2.25.3",
|
|
60
60
|
"jest": "^27.3.1",
|
|
61
61
|
"jest-junit": "^12",
|
|
62
|
-
"jsii": "^1.
|
|
63
|
-
"jsii-diff": "^1.
|
|
62
|
+
"jsii": "^1.46.0",
|
|
63
|
+
"jsii-diff": "^1.46.0",
|
|
64
64
|
"jsii-docgen": "^1.8.110",
|
|
65
|
-
"jsii-pacmak": "^1.
|
|
65
|
+
"jsii-pacmak": "^1.46.0",
|
|
66
66
|
"json-schema": "^0.4.0",
|
|
67
|
-
"markmac": "^0.1.
|
|
67
|
+
"markmac": "^0.1.98",
|
|
68
68
|
"npm-check-updates": "^11",
|
|
69
69
|
"standard-version": "^9",
|
|
70
70
|
"ts-jest": "^27.0.7",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
},
|
|
112
112
|
"main": "lib/index.js",
|
|
113
113
|
"license": "Apache-2.0",
|
|
114
|
-
"version": "0.34.
|
|
114
|
+
"version": "0.34.16",
|
|
115
115
|
"jest": {
|
|
116
116
|
"testMatch": [
|
|
117
117
|
"**/__tests__/**/*.ts?(x)",
|
|
@@ -0,0 +1,95 @@
|
|
|
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.
|