Skip to content

🎥 Make videos programmatically with React

alright

Jonny Burger17767b02ea15
diff --git a/packages/it-tests/src/monorepo/all-same-version.test.ts b/packages/it-tests/src/monorepo/all-same-version.test.ts
index 85e52da113..f1bd3af9f4 100644
--- a/packages/it-tests/src/monorepo/all-same-version.test.ts
+++ b/packages/it-tests/src/monorepo/all-same-version.test.ts
@@ -1,26 +1,13 @@
import {expect, test} from 'bun:test';
-import {existsSync, lstatSync, readFileSync, readdirSync} from 'fs';
-import path from 'path';
+import {existsSync, readFileSync} from 'fs';
+import {getAllPackages} from './get-all-packages';
-test('All packages require the same remotion version', () => {
- const packages = readdirSync(path.join(process.cwd(), '..'));
- const folders = packages.filter((p) =>
- lstatSync(path.join(process.cwd(), '..', p)).isDirectory(),
- );
+test('All monorepo packages need to have workspace:* as remotion version', () => {
+ const folders = getAllPackages();
let deps = 0;
for (const folder of folders) {
- const packageJsonPath = path.join(
- process.cwd(),
- '..',
- folder,
- 'package.json',
- );
- if (!existsSync(packageJsonPath)) {
- continue;
- }
-
- const json = readFileSync(packageJsonPath, 'utf-8');
+ const json = readFileSync(folder.path, 'utf-8');
const packageJson = JSON.parse(json);
const {
@@ -51,26 +38,17 @@ test('All packages require the same remotion version', () => {
expect(deps).toBeGreaterThan(75);
});
-test('All packages require the same remotion version', () => {
- const packages = readdirSync(path.join(process.cwd(), '..'));
- const folders = packages.filter((p) =>
- lstatSync(path.join(process.cwd(), '..', p)).isDirectory(),
- );
+test('All monorepo packages should have the same "version" field', () => {
+ const packages = getAllPackages();
const versions = new Set<string>();
- for (const folder of folders) {
- const packageJsonPath = path.join(
- process.cwd(),
- '..',
- folder,
- 'package.json',
- );
- if (!existsSync(packageJsonPath)) {
+ for (const folder of packages) {
+ if (!existsSync(folder.path)) {
continue;
}
- const json = readFileSync(packageJsonPath, 'utf-8');
+ const json = readFileSync(folder.path, 'utf-8');
const packageJson = JSON.parse(json);
versions.add(packageJson.version);
diff --git a/set-version.ts b/set-version.ts
index 827ac2d0a4..588260d8ef 100644
--- a/set-version.ts
+++ b/set-version.ts
@@ -8,6 +8,7 @@ import {
writeFileSync,
} from 'fs';
import path from 'path';
+import {FEATURED_TEMPLATES} from './packages/create-video/src/templates.tsx';
let version = process.argv[2];
let noCommit = process.argv.includes('--no-commit');
@@ -29,6 +30,13 @@ const dirs = readdirSync('packages')
);
for (const dir of [path.join('cloudrun', 'container'), ...dirs]) {
+ const localTemplates = FEATURED_TEMPLATES.map(
+ (t) => t.templateInMonorepo,
+ ).filter(Boolean) as string[];
+ if (localTemplates.includes(dir)) {
+ continue;
+ }
+
const packageJsonPath = path.join(
process.cwd(),
'packages',