mografy 0.1.1 → 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.
- package/README.md +10 -8
- package/lib/node_modules/@mografy/cli/bin/locate.mjs +2 -22
- package/lib/node_modules/@mografy/cli/dist/add.d.ts +0 -1
- package/lib/node_modules/@mografy/cli/dist/add.js +6 -24
- package/lib/node_modules/@mografy/cli/dist/commands/help.js +5 -5
- package/lib/node_modules/@mografy/cli/dist/examples.js +4 -4
- package/lib/node_modules/@mografy/cli/dist/index.js +59 -29
- package/lib/node_modules/@mografy/cli/dist/mcp/hosts.d.ts +1 -1
- package/lib/node_modules/@mografy/cli/dist/mcp/hosts.js +6 -3
- package/lib/node_modules/@mografy/cli/dist/paths.d.ts +4 -3
- package/lib/node_modules/@mografy/cli/dist/paths.js +6 -5
- package/lib/node_modules/@mografy/cli/dist/project-install.d.ts +18 -1
- package/lib/node_modules/@mografy/cli/dist/project-install.js +103 -7
- package/lib/node_modules/@mografy/cli/dist/showcase.js +4 -4
- package/lib/node_modules/@mografy/cli/dist/skill-hint.js +4 -2
- package/lib/node_modules/@mografy/cli/dist/templates.d.ts +1 -1
- package/lib/node_modules/@mografy/cli/dist/templates.js +17 -5
- package/lib/node_modules/@mografy/cli/package.json +1 -1
- package/lib/node_modules/@mografy/core/dist/guide.d.ts +12 -12
- package/lib/node_modules/@mografy/core/dist/guide.js +3 -3
- package/lib/node_modules/@mografy/core/dist/protocol.d.ts +6 -0
- package/lib/node_modules/@mografy/core/dist/skill-text.d.ts +22 -22
- package/lib/node_modules/@mografy/core/dist/skill-text.js +22 -22
- package/lib/node_modules/@mografy/core/package.json +1 -1
- package/lib/node_modules/@mografy/render/package.json +1 -1
- package/lib/node_modules/@mografy/runtime/package.json +1 -1
- package/lib/node_modules/@mografy/server/dist/installation.d.ts +31 -2
- package/lib/node_modules/@mografy/server/dist/installation.js +75 -5
- package/lib/node_modules/@mografy/server/dist/project.d.ts +5 -0
- package/lib/node_modules/@mografy/server/dist/project.js +2 -2
- package/lib/node_modules/@mografy/server/dist/workspace.js +9 -5
- package/lib/node_modules/@mografy/server/package.json +1 -1
- package/lib/node_modules/@mografy/web/dist/app.css +1 -1
- package/lib/node_modules/@mografy/web/dist/app.js +26 -14
- package/lib/node_modules/@mografy/web/package.json +1 -1
- package/package.json +2 -1
- package/templates/README.md +35 -0
- package/templates/ai-chat-stream-wide.ts +132 -0
- package/templates/ai-chat-stream.ts +86 -0
- package/templates/before-after-wide.ts +120 -0
- package/templates/before-after.ts +111 -0
- package/templates/browser-window-wide.ts +155 -0
- package/templates/bullet-points-wide.ts +89 -0
- package/templates/callout-wide.ts +151 -0
- package/templates/callout.ts +135 -0
- package/templates/caption-highlight.ts +117 -0
- package/templates/caption-pop.ts +121 -0
- package/templates/caption-stack.ts +84 -0
- package/templates/caption-subtitle-wide.ts +86 -0
- package/templates/caption-subtitle.ts +115 -0
- package/templates/caption-word.ts +107 -0
- package/templates/catalog.json +2400 -0
- package/templates/chapter-title-wide.ts +62 -0
- package/templates/click-zoom.ts +139 -0
- package/templates/cta-endcard-wide.ts +127 -0
- package/templates/cta-endcard.ts +119 -0
- package/templates/desktop-follow.ts +198 -0
- package/templates/device-stack.ts +135 -0
- package/templates/editorial.ts +260 -0
- package/templates/feature-grid-wide.ts +109 -0
- package/templates/fonts/Anton-Regular.woff2 +0 -0
- package/templates/fonts/Inter-500-latin.ttf +0 -0
- package/templates/fonts/Inter-600-latin.ttf +0 -0
- package/templates/fonts/Inter-700-latin.ttf +0 -0
- package/templates/fonts/Inter-800-latin.ttf +0 -0
- package/templates/fonts/LICENSE-Inter.txt +133 -0
- package/templates/fonts/OFL-Anton.txt +93 -0
- package/templates/growth-bars-wide.ts +85 -0
- package/templates/hook-impact.ts +58 -0
- package/templates/hook-number.ts +90 -0
- package/templates/hook-question.ts +88 -0
- package/templates/kit.ts +140 -0
- package/templates/laptop-frame-wide.ts +163 -0
- package/templates/logo-tagline-wide.ts +81 -0
- package/templates/logo-tagline.ts +93 -0
- package/templates/logo-wall-wide.ts +65 -0
- package/templates/montage.ts +273 -0
- package/templates/multi-window-wide.ts +135 -0
- package/templates/name-lower-wide.ts +97 -0
- package/templates/phone-recording.ts +154 -0
- package/templates/product-hero-wide.ts +72 -0
- package/templates/push-transition-wide.ts +75 -0
- package/templates/push-transition.ts +83 -0
- package/templates/quote-wide.ts +92 -0
- package/templates/review-cards.ts +83 -0
- package/templates/stat-count-wide.ts +73 -0
- package/templates/stat-count.ts +100 -0
- package/templates/terminal-wide.ts +115 -0
- package/templates/three-steps.ts +92 -0
- package/templates/title-wide.ts +55 -0
- package/templates/tsconfig.json +17 -0
- package/templates/type-input.ts +107 -0
- package/lib/node_modules/@mografy/cli/dist/launcher.d.ts +0 -18
- package/lib/node_modules/@mografy/cli/dist/launcher.js +0 -126
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { mkdir, readdir, writeFile } from 'node:fs/promises';
|
|
5
5
|
import { dirname, join, normalize, resolve, sep } from 'node:path';
|
|
6
6
|
import { inflateRawSync } from 'node:zlib';
|
|
7
|
-
import {
|
|
7
|
+
import { referenceFilmsDir } from '@mografy/server';
|
|
8
8
|
import { displayPath } from './paths.js';
|
|
9
9
|
export const SHOWCASE_URL = (process.env.MOGRAFY_SHOWCASE_URL ?? 'https://www.mografy.app/showcase').replace(/\/$/, '');
|
|
10
10
|
export const filmUrl = (name) => `${SHOWCASE_URL}/films/${name}.zip`;
|
|
@@ -87,9 +87,9 @@ export async function extractZip(zip, dest) {
|
|
|
87
87
|
export async function installShowcase(name, target, fetchImpl = fetch) {
|
|
88
88
|
if (!isShowcaseFilm(name))
|
|
89
89
|
throw new Error(`Unknown showcase film: ${name}\nShowcase films:\n${showcaseList()}`);
|
|
90
|
-
const dest = resolve(target ?? join(
|
|
90
|
+
const dest = resolve(target ?? join(referenceFilmsDir(), name));
|
|
91
91
|
if (await readdir(dest).then(() => true, () => false))
|
|
92
|
-
throw new Error(`${displayPath(dest)} already exists. Pass another folder: mografy add ${name} <folder>`);
|
|
92
|
+
throw new Error(`${displayPath(dest)} already exists. Pass another folder: npx mografy add ${name} <folder>`);
|
|
93
93
|
const url = filmUrl(name);
|
|
94
94
|
console.log(`Downloading ${name} from ${url}…`);
|
|
95
95
|
const response = await fetchImpl(url).catch(error => { throw new Error(`Could not download ${name}: ${error.message}. Check the connection, or get it from ${SHOWCASE_URL}`); });
|
|
@@ -104,6 +104,6 @@ export async function installShowcase(name, target, fetchImpl = fetch) {
|
|
|
104
104
|
}
|
|
105
105
|
export function printShowcase(name, dest, bytes) {
|
|
106
106
|
console.log(`Downloaded the showcase film ${name} (${(bytes / 1048576).toFixed(1)} MB) to ${displayPath(dest)}`);
|
|
107
|
-
console.log(`\nWatch it: mografy dev ${displayPath(dest)}\nRead first: scenes/ and style.md, then references/examples.md in the Mografy Skill`);
|
|
107
|
+
console.log(`\nWatch it: npx mografy dev ${displayPath(dest)}\nRead first: scenes/ and style.md, then references/examples.md in the Mografy Skill`);
|
|
108
108
|
}
|
|
109
109
|
//# sourceMappingURL=showcase.js.map
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
|
-
import { installation } from '@mografy/server';
|
|
7
|
+
import { installation, workspaceDir } from '@mografy/server';
|
|
8
8
|
export const SKILL_INSTALL = 'npx skills add mografy/mografy -g';
|
|
9
9
|
/** Where agents find a Skill named mografy: the project's own folders, then the user's (both hosts). */
|
|
10
10
|
export const skillLocations = (project, home = homedir()) => [project, home].flatMap(base => ['.agents', '.claude'].map(host => join(base, host, 'skills', 'mografy', 'SKILL.md')));
|
|
11
11
|
export function skillHint(project, log = (line) => console.log(line), home) {
|
|
12
|
-
|
|
12
|
+
const workspace = workspaceDir();
|
|
13
|
+
const found = [...skillLocations(project, home), ...(workspace ? skillLocations(workspace, home) : [])].some(file => existsSync(file));
|
|
14
|
+
if (installation.kind !== 'package' || found)
|
|
13
15
|
return false;
|
|
14
16
|
log(`Tip: agents need the Mografy Skill to write scenes. Install it once with:\n ${SKILL_INSTALL}`);
|
|
15
17
|
return true;
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
6
6
|
import { dirname, join, relative, sep } from 'node:path';
|
|
7
7
|
import { createInLibrary, createProject, installation, isProject } from '@mografy/server';
|
|
8
|
-
import { displayPath } from './paths.js';
|
|
8
|
+
import { displayPath, workspaceRoot } from './paths.js';
|
|
9
9
|
import { exists, repoFile } from './github.js';
|
|
10
|
-
/**
|
|
11
|
-
export const ROOT =
|
|
10
|
+
/** The checkout or workspace whose templates/ is read first (see `workspaceRoot`). */
|
|
11
|
+
export const ROOT = workspaceRoot;
|
|
12
12
|
/** Fonts every template uses: Inter 500–800 for body, UI and the montage type; Anton for editorial headlines. */
|
|
13
13
|
export const TEMPLATE_FONTS = [
|
|
14
14
|
...[500, 600, 700, 800].map(weight => ({ from: `templates/fonts/Inter-${weight}-latin.ttf`, to: `assets/Inter-${weight}-latin.ttf`, family: 'Inter', weight })),
|
|
@@ -93,6 +93,18 @@ export async function templateProject(workspaceRoot, dir, ids) {
|
|
|
93
93
|
});
|
|
94
94
|
return { dir: made, created: true };
|
|
95
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* The runtime types a project's tsconfig.json points to: this installation's; in a workspace, the copy in its own
|
|
98
|
+
* node_modules when it has one (an npx download can be cleaned away); in another checkout, that checkout's build.
|
|
99
|
+
*/
|
|
100
|
+
async function runtimeTypesFor(root) {
|
|
101
|
+
if (root === installation.root)
|
|
102
|
+
return installation.runtimeTypes;
|
|
103
|
+
const local = join(root, 'node_modules', 'mografy', 'lib', 'node_modules', '@mografy', 'runtime', 'dist', 'index.d.ts');
|
|
104
|
+
if (installation.kind === 'package')
|
|
105
|
+
return await exists(local) ? local : installation.runtimeTypes;
|
|
106
|
+
return join(root, 'packages/runtime/dist/index.d.ts');
|
|
107
|
+
}
|
|
96
108
|
/**
|
|
97
109
|
* Editor support for a project's scenes: a tsconfig.json that resolves `@mografy/runtime` to this installation's
|
|
98
110
|
* types, so templates open without "Cannot find module" or implicit `any` errors. Mografy's own build never reads it.
|
|
@@ -102,7 +114,7 @@ export async function writeEditorConfig(workspaceRoot, dir) {
|
|
|
102
114
|
const file = join(dir, 'tsconfig.json');
|
|
103
115
|
if (await exists(file))
|
|
104
116
|
return false;
|
|
105
|
-
const types = relative(dir,
|
|
117
|
+
const types = relative(dir, await runtimeTypesFor(workspaceRoot)).split(sep).join('/');
|
|
106
118
|
const config = {
|
|
107
119
|
'//': "Editor support only. Mografy's build resolves @mografy/runtime itself.",
|
|
108
120
|
compilerOptions: {
|
|
@@ -170,7 +182,7 @@ export function printTemplatesDone(dir, ids, created, aspect, skipped) {
|
|
|
170
182
|
'',
|
|
171
183
|
created ? `Created ${displayPath(dir)} (${aspect}) with a scene that plays ${ids.length > 1 ? 'the templates in order' : 'the template'}: scenes/main.ts` : `Templates are in ${displayPath(dir)}/scenes/templates/.`,
|
|
172
184
|
...skipped.length ? [`Not in the sequence (other aspect ratio): ${skipped.join(', ')}. Use them in a ${aspect === '9:16' ? '16:9' : '9:16'} project.`] : [],
|
|
173
|
-
created ? `Open it: mografy dev ${displayPath(dir)}` : 'Play one inside your film:',
|
|
185
|
+
created ? `Open it: npx mografy dev ${displayPath(dir)}` : 'Play one inside your film:',
|
|
174
186
|
...created ? [] : [` import * as ${camel(first)} from './templates/${first}.js';`, ` import { play } from './templates/kit.js';`, ` play(ctx, time, 2.0, ${camel(first)}, { /* params */ });`],
|
|
175
187
|
'Guide: .agents/skills/mografy/references/templates.md',
|
|
176
188
|
];
|