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.
Files changed (93) hide show
  1. package/.jsii +4 -4
  2. package/lib/awscdk/auto-discover.js +1 -1
  3. package/lib/awscdk/cdk-config.js +1 -1
  4. package/lib/awscdk/cdk-tasks.js +1 -1
  5. package/lib/awscdk/java-app.js +1 -1
  6. package/lib/awscdk/lambda-function.js +2 -2
  7. package/lib/awscdk-app-ts.js +3 -2
  8. package/lib/awscdk-construct.js +2 -2
  9. package/lib/cdk8s-app-ts.js +1 -1
  10. package/lib/cdk8s-construct.js +1 -1
  11. package/lib/cdktf-construct.js +1 -1
  12. package/lib/component.js +1 -1
  13. package/lib/construct-lib.js +1 -1
  14. package/lib/deps/dependencies.js +1 -1
  15. package/lib/dev-env.js +1 -1
  16. package/lib/docker-compose.js +2 -2
  17. package/lib/eslint.js +1 -1
  18. package/lib/file.js +1 -1
  19. package/lib/git/gitattributes.js +1 -1
  20. package/lib/github/auto-approve.js +1 -1
  21. package/lib/github/auto-merge.js +1 -1
  22. package/lib/github/dependabot.js +1 -1
  23. package/lib/github/github.js +1 -1
  24. package/lib/github/mergify.js +1 -1
  25. package/lib/github/pr-template.js +1 -1
  26. package/lib/github/pull-request-lint.js +1 -1
  27. package/lib/github/stale.js +1 -1
  28. package/lib/github/task-workflow.js +1 -1
  29. package/lib/github/workflows.js +1 -1
  30. package/lib/gitpod.js +1 -1
  31. package/lib/ignore-file.js +1 -1
  32. package/lib/ini.js +1 -1
  33. package/lib/java/java-project.js +1 -1
  34. package/lib/java/junit.js +1 -1
  35. package/lib/java/maven-compile.js +1 -1
  36. package/lib/java/maven-packaging.js +1 -1
  37. package/lib/java/maven-sample.js +1 -1
  38. package/lib/java/pom.js +1 -1
  39. package/lib/java/projenrc.js +1 -1
  40. package/lib/javascript/bundler.js +1 -1
  41. package/lib/javascript/npm-config.js +1 -1
  42. package/lib/javascript/projenrc.js +1 -1
  43. package/lib/jest.js +1 -1
  44. package/lib/jsii-project.js +1 -1
  45. package/lib/json/projenrc.js +1 -1
  46. package/lib/json.js +1 -1
  47. package/lib/license.js +1 -1
  48. package/lib/logger.js +1 -1
  49. package/lib/makefile.js +1 -1
  50. package/lib/node-package.js +1 -1
  51. package/lib/node-project.js +1 -1
  52. package/lib/object-file.js +1 -1
  53. package/lib/project-build.js +1 -1
  54. package/lib/project.js +2 -2
  55. package/lib/projects.js +1 -1
  56. package/lib/python/pip.js +1 -1
  57. package/lib/python/poetry.js +2 -2
  58. package/lib/python/projenrc.js +1 -1
  59. package/lib/python/pytest.js +1 -1
  60. package/lib/python/python-project.js +1 -1
  61. package/lib/python/python-sample.js +1 -1
  62. package/lib/python/requirements-file.js +1 -1
  63. package/lib/python/setuppy.js +1 -1
  64. package/lib/python/setuptools.js +1 -1
  65. package/lib/python/venv.js +1 -1
  66. package/lib/readme.js +1 -1
  67. package/lib/release/publisher.js +1 -1
  68. package/lib/release/release-trigger.js +1 -1
  69. package/lib/release/release.js +1 -1
  70. package/lib/sample-file.js +2 -2
  71. package/lib/semver.js +1 -1
  72. package/lib/source-code.js +1 -1
  73. package/lib/tasks/runtime.js +1 -1
  74. package/lib/tasks/task.js +1 -1
  75. package/lib/tasks/tasks.js +1 -1
  76. package/lib/textfile.js +1 -1
  77. package/lib/toml.js +1 -1
  78. package/lib/typescript/projenrc.js +1 -1
  79. package/lib/typescript-config.js +1 -1
  80. package/lib/typescript.js +3 -3
  81. package/lib/upgrade-dependencies.js +2 -2
  82. package/lib/version.js +1 -1
  83. package/lib/vscode/devcontainer.js +1 -1
  84. package/lib/vscode/launch-config.js +1 -1
  85. package/lib/vscode/vscode.js +1 -1
  86. package/lib/web/next.js +3 -3
  87. package/lib/web/postcss.js +1 -1
  88. package/lib/web/react.js +4 -4
  89. package/lib/web/tailwind.js +1 -1
  90. package/lib/xmlfile.js +1 -1
  91. package/lib/yaml.js +1 -1
  92. package/package.json +5 -5
  93. 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.45.0",
63
- "jsii-diff": "^1.45.0",
62
+ "jsii": "^1.46.0",
63
+ "jsii-diff": "^1.46.0",
64
64
  "jsii-docgen": "^1.8.110",
65
- "jsii-pacmak": "^1.45.0",
65
+ "jsii-pacmak": "^1.46.0",
66
66
  "json-schema": "^0.4.0",
67
- "markmac": "^0.1.95",
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.12",
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.