Skip to content

🎥 Make videos programmatically with React

publish codex plugin

Jonny Burger1c43afec4c76
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index 70bdba1210..03dcefe90f 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -1015,7 +1015,6 @@ const sidebars: SidebarsConfig = {
},
items: [
'encoding',
- 'sample-rate',
'stills',
'scaling',
'transparent-videos',
@@ -1029,6 +1028,7 @@ const sidebars: SidebarsConfig = {
'metadata',
'hardware-acceleration',
'hdr',
+ 'sample-rate',
],
},
{
diff --git a/packages/it-tests/src/templates/publish.ts b/packages/it-tests/src/templates/publish.ts
index ce22e984f4..59ef6a0544 100644
--- a/packages/it-tests/src/templates/publish.ts
+++ b/packages/it-tests/src/templates/publish.ts
@@ -83,6 +83,47 @@ const publish = async (template: MinimalTemplate) => {
await $`git push origin ${defaultBranch.trim()}`.cwd(workingDir);
};
+const publishCodexPlugin = async () => {
+ const codexPluginDir = path.join(__dirname, '..', '..', '..', 'codex-plugin');
+
+ // Run the build step to assemble skills
+ await $`bun build.mts`.cwd(codexPluginDir);
+
+ const tmpDir = tmpdir();
+ const workingDir = path.join(tmpDir, `codex-plugin-${Math.random()}`);
+
+ await $`git clone [email protected]:remotion-dev/codex-plugin.git ${workingDir} --depth 1`;
+
+ const defaultBranch = await $`git branch --show-current`
+ .cwd(workingDir)
+ .text();
+ const existingFilesInRepo = await $`git ls-files`.cwd(workingDir).quiet();
+ for (const file of existingFilesInRepo.stdout
+ .toString('utf-8')
+ .trim()
+ .split('\n')) {
+ if (file === '') continue;
+ await $`rm ${file}`.cwd(workingDir).quiet();
+ }
+
+ const filesToCopy = ['assets', 'skills', 'marketplace.json', 'README.md'];
+ for (const entry of filesToCopy) {
+ const src = path.join(codexPluginDir, entry);
+ const dst = path.join(workingDir, entry);
+ cpSync(src, dst, {recursive: true});
+ }
+
+ await $`git add .`.cwd(workingDir).nothrow();
+ const hasChanges = await $`git status --porcelain`.cwd(workingDir).text();
+ if (!hasChanges) {
+ console.log('No changes in codex-plugin');
+ return;
+ }
+
+ await $`git commit -m "Update codex plugin"`.cwd(workingDir);
+ await $`git push origin ${defaultBranch.trim()}`.cwd(workingDir);
+};
+
const CONCURRENCY = 1;
const results: PromiseSettledResult<void>[] = [];
@@ -95,6 +136,8 @@ for (let i = 0; i < templates.length; i += CONCURRENCY) {
results.push(...batchResults);
}
+results.push(...(await Promise.allSettled([publishCodexPlugin()])));
+
const failures = results.filter(
(r): r is PromiseRejectedResult => r.status === 'rejected',
);