@remotion/cli 3.2.12-crf.7 → 3.2.12

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.
@@ -0,0 +1,12 @@
1
+ declare type Environment = 'development' | 'production';
2
+ declare global {
3
+ namespace NodeJS {
4
+ interface ProcessVersions {
5
+ pnp?: string;
6
+ }
7
+ }
8
+ }
9
+ export declare const clearCache: (environment: Environment, inputProps: object | null) => Promise<void>;
10
+ export declare const getWebpackCacheName: (environment: Environment, inputProps: object | null) => string;
11
+ export declare const cacheExists: (environment: Environment, inputProps: object | null) => boolean;
12
+ export {};
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.cacheExists = exports.getWebpackCacheName = exports.clearCache = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const remotion_1 = require("remotion");
10
+ // Inlined from https://github.com/webpack/webpack/blob/4c2ee7a4ddb8db2362ca83b6c4190523387ba7ee/lib/config/defaults.js#L265
11
+ // An algorithm to determine where Webpack will cache the depencies
12
+ const getWebpackCacheDir = () => {
13
+ const cwd = process.cwd();
14
+ let dir = cwd;
15
+ for (;;) {
16
+ try {
17
+ if (fs_1.default.statSync(path_1.default.join(dir, 'package.json')).isFile()) {
18
+ break;
19
+ }
20
+ // eslint-disable-next-line no-empty
21
+ }
22
+ catch (e) { }
23
+ const parent = path_1.default.dirname(dir);
24
+ if (dir === parent) {
25
+ dir = undefined;
26
+ break;
27
+ }
28
+ dir = parent;
29
+ }
30
+ if (!dir) {
31
+ return path_1.default.resolve(cwd, '.cache/webpack');
32
+ }
33
+ if (process.versions.pnp === '1') {
34
+ return path_1.default.resolve(dir, '.pnp/.cache/webpack');
35
+ }
36
+ if (process.versions.pnp === '3') {
37
+ return path_1.default.resolve(dir, '.yarn/.cache/webpack');
38
+ }
39
+ return path_1.default.resolve(dir, 'node_modules/.cache/webpack');
40
+ };
41
+ const remotionCacheLocation = (environment, inputProps) => {
42
+ return path_1.default.join(getWebpackCacheDir(), (0, exports.getWebpackCacheName)(environment, inputProps));
43
+ };
44
+ const clearCache = (environment, inputProps) => {
45
+ var _a;
46
+ return ((_a = fs_1.default.promises.rm) !== null && _a !== void 0 ? _a : fs_1.default.promises.rmdir)(remotionCacheLocation(environment, inputProps), {
47
+ recursive: true,
48
+ });
49
+ };
50
+ exports.clearCache = clearCache;
51
+ const getWebpackCacheName = (environment, inputProps) => {
52
+ // In development, let's reset the cache when input props
53
+ // are changing, because they are injected using Webpack and if changed,
54
+ // it will get the cached version
55
+ if (environment === 'development') {
56
+ return `remotion-v3-${environment}-${(0, remotion_1.random)(JSON.stringify(inputProps))}`;
57
+ }
58
+ // In production, the cache is independent from input props because
59
+ // they are passed over URL params. Speed is mostly important in production.
60
+ return `remotion-v3-${environment}`;
61
+ };
62
+ exports.getWebpackCacheName = getWebpackCacheName;
63
+ const cacheExists = (environment, inputProps) => {
64
+ return fs_1.default.existsSync(remotionCacheLocation(environment, inputProps));
65
+ };
66
+ exports.cacheExists = cacheExists;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/cli",
3
- "version": "3.2.12-crf.7+93db68411",
3
+ "version": "3.2.12",
4
4
  "description": "CLI for Remotion",
5
5
  "main": "dist/index.js",
6
6
  "sideEffects": false,
@@ -23,15 +23,15 @@
23
23
  "author": "Jonny Burger <jonny@remotion.dev>",
24
24
  "license": "SEE LICENSE IN LICENSE.md",
25
25
  "dependencies": {
26
- "@remotion/bundler": "3.2.12-crf.7+93db68411",
27
- "@remotion/media-utils": "3.2.12-crf.7+93db68411",
28
- "@remotion/player": "3.2.12-crf.7+93db68411",
29
- "@remotion/renderer": "3.2.12-crf.7+93db68411",
26
+ "@remotion/bundler": "3.2.12",
27
+ "@remotion/media-utils": "3.2.12",
28
+ "@remotion/player": "3.2.12",
29
+ "@remotion/renderer": "3.2.12",
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.2.12-crf.7+93db68411",
34
+ "remotion": "3.2.12",
35
35
  "semver": "7.3.5",
36
36
  "source-map": "0.6.1"
37
37
  },
@@ -71,5 +71,5 @@
71
71
  "publishConfig": {
72
72
  "access": "public"
73
73
  },
74
- "gitHead": "93db68411377be8a8345f52ad3ea4d281424decc"
74
+ "gitHead": "72c9a148cafdd4468fff41bbc7ca70a1776fb15e"
75
75
  }
@@ -1,2 +0,0 @@
1
- export declare const setDropAudioIfSilent: (muted: boolean) => void;
2
- export declare const getDropAudioIfSilent: () => boolean;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDropAudioIfSilent = exports.setDropAudioIfSilent = void 0;
4
- const DEFAULT_DROP_AUDIO_IF_SILENT_STATE = true;
5
- let mutedState = DEFAULT_DROP_AUDIO_IF_SILENT_STATE;
6
- const setDropAudioIfSilent = (muted) => {
7
- mutedState = muted;
8
- };
9
- exports.setDropAudioIfSilent = setDropAudioIfSilent;
10
- const getDropAudioIfSilent = () => {
11
- return mutedState;
12
- };
13
- exports.getDropAudioIfSilent = getDropAudioIfSilent;