demo-this-pr 0.1.1 → 0.1.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/README.md +3 -3
- package/dist/cli.js +7 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://cdn.jsdelivr.net/npm/demo-this-pr@0.1.
|
|
2
|
+
<img src="https://cdn.jsdelivr.net/npm/demo-this-pr@0.1.2/assets/demo-this-pr-logo.svg" alt="DEMO THIS PR animated wordmark" width="920">
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
# demo-this-pr
|
|
@@ -70,7 +70,7 @@ For CI or agent runners, prefer a pinned package version and a deterministic
|
|
|
70
70
|
artifact directory:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
npx demo-this-pr@0.1.
|
|
73
|
+
npx demo-this-pr@0.1.2 ci
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
The command exits non-zero when Git context or a reachable local app is missing.
|
|
@@ -213,7 +213,7 @@ Jenkins example:
|
|
|
213
213
|
stage('PR demo') {
|
|
214
214
|
steps {
|
|
215
215
|
sh 'npm ci'
|
|
216
|
-
sh 'npx demo-this-pr@0.1.
|
|
216
|
+
sh 'npx demo-this-pr@0.1.2 ci'
|
|
217
217
|
}
|
|
218
218
|
post {
|
|
219
219
|
always {
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import pc from "picocolors";
|
|
5
6
|
import { resolveAutoDemo } from "./auto.js";
|
|
@@ -8,10 +9,11 @@ import { parseDemoStep } from "./demoPlan.js";
|
|
|
8
9
|
import { defaultRunOutputDir } from "./runs.js";
|
|
9
10
|
import { openReportViewer } from "./viewer.js";
|
|
10
11
|
const program = new Command();
|
|
12
|
+
const packageVersion = readPackageVersion();
|
|
11
13
|
program
|
|
12
14
|
.name("demo-this-pr")
|
|
13
15
|
.description("Generate reviewable PR demos from current unpushed changes.")
|
|
14
|
-
.version(
|
|
16
|
+
.version(packageVersion)
|
|
15
17
|
.argument("[repo]", "repository path; defaults to the current working directory")
|
|
16
18
|
.option("--cwd <path>", "repository path; useful when running from outside the target repo")
|
|
17
19
|
.option("--headless", "run Chromium without a visible window", false)
|
|
@@ -199,3 +201,7 @@ function printResult(result, label, notes) {
|
|
|
199
201
|
function collect(value, previous) {
|
|
200
202
|
return [...previous, value];
|
|
201
203
|
}
|
|
204
|
+
function readPackageVersion() {
|
|
205
|
+
const packageJson = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
206
|
+
return packageJson.version ?? "0.0.0";
|
|
207
|
+
}
|
package/package.json
CHANGED