@nikovirtala/projen-constructs 0.5.1 → 0.5.2
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/.kiro/steering/product.md +7 -5
- package/.kiro/steering/tech.md +7 -5
- package/README.md +94 -478
- package/docs/api/assets/highlight.css +8 -8
- package/docs/api/functions/renderBundleName.html +1 -1
- package/docs/api/index.html +96 -415
- package/docs/api/interfaces/AwsCdkConstructLibraryProjectOptions.html +3 -3
- package/docs/api/interfaces/AwsCdkTypeScriptAppProjectOptions.html +3 -3
- package/docs/api/interfaces/JsiiProjectOptions.html +3 -3
- package/docs/api/interfaces/LocalStackOptions.html +2 -2
- package/docs/api/interfaces/ProjectGeneratorOptions.html +1 -1
- package/docs/api/interfaces/TypeScriptProjectOptions.html +3 -3
- package/docs/api/interfaces/VitestConfigOptions.html +3 -3
- package/docs/api/interfaces/VitestOptions.html +2 -2
- package/docs/api/media/LICENSE +202 -0
- package/docs/api/media/components.md +191 -0
- package/docs/api/media/configuration.md +108 -0
- package/docs/api/media/development.md +93 -0
- package/docs/api/media/index.html +169 -0
- package/docs/api/media/migration.md +106 -0
- package/docs/api/modules.html +2 -2
- package/docs/components.md +191 -0
- package/docs/configuration.md +108 -0
- package/docs/development.md +93 -0
- package/docs/migration.md +106 -0
- package/lib/components/bundle-lambda-function-code.js +3 -3
- package/lib/components/colima.js +1 -1
- package/lib/components/homebrew.js +1 -1
- package/lib/components/lambda-function-construct-generator.js +1 -1
- package/lib/components/localstack.js +1 -1
- package/lib/components/mise.js +1 -1
- package/lib/components/typedoc.js +1 -1
- package/lib/components/vitest.js +1 -1
- package/lib/project-generator.js +1 -1
- package/lib/projects/awscdk-construct-library.generated.js +1 -1
- package/lib/projects/awscdk-typescript-app.generated.js +1 -1
- package/lib/projects/jsii.generated.js +1 -1
- package/lib/projects/typescript.generated.js +1 -1
- package/package.json +3 -2
package/docs/api/index.html
CHANGED
|
@@ -9,419 +9,126 @@
|
|
|
9
9
|
<div class="tsd-page-title">
|
|
10
10
|
<h1>@nikovirtala/projen-constructs</h1></div>
|
|
11
11
|
<div class="tsd-panel tsd-typography"><h1 id="nikovirtalaprojen-constructs" class="tsd-anchor-link">@nikovirtala/projen-constructs<a href="#nikovirtalaprojen-constructs" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h1>
|
|
12
|
-
<p>
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
<p>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<li
|
|
30
|
-
<li
|
|
31
|
-
<li
|
|
32
|
-
<li><strong>Auto-merge</strong>: Enabled with auto-approve</li>
|
|
33
|
-
<li><strong>VSCode</strong>: Recommended extensions and settings</li>
|
|
34
|
-
<li><strong>mise</strong>: Node version management</li>
|
|
35
|
-
</ul>
|
|
36
|
-
<h2 id="standard-configuration" class="tsd-anchor-link">Standard Configuration<a href="#standard-configuration" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
37
|
-
<ul>
|
|
38
|
-
<li><strong>Author</strong>: Niko Virtala (<a href="mailto:niko.virtala@hey.com">niko.virtala@hey.com</a>)</li>
|
|
39
|
-
<li><strong>Default Release Branch</strong>: main</li>
|
|
40
|
-
<li><strong>Package Manager</strong>: pnpm 12.16.1</li>
|
|
41
|
-
<li><strong>Node Version</strong>: 26.13.0</li>
|
|
42
|
-
<li><strong>TypeScript</strong>: 6.0.3</li>
|
|
43
|
-
<li><strong>CDK Version</strong>: 2.263.0 (for CDK projects)</li>
|
|
44
|
-
<li><strong>JSII Version</strong>: ~6.0.3 (for JSII projects)</li>
|
|
12
|
+
<p>Opinionated projen project types that scaffold TypeScript, JSII and AWS CDK repositories with one shared config.</p>
|
|
13
|
+
<p><a href="https://www.npmjs.com/package/@nikovirtala/projen-constructs"><img src="https://img.shields.io/npm/v/@nikovirtala/projen-constructs?label=npm" alt="npm version badge, latest release on npm"></a>
|
|
14
|
+
<a href="https://github.com/nikovirtala/projen-constructs/actions/workflows/build.yml"><img src="https://img.shields.io/github/actions/workflow/status/nikovirtala/projen-constructs/build.yml?branch=main&label=build" alt="build status badge from the GitHub Actions build workflow"></a>
|
|
15
|
+
<a href="./LICENSE"><img src="https://img.shields.io/npm/l/@nikovirtala/projen-constructs?label=license" alt="license badge, Apache-2.0"></a>
|
|
16
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D26.13.0-informational?label=node" alt="supported Node.js version badge, requires Node.js 26.13.0 or newer"></a>
|
|
17
|
+
<a href="https://projen.io"><img src="https://img.shields.io/badge/projen-%5E0.104.23-informational?label=projen" alt="projen peer dependency version badge, requires projen 0.104.23 or newer"></a></p>
|
|
18
|
+
<h2 id="why-this-exists" class="tsd-anchor-link">Why this exists<a href="#why-this-exists" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
19
|
+
<p>Projen gives you code-first project configuration, but wiring up a consistent setup across many
|
|
20
|
+
TypeScript, JSII and AWS CDK repositories still means repeating the same choices. This library
|
|
21
|
+
packages those choices into ready-made project types and reusable components, so every repository
|
|
22
|
+
you generate shares the same package manager, Node.js and TypeScript versions, testing, linting and
|
|
23
|
+
release tooling.</p>
|
|
24
|
+
<p>It is for anyone in the projen and AWS CDK community who maintains more than one repository and wants
|
|
25
|
+
them to behave the same way without hand-copying configuration between them.</p>
|
|
26
|
+
<h2 id="when-not-to-use-this" class="tsd-anchor-link">When not to use this<a href="#when-not-to-use-this" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
27
|
+
<p>Reach for plain projen instead when:</p>
|
|
28
|
+
<ul>
|
|
29
|
+
<li>you want unopinionated projen defaults and prefer to make each tooling choice yourself</li>
|
|
30
|
+
<li>your setup is not pnpm-based or cannot run Node.js 26</li>
|
|
31
|
+
<li>you build in languages beyond TypeScript, JSII and AWS CDK</li>
|
|
45
32
|
</ul>
|
|
46
|
-
<
|
|
47
|
-
<code>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
<h2 id="status-and-supported-versions" class="tsd-anchor-link">Status and supported versions<a href="#status-and-supported-versions" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
34
|
+
<p>Stability: <strong>stable</strong>. This library requires <code>projen</code> ^0.104.23, pnpm 12, and Node.js >= 26.13.0.
|
|
35
|
+
These values are maintained in <code>src/versions.json</code> and the project configuration; the numbers quoted
|
|
36
|
+
across this documentation track those sources.</p>
|
|
37
|
+
<h2 id="documentation" class="tsd-anchor-link">Documentation<a href="#documentation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
51
38
|
<table>
|
|
52
39
|
<thead>
|
|
53
40
|
<tr>
|
|
54
|
-
<th>
|
|
55
|
-
<th>
|
|
56
|
-
<th>Reason</th>
|
|
41
|
+
<th>Guide</th>
|
|
42
|
+
<th>What it covers</th>
|
|
57
43
|
</tr>
|
|
58
44
|
</thead>
|
|
59
45
|
<tbody>
|
|
60
46
|
<tr>
|
|
61
|
-
<td><
|
|
62
|
-
<td
|
|
63
|
-
<td>jsii tooling resolves dependencies from a flat <code>node_modules</code></td>
|
|
47
|
+
<td><a href="media/configuration.md">Configuration</a></td>
|
|
48
|
+
<td>Standard defaults, pnpm settings, the TypeScript configs, native TypeScript, and how to customize any option</td>
|
|
64
49
|
</tr>
|
|
65
50
|
<tr>
|
|
66
|
-
<td><
|
|
67
|
-
<td
|
|
68
|
-
<td>esbuild links its platform binary in a postinstall script, and pnpm 11 fails an install with ignored builds</td>
|
|
51
|
+
<td><a href="media/components.md">Components</a></td>
|
|
52
|
+
<td>Reference for every component: Vitest, TypeDoc, Mise, Homebrew, Colima, LocalStack, LambdaFunctionConstructGenerator, Bundler, and ProjectGenerator</td>
|
|
69
53
|
</tr>
|
|
70
54
|
<tr>
|
|
71
|
-
<td><
|
|
72
|
-
<td
|
|
73
|
-
<td>projen resolves the task <code>PATH</code> with <code>$(pnpm -c exec ...)</code>, which otherwise re-enters <code>pnpm install</code> and deadlocks</td>
|
|
55
|
+
<td><a href="media/migration.md">Migration</a></td>
|
|
56
|
+
<td>Moving from the deprecated standalone packages, including the name mapping and behaviour changes</td>
|
|
74
57
|
</tr>
|
|
75
58
|
<tr>
|
|
76
|
-
<td><
|
|
77
|
-
<td
|
|
78
|
-
|
|
59
|
+
<td><a href="media/development.md">Development</a></td>
|
|
60
|
+
<td>Development commands and the build process diagram</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td><a href="media/index.html">API reference</a></td>
|
|
64
|
+
<td>Generated TypeDoc API documentation</td>
|
|
79
65
|
</tr>
|
|
80
66
|
</tbody>
|
|
81
67
|
</table>
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
<
|
|
85
|
-
<
|
|
86
|
-
rule set, so it only carries compiler options jsii accepts.</li>
|
|
87
|
-
<li><code>test/tsconfig.json</code> extends it and is type-check only. This is the config Vitest type checking and
|
|
88
|
-
the editor use, and the one <code>tsconfigDev</code> points at.</li>
|
|
89
|
-
<li><code>projenrc/tsconfig.json</code> covers <code>.projenrc.ts</code>.</li>
|
|
90
|
-
</ul>
|
|
91
|
-
<h3 id="native-typescript" class="tsd-anchor-link">Native TypeScript<a href="#native-typescript" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
92
|
-
<p>TypeScript and AWS CDK app projects run TypeScript with Node.js's built-in
|
|
93
|
-
<a href="https://nodejs.org/api/typescript.html#type-stripping">type stripping</a> instead of <code>tsx</code> or
|
|
94
|
-
<code>ts-node</code>: the default task is <code>node .projenrc.ts</code>, and the cdk.json <code>app</code> is <code>node src/main.ts</code>.
|
|
95
|
-
Their <code>tsconfig.json</code> sets <code>erasableSyntaxOnly</code> and <code>verbatimModuleSyntax</code>, so <code>tsc</code> reports code
|
|
96
|
-
that Node.js can't run before Node.js does.</p>
|
|
97
|
-
<p>Code in these projects must therefore:</p>
|
|
98
|
-
<ul>
|
|
99
|
-
<li>only use syntax that can be stripped: no <code>enum</code>s (use an <code>as const</code> object), no namespaces with
|
|
100
|
-
values, and no constructor parameter properties</li>
|
|
101
|
-
<li>mark type-only imports with <code>type</code> (Biome's <code>useImportType</code> fixes these)</li>
|
|
102
|
-
<li>import relative files with their <code>.ts</code> extension, and never import a directory</li>
|
|
103
|
-
<li>use Node.js <a href="https://nodejs.org/api/packages.html#subpath-imports">subpath imports</a>
|
|
104
|
-
(<code>#stacks</code> in <code>package.json</code> <code>imports</code>) instead of tsconfig <code>paths</code>, which Node.js doesn't read</li>
|
|
105
|
-
<li>import packages without an <code>exports</code> map either from the package root or with an explicit file,
|
|
106
|
-
e.g. <code>projen/lib/component.js</code> rather than <code>projen/lib/component</code></li>
|
|
107
|
-
</ul>
|
|
108
|
-
<p>Lambda handlers bundled by esbuild and tests run by Vitest aren't run by Node.js directly, but the
|
|
109
|
-
same compiler options apply to them.</p>
|
|
110
|
-
<p>JSII and AWS CDK construct library projects keep using <code>tsx</code>, because jsii compiles to CommonJS, and
|
|
111
|
-
their <code>.projenrc.ts</code> often imports their own <code>src</code>.</p>
|
|
112
|
-
<p>When you start a new project by hand, make sure <code>package.json</code> has <code>"type": "module"</code> before the
|
|
113
|
-
first <code>node .projenrc.ts</code>: <code>npm init</code> writes <code>"type": "commonjs"</code>, which makes Node.js reject the
|
|
114
|
-
<code>import</code> statements in <code>.projenrc.ts</code>.</p>
|
|
115
|
-
<h2 id="customization" class="tsd-anchor-link">Customization<a href="#customization" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
116
|
-
<p>Override any option by passing it to the constructor:</p>
|
|
117
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">JsiiProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">JsiiProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-project"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-project.git"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">minNodeVersion:</span><span class="hl-1"> </span><span class="hl-2">"26.0.0"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">author:</span><span class="hl-1"> </span><span class="hl-2">"Custom Author"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">authorAddress:</span><span class="hl-1"> </span><span class="hl-2">"custom@example.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">mise:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">vitest:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">tsconfig:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">compilerOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">noUnusedLocals:</span><span class="hl-1"> </span><span class="hl-3">false</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-5">biomeOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">biomeConfig:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">formatter:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">lineWidth:</span><span class="hl-1"> </span><span class="hl-7">100</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
118
|
-
</code><button type="button">Copy</button></pre>
|
|
119
|
-
|
|
120
|
-
<p>Every component is exposed as an enable flag (<code>mise</code>, <code>vitest</code>, ...) plus an options property
|
|
121
|
-
(<code>miseOptions</code>, <code>vitestOptions</code>, ...).</p>
|
|
122
|
-
<h2 id="usage" class="tsd-anchor-link">Usage<a href="#usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
123
|
-
<h3 id="projects" class="tsd-anchor-link">Projects<a href="#projects" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
124
|
-
<h4 id="aws-cdk-construct-library-project" class="tsd-anchor-link">AWS CDK Construct Library Project<a href="#aws-cdk-construct-library-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
125
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkConstructLibraryProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkConstructLibraryProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-cdk-construct"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-cdk-construct.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
126
|
-
</code><button type="button">Copy</button></pre>
|
|
127
|
-
|
|
128
|
-
<h4 id="aws-cdk-typescript-app-project" class="tsd-anchor-link">AWS CDK TypeScript App Project<a href="#aws-cdk-typescript-app-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
129
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkTypeScriptAppProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkTypeScriptAppProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-cdk-app"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repository:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-cdk-app.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
130
|
-
</code><button type="button">Copy</button></pre>
|
|
131
|
-
|
|
132
|
-
<h4 id="jsii-project" class="tsd-anchor-link">JSII Project<a href="#jsii-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
133
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">JsiiProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">JsiiProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-jsii-project"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-jsii-project.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
134
|
-
</code><button type="button">Copy</button></pre>
|
|
135
|
-
|
|
136
|
-
<h4 id="typescript-project" class="tsd-anchor-link">TypeScript Project<a href="#typescript-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
137
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">TypeScriptProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">TypeScriptProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-typescript-project"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repository:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-typescript-project.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
138
|
-
</code><button type="button">Copy</button></pre>
|
|
139
|
-
|
|
140
|
-
<h3 id="components" class="tsd-anchor-link">Components<a href="#components" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
141
|
-
<p>The package includes reusable components for common development tasks:</p>
|
|
142
|
-
<h4 id="vitest" class="tsd-anchor-link">Vitest<a href="#vitest" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
143
|
-
<p><a href="https://vitest.dev">Vitest</a> testing framework component.</p>
|
|
144
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Vitest</span><span class="hl-1">, </span><span class="hl-5">CoverageProvider</span><span class="hl-1">, </span><span class="hl-5">CoverageReporter</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Vitest</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">vitestVersion:</span><span class="hl-1"> </span><span class="hl-2">"^5"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">config:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">coverageProvider:</span><span class="hl-1"> </span><span class="hl-5">CoverageProvider</span><span class="hl-1">.</span><span class="hl-6">V8</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">coverageReporters:</span><span class="hl-1"> [</span><span class="hl-5">CoverageReporter</span><span class="hl-1">.</span><span class="hl-6">TEXT</span><span class="hl-1">, </span><span class="hl-5">CoverageReporter</span><span class="hl-1">.</span><span class="hl-6">LCOV</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
145
|
-
</code><button type="button">Copy</button></pre>
|
|
146
|
-
|
|
147
|
-
<p>Type checking runs against the project's development tsconfig (<code>test/tsconfig.json</code>) unless
|
|
148
|
-
<code>config.typecheckTsconfig</code> says otherwise.</p>
|
|
149
|
-
<p>For Vitest settings that <code>config</code> doesn't cover, use <code>extraTestConfig</code> (merged into <code>test</code>) and
|
|
150
|
-
<code>extraConfig</code> (top-level options next to <code>test</code>):</p>
|
|
151
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Vitest</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Vitest</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">extraTestConfig:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">setupFiles:</span><span class="hl-1"> [</span><span class="hl-2">"test/setup.ts"</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1"> </span><span class="hl-5">extraConfig:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">resolve:</span><span class="hl-1"> { </span><span class="hl-5">alias:</span><span class="hl-1"> { </span><span class="hl-2">"@"</span><span class="hl-5">:</span><span class="hl-1"> </span><span class="hl-2">"/src"</span><span class="hl-1"> } },</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
152
|
-
</code><button type="button">Copy</button></pre>
|
|
153
|
-
|
|
154
|
-
<p><code>extraTestConfig</code> is deep-merged over the generated <code>test</code> options: objects merge, and other values
|
|
155
|
-
(including arrays) replace the generated value. Both options are rendered as JSON, so their values
|
|
156
|
-
can't contain functions or regular expressions, which rules out plugins.</p>
|
|
157
|
-
<h4 id="typedoc" class="tsd-anchor-link">TypeDoc<a href="#typedoc" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
158
|
-
<p><a href="https://typedoc.org">TypeDoc</a> documentation generation component.</p>
|
|
159
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">TypeDoc</span><span class="hl-1">, </span><span class="hl-5">EntryPointStrategy</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">TypeDoc</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">version:</span><span class="hl-1"> </span><span class="hl-2">"^0.28"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">typeDocConfig:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">entryPointStrategy:</span><span class="hl-1"> </span><span class="hl-5">EntryPointStrategy</span><span class="hl-1">.</span><span class="hl-6">EXPAND</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">out:</span><span class="hl-1"> </span><span class="hl-2">"docs/api"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">exclude:</span><span class="hl-1"> [</span><span class="hl-2">"**/*.test.ts"</span><span class="hl-1">],</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
160
|
-
</code><button type="button">Copy</button></pre>
|
|
161
|
-
|
|
162
|
-
<h4 id="mise" class="tsd-anchor-link">Mise<a href="#mise" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
163
|
-
<p><a href="https://mise.jdx.dev">Mise</a> dev tools/runtimes management component.</p>
|
|
164
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Mise</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Mise</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">nodeVersion:</span><span class="hl-1"> </span><span class="hl-2">"26.13.0"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
|
|
165
|
-
</code><button type="button">Copy</button></pre>
|
|
166
|
-
|
|
167
|
-
<h4 id="homebrew" class="tsd-anchor-link">Homebrew<a href="#homebrew" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
168
|
-
<p><a href="https://brew.sh">Homebrew</a> package management component. Writes a <code>Brewfile</code> and adds an
|
|
169
|
-
<code>install:homebrew</code> task that bootstraps Homebrew and runs <code>brew bundle</code>.</p>
|
|
170
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Homebrew</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">homebrew</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Homebrew</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">packages:</span><span class="hl-1"> [</span><span class="hl-2">"jq"</span><span class="hl-1">, </span><span class="hl-2">"yq"</span><span class="hl-1">],</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">homebrew</span><span class="hl-1">.</span><span class="hl-0">addPackage</span><span class="hl-1">(</span><span class="hl-2">"gh"</span><span class="hl-1">);</span>
|
|
171
|
-
</code><button type="button">Copy</button></pre>
|
|
172
|
-
|
|
173
|
-
<p>A fully qualified formula (<code>user/repository/formula</code>) also adds a <code>tap</code> entry. Since Homebrew 6,
|
|
174
|
-
formulae from non-official taps only load when trusted, so they're written with <code>trusted: true</code>.
|
|
175
|
-
That trusts only the formula, not the rest of its tap.</p>
|
|
176
|
-
<h4 id="colima" class="tsd-anchor-link">Colima<a href="#colima" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
177
|
-
<p><a href="https://github.com/abiosoft/colima">Colima</a> container runtime component. Alternative for Docker.</p>
|
|
178
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Colima</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Colima</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">);</span>
|
|
179
|
-
</code><button type="button">Copy</button></pre>
|
|
180
|
-
|
|
181
|
-
<h4 id="localstack" class="tsd-anchor-link">LocalStack<a href="#localstack" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h4>
|
|
182
|
-
<p><a href="https://www.localstack.cloud">LocalStack</a> AWS emulation component.</p>
|
|
183
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">LocalStack</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LocalStack</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">services:</span><span class="hl-1"> [</span><span class="hl-2">"s3"</span><span class="hl-1">, </span><span class="hl-2">"lambda"</span><span class="hl-1">, </span><span class="hl-2">"dynamodb"</span><span class="hl-1">],</span><br/><span class="hl-1"> </span><span class="hl-5">port:</span><span class="hl-1"> </span><span class="hl-7">4566</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">debug:</span><span class="hl-1"> </span><span class="hl-3">true</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
|
|
68
|
+
<p>Quick links: <a href="#quick-start">Quick start</a> · <a href="#usage">Usage</a> · <a href="#features">Features</a>.</p>
|
|
69
|
+
<h2 id="quick-start" class="tsd-anchor-link">Quick start<a href="#quick-start" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
70
|
+
<p>Install the library alongside its <code>projen</code> and <code>constructs</code> peers:</p>
|
|
71
|
+
<pre><code class="bash"><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">add</span><span class="hl-1"> </span><span class="hl-3">-D</span><span class="hl-1"> </span><span class="hl-2">@nikovirtala/projen-constructs</span><span class="hl-1"> </span><span class="hl-2">projen</span><span class="hl-1"> </span><span class="hl-2">constructs</span>
|
|
184
72
|
</code><button type="button">Copy</button></pre>
|
|
185
73
|
|
|
186
|
-
<
|
|
187
|
-
<
|
|
188
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">LambdaFunctionConstructGenerator</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LambdaFunctionConstructGenerator</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">sourceDir:</span><span class="hl-1"> </span><span class="hl-2">"src/handlers"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">outputDir:</span><span class="hl-1"> </span><span class="hl-2">"src/constructs/lambda"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">filePattern:</span><span class="hl-1"> </span><span class="hl-2">"*.lambda.ts"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">esbuildOptions:</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">minify:</span><span class="hl-1"> </span><span class="hl-3">true</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">sourcemap:</span><span class="hl-1"> </span><span class="hl-3">true</span><span class="hl-1">,</span><br/><span class="hl-1"> },</span><br/><span class="hl-1">});</span>
|
|
74
|
+
<p>Create a <code>.projenrc.ts</code> that defines an AWS CDK construct library and synthesizes it:</p>
|
|
75
|
+
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkConstructLibraryProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkConstructLibraryProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-cdk-construct"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">author:</span><span class="hl-1"> </span><span class="hl-2">"Your Name"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">authorAddress:</span><span class="hl-1"> </span><span class="hl-2">"you@example.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/your-org/my-cdk-construct.git"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">cdkVersion:</span><span class="hl-1"> </span><span class="hl-2">"2.275.0"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
189
76
|
</code><button type="button">Copy</button></pre>
|
|
190
77
|
|
|
191
|
-
<
|
|
192
|
-
<
|
|
193
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> {</span><br/><span class="hl-1"> </span><span class="hl-5">Bundler</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">LambdaFunctionCodeBundle</span><span class="hl-1">,</span><br/><span class="hl-1">} </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">bundler</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">Bundler</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">assetsDir:</span><span class="hl-1"> </span><span class="hl-2">"assets"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">esbuildVersion:</span><span class="hl-1"> </span><span class="hl-2">"^0.25"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">LambdaFunctionCodeBundle</span><span class="hl-1">(</span><span class="hl-5">project</span><span class="hl-1">, {</span><br/><span class="hl-1"> </span><span class="hl-5">entrypoint:</span><span class="hl-1"> </span><span class="hl-2">"src/my-function.lambda.ts"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">extension:</span><span class="hl-1"> </span><span class="hl-2">".lambda.ts"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span>
|
|
78
|
+
<p>Then run synthesis:</p>
|
|
79
|
+
<pre><code class="bash"><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">dlx</span><span class="hl-1"> </span><span class="hl-2">projen</span>
|
|
194
80
|
</code><button type="button">Copy</button></pre>
|
|
195
81
|
|
|
196
|
-
<
|
|
197
|
-
<
|
|
198
|
-
|
|
82
|
+
<p><strong>Expected output</strong>: projen reads <code>.projenrc.ts</code> and writes the generated project files into the
|
|
83
|
+
working directory: <code>package.json</code>, <code>tsconfig.json</code>, <code>pnpm-workspace.yaml</code>, the GitHub Actions
|
|
84
|
+
workflows, the Vitest and Biome configuration, <code>mise.toml</code>, and the source and test scaffolding for
|
|
85
|
+
your construct library. Re-running the command after you edit <code>.projenrc.ts</code> updates those files in
|
|
86
|
+
place.</p>
|
|
87
|
+
<p>To start a project from scratch without writing <code>.projenrc.ts</code> yourself:</p>
|
|
88
|
+
<pre><code class="bash"><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">dlx</span><span class="hl-1"> </span><span class="hl-2">projen</span><span class="hl-1"> </span><span class="hl-2">new</span><span class="hl-1"> </span><span class="hl-3">--from</span><span class="hl-1"> </span><span class="hl-2">@nikovirtala/projen-constructs</span><span class="hl-1"> </span><span class="hl-2">aws_cdk_construct_library</span>
|
|
199
89
|
</code><button type="button">Copy</button></pre>
|
|
200
90
|
|
|
201
|
-
<
|
|
91
|
+
<h2 id="features" class="tsd-anchor-link">Features<a href="#features" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
202
92
|
<ul>
|
|
203
|
-
<li>
|
|
204
|
-
|
|
205
|
-
<li>
|
|
206
|
-
|
|
207
|
-
<li>
|
|
208
|
-
|
|
93
|
+
<li><strong>Standard configuration</strong>: opinionated defaults for author, release branch, package manager,
|
|
94
|
+
Node.js, TypeScript, and tooling</li>
|
|
95
|
+
<li><strong>Automatic project type discovery</strong>: generates the <code>ProjectType</code> enum from projen's JSII manifest
|
|
96
|
+
(<!-- generated:project-type-count-start -->21<!-- generated:project-type-count-end --> project types)</li>
|
|
97
|
+
<li><strong>Component system</strong>: reusable components (Vitest, TypeDoc, Mise, Homebrew, Colima, LocalStack,
|
|
98
|
+
Lambda bundling)</li>
|
|
99
|
+
<li><strong>Code generation</strong>: <code>ProjectGenerator</code> creates project classes with standard configuration</li>
|
|
100
|
+
<li><strong>ES modules</strong>: TypeScript and CDK app projects use ES modules (JSII uses CommonJS)</li>
|
|
101
|
+
<li><strong>Code quality</strong>: Biome for formatting and linting</li>
|
|
102
|
+
<li><strong>Testing</strong>: Vitest with coverage</li>
|
|
103
|
+
<li><strong>Auto-merge</strong>: enabled with auto-approve</li>
|
|
104
|
+
<li><strong>VSCode</strong>: recommended extensions and settings</li>
|
|
105
|
+
<li><strong>mise</strong>: Node version management</li>
|
|
209
106
|
</ul>
|
|
210
|
-
<h2 id="
|
|
211
|
-
<p>
|
|
212
|
-
|
|
213
|
-
<
|
|
214
|
-
<
|
|
215
|
-
<
|
|
216
|
-
<tr>
|
|
217
|
-
<th>Deprecated package</th>
|
|
218
|
-
<th>Replacement in <code>@nikovirtala/projen-constructs</code></th>
|
|
219
|
-
</tr>
|
|
220
|
-
</thead>
|
|
221
|
-
<tbody>
|
|
222
|
-
<tr>
|
|
223
|
-
<td><code>@nikovirtala/projen-vitest</code></td>
|
|
224
|
-
<td><code>Vitest</code>, <code>VitestOptions</code>, <code>VitestConfigOptions</code>, <code>Environment</code>, <code>Pool</code>, <code>CoverageProvider</code>, <code>CoverageReporter</code></td>
|
|
225
|
-
</tr>
|
|
226
|
-
<tr>
|
|
227
|
-
<td><code>@nikovirtala/projen-typedoc</code></td>
|
|
228
|
-
<td><code>TypeDoc</code>, <code>TypeDocOptions</code>, <code>TypeDocConfiguration</code> and its enums</td>
|
|
229
|
-
</tr>
|
|
230
|
-
<tr>
|
|
231
|
-
<td><code>@nikovirtala/projen-homebrew</code></td>
|
|
232
|
-
<td><code>Homebrew</code>, <code>HomebrewOptions</code></td>
|
|
233
|
-
</tr>
|
|
234
|
-
<tr>
|
|
235
|
-
<td><code>@nikovirtala/projen-colima</code></td>
|
|
236
|
-
<td><code>Colima</code></td>
|
|
237
|
-
</tr>
|
|
238
|
-
<tr>
|
|
239
|
-
<td><code>@nikovirtala/projen-localstack</code></td>
|
|
240
|
-
<td><code>LocalStack</code>, <code>LocalStackOptions</code></td>
|
|
241
|
-
</tr>
|
|
242
|
-
<tr>
|
|
243
|
-
<td><code>@nikovirtala/projen-bundle-lambda-function-code</code></td>
|
|
244
|
-
<td><code>Bundler</code>, <code>LambdaFunctionCodeBundle</code>, <code>LambdaFunctionCodeBundler</code> and their options</td>
|
|
245
|
-
</tr>
|
|
246
|
-
<tr>
|
|
247
|
-
<td><code>@nikovirtala/projen-lambda-function-construct-generator</code></td>
|
|
248
|
-
<td><code>LambdaFunctionConstructGenerator</code>, <code>LambdaFunctionConstructGeneratorOptions</code></td>
|
|
249
|
-
</tr>
|
|
250
|
-
<tr>
|
|
251
|
-
<td><code>@nikovirtala/projen-aws-cdk-app</code></td>
|
|
252
|
-
<td><code>AwsCdkTypeScriptAppProject</code>, <code>AwsCdkTypeScriptAppProjectOptions</code></td>
|
|
253
|
-
</tr>
|
|
254
|
-
</tbody>
|
|
255
|
-
</table>
|
|
256
|
-
<h3 id="steps" class="tsd-anchor-link">Steps<a href="#steps" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
257
|
-
<ol>
|
|
258
|
-
<li>
|
|
259
|
-
<p>In <code>.projenrc.ts</code>, replace the old package in <code>devDeps</code> with <code>@nikovirtala/projen-constructs</code>, and
|
|
260
|
-
change the imports:</p>
|
|
261
|
-
<pre><code class="typescript"><span class="hl-8">// before</span><br/><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Vitest</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-vitest"</span><span class="hl-1">;</span><br/><span class="hl-8">// after</span><br/><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">Vitest</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span>
|
|
107
|
+
<h2 id="usage" class="tsd-anchor-link">Usage<a href="#usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
108
|
+
<p>Each project type applies the standard configuration and the shared components. See
|
|
109
|
+
<a href="media/configuration.md">Configuration</a> for the defaults and how to override them, and
|
|
110
|
+
<a href="media/components.md">Components</a> for the component reference.</p>
|
|
111
|
+
<h3 id="aws-cdk-construct-library-project" class="tsd-anchor-link">AWS CDK construct library project<a href="#aws-cdk-construct-library-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
112
|
+
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkConstructLibraryProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkConstructLibraryProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-cdk-construct"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">author:</span><span class="hl-1"> </span><span class="hl-2">"Your Name"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">authorAddress:</span><span class="hl-1"> </span><span class="hl-2">"you@example.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-cdk-construct.git"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">cdkVersion:</span><span class="hl-1"> </span><span class="hl-2">"2.275.0"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
262
113
|
</code><button type="button">Copy</button></pre>
|
|
263
114
|
|
|
264
|
-
|
|
265
|
-
<
|
|
266
|
-
<p>Check the peer dependencies. <code>@nikovirtala/projen-constructs</code> needs <code>projen</code> ^0.104.23, <code>constructs</code>
|
|
267
|
-
^10 and <code>@mrgrain/cdk-esbuild</code> ^5. The standalone packages accepted older projen versions, so you
|
|
268
|
-
may have to upgrade projen in the same change.</p>
|
|
269
|
-
</li>
|
|
270
|
-
<li>
|
|
271
|
-
<p>Install the new package, run <code>npx projen</code> and review the changes to the generated files.</p>
|
|
272
|
-
</li>
|
|
273
|
-
</ol>
|
|
274
|
-
<h3 id="changes-to-expect" class="tsd-anchor-link">Changes to expect<a href="#changes-to-expect" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
275
|
-
<p>These are the differences in behaviour or generated files between the standalone packages and this
|
|
276
|
-
library.</p>
|
|
277
|
-
<p><strong>Vitest</strong></p>
|
|
278
|
-
<ul>
|
|
279
|
-
<li><code>vitest.config.ts</code> imports <code>defineConfig</code> from
|
|
280
|
-
<code>@nikovirtala/projen-constructs/lib/vitest-define-config</code> instead of
|
|
281
|
-
<code>@nikovirtala/projen-vitest/lib/bundled-define-config</code>. Projen rewrites the file, so there's
|
|
282
|
-
nothing to change by hand.</li>
|
|
283
|
-
<li>The config is rendered as JSON, so its keys are quoted. The settings are the same.</li>
|
|
284
|
-
<li><code>config.typecheckTsconfig</code> defaults to the project's development tsconfig (<code>test/tsconfig.json</code>
|
|
285
|
-
in current projen) instead of <code>tsconfig.dev.json</code>.</li>
|
|
286
|
-
<li>JSII and construct library projects exclude <code>vitest.config.ts</code> from the published package.</li>
|
|
287
|
-
<li>New: <code>extraTestConfig</code> and <code>extraConfig</code> for Vitest settings that <code>config</code> doesn't cover.</li>
|
|
288
|
-
</ul>
|
|
289
|
-
<p><strong>Homebrew and Colima</strong></p>
|
|
290
|
-
<ul>
|
|
291
|
-
<li>Packages from a tap (<code>owner/tap/formula</code>) also add a <code>tap</code> line to the <code>Brewfile</code>, and the
|
|
292
|
-
<code>Brewfile</code> is sorted.</li>
|
|
293
|
-
<li>The <code>install:homebrew</code>, <code>homebrew:bundle</code> and <code>colima</code> tasks run in bash. <code>homebrew:bundle</code> also
|
|
294
|
-
finds a freshly installed <code>brew</code> that isn't on the <code>PATH</code> yet.</li>
|
|
295
|
-
</ul>
|
|
296
|
-
<p><strong>LocalStack</strong></p>
|
|
297
|
-
<ul>
|
|
298
|
-
<li><code>imageTag</code> is applied: LocalStack starts with <code>localstack/localstack:<imageTag></code>. It used to be
|
|
299
|
-
ignored.</li>
|
|
300
|
-
</ul>
|
|
301
|
-
<p><strong>Bundler / LambdaFunctionCodeBundler</strong></p>
|
|
302
|
-
<ul>
|
|
303
|
-
<li><code>LambdaFunctionCodeBundler.bundleOptions</code> applies to every discovered entrypoint. Its <code>entrypoint</code>
|
|
304
|
-
used to replace them all.</li>
|
|
305
|
-
</ul>
|
|
306
|
-
<p><strong>LambdaFunctionConstructGenerator</strong></p>
|
|
307
|
-
<ul>
|
|
308
|
-
<li>The bundle task runs <code>tsx</code> with the project's development tsconfig instead of <code>tsconfig.dev.json</code>.</li>
|
|
309
|
-
</ul>
|
|
310
|
-
<p><strong>TypeDoc</strong>: no changes.</p>
|
|
311
|
-
<h3 id="from-to" class="tsd-anchor-link">From <code>AwsCdkApp</code> to <code>AwsCdkTypeScriptAppProject</code><a href="#from-to" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
312
|
-
<pre><code class="typescript"><span class="hl-8">// before</span><br/><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkApp</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-aws-cdk-app"</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkApp</span><span class="hl-1">({ </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-app"</span><span class="hl-1">, </span><span class="hl-5">cdkVersion:</span><span class="hl-1"> </span><span class="hl-2">"2.221.0"</span><span class="hl-1"> });</span><br/><br/><span class="hl-8">// after</span><br/><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkTypeScriptAppProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkTypeScriptAppProject</span><span class="hl-1">({ </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-app"</span><span class="hl-1">, </span><span class="hl-5">cdkVersion:</span><span class="hl-1"> </span><span class="hl-2">"2.221.0"</span><span class="hl-1"> });</span>
|
|
115
|
+
<h3 id="aws-cdk-typescript-app-project" class="tsd-anchor-link">AWS CDK TypeScript app project<a href="#aws-cdk-typescript-app-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
116
|
+
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">AwsCdkTypeScriptAppProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">AwsCdkTypeScriptAppProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-cdk-app"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repository:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-cdk-app.git"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">cdkVersion:</span><span class="hl-1"> </span><span class="hl-2">"2.275.0"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
313
117
|
</code><button type="button">Copy</button></pre>
|
|
314
118
|
|
|
315
|
-
<
|
|
316
|
-
<
|
|
317
|
-
<li>
|
|
318
|
-
<p><strong>Native TypeScript</strong>: <code>.projenrc.ts</code> and the app run with <code>node</code> instead of <code>tsx</code>, and the
|
|
319
|
-
tsconfig sets <code>erasableSyntaxOnly</code> and <code>verbatimModuleSyntax</code> (see <a href="#native-typescript">Native TypeScript</a>).</p>
|
|
320
|
-
</li>
|
|
321
|
-
<li>
|
|
322
|
-
<p><strong><code>nvm</code> is removed.</strong> Use mise (on by default), which pins the Node.js version in <code>mise.toml</code>.</p>
|
|
323
|
-
</li>
|
|
324
|
-
<li>
|
|
325
|
-
<p><strong>Homebrew is on by default.</strong> The project gets a <code>Brewfile</code>, and <code>npx projen</code> runs
|
|
326
|
-
<code>install:homebrew</code> (installs Homebrew if <code>brew</code> is missing) and <code>homebrew:bundle</code>. Set
|
|
327
|
-
<code>homebrew: false</code> to turn it off.</p>
|
|
328
|
-
</li>
|
|
329
|
-
<li>
|
|
330
|
-
<p><strong>cdk.json <code>app</code></strong> is <code>node src/main.ts</code> instead of <code>tsx --tsconfig tsconfig.json src/main.ts</code>.</p>
|
|
331
|
-
</li>
|
|
332
|
-
<li>
|
|
333
|
-
<p><strong>Defaults</strong> come from this library: Node.js, TypeScript, CDK and pnpm versions (pnpm 12 instead
|
|
334
|
-
of 10), Dependabot off, auto-merge on, <code>auto-approve</code> and <code>auto-merge</code> labels on dependency
|
|
335
|
-
upgrade PRs, and auto-approval of PRs by <code>nikovirtala</code>. Any option you set explicitly still wins,
|
|
336
|
-
so set <code>autoApproveOptions</code> if you aren't <code>nikovirtala</code>.</p>
|
|
337
|
-
</li>
|
|
338
|
-
<li>
|
|
339
|
-
<p><strong>tsconfig</strong>: <code>noImplicitOverride</code> and <code>allowSyntheticDefaultImports</code> move from <code>tsconfig.json</code>
|
|
340
|
-
to the development tsconfig (<code>test/tsconfig.json</code>).</p>
|
|
341
|
-
</li>
|
|
342
|
-
<li>
|
|
343
|
-
<p><strong>Options removed from the interface</strong>: <code>eslint</code>, <code>jest</code>, <code>prettier</code> (and their options),
|
|
344
|
-
<code>sampleCode</code> and <code>tsJestOptions</code>.</p>
|
|
345
|
-
</li>
|
|
346
|
-
<li>
|
|
347
|
-
<p><code>vitestOptions</code> takes the <code>VitestOptions</code> of this library, and now also <code>homebrewOptions</code> and
|
|
348
|
-
<code>miseOptions</code>.</p>
|
|
349
|
-
</li>
|
|
350
|
-
</ul>
|
|
351
|
-
<h2 id="development" class="tsd-anchor-link">Development<a href="#development" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
352
|
-
<p>This project is managed by Projen and generates itself: <code>.projenrc.ts</code> defines the project using the
|
|
353
|
-
<code>JsiiProject</code> type from <code>src/</code>. Configuration changes belong in <code>.projenrc.ts</code>, never in the
|
|
354
|
-
generated files.</p>
|
|
355
|
-
<pre><code class="bash"><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">projen</span><span class="hl-1"> </span><span class="hl-8"># synthesize project files</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">build</span><span class="hl-1"> </span><span class="hl-8"># synthesize, compile, test and package</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">test</span><span class="hl-1"> </span><span class="hl-8"># biome, vitest, typedoc</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">test:watch</span><span class="hl-1"> </span><span class="hl-8"># vitest in watch mode</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">test:update</span><span class="hl-1"> </span><span class="hl-8"># update snapshots</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">biome</span><span class="hl-1"> </span><span class="hl-8"># format and lint</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">docgen</span><span class="hl-1"> </span><span class="hl-8"># regenerate API.md from the .jsii manifest</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">update-versions</span><span class="hl-1"> </span><span class="hl-8"># refresh src/versions.json</span><br/><span class="hl-0">pnpm</span><span class="hl-1"> </span><span class="hl-2">upgrade</span><span class="hl-1"> </span><span class="hl-8"># upgrade dependencies</span>
|
|
119
|
+
<h3 id="jsii-project" class="tsd-anchor-link">JSII project<a href="#jsii-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
120
|
+
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">JsiiProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">JsiiProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-jsii-project"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">author:</span><span class="hl-1"> </span><span class="hl-2">"Your Name"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">authorAddress:</span><span class="hl-1"> </span><span class="hl-2">"you@example.com"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repositoryUrl:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-jsii-project.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
356
121
|
</code><button type="button">Copy</button></pre>
|
|
357
122
|
|
|
358
|
-
<h3 id="
|
|
359
|
-
<pre><code class="
|
|
360
|
-
projenrc[".projenrc.ts"]
|
|
361
|
-
|
|
362
|
-
subgraph synthesize["default (synthesize)"]
|
|
363
|
-
direction TB
|
|
364
|
-
synth["tsx .projenrc.ts"]
|
|
365
|
-
generator["ProjectGenerator"]
|
|
366
|
-
generated["src/project-type.ts<br/>src/projects/*.generated.ts<br/>src/projects/*-options.generated.ts"]
|
|
367
|
-
projenfiles["package.json, tsconfig.json,<br/>pnpm-workspace.yaml, workflows, ..."]
|
|
368
|
-
brew["install:homebrew<br/>brew bundle"]
|
|
369
|
-
definecfg["bundle-vitest-define-config<br/>esbuild → lib/vitest-define-config.js"]
|
|
370
|
-
|
|
371
|
-
synth --> generator --> generated
|
|
372
|
-
synth --> projenfiles
|
|
373
|
-
synth --> brew
|
|
374
|
-
synth --> definecfg
|
|
375
|
-
end
|
|
376
|
-
|
|
377
|
-
subgraph compile["compile"]
|
|
378
|
-
direction TB
|
|
379
|
-
jsii["jsii<br/>validates tsconfig.json against the strict rule set"]
|
|
380
|
-
lib["lib/**"]
|
|
381
|
-
manifest[".jsii manifest"]
|
|
382
|
-
|
|
383
|
-
jsii --> lib
|
|
384
|
-
jsii --> manifest
|
|
385
|
-
end
|
|
386
|
-
|
|
387
|
-
subgraph test["test"]
|
|
388
|
-
direction TB
|
|
389
|
-
biome["biome check --write"]
|
|
390
|
-
vitest["vitest run<br/>+ type checking"]
|
|
391
|
-
typedoc["typedoc → docs/api"]
|
|
392
|
-
|
|
393
|
-
biome --> vitest --> typedoc
|
|
394
|
-
end
|
|
395
|
-
|
|
396
|
-
subgraph package["package"]
|
|
397
|
-
direction TB
|
|
398
|
-
pacmak["jsii-pacmak<br/>--pack-command 'pnpm pack'"]
|
|
399
|
-
dist["dist/js/*.tgz"]
|
|
400
|
-
|
|
401
|
-
pacmak --> dist
|
|
402
|
-
end
|
|
403
|
-
|
|
404
|
-
projenrc --> synthesize
|
|
405
|
-
synthesize --> compile
|
|
406
|
-
compile --> test
|
|
407
|
-
test --> package
|
|
408
|
-
|
|
409
|
-
manifest -. "component options FQNs<br/>read on the next synthesis" .-> generator
|
|
410
|
-
docgen["docgen<br/>jsii-docgen → API.md"]
|
|
411
|
-
manifest --> docgen
|
|
412
|
-
|
|
413
|
-
classDef artifact fill:#eef,stroke:#88a
|
|
414
|
-
class generated,projenfiles,lib,manifest,dist artifact
|
|
123
|
+
<h3 id="typescript-project" class="tsd-anchor-link">TypeScript project<a href="#typescript-project" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h3>
|
|
124
|
+
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">TypeScriptProject</span><span class="hl-1"> } </span><span class="hl-4">from</span><span class="hl-1"> </span><span class="hl-2">"@nikovirtala/projen-constructs"</span><span class="hl-1">;</span><br/><br/><span class="hl-3">const</span><span class="hl-1"> </span><span class="hl-6">project</span><span class="hl-1"> = </span><span class="hl-3">new</span><span class="hl-1"> </span><span class="hl-0">TypeScriptProject</span><span class="hl-1">({</span><br/><span class="hl-1"> </span><span class="hl-5">name:</span><span class="hl-1"> </span><span class="hl-2">"my-typescript-project"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">repository:</span><span class="hl-1"> </span><span class="hl-2">"https://github.com/nikovirtala/my-typescript-project.git"</span><span class="hl-1">,</span><br/><span class="hl-1">});</span><br/><br/><span class="hl-5">project</span><span class="hl-1">.</span><span class="hl-0">synth</span><span class="hl-1">();</span>
|
|
415
125
|
</code><button type="button">Copy</button></pre>
|
|
416
126
|
|
|
417
|
-
<
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
then synthesize again.</p>
|
|
423
|
-
<p><code>package</code> runs <code>package:js</code> on CI and <code>package-all</code> locally; both end up in <code>jsii-pacmak</code>.
|
|
424
|
-
<code>docgen</code> is not part of <code>build</code> and has to be run explicitly after the manifest changes.</p>
|
|
127
|
+
<h2 id="contributing" class="tsd-anchor-link">Contributing<a href="#contributing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
128
|
+
<p>See <a href="media/development.md">Development</a> for the commands and the build process. Configuration
|
|
129
|
+
changes belong in <code>.projenrc.ts</code>, never in the generated files.</p>
|
|
130
|
+
<h2 id="license" class="tsd-anchor-link">License<a href="#license" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="assets/icons.svg#icon-anchor"></use></svg></a></h2>
|
|
131
|
+
<p>Apache-2.0. See <a href="media/LICENSE">LICENSE</a>.</p>
|
|
425
132
|
</div></div>
|
|
426
133
|
<div class="col-sidebar">
|
|
427
134
|
<div class="page-menu">
|
|
@@ -439,47 +146,21 @@ then synthesize again.</p>
|
|
|
439
146
|
<h3>On This Page</h3></summary>
|
|
440
147
|
<div class="tsd-accordion-details"><a href="#nikovirtalaprojen-constructs"><span>@nikovirtala/projen-<wbr/>constructs</span></a>
|
|
441
148
|
<ul>
|
|
442
|
-
<li><a href="#
|
|
149
|
+
<li><a href="#why-this-exists"><span>Why this exists</span></a></li>
|
|
150
|
+
<li><a href="#when-not-to-use-this"><span>When not to use this</span></a></li>
|
|
151
|
+
<li><a href="#status-and-supported-versions"><span>Status and supported versions</span></a></li>
|
|
152
|
+
<li><a href="#documentation"><span>Documentation</span></a></li>
|
|
153
|
+
<li><a href="#quick-start"><span>Quick start</span></a></li>
|
|
443
154
|
<li><a href="#features"><span>Features</span></a></li>
|
|
444
|
-
<li><a href="#standard-configuration"><span>Standard <wbr/>Configuration</span></a></li>
|
|
445
|
-
<li>
|
|
446
|
-
<ul>
|
|
447
|
-
<li><a href="#pnpm"><span>pnpm</span></a></li>
|
|
448
|
-
<li><a href="#typescript-configuration"><span>Type<wbr/>Script configuration</span></a></li>
|
|
449
|
-
<li><a href="#native-typescript"><span>Native <wbr/>Type<wbr/>Script</span></a></li></ul></li>
|
|
450
|
-
<li><a href="#customization"><span>Customization</span></a></li>
|
|
451
155
|
<li><a href="#usage"><span>Usage</span></a></li>
|
|
452
156
|
<li>
|
|
453
157
|
<ul>
|
|
454
|
-
<li><a href="#
|
|
455
|
-
<li>
|
|
456
|
-
<
|
|
457
|
-
<li><a href="#
|
|
458
|
-
<li><a href="#
|
|
459
|
-
<li><a href="#
|
|
460
|
-
<li><a href="#typescript-project"><span>Type<wbr/>Script <wbr/>Project</span></a></li></ul></li>
|
|
461
|
-
<li><a href="#components"><span>Components</span></a></li>
|
|
462
|
-
<li>
|
|
463
|
-
<ul>
|
|
464
|
-
<li><a href="#vitest"><span>Vitest</span></a></li>
|
|
465
|
-
<li><a href="#typedoc"><span>Type<wbr/>Doc</span></a></li>
|
|
466
|
-
<li><a href="#mise"><span>Mise</span></a></li>
|
|
467
|
-
<li><a href="#homebrew"><span>Homebrew</span></a></li>
|
|
468
|
-
<li><a href="#colima"><span>Colima</span></a></li>
|
|
469
|
-
<li><a href="#localstack"><span>Local<wbr/>Stack</span></a></li>
|
|
470
|
-
<li><a href="#lambdafunctionconstructgenerator"><span>Lambda<wbr/>Function<wbr/>Construct<wbr/>Generator</span></a></li>
|
|
471
|
-
<li><a href="#bundler"><span>Bundler</span></a></li>
|
|
472
|
-
<li><a href="#projectgenerator"><span>Project<wbr/>Generator</span></a></li></ul></li></ul></li>
|
|
473
|
-
<li><a href="#migrating-from-the-standalone-packages"><span>Migrating from the standalone packages</span></a></li>
|
|
474
|
-
<li>
|
|
475
|
-
<ul>
|
|
476
|
-
<li><a href="#steps"><span>Steps</span></a></li>
|
|
477
|
-
<li><a href="#changes-to-expect"><span>Changes to expect</span></a></li>
|
|
478
|
-
<li><a href="#from-to"><span>From to </span></a></li></ul></li>
|
|
479
|
-
<li><a href="#development"><span>Development</span></a></li>
|
|
480
|
-
<li>
|
|
481
|
-
<ul>
|
|
482
|
-
<li><a href="#build-process"><span>Build process</span></a></li></ul></li></ul></div></details></div>
|
|
158
|
+
<li><a href="#aws-cdk-construct-library-project"><span>AWS <wbr/>CDK construct library project</span></a></li>
|
|
159
|
+
<li><a href="#aws-cdk-typescript-app-project"><span>AWS <wbr/>CDK <wbr/>Type<wbr/>Script app project</span></a></li>
|
|
160
|
+
<li><a href="#jsii-project"><span>JSII project</span></a></li>
|
|
161
|
+
<li><a href="#typescript-project"><span>Type<wbr/>Script project</span></a></li></ul></li>
|
|
162
|
+
<li><a href="#contributing"><span>Contributing</span></a></li>
|
|
163
|
+
<li><a href="#license"><span>License</span></a></li></ul></div></details></div>
|
|
483
164
|
<div class="site-menu">
|
|
484
165
|
<nav class="tsd-navigation"><a href="modules.html">@nikovirtala/projen-constructs</a>
|
|
485
166
|
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|