@tongue-core/templates 0.1.0-rc.8 → 0.1.0-rc.9
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
|
@@ -27,6 +27,10 @@ Reading templates uses the file system (Bun or Node). The format itself (`templa
|
|
|
27
27
|
`TemplateSource`, `projectFromTemplate`) is `@tongue-core/project/template`'s, so other sources (an app's
|
|
28
28
|
own catalog, a URL) implement the same interface.
|
|
29
29
|
|
|
30
|
+
Templates ship local, generated media for offline use. Applications should normally declare
|
|
31
|
+
hosted footage by URL in `assets.ts`, with an immutable SHA-256 when available. The SDK's media
|
|
32
|
+
store prepares and hosts previews outside the project; builds retain only their references.
|
|
33
|
+
|
|
30
34
|
## A template
|
|
31
35
|
|
|
32
36
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tongue-core/templates",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.9",
|
|
4
4
|
"description": "The film projects `tongue init` starts from: a blank film, a vertical social post, a promo with footage. Each is a complete project that builds as it is.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"README.md"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tongue-core/project": "0.1.0-rc.
|
|
28
|
+
"@tongue-core/project": "0.1.0-rc.9"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"effect": "^4.0.6"
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
- `film.tsx` is the timeline: which scenes play, for how long, and how they join.
|
|
4
4
|
- `scenes/` has one scene per file, named for its id (`scenes/title.tsx` is scene `title`).
|
|
5
|
-
- `assets.ts` declares
|
|
5
|
+
- `assets.ts` declares media at module scope. Application footage normally uses hosted URLs;
|
|
6
|
+
the template's local fonts live in `assets/` so it also works offline.
|
|
7
|
+
|
|
8
|
+
For hosted footage, declare `video("https://…/screen.mp4", { name: "screen", sha256: "<64 hex digits>" })`.
|
|
9
|
+
Set `TONGUE_MEDIA_DIR` and `TONGUE_MEDIA_URL` to the host's prepared-media store for portable builds,
|
|
10
|
+
or supply a hosted `prepared` manifest on the asset. Studio serves a local media store automatically.
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
13
|
tongue check . # does it build? (layout, code, timeline)
|
|
@@ -3,3 +3,7 @@ import { font } from "@tongue-core/film";
|
|
|
3
3
|
// Every file the film uses, declared once. Paths are relative to the project.
|
|
4
4
|
|
|
5
5
|
export const inter = font("assets/fonts/Inter.woff2");
|
|
6
|
+
|
|
7
|
+
// Application media normally uses hosted URLs, declared here before rendering.
|
|
8
|
+
// Example: video("https://cdn.example/screen.mp4", { name: "screen", sha256: "<64 hex digits>" }).
|
|
9
|
+
// A portable build uses the host media store or an asset's prepared manifest URL.
|
|
@@ -8,3 +8,7 @@ export const inter = font("assets/fonts/Inter.woff2");
|
|
|
8
8
|
export const aurora = video("assets/video/aurora.mp4");
|
|
9
9
|
/** A generated dusk landscape. */
|
|
10
10
|
export const dusk = image("assets/images/dusk.jpg", { maxSize: 2000 });
|
|
11
|
+
|
|
12
|
+
// Application media normally uses hosted URLs, declared here before rendering.
|
|
13
|
+
// Example: video("https://cdn.example/screen.mp4", { name: "screen", sha256: "<64 hex digits>" }).
|
|
14
|
+
// A portable build uses the host media store or an asset's prepared manifest URL.
|
|
@@ -6,3 +6,7 @@ export const fraunces = font("assets/fonts/Fraunces.woff2");
|
|
|
6
6
|
export const figtree = font("assets/fonts/Figtree.woff2");
|
|
7
7
|
/** A generated dusk landscape; swap in a photo of your own. */
|
|
8
8
|
export const dusk = image("assets/images/dusk.jpg", { maxSize: 2000 });
|
|
9
|
+
|
|
10
|
+
// Application media normally uses hosted URLs, declared here before rendering.
|
|
11
|
+
// Example: video("https://cdn.example/screen.mp4", { name: "screen", sha256: "<64 hex digits>" }).
|
|
12
|
+
// A portable build uses the host media store or an asset's prepared manifest URL.
|