@reportforge/playwright-pdf 0.10.0 → 0.10.1

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 CHANGED
@@ -211,7 +211,9 @@ Full reference: [reportforge.org/docs/configuration](https://reportforge.org/doc
211
211
 
212
212
  ### Live Runs
213
213
 
214
- Watch a run as it happens. With `live` enabled, the reporter prints an unguessable watch link — boxed under a `Live Tracker` heading — to your CI logs at run start and streams per-test progress to a hosted dashboard while tests execute. All shards of one CI run converge on a single live view, each running test shows the step it's currently executing, and the PDF is still generated at the end, unchanged.
214
+ Watch a run as it happens. With `live` enabled, the reporter prints an unguessable watch link — boxed under a `Live Tracker` heading — to your CI logs at run start and streams per-test progress to a hosted dashboard while tests execute. All shards of one CI run converge on a single live view, each test shows its steps as sub-lines beneath its own row, and the PDF is still generated at the end, unchanged.
215
+
216
+ > The watch link is entitlement-gated. If you enable `live` but see no `Live Tracker` line, the reporter logs why (missing `RF_LICENSE_KEY`, or a cached token without the `live` entitlement — delete `~/.reportforge/license.json` to force re-activation).
215
217
 
216
218
  ```typescript
217
219
  // playwright.config.ts
package/dist/index.js CHANGED
@@ -13753,7 +13753,7 @@ var LiveStreamer = class {
13753
13753
  this.enabled = false;
13754
13754
  this.testBuffer = [];
13755
13755
  this.eventBuffer = [];
13756
- this.warn("Live streaming disabled \u2014 no active license or live entitlement.");
13756
+ logger.debug("Live streaming disabled \u2014 no active license or live entitlement.");
13757
13757
  return false;
13758
13758
  }
13759
13759
  this.jwt = info.jwt;
@@ -13816,8 +13816,8 @@ function deriveRunId(opts) {
13816
13816
  if (fromEnv) return fromEnv;
13817
13817
  return detectCiRunId() ?? (0, import_crypto9.randomUUID)();
13818
13818
  }
13819
- function computeWatchToken(runId) {
13820
- const secret = process.env.RF_LICENSE_KEY?.trim();
13819
+ function computeWatchToken(runId, key) {
13820
+ const secret = key?.trim() || process.env.RF_LICENSE_KEY?.trim();
13821
13821
  if (!secret) return null;
13822
13822
  return (0, import_crypto8.createHmac)("sha256", secret).update(`live:${runId}`).digest("hex").slice(0, WATCH_TOKEN_HEX_LEN);
13823
13823
  }
@@ -13911,7 +13911,7 @@ var PdfReporter = class {
13911
13911
  this.liveConsole = false;
13912
13912
  this.options = parseOptions(rawOptions);
13913
13913
  this.dataCollector = new DataCollector(this.options.capture);
13914
- const version = true ? "0.10.0" : "0.x";
13914
+ const version = true ? "0.10.1" : "0.x";
13915
13915
  logger.info(`@reportforge/playwright-pdf v${version} initialised`);
13916
13916
  this.licenseClient = new LicenseClient({
13917
13917
  licenseKey: this.options.licenseKey,
@@ -14125,11 +14125,17 @@ var PdfReporter = class {
14125
14125
  this.liveSteps = live.steps;
14126
14126
  this.liveConsole = live.console;
14127
14127
  void this.license();
14128
- const token = computeWatchToken(runId);
14128
+ const token = computeWatchToken(runId, this.options.licenseKey);
14129
14129
  const watchUrl = token ? buildWatchUrl(serverUrl, runId, token) : void 0;
14130
14130
  const env = detectCiEnv();
14131
- if (watchUrl) void this.announceLive(watchUrl, env, shard).catch(() => {
14132
- });
14131
+ if (watchUrl) {
14132
+ void this.announceLive(watchUrl, env, shard).catch(() => {
14133
+ });
14134
+ } else {
14135
+ logger.warn(
14136
+ "Live is enabled but no RF_LICENSE_KEY was found \u2014 cannot mint a watch link or stream. Set RF_LICENSE_KEY (or the `licenseKey` option)."
14137
+ );
14138
+ }
14133
14139
  this.liveStreamer = new LiveStreamer({
14134
14140
  serverUrl,
14135
14141
  runId,
@@ -14150,7 +14156,22 @@ var PdfReporter = class {
14150
14156
  */
14151
14157
  async announceLive(watchUrl, env, shard) {
14152
14158
  const info = await this.license();
14153
- if (!info?.jwt || !info.features?.includes("live")) return;
14159
+ if (!info) {
14160
+ logger.warn("Live is enabled but no active license resolved \u2014 no watch link or streaming.");
14161
+ return;
14162
+ }
14163
+ if (!info.jwt) {
14164
+ logger.warn(
14165
+ "Live is enabled but the license has no signed token (offline with no cached token?) \u2014 no streaming."
14166
+ );
14167
+ return;
14168
+ }
14169
+ if (!info.features?.includes("live")) {
14170
+ logger.warn(
14171
+ "Live is enabled but your license token does not include the 'live' entitlement \u2014 no watch link or streaming. This usually means a cached token predates live streaming and could not be refreshed. Ensure network access on the next run, or delete ~/.reportforge/license.json to force re-activation. If it persists on an active subscription, contact support."
14172
+ );
14173
+ return;
14174
+ }
14154
14175
  logger.info(`Live Tracker: ${watchUrl}`);
14155
14176
  console.log(formatLiveBanner(watchUrl));
14156
14177
  const isPrimaryShard = !shard || shard.current === 1;
package/dist/index.mjs CHANGED
@@ -13754,7 +13754,7 @@ var LiveStreamer = class {
13754
13754
  this.enabled = false;
13755
13755
  this.testBuffer = [];
13756
13756
  this.eventBuffer = [];
13757
- this.warn("Live streaming disabled \u2014 no active license or live entitlement.");
13757
+ logger.debug("Live streaming disabled \u2014 no active license or live entitlement.");
13758
13758
  return false;
13759
13759
  }
13760
13760
  this.jwt = info.jwt;
@@ -13817,8 +13817,8 @@ function deriveRunId(opts) {
13817
13817
  if (fromEnv) return fromEnv;
13818
13818
  return detectCiRunId() ?? randomUUID2();
13819
13819
  }
13820
- function computeWatchToken(runId) {
13821
- const secret = process.env.RF_LICENSE_KEY?.trim();
13820
+ function computeWatchToken(runId, key) {
13821
+ const secret = key?.trim() || process.env.RF_LICENSE_KEY?.trim();
13822
13822
  if (!secret) return null;
13823
13823
  return createHmac3("sha256", secret).update(`live:${runId}`).digest("hex").slice(0, WATCH_TOKEN_HEX_LEN);
13824
13824
  }
@@ -13912,7 +13912,7 @@ var PdfReporter = class {
13912
13912
  this.liveConsole = false;
13913
13913
  this.options = parseOptions(rawOptions);
13914
13914
  this.dataCollector = new DataCollector(this.options.capture);
13915
- const version = true ? "0.10.0" : "0.x";
13915
+ const version = true ? "0.10.1" : "0.x";
13916
13916
  logger.info(`@reportforge/playwright-pdf v${version} initialised`);
13917
13917
  this.licenseClient = new LicenseClient({
13918
13918
  licenseKey: this.options.licenseKey,
@@ -14126,11 +14126,17 @@ var PdfReporter = class {
14126
14126
  this.liveSteps = live.steps;
14127
14127
  this.liveConsole = live.console;
14128
14128
  void this.license();
14129
- const token = computeWatchToken(runId);
14129
+ const token = computeWatchToken(runId, this.options.licenseKey);
14130
14130
  const watchUrl = token ? buildWatchUrl(serverUrl, runId, token) : void 0;
14131
14131
  const env = detectCiEnv();
14132
- if (watchUrl) void this.announceLive(watchUrl, env, shard).catch(() => {
14133
- });
14132
+ if (watchUrl) {
14133
+ void this.announceLive(watchUrl, env, shard).catch(() => {
14134
+ });
14135
+ } else {
14136
+ logger.warn(
14137
+ "Live is enabled but no RF_LICENSE_KEY was found \u2014 cannot mint a watch link or stream. Set RF_LICENSE_KEY (or the `licenseKey` option)."
14138
+ );
14139
+ }
14134
14140
  this.liveStreamer = new LiveStreamer({
14135
14141
  serverUrl,
14136
14142
  runId,
@@ -14151,7 +14157,22 @@ var PdfReporter = class {
14151
14157
  */
14152
14158
  async announceLive(watchUrl, env, shard) {
14153
14159
  const info = await this.license();
14154
- if (!info?.jwt || !info.features?.includes("live")) return;
14160
+ if (!info) {
14161
+ logger.warn("Live is enabled but no active license resolved \u2014 no watch link or streaming.");
14162
+ return;
14163
+ }
14164
+ if (!info.jwt) {
14165
+ logger.warn(
14166
+ "Live is enabled but the license has no signed token (offline with no cached token?) \u2014 no streaming."
14167
+ );
14168
+ return;
14169
+ }
14170
+ if (!info.features?.includes("live")) {
14171
+ logger.warn(
14172
+ "Live is enabled but your license token does not include the 'live' entitlement \u2014 no watch link or streaming. This usually means a cached token predates live streaming and could not be refreshed. Ensure network access on the next run, or delete ~/.reportforge/license.json to force re-activation. If it persists on an active subscription, contact support."
14173
+ );
14174
+ return;
14175
+ }
14155
14176
  logger.info(`Live Tracker: ${watchUrl}`);
14156
14177
  console.log(formatLiveBanner(watchUrl));
14157
14178
  const isPrimaryShard = !shard || shard.current === 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportforge/playwright-pdf",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "Enterprise-ready PDF reports for Playwright Test — minimal, detailed, and executive templates with CI/CD integrations",
5
5
  "license": "MIT",
6
6
  "author": "ReportForge",