remotion-ui 0.1.0 → 0.2.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/README.md +14 -0
- package/dist/index.js +256 -34
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -21,6 +21,20 @@ Components are copied into your project as source files. You own the code.
|
|
|
21
21
|
| `remotion-ui add <name>` | Add component(s) from the registry |
|
|
22
22
|
| `remotion-ui search -q <query>` | Search the registry |
|
|
23
23
|
| `remotion-ui view <name>` | View registry item metadata |
|
|
24
|
+
| `remotion-ui diff <name>` | Diff installed vs registry |
|
|
25
|
+
| `remotion-ui update <name>` | Re-install from registry |
|
|
26
|
+
| `remotion-ui build [registry.json]` | Build a custom registry |
|
|
27
|
+
|
|
28
|
+
## Publishing (maintainers)
|
|
29
|
+
|
|
30
|
+
From the monorepo root, with a granular npm token (read/write + bypass 2FA):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cp .env.example .env # add NPM_TOKEN=...
|
|
34
|
+
pnpm publish:cli
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or in GitHub Actions: add `NPM_TOKEN` as a repo secret and run the **Publish CLI** workflow.
|
|
24
38
|
|
|
25
39
|
## Configuration
|
|
26
40
|
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Command } from "commander";
|
|
|
5
5
|
|
|
6
6
|
// src/commands/add.ts
|
|
7
7
|
import { execSync } from "child_process";
|
|
8
|
-
import
|
|
8
|
+
import path6 from "path";
|
|
9
9
|
|
|
10
10
|
// src/remotion/composition-patch.ts
|
|
11
11
|
import fs from "fs-extra";
|
|
@@ -273,12 +273,43 @@ function getInstallCommand(pm, packages) {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
// src/
|
|
276
|
+
// src/preflights/preflight-add.ts
|
|
277
277
|
import fs4 from "fs-extra";
|
|
278
278
|
import path4 from "path";
|
|
279
|
+
async function preflightAdd(cwd) {
|
|
280
|
+
const configPath = path4.join(cwd, "remotion-ui.json");
|
|
281
|
+
if (!await fs4.pathExists(configPath)) {
|
|
282
|
+
throw new Error(
|
|
283
|
+
`No remotion-ui.json found in ${cwd}. Run "remotion-ui init" first.`
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
const config = await getConfig(cwd);
|
|
287
|
+
const pkgPath = path4.join(cwd, "package.json");
|
|
288
|
+
if (!await fs4.pathExists(pkgPath)) {
|
|
289
|
+
console.warn(" \u26A0 No package.json found \u2014 npm dependencies won't be installed.");
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const pkg = await fs4.readJson(pkgPath);
|
|
293
|
+
const remotionVersion = pkg.dependencies?.remotion ?? pkg.devDependencies?.remotion;
|
|
294
|
+
if (!remotionVersion) {
|
|
295
|
+
console.warn(" \u26A0 remotion is not in package.json dependencies.");
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const expectedMajor = config.remotion.version;
|
|
299
|
+
const installedMajor = remotionVersion.replace(/[^0-9].*$/, "");
|
|
300
|
+
if (expectedMajor && installedMajor && expectedMajor !== installedMajor) {
|
|
301
|
+
console.warn(
|
|
302
|
+
` \u26A0 Remotion major version mismatch: remotion-ui.json expects v${expectedMajor}, package.json has ${remotionVersion}`
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/utils/index.ts
|
|
308
|
+
import fs5 from "fs-extra";
|
|
309
|
+
import path5 from "path";
|
|
279
310
|
async function writeFile(filePath, content) {
|
|
280
|
-
await
|
|
281
|
-
await
|
|
311
|
+
await fs5.ensureDir(path5.dirname(filePath));
|
|
312
|
+
await fs5.writeFile(filePath, content, "utf-8");
|
|
282
313
|
}
|
|
283
314
|
|
|
284
315
|
// src/commands/add.ts
|
|
@@ -286,7 +317,8 @@ async function addCommand(components, options = {}) {
|
|
|
286
317
|
if (components.length === 0) {
|
|
287
318
|
throw new Error("Please specify at least one component to add.");
|
|
288
319
|
}
|
|
289
|
-
const cwd =
|
|
320
|
+
const cwd = path6.resolve(options.cwd ?? process.cwd());
|
|
321
|
+
await preflightAdd(cwd);
|
|
290
322
|
const config = await getConfig(cwd);
|
|
291
323
|
const installed = /* @__PURE__ */ new Set();
|
|
292
324
|
const dependencies = /* @__PURE__ */ new Set();
|
|
@@ -328,10 +360,10 @@ async function installComponent(name, ctx) {
|
|
|
328
360
|
}
|
|
329
361
|
const targetPath = resolveInstallPath(ctx.cwd, ctx.config, file);
|
|
330
362
|
await writeFile(targetPath, file.content);
|
|
331
|
-
console.log(` \u2713 ${
|
|
363
|
+
console.log(` \u2713 ${path6.relative(ctx.cwd, targetPath)}`);
|
|
332
364
|
}
|
|
333
365
|
if (item.composition && isCompositionItem(item.files)) {
|
|
334
|
-
const rootPath =
|
|
366
|
+
const rootPath = path6.resolve(ctx.cwd, ctx.config.remotion.root);
|
|
335
367
|
await patchRootTsx(rootPath, {
|
|
336
368
|
...item.composition,
|
|
337
369
|
importPath: item.composition.importPath ?? `@/compositions/${name}/index`
|
|
@@ -343,28 +375,167 @@ async function installComponent(name, ctx) {
|
|
|
343
375
|
ctx.installed.add(name);
|
|
344
376
|
}
|
|
345
377
|
|
|
346
|
-
// src/commands/
|
|
347
|
-
import
|
|
378
|
+
// src/commands/build.ts
|
|
379
|
+
import path8 from "path";
|
|
380
|
+
|
|
381
|
+
// src/registry/build-registry.ts
|
|
348
382
|
import fs6 from "fs-extra";
|
|
349
383
|
import path7 from "path";
|
|
384
|
+
async function readFileContent(appRoot, relativePath) {
|
|
385
|
+
const absolutePath = path7.join(appRoot, relativePath);
|
|
386
|
+
try {
|
|
387
|
+
return await fs6.readFile(absolutePath, "utf-8");
|
|
388
|
+
} catch {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async function buildRegistry(options) {
|
|
393
|
+
const registryPath = path7.resolve(options.registryPath);
|
|
394
|
+
const appRoot = path7.dirname(registryPath);
|
|
395
|
+
const preset = options.preset ?? "default";
|
|
396
|
+
const baseOutputDir = path7.resolve(options.outputDir);
|
|
397
|
+
const outputDir = path7.resolve(baseOutputDir, "presets", preset);
|
|
398
|
+
const registryRaw = await fs6.readFile(registryPath, "utf-8");
|
|
399
|
+
const registry = JSON.parse(registryRaw);
|
|
400
|
+
await fs6.mkdir(outputDir, { recursive: true });
|
|
401
|
+
const index = [];
|
|
402
|
+
for (const item of registry.items) {
|
|
403
|
+
const filesWithContent = [];
|
|
404
|
+
for (const file of item.files) {
|
|
405
|
+
const content = await readFileContent(appRoot, file.path);
|
|
406
|
+
filesWithContent.push({
|
|
407
|
+
...file,
|
|
408
|
+
...content !== null ? { content } : {}
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
const output = {
|
|
412
|
+
...item,
|
|
413
|
+
files: filesWithContent
|
|
414
|
+
};
|
|
415
|
+
await fs6.writeFile(
|
|
416
|
+
path7.join(outputDir, `${item.name}.json`),
|
|
417
|
+
JSON.stringify(output, null, 2),
|
|
418
|
+
"utf-8"
|
|
419
|
+
);
|
|
420
|
+
index.push({
|
|
421
|
+
name: item.name,
|
|
422
|
+
type: item.type,
|
|
423
|
+
description: item.description
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
await fs6.mkdir(baseOutputDir, { recursive: true });
|
|
427
|
+
await fs6.writeFile(
|
|
428
|
+
path7.join(baseOutputDir, "index.json"),
|
|
429
|
+
JSON.stringify(
|
|
430
|
+
{
|
|
431
|
+
name: registry.name,
|
|
432
|
+
homepage: registry.homepage,
|
|
433
|
+
items: index
|
|
434
|
+
},
|
|
435
|
+
null,
|
|
436
|
+
2
|
|
437
|
+
),
|
|
438
|
+
"utf-8"
|
|
439
|
+
);
|
|
440
|
+
return { itemCount: registry.items.length, outputDir };
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// src/commands/build.ts
|
|
444
|
+
async function buildCommand(registryPath = "registry.json", options = {}) {
|
|
445
|
+
const cwd = path8.resolve(options.cwd ?? process.cwd());
|
|
446
|
+
const resolvedRegistry = path8.resolve(cwd, registryPath);
|
|
447
|
+
const outputDir = options.outputDir ?? path8.join(path8.dirname(resolvedRegistry), "public", "r");
|
|
448
|
+
console.log("Building registry...");
|
|
449
|
+
const result = await buildRegistry({
|
|
450
|
+
registryPath: resolvedRegistry,
|
|
451
|
+
outputDir,
|
|
452
|
+
preset: options.preset
|
|
453
|
+
});
|
|
454
|
+
console.log(`
|
|
455
|
+
Registry built: ${result.itemCount} item(s)`);
|
|
456
|
+
console.log(`Output: ${result.outputDir}`);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// src/commands/diff.ts
|
|
460
|
+
import fs7 from "fs-extra";
|
|
461
|
+
import path9 from "path";
|
|
462
|
+
function printUnifiedDiff(filePath, installed, registry) {
|
|
463
|
+
const installedLines = installed.split("\n");
|
|
464
|
+
const registryLines = registry.split("\n");
|
|
465
|
+
const max = Math.max(installedLines.length, registryLines.length);
|
|
466
|
+
console.log(`--- ${filePath} (installed)`);
|
|
467
|
+
console.log(`+++ ${filePath} (registry)`);
|
|
468
|
+
for (let i = 0; i < max; i++) {
|
|
469
|
+
const a = installedLines[i];
|
|
470
|
+
const b = registryLines[i];
|
|
471
|
+
if (a === b) {
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
if (a !== void 0) {
|
|
475
|
+
console.log(`-${a}`);
|
|
476
|
+
}
|
|
477
|
+
if (b !== void 0) {
|
|
478
|
+
console.log(`+${b}`);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
async function diffCommand(name, options = {}) {
|
|
483
|
+
const cwd = path9.resolve(options.cwd ?? process.cwd());
|
|
484
|
+
const config = await getConfig(cwd);
|
|
485
|
+
const preset = options.preset ?? config.preset;
|
|
486
|
+
const item = await fetchRegistryItem(name, {
|
|
487
|
+
registryUrl: options.registryUrl,
|
|
488
|
+
preset
|
|
489
|
+
});
|
|
490
|
+
let hasDiff = false;
|
|
491
|
+
for (const file of item.files) {
|
|
492
|
+
if (!file.content) {
|
|
493
|
+
console.warn(` \u26A0 No registry content for ${file.path}`);
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
const targetPath = resolveInstallPath(cwd, config, file);
|
|
497
|
+
const relativePath = path9.relative(cwd, targetPath);
|
|
498
|
+
if (!await fs7.pathExists(targetPath)) {
|
|
499
|
+
console.log(`
|
|
500
|
+
${relativePath}: not installed`);
|
|
501
|
+
hasDiff = true;
|
|
502
|
+
continue;
|
|
503
|
+
}
|
|
504
|
+
const installed = await fs7.readFile(targetPath, "utf-8");
|
|
505
|
+
if (installed.trim() !== file.content.trim()) {
|
|
506
|
+
console.log(`
|
|
507
|
+
Diff for ${relativePath}:`);
|
|
508
|
+
printUnifiedDiff(relativePath, installed, file.content);
|
|
509
|
+
hasDiff = true;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
if (!hasDiff) {
|
|
513
|
+
console.log(`${name}: no differences (installed matches registry)`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
// src/commands/init.ts
|
|
518
|
+
import { execSync as execSync2 } from "child_process";
|
|
519
|
+
import fs9 from "fs-extra";
|
|
520
|
+
import path11 from "path";
|
|
350
521
|
|
|
351
522
|
// src/utils/get-template-dir.ts
|
|
352
|
-
import
|
|
353
|
-
import
|
|
523
|
+
import fs8 from "fs-extra";
|
|
524
|
+
import path10 from "path";
|
|
354
525
|
import { fileURLToPath } from "url";
|
|
355
526
|
function getTemplateDir(templateName) {
|
|
356
|
-
const currentDir =
|
|
527
|
+
const currentDir = path10.dirname(fileURLToPath(import.meta.url));
|
|
357
528
|
const candidates = [
|
|
358
529
|
// Bundled CLI: dist/index.js → packages/remotion-ui/templates
|
|
359
|
-
|
|
530
|
+
path10.resolve(currentDir, "../templates", templateName),
|
|
360
531
|
// Dev / subpath: dist/utils/*.js
|
|
361
|
-
|
|
532
|
+
path10.resolve(currentDir, "../../templates", templateName),
|
|
362
533
|
// Monorepo root: templates/
|
|
363
|
-
|
|
364
|
-
|
|
534
|
+
path10.resolve(currentDir, "../../../templates", templateName),
|
|
535
|
+
path10.resolve(currentDir, "../../../../templates", templateName)
|
|
365
536
|
];
|
|
366
537
|
for (const candidate of candidates) {
|
|
367
|
-
if (
|
|
538
|
+
if (fs8.existsSync(candidate)) {
|
|
368
539
|
return candidate;
|
|
369
540
|
}
|
|
370
541
|
}
|
|
@@ -373,21 +544,21 @@ function getTemplateDir(templateName) {
|
|
|
373
544
|
|
|
374
545
|
// src/commands/init.ts
|
|
375
546
|
async function initCommand(projectName = "my-video", options = {}) {
|
|
376
|
-
const cwd =
|
|
377
|
-
const targetDir =
|
|
547
|
+
const cwd = path11.resolve(options.cwd ?? process.cwd());
|
|
548
|
+
const targetDir = path11.join(cwd, projectName);
|
|
378
549
|
const templateDir = getTemplateDir("remotion-app");
|
|
379
|
-
if (!await
|
|
550
|
+
if (!await fs9.pathExists(templateDir)) {
|
|
380
551
|
throw new Error(`Template not found: ${templateDir}`);
|
|
381
552
|
}
|
|
382
|
-
if (await
|
|
553
|
+
if (await fs9.pathExists(targetDir)) {
|
|
383
554
|
throw new Error(`Directory already exists: ${targetDir}`);
|
|
384
555
|
}
|
|
385
556
|
console.log(`Creating Remotion project: ${projectName}`);
|
|
386
|
-
await
|
|
387
|
-
const pkgPath =
|
|
388
|
-
const pkg = await
|
|
557
|
+
await fs9.copy(templateDir, targetDir);
|
|
558
|
+
const pkgPath = path11.join(targetDir, "package.json");
|
|
559
|
+
const pkg = await fs9.readJson(pkgPath);
|
|
389
560
|
pkg.name = projectName;
|
|
390
|
-
await
|
|
561
|
+
await fs9.writeJson(pkgPath, pkg, { spaces: 2 });
|
|
391
562
|
const pm = await detectPackageManager(cwd);
|
|
392
563
|
console.log("Installing dependencies...");
|
|
393
564
|
if (pm === "pnpm") {
|
|
@@ -408,16 +579,25 @@ Next steps:`);
|
|
|
408
579
|
console.log(` npm run dev`);
|
|
409
580
|
}
|
|
410
581
|
|
|
582
|
+
// src/commands/update.ts
|
|
583
|
+
async function updateCommand(components, options = {}) {
|
|
584
|
+
if (components.length === 0) {
|
|
585
|
+
throw new Error("Please specify at least one component to update.");
|
|
586
|
+
}
|
|
587
|
+
console.log(`Updating ${components.length} component(s) from registry\u2026`);
|
|
588
|
+
await addCommand(components, options);
|
|
589
|
+
}
|
|
590
|
+
|
|
411
591
|
// src/registry/fetch-index.ts
|
|
412
|
-
import
|
|
413
|
-
import
|
|
592
|
+
import fs10 from "fs-extra";
|
|
593
|
+
import path12 from "path";
|
|
414
594
|
async function fetchRegistryIndex(registryUrl = process.env.REMOTION_UI_REGISTRY_URL ?? DEFAULT_REGISTRY_URL) {
|
|
415
595
|
if (isLocalRegistry2(registryUrl)) {
|
|
416
|
-
const filePath =
|
|
417
|
-
if (!await
|
|
596
|
+
const filePath = path12.join(path12.resolve(registryUrl), "index.json");
|
|
597
|
+
if (!await fs10.pathExists(filePath)) {
|
|
418
598
|
throw new Error(`Registry index not found at ${filePath}`);
|
|
419
599
|
}
|
|
420
|
-
const raw = await
|
|
600
|
+
const raw = await fs10.readFile(filePath, "utf-8");
|
|
421
601
|
return JSON.parse(raw);
|
|
422
602
|
}
|
|
423
603
|
const url = `${registryUrl.replace(/\/$/, "")}/index.json`;
|
|
@@ -482,7 +662,7 @@ Files:`);
|
|
|
482
662
|
|
|
483
663
|
// src/index.ts
|
|
484
664
|
var program = new Command();
|
|
485
|
-
program.name("remotion-ui").description("Add Remotion video components to your project").version("0.
|
|
665
|
+
program.name("remotion-ui").description("Add Remotion video components to your project").version("0.2.0");
|
|
486
666
|
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
667
|
try {
|
|
488
668
|
await initCommand(projectName, { yes: options.yes });
|
|
@@ -542,9 +722,51 @@ program.command("view").description("View registry item details").argument("<nam
|
|
|
542
722
|
process.exit(1);
|
|
543
723
|
}
|
|
544
724
|
});
|
|
545
|
-
program.command("
|
|
546
|
-
|
|
547
|
-
|
|
725
|
+
program.command("update").description("Update installed component(s) from registry (overwrites files)").argument("[components...]", "component names to update").option(
|
|
726
|
+
"-r, --registry-url <url>",
|
|
727
|
+
"Registry base URL or local path to public/r/"
|
|
728
|
+
).option("--preset <preset>", "Registry preset", "default").option("-y, --yes", "Skip confirmation prompts").action(async (components, options) => {
|
|
729
|
+
try {
|
|
730
|
+
await updateCommand(components, {
|
|
731
|
+
registryUrl: options.registryUrl,
|
|
732
|
+
preset: options.preset,
|
|
733
|
+
yes: options.yes
|
|
734
|
+
});
|
|
735
|
+
} catch (error) {
|
|
736
|
+
console.error(
|
|
737
|
+
error instanceof Error ? error.message : "Failed to update components"
|
|
738
|
+
);
|
|
739
|
+
process.exit(1);
|
|
740
|
+
}
|
|
741
|
+
});
|
|
742
|
+
program.command("diff").description("Diff installed component vs registry").argument("<name>", "component name").option(
|
|
743
|
+
"-r, --registry-url <url>",
|
|
744
|
+
"Registry base URL or local path to public/r/"
|
|
745
|
+
).option("--preset <preset>", "Registry preset", "default").action(async (name, options) => {
|
|
746
|
+
try {
|
|
747
|
+
await diffCommand(name, {
|
|
748
|
+
registryUrl: options.registryUrl,
|
|
749
|
+
preset: options.preset
|
|
750
|
+
});
|
|
751
|
+
} catch (error) {
|
|
752
|
+
console.error(
|
|
753
|
+
error instanceof Error ? error.message : "Diff failed"
|
|
754
|
+
);
|
|
755
|
+
process.exit(1);
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
program.command("build").description("Build a custom registry").argument("[registry]", "path to registry.json", "registry.json").option("-o, --output <dir>", "output directory for built registry").option("--preset <preset>", "registry preset name", "default").action(async (registry, options) => {
|
|
759
|
+
try {
|
|
760
|
+
await buildCommand(registry, {
|
|
761
|
+
outputDir: options.output,
|
|
762
|
+
preset: options.preset
|
|
763
|
+
});
|
|
764
|
+
} catch (error) {
|
|
765
|
+
console.error(
|
|
766
|
+
error instanceof Error ? error.message : "Build failed"
|
|
767
|
+
);
|
|
768
|
+
process.exit(1);
|
|
769
|
+
}
|
|
548
770
|
});
|
|
549
771
|
program.parse();
|
|
550
772
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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;A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AO,uBAAuB,cAAc,EAC5C;AAAA,EACC;AAAA,EACA;AACF,EACC,OAAO,OAAO,YAAsD;AACnE,MAAI;AACF,UAAM,cAAc;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"]}
|
|
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/preflights/preflight-add.ts","../src/utils/index.ts","../src/commands/build.ts","../src/registry/build-registry.ts","../src/commands/diff.ts","../src/commands/init.ts","../src/utils/get-template-dir.ts","../src/commands/update.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 { buildCommand } from \"./commands/build.js\";\nimport { diffCommand } from \"./commands/diff.js\";\nimport { initCommand } from \"./commands/init.js\";\nimport { updateCommand } from \"./commands/update.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.2.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(\"update\")\n .description(\"Update installed component(s) from registry (overwrites files)\")\n .argument(\"[components...]\", \"component names to update\")\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 updateCommand(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 update components\",\n );\n process.exit(1);\n }\n });\n\nprogram\n .command(\"diff\")\n .description(\"Diff installed component vs registry\")\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 diffCommand(name, {\n registryUrl: options.registryUrl,\n preset: options.preset,\n });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"Diff 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\", \"registry.json\")\n .option(\"-o, --output <dir>\", \"output directory for built registry\")\n .option(\"--preset <preset>\", \"registry preset name\", \"default\")\n .action(async (registry: string, options) => {\n try {\n await buildCommand(registry, {\n outputDir: options.output,\n preset: options.preset,\n });\n } catch (error) {\n console.error(\n error instanceof Error ? error.message : \"Build failed\",\n );\n process.exit(1);\n }\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 { preflightAdd } from \"../preflights/preflight-add.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 await preflightAdd(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\";\nimport { getConfig } from \"../utils/get-config.js\";\n\nexport async function preflightAdd(cwd: string): Promise<void> {\n const configPath = path.join(cwd, \"remotion-ui.json\");\n\n if (!(await fs.pathExists(configPath))) {\n throw new Error(\n `No remotion-ui.json found in ${cwd}. Run \"remotion-ui init\" first.`,\n );\n }\n\n const config = await getConfig(cwd);\n const pkgPath = path.join(cwd, \"package.json\");\n\n if (!(await fs.pathExists(pkgPath))) {\n console.warn(\" ⚠ No package.json found — npm dependencies won't be installed.\");\n return;\n }\n\n const pkg = (await fs.readJson(pkgPath)) as {\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n };\n\n const remotionVersion =\n pkg.dependencies?.remotion ?? pkg.devDependencies?.remotion;\n\n if (!remotionVersion) {\n console.warn(\" ⚠ remotion is not in package.json dependencies.\");\n return;\n }\n\n const expectedMajor = config.remotion.version;\n const installedMajor = remotionVersion.replace(/[^0-9].*$/, \"\");\n\n if (expectedMajor && installedMajor && expectedMajor !== installedMajor) {\n console.warn(\n ` ⚠ Remotion major version mismatch: remotion-ui.json expects v${expectedMajor}, package.json has ${remotionVersion}`,\n );\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 path from \"node:path\";\nimport { buildRegistry } from \"../registry/build-registry.js\";\n\nexport type BuildOptions = {\n cwd?: string;\n outputDir?: string;\n preset?: string;\n};\n\nexport async function buildCommand(\n registryPath = \"registry.json\",\n options: BuildOptions = {},\n): Promise<void> {\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const resolvedRegistry = path.resolve(cwd, registryPath);\n const outputDir =\n options.outputDir ?? path.join(path.dirname(resolvedRegistry), \"public\", \"r\");\n\n console.log(\"Building registry...\");\n const result = await buildRegistry({\n registryPath: resolvedRegistry,\n outputDir,\n preset: options.preset,\n });\n\n console.log(`\\nRegistry built: ${result.itemCount} item(s)`);\n console.log(`Output: ${result.outputDir}`);\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\n\ntype RegistryFile = {\n path: string;\n type: string;\n target?: string;\n content?: string;\n};\n\ntype RegistryItem = {\n name: string;\n type: string;\n description?: string;\n dependencies?: string[];\n registryDependencies?: string[];\n composition?: Record<string, unknown>;\n files: RegistryFile[];\n};\n\ntype Registry = {\n name: string;\n homepage?: string;\n items: RegistryItem[];\n};\n\nexport type BuildRegistryOptions = {\n registryPath: string;\n outputDir: string;\n preset?: string;\n};\n\nasync function readFileContent(\n appRoot: string,\n relativePath: string,\n): Promise<string | null> {\n const absolutePath = path.join(appRoot, relativePath);\n try {\n return await fs.readFile(absolutePath, \"utf-8\");\n } catch {\n return null;\n }\n}\n\nexport async function buildRegistry(\n options: BuildRegistryOptions,\n): Promise<{ itemCount: number; outputDir: string }> {\n const registryPath = path.resolve(options.registryPath);\n const appRoot = path.dirname(registryPath);\n const preset = options.preset ?? \"default\";\n const baseOutputDir = path.resolve(options.outputDir);\n const outputDir = path.resolve(baseOutputDir, \"presets\", preset);\n\n const registryRaw = await fs.readFile(registryPath, \"utf-8\");\n const registry: Registry = JSON.parse(registryRaw);\n\n await fs.mkdir(outputDir, { recursive: true });\n\n const index: Array<{ name: string; type: string; description?: string }> = [];\n\n for (const item of registry.items) {\n const filesWithContent = [];\n\n for (const file of item.files) {\n const content = await readFileContent(appRoot, file.path);\n filesWithContent.push({\n ...file,\n ...(content !== null ? { content } : {}),\n });\n }\n\n const output = {\n ...item,\n files: filesWithContent,\n };\n\n await fs.writeFile(\n path.join(outputDir, `${item.name}.json`),\n JSON.stringify(output, null, 2),\n \"utf-8\",\n );\n\n index.push({\n name: item.name,\n type: item.type,\n description: item.description,\n });\n }\n\n await fs.mkdir(baseOutputDir, { recursive: true });\n await fs.writeFile(\n path.join(baseOutputDir, \"index.json\"),\n JSON.stringify(\n {\n name: registry.name,\n homepage: registry.homepage,\n items: index,\n },\n null,\n 2,\n ),\n \"utf-8\",\n );\n\n return { itemCount: registry.items.length, outputDir };\n}\n","import fs from \"fs-extra\";\nimport path from \"node:path\";\nimport { fetchRegistryItem } from \"../registry/fetch-item.js\";\nimport { getConfig, resolveInstallPath } from \"../utils/get-config.js\";\n\nexport type DiffOptions = {\n cwd?: string;\n registryUrl?: string;\n preset?: string;\n};\n\nfunction printUnifiedDiff(\n filePath: string,\n installed: string,\n registry: string,\n): void {\n const installedLines = installed.split(\"\\n\");\n const registryLines = registry.split(\"\\n\");\n const max = Math.max(installedLines.length, registryLines.length);\n\n console.log(`--- ${filePath} (installed)`);\n console.log(`+++ ${filePath} (registry)`);\n\n for (let i = 0; i < max; i++) {\n const a = installedLines[i];\n const b = registryLines[i];\n\n if (a === b) {\n continue;\n }\n\n if (a !== undefined) {\n console.log(`-${a}`);\n }\n if (b !== undefined) {\n console.log(`+${b}`);\n }\n }\n}\n\nexport async function diffCommand(\n name: string,\n options: DiffOptions = {},\n): Promise<void> {\n const cwd = path.resolve(options.cwd ?? process.cwd());\n const config = await getConfig(cwd);\n const preset = options.preset ?? config.preset;\n\n const item = await fetchRegistryItem(name, {\n registryUrl: options.registryUrl,\n preset,\n });\n\n let hasDiff = false;\n\n for (const file of item.files) {\n if (!file.content) {\n console.warn(` ⚠ No registry content for ${file.path}`);\n continue;\n }\n\n const targetPath = resolveInstallPath(cwd, config, file);\n const relativePath = path.relative(cwd, targetPath);\n\n if (!(await fs.pathExists(targetPath))) {\n console.log(`\\n${relativePath}: not installed`);\n hasDiff = true;\n continue;\n }\n\n const installed = await fs.readFile(targetPath, \"utf-8\");\n\n if (installed.trim() !== file.content.trim()) {\n console.log(`\\nDiff for ${relativePath}:`);\n printUnifiedDiff(relativePath, installed, file.content);\n hasDiff = true;\n }\n }\n\n if (!hasDiff) {\n console.log(`${name}: no differences (installed matches registry)`);\n }\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 { addCommand, type AddOptions } from \"./add.js\";\n\nexport type UpdateOptions = AddOptions;\n\n/** Re-install a component from the registry, overwriting local files */\nexport async function updateCommand(\n components: string[],\n options: UpdateOptions = {},\n): Promise<void> {\n if (components.length === 0) {\n throw new Error(\"Please specify at least one component to update.\");\n }\n\n console.log(`Updating ${components.length} component(s) from registry…`);\n await addCommand(components, options);\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,EA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9B,aAAa,QAAQ;AAAA,MACrB,QAAQ,QAAQ;AAAA,MAChB,KAAK,QAAQ;AAAA,IACf,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,sCAAsC,EAClD,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,yBAAyB,eAAe,EAC/D,OAAO,sBAAsB,qCAAqC,EAClE,OAAO,qBAAqB,wBAAwB,SAAS,EAC7D,OAAO,OAAO,UAAkB,YAAY;AAC3C,MAAI;AACF,UAAM,aAAa,UAAU;AAAA,MAC3B,WAAW,QAAQ;AAAA,MACnB,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,QAAQ,MAAM;","names":["path","fs","path","path","baseDir","fs","path","fs","path","path","fs","fs","path","path","path","fs","path","path","fs","path","path","fs","execSync","fs","path","fs","path","path","fs","execSync","fs","path","isLocalRegistry","path","fs"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion-ui",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Add Remotion video components to your project — copy-paste, fully customisable.",
|
|
5
5
|
"homepage": "https://remotionui.com",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"prepublishOnly": "pnpm build",
|
|
45
45
|
"dev": "tsup --watch",
|
|
46
46
|
"lint": "tsc --noEmit",
|
|
47
|
-
"test": "vitest run"
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"publish:npm": "npm publish --access public"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"commander": "^13.1.0",
|