projen 0.34.13 → 0.34.17

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 (96) hide show
  1. package/.jsii +3 -3
  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/node_modules/xmlbuilder2/node_modules/@types/node/README.md +1 -1
  93. package/node_modules/xmlbuilder2/node_modules/@types/node/fs.d.ts +42 -6
  94. package/node_modules/xmlbuilder2/node_modules/@types/node/package.json +2 -2
  95. package/package.json +2 -2
  96. package/rfcs/github-project-settings.md +95 -0
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 19 Nov 2021 08:31:10 GMT
11
+ * Last updated: Tue, 23 Nov 2021 19:31:07 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
@@ -260,6 +260,29 @@ declare module 'fs' {
260
260
  */
261
261
  readSync(): Dirent | null;
262
262
  }
263
+ /**
264
+ * Class: fs.StatWatcher
265
+ * @since v14.3.0, v12.20.0
266
+ * Extends `EventEmitter`
267
+ * A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
268
+ */
269
+ export interface StatWatcher extends EventEmitter {
270
+ /**
271
+ * @since v14.3.0, v12.20.0
272
+ * When called, requests that the Node.js event loop not exit so long as the `fs.StatWatcher` is active.
273
+ * Calling `watcher.ref()` multiple times will have no effect.
274
+ * By default, all `fs.StatWatcher`` objects are "ref'ed", making it normally unnecessary to call `watcher.ref()`
275
+ * unless `watcher.unref()` had been called previously.
276
+ */
277
+ ref(): this;
278
+ /**
279
+ * @since v14.3.0, v12.20.0
280
+ * When called, the active `fs.StatWatcher`` object will not require the Node.js event loop to remain active.
281
+ * If there is no other activity keeping the event loop running, the process may exit before the `fs.StatWatcher`` object's callback is invoked.
282
+ * `Calling watcher.unref()` multiple times will have no effect.
283
+ */
284
+ unref(): this;
285
+ }
263
286
  export interface FSWatcher extends EventEmitter {
264
287
  /**
265
288
  * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
@@ -2784,21 +2807,34 @@ declare module 'fs' {
2784
2807
  * * the file is renamed and then renamed a second time back to its original name
2785
2808
  * @since v0.1.31
2786
2809
  */
2810
+ export interface WatchFileOptions {
2811
+ bigint?: boolean | undefined;
2812
+ persistent?: boolean | undefined;
2813
+ interval?: number | undefined;
2814
+ }
2787
2815
  export function watchFile(
2788
2816
  filename: PathLike,
2789
2817
  options:
2790
- | {
2791
- persistent?: boolean | undefined;
2792
- interval?: number | undefined;
2793
- }
2818
+ | (WatchFileOptions & {
2819
+ bigint?: false | undefined;
2820
+ })
2794
2821
  | undefined,
2795
2822
  listener: (curr: Stats, prev: Stats) => void
2796
- ): void;
2823
+ ): StatWatcher;
2824
+ export function watchFile(
2825
+ filename: PathLike,
2826
+ options:
2827
+ | (WatchFileOptions & {
2828
+ bigint: true;
2829
+ })
2830
+ | undefined,
2831
+ listener: (curr: BigIntStats, prev: BigIntStats) => void
2832
+ ): StatWatcher;
2797
2833
  /**
2798
2834
  * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
2799
2835
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
2800
2836
  */
2801
- export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void;
2837
+ export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher;
2802
2838
  /**
2803
2839
  * Stop watching for changes on `filename`. If `listener` is specified, only that
2804
2840
  * particular listener is removed. Otherwise, _all_ listeners are removed,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.11.9",
3
+ "version": "16.11.10",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -225,6 +225,6 @@
225
225
  },
226
226
  "scripts": {},
227
227
  "dependencies": {},
228
- "typesPublisherContentHash": "d38d785af313406345e5384ce39a1c5750b72c1893eb022dca68dc7f95f943cf",
228
+ "typesPublisherContentHash": "b24d5d157d742f1a54b5d70ed1c014862c87e0187063c31ed2038790f909f02d",
229
229
  "typeScriptVersion": "3.8"
230
230
  }
package/package.json CHANGED
@@ -64,7 +64,7 @@
64
64
  "jsii-docgen": "^1.8.110",
65
65
  "jsii-pacmak": "^1.46.0",
66
66
  "json-schema": "^0.4.0",
67
- "markmac": "^0.1.97",
67
+ "markmac": "^0.1.99",
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.13",
114
+ "version": "0.34.17",
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.