remotion-ui 0.1.0

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 ADDED
@@ -0,0 +1,56 @@
1
+ # remotion-ui
2
+
3
+ CLI for adding Remotion video components to your project — the [shadcn/ui](https://ui.shadcn.com) of Remotion.
4
+
5
+ ## Quick start
6
+
7
+ ```bash
8
+ npx remotion-ui@latest init my-video
9
+ cd my-video
10
+ npx remotion-ui@latest add fade-in
11
+ npx remotion-ui@latest add intro
12
+ ```
13
+
14
+ Components are copied into your project as source files. You own the code.
15
+
16
+ ## Commands
17
+
18
+ | Command | Description |
19
+ |---------|-------------|
20
+ | `remotion-ui init [name]` | Scaffold a new Remotion project |
21
+ | `remotion-ui add <name>` | Add component(s) from the registry |
22
+ | `remotion-ui search -q <query>` | Search the registry |
23
+ | `remotion-ui view <name>` | View registry item metadata |
24
+
25
+ ## Configuration
26
+
27
+ Create `remotion-ui.json` in your project root (included by `init`):
28
+
29
+ ```json
30
+ {
31
+ "preset": "default",
32
+ "aliases": {
33
+ "primitives": "@/remotion/primitives",
34
+ "scenes": "@/remotion/scenes",
35
+ "compositions": "@/compositions",
36
+ "lib": "@/remotion/lib"
37
+ }
38
+ }
39
+ ```
40
+
41
+ ## Registry
42
+
43
+ Default registry: `https://remotionui.com/r`
44
+
45
+ Override with `--registry-url` or `REMOTION_UI_REGISTRY_URL`.
46
+
47
+ ## Programmatic API
48
+
49
+ ```ts
50
+ import { fetchRegistryItem } from "remotion-ui/registry";
51
+ import { remotionUiConfigSchema } from "remotion-ui/schema";
52
+ ```
53
+
54
+ ## Docs
55
+
56
+ https://remotionui.com/docs
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,550 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import { Command } from "commander";
5
+
6
+ // src/commands/add.ts
7
+ import { execSync } from "child_process";
8
+ import path5 from "path";
9
+
10
+ // src/remotion/composition-patch.ts
11
+ import fs from "fs-extra";
12
+ async function patchRootTsx(rootPath, meta) {
13
+ if (!await fs.pathExists(rootPath)) {
14
+ throw new Error(`Root file not found: ${rootPath}`);
15
+ }
16
+ const content = await fs.readFile(rootPath, "utf-8");
17
+ if (content.includes(`id="${meta.id}"`) || content.includes(`id={'${meta.id}'}`)) {
18
+ console.log(` \xB7 Composition "${meta.id}" already registered in Root.tsx`);
19
+ return;
20
+ }
21
+ const importPath = meta.importPath ?? `@/compositions/${meta.component.toLowerCase().replace(/composition$/, "")}/index`;
22
+ const importStatement = `import { ${meta.component} } from "${importPath}";`;
23
+ let updated = content;
24
+ if (!updated.includes(importStatement)) {
25
+ const lastImportIndex = findLastImportIndex(updated);
26
+ if (lastImportIndex === -1) {
27
+ updated = `${importStatement}
28
+ ${updated}`;
29
+ } else {
30
+ const insertAt = updated.indexOf("\n", lastImportIndex) + 1;
31
+ updated = updated.slice(0, insertAt) + importStatement + "\n" + updated.slice(insertAt);
32
+ }
33
+ }
34
+ const compositionEntry = ` <Composition
35
+ id="${meta.id}"
36
+ component={${meta.component}}
37
+ durationInFrames={${meta.durationInFrames}}
38
+ fps={${meta.fps}}
39
+ width={${meta.width}}
40
+ height={${meta.height}}
41
+ />`;
42
+ if (updated.includes("</>")) {
43
+ updated = updated.replace("</>", `${compositionEntry}
44
+ </>`);
45
+ } else if (updated.includes("</RemotionRoot>")) {
46
+ updated = updated.replace(
47
+ "</RemotionRoot>",
48
+ `${compositionEntry}
49
+ </RemotionRoot>`
50
+ );
51
+ } else {
52
+ throw new Error(
53
+ "Could not find a suitable insertion point in Root.tsx for the Composition."
54
+ );
55
+ }
56
+ if (!updated.includes("import { Composition")) {
57
+ updated = updated.replace(
58
+ /from "remotion";/,
59
+ 'from "remotion";\nimport { Composition } from "remotion";'
60
+ );
61
+ if (!updated.includes("import { Composition }")) {
62
+ updated = `import { Composition } from "remotion";
63
+ ${updated}`;
64
+ }
65
+ }
66
+ await fs.writeFile(rootPath, updated, "utf-8");
67
+ console.log(` \u2713 Registered composition "${meta.id}" in Root.tsx`);
68
+ }
69
+ function findLastImportIndex(content) {
70
+ const imports = [...content.matchAll(/^import .+$/gm)];
71
+ if (imports.length === 0) {
72
+ return -1;
73
+ }
74
+ const last = imports[imports.length - 1];
75
+ return last.index ?? -1;
76
+ }
77
+
78
+ // src/registry/fetch-item.ts
79
+ import fs2 from "fs-extra";
80
+ import path from "path";
81
+ var DEFAULT_REGISTRY_URL = "https://remotionui.com/r";
82
+ async function fetchRegistryItem(name, options = {}) {
83
+ const registryUrl = options.registryUrl ?? process.env.REMOTION_UI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL;
84
+ const preset = options.preset ?? "default";
85
+ if (isLocalRegistry(registryUrl)) {
86
+ const filePath = path.join(
87
+ path.resolve(registryUrl),
88
+ "presets",
89
+ preset,
90
+ `${name}.json`
91
+ );
92
+ if (!await fs2.pathExists(filePath)) {
93
+ throw new Error(`Registry item "${name}" not found at ${filePath}`);
94
+ }
95
+ const raw = await fs2.readFile(filePath, "utf-8");
96
+ return JSON.parse(raw);
97
+ }
98
+ const url = `${registryUrl.replace(/\/$/, "")}/presets/${preset}/${name}.json`;
99
+ const response = await fetch(url);
100
+ if (!response.ok) {
101
+ throw new Error(`Failed to fetch registry item "${name}" from ${url}`);
102
+ }
103
+ return response.json();
104
+ }
105
+ function isLocalRegistry(registryUrl) {
106
+ return registryUrl.startsWith("/") || registryUrl.startsWith("./") || registryUrl.startsWith("../") || registryUrl.startsWith("file:");
107
+ }
108
+
109
+ // src/utils/get-config.ts
110
+ import { cosmiconfig } from "cosmiconfig";
111
+ import path2 from "path";
112
+
113
+ // src/schema/index.ts
114
+ import { z } from "zod";
115
+ var remotionUiConfigSchema = z.object({
116
+ $schema: z.string().optional(),
117
+ preset: z.string().default("default"),
118
+ tsx: z.boolean().default(true),
119
+ remotion: z.object({
120
+ version: z.string().default("4"),
121
+ config: z.string().default("remotion.config.ts"),
122
+ root: z.string().default("src/Root.tsx")
123
+ }).default({}),
124
+ aliases: z.object({
125
+ primitives: z.string().default("@/remotion/primitives"),
126
+ scenes: z.string().default("@/remotion/scenes"),
127
+ compositions: z.string().default("@/compositions"),
128
+ lib: z.string().default("@/remotion/lib"),
129
+ hooks: z.string().default("@/remotion/hooks")
130
+ }).default({})
131
+ });
132
+ var compositionMetaSchema = z.object({
133
+ id: z.string(),
134
+ component: z.string(),
135
+ durationInFrames: z.number(),
136
+ fps: z.number(),
137
+ width: z.number(),
138
+ height: z.number(),
139
+ importPath: z.string().optional()
140
+ });
141
+ var registryItemSchema = z.object({
142
+ name: z.string(),
143
+ type: z.string(),
144
+ description: z.string().optional(),
145
+ dependencies: z.array(z.string()).optional(),
146
+ registryDependencies: z.array(z.string()).optional(),
147
+ composition: compositionMetaSchema.optional(),
148
+ files: z.array(
149
+ z.object({
150
+ path: z.string(),
151
+ type: z.string(),
152
+ target: z.string().optional(),
153
+ content: z.string().optional()
154
+ })
155
+ )
156
+ });
157
+ var registrySchema = z.object({
158
+ $schema: z.string().optional(),
159
+ name: z.string(),
160
+ homepage: z.string().optional(),
161
+ items: z.array(registryItemSchema)
162
+ });
163
+
164
+ // src/utils/get-config.ts
165
+ var explorer = cosmiconfig("remotion-ui", {
166
+ searchPlaces: [
167
+ "remotion-ui.json",
168
+ ".remotion-uirc",
169
+ ".remotion-uirc.json"
170
+ ]
171
+ });
172
+ var CATEGORY_SEGMENTS = [
173
+ { segment: "/primitives/", key: "primitives" },
174
+ { segment: "/scenes/", key: "scenes" },
175
+ { segment: "/compositions/", key: "compositions" },
176
+ { segment: "/lib/", key: "lib" },
177
+ { segment: "/hooks/", key: "hooks" }
178
+ ];
179
+ async function getConfig(cwd) {
180
+ const result = await explorer.search(cwd);
181
+ if (!result) {
182
+ throw new Error(
183
+ `No remotion-ui.json found in ${cwd}. Run "remotion-ui init" first.`
184
+ );
185
+ }
186
+ return remotionUiConfigSchema.parse(result.config);
187
+ }
188
+ function getAliasForType(config, type, filePath) {
189
+ if (filePath) {
190
+ const category = getCategoryFromPath(filePath);
191
+ if (category) {
192
+ return config.aliases[category.key];
193
+ }
194
+ }
195
+ const map = {
196
+ "registry:ui": "primitives",
197
+ "registry:lib": "lib",
198
+ "registry:hook": "hooks",
199
+ "registry:block": "scenes"
200
+ };
201
+ const key = map[type];
202
+ return key ? config.aliases[key] : void 0;
203
+ }
204
+ function getCategoryFromPath(filePath) {
205
+ for (const { segment, key } of CATEGORY_SEGMENTS) {
206
+ const index = filePath.indexOf(segment);
207
+ if (index !== -1) {
208
+ return {
209
+ key,
210
+ relativePath: filePath.slice(index + segment.length)
211
+ };
212
+ }
213
+ }
214
+ return null;
215
+ }
216
+ function resolveAliasPath(cwd, alias) {
217
+ if (alias.startsWith("@/")) {
218
+ return path2.join(cwd, "src", alias.slice(2));
219
+ }
220
+ if (alias.startsWith("./") || alias.startsWith("../")) {
221
+ return path2.resolve(cwd, alias);
222
+ }
223
+ return path2.join(cwd, alias);
224
+ }
225
+ function resolveInstallPath(cwd, config, file) {
226
+ if (file.target) {
227
+ return path2.resolve(cwd, file.target);
228
+ }
229
+ const category = getCategoryFromPath(file.path);
230
+ if (category) {
231
+ const baseDir2 = resolveAliasPath(cwd, config.aliases[category.key]);
232
+ return path2.join(baseDir2, category.relativePath);
233
+ }
234
+ const alias = getAliasForType(config, file.type, file.path);
235
+ if (!alias) {
236
+ throw new Error(`No alias configured for registry type "${file.type}"`);
237
+ }
238
+ const baseDir = resolveAliasPath(cwd, alias);
239
+ const fileName = path2.basename(file.path);
240
+ return path2.join(baseDir, fileName);
241
+ }
242
+ function isCompositionItem(files) {
243
+ return files.some((file) => file.path.includes("/compositions/"));
244
+ }
245
+
246
+ // src/utils/get-package-manager.ts
247
+ import fs3 from "fs-extra";
248
+ import path3 from "path";
249
+ async function detectPackageManager(cwd) {
250
+ const pkgPath = path3.join(cwd, "package.json");
251
+ if (await fs3.pathExists(pkgPath)) {
252
+ const pkg = await fs3.readJson(pkgPath);
253
+ if (pkg.packageManager?.startsWith("pnpm")) return "pnpm";
254
+ if (pkg.packageManager?.startsWith("yarn")) return "yarn";
255
+ if (pkg.packageManager?.startsWith("bun")) return "bun";
256
+ }
257
+ if (await fs3.pathExists(path3.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
258
+ if (await fs3.pathExists(path3.join(cwd, "yarn.lock"))) return "yarn";
259
+ if (await fs3.pathExists(path3.join(cwd, "bun.lockb"))) return "bun";
260
+ return "npm";
261
+ }
262
+ function getInstallCommand(pm, packages) {
263
+ const deps = packages.join(" ");
264
+ switch (pm) {
265
+ case "pnpm":
266
+ return `pnpm add ${deps}`;
267
+ case "yarn":
268
+ return `yarn add ${deps}`;
269
+ case "bun":
270
+ return `bun add ${deps}`;
271
+ default:
272
+ return `npm install ${deps}`;
273
+ }
274
+ }
275
+
276
+ // src/utils/index.ts
277
+ import fs4 from "fs-extra";
278
+ import path4 from "path";
279
+ async function writeFile(filePath, content) {
280
+ await fs4.ensureDir(path4.dirname(filePath));
281
+ await fs4.writeFile(filePath, content, "utf-8");
282
+ }
283
+
284
+ // src/commands/add.ts
285
+ async function addCommand(components, options = {}) {
286
+ if (components.length === 0) {
287
+ throw new Error("Please specify at least one component to add.");
288
+ }
289
+ const cwd = path5.resolve(options.cwd ?? process.cwd());
290
+ const config = await getConfig(cwd);
291
+ const installed = /* @__PURE__ */ new Set();
292
+ const dependencies = /* @__PURE__ */ new Set();
293
+ for (const name of components) {
294
+ await installComponent(name, {
295
+ cwd,
296
+ config,
297
+ registryUrl: options.registryUrl,
298
+ preset: options.preset ?? config.preset,
299
+ installed,
300
+ dependencies
301
+ });
302
+ }
303
+ if (dependencies.size > 0) {
304
+ const pm = await detectPackageManager(cwd);
305
+ const cmd = getInstallCommand(pm, [...dependencies]);
306
+ console.log(`Installing dependencies: ${[...dependencies].join(", ")}`);
307
+ execSync(cmd, { cwd, stdio: "inherit" });
308
+ }
309
+ console.log(`
310
+ Added ${components.length} component(s) successfully.`);
311
+ }
312
+ async function installComponent(name, ctx) {
313
+ if (ctx.installed.has(name)) {
314
+ return;
315
+ }
316
+ const item = await fetchRegistryItem(name, {
317
+ registryUrl: ctx.registryUrl,
318
+ preset: ctx.preset
319
+ });
320
+ for (const dep of item.registryDependencies ?? []) {
321
+ await installComponent(dep, ctx);
322
+ }
323
+ for (const file of item.files) {
324
+ if (!file.content) {
325
+ throw new Error(
326
+ `Registry item "${name}" is missing content for ${file.path}`
327
+ );
328
+ }
329
+ const targetPath = resolveInstallPath(ctx.cwd, ctx.config, file);
330
+ await writeFile(targetPath, file.content);
331
+ console.log(` \u2713 ${path5.relative(ctx.cwd, targetPath)}`);
332
+ }
333
+ if (item.composition && isCompositionItem(item.files)) {
334
+ const rootPath = path5.resolve(ctx.cwd, ctx.config.remotion.root);
335
+ await patchRootTsx(rootPath, {
336
+ ...item.composition,
337
+ importPath: item.composition.importPath ?? `@/compositions/${name}/index`
338
+ });
339
+ }
340
+ for (const dep of item.dependencies ?? []) {
341
+ ctx.dependencies.add(dep);
342
+ }
343
+ ctx.installed.add(name);
344
+ }
345
+
346
+ // src/commands/init.ts
347
+ import { execSync as execSync2 } from "child_process";
348
+ import fs6 from "fs-extra";
349
+ import path7 from "path";
350
+
351
+ // src/utils/get-template-dir.ts
352
+ import fs5 from "fs-extra";
353
+ import path6 from "path";
354
+ import { fileURLToPath } from "url";
355
+ function getTemplateDir(templateName) {
356
+ const currentDir = path6.dirname(fileURLToPath(import.meta.url));
357
+ const candidates = [
358
+ // Bundled CLI: dist/index.js → packages/remotion-ui/templates
359
+ path6.resolve(currentDir, "../templates", templateName),
360
+ // Dev / subpath: dist/utils/*.js
361
+ path6.resolve(currentDir, "../../templates", templateName),
362
+ // Monorepo root: templates/
363
+ path6.resolve(currentDir, "../../../templates", templateName),
364
+ path6.resolve(currentDir, "../../../../templates", templateName)
365
+ ];
366
+ for (const candidate of candidates) {
367
+ if (fs5.existsSync(candidate)) {
368
+ return candidate;
369
+ }
370
+ }
371
+ return candidates[0];
372
+ }
373
+
374
+ // src/commands/init.ts
375
+ async function initCommand(projectName = "my-video", options = {}) {
376
+ const cwd = path7.resolve(options.cwd ?? process.cwd());
377
+ const targetDir = path7.join(cwd, projectName);
378
+ const templateDir = getTemplateDir("remotion-app");
379
+ if (!await fs6.pathExists(templateDir)) {
380
+ throw new Error(`Template not found: ${templateDir}`);
381
+ }
382
+ if (await fs6.pathExists(targetDir)) {
383
+ throw new Error(`Directory already exists: ${targetDir}`);
384
+ }
385
+ console.log(`Creating Remotion project: ${projectName}`);
386
+ await fs6.copy(templateDir, targetDir);
387
+ const pkgPath = path7.join(targetDir, "package.json");
388
+ const pkg = await fs6.readJson(pkgPath);
389
+ pkg.name = projectName;
390
+ await fs6.writeJson(pkgPath, pkg, { spaces: 2 });
391
+ const pm = await detectPackageManager(cwd);
392
+ console.log("Installing dependencies...");
393
+ if (pm === "pnpm") {
394
+ execSync2("pnpm install", { cwd: targetDir, stdio: "inherit" });
395
+ } else if (pm === "yarn") {
396
+ execSync2("yarn install", { cwd: targetDir, stdio: "inherit" });
397
+ } else if (pm === "bun") {
398
+ execSync2("bun install", { cwd: targetDir, stdio: "inherit" });
399
+ } else {
400
+ execSync2("npm install", { cwd: targetDir, stdio: "inherit" });
401
+ }
402
+ console.log(`
403
+ Project created at ${targetDir}`);
404
+ console.log(`
405
+ Next steps:`);
406
+ console.log(` cd ${projectName}`);
407
+ console.log(` npx remotion-ui add fade-in`);
408
+ console.log(` npm run dev`);
409
+ }
410
+
411
+ // src/registry/fetch-index.ts
412
+ import fs7 from "fs-extra";
413
+ import path8 from "path";
414
+ async function fetchRegistryIndex(registryUrl = process.env.REMOTION_UI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL) {
415
+ if (isLocalRegistry2(registryUrl)) {
416
+ const filePath = path8.join(path8.resolve(registryUrl), "index.json");
417
+ if (!await fs7.pathExists(filePath)) {
418
+ throw new Error(`Registry index not found at ${filePath}`);
419
+ }
420
+ const raw = await fs7.readFile(filePath, "utf-8");
421
+ return JSON.parse(raw);
422
+ }
423
+ const url = `${registryUrl.replace(/\/$/, "")}/index.json`;
424
+ const response = await fetch(url);
425
+ if (!response.ok) {
426
+ throw new Error(`Failed to fetch registry index from ${url}`);
427
+ }
428
+ return response.json();
429
+ }
430
+ function isLocalRegistry2(registryUrl) {
431
+ return registryUrl.startsWith("/") || registryUrl.startsWith("./") || registryUrl.startsWith("../") || registryUrl.startsWith("file:");
432
+ }
433
+
434
+ // src/commands/search.ts
435
+ async function searchCommand(options = {}) {
436
+ const index = await fetchRegistryIndex(options.registryUrl);
437
+ const query = options.query?.toLowerCase().trim();
438
+ const results = index.items.filter((item) => {
439
+ if (!query) return true;
440
+ return item.name.toLowerCase().includes(query) || item.description?.toLowerCase().includes(query) || item.type.toLowerCase().includes(query);
441
+ });
442
+ if (results.length === 0) {
443
+ console.log("No components found.");
444
+ return;
445
+ }
446
+ for (const item of results) {
447
+ const desc = item.description ? ` \u2014 ${item.description}` : "";
448
+ console.log(`${item.name} (${item.type})${desc}`);
449
+ }
450
+ console.log(`
451
+ ${results.length} result(s)`);
452
+ }
453
+
454
+ // src/commands/view.ts
455
+ async function viewCommand(name, options = {}) {
456
+ const item = await fetchRegistryItem(name, {
457
+ registryUrl: options.registryUrl,
458
+ preset: options.preset ?? "default"
459
+ });
460
+ console.log(`Name: ${item.name}`);
461
+ console.log(`Type: ${item.type}`);
462
+ if (item.description) {
463
+ console.log(`Description: ${item.description}`);
464
+ }
465
+ if (item.dependencies?.length) {
466
+ console.log(`Dependencies: ${item.dependencies.join(", ")}`);
467
+ }
468
+ if (item.registryDependencies?.length) {
469
+ console.log(
470
+ `Registry dependencies: ${item.registryDependencies.join(", ")}`
471
+ );
472
+ }
473
+ if (item.composition) {
474
+ console.log(`Composition: ${item.composition.id} (${item.composition.component})`);
475
+ }
476
+ console.log(`
477
+ Files:`);
478
+ for (const file of item.files) {
479
+ console.log(` - ${file.path} (${file.type})`);
480
+ }
481
+ }
482
+
483
+ // src/index.ts
484
+ var program = new Command();
485
+ program.name("remotion-ui").description("Add Remotion video components to your project").version("0.1.0");
486
+ program.command("init").description("Initialize a new Remotion project with RemotionUI").argument("[project-name]", "project directory name", "my-video").option("-y, --yes", "Skip confirmation prompts").action(async (projectName, options) => {
487
+ try {
488
+ await initCommand(projectName, { yes: options.yes });
489
+ } catch (error) {
490
+ console.error(
491
+ error instanceof Error ? error.message : "Failed to initialize project"
492
+ );
493
+ process.exit(1);
494
+ }
495
+ });
496
+ program.command("add").description("Add a component to your project").argument("[components...]", "component names to add").option(
497
+ "-r, --registry-url <url>",
498
+ "Registry base URL or local path to public/r/"
499
+ ).option("--preset <preset>", "Registry preset", "default").option("-y, --yes", "Skip confirmation prompts").action(async (components, options) => {
500
+ try {
501
+ await addCommand(components, {
502
+ registryUrl: options.registryUrl,
503
+ preset: options.preset,
504
+ yes: options.yes
505
+ });
506
+ } catch (error) {
507
+ console.error(
508
+ error instanceof Error ? error.message : "Failed to add components"
509
+ );
510
+ process.exit(1);
511
+ }
512
+ });
513
+ program.command("search").description("Search the component registry").option("-q, --query <query>", "search query").option(
514
+ "-r, --registry-url <url>",
515
+ "Registry base URL or local path to public/r/"
516
+ ).action(async (options) => {
517
+ try {
518
+ await searchCommand({
519
+ query: options.query,
520
+ registryUrl: options.registryUrl
521
+ });
522
+ } catch (error) {
523
+ console.error(
524
+ error instanceof Error ? error.message : "Search failed"
525
+ );
526
+ process.exit(1);
527
+ }
528
+ });
529
+ program.command("view").description("View registry item details").argument("<name>", "component name").option(
530
+ "-r, --registry-url <url>",
531
+ "Registry base URL or local path to public/r/"
532
+ ).option("--preset <preset>", "Registry preset", "default").action(async (name, options) => {
533
+ try {
534
+ await viewCommand(name, {
535
+ registryUrl: options.registryUrl,
536
+ preset: options.preset
537
+ });
538
+ } catch (error) {
539
+ console.error(
540
+ error instanceof Error ? error.message : "View failed"
541
+ );
542
+ process.exit(1);
543
+ }
544
+ });
545
+ program.command("build").description("Build a custom registry").argument("[registry]", "path to registry.json").action((registry) => {
546
+ console.log("build:", registry ?? "registry.json");
547
+ console.log("build: coming soon");
548
+ });
549
+ program.parse();
550
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/commands/add.ts","../src/remotion/composition-patch.ts","../src/registry/fetch-item.ts","../src/utils/get-config.ts","../src/schema/index.ts","../src/utils/get-package-manager.ts","../src/utils/index.ts","../src/commands/init.ts","../src/utils/get-template-dir.ts","../src/registry/fetch-index.ts","../src/commands/search.ts","../src/commands/view.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { addCommand } from \"./commands/add.js\";\nimport { initCommand } from \"./commands/init.js\";\nimport { searchCommand } from \"./commands/search.js\";\nimport { viewCommand } from \"./commands/view.js\";\n\nconst program = new Command();\n\nprogram\n .name(\"remotion-ui\")\n .description(\"Add Remotion video components to your project\")\n .version(\"0.1.0\");\n\nprogram\n .command(\"init\")\n .description(\"Initialize a new Remotion project with RemotionUI\")\n .argument(\"[project-name]\", \"project directory name\", \"my-video\")\n .option(\"-y, --yes\", \"Skip confirmation prompts\")\n .action(async (projectName: string, options: { yes?: boolean }) => {\n try {\n await initCommand(projectName, { yes: options.yes });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"Failed to initialize project\",\n );\n process.exit(1);\n }\n });\n\nprogram\n .command(\"add\")\n .description(\"Add a component to your project\")\n .argument(\"[components...]\", \"component names to add\")\n .option(\n \"-r, --registry-url <url>\",\n \"Registry base URL or local path to public/r/\",\n )\n .option(\"--preset <preset>\", \"Registry preset\", \"default\")\n .option(\"-y, --yes\", \"Skip confirmation prompts\")\n .action(async (components: string[], options) => {\n try {\n await addCommand(components, {\n registryUrl: options.registryUrl,\n preset: options.preset,\n yes: options.yes,\n });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"Failed to add components\",\n );\n process.exit(1);\n }\n });\n\nprogram\n .command(\"search\")\n .description(\"Search the component registry\")\n .option(\"-q, --query <query>\", \"search query\")\n .option(\n \"-r, --registry-url <url>\",\n \"Registry base URL or local path to public/r/\",\n )\n .action(async (options: { query?: string; registryUrl?: string }) => {\n try {\n await searchCommand({\n query: options.query,\n registryUrl: options.registryUrl,\n });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"Search failed\",\n );\n process.exit(1);\n }\n });\n\nprogram\n .command(\"view\")\n .description(\"View registry item details\")\n .argument(\"<name>\", \"component name\")\n .option(\n \"-r, --registry-url <url>\",\n \"Registry base URL or local path to public/r/\",\n )\n .option(\"--preset <preset>\", \"Registry preset\", \"default\")\n .action(async (name: string, options) => {\n try {\n await viewCommand(name, {\n registryUrl: options.registryUrl,\n preset: options.preset,\n });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"View failed\",\n );\n process.exit(1);\n }\n });\n\nprogram\n .command(\"build\")\n .description(\"Build a custom registry\")\n .argument(\"[registry]\", \"path to registry.json\")\n .action((registry?: string) => {\n console.log(\"build:\", registry ?? \"registry.json\");\n console.log(\"build: coming soon\");\n });\n\nprogram.parse();\n","import { execSync } from \"node:child_process\";\nimport path from \"node:path\";\nimport { patchRootTsx } from \"../remotion/composition-patch.js\";\nimport { fetchRegistryItem } from \"../registry/fetch-item.js\";\nimport {\n getConfig,\n isCompositionItem,\n resolveInstallPath,\n} from \"../utils/get-config.js\";\nimport {\n detectPackageManager,\n getInstallCommand,\n} from \"../utils/get-package-manager.js\";\nimport { writeFile } from \"../utils/index.js\";\n\nexport type AddOptions = {\n cwd?: string;\n registryUrl?: string;\n preset?: string;\n yes?: boolean;\n};\n\nexport async function addCommand(\n components: string[],\n options: AddOptions = {},\n): Promise<void> {\n if (components.length === 0) {\n throw new Error(\"Please specify at least one component to add.\");\n }\n\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const config = await getConfig(cwd);\n const installed = new Set<string>();\n const dependencies = new Set<string>();\n\n for (const name of components) {\n await installComponent(name, {\n cwd,\n config,\n registryUrl: options.registryUrl,\n preset: options.preset ?? config.preset,\n installed,\n dependencies,\n });\n }\n\n if (dependencies.size > 0) {\n const pm = await detectPackageManager(cwd);\n const cmd = getInstallCommand(pm, [...dependencies]);\n console.log(`Installing dependencies: ${[...dependencies].join(\", \")}`);\n execSync(cmd, { cwd, stdio: \"inherit\" });\n }\n\n console.log(`\\nAdded ${components.length} component(s) successfully.`);\n}\n\nasync function installComponent(\n name: string,\n ctx: {\n cwd: string;\n config: Awaited<ReturnType<typeof getConfig>>;\n registryUrl?: string;\n preset: string;\n installed: Set<string>;\n dependencies: Set<string>;\n },\n): Promise<void> {\n if (ctx.installed.has(name)) {\n return;\n }\n\n const item = await fetchRegistryItem(name, {\n registryUrl: ctx.registryUrl,\n preset: ctx.preset,\n });\n\n for (const dep of item.registryDependencies ?? []) {\n await installComponent(dep, ctx);\n }\n\n for (const file of item.files) {\n if (!file.content) {\n throw new Error(\n `Registry item \"${name}\" is missing content for ${file.path}`,\n );\n }\n\n const targetPath = resolveInstallPath(ctx.cwd, ctx.config, file);\n await writeFile(targetPath, file.content);\n console.log(` ✓ ${path.relative(ctx.cwd, targetPath)}`);\n }\n\n if (item.composition && isCompositionItem(item.files)) {\n const rootPath = path.resolve(ctx.cwd, ctx.config.remotion.root);\n await patchRootTsx(rootPath, {\n ...item.composition,\n importPath:\n item.composition.importPath ??\n `@/compositions/${name}/index`,\n });\n }\n\n for (const dep of item.dependencies ?? []) {\n ctx.dependencies.add(dep);\n }\n\n ctx.installed.add(name);\n}\n","import fs from \"fs-extra\";\n\nexport type CompositionMeta = {\n id: string;\n component: string;\n durationInFrames: number;\n fps: number;\n width: number;\n height: number;\n importPath?: string;\n};\n\nexport async function patchRootTsx(\n rootPath: string,\n meta: CompositionMeta,\n): Promise<void> {\n if (!(await fs.pathExists(rootPath))) {\n throw new Error(`Root file not found: ${rootPath}`);\n }\n\n const content = await fs.readFile(rootPath, \"utf-8\");\n\n if (content.includes(`id=\"${meta.id}\"`) || content.includes(`id={'${meta.id}'}`)) {\n console.log(` · Composition \"${meta.id}\" already registered in Root.tsx`);\n return;\n }\n\n const importPath =\n meta.importPath ??\n `@/compositions/${meta.component.toLowerCase().replace(/composition$/, \"\")}/index`;\n const importStatement = `import { ${meta.component} } from \"${importPath}\";`;\n\n let updated = content;\n\n if (!updated.includes(importStatement)) {\n const lastImportIndex = findLastImportIndex(updated);\n if (lastImportIndex === -1) {\n updated = `${importStatement}\\n${updated}`;\n } else {\n const insertAt = updated.indexOf(\"\\n\", lastImportIndex) + 1;\n updated =\n updated.slice(0, insertAt) + importStatement + \"\\n\" + updated.slice(insertAt);\n }\n }\n\n const compositionEntry = ` <Composition\n id=\"${meta.id}\"\n component={${meta.component}}\n durationInFrames={${meta.durationInFrames}}\n fps={${meta.fps}}\n width={${meta.width}}\n height={${meta.height}}\n />`;\n\n if (updated.includes(\"</>\")) {\n updated = updated.replace(\"</>\", `${compositionEntry}\\n </>`);\n } else if (updated.includes(\"</RemotionRoot>\")) {\n updated = updated.replace(\n \"</RemotionRoot>\",\n `${compositionEntry}\\n </RemotionRoot>`,\n );\n } else {\n throw new Error(\n \"Could not find a suitable insertion point in Root.tsx for the Composition.\",\n );\n }\n\n if (!updated.includes('import { Composition')) {\n updated = updated.replace(\n /from \"remotion\";/,\n 'from \"remotion\";\\nimport { Composition } from \"remotion\";',\n );\n if (!updated.includes(\"import { Composition }\")) {\n updated = `import { Composition } from \"remotion\";\\n${updated}`;\n }\n }\n\n await fs.writeFile(rootPath, updated, \"utf-8\");\n console.log(` ✓ Registered composition \"${meta.id}\" in Root.tsx`);\n}\n\nfunction findLastImportIndex(content: string): number {\n const imports = [...content.matchAll(/^import .+$/gm)];\n if (imports.length === 0) {\n return -1;\n }\n const last = imports[imports.length - 1];\n return last.index ?? -1;\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport type { RegistryItemJson } from \"./index.js\";\n\nexport const DEFAULT_REGISTRY_URL = \"https://remotionui.com/r\";\n\nexport type FetchRegistryOptions = {\n registryUrl?: string;\n preset?: string;\n};\n\nexport async function fetchRegistryItem(\n name: string,\n options: FetchRegistryOptions = {},\n): Promise<RegistryItemJson> {\n const registryUrl =\n options.registryUrl ??\n process.env.REMOTION_UI_REGISTRY_URL ??\n DEFAULT_REGISTRY_URL;\n const preset = options.preset ?? \"default\";\n\n if (isLocalRegistry(registryUrl)) {\n const filePath = path.join(\n path.resolve(registryUrl),\n \"presets\",\n preset,\n `${name}.json`,\n );\n\n if (!(await fs.pathExists(filePath))) {\n throw new Error(`Registry item \"${name}\" not found at ${filePath}`);\n }\n\n const raw = await fs.readFile(filePath, \"utf-8\");\n return JSON.parse(raw) as RegistryItemJson;\n }\n\n const url = `${registryUrl.replace(/\\/$/, \"\")}/presets/${preset}/${name}.json`;\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch registry item \"${name}\" from ${url}`);\n }\n\n return response.json() as Promise<RegistryItemJson>;\n}\n\nfunction isLocalRegistry(registryUrl: string): boolean {\n return (\n registryUrl.startsWith(\"/\") ||\n registryUrl.startsWith(\"./\") ||\n registryUrl.startsWith(\"../\") ||\n registryUrl.startsWith(\"file:\")\n );\n}\n","import { cosmiconfig } from \"cosmiconfig\";\nimport path from \"node:path\";\nimport {\n remotionUiConfigSchema,\n type RemotionUiConfig,\n} from \"../schema/index.js\";\n\nconst explorer = cosmiconfig(\"remotion-ui\", {\n searchPlaces: [\n \"remotion-ui.json\",\n \".remotion-uirc\",\n \".remotion-uirc.json\",\n ],\n});\n\nconst CATEGORY_SEGMENTS: Array<{\n segment: string;\n key: keyof RemotionUiConfig[\"aliases\"];\n}> = [\n { segment: \"/primitives/\", key: \"primitives\" },\n { segment: \"/scenes/\", key: \"scenes\" },\n { segment: \"/compositions/\", key: \"compositions\" },\n { segment: \"/lib/\", key: \"lib\" },\n { segment: \"/hooks/\", key: \"hooks\" },\n];\n\nexport async function getConfig(cwd: string): Promise<RemotionUiConfig> {\n const result = await explorer.search(cwd);\n\n if (!result) {\n throw new Error(\n `No remotion-ui.json found in ${cwd}. Run \"remotion-ui init\" first.`,\n );\n }\n\n return remotionUiConfigSchema.parse(result.config);\n}\n\nexport function getAliasForType(\n config: RemotionUiConfig,\n type: string,\n filePath?: string,\n): string | undefined {\n if (filePath) {\n const category = getCategoryFromPath(filePath);\n if (category) {\n return config.aliases[category.key];\n }\n }\n\n const map: Record<string, keyof RemotionUiConfig[\"aliases\"]> = {\n \"registry:ui\": \"primitives\",\n \"registry:lib\": \"lib\",\n \"registry:hook\": \"hooks\",\n \"registry:block\": \"scenes\",\n };\n\n const key = map[type];\n return key ? config.aliases[key] : undefined;\n}\n\nexport function getCategoryFromPath(filePath: string): {\n key: keyof RemotionUiConfig[\"aliases\"];\n relativePath: string;\n} | null {\n for (const { segment, key } of CATEGORY_SEGMENTS) {\n const index = filePath.indexOf(segment);\n if (index !== -1) {\n return {\n key,\n relativePath: filePath.slice(index + segment.length),\n };\n }\n }\n return null;\n}\n\nexport function resolveAliasPath(cwd: string, alias: string): string {\n if (alias.startsWith(\"@/\")) {\n return path.join(cwd, \"src\", alias.slice(2));\n }\n\n if (alias.startsWith(\"./\") || alias.startsWith(\"../\")) {\n return path.resolve(cwd, alias);\n }\n\n return path.join(cwd, alias);\n}\n\nexport function resolveInstallPath(\n cwd: string,\n config: RemotionUiConfig,\n file: { path: string; type: string; target?: string },\n): string {\n if (file.target) {\n return path.resolve(cwd, file.target);\n }\n\n const category = getCategoryFromPath(file.path);\n if (category) {\n const baseDir = resolveAliasPath(cwd, config.aliases[category.key]);\n return path.join(baseDir, category.relativePath);\n }\n\n const alias = getAliasForType(config, file.type, file.path);\n if (!alias) {\n throw new Error(`No alias configured for registry type \"${file.type}\"`);\n }\n\n const baseDir = resolveAliasPath(cwd, alias);\n const fileName = path.basename(file.path);\n return path.join(baseDir, fileName);\n}\n\nexport function isCompositionItem(files: Array<{ path: string }>): boolean {\n return files.some((file) => file.path.includes(\"/compositions/\"));\n}\n","import { z } from \"zod\";\n\nexport const remotionUiConfigSchema = z.object({\n $schema: z.string().optional(),\n preset: z.string().default(\"default\"),\n tsx: z.boolean().default(true),\n remotion: z\n .object({\n version: z.string().default(\"4\"),\n config: z.string().default(\"remotion.config.ts\"),\n root: z.string().default(\"src/Root.tsx\"),\n })\n .default({}),\n aliases: z\n .object({\n primitives: z.string().default(\"@/remotion/primitives\"),\n scenes: z.string().default(\"@/remotion/scenes\"),\n compositions: z.string().default(\"@/compositions\"),\n lib: z.string().default(\"@/remotion/lib\"),\n hooks: z.string().default(\"@/remotion/hooks\"),\n })\n .default({}),\n});\n\nexport type RemotionUiConfig = z.infer<typeof remotionUiConfigSchema>;\n\nexport const compositionMetaSchema = z.object({\n id: z.string(),\n component: z.string(),\n durationInFrames: z.number(),\n fps: z.number(),\n width: z.number(),\n height: z.number(),\n importPath: z.string().optional(),\n});\n\nexport const registryItemSchema = z.object({\n name: z.string(),\n type: z.string(),\n description: z.string().optional(),\n dependencies: z.array(z.string()).optional(),\n registryDependencies: z.array(z.string()).optional(),\n composition: compositionMetaSchema.optional(),\n files: z.array(\n z.object({\n path: z.string(),\n type: z.string(),\n target: z.string().optional(),\n content: z.string().optional(),\n }),\n ),\n});\n\nexport type RegistryItem = z.infer<typeof registryItemSchema>;\n\nexport const registrySchema = z.object({\n $schema: z.string().optional(),\n name: z.string(),\n homepage: z.string().optional(),\n items: z.array(registryItemSchema),\n});\n\nexport type Registry = z.infer<typeof registrySchema>;\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\n\nexport type PackageManager = \"pnpm\" | \"npm\" | \"yarn\" | \"bun\";\n\nexport async function detectPackageManager(\n cwd: string,\n): Promise<PackageManager> {\n const pkgPath = path.join(cwd, \"package.json\");\n\n if (await fs.pathExists(pkgPath)) {\n const pkg = (await fs.readJson(pkgPath)) as {\n packageManager?: string;\n };\n\n if (pkg.packageManager?.startsWith(\"pnpm\")) return \"pnpm\";\n if (pkg.packageManager?.startsWith(\"yarn\")) return \"yarn\";\n if (pkg.packageManager?.startsWith(\"bun\")) return \"bun\";\n }\n\n if (await fs.pathExists(path.join(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (await fs.pathExists(path.join(cwd, \"yarn.lock\"))) return \"yarn\";\n if (await fs.pathExists(path.join(cwd, \"bun.lockb\"))) return \"bun\";\n\n return \"npm\";\n}\n\nexport function getInstallCommand(\n pm: PackageManager,\n packages: string[],\n): string {\n const deps = packages.join(\" \");\n\n switch (pm) {\n case \"pnpm\":\n return `pnpm add ${deps}`;\n case \"yarn\":\n return `yarn add ${deps}`;\n case \"bun\":\n return `bun add ${deps}`;\n default:\n return `npm install ${deps}`;\n }\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\n\nexport async function writeFile(\n filePath: string,\n content: string,\n): Promise<void> {\n await fs.ensureDir(path.dirname(filePath));\n await fs.writeFile(filePath, content, \"utf-8\");\n}\n\nexport function resolveProjectPath(cwd: string, alias: string): string {\n // TODO: Resolve alias from remotion-ui.json to filesystem path\n return path.join(cwd, alias.replace(\"@/\", \"src/\"));\n}\n","import { execSync } from \"node:child_process\";\nimport fs from \"fs-extra\";\nimport path from \"node:path\";\nimport {\n detectPackageManager,\n getInstallCommand,\n} from \"../utils/get-package-manager.js\";\nimport { getTemplateDir } from \"../utils/get-template-dir.js\";\n\nexport type InitOptions = {\n cwd?: string;\n yes?: boolean;\n};\n\nexport async function initCommand(\n projectName = \"my-video\",\n options: InitOptions = {},\n): Promise<void> {\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const targetDir = path.join(cwd, projectName);\n const templateDir = getTemplateDir(\"remotion-app\");\n\n if (!(await fs.pathExists(templateDir))) {\n throw new Error(`Template not found: ${templateDir}`);\n }\n\n if (await fs.pathExists(targetDir)) {\n throw new Error(`Directory already exists: ${targetDir}`);\n }\n\n console.log(`Creating Remotion project: ${projectName}`);\n\n await fs.copy(templateDir, targetDir);\n\n const pkgPath = path.join(targetDir, \"package.json\");\n const pkg = (await fs.readJson(pkgPath)) as { name: string };\n pkg.name = projectName;\n await fs.writeJson(pkgPath, pkg, { spaces: 2 });\n\n const pm = await detectPackageManager(cwd);\n\n console.log(\"Installing dependencies...\");\n if (pm === \"pnpm\") {\n execSync(\"pnpm install\", { cwd: targetDir, stdio: \"inherit\" });\n } else if (pm === \"yarn\") {\n execSync(\"yarn install\", { cwd: targetDir, stdio: \"inherit\" });\n } else if (pm === \"bun\") {\n execSync(\"bun install\", { cwd: targetDir, stdio: \"inherit\" });\n } else {\n execSync(\"npm install\", { cwd: targetDir, stdio: \"inherit\" });\n }\n\n console.log(`\\nProject created at ${targetDir}`);\n console.log(`\\nNext steps:`);\n console.log(` cd ${projectName}`);\n console.log(` npx remotion-ui add fade-in`);\n console.log(` npm run dev`);\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nexport function getTemplateDir(templateName: string): string {\n const currentDir = path.dirname(fileURLToPath(import.meta.url));\n\n const candidates = [\n // Bundled CLI: dist/index.js → packages/remotion-ui/templates\n path.resolve(currentDir, \"../templates\", templateName),\n // Dev / subpath: dist/utils/*.js\n path.resolve(currentDir, \"../../templates\", templateName),\n // Monorepo root: templates/\n path.resolve(currentDir, \"../../../templates\", templateName),\n path.resolve(currentDir, \"../../../../templates\", templateName),\n ];\n\n for (const candidate of candidates) {\n if (fs.existsSync(candidate)) {\n return candidate;\n }\n }\n\n return candidates[0];\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport { DEFAULT_REGISTRY_URL } from \"./fetch-item.js\";\n\nexport type RegistryIndexItem = {\n name: string;\n type: string;\n description?: string;\n};\n\nexport type RegistryIndex = {\n name: string;\n homepage?: string;\n items: RegistryIndexItem[];\n};\n\nexport async function fetchRegistryIndex(\n registryUrl = process.env.REMOTION_UI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL,\n): Promise<RegistryIndex> {\n if (isLocalRegistry(registryUrl)) {\n const filePath = path.join(path.resolve(registryUrl), \"index.json\");\n if (!(await fs.pathExists(filePath))) {\n throw new Error(`Registry index not found at ${filePath}`);\n }\n const raw = await fs.readFile(filePath, \"utf-8\");\n return JSON.parse(raw) as RegistryIndex;\n }\n\n const url = `${registryUrl.replace(/\\/$/, \"\")}/index.json`;\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch registry index from ${url}`);\n }\n\n return response.json() as Promise<RegistryIndex>;\n}\n\nfunction isLocalRegistry(registryUrl: string): boolean {\n return (\n registryUrl.startsWith(\"/\") ||\n registryUrl.startsWith(\"./\") ||\n registryUrl.startsWith(\"../\") ||\n registryUrl.startsWith(\"file:\")\n );\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport { fetchRegistryIndex } from \"../registry/fetch-index.js\";\n\nexport type SearchOptions = {\n query?: string;\n registryUrl?: string;\n};\n\nexport async function searchCommand(\n options: SearchOptions = {},\n): Promise<void> {\n const index = await fetchRegistryIndex(options.registryUrl);\n const query = options.query?.toLowerCase().trim();\n\n const results = index.items.filter((item) => {\n if (!query) return true;\n return (\n item.name.toLowerCase().includes(query) ||\n item.description?.toLowerCase().includes(query) ||\n item.type.toLowerCase().includes(query)\n );\n });\n\n if (results.length === 0) {\n console.log(\"No components found.\");\n return;\n }\n\n for (const item of results) {\n const desc = item.description ? ` — ${item.description}` : \"\";\n console.log(`${item.name} (${item.type})${desc}`);\n }\n\n console.log(`\\n${results.length} result(s)`);\n}\n","import { fetchRegistryItem } from \"../registry/fetch-item.js\";\n\nexport type ViewOptions = {\n registryUrl?: string;\n preset?: string;\n};\n\nexport async function viewCommand(\n name: string,\n options: ViewOptions = {},\n): Promise<void> {\n const item = await fetchRegistryItem(name, {\n registryUrl: options.registryUrl,\n preset: options.preset ?? \"default\",\n });\n\n console.log(`Name: ${item.name}`);\n console.log(`Type: ${item.type}`);\n if (item.description) {\n console.log(`Description: ${item.description}`);\n }\n if (item.dependencies?.length) {\n console.log(`Dependencies: ${item.dependencies.join(\", \")}`);\n }\n if (item.registryDependencies?.length) {\n console.log(\n `Registry dependencies: ${item.registryDependencies.join(\", \")}`,\n );\n }\n if (item.composition) {\n console.log(`Composition: ${item.composition.id} (${item.composition.component})`);\n }\n console.log(`\\nFiles:`);\n for (const file of item.files) {\n console.log(` - ${file.path} (${file.type})`);\n }\n}\n"],"mappings":";;;AAAA,SAAS,eAAe;;;ACAxB,SAAS,gBAAgB;AACzB,OAAOA,WAAU;;;ACDjB,OAAO,QAAQ;AAYf,eAAsB,aACpB,UACA,MACe;AACf,MAAI,CAAE,MAAM,GAAG,WAAW,QAAQ,GAAI;AACpC,UAAM,IAAI,MAAM,wBAAwB,QAAQ,EAAE;AAAA,EACpD;AAEA,QAAM,UAAU,MAAM,GAAG,SAAS,UAAU,OAAO;AAEnD,MAAI,QAAQ,SAAS,OAAO,KAAK,EAAE,GAAG,KAAK,QAAQ,SAAS,QAAQ,KAAK,EAAE,IAAI,GAAG;AAChF,YAAQ,IAAI,uBAAoB,KAAK,EAAE,kCAAkC;AACzE;AAAA,EACF;AAEA,QAAM,aACJ,KAAK,cACL,kBAAkB,KAAK,UAAU,YAAY,EAAE,QAAQ,gBAAgB,EAAE,CAAC;AAC5E,QAAM,kBAAkB,YAAY,KAAK,SAAS,YAAY,UAAU;AAExE,MAAI,UAAU;AAEd,MAAI,CAAC,QAAQ,SAAS,eAAe,GAAG;AACtC,UAAM,kBAAkB,oBAAoB,OAAO;AACnD,QAAI,oBAAoB,IAAI;AAC1B,gBAAU,GAAG,eAAe;AAAA,EAAK,OAAO;AAAA,IAC1C,OAAO;AACL,YAAM,WAAW,QAAQ,QAAQ,MAAM,eAAe,IAAI;AAC1D,gBACE,QAAQ,MAAM,GAAG,QAAQ,IAAI,kBAAkB,OAAO,QAAQ,MAAM,QAAQ;AAAA,IAChF;AAAA,EACF;AAEA,QAAM,mBAAmB;AAAA,cACb,KAAK,EAAE;AAAA,qBACA,KAAK,SAAS;AAAA,4BACP,KAAK,gBAAgB;AAAA,eAClC,KAAK,GAAG;AAAA,iBACN,KAAK,KAAK;AAAA,kBACT,KAAK,MAAM;AAAA;AAG3B,MAAI,QAAQ,SAAS,KAAK,GAAG;AAC3B,cA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Ac;AAAA,MAClB,OAAO,QAAQ;AAAA,MACf,aAAa,QAAQ;AAAA,IACvB,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ;AAAA,MACN,iBAAiB,QAAQ,MAAM,UAAU;AAAA,IAC3C;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,MAAM,EACd,YAAY,4BAA4B,EACxC,SAAS,UAAU,gBAAgB,EACnC;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,qBAAqB,mBAAmB,SAAS,EACxD,OAAO,OAAO,MAAc,YAAY;AACvC,MAAI;AACF,UAAM,YAAY,MAAM;AAAA,MACtB,aAAa,QAAQ;AAAA,MACrB,QAAQ,QAAQ;AAAA,IAClB,CAAC;AAAA,EACH,SAAS,OAAO;AACd,YAAQ;AAAA,MACN,iBAAiB,QAAQ,MAAM,UAAU;AAAA,IAC3C;AACA,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,OAAO,EACf,YAAY,yBAAyB,EACrC,SAAS,cAAc,uBAAuB,EAC9C,OAAO,CAAC,aAAsB;AAC7B,UAAQ,IAAI,UAAU,YAAY,eAAe;AACjD,UAAQ,IAAI,oBAAoB;AAClC,CAAC;AAEH,QAAQ,MAAM;","names":["path","fs","path","path","baseDir","fs","path","fs","path","path","execSync","fs","path","fs","path","path","fs","execSync","fs","path","isLocalRegistry","path","fs"]}
@@ -0,0 +1,33 @@
1
+ declare const DEFAULT_REGISTRY_URL = "https://remotionui.com/r";
2
+ type FetchRegistryOptions = {
3
+ registryUrl?: string;
4
+ preset?: string;
5
+ };
6
+ declare function fetchRegistryItem(name: string, options?: FetchRegistryOptions): Promise<RegistryItemJson>;
7
+
8
+ type RegistryFile = {
9
+ path: string;
10
+ type: string;
11
+ target?: string;
12
+ content?: string;
13
+ };
14
+ type CompositionMetaJson = {
15
+ id: string;
16
+ component: string;
17
+ durationInFrames: number;
18
+ fps: number;
19
+ width: number;
20
+ height: number;
21
+ importPath?: string;
22
+ };
23
+ type RegistryItemJson = {
24
+ name: string;
25
+ type: string;
26
+ description?: string;
27
+ dependencies?: string[];
28
+ registryDependencies?: string[];
29
+ composition?: CompositionMetaJson;
30
+ files: RegistryFile[];
31
+ };
32
+
33
+ export { type CompositionMetaJson, DEFAULT_REGISTRY_URL, type FetchRegistryOptions, type RegistryFile, type RegistryItemJson, fetchRegistryItem };
@@ -0,0 +1,35 @@
1
+ // src/registry/fetch-item.ts
2
+ import fs from "fs-extra";
3
+ import path from "path";
4
+ var DEFAULT_REGISTRY_URL = "https://remotionui.com/r";
5
+ async function fetchRegistryItem(name, options = {}) {
6
+ const registryUrl = options.registryUrl ?? process.env.REMOTION_UI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL;
7
+ const preset = options.preset ?? "default";
8
+ if (isLocalRegistry(registryUrl)) {
9
+ const filePath = path.join(
10
+ path.resolve(registryUrl),
11
+ "presets",
12
+ preset,
13
+ `${name}.json`
14
+ );
15
+ if (!await fs.pathExists(filePath)) {
16
+ throw new Error(`Registry item "${name}" not found at ${filePath}`);
17
+ }
18
+ const raw = await fs.readFile(filePath, "utf-8");
19
+ return JSON.parse(raw);
20
+ }
21
+ const url = `${registryUrl.replace(/\/$/, "")}/presets/${preset}/${name}.json`;
22
+ const response = await fetch(url);
23
+ if (!response.ok) {
24
+ throw new Error(`Failed to fetch registry item "${name}" from ${url}`);
25
+ }
26
+ return response.json();
27
+ }
28
+ function isLocalRegistry(registryUrl) {
29
+ return registryUrl.startsWith("/") || registryUrl.startsWith("./") || registryUrl.startsWith("../") || registryUrl.startsWith("file:");
30
+ }
31
+ export {
32
+ DEFAULT_REGISTRY_URL,
33
+ fetchRegistryItem
34
+ };
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/registry/fetch-item.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport type { RegistryItemJson } from \"./index.js\";\n\nexport const DEFAULT_REGISTRY_URL = \"https://remotionui.com/r\";\n\nexport type FetchRegistryOptions = {\n registryUrl?: string;\n preset?: string;\n};\n\nexport async function fetchRegistryItem(\n name: string,\n options: FetchRegistryOptions = {},\n): Promise<RegistryItemJson> {\n const registryUrl =\n options.registryUrl ??\n process.env.REMOTION_UI_REGISTRY_URL ??\n DEFAULT_REGISTRY_URL;\n const preset = options.preset ?? \"default\";\n\n if (isLocalRegistry(registryUrl)) {\n const filePath = path.join(\n path.resolve(registryUrl),\n \"presets\",\n preset,\n `${name}.json`,\n );\n\n if (!(await fs.pathExists(filePath))) {\n throw new Error(`Registry item \"${name}\" not found at ${filePath}`);\n }\n\n const raw = await fs.readFile(filePath, \"utf-8\");\n return JSON.parse(raw) as RegistryItemJson;\n }\n\n const url = `${registryUrl.replace(/\\/$/, \"\")}/presets/${preset}/${name}.json`;\n const response = await fetch(url);\n\n if (!response.ok) {\n throw new Error(`Failed to fetch registry item \"${name}\" from ${url}`);\n }\n\n return response.json() as Promise<RegistryItemJson>;\n}\n\nfunction isLocalRegistry(registryUrl: string): boolean {\n return (\n registryUrl.startsWith(\"/\") ||\n registryUrl.startsWith(\"./\") ||\n registryUrl.startsWith(\"../\") ||\n registryUrl.startsWith(\"file:\")\n );\n}\n"],"mappings":";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAGV,IAAM,uBAAuB;AAOpC,eAAsB,kBACpB,MACA,UAAgC,CAAC,GACN;AAC3B,QAAM,cACJ,QAAQ,eACR,QAAQ,IAAI,4BACZ;AACF,QAAM,SAAS,QAAQ,UAAU;AAEjC,MAAI,gBAAgB,WAAW,GAAG;AAChC,UAAM,WAAW,KAAK;AAAA,MACpB,KAAK,QAAQ,WAAW;AAAA,MACxB;AAAA,MACA;AAAA,MACA,GAAG,IAAI;AAAA,IACT;AAEA,QAAI,CAAE,MAAM,GAAG,WAAW,QAAQ,GAAI;AACpC,YAAM,IAAI,MAAM,kBAAkB,IAAI,kBAAkB,QAAQ,EAAE;AAAA,IACpE;AAEA,UAAM,MAAM,MAAM,GAAG,SAAS,UAAU,OAAO;AAC/C,WAAO,KAAK,MAAM,GAAG;AAAA,EACvB;AAEA,QAAM,MAAM,GAAG,YAAY,QAAQ,OAAO,EAAE,CAAC,YAAY,MAAM,IAAI,IAAI;AACvE,QAAM,WAAW,MAAM,MAAM,GAAG;AAEhC,MAAI,CAAC,SAAS,IAAI;AAChB,UAAM,IAAI,MAAM,kCAAkC,IAAI,UAAU,GAAG,EAAE;AAAA,EACvE;AAEA,SAAO,SAAS,KAAK;AACvB;AAEA,SAAS,gBAAgB,aAA8B;AACrD,SACE,YAAY,WAAW,GAAG,KAC1B,YAAY,WAAW,IAAI,KAC3B,YAAY,WAAW,KAAK,KAC5B,YAAY,WAAW,OAAO;AAElC;","names":[]}
@@ -0,0 +1,338 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const remotionUiConfigSchema: z.ZodObject<{
4
+ $schema: z.ZodOptional<z.ZodString>;
5
+ preset: z.ZodDefault<z.ZodString>;
6
+ tsx: z.ZodDefault<z.ZodBoolean>;
7
+ remotion: z.ZodDefault<z.ZodObject<{
8
+ version: z.ZodDefault<z.ZodString>;
9
+ config: z.ZodDefault<z.ZodString>;
10
+ root: z.ZodDefault<z.ZodString>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ version: string;
13
+ config: string;
14
+ root: string;
15
+ }, {
16
+ version?: string | undefined;
17
+ config?: string | undefined;
18
+ root?: string | undefined;
19
+ }>>;
20
+ aliases: z.ZodDefault<z.ZodObject<{
21
+ primitives: z.ZodDefault<z.ZodString>;
22
+ scenes: z.ZodDefault<z.ZodString>;
23
+ compositions: z.ZodDefault<z.ZodString>;
24
+ lib: z.ZodDefault<z.ZodString>;
25
+ hooks: z.ZodDefault<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ primitives: string;
28
+ scenes: string;
29
+ compositions: string;
30
+ lib: string;
31
+ hooks: string;
32
+ }, {
33
+ primitives?: string | undefined;
34
+ scenes?: string | undefined;
35
+ compositions?: string | undefined;
36
+ lib?: string | undefined;
37
+ hooks?: string | undefined;
38
+ }>>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ preset: string;
41
+ tsx: boolean;
42
+ remotion: {
43
+ version: string;
44
+ config: string;
45
+ root: string;
46
+ };
47
+ aliases: {
48
+ primitives: string;
49
+ scenes: string;
50
+ compositions: string;
51
+ lib: string;
52
+ hooks: string;
53
+ };
54
+ $schema?: string | undefined;
55
+ }, {
56
+ $schema?: string | undefined;
57
+ preset?: string | undefined;
58
+ tsx?: boolean | undefined;
59
+ remotion?: {
60
+ version?: string | undefined;
61
+ config?: string | undefined;
62
+ root?: string | undefined;
63
+ } | undefined;
64
+ aliases?: {
65
+ primitives?: string | undefined;
66
+ scenes?: string | undefined;
67
+ compositions?: string | undefined;
68
+ lib?: string | undefined;
69
+ hooks?: string | undefined;
70
+ } | undefined;
71
+ }>;
72
+ type RemotionUiConfig = z.infer<typeof remotionUiConfigSchema>;
73
+ declare const compositionMetaSchema: z.ZodObject<{
74
+ id: z.ZodString;
75
+ component: z.ZodString;
76
+ durationInFrames: z.ZodNumber;
77
+ fps: z.ZodNumber;
78
+ width: z.ZodNumber;
79
+ height: z.ZodNumber;
80
+ importPath: z.ZodOptional<z.ZodString>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ id: string;
83
+ component: string;
84
+ durationInFrames: number;
85
+ fps: number;
86
+ width: number;
87
+ height: number;
88
+ importPath?: string | undefined;
89
+ }, {
90
+ id: string;
91
+ component: string;
92
+ durationInFrames: number;
93
+ fps: number;
94
+ width: number;
95
+ height: number;
96
+ importPath?: string | undefined;
97
+ }>;
98
+ declare const registryItemSchema: z.ZodObject<{
99
+ name: z.ZodString;
100
+ type: z.ZodString;
101
+ description: z.ZodOptional<z.ZodString>;
102
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
103
+ registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
104
+ composition: z.ZodOptional<z.ZodObject<{
105
+ id: z.ZodString;
106
+ component: z.ZodString;
107
+ durationInFrames: z.ZodNumber;
108
+ fps: z.ZodNumber;
109
+ width: z.ZodNumber;
110
+ height: z.ZodNumber;
111
+ importPath: z.ZodOptional<z.ZodString>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ id: string;
114
+ component: string;
115
+ durationInFrames: number;
116
+ fps: number;
117
+ width: number;
118
+ height: number;
119
+ importPath?: string | undefined;
120
+ }, {
121
+ id: string;
122
+ component: string;
123
+ durationInFrames: number;
124
+ fps: number;
125
+ width: number;
126
+ height: number;
127
+ importPath?: string | undefined;
128
+ }>>;
129
+ files: z.ZodArray<z.ZodObject<{
130
+ path: z.ZodString;
131
+ type: z.ZodString;
132
+ target: z.ZodOptional<z.ZodString>;
133
+ content: z.ZodOptional<z.ZodString>;
134
+ }, "strip", z.ZodTypeAny, {
135
+ path: string;
136
+ type: string;
137
+ target?: string | undefined;
138
+ content?: string | undefined;
139
+ }, {
140
+ path: string;
141
+ type: string;
142
+ target?: string | undefined;
143
+ content?: string | undefined;
144
+ }>, "many">;
145
+ }, "strip", z.ZodTypeAny, {
146
+ type: string;
147
+ name: string;
148
+ files: {
149
+ path: string;
150
+ type: string;
151
+ target?: string | undefined;
152
+ content?: string | undefined;
153
+ }[];
154
+ description?: string | undefined;
155
+ dependencies?: string[] | undefined;
156
+ registryDependencies?: string[] | undefined;
157
+ composition?: {
158
+ id: string;
159
+ component: string;
160
+ durationInFrames: number;
161
+ fps: number;
162
+ width: number;
163
+ height: number;
164
+ importPath?: string | undefined;
165
+ } | undefined;
166
+ }, {
167
+ type: string;
168
+ name: string;
169
+ files: {
170
+ path: string;
171
+ type: string;
172
+ target?: string | undefined;
173
+ content?: string | undefined;
174
+ }[];
175
+ description?: string | undefined;
176
+ dependencies?: string[] | undefined;
177
+ registryDependencies?: string[] | undefined;
178
+ composition?: {
179
+ id: string;
180
+ component: string;
181
+ durationInFrames: number;
182
+ fps: number;
183
+ width: number;
184
+ height: number;
185
+ importPath?: string | undefined;
186
+ } | undefined;
187
+ }>;
188
+ type RegistryItem = z.infer<typeof registryItemSchema>;
189
+ declare const registrySchema: z.ZodObject<{
190
+ $schema: z.ZodOptional<z.ZodString>;
191
+ name: z.ZodString;
192
+ homepage: z.ZodOptional<z.ZodString>;
193
+ items: z.ZodArray<z.ZodObject<{
194
+ name: z.ZodString;
195
+ type: z.ZodString;
196
+ description: z.ZodOptional<z.ZodString>;
197
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
198
+ registryDependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
199
+ composition: z.ZodOptional<z.ZodObject<{
200
+ id: z.ZodString;
201
+ component: z.ZodString;
202
+ durationInFrames: z.ZodNumber;
203
+ fps: z.ZodNumber;
204
+ width: z.ZodNumber;
205
+ height: z.ZodNumber;
206
+ importPath: z.ZodOptional<z.ZodString>;
207
+ }, "strip", z.ZodTypeAny, {
208
+ id: string;
209
+ component: string;
210
+ durationInFrames: number;
211
+ fps: number;
212
+ width: number;
213
+ height: number;
214
+ importPath?: string | undefined;
215
+ }, {
216
+ id: string;
217
+ component: string;
218
+ durationInFrames: number;
219
+ fps: number;
220
+ width: number;
221
+ height: number;
222
+ importPath?: string | undefined;
223
+ }>>;
224
+ files: z.ZodArray<z.ZodObject<{
225
+ path: z.ZodString;
226
+ type: z.ZodString;
227
+ target: z.ZodOptional<z.ZodString>;
228
+ content: z.ZodOptional<z.ZodString>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ path: string;
231
+ type: string;
232
+ target?: string | undefined;
233
+ content?: string | undefined;
234
+ }, {
235
+ path: string;
236
+ type: string;
237
+ target?: string | undefined;
238
+ content?: string | undefined;
239
+ }>, "many">;
240
+ }, "strip", z.ZodTypeAny, {
241
+ type: string;
242
+ name: string;
243
+ files: {
244
+ path: string;
245
+ type: string;
246
+ target?: string | undefined;
247
+ content?: string | undefined;
248
+ }[];
249
+ description?: string | undefined;
250
+ dependencies?: string[] | undefined;
251
+ registryDependencies?: string[] | undefined;
252
+ composition?: {
253
+ id: string;
254
+ component: string;
255
+ durationInFrames: number;
256
+ fps: number;
257
+ width: number;
258
+ height: number;
259
+ importPath?: string | undefined;
260
+ } | undefined;
261
+ }, {
262
+ type: string;
263
+ name: string;
264
+ files: {
265
+ path: string;
266
+ type: string;
267
+ target?: string | undefined;
268
+ content?: string | undefined;
269
+ }[];
270
+ description?: string | undefined;
271
+ dependencies?: string[] | undefined;
272
+ registryDependencies?: string[] | undefined;
273
+ composition?: {
274
+ id: string;
275
+ component: string;
276
+ durationInFrames: number;
277
+ fps: number;
278
+ width: number;
279
+ height: number;
280
+ importPath?: string | undefined;
281
+ } | undefined;
282
+ }>, "many">;
283
+ }, "strip", z.ZodTypeAny, {
284
+ name: string;
285
+ items: {
286
+ type: string;
287
+ name: string;
288
+ files: {
289
+ path: string;
290
+ type: string;
291
+ target?: string | undefined;
292
+ content?: string | undefined;
293
+ }[];
294
+ description?: string | undefined;
295
+ dependencies?: string[] | undefined;
296
+ registryDependencies?: string[] | undefined;
297
+ composition?: {
298
+ id: string;
299
+ component: string;
300
+ durationInFrames: number;
301
+ fps: number;
302
+ width: number;
303
+ height: number;
304
+ importPath?: string | undefined;
305
+ } | undefined;
306
+ }[];
307
+ $schema?: string | undefined;
308
+ homepage?: string | undefined;
309
+ }, {
310
+ name: string;
311
+ items: {
312
+ type: string;
313
+ name: string;
314
+ files: {
315
+ path: string;
316
+ type: string;
317
+ target?: string | undefined;
318
+ content?: string | undefined;
319
+ }[];
320
+ description?: string | undefined;
321
+ dependencies?: string[] | undefined;
322
+ registryDependencies?: string[] | undefined;
323
+ composition?: {
324
+ id: string;
325
+ component: string;
326
+ durationInFrames: number;
327
+ fps: number;
328
+ width: number;
329
+ height: number;
330
+ importPath?: string | undefined;
331
+ } | undefined;
332
+ }[];
333
+ $schema?: string | undefined;
334
+ homepage?: string | undefined;
335
+ }>;
336
+ type Registry = z.infer<typeof registrySchema>;
337
+
338
+ export { type Registry, type RegistryItem, type RemotionUiConfig, compositionMetaSchema, registryItemSchema, registrySchema, remotionUiConfigSchema };
@@ -0,0 +1,57 @@
1
+ // src/schema/index.ts
2
+ import { z } from "zod";
3
+ var remotionUiConfigSchema = z.object({
4
+ $schema: z.string().optional(),
5
+ preset: z.string().default("default"),
6
+ tsx: z.boolean().default(true),
7
+ remotion: z.object({
8
+ version: z.string().default("4"),
9
+ config: z.string().default("remotion.config.ts"),
10
+ root: z.string().default("src/Root.tsx")
11
+ }).default({}),
12
+ aliases: z.object({
13
+ primitives: z.string().default("@/remotion/primitives"),
14
+ scenes: z.string().default("@/remotion/scenes"),
15
+ compositions: z.string().default("@/compositions"),
16
+ lib: z.string().default("@/remotion/lib"),
17
+ hooks: z.string().default("@/remotion/hooks")
18
+ }).default({})
19
+ });
20
+ var compositionMetaSchema = z.object({
21
+ id: z.string(),
22
+ component: z.string(),
23
+ durationInFrames: z.number(),
24
+ fps: z.number(),
25
+ width: z.number(),
26
+ height: z.number(),
27
+ importPath: z.string().optional()
28
+ });
29
+ var registryItemSchema = z.object({
30
+ name: z.string(),
31
+ type: z.string(),
32
+ description: z.string().optional(),
33
+ dependencies: z.array(z.string()).optional(),
34
+ registryDependencies: z.array(z.string()).optional(),
35
+ composition: compositionMetaSchema.optional(),
36
+ files: z.array(
37
+ z.object({
38
+ path: z.string(),
39
+ type: z.string(),
40
+ target: z.string().optional(),
41
+ content: z.string().optional()
42
+ })
43
+ )
44
+ });
45
+ var registrySchema = z.object({
46
+ $schema: z.string().optional(),
47
+ name: z.string(),
48
+ homepage: z.string().optional(),
49
+ items: z.array(registryItemSchema)
50
+ });
51
+ export {
52
+ compositionMetaSchema,
53
+ registryItemSchema,
54
+ registrySchema,
55
+ remotionUiConfigSchema
56
+ };
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/schema/index.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const remotionUiConfigSchema = z.object({\n $schema: z.string().optional(),\n preset: z.string().default(\"default\"),\n tsx: z.boolean().default(true),\n remotion: z\n .object({\n version: z.string().default(\"4\"),\n config: z.string().default(\"remotion.config.ts\"),\n root: z.string().default(\"src/Root.tsx\"),\n })\n .default({}),\n aliases: z\n .object({\n primitives: z.string().default(\"@/remotion/primitives\"),\n scenes: z.string().default(\"@/remotion/scenes\"),\n compositions: z.string().default(\"@/compositions\"),\n lib: z.string().default(\"@/remotion/lib\"),\n hooks: z.string().default(\"@/remotion/hooks\"),\n })\n .default({}),\n});\n\nexport type RemotionUiConfig = z.infer<typeof remotionUiConfigSchema>;\n\nexport const compositionMetaSchema = z.object({\n id: z.string(),\n component: z.string(),\n durationInFrames: z.number(),\n fps: z.number(),\n width: z.number(),\n height: z.number(),\n importPath: z.string().optional(),\n});\n\nexport const registryItemSchema = z.object({\n name: z.string(),\n type: z.string(),\n description: z.string().optional(),\n dependencies: z.array(z.string()).optional(),\n registryDependencies: z.array(z.string()).optional(),\n composition: compositionMetaSchema.optional(),\n files: z.array(\n z.object({\n path: z.string(),\n type: z.string(),\n target: z.string().optional(),\n content: z.string().optional(),\n }),\n ),\n});\n\nexport type RegistryItem = z.infer<typeof registryItemSchema>;\n\nexport const registrySchema = z.object({\n $schema: z.string().optional(),\n name: z.string(),\n homepage: z.string().optional(),\n items: z.array(registryItemSchema),\n});\n\nexport type Registry = z.infer<typeof registrySchema>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yBAAyB,EAAE,OAAO;AAAA,EAC7C,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,QAAQ,EAAE,OAAO,EAAE,QAAQ,SAAS;AAAA,EACpC,KAAK,EAAE,QAAQ,EAAE,QAAQ,IAAI;AAAA,EAC7B,UAAU,EACP,OAAO;AAAA,IACN,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG;AAAA,IAC/B,QAAQ,EAAE,OAAO,EAAE,QAAQ,oBAAoB;AAAA,IAC/C,MAAM,EAAE,OAAO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A,EACrC,SAAS,EAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,MAAM,EAAE,OAAO;AAAA,EACf,UAAU,EAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,OAAO,EAAE,MAAM,kBAAkB;AACnC,CAAC;","names":[]}
package/package.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "remotion-ui",
3
+ "version": "0.1.0",
4
+ "description": "Add Remotion video components to your project — copy-paste, fully customisable.",
5
+ "homepage": "https://remotionui.com",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/riaz37/remotionui.git",
9
+ "directory": "packages/remotion-ui"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/riaz37/remotionui/issues"
13
+ },
14
+ "keywords": [
15
+ "remotion",
16
+ "video",
17
+ "react",
18
+ "cli",
19
+ "components",
20
+ "registry"
21
+ ],
22
+ "license": "MIT",
23
+ "type": "module",
24
+ "bin": {
25
+ "remotion-ui": "./dist/index.js"
26
+ },
27
+ "files": ["dist", "templates"],
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "default": "./dist/index.js"
32
+ },
33
+ "./schema": {
34
+ "types": "./dist/schema/index.d.ts",
35
+ "default": "./dist/schema/index.js"
36
+ },
37
+ "./registry": {
38
+ "types": "./dist/registry/index.d.ts",
39
+ "default": "./dist/registry/index.js"
40
+ }
41
+ },
42
+ "scripts": {
43
+ "build": "tsup",
44
+ "prepublishOnly": "pnpm build",
45
+ "dev": "tsup --watch",
46
+ "lint": "tsc --noEmit",
47
+ "test": "vitest run"
48
+ },
49
+ "dependencies": {
50
+ "commander": "^13.1.0",
51
+ "cosmiconfig": "^9.0.0",
52
+ "fs-extra": "^11.3.0",
53
+ "zod": "^3.24.2"
54
+ },
55
+ "devDependencies": {
56
+ "@remotionui/typescript-config": "workspace:*",
57
+ "@types/fs-extra": "^11.0.4",
58
+ "@types/node": "^22.13.4",
59
+ "tsup": "^8.3.6",
60
+ "typescript": "^5.7.3",
61
+ "vitest": "^3.0.5"
62
+ },
63
+ "publishConfig": {
64
+ "access": "public"
65
+ }
66
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "my-video",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "remotion studio",
7
+ "build": "remotion bundle",
8
+ "render": "remotion render"
9
+ },
10
+ "dependencies": {
11
+ "@remotion/cli": "^4.0.242",
12
+ "react": "^19.0.0",
13
+ "react-dom": "^19.0.0",
14
+ "remotion": "^4.0.242"
15
+ },
16
+ "devDependencies": {
17
+ "@types/react": "^19.0.10",
18
+ "typescript": "^5.7.3"
19
+ }
20
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://remotionui.com/schema.json",
3
+ "preset": "default",
4
+ "tsx": true,
5
+ "remotion": {
6
+ "version": "4",
7
+ "config": "remotion.config.ts",
8
+ "root": "src/Root.tsx"
9
+ },
10
+ "aliases": {
11
+ "primitives": "@/remotion/primitives",
12
+ "scenes": "@/remotion/scenes",
13
+ "compositions": "@/compositions",
14
+ "lib": "@/remotion/lib",
15
+ "hooks": "@/remotion/hooks"
16
+ }
17
+ }
@@ -0,0 +1,4 @@
1
+ import { Config } from "@remotion/cli/config";
2
+
3
+ Config.setVideoImageFormat("jpeg");
4
+ Config.setOverwriteOutput(true);
@@ -0,0 +1,8 @@
1
+ import { Composition } from "remotion";
2
+
3
+ export const RemotionRoot: React.FC = () => {
4
+ return (
5
+ <>
6
+ </>
7
+ );
8
+ };
@@ -0,0 +1,4 @@
1
+ import { registerRoot } from "remotion";
2
+ import { RemotionRoot } from "./Root";
3
+
4
+ registerRoot(RemotionRoot);
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "jsx": "react-jsx",
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "baseUrl": ".",
11
+ "paths": {
12
+ "@/*": ["src/*"]
13
+ }
14
+ },
15
+ "include": ["src"]
16
+ }