@remotion/cli 3.1.7 → 3.1.8

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.
Files changed (47) hide show
  1. package/dist/bundle-on-cli.d.ts +2 -0
  2. package/dist/bundle-on-cli.js +41 -0
  3. package/dist/bundle.d.ts +1 -0
  4. package/dist/bundle.js +31 -0
  5. package/dist/chalk/symbols.d.ts +111 -0
  6. package/dist/chalk/symbols.js +75 -0
  7. package/dist/chalk/utilities.d.ts +2 -0
  8. package/dist/chalk/utilities.js +37 -0
  9. package/dist/compositions.js +4 -1
  10. package/dist/editor/components/CompositionManager.d.ts +4 -0
  11. package/dist/editor/components/CompositionManager.js +60 -0
  12. package/dist/editor/components/LoadingIndicator.d.ts +2 -0
  13. package/dist/editor/components/LoadingIndicator.js +35 -0
  14. package/dist/editor/components/Menu/MenuItem.js +1 -1
  15. package/dist/editor/components/Menu/MenuSubItem.js +1 -1
  16. package/dist/editor/components/Menu/styles.d.ts +3 -2
  17. package/dist/editor/components/Menu/styles.js +10 -3
  18. package/dist/editor/components/NewComposition/ComboBox.js +12 -2
  19. package/dist/editor/components/Timeline/TimelineScrollable.d.ts +4 -0
  20. package/dist/editor/components/Timeline/TimelineScrollable.js +23 -0
  21. package/dist/editor/components/Timeline/TimelineZoomControls.d.ts +2 -0
  22. package/dist/editor/components/Timeline/TimelineZoomControls.js +29 -0
  23. package/dist/editor/components/Timeline/timeline-scroll-logic.d.ts +4 -0
  24. package/dist/editor/components/Timeline/timeline-scroll-logic.js +13 -0
  25. package/dist/editor/state/timeline-zoom.d.ts +10 -0
  26. package/dist/editor/state/timeline-zoom.js +24 -0
  27. package/dist/prepare-entry-point.d.ts +11 -0
  28. package/dist/prepare-entry-point.js +36 -0
  29. package/dist/preview-server/fast-refresh/helpers.d.ts +39 -0
  30. package/dist/preview-server/fast-refresh/helpers.js +145 -0
  31. package/dist/preview-server/fast-refresh/index.d.ts +30 -0
  32. package/dist/preview-server/fast-refresh/index.js +86 -0
  33. package/dist/preview-server/fast-refresh/loader.d.ts +35 -0
  34. package/dist/preview-server/fast-refresh/loader.js +81 -0
  35. package/dist/preview-server/fast-refresh/runtime.d.ts +35 -0
  36. package/dist/preview-server/fast-refresh/runtime.js +32 -0
  37. package/dist/preview-server/static-preview.d.ts +1 -0
  38. package/dist/preview-server/static-preview.js +40 -0
  39. package/dist/preview-server/webpack-cache.d.ts +12 -0
  40. package/dist/preview-server/webpack-cache.js +66 -0
  41. package/dist/render.js +9 -5
  42. package/dist/setup-cache.d.ts +8 -0
  43. package/dist/setup-cache.js +16 -1
  44. package/dist/still.js +6 -5
  45. package/dist/webpack-cache.d.ts +2 -2
  46. package/dist/webpack-cache.js +10 -10
  47. package/package.json +10 -10
package/dist/render.js CHANGED
@@ -35,6 +35,7 @@ const render = async (remotionRoot) => {
35
35
  : path_1.default.join(process.cwd(), file);
36
36
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
37
37
  await (0, initialize_render_cli_1.initializeRenderCli)(remotionRoot, 'sequence');
38
+ log_1.Log.verbose('Asset dirs', downloadMap.assetDir);
38
39
  const { codec, proResProfile, parallelism, frameRange, shouldOutputImageSequence, overwrite, inputProps, envVariables, quality, browser, crf, pixelFormat, imageFormat, browserExecutable, ffmpegExecutable, ffprobeExecutable, scale, chromiumOptions, port, numberOfGifLoops, everyNthFrame, puppeteerTimeout, } = await (0, get_cli_options_1.getCliOptions)({
39
40
  isLambda: false,
40
41
  type: 'series',
@@ -63,9 +64,11 @@ const render = async (remotionRoot) => {
63
64
  'rendering',
64
65
  shouldOutputImageSequence ? null : 'stitching',
65
66
  ].filter(remotion_1.Internals.truthy);
66
- const urlOrBundle = renderer_1.RenderInternals.isServeUrl(fullPath)
67
- ? fullPath
68
- : await (0, setup_cache_1.bundleOnCli)({ fullPath, remotionRoot, steps });
67
+ const { urlOrBundle, cleanup: cleanupBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({
68
+ fullPath,
69
+ remotionRoot,
70
+ steps,
71
+ });
69
72
  const onDownload = (src) => {
70
73
  const id = Math.random();
71
74
  const download = {
@@ -240,9 +243,10 @@ const render = async (remotionRoot) => {
240
243
  ].join(' '));
241
244
  log_1.Log.info('-', 'Output can be found at:');
242
245
  log_1.Log.info(chalk_1.chalk.cyan(`▶ ${absoluteOutputFile}`));
243
- log_1.Log.verbose('Cleaning up...');
244
246
  try {
245
- await renderer_1.RenderInternals.deleteDirectory(urlOrBundle);
247
+ await cleanupBundle();
248
+ await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
249
+ log_1.Log.verbose('Cleaned up', downloadMap.assetDir);
246
250
  }
247
251
  catch (err) {
248
252
  log_1.Log.warn('Could not clean up directory.');
@@ -1,4 +1,12 @@
1
1
  import type { RenderStep } from './step';
2
+ export declare const bundleOnCliOrTakeServeUrl: ({ fullPath, remotionRoot, steps, }: {
3
+ fullPath: string;
4
+ remotionRoot: string;
5
+ steps: RenderStep[];
6
+ }) => Promise<{
7
+ urlOrBundle: string;
8
+ cleanup: () => Promise<void>;
9
+ }>;
2
10
  export declare const bundleOnCli: ({ fullPath, steps, remotionRoot, }: {
3
11
  fullPath: string;
4
12
  steps: RenderStep[];
@@ -1,11 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bundleOnCli = void 0;
3
+ exports.bundleOnCli = exports.bundleOnCliOrTakeServeUrl = void 0;
4
4
  const bundler_1 = require("@remotion/bundler");
5
+ const renderer_1 = require("@remotion/renderer");
5
6
  const config_1 = require("./config");
6
7
  const log_1 = require("./log");
7
8
  const parse_command_line_1 = require("./parse-command-line");
8
9
  const progress_bar_1 = require("./progress-bar");
10
+ const bundleOnCliOrTakeServeUrl = async ({ fullPath, remotionRoot, steps, }) => {
11
+ if (renderer_1.RenderInternals.isServeUrl(fullPath)) {
12
+ return {
13
+ urlOrBundle: fullPath,
14
+ cleanup: () => Promise.resolve(undefined),
15
+ };
16
+ }
17
+ const bundled = await (0, exports.bundleOnCli)({ fullPath, remotionRoot, steps });
18
+ return {
19
+ urlOrBundle: bundled,
20
+ cleanup: () => renderer_1.RenderInternals.deleteDirectory(bundled),
21
+ };
22
+ };
23
+ exports.bundleOnCliOrTakeServeUrl = bundleOnCliOrTakeServeUrl;
9
24
  const bundleOnCli = async ({ fullPath, steps, remotionRoot, }) => {
10
25
  var _a;
11
26
  const shouldCache = config_1.ConfigInternals.getWebpackCaching();
package/dist/still.js CHANGED
@@ -72,12 +72,10 @@ const still = async (remotionRoot) => {
72
72
  renderer_1.RenderInternals.isServeUrl(fullPath) ? null : 'bundling',
73
73
  'rendering',
74
74
  ].filter(truthy_1.truthy);
75
- const urlOrBundle = renderer_1.RenderInternals.isServeUrl(fullPath)
76
- ? Promise.resolve(fullPath)
77
- : await (0, setup_cache_1.bundleOnCli)({ fullPath, remotionRoot, steps });
75
+ const { cleanup: cleanupBundle, urlOrBundle } = await (0, setup_cache_1.bundleOnCliOrTakeServeUrl)({ fullPath, remotionRoot, steps });
78
76
  const puppeteerInstance = await browserInstance;
79
77
  const downloadMap = renderer_1.RenderInternals.makeDownloadMap();
80
- const comps = await (0, renderer_1.getCompositions)(await urlOrBundle, {
78
+ const comps = await (0, renderer_1.getCompositions)(urlOrBundle, {
81
79
  inputProps,
82
80
  puppeteerInstance,
83
81
  envVariables,
@@ -132,7 +130,7 @@ const still = async (remotionRoot) => {
132
130
  composition,
133
131
  frame: stillFrame,
134
132
  output: absoluteOutputLocation,
135
- serveUrl: await urlOrBundle,
133
+ serveUrl: urlOrBundle,
136
134
  quality,
137
135
  dumpBrowserLogs: renderer_1.RenderInternals.isEqualOrBelowLogLevel(config_1.ConfigInternals.Logging.getLogLevel(), 'verbose'),
138
136
  envVariables,
@@ -162,5 +160,8 @@ const still = async (remotionRoot) => {
162
160
  log_1.Log.info('-', 'Output can be found at:');
163
161
  log_1.Log.info(chalk_1.chalk.cyan(`▶️ ${absoluteOutputLocation}`));
164
162
  await closeBrowserPromise;
163
+ await renderer_1.RenderInternals.cleanDownloadMap(downloadMap);
164
+ await cleanupBundle();
165
+ log_1.Log.verbose('Cleaned up', downloadMap.assetDir);
165
166
  };
166
167
  exports.still = still;
@@ -6,7 +6,7 @@ declare global {
6
6
  }
7
7
  }
8
8
  }
9
- export declare const clearCache: (remotionRoot: string, environment: Environment, inputProps: object | null) => Promise<void>;
9
+ export declare const clearCache: (environment: Environment, inputProps: object | null) => Promise<void>;
10
10
  export declare const getWebpackCacheName: (environment: Environment, inputProps: object | null) => string;
11
- export declare const cacheExists: (remotionRoot: string, environment: Environment, inputProps: object | null) => boolean;
11
+ export declare const cacheExists: (environment: Environment, inputProps: object | null) => boolean;
12
12
  export {};
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.cacheExists = exports.getWebpackCacheName = exports.clearCache = void 0;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
- // eslint-disable-next-line no-restricted-imports
10
9
  const remotion_1 = require("remotion");
11
10
  // Inlined from https://github.com/webpack/webpack/blob/4c2ee7a4ddb8db2362ca83b6c4190523387ba7ee/lib/config/defaults.js#L265
12
11
  // An algorithm to determine where Webpack will cache the depencies
13
- const getWebpackCacheDir = (remotionRoot) => {
14
- let dir = remotionRoot;
12
+ const getWebpackCacheDir = () => {
13
+ const cwd = process.cwd();
14
+ let dir = cwd;
15
15
  for (;;) {
16
16
  try {
17
17
  if (fs_1.default.statSync(path_1.default.join(dir, 'package.json')).isFile()) {
@@ -28,7 +28,7 @@ const getWebpackCacheDir = (remotionRoot) => {
28
28
  dir = parent;
29
29
  }
30
30
  if (!dir) {
31
- return path_1.default.resolve(remotionRoot, '.cache/webpack');
31
+ return path_1.default.resolve(cwd, '.cache/webpack');
32
32
  }
33
33
  if (process.versions.pnp === '1') {
34
34
  return path_1.default.resolve(dir, '.pnp/.cache/webpack');
@@ -38,12 +38,12 @@ const getWebpackCacheDir = (remotionRoot) => {
38
38
  }
39
39
  return path_1.default.resolve(dir, 'node_modules/.cache/webpack');
40
40
  };
41
- const remotionCacheLocation = (remotionRoot, environment, inputProps) => {
42
- return path_1.default.join(getWebpackCacheDir(remotionRoot), (0, exports.getWebpackCacheName)(environment, inputProps));
41
+ const remotionCacheLocation = (environment, inputProps) => {
42
+ return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment, inputProps));
43
43
  };
44
- const clearCache = (remotionRoot, environment, inputProps) => {
44
+ const clearCache = (environment, inputProps) => {
45
45
  var _a;
46
- return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(remotionRoot, environment, inputProps), {
46
+ return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment, inputProps), {
47
47
  recursive: true,
48
48
  });
49
49
  };
@@ -60,7 +60,7 @@ const getWebpackCacheName = (environment, inputProps) => {
60
60
  return `remotion-v3-${environment}`;
61
61
  };
62
62
  exports.getWebpackCacheName = getWebpackCacheName;
63
- const cacheExists = (remotionRoot, environment, inputProps) => {
64
- return fs_1.default.existsSync(remotionCacheLocation(remotionRoot, environment, inputProps));
63
+ const cacheExists = (environment, inputProps) => {
64
+ return fs_1.default.existsSync(remotionCacheLocation(environment, inputProps));
65
65
  };
66
66
  exports.cacheExists = cacheExists;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,18 +23,17 @@
23
23
  "author": "Jonny Burger <jonny@remotion.dev>",
24
24
  "license": "SEE LICENSE IN LICENSE.md",
25
25
  "dependencies": {
26
- "@remotion/bundler": "3.1.7",
27
- "@remotion/media-utils": "3.1.7",
28
- "@remotion/player": "3.1.7",
29
- "@remotion/renderer": "3.1.7",
26
+ "@remotion/bundler": "3.1.8",
27
+ "@remotion/media-utils": "3.1.8",
28
+ "@remotion/player": "3.1.8",
29
+ "@remotion/renderer": "3.1.8",
30
30
  "better-opn": "2.1.1",
31
31
  "dotenv": "9.0.2",
32
32
  "memfs": "3.4.3",
33
33
  "minimist": "1.2.6",
34
- "remotion": "3.1.7",
34
+ "remotion": "3.1.8",
35
35
  "semver": "7.3.5",
36
- "source-map": "0.6.1",
37
- "vitest": "^0.18.0"
36
+ "source-map": "0.6.1"
38
37
  },
39
38
  "peerDependencies": {
40
39
  "react": ">=16.8.0",
@@ -58,7 +57,8 @@
58
57
  "prettier-plugin-organize-imports": "^2.3.4",
59
58
  "react": "^18.0.0",
60
59
  "react-dom": "^18.0.0",
61
- "typescript": "^4.7.0"
60
+ "typescript": "^4.7.0",
61
+ "vitest": "^0.18.0"
62
62
  },
63
63
  "keywords": [
64
64
  "remotion",
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "599379fef6043a7125d1979766f915580ec1cf77"
74
+ "gitHead": "57f34a02b0f830053f92af426a6b70b6824f887e"
75
75
  }