demo-this-pr 0.1.0 → 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.
Files changed (3) hide show
  1. package/README.md +7 -5
  2. package/dist/cli.js +7 -1
  3. package/package.json +1 -16
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="./assets/demo-this-pr-logo.svg" alt="DEMO THIS PR animated wordmark" width="920">
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.0 ci
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.
@@ -95,11 +95,13 @@ Pre-publish checks:
95
95
 
96
96
  ```bash
97
97
  npm run publish:check
98
- npm publish
98
+ npm run publish:npm
99
99
  ```
100
100
 
101
101
  `npm run publish:check` builds the TypeScript output, runs tests, and verifies
102
- the package contents with `npm pack --dry-run`.
102
+ the package contents with `npm pack --dry-run`. `npm run publish:npm` publishes
103
+ from a generated staging directory so npm can use a registry-friendly README
104
+ without changing the GitHub README.
103
105
 
104
106
  ## Requirements
105
107
 
@@ -211,7 +213,7 @@ Jenkins example:
211
213
  stage('PR demo') {
212
214
  steps {
213
215
  sh 'npm ci'
214
- sh 'npx demo-this-pr@0.1.0 ci'
216
+ sh 'npx demo-this-pr@0.1.2 ci'
215
217
  }
216
218
  post {
217
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("0.1.0")
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "demo-this-pr",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Record local PR demos with isolated Playwright Chromium, MP4 evidence, test output, and review-ready reports.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,15 +30,6 @@
30
30
  "mp4",
31
31
  "developer-tools"
32
32
  ],
33
- "scripts": {
34
- "build": "tsc -p tsconfig.json",
35
- "check": "npm run build && npm test",
36
- "dev": "tsx src/cli.ts",
37
- "pack:dry-run": "npm pack --dry-run",
38
- "prepack": "npm run build",
39
- "publish:check": "npm run check && npm run pack:dry-run",
40
- "test": "vitest run"
41
- },
42
33
  "publishConfig": {
43
34
  "access": "public"
44
35
  },
@@ -51,11 +42,5 @@
51
42
  "ffmpeg-static": "^5.3.0",
52
43
  "picocolors": "^1.1.1"
53
44
  },
54
- "devDependencies": {
55
- "@types/node": "^24.10.1",
56
- "tsx": "^4.20.6",
57
- "typescript": "^5.9.3",
58
- "vitest": "^4.0.13"
59
- },
60
45
  "license": "MIT"
61
46
  }