@codepress/design-kit 0.1.3 → 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/LICENSE +17 -7
- package/README.md +7 -0
- package/package.json +9 -6
- package/src/capture-pages.mjs +5 -2
package/LICENSE
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2026 Quant Five LLC
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -279,3 +279,10 @@ await capturePages(config, {
|
|
|
279
279
|
`capturePages` also takes `forbidStrings` and `stripOrigins` (more origins to
|
|
280
280
|
remove from markup, such as a mock API's) and a `session` object whose
|
|
281
281
|
`interrupted` flag stops it between pages.
|
|
282
|
+
|
|
283
|
+
## Contributing and license
|
|
284
|
+
|
|
285
|
+
The source is on GitHub at
|
|
286
|
+
[quantfive/design-kit](https://github.com/quantfive/design-kit), where issues
|
|
287
|
+
and pull requests are welcome; see its `CONTRIBUTING.md`. MIT licensed: see
|
|
288
|
+
[`LICENSE`](./LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codepress/design-kit",
|
|
3
|
-
"version": "0.1
|
|
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": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"node": ">=20"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"test": "TZ=UTC LC_ALL=en_US.UTF-8 node ../../scripts/test-with-deadline.mjs node --test
|
|
36
|
-
"test:browser": "node ../../scripts/capacity-browser.mjs -- \"node --test
|
|
35
|
+
"test": "TZ=UTC LC_ALL=en_US.UTF-8 node ../../scripts/test-with-deadline.mjs node --test test/*.test.mjs",
|
|
36
|
+
"test:browser": "node ../../scripts/capacity-browser.mjs -- \"node --test test/browser/*.test.mjs\"",
|
|
37
37
|
"lint": "oxlint --ignore-pattern 'test/fixtures/**' .",
|
|
38
38
|
"format": "prettier --write .",
|
|
39
39
|
"format:check": "prettier --check .",
|
|
@@ -60,11 +60,14 @@
|
|
|
60
60
|
"design-system"
|
|
61
61
|
],
|
|
62
62
|
"author": "CodePress",
|
|
63
|
-
"license": "
|
|
63
|
+
"license": "MIT",
|
|
64
64
|
"repository": {
|
|
65
65
|
"type": "git",
|
|
66
|
-
"url": "git+https://github.com/quantfive/
|
|
67
|
-
|
|
66
|
+
"url": "git+https://github.com/quantfive/design-kit.git"
|
|
67
|
+
},
|
|
68
|
+
"homepage": "https://github.com/quantfive/design-kit#readme",
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/quantfive/design-kit/issues"
|
|
68
71
|
},
|
|
69
72
|
"publishConfig": {
|
|
70
73
|
"access": "public"
|
package/src/capture-pages.mjs
CHANGED
|
@@ -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
|
-
|
|
335
|
-
|
|
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(() => {
|