@toonstrip/next 0.1.0 → 0.1.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 +21 -0
- package/README.md +7 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -7
- package/dist/server.d.ts +4 -27
- package/dist/server.js +6 -10
- package/package.json +13 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel Kim
|
|
4
|
+
|
|
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:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
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
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @toonstrip/next
|
|
2
2
|
|
|
3
|
+
**Deprecated.** `@toonstrip/react`'s `<ComicStrip>` now carries its own `'use client'`
|
|
4
|
+
directive, and `@toonstrip/cli` exports `renderPlaceholder` directly — this package no
|
|
5
|
+
longer adds anything on top of either. It's kept as a working re-export for existing
|
|
6
|
+
installs; new code should import from `@toonstrip/react` and `@toonstrip/cli` instead.
|
|
7
|
+
See [`docs/next.md`](https://github.com/dkdev24/toonstrip/blob/main/docs/next.md) for the
|
|
8
|
+
two-line migration.
|
|
9
|
+
|
|
3
10
|
`@toonstrip/react`'s `<ComicStrip>` behind an App-Router-safe `'use client'` boundary,
|
|
4
11
|
plus `@toonstrip/next/server`'s `renderPlaceholder` for a real SSR PNG placeholder — no
|
|
5
12
|
layout shift on hydration, and content visible with JavaScript disabled.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated `@toonstrip/react`'s `<ComicStrip>` now carries its own
|
|
3
|
+
* `"use client"` directive — import it directly from `@toonstrip/react`
|
|
4
|
+
* instead of through this package, which no longer adds anything on top of
|
|
5
|
+
* it. Kept for existing installs; see `docs/next.md` for the migration.
|
|
6
|
+
*/
|
|
1
7
|
export { ComicStrip } from "@toonstrip/react";
|
|
2
8
|
export type { ComicStripProps, ComicStripPlaceholder } from "@toonstrip/react";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// tree; this directive is the separate, RSC-protocol half of that story.
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated `@toonstrip/react`'s `<ComicStrip>` now carries its own
|
|
3
|
+
* `"use client"` directive — import it directly from `@toonstrip/react`
|
|
4
|
+
* instead of through this package, which no longer adds anything on top of
|
|
5
|
+
* it. Kept for existing installs; see `docs/next.md` for the migration.
|
|
6
|
+
*/
|
|
8
7
|
export { ComicStrip } from "@toonstrip/react";
|
package/dist/server.d.ts
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `<ComicStrip placeholder>` as the light-DOM image it shows until client JS
|
|
6
|
-
* hydrates and paints the live canvas.
|
|
7
|
-
*
|
|
8
|
-
* A separate entry point ("@toonstrip/next/server", not the package root):
|
|
9
|
-
* `@toonstrip/cli` pulls in `@napi-rs/canvas`, a native Node addon that must
|
|
10
|
-
* never end up in a client bundle. Only import this from a Server Component
|
|
11
|
-
* or other server-only code.
|
|
12
|
-
*
|
|
13
|
-
* `@toonstrip/cli` is imported dynamically with `webpackIgnore` rather than
|
|
14
|
-
* statically: Next's `serverExternalPackages` opt-out is meant to stop it
|
|
15
|
-
* being bundled, but a workspace package reached through a symlinked,
|
|
16
|
-
* non-`node_modules` local package (`@toonstrip/cli`, here) doesn't reliably
|
|
17
|
-
* hit that path, and webpack then tries to statically bundle
|
|
18
|
-
* `@napi-rs/canvas`'s platform-detection `require()`s for every OS/arch and
|
|
19
|
-
* fails on the binary `.node` files. `webpackIgnore` leaves this import
|
|
20
|
-
* completely alone, so Node resolves and loads it normally at request time —
|
|
21
|
-
* from the *bundled output file's* location, though, so the consuming app
|
|
22
|
-
* must list `@toonstrip/cli` as its own direct dependency (not only reachable
|
|
23
|
-
* transitively through `@toonstrip/next`) for that resolution to succeed
|
|
24
|
-
* under pnpm's default strict `node_modules` layout.
|
|
2
|
+
* @deprecated `@toonstrip/cli` now exports `renderPlaceholder` directly, with
|
|
3
|
+
* the same signature — this re-export is kept for existing installs. Import
|
|
4
|
+
* from `@toonstrip/cli` instead; see `docs/next.md` for the migration.
|
|
25
5
|
*/
|
|
26
|
-
|
|
27
|
-
import type { ComicStripDocument } from "@toonstrip/schema";
|
|
28
|
-
import type { RenderOptions } from "@toonstrip/cli";
|
|
29
|
-
export declare function renderPlaceholder(doc: ComicStripDocument, options?: RenderOptions): Promise<ComicStripPlaceholder>;
|
|
6
|
+
export { renderPlaceholder } from "@toonstrip/cli";
|
package/dist/server.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// density, so using the PNG's raw pixel size here would render it 2x too
|
|
8
|
-
// large (the default `scale`) and shift layout on hydration.
|
|
9
|
-
return { src: `data:image/png;base64,${png.toString("base64")}`, width: cssWidth, height: cssHeight };
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated `@toonstrip/cli` now exports `renderPlaceholder` directly, with
|
|
3
|
+
* the same signature — this re-export is kept for existing installs. Import
|
|
4
|
+
* from `@toonstrip/cli` instead; see `docs/next.md` for the migration.
|
|
5
|
+
*/
|
|
6
|
+
export { renderPlaceholder } from "@toonstrip/cli";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toonstrip/next",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "@toonstrip/react
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "[DEPRECATED] @toonstrip/react's <ComicStrip> now carries its own 'use client' directive and @toonstrip/cli exports renderPlaceholder directly — import from those instead. See docs/next.md for the migration.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -19,19 +19,13 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "tsc -p tsconfig.json",
|
|
24
|
-
"test": "vitest run",
|
|
25
|
-
"lint": "tsc -p tsconfig.json --noEmit"
|
|
26
|
-
},
|
|
27
22
|
"peerDependencies": {
|
|
28
23
|
"react": "^18.0.0 || ^19.0.0",
|
|
29
24
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
30
25
|
},
|
|
31
26
|
"dependencies": {
|
|
32
|
-
"@toonstrip/cli": "
|
|
33
|
-
"@toonstrip/react": "
|
|
34
|
-
"@toonstrip/schema": "workspace:*"
|
|
27
|
+
"@toonstrip/cli": "0.2.3",
|
|
28
|
+
"@toonstrip/react": "0.1.2"
|
|
35
29
|
},
|
|
36
30
|
"devDependencies": {
|
|
37
31
|
"@types/react": "^18.3.12",
|
|
@@ -39,7 +33,8 @@
|
|
|
39
33
|
"react": "^18.3.1",
|
|
40
34
|
"react-dom": "^18.3.1",
|
|
41
35
|
"typescript": "^5.6.3",
|
|
42
|
-
"vitest": "^2.1.4"
|
|
36
|
+
"vitest": "^2.1.4",
|
|
37
|
+
"@toonstrip/schema": "0.1.3"
|
|
43
38
|
},
|
|
44
39
|
"publishConfig": {
|
|
45
40
|
"access": "public"
|
|
@@ -57,5 +52,10 @@
|
|
|
57
52
|
"directory": "packages/next"
|
|
58
53
|
},
|
|
59
54
|
"homepage": "https://github.com/dkdev24/toonstrip#readme",
|
|
60
|
-
"bugs": "https://github.com/dkdev24/toonstrip/issues"
|
|
61
|
-
|
|
55
|
+
"bugs": "https://github.com/dkdev24/toonstrip/issues",
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsc -p tsconfig.json",
|
|
58
|
+
"test": "vitest run",
|
|
59
|
+
"lint": "tsc -p tsconfig.json --noEmit"
|
|
60
|
+
}
|
|
61
|
+
}
|