@remotion/bundler 3.3.6 → 3.3.7
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.
- package/dist/get-etag.d.ts +1 -0
- package/dist/get-etag.js +24 -0
- package/dist/read-recursively.d.ts +6 -0
- package/dist/read-recursively.js +64 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getEtagOfFile: (filePath: string) => Promise<string>;
|
package/dist/get-etag.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
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.getEtagOfFile = void 0;
|
|
7
|
+
const fs_1 = __importDefault(require("fs"));
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const chunk = 1024 * 1024 * 5; // 5MB
|
|
10
|
+
const md5 = (data) => crypto_1.default.createHash('md5').update(data).digest('hex');
|
|
11
|
+
const getEtagOfFile = async (filePath) => {
|
|
12
|
+
const stream = await fs_1.default.promises.readFile(filePath);
|
|
13
|
+
if (stream.length <= chunk) {
|
|
14
|
+
return md5(stream);
|
|
15
|
+
}
|
|
16
|
+
const md5Chunks = [];
|
|
17
|
+
const chunksNumber = Math.ceil(stream.length / chunk);
|
|
18
|
+
for (let i = 0; i < chunksNumber; i++) {
|
|
19
|
+
const chunkStream = stream.slice(i * chunk, (i + 1) * chunk);
|
|
20
|
+
md5Chunks.push(md5(chunkStream));
|
|
21
|
+
}
|
|
22
|
+
return `${md5(Buffer.from(md5Chunks.join(''), 'hex'))}-${chunksNumber}`;
|
|
23
|
+
};
|
|
24
|
+
exports.getEtagOfFile = getEtagOfFile;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.readRecursively = void 0;
|
|
30
|
+
const fs_1 = __importStar(require("fs"));
|
|
31
|
+
const path_1 = __importDefault(require("path"));
|
|
32
|
+
const readRecursively = ({ folder, output = [], startPath, }) => {
|
|
33
|
+
const absFolder = path_1.default.join(startPath, folder);
|
|
34
|
+
const files = fs_1.default.readdirSync(absFolder);
|
|
35
|
+
for (const file of files) {
|
|
36
|
+
if (file.startsWith('.DS_Store')) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const stat = (0, fs_1.statSync)(path_1.default.join(absFolder, file));
|
|
40
|
+
if (stat.isDirectory()) {
|
|
41
|
+
(0, exports.readRecursively)({ startPath, folder: path_1.default.join(folder, file), output });
|
|
42
|
+
}
|
|
43
|
+
else if (stat.isFile()) {
|
|
44
|
+
output.push({
|
|
45
|
+
path: path_1.default.join(folder, file),
|
|
46
|
+
lastModified: Math.floor(stat.mtimeMs),
|
|
47
|
+
sizeInBytes: stat.size,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else if (stat.isSymbolicLink()) {
|
|
51
|
+
const realpath = fs_1.default.realpathSync(path_1.default.join(folder, file));
|
|
52
|
+
const realStat = fs_1.default.statSync(realpath);
|
|
53
|
+
if (realStat.isFile()) {
|
|
54
|
+
output.push({
|
|
55
|
+
path: realpath,
|
|
56
|
+
lastModified: Math.floor(realStat.mtimeMs),
|
|
57
|
+
sizeInBytes: realStat.size,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return output.sort((a, b) => a.path.localeCompare(b.path));
|
|
63
|
+
};
|
|
64
|
+
exports.readRecursively = readRecursively;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"css-loader": "5.2.7",
|
|
27
27
|
"esbuild": "0.15.13",
|
|
28
28
|
"react-refresh": "0.9.0",
|
|
29
|
-
"remotion": "3.3.
|
|
29
|
+
"remotion": "3.3.7",
|
|
30
30
|
"style-loader": "2.0.0",
|
|
31
31
|
"webpack": "5.74.0"
|
|
32
32
|
},
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "5a9310dd3db431e7a3e2eb2e2b3c508bbc7b258a"
|
|
68
68
|
}
|