@toonstrip/astro 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/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/package.json +23 -9
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 ADDED
@@ -0,0 +1,71 @@
1
+ # @toonstrip/astro
2
+
3
+ An Astro integration plus a `<ComicStrip>` component, wrapping
4
+ `@toonstrip/element`'s `<comic-strip>` custom element for use in Astro
5
+ sites/blogs.
6
+
7
+ Part of [toonstrip](https://github.com/dkdev24/toonstrip), a
8
+ framework-embeddable comic-strip renderer.
9
+
10
+ ## Install
11
+
12
+ ```
13
+ npm install @toonstrip/astro @toonstrip/pack-comic-chat
14
+ ```
15
+
16
+ ## Setup
17
+
18
+ ```js
19
+ // astro.config.mjs
20
+ import { defineConfig } from "astro/config";
21
+ import toonstrip from "@toonstrip/astro";
22
+
23
+ export default defineConfig({
24
+ integrations: [
25
+ toonstrip({ packs: ["@toonstrip/pack-comic-chat"] }),
26
+ ],
27
+ });
28
+ ```
29
+
30
+ `packs` is a list of asset-pack **npm package specifiers** used anywhere in
31
+ the site. At `astro:config:setup`, each specifier is resolved, its
32
+ `pack.json` read, and `pack.json` + `characters/` + `backdrops/` copied into
33
+ `public/_toonstrip/<pack.json name>/`. A pack used by a page must be listed
34
+ here explicitly — there's no auto-discovery.
35
+
36
+ ## Embedding a strip
37
+
38
+ ```astro
39
+ ---
40
+ import { ComicStrip } from "@toonstrip/astro";
41
+ import doc from "../content/my-strip.json";
42
+ ---
43
+
44
+ <ComicStrip document={doc} packs={["comic-chat"]} client:visible />
45
+ ```
46
+
47
+ - `document` — a `ComicStripDocument` (see
48
+ [`@toonstrip/schema`](https://www.npmjs.com/package/@toonstrip/schema)),
49
+ typically imported as JSON.
50
+ - `packs` — pack **names** here (the `pack.json` `name` field, e.g.
51
+ `"comic-chat"`), not the npm specifiers used in `astro.config.mjs`. Each
52
+ name resolves to the `/_toonstrip/<name>/` URL the integration copied that
53
+ pack to.
54
+ - `client:visible` is a standard Astro client directive — recommended so the
55
+ element's JS and its canvas rendering work don't load until the strip
56
+ scrolls into view, but any client directive works.
57
+
58
+ Server-side render emits only an inert placeholder tag — real rendering
59
+ needs a canvas context and only ever happens client-side, once the chosen
60
+ directive's condition fires.
61
+
62
+ ## Worked example
63
+
64
+ See `examples/astro-blog` in the
65
+ [repo](https://github.com/dkdev24/toonstrip/tree/main/examples/astro-blog)
66
+ for a complete, runnable site. Full field reference:
67
+ [`docs/astro.md`](https://github.com/dkdev24/toonstrip/blob/main/docs/astro.md).
68
+
69
+ ## License
70
+
71
+ MIT
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@toonstrip/astro",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "description": "Astro integration and <ComicStrip> component for embedding toonstrip comic strips.",
4
5
  "license": "MIT",
5
6
  "type": "module",
6
7
  "main": "./dist/index.js",
@@ -8,17 +9,12 @@
8
9
  "files": [
9
10
  "dist"
10
11
  ],
11
- "scripts": {
12
- "build": "tsc -p tsconfig.json",
13
- "test": "vitest run",
14
- "lint": "tsc -p tsconfig.json --noEmit"
15
- },
16
12
  "peerDependencies": {
17
13
  "astro": "^7.0.0"
18
14
  },
19
15
  "dependencies": {
20
- "@toonstrip/element": "workspace:*",
21
- "@toonstrip/schema": "workspace:*"
16
+ "@toonstrip/schema": "0.1.1",
17
+ "@toonstrip/element": "0.1.2"
22
18
  },
23
19
  "devDependencies": {
24
20
  "astro": "^7.2.9",
@@ -27,5 +23,23 @@
27
23
  },
28
24
  "publishConfig": {
29
25
  "access": "public"
26
+ },
27
+ "keywords": [
28
+ "toonstrip",
29
+ "comic",
30
+ "astro",
31
+ "astro-integration"
32
+ ],
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/dkdev24/toonstrip.git",
36
+ "directory": "packages/astro"
37
+ },
38
+ "homepage": "https://github.com/dkdev24/toonstrip#readme",
39
+ "bugs": "https://github.com/dkdev24/toonstrip/issues",
40
+ "scripts": {
41
+ "build": "tsc -p tsconfig.json",
42
+ "test": "vitest run",
43
+ "lint": "tsc -p tsconfig.json --noEmit"
30
44
  }
31
- }
45
+ }