@codepress/design-kit 0.2.0 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codepress/design-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Capture your Storybook and real app pages as a static design kit, and compose self-contained mockups from it",
5
5
  "type": "module",
6
6
  "bin": {
@@ -330,9 +330,12 @@ async function capturePage(context, page, viewport, run) {
330
330
  requestAnimationFrame(() => requestAnimationFrame(resolve)),
331
331
  );
332
332
  });
333
+ // A page's path may carry a query (`?tab=settings`), which the app may
334
+ // rewrite; only a different pathname is a redirect.
333
335
  const finalPath = new URL(tab.url()).pathname;
334
- if (finalPath !== page.path)
335
- throw new Error(`redirected from ${page.path} to ${finalPath}`);
336
+ const wantPath = new URL(page.path, baseUrl).pathname;
337
+ if (finalPath !== wantPath)
338
+ throw new Error(`redirected from ${wantPath} to ${finalPath}`);
336
339
 
337
340
  // The serialized DOM keeps no scroll, so neither does the screenshot.
338
341
  await tab.evaluate(() => {