projen 0.47.4 → 0.47.5

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 (103) hide show
  1. package/.jsii +2 -2
  2. package/changelog.md +1 -6
  3. package/lib/awscdk/auto-discover.js +1 -1
  4. package/lib/awscdk/awscdk-app-ts.js +1 -1
  5. package/lib/awscdk/awscdk-construct.js +2 -2
  6. package/lib/awscdk/awscdk-deps.js +1 -1
  7. package/lib/awscdk/cdk-config.js +1 -1
  8. package/lib/awscdk/cdk-tasks.js +1 -1
  9. package/lib/awscdk/integration-test.js +1 -1
  10. package/lib/awscdk/java-app.js +1 -1
  11. package/lib/awscdk/lambda-function.js +2 -2
  12. package/lib/build/build-workflow.js +1 -1
  13. package/lib/cdk/construct-lib.js +1 -1
  14. package/lib/cdk/jsii-docgen.js +1 -1
  15. package/lib/cdk/jsii-project.js +1 -1
  16. package/lib/cdk8s/cdk8s-app-ts.js +1 -1
  17. package/lib/cdk8s/cdk8s-construct.js +1 -1
  18. package/lib/cdktf/cdktf-construct.js +1 -1
  19. package/lib/component.js +1 -1
  20. package/lib/dependencies.js +1 -1
  21. package/lib/dev-env.js +1 -1
  22. package/lib/docker-compose.js +2 -2
  23. package/lib/file.js +1 -1
  24. package/lib/gitattributes.js +1 -1
  25. package/lib/github/auto-approve.js +1 -1
  26. package/lib/github/auto-merge.js +1 -1
  27. package/lib/github/dependabot.js +1 -1
  28. package/lib/github/github-project.js +1 -1
  29. package/lib/github/github.js +1 -1
  30. package/lib/github/mergify.js +1 -1
  31. package/lib/github/pr-template.js +1 -1
  32. package/lib/github/pull-request-lint.js +1 -1
  33. package/lib/github/stale.js +1 -1
  34. package/lib/github/task-workflow.js +1 -1
  35. package/lib/github/workflows.js +1 -1
  36. package/lib/gitpod.js +1 -1
  37. package/lib/ignore-file.js +1 -1
  38. package/lib/ini.js +1 -1
  39. package/lib/java/java-project.js +1 -1
  40. package/lib/java/junit.js +1 -1
  41. package/lib/java/maven-compile.js +1 -1
  42. package/lib/java/maven-packaging.js +1 -1
  43. package/lib/java/maven-sample.js +1 -1
  44. package/lib/java/pom.js +1 -1
  45. package/lib/java/projenrc.js +1 -1
  46. package/lib/javascript/bundler.js +1 -1
  47. package/lib/javascript/eslint.js +1 -1
  48. package/lib/javascript/jest.js +1 -1
  49. package/lib/javascript/node-package.js +1 -1
  50. package/lib/javascript/node-project.js +1 -1
  51. package/lib/javascript/npm-config.js +1 -1
  52. package/lib/javascript/projenrc.js +1 -1
  53. package/lib/javascript/typescript-config.js +1 -1
  54. package/lib/javascript/upgrade-dependencies.js +2 -2
  55. package/lib/json.js +1 -1
  56. package/lib/license.js +1 -1
  57. package/lib/logger.js +1 -1
  58. package/lib/makefile.js +1 -1
  59. package/lib/object-file.js +1 -1
  60. package/lib/project-build.js +1 -1
  61. package/lib/project.js +1 -1
  62. package/lib/projects.js +1 -1
  63. package/lib/projenrc-json.js +1 -1
  64. package/lib/python/pip.js +1 -1
  65. package/lib/python/poetry.js +2 -2
  66. package/lib/python/projenrc.js +1 -1
  67. package/lib/python/pytest.js +1 -1
  68. package/lib/python/python-project.js +1 -1
  69. package/lib/python/python-sample.js +1 -1
  70. package/lib/python/requirements-file.js +1 -1
  71. package/lib/python/setuppy.js +1 -1
  72. package/lib/python/setuptools.js +1 -1
  73. package/lib/python/venv.js +1 -1
  74. package/lib/readme.js +1 -1
  75. package/lib/release/publisher.js +1 -1
  76. package/lib/release/release-trigger.js +1 -1
  77. package/lib/release/release.js +1 -1
  78. package/lib/sample-file.js +2 -2
  79. package/lib/semver.js +1 -1
  80. package/lib/source-code.js +1 -1
  81. package/lib/task-runtime.js +1 -1
  82. package/lib/task.js +1 -1
  83. package/lib/tasks.js +1 -1
  84. package/lib/testing.js +1 -1
  85. package/lib/textfile.js +1 -1
  86. package/lib/toml.js +1 -1
  87. package/lib/typescript/projenrc.js +1 -1
  88. package/lib/typescript/typescript-typedoc.js +1 -1
  89. package/lib/typescript/typescript.js +3 -3
  90. package/lib/version.js +1 -1
  91. package/lib/vscode/devcontainer.js +1 -1
  92. package/lib/vscode/launch-config.js +1 -1
  93. package/lib/vscode/vscode.js +1 -1
  94. package/lib/web/next.js +3 -3
  95. package/lib/web/postcss.js +1 -1
  96. package/lib/web/react.js +4 -4
  97. package/lib/web/tailwind.js +1 -1
  98. package/lib/xmlfile.js +1 -1
  99. package/lib/yaml.js +1 -1
  100. package/package.json +1 -1
  101. package/releasetag.txt +1 -1
  102. package/rfcs/project-creation-prompt.md +95 -0
  103. package/version.txt +1 -1
package/lib/yaml.js CHANGED
@@ -36,5 +36,5 @@ class YamlFile extends object_file_1.ObjectFile {
36
36
  }
37
37
  exports.YamlFile = YamlFile;
38
38
  _a = JSII_RTTI_SYMBOL_1;
39
- YamlFile[_a] = { fqn: "projen.YamlFile", version: "0.47.4" };
39
+ YamlFile[_a] = { fqn: "projen.YamlFile", version: "0.47.5" };
40
40
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWFtbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy95YW1sLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsNkJBQTZCO0FBRTdCLCtDQUE4RDs7Ozs7O0FBTzlELE1BQWEsUUFBUyxTQUFRLHdCQUFVOzs7O0lBQ3RDLFlBQVksT0FBZ0IsRUFBRSxRQUFnQixFQUFFLE9BQXdCO1FBQ3RFLEtBQUssQ0FBQyxPQUFPLEVBQUUsUUFBUSxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ3BDLENBQUM7Ozs7OztJQUVTLGlCQUFpQixDQUFDLFFBQW1CO1FBQzdDLE1BQU0sSUFBSSxHQUFHLEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUMvQyxJQUFJLENBQUMsSUFBSSxFQUFFO1lBQ1QsT0FBTyxTQUFTLENBQUM7U0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OiBJUmVzb2x2ZXIpOiBzdHJpbmcgfCB1bmRlZmluZWQge1xuICAgIGNvbnN0IGpzb24gPSBzdXBlci5zeW50aGVzaXplQ29udGVudChyZXNvbHZlcik7XG4gICAgaWYgKCFqc29uKSB7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIHJldHVybiBbXG4gICAgICAuLi4gKHRoaXMubWFya2VyID8gW2AjICR7WWFtbEZpbGUuUFJPSkVOX01BUktFUn1gXSA6IFtdKSxcbiAgICAgICcnLFxuICAgICAgWUFNTC5zdHJpbmdpZnkoSlNPTi5wYXJzZShqc29uKSwgeyBpbmRlbnQ6IDIgfSksXG4gICAgXS5qb2luKCdcXG4nKTtcbiAgfVxufSJdfQ==
package/package.json CHANGED
@@ -113,7 +113,7 @@
113
113
  },
114
114
  "main": "lib/index.js",
115
115
  "license": "Apache-2.0",
116
- "version": "0.47.4",
116
+ "version": "0.47.5",
117
117
  "jest": {
118
118
  "testMatch": [
119
119
  "**/__tests__/**/*.ts?(x)",
package/releasetag.txt CHANGED
@@ -1 +1 @@
1
- v0.47.4
1
+ v0.47.5
@@ -0,0 +1,95 @@
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.txt CHANGED
@@ -1 +1 @@
1
- 0.47.4
1
+ 0.47.5