Skip to content

🎥 Make videos programmatically with React

revert some

Jonny Burger76174111ae51
diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml
index d978f6242d..7e8d04a01e 100644
--- a/.github/workflows/push.yml
+++ b/.github/workflows/push.yml
@@ -7,6 +7,7 @@ name: Install and Test
env:
FORCE_COLOR: 1
+ TURBO_TELEMETRY_DISABLED: 1
jobs:
lambda-tests:
runs-on: ubuntu-latest
diff --git a/packages/google-fonts/.gitignore b/packages/google-fonts/.gitignore
index 87c6cc4506..a15628460d 100644
--- a/packages/google-fonts/.gitignore
+++ b/packages/google-fonts/.gitignore
@@ -2,7 +2,8 @@
.cache-css
/*.js
/*.d.ts
-!ensure-generation.ts
+!ensure-generation.js
src
!src/index.ts
!src/base.ts
+!rollup.config.js
diff --git a/packages/google-fonts/package.json b/packages/google-fonts/package.json
index 937c481f0f..7387c41028 100644
--- a/packages/google-fonts/package.json
+++ b/packages/google-fonts/package.json
@@ -5,7 +5,7 @@
"main": "dist/cjs/index.js",
"module": "dist/esm/index.mjs",
"scripts": {
- "build": "pnpm run generate && bun bundle.ts && tsc -d",
+ "build": "pnpm run generate && rollup --config rollup.config.js && tsc -d",
"watch": "tsc -w",
"generate": "ts-node scripts/generate.ts",
"prepublishOnly": "bun ensure-generation.ts"
@@ -15,12 +15,14 @@
"remotion": "workspace:*"
},
"devDependencies": {
+ "@rollup/plugin-typescript": "^8.2.0",
"@types/css-font-loading-module": "^0.0.7",
"@types/node": "18.14.6",
"@types/prettier": "^2.7.1",
"got": "^11",
"postcss": "^8.4.31",
"prettier": "3.2.5",
+ "rollup": "^2.70.1",
"ts-node": "10.9.2"
},
"files": [
diff --git a/packages/google-fonts/rollup.config.js b/packages/google-fonts/rollup.config.js
new file mode 100644
index 0000000000..db3a63463c
--- /dev/null
+++ b/packages/google-fonts/rollup.config.js
@@ -0,0 +1,44 @@
+// rollup.config.js
+import typescript from "@rollup/plugin-typescript";
+
+export default [
+ {
+ input: "src/index.ts",
+ output: [
+ {
+ dir: "dist/esm",
+ format: "es",
+ sourcemap: false,
+ chunkFileNames: `[name].mjs`,
+ entryFileNames: `[name].mjs`,
+ },
+ ],
+ external: ["remotion"],
+ plugins: [
+ typescript({
+ tsconfig: "tsconfig-esm.json",
+ sourceMap: false,
+ outputToFilesystem: true,
+ }),
+ ],
+ },
+ {
+ input: "src/index.ts",
+ output: [
+ {
+ dir: "dist/cjs",
+ format: "cjs",
+ sourcemap: false,
+ chunkFileNames: `[name].cjs`,
+ },
+ ],
+ external: ["remotion"],
+ plugins: [
+ typescript({
+ tsconfig: "tsconfig.json",
+ sourceMap: false,
+ outputToFilesystem: true,
+ }),
+ ],
+ },
+];
diff --git a/packages/google-fonts/scripts/generate-index.ts b/packages/google-fonts/scripts/generate-index.ts
index 19dd67242e..03cd4e1395 100644
--- a/packages/google-fonts/scripts/generate-index.ts
+++ b/packages/google-fonts/scripts/generate-index.ts
@@ -44,7 +44,7 @@ export type GoogleFont = {
};
`;
-export const generateIndex = async () => {
+const generate = async () => {
// Prepare filename
const filename = `index.ts`;
@@ -83,7 +83,7 @@ export const generateIndex = async () => {
if (!read.typesVersions) read.typesVersions = {};
if (!read.typesVersions[">=1.0"]) read.typesVersions[">=1.0"] = {};
read.typesVersions[">=1.0"][removeWhitespace(unquote(font.family))] = [
- `dist/cjs/${removeWhitespace(unquote(font.family))}.d.ts`,
+ `dist/esm/${removeWhitespace(unquote(font.family))}.d.ts`,
];
}
@@ -92,3 +92,8 @@ export const generateIndex = async () => {
JSON.stringify(read, null, 2) + "\n"
);
};
+
+generate().catch((err) => {
+ console.error(err);
+ process.exit(1);
+});
diff --git a/packages/google-fonts/scripts/generate.ts b/packages/google-fonts/scripts/generate.ts
index b9376ad379..47d2b9b52d 100644
--- a/packages/google-fonts/scripts/generate.ts
+++ b/packages/google-fonts/scripts/generate.ts
@@ -2,7 +2,6 @@ import fs, { mkdirSync } from "node:fs";
import path from "path";
import got from "got";
import postcss from "postcss";
-import { generateIndex } from "./generate-index";
type FontInfo = {
fontFamily: string;
@@ -186,14 +185,10 @@ const run = async () => {
await generate(font);
}
- console.log(`- Generated fonts in ${Date.now() - date}ms`);
+ console.log("- Generated fonts in " + (Date.now() - date) + "ms");
};
-run()
- .then(() => {
- return generateIndex();
- })
- .catch((err) => {
- console.error(err);
- process.exit(1);
- });
+run().catch((err) => {
+ console.error(err);
+ process.exit(1);
+});