-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore-workflows.html
More file actions
405 lines (386 loc) · 22.7 KB
/
Copy pathcore-workflows.html
File metadata and controls
405 lines (386 loc) · 22.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport">
<title>NovaModuleTools — Core workflows for scaffold, build, test, import, and reload</title>
<meta content="Follow the normal NovaModuleTools workflow for scaffolding, building, testing, importing, and reloading PowerShell modules during day-to-day development."
name="description">
<meta content="index,follow,max-image-preview:large" name="robots">
<meta content="#0b1020" name="theme-color">
<link href="https://www.novamoduletools.com/core-workflows.html" rel="canonical">
<link href="./assets/icon.png" rel="icon" type="image/png">
<link href="./assets/icon.png" rel="apple-touch-icon">
<meta content="article" property="og:type">
<meta content="NovaModuleTools — Core workflows for scaffold, build, test, import, and reload" property="og:title">
<meta content="Use this guide for the normal NovaModuleTools lifecycle: scaffold a project, build the module, run tests, import the built output, and reload safely after changes."
property="og:description">
<meta content="https://www.novamoduletools.com/core-workflows.html" property="og:url">
<meta content="https://www.novamoduletools.com/assets/icon.png" property="og:image">
<meta content="summary" name="twitter:card">
<meta content="NovaModuleTools — Core workflows for scaffold, build, test, import, and reload" name="twitter:title">
<meta content="Use this guide for the normal NovaModuleTools lifecycle: scaffold a project, build the module, run tests, import the built output, and reload safely after changes."
name="twitter:description">
<link href="./assets/site.css" rel="stylesheet">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TechArticle",
"headline": "NovaModuleTools core workflows",
"description": "The daily scaffold, build, test, import, and reload workflow for NovaModuleTools.",
"url": "https://www.novamoduletools.com/core-workflows.html"
}
</script>
</head>
<body class="guide-page">
<header class="site-header">
<div class="site-header__inner">
<a class="site-brand" href="./index.html">
<img alt="" class="site-brand__icon" src="./assets/icon.png">
<span class="site-brand__text">NovaModuleTools</span>
</a>
<div aria-label="Command display mode" class="site-header__command-surface">
<div aria-label="Command display mode" class="surface-tabs" role="tablist">
<button aria-selected="true" class="surface-tabs__button" data-command-mode="powershell" role="tab"
type="button">PowerShell
</button>
<button aria-selected="false" class="surface-tabs__button" data-command-mode="command-line" role="tab"
type="button">Command-line
</button>
</div>
</div>
<div class="site-header__actions">
<details class="site-menu">
<summary class="site-menu__button">
<span class="site-menu__button-label">Menu</span>
<span class="site-menu__current">Core Workflows</span>
</summary>
<nav aria-label="Primary" class="site-menu__panel">
<a class="site-nav__link" href="./index.html">Home</a>
<a class="site-nav__link" href="./getting-started.html">Getting Started</a>
<a aria-current="page" class="site-nav__link site-nav__link--active" href="./core-workflows.html">Core
Workflows</a>
<a class="site-nav__link" href="./working-with-modules.html">Working with Modules</a>
<a class="site-nav__link" href="./project-json-reference.html">project.json Reference</a>
<a class="site-nav__link" href="./commands.html">Command Reference</a>
<a class="site-nav__link" href="./packaging-and-delivery.html">Packaging & Delivery</a>
<a class="site-nav__link" href="./versioning-and-updates.html">Versioning & Updates</a>
<a class="site-nav__link" href="./troubleshooting.html">Troubleshooting</a>
<a class="site-nav__link" href="./advanced.html">Concepts</a>
<a class="site-nav__link" href="./release-notes.html">Release Notes</a>
</nav>
</details>
</div>
</div>
</header>
<main class="page-shell">
<section class="guide-hero">
<p class="eyebrow">How-to Guides</p>
<h1>Use the normal Nova loop: scaffold → build → test → import → reload</h1>
<p class="lead">Most of your time with NovaModuleTools should stay in this loop. Once you are comfortable here,
packaging, upload, publish, and release become much easier to reason about.</p>
</section>
<section class="content-grid">
<aside class="toc-card">
<h2>On this page</h2>
<ul class="toc-list">
<li><a href="#scaffold">Create the project</a></li>
<li><a href="#build">Build the module</a></li>
<li><a href="#test">Run the tests</a></li>
<li><a href="#import">Import the built output</a></li>
<li><a href="#reload">Reload safely after changes</a></li>
<li><a href="#handoff">Move into packaging and release</a></li>
</ul>
</aside>
<div class="guide-content">
<section class="content-section" id="scaffold">
<h2>Create the project</h2>
<p>Nova supports two scaffold styles:</p>
<ul class="plain-list">
<li><strong>minimal scaffold</strong> for a clean new module</li>
<li><strong>example scaffold</strong> for a working sample you can inspect and adapt</li>
</ul>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Create either scaffold style</p>
<p class="surface-example__status">Showing: <span data-command-surface-label>PowerShell</span>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS> Initialize-NovaModule -Path ~/Work
PS> Initialize-NovaModule -Example -Path ~/Work</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova init --path ~/Work
% nova init --example --path ~/Work</code></pre>
</div>
</div>
<div class="notice" data-command-visibility="command-line" hidden>
<strong>CLI caveat:</strong>
<p>Use <code>% nova init --path ~/Work</code> or <code>% nova init -p ~/Work</code>, not positional
path syntax such as <code>% nova init ~/Work</code>.</p>
</div>
<p>Use the example scaffold when you want the shortest path to understanding a real project layout, test
suite, and package configuration. Use the minimal scaffold when you already know the structure you
want.</p>
</section>
<section class="content-section" id="build">
<h2>Build the module</h2>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Build the current project</p>
<p class="surface-example__status">Showing: <span data-command-surface-label>PowerShell</span>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS> Invoke-NovaBuild
PS> Invoke-NovaBuild -ContinuousIntegration</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova build
% nova build --continuous-integration</code></pre>
</div>
</div>
<p>The build step turns your project into a real PowerShell module under
<code>dist/<ProjectName></code>.</p>
<p>Use the continuous-integration form when the same CI/self-hosting session must keep using the freshly
built module after the build completes. Nova then re-imports the new <code>dist/</code> output
before
returning.</p>
<h3>What build includes</h3>
<ul class="plain-list">
<li>generated <code>.psm1</code> output</li>
<li>generated manifest</li>
<li>external help generation from the command-help markdown</li>
<li>resource copying</li>
<li>duplicate function validation when enabled</li>
</ul>
<p>If <code>SetSourcePath</code> is enabled, the generated module includes <code># Source:</code>
markers before each source block. If <code>Preamble</code> is configured, those lines are written at
the top of the generated module before the rest of the content.</p>
</section>
<section class="content-section" id="test">
<h2>Run the tests</h2>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Run the Nova test workflow</p>
<p class="surface-example__status">Showing: <span data-command-surface-label>PowerShell</span>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS> Test-NovaBuild
PS> Test-NovaBuild -Build
PS> Test-NovaBuild -TagFilter unit,fast
PS> Test-NovaBuild -ExcludeTagFilter slow
PS> Test-NovaBuild -OutputVerbosity Detailed -OutputRenderMode Ansi</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova test
% nova test --build
% nova test --what-if</code></pre>
</div>
</div>
<p><code>Test-NovaBuild</code> reads the Pester configuration from <code>project.json</code>, resolves
the test path, and writes results to <code>artifacts/TestResults.xml</code>.</p>
<p>Use <code>-Build</code>, <code>--build</code>, or <code>-b</code> when you want Nova to rebuild the
project before the test workflow starts.</p>
<p><strong>Important behavior:</strong> when <code>BuildRecursiveFolders</code> is <code>true</code>,
nested test files are discovered. When it is <code>false</code>, Nova stays closer to top-level
Pester-style discovery.</p>
<div class="surface-note" data-command-visibility="command-line" hidden>
<p><strong>Command-line note:</strong> the routed CLI covers the standard test flow, optional
build-before-test, and preview mode. Advanced test overrides such as <code>-TagFilter</code>,
<code>-ExcludeTagFilter</code>, <code>-OutputVerbosity</code>, and
<code>-OutputRenderMode</code> are PowerShell cmdlet parameters, so switch to the PowerShell
view when you need those controls.</p>
</div>
<p data-command-visibility="powershell">Use <code>-WhatIf</code> if you want to preview the test run and
output path without creating the
results directory or invoking Pester.</p>
<p data-command-visibility="command-line" hidden>Use <code>--what-if</code> if you want to preview the
test run and output path without creating the
results directory or invoking Pester.</p>
</section>
<section class="content-section" id="import">
<h2>Import the built output</h2>
<p>This is the recommended way to work with Nova-built modules during development:</p>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Import the built module from dist</p>
<p class="surface-example__status">Showing: <span data-command-surface-label>PowerShell</span>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS> $project = Get-NovaProjectInfo
PS> Import-Module $project.OutputModuleDir -Force</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>pwsh -NoLogo -Command 'Import-Module (Get-NovaProjectInfo).OutputModuleDir -Force; Get-Command -Module (Get-NovaProjectInfo).ProjectName'</code></pre>
</div>
</div>
<div class="surface-note" data-command-visibility="command-line" hidden>
<p><strong>Command-line note:</strong> importing built output still happens inside PowerShell. The
one-liner above starts a fresh <code>pwsh</code> process, imports from <code>dist/</code>, and
lists the exported commands so you can confirm the built module loads cleanly.</p>
</div>
<p>Importing from <code>dist/</code> keeps your runtime behavior aligned with what Nova will package and
publish later.</p>
</section>
<section class="content-section" id="reload">
<h2>Reload safely after changes</h2>
<p>When you edit source files, rebuild and reload the module instead of trusting the module already
loaded in memory:</p>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Refresh the module after source changes</p>
<p class="surface-example__status">Showing: <span data-command-surface-label>PowerShell</span>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS> $project = Get-NovaProjectInfo
PS> Remove-Module $project.ProjectName -ErrorAction SilentlyContinue
PS> Invoke-NovaBuild
PS> Import-Module $project.OutputModuleDir -Force</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova build
pwsh -NoLogo -Command 'Import-Module (Get-NovaProjectInfo).OutputModuleDir -Force; Get-Command -Module (Get-NovaProjectInfo).ProjectName'</code></pre>
</div>
</div>
<p>This avoids stale function definitions and stale resource loading.</p>
<div class="surface-note" data-command-visibility="command-line" hidden>
<p><strong>Command-line note:</strong> a fresh <code>pwsh -Command</code> process starts clean, so
you usually do not need an explicit <code>Remove-Module</code> step there. If you are iterating
inside a long-lived interactive PowerShell session, switch to the PowerShell view and do the
full remove/build/import loop.</p>
</div>
<div class="notice">
<strong>When local publish changes the story.</strong>
<p><code>PS> Publish-NovaModule -Local</code> and <code>% nova publish --local</code> reload the
published
module from the local install path after a successful publish. That is different from the normal
build/import loop, which works from <code>dist/</code>.</p>
</div>
<div class="notice">
<strong>CI/self-hosting note.</strong>
<p>When a later command in the same session must switch back to the built <code>dist/</code> module,
use <code>Invoke-NovaBuild -ContinuousIntegration</code> or <code>% nova build
--continuous-integration</code>
so Nova restores the built module state automatically.</p>
</div>
</section>
<section class="content-section" id="handoff">
<h2>Move into packaging and release when you are ready</h2>
<p>Once the build/test/import loop feels natural, the next question is usually one of these:</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>If you want to…</th>
<th>Go here next</th>
</tr>
</thead>
<tbody>
<tr>
<td>create package artifacts</td>
<td><a class="text-link" href="./packaging-and-delivery.html#pack">Packaging & Delivery
→ Create package artifacts</a></td>
</tr>
<tr>
<td>upload package files to a raw endpoint</td>
<td><a class="text-link" href="./packaging-and-delivery.html#upload">Packaging &
Delivery → Upload package artifacts</a></td>
</tr>
<tr>
<td>publish the module locally or to PowerShell Gallery</td>
<td><a class="text-link" href="./packaging-and-delivery.html#publish">Packaging &
Delivery → Publish to a PowerShell repository</a></td>
</tr>
<tr>
<td>run a full release workflow with version bumping</td>
<td><a class="text-link" href="./packaging-and-delivery.html#release">Packaging &
Delivery → Run the release workflow</a></td>
</tr>
<tr>
<td>tune the project configuration</td>
<td><a class="text-link" href="./project-json-reference.html">project.json Reference</a>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</section>
</main>
<footer class="footer">
<div class="footer__inner">
<h2>Master the daily loop first</h2>
<p>When build, test, import, and reload feel predictable, the rest of Nova starts to feel simple instead of
magical.</p>
<div class="hero__actions">
<a class="button button--primary" href="./working-with-modules.html">Open Working with Modules</a>
<a class="button button--secondary" href="./packaging-and-delivery.html">Open Packaging & Delivery</a>
</div>
<p class="footer__legal">Also available: <a class="legal-link" href="./project-json-reference.html">project.json
Reference</a>, <a class="legal-link" href="./release-notes.html">Release Notes</a>, and the <a
class="legal-link" href="./license.html">MIT License</a>.</p>
</div>
</footer>
<script>
(() => {
const storageKey = 'nova-doc-command-surface';
const supportedModes = ['powershell', 'command-line'];
function readStoredMode() {
try {
const stored = window.localStorage.getItem(storageKey);
return supportedModes.includes(stored) ? stored : 'powershell';
} catch {
return 'powershell';
}
}
function writeStoredMode(mode) {
try {
window.localStorage.setItem(storageKey, mode);
} catch {
// Ignore storage failures and keep the page interactive.
}
}
function getModeLabel(mode) {
return mode === 'command-line' ? 'Command-line' : 'PowerShell';
}
function applyMode(mode) {
document.querySelectorAll('[data-command-mode]').forEach((button) => {
const selected = button.dataset.commandMode === mode;
button.setAttribute('aria-selected', selected ? 'true' : 'false');
});
document.querySelectorAll('[data-command-example]').forEach((example) => {
example.querySelectorAll('[data-command-surface]').forEach((surface) => {
surface.hidden = surface.dataset.commandSurface !== mode;
});
});
document.querySelectorAll('[data-command-surface-label]').forEach((label) => {
label.textContent = getModeLabel(mode);
});
document.querySelectorAll('[data-command-visibility]').forEach((element) => {
element.hidden = element.dataset.commandVisibility !== mode;
});
}
document.addEventListener('DOMContentLoaded', () => {
const initialMode = readStoredMode();
applyMode(initialMode);
document.querySelectorAll('[data-command-mode]').forEach((button) => {
button.addEventListener('click', () => {
const nextMode = button.dataset.commandMode;
if (!supportedModes.includes(nextMode)) {
return;
}
applyMode(nextMode);
writeStoredMode(nextMode);
});
});
});
})();
</script>
</body>
</html>