Skip to content

🎥 Make videos programmatically with React

refactor(effects): drop root barrel exports; use subpath imports

JonnyBurgere0597913d52a
diff --git a/packages/core/src/effects/index.ts b/packages/core/src/effects/index.ts
index 775fb58196..681ac8c77b 100644
--- a/packages/core/src/effects/index.ts
+++ b/packages/core/src/effects/index.ts
@@ -1,4 +1,4 @@
-// Types needed outside core for `_experimentalEffects` / `@remotion/effects` typing.
+// Types needed outside core for `_experimentalEffects` / `@remotion/effects/*` typing.
export type {
EffectDefinitionAndStack,
EffectDescriptor,
diff --git a/packages/effects/bundle.ts b/packages/effects/bundle.ts
index 24a7c113b4..8699642875 100644
--- a/packages/effects/bundle.ts
+++ b/packages/effects/bundle.ts
@@ -33,9 +33,14 @@ if (!output.success) {
}
for (const file of output.outputs) {
- const str = await file.text();
+ let str = await file.text();
const out = path.join('dist', 'esm', file.path);
+ // Bun can emit a 0-byte file for `export {}` only; Node needs a real empty module.
+ if (path.basename(file.path) === 'index.mjs' && str.trim() === '') {
+ str = 'export {};\n';
+ }
+
await Bun.write(out, str);
}
diff --git a/packages/effects/src/index.ts b/packages/effects/src/index.ts
index b411a4c406..cb0ff5c3b5 100644
--- a/packages/effects/src/index.ts
+++ b/packages/effects/src/index.ts
@@ -1,16 +1 @@
-export {blur, blurHorizontal, blurVertical} from './blur/index.js';
-export type {
- BlurHorizontalParams,
- BlurParams,
- BlurVerticalParams,
-} from './blur/index.js';
-export {halftone} from './halftone.js';
-export type {
- HalftoneParams,
- HalftoneSampling,
- HalftoneShape,
-} from './halftone.js';
-export {tint} from './tint.js';
-export type {TintParams} from './tint.js';
-export {wave} from './wave.js';
-export type {WaveParams} from './wave.js';
+export {};
diff --git a/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx b/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
index 532a958e52..dcbf23228b 100644
--- a/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
+++ b/packages/example/src/HtmlInCanvas/compose-webgl-crt.tsx
@@ -1,4 +1,4 @@
-import {tint} from '@remotion/effects';
+import {tint} from '@remotion/effects/tint';
import React, {useCallback, useRef} from 'react';
import {
HtmlInCanvas,
diff --git a/packages/example/src/HtmlInCanvas/react-svg.tsx b/packages/example/src/HtmlInCanvas/react-svg.tsx
index c9b0105888..722f7b225d 100644
--- a/packages/example/src/HtmlInCanvas/react-svg.tsx
+++ b/packages/example/src/HtmlInCanvas/react-svg.tsx
@@ -1,4 +1,5 @@
-import {halftone, tint} from '@remotion/effects';
+import {halftone} from '@remotion/effects/halftone';
+import {tint} from '@remotion/effects/tint';
import React from 'react';
import {HtmlInCanvas, useVideoConfig} from 'remotion';
import ReactSvg from '../ReactSvg';