@nikovirtala/projen-constructs 0.5.1 → 0.5.3
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/AGENTS.md +41 -0
- package/CHANGELOG.md +43 -0
- package/CONTRIBUTING.md +66 -0
- package/README.md +105 -475
- package/SECURITY.md +29 -0
- package/docs/api/assets/highlight.css +8 -8
- package/docs/api/functions/renderBundleName.html +1 -1
- package/docs/api/index.html +116 -402
- 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 +202 -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,156 @@
|
|
|
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>
|
|
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>
|
|
35
32
|
</ul>
|
|
36
|
-
<h2 id="
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
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>
|
|
45
|
-
</ul>
|
|
46
|
-
<p>The AWS CDK, Node.js and TypeScript versions live in <code>src/versions.json</code> and are refreshed by the
|
|
47
|
-
<code>update-versions</code> task, which the dependency upgrade workflow runs.</p>
|
|
48
|
-
<h3 id="pnpm" class="tsd-anchor-link">pnpm<a href="#pnpm" 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>
|
|
49
|
-
<p>pnpm reads its settings from <code>pnpm-workspace.yaml</code>, not <code>.npmrc</code>, since pnpm 11. Generated projects
|
|
50
|
-
get:</p>
|
|
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
|
-
|
|
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>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
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>
|
|
64
53
|
</tr>
|
|
65
54
|
<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>
|
|
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>
|
|
69
57
|
</tr>
|
|
70
58
|
<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>
|
|
59
|
+
<td><a href="media/development.md">Development</a></td>
|
|
60
|
+
<td>Development commands and the build process diagram</td>
|
|
74
61
|
</tr>
|
|
75
62
|
<tr>
|
|
76
|
-
<td><
|
|
77
|
-
<td
|
|
78
|
-
<td>the pnpm 11 default of 1440 minutes makes pnpm write <code>minimumReleaseAgeExclude</code> entries into this generated file</td>
|
|
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
|
-
|
|
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>
|
|
184
|
-
</code><button type="button">Copy</button></pre>
|
|
185
|
-
|
|
186
|
-
<h4 id="lambdafunctionconstructgenerator" class="tsd-anchor-link">LambdaFunctionConstructGenerator<a href="#lambdafunctionconstructgenerator" 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>
|
|
187
|
-
<p>Generates AWS CDK Lambda Function constructs and bundles their code.</p>
|
|
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>
|
|
189
|
-
</code><button type="button">Copy</button></pre>
|
|
190
|
-
|
|
191
|
-
<h4 id="bundler" class="tsd-anchor-link">Bundler<a href="#bundler" 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>
|
|
192
|
-
<p>Low-level bundling utilities for Lambda functions.</p>
|
|
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>
|
|
194
|
-
</code><button type="button">Copy</button></pre>
|
|
195
|
-
|
|
196
|
-
<h4 id="projectgenerator" class="tsd-anchor-link">ProjectGenerator<a href="#projectgenerator" 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>
|
|
197
|
-
<p>Generates TypeScript project classes with standard configuration.</p>
|
|
198
|
-
<pre><code class="typescript"><span class="hl-4">import</span><span class="hl-1"> { </span><span class="hl-5">ProjectGenerator</span><span class="hl-1">, </span><span class="hl-5">ProjectType</span><span class="hl-1">, </span><span class="hl-5">Mise</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">ProjectGenerator</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">name:</span><span class="hl-1"> </span><span class="hl-2">"TypeScriptProject"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">projectType:</span><span class="hl-1"> </span><span class="hl-5">ProjectType</span><span class="hl-1">.</span><span class="hl-6">TYPE_SCRIPT_PROJECT</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">filePath:</span><span class="hl-1"> </span><span class="hl-2">"./src/projects/typescript.generated.ts"</span><span class="hl-1">,</span><br/><span class="hl-1"> </span><span class="hl-5">components:</span><span class="hl-1"> [</span><br/><span class="hl-1"> { </span><span class="hl-5">componentClass:</span><span class="hl-1"> </span><span class="hl-5">Mise</span><span class="hl-1"> },</span><br/><span class="hl-1"> { </span><span class="hl-5">componentClass:</span><span class="hl-1"> </span><span class="hl-5">Vitest</span><span class="hl-1"> }, </span><span class="hl-8">// Auto-detects VitestOptions from JSII manifest</span><br/><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>To start a new project from scratch, run <code>projen new --from</code> in an empty directory. It installs the
|
|
71
|
+
library and writes a ready-to-use <code>.projenrc.ts</code> and the full project for you, with no manual setup:</p>
|
|
72
|
+
<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
73
|
</code><button type="button">Copy</button></pre>
|
|
200
74
|
|
|
201
|
-
<p>
|
|
202
|
-
<
|
|
203
|
-
<
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
render into a generated <code>.projenrc.ts</code> as the package manager that ran the command</li>
|
|
207
|
-
<li>Validates paths to prevent directory traversal attacks</li>
|
|
208
|
-
<li>Structured error handling with custom error classes</li>
|
|
209
|
-
</ul>
|
|
210
|
-
<h2 id="migrating-from-the-standalone-packages" class="tsd-anchor-link">Migrating from the standalone packages<a href="#migrating-from-the-standalone-packages" 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>
|
|
211
|
-
<p>The components used to be published as separate packages. Those packages are deprecated and won't
|
|
212
|
-
get new features or fixes. Every class, interface, enum and function they exported is exported from
|
|
213
|
-
<code>@nikovirtala/projen-constructs</code> under the same name, except <code>AwsCdkApp</code> (see below).</p>
|
|
75
|
+
<p><strong>Expected output</strong>: projen installs <code>@nikovirtala/projen-constructs</code> and its peers, writes a
|
|
76
|
+
<code>.projenrc.ts</code> that defines the project, and synthesizes the generated files into the directory:
|
|
77
|
+
<code>package.json</code>, <code>tsconfig.json</code>, <code>pnpm-workspace.yaml</code>, the GitHub Actions workflows, the Vitest and
|
|
78
|
+
Biome configuration, <code>mise.toml</code>, and the source and test scaffolding for your construct library.</p>
|
|
79
|
+
<p>Pass a different project type to scaffold one of the others this library provides:</p>
|
|
214
80
|
<table>
|
|
215
81
|
<thead>
|
|
216
82
|
<tr>
|
|
217
|
-
<th>
|
|
218
|
-
<th>
|
|
83
|
+
<th>Project type</th>
|
|
84
|
+
<th><code>projen new --from</code> argument</th>
|
|
219
85
|
</tr>
|
|
220
86
|
</thead>
|
|
221
87
|
<tbody>
|
|
222
88
|
<tr>
|
|
223
|
-
<td
|
|
224
|
-
<td><code>
|
|
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>
|
|
89
|
+
<td>AWS CDK construct library</td>
|
|
90
|
+
<td><code>aws_cdk_construct_library</code></td>
|
|
233
91
|
</tr>
|
|
234
92
|
<tr>
|
|
235
|
-
<td
|
|
236
|
-
<td><code>
|
|
93
|
+
<td>AWS CDK TypeScript app</td>
|
|
94
|
+
<td><code>aws_cdk_type_script_app</code></td>
|
|
237
95
|
</tr>
|
|
238
96
|
<tr>
|
|
239
|
-
<td
|
|
240
|
-
<td><code>
|
|
97
|
+
<td>JSII</td>
|
|
98
|
+
<td><code>jsii_project</code></td>
|
|
241
99
|
</tr>
|
|
242
100
|
<tr>
|
|
243
|
-
<td
|
|
244
|
-
<td><code>
|
|
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>
|
|
101
|
+
<td>TypeScript</td>
|
|
102
|
+
<td><code>type_script_project</code></td>
|
|
253
103
|
</tr>
|
|
254
104
|
</tbody>
|
|
255
105
|
</table>
|
|
256
|
-
<h3 id="
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
<
|
|
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>
|
|
106
|
+
<h3 id="adding-it-to-an-existing-project" class="tsd-anchor-link">Adding it to an existing project<a href="#adding-it-to-an-existing-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>
|
|
107
|
+
<p>If you already have a <code>.projenrc.ts</code>, install the library alongside its <code>projen</code> and <code>constructs</code>
|
|
108
|
+
peers instead:</p>
|
|
109
|
+
<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>
|
|
262
110
|
</code><button type="button">Copy</button></pre>
|
|
263
111
|
|
|
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>
|
|
112
|
+
<p>Then define a project in <code>.projenrc.ts</code>:</p>
|
|
113
|
+
<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>
|
|
313
114
|
</code><button type="button">Copy</button></pre>
|
|
314
115
|
|
|
315
|
-
<p>
|
|
116
|
+
<p>Run synthesis to write or update the generated files:</p>
|
|
117
|
+
<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>
|
|
118
|
+
</code><button type="button">Copy</button></pre>
|
|
119
|
+
|
|
120
|
+
<p>Re-running <code>projen</code> after you edit <code>.projenrc.ts</code> updates those files in place.</p>
|
|
121
|
+
<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>
|
|
316
122
|
<ul>
|
|
317
|
-
<li>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
</li>
|
|
321
|
-
<li>
|
|
322
|
-
|
|
323
|
-
</li>
|
|
324
|
-
<li>
|
|
325
|
-
<
|
|
326
|
-
<
|
|
327
|
-
<
|
|
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>
|
|
123
|
+
<li><strong>Standard configuration</strong>: opinionated defaults for author, release branch, package manager,
|
|
124
|
+
Node.js, TypeScript, and tooling</li>
|
|
125
|
+
<li><strong>Automatic project type discovery</strong>: generates the <code>ProjectType</code> enum from projen's JSII manifest
|
|
126
|
+
(<!-- generated:project-type-count-start -->21<!-- generated:project-type-count-end --> project types)</li>
|
|
127
|
+
<li><strong>Component system</strong>: reusable components (Vitest, TypeDoc, Mise, Homebrew, Colima, LocalStack,
|
|
128
|
+
Lambda bundling)</li>
|
|
129
|
+
<li><strong>Code generation</strong>: <code>ProjectGenerator</code> creates project classes with standard configuration</li>
|
|
130
|
+
<li><strong>ES modules</strong>: TypeScript and CDK app projects use ES modules (JSII uses CommonJS)</li>
|
|
131
|
+
<li><strong>Code quality</strong>: Biome for formatting and linting</li>
|
|
132
|
+
<li><strong>Testing</strong>: Vitest with coverage</li>
|
|
133
|
+
<li><strong>Auto-merge</strong>: enabled with auto-approve</li>
|
|
134
|
+
<li><strong>VSCode</strong>: recommended extensions and settings</li>
|
|
135
|
+
<li><strong>mise</strong>: Node version management</li>
|
|
350
136
|
</ul>
|
|
351
|
-
<h2 id="
|
|
352
|
-
<p>
|
|
353
|
-
<
|
|
354
|
-
|
|
355
|
-
<
|
|
137
|
+
<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>
|
|
138
|
+
<p>Each project type applies the standard configuration and the shared components. See
|
|
139
|
+
<a href="media/configuration.md">Configuration</a> for the defaults and how to override them, and
|
|
140
|
+
<a href="media/components.md">Components</a> for the component reference.</p>
|
|
141
|
+
<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>
|
|
142
|
+
<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>
|
|
356
143
|
</code><button type="button">Copy</button></pre>
|
|
357
144
|
|
|
358
|
-
<h3 id="
|
|
359
|
-
<pre><code class="
|
|
360
|
-
|
|
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
|
|
145
|
+
<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>
|
|
146
|
+
<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>
|
|
147
|
+
</code><button type="button">Copy</button></pre>
|
|
408
148
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
149
|
+
<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>
|
|
150
|
+
<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>
|
|
151
|
+
</code><button type="button">Copy</button></pre>
|
|
412
152
|
|
|
413
|
-
|
|
414
|
-
|
|
153
|
+
<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>
|
|
154
|
+
<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
155
|
</code><button type="button">Copy</button></pre>
|
|
416
156
|
|
|
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>
|
|
157
|
+
<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>
|
|
158
|
+
<p>See <a href="media/development.md">Development</a> for the commands and the build process. Configuration
|
|
159
|
+
changes belong in <code>.projenrc.ts</code>, never in the generated files.</p>
|
|
160
|
+
<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>
|
|
161
|
+
<p>Apache-2.0. See <a href="media/LICENSE">LICENSE</a>.</p>
|
|
425
162
|
</div></div>
|
|
426
163
|
<div class="col-sidebar">
|
|
427
164
|
<div class="page-menu">
|
|
@@ -439,47 +176,24 @@ then synthesize again.</p>
|
|
|
439
176
|
<h3>On This Page</h3></summary>
|
|
440
177
|
<div class="tsd-accordion-details"><a href="#nikovirtalaprojen-constructs"><span>@nikovirtala/projen-<wbr/>constructs</span></a>
|
|
441
178
|
<ul>
|
|
442
|
-
<li><a href="#
|
|
443
|
-
<li><a href="#
|
|
444
|
-
<li><a href="#
|
|
179
|
+
<li><a href="#why-this-exists"><span>Why this exists</span></a></li>
|
|
180
|
+
<li><a href="#when-not-to-use-this"><span>When not to use this</span></a></li>
|
|
181
|
+
<li><a href="#status-and-supported-versions"><span>Status and supported versions</span></a></li>
|
|
182
|
+
<li><a href="#documentation"><span>Documentation</span></a></li>
|
|
183
|
+
<li><a href="#quick-start"><span>Quick start</span></a></li>
|
|
445
184
|
<li>
|
|
446
185
|
<ul>
|
|
447
|
-
<li><a href="#
|
|
448
|
-
<li><a href="#
|
|
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>
|
|
186
|
+
<li><a href="#adding-it-to-an-existing-project"><span>Adding it to an existing project</span></a></li></ul></li>
|
|
187
|
+
<li><a href="#features"><span>Features</span></a></li>
|
|
451
188
|
<li><a href="#usage"><span>Usage</span></a></li>
|
|
452
189
|
<li>
|
|
453
190
|
<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>
|
|
191
|
+
<li><a href="#aws-cdk-construct-library-project"><span>AWS <wbr/>CDK construct library project</span></a></li>
|
|
192
|
+
<li><a href="#aws-cdk-typescript-app-project"><span>AWS <wbr/>CDK <wbr/>Type<wbr/>Script app project</span></a></li>
|
|
193
|
+
<li><a href="#jsii-project"><span>JSII project</span></a></li>
|
|
194
|
+
<li><a href="#typescript-project"><span>Type<wbr/>Script project</span></a></li></ul></li>
|
|
195
|
+
<li><a href="#contributing"><span>Contributing</span></a></li>
|
|
196
|
+
<li><a href="#license"><span>License</span></a></li></ul></div></details></div>
|
|
483
197
|
<div class="site-menu">
|
|
484
198
|
<nav class="tsd-navigation"><a href="modules.html">@nikovirtala/projen-constructs</a>
|
|
485
199
|
<ul class="tsd-small-nested-navigation" id="tsd-nav-container">
|