@hot-updater/cli-tools 0.21.10 → 0.21.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.
- package/dist/index.cjs +79804 -43
- package/dist/index.d.cts +173 -16
- package/dist/index.d.ts +173 -16
- package/dist/index.js +79765 -18
- package/package.json +14 -6
- package/dist/ConfigBuilder.cjs +0 -122
- package/dist/ConfigBuilder.d.cts +0 -43
- package/dist/ConfigBuilder.d.ts +0 -43
- package/dist/ConfigBuilder.js +0 -121
- package/dist/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/banner.cjs +0 -29
- package/dist/banner.d.cts +0 -6
- package/dist/banner.d.ts +0 -6
- package/dist/banner.js +0 -24
- package/dist/colors.d.cts +0 -2
- package/dist/colors.d.ts +0 -2
- package/dist/colors.js +0 -3
- package/dist/copyDirToTmp.cjs +0 -28
- package/dist/copyDirToTmp.d.cts +0 -7
- package/dist/copyDirToTmp.d.ts +0 -7
- package/dist/copyDirToTmp.js +0 -25
- package/dist/createTarBr.cjs +0 -94
- package/dist/createTarBr.d.cts +0 -22
- package/dist/createTarBr.d.ts +0 -22
- package/dist/createTarBr.js +0 -88
- package/dist/createTarGz.cjs +0 -78
- package/dist/createTarGz.d.cts +0 -22
- package/dist/createTarGz.d.ts +0 -22
- package/dist/createTarGz.js +0 -73
- package/dist/createZip.cjs +0 -80
- package/dist/createZip.d.cts +0 -22
- package/dist/createZip.d.ts +0 -22
- package/dist/createZip.js +0 -75
- package/dist/crypto.cjs +0 -27
- package/dist/crypto.d.cts +0 -5
- package/dist/crypto.d.ts +0 -5
- package/dist/crypto.js +0 -24
- package/dist/cwd.cjs +0 -9
- package/dist/cwd.d.cts +0 -4
- package/dist/cwd.d.ts +0 -4
- package/dist/cwd.js +0 -7
- package/dist/getAndroidSdkPath.cjs +0 -10
- package/dist/getAndroidSdkPath.d.cts +0 -4
- package/dist/getAndroidSdkPath.d.ts +0 -4
- package/dist/getAndroidSdkPath.js +0 -9
- package/dist/isObject.cjs +0 -8
- package/dist/isObject.js +0 -7
- package/dist/loadConfig.cjs +0 -100
- package/dist/loadConfig.d.cts +0 -12
- package/dist/loadConfig.d.ts +0 -12
- package/dist/loadConfig.js +0 -93
- package/dist/log.cjs +0 -16
- package/dist/log.d.cts +0 -11
- package/dist/log.d.ts +0 -11
- package/dist/log.js +0 -14
- package/dist/makeEnv.cjs +0 -57
- package/dist/makeEnv.d.cts +0 -8
- package/dist/makeEnv.d.ts +0 -8
- package/dist/makeEnv.js +0 -55
- package/dist/prompts.d.cts +0 -2
- package/dist/prompts.d.ts +0 -2
- package/dist/prompts.js +0 -3
- package/dist/transformEnv.cjs +0 -14
- package/dist/transformEnv.d.cts +0 -4
- package/dist/transformEnv.d.ts +0 -4
- package/dist/transformEnv.js +0 -11
- package/dist/transformTemplate.cjs +0 -22
- package/dist/transformTemplate.d.cts +0 -15
- package/dist/transformTemplate.d.ts +0 -15
- package/dist/transformTemplate.js +0 -21
package/dist/createTarBr.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/createTarBr.d.ts
|
|
2
|
-
declare const createTarBrTargetFiles: ({
|
|
3
|
-
outfile,
|
|
4
|
-
targetFiles
|
|
5
|
-
}: {
|
|
6
|
-
targetFiles: {
|
|
7
|
-
path: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
outfile: string;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
declare const createTarBr: ({
|
|
13
|
-
outfile,
|
|
14
|
-
targetDir,
|
|
15
|
-
excludeExts
|
|
16
|
-
}: {
|
|
17
|
-
targetDir: string;
|
|
18
|
-
outfile: string;
|
|
19
|
-
excludeExts?: string[];
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createTarBr, createTarBrTargetFiles };
|
package/dist/createTarBr.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import * as tar from "tar";
|
|
4
|
-
import { brotliCompressSync, constants } from "zlib";
|
|
5
|
-
|
|
6
|
-
//#region src/createTarBr.ts
|
|
7
|
-
const createTarBrTargetFiles = async ({ outfile, targetFiles }) => {
|
|
8
|
-
await fs.rm(outfile, { force: true });
|
|
9
|
-
const tmpDir = path.join(path.dirname(outfile), `.tmp-tar-${Date.now()}`);
|
|
10
|
-
await fs.mkdir(tmpDir, { recursive: true });
|
|
11
|
-
try {
|
|
12
|
-
for (const target of targetFiles) {
|
|
13
|
-
const sourcePath = target.path;
|
|
14
|
-
const destPath = path.join(tmpDir, target.name);
|
|
15
|
-
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
16
|
-
if ((await fs.stat(sourcePath)).isDirectory()) await copyDir(sourcePath, destPath);
|
|
17
|
-
else await fs.copyFile(sourcePath, destPath);
|
|
18
|
-
}
|
|
19
|
-
const tmpTarFile = outfile.replace(/\.tar\.br$/, ".tar");
|
|
20
|
-
await tar.create({
|
|
21
|
-
file: tmpTarFile,
|
|
22
|
-
cwd: tmpDir,
|
|
23
|
-
portable: true,
|
|
24
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
25
|
-
gzip: false
|
|
26
|
-
}, await fs.readdir(tmpDir));
|
|
27
|
-
const compressedData = brotliCompressSync(await fs.readFile(tmpTarFile), { params: {
|
|
28
|
-
[constants.BROTLI_PARAM_QUALITY]: 11,
|
|
29
|
-
[constants.BROTLI_PARAM_LGWIN]: 24
|
|
30
|
-
} });
|
|
31
|
-
await fs.mkdir(path.dirname(outfile), { recursive: true });
|
|
32
|
-
await fs.writeFile(outfile, compressedData);
|
|
33
|
-
await fs.rm(tmpTarFile, { force: true });
|
|
34
|
-
return outfile;
|
|
35
|
-
} finally {
|
|
36
|
-
await fs.rm(tmpDir, {
|
|
37
|
-
recursive: true,
|
|
38
|
-
force: true
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
async function copyDir(src, dest) {
|
|
43
|
-
await fs.mkdir(dest, { recursive: true });
|
|
44
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
45
|
-
for (const entry of entries) {
|
|
46
|
-
const srcPath = path.join(src, entry.name);
|
|
47
|
-
const destPath = path.join(dest, entry.name);
|
|
48
|
-
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
49
|
-
else await fs.copyFile(srcPath, destPath);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const createTarBr = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
53
|
-
await fs.rm(outfile, { force: true });
|
|
54
|
-
const tmpTarFile = outfile.replace(/\.tar\.br$/, ".tar");
|
|
55
|
-
async function getFiles(dir, baseDir = "") {
|
|
56
|
-
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
57
|
-
const files = [];
|
|
58
|
-
for (const entry of entries) {
|
|
59
|
-
if (excludeExts.some((pattern) => entry.name.includes(pattern))) continue;
|
|
60
|
-
const fullPath = path.join(dir, entry.name);
|
|
61
|
-
const relativePath = path.join(baseDir, entry.name);
|
|
62
|
-
if (entry.isDirectory()) {
|
|
63
|
-
const subFiles = await getFiles(fullPath, relativePath);
|
|
64
|
-
files.push(...subFiles);
|
|
65
|
-
} else files.push(relativePath);
|
|
66
|
-
}
|
|
67
|
-
return files;
|
|
68
|
-
}
|
|
69
|
-
const filesToInclude = await getFiles(targetDir);
|
|
70
|
-
filesToInclude.sort();
|
|
71
|
-
await tar.create({
|
|
72
|
-
file: tmpTarFile,
|
|
73
|
-
cwd: targetDir,
|
|
74
|
-
portable: true,
|
|
75
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
76
|
-
gzip: false
|
|
77
|
-
}, filesToInclude);
|
|
78
|
-
const compressedData = brotliCompressSync(await fs.readFile(tmpTarFile), { params: {
|
|
79
|
-
[constants.BROTLI_PARAM_QUALITY]: 11,
|
|
80
|
-
[constants.BROTLI_PARAM_LGWIN]: 24
|
|
81
|
-
} });
|
|
82
|
-
await fs.writeFile(outfile, compressedData);
|
|
83
|
-
await fs.rm(tmpTarFile, { force: true });
|
|
84
|
-
return outfile;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
//#endregion
|
|
88
|
-
export { createTarBr, createTarBrTargetFiles };
|
package/dist/createTarGz.cjs
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let fs_promises = require("fs/promises");
|
|
3
|
-
fs_promises = require_rolldown_runtime.__toESM(fs_promises);
|
|
4
|
-
let path = require("path");
|
|
5
|
-
path = require_rolldown_runtime.__toESM(path);
|
|
6
|
-
let tar = require("tar");
|
|
7
|
-
tar = require_rolldown_runtime.__toESM(tar);
|
|
8
|
-
|
|
9
|
-
//#region src/createTarGz.ts
|
|
10
|
-
const createTarGzTargetFiles = async ({ outfile, targetFiles }) => {
|
|
11
|
-
await fs_promises.default.rm(outfile, { force: true });
|
|
12
|
-
const tmpDir = path.default.join(path.default.dirname(outfile), `.tmp-tar-${Date.now()}`);
|
|
13
|
-
await fs_promises.default.mkdir(tmpDir, { recursive: true });
|
|
14
|
-
try {
|
|
15
|
-
for (const target of targetFiles) {
|
|
16
|
-
const sourcePath = target.path;
|
|
17
|
-
const destPath = path.default.join(tmpDir, target.name);
|
|
18
|
-
await fs_promises.default.mkdir(path.default.dirname(destPath), { recursive: true });
|
|
19
|
-
if ((await fs_promises.default.stat(sourcePath)).isDirectory()) await copyDir(sourcePath, destPath);
|
|
20
|
-
else await fs_promises.default.copyFile(sourcePath, destPath);
|
|
21
|
-
}
|
|
22
|
-
await fs_promises.default.mkdir(path.default.dirname(outfile), { recursive: true });
|
|
23
|
-
await tar.create({
|
|
24
|
-
file: outfile,
|
|
25
|
-
cwd: tmpDir,
|
|
26
|
-
portable: true,
|
|
27
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
28
|
-
gzip: true
|
|
29
|
-
}, await fs_promises.default.readdir(tmpDir));
|
|
30
|
-
return outfile;
|
|
31
|
-
} finally {
|
|
32
|
-
await fs_promises.default.rm(tmpDir, {
|
|
33
|
-
recursive: true,
|
|
34
|
-
force: true
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
async function copyDir(src, dest) {
|
|
39
|
-
await fs_promises.default.mkdir(dest, { recursive: true });
|
|
40
|
-
const entries = await fs_promises.default.readdir(src, { withFileTypes: true });
|
|
41
|
-
for (const entry of entries) {
|
|
42
|
-
const srcPath = path.default.join(src, entry.name);
|
|
43
|
-
const destPath = path.default.join(dest, entry.name);
|
|
44
|
-
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
45
|
-
else await fs_promises.default.copyFile(srcPath, destPath);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
const createTarGz = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
49
|
-
await fs_promises.default.rm(outfile, { force: true });
|
|
50
|
-
async function getFiles(dir, baseDir = "") {
|
|
51
|
-
const entries = await fs_promises.default.readdir(dir, { withFileTypes: true });
|
|
52
|
-
const files = [];
|
|
53
|
-
for (const entry of entries) {
|
|
54
|
-
if (excludeExts.some((pattern) => entry.name.includes(pattern))) continue;
|
|
55
|
-
const fullPath = path.default.join(dir, entry.name);
|
|
56
|
-
const relativePath = path.default.join(baseDir, entry.name);
|
|
57
|
-
if (entry.isDirectory()) {
|
|
58
|
-
const subFiles = await getFiles(fullPath, relativePath);
|
|
59
|
-
files.push(...subFiles);
|
|
60
|
-
} else files.push(relativePath);
|
|
61
|
-
}
|
|
62
|
-
return files;
|
|
63
|
-
}
|
|
64
|
-
const filesToInclude = await getFiles(targetDir);
|
|
65
|
-
filesToInclude.sort();
|
|
66
|
-
await tar.create({
|
|
67
|
-
file: outfile,
|
|
68
|
-
cwd: targetDir,
|
|
69
|
-
portable: true,
|
|
70
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
71
|
-
gzip: true
|
|
72
|
-
}, filesToInclude);
|
|
73
|
-
return outfile;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
//#endregion
|
|
77
|
-
exports.createTarGz = createTarGz;
|
|
78
|
-
exports.createTarGzTargetFiles = createTarGzTargetFiles;
|
package/dist/createTarGz.d.cts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/createTarGz.d.ts
|
|
2
|
-
declare const createTarGzTargetFiles: ({
|
|
3
|
-
outfile,
|
|
4
|
-
targetFiles
|
|
5
|
-
}: {
|
|
6
|
-
targetFiles: {
|
|
7
|
-
path: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
outfile: string;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
declare const createTarGz: ({
|
|
13
|
-
outfile,
|
|
14
|
-
targetDir,
|
|
15
|
-
excludeExts
|
|
16
|
-
}: {
|
|
17
|
-
targetDir: string;
|
|
18
|
-
outfile: string;
|
|
19
|
-
excludeExts?: string[];
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createTarGz, createTarGzTargetFiles };
|
package/dist/createTarGz.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/createTarGz.d.ts
|
|
2
|
-
declare const createTarGzTargetFiles: ({
|
|
3
|
-
outfile,
|
|
4
|
-
targetFiles
|
|
5
|
-
}: {
|
|
6
|
-
targetFiles: {
|
|
7
|
-
path: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
outfile: string;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
declare const createTarGz: ({
|
|
13
|
-
outfile,
|
|
14
|
-
targetDir,
|
|
15
|
-
excludeExts
|
|
16
|
-
}: {
|
|
17
|
-
targetDir: string;
|
|
18
|
-
outfile: string;
|
|
19
|
-
excludeExts?: string[];
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createTarGz, createTarGzTargetFiles };
|
package/dist/createTarGz.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import * as tar from "tar";
|
|
4
|
-
|
|
5
|
-
//#region src/createTarGz.ts
|
|
6
|
-
const createTarGzTargetFiles = async ({ outfile, targetFiles }) => {
|
|
7
|
-
await fs.rm(outfile, { force: true });
|
|
8
|
-
const tmpDir = path.join(path.dirname(outfile), `.tmp-tar-${Date.now()}`);
|
|
9
|
-
await fs.mkdir(tmpDir, { recursive: true });
|
|
10
|
-
try {
|
|
11
|
-
for (const target of targetFiles) {
|
|
12
|
-
const sourcePath = target.path;
|
|
13
|
-
const destPath = path.join(tmpDir, target.name);
|
|
14
|
-
await fs.mkdir(path.dirname(destPath), { recursive: true });
|
|
15
|
-
if ((await fs.stat(sourcePath)).isDirectory()) await copyDir(sourcePath, destPath);
|
|
16
|
-
else await fs.copyFile(sourcePath, destPath);
|
|
17
|
-
}
|
|
18
|
-
await fs.mkdir(path.dirname(outfile), { recursive: true });
|
|
19
|
-
await tar.create({
|
|
20
|
-
file: outfile,
|
|
21
|
-
cwd: tmpDir,
|
|
22
|
-
portable: true,
|
|
23
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
24
|
-
gzip: true
|
|
25
|
-
}, await fs.readdir(tmpDir));
|
|
26
|
-
return outfile;
|
|
27
|
-
} finally {
|
|
28
|
-
await fs.rm(tmpDir, {
|
|
29
|
-
recursive: true,
|
|
30
|
-
force: true
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
async function copyDir(src, dest) {
|
|
35
|
-
await fs.mkdir(dest, { recursive: true });
|
|
36
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
37
|
-
for (const entry of entries) {
|
|
38
|
-
const srcPath = path.join(src, entry.name);
|
|
39
|
-
const destPath = path.join(dest, entry.name);
|
|
40
|
-
if (entry.isDirectory()) await copyDir(srcPath, destPath);
|
|
41
|
-
else await fs.copyFile(srcPath, destPath);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const createTarGz = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
45
|
-
await fs.rm(outfile, { force: true });
|
|
46
|
-
async function getFiles(dir, baseDir = "") {
|
|
47
|
-
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
48
|
-
const files = [];
|
|
49
|
-
for (const entry of entries) {
|
|
50
|
-
if (excludeExts.some((pattern) => entry.name.includes(pattern))) continue;
|
|
51
|
-
const fullPath = path.join(dir, entry.name);
|
|
52
|
-
const relativePath = path.join(baseDir, entry.name);
|
|
53
|
-
if (entry.isDirectory()) {
|
|
54
|
-
const subFiles = await getFiles(fullPath, relativePath);
|
|
55
|
-
files.push(...subFiles);
|
|
56
|
-
} else files.push(relativePath);
|
|
57
|
-
}
|
|
58
|
-
return files;
|
|
59
|
-
}
|
|
60
|
-
const filesToInclude = await getFiles(targetDir);
|
|
61
|
-
filesToInclude.sort();
|
|
62
|
-
await tar.create({
|
|
63
|
-
file: outfile,
|
|
64
|
-
cwd: targetDir,
|
|
65
|
-
portable: true,
|
|
66
|
-
mtime: /* @__PURE__ */ new Date(0),
|
|
67
|
-
gzip: true
|
|
68
|
-
}, filesToInclude);
|
|
69
|
-
return outfile;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
export { createTarGz, createTarGzTargetFiles };
|
package/dist/createZip.cjs
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let fs_promises = require("fs/promises");
|
|
3
|
-
fs_promises = require_rolldown_runtime.__toESM(fs_promises);
|
|
4
|
-
let path = require("path");
|
|
5
|
-
path = require_rolldown_runtime.__toESM(path);
|
|
6
|
-
let jszip = require("jszip");
|
|
7
|
-
jszip = require_rolldown_runtime.__toESM(jszip);
|
|
8
|
-
|
|
9
|
-
//#region src/createZip.ts
|
|
10
|
-
const createZipTargetFiles = async ({ outfile, targetFiles }) => {
|
|
11
|
-
const zip = new jszip.default();
|
|
12
|
-
await fs_promises.default.rm(outfile, { force: true });
|
|
13
|
-
async function addFiles(dir, zipFolder) {
|
|
14
|
-
const files = await fs_promises.default.readdir(dir);
|
|
15
|
-
files.sort();
|
|
16
|
-
for (const file of files) {
|
|
17
|
-
const fullPath = path.default.join(dir, file);
|
|
18
|
-
if ((await fs_promises.default.stat(fullPath)).isDirectory()) {
|
|
19
|
-
const folder = zipFolder.folder(file);
|
|
20
|
-
if (!folder) continue;
|
|
21
|
-
await addFiles(fullPath, folder);
|
|
22
|
-
} else {
|
|
23
|
-
const data = await fs_promises.default.readFile(fullPath);
|
|
24
|
-
zipFolder.file(file, data);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
for (const target of targetFiles) if ((await fs_promises.default.stat(target.path)).isDirectory()) {
|
|
29
|
-
const folder = zip.folder(target.name);
|
|
30
|
-
if (folder) await addFiles(target.path, folder);
|
|
31
|
-
} else {
|
|
32
|
-
const data = await fs_promises.default.readFile(target.path);
|
|
33
|
-
zip.file(target.name, data);
|
|
34
|
-
}
|
|
35
|
-
const content = await zip.generateAsync({
|
|
36
|
-
type: "nodebuffer",
|
|
37
|
-
compression: "DEFLATE",
|
|
38
|
-
compressionOptions: { level: 9 },
|
|
39
|
-
platform: "UNIX"
|
|
40
|
-
});
|
|
41
|
-
await fs_promises.default.mkdir(path.default.dirname(outfile), { recursive: true });
|
|
42
|
-
await fs_promises.default.writeFile(outfile, content);
|
|
43
|
-
return outfile;
|
|
44
|
-
};
|
|
45
|
-
const createZip = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
46
|
-
const zip = new jszip.default();
|
|
47
|
-
await fs_promises.default.rm(outfile, { force: true });
|
|
48
|
-
async function addFiles(dir, zipFolder) {
|
|
49
|
-
const files = await fs_promises.default.readdir(dir);
|
|
50
|
-
files.sort();
|
|
51
|
-
for (const file of files) {
|
|
52
|
-
if (excludeExts.some((pattern) => file.includes(pattern))) continue;
|
|
53
|
-
const fullPath = path.default.join(dir, file);
|
|
54
|
-
if ((await fs_promises.default.stat(fullPath)).isDirectory()) {
|
|
55
|
-
const folder = zipFolder.folder(file);
|
|
56
|
-
if (!folder) continue;
|
|
57
|
-
await addFiles(fullPath, folder);
|
|
58
|
-
} else {
|
|
59
|
-
const data = await fs_promises.default.readFile(fullPath);
|
|
60
|
-
zipFolder.file(file, data);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
await addFiles(targetDir, zip);
|
|
65
|
-
zip.forEach((_, file) => {
|
|
66
|
-
file.date = /* @__PURE__ */ new Date(0);
|
|
67
|
-
});
|
|
68
|
-
const content = await zip.generateAsync({
|
|
69
|
-
type: "nodebuffer",
|
|
70
|
-
compression: "DEFLATE",
|
|
71
|
-
compressionOptions: { level: 9 },
|
|
72
|
-
platform: "UNIX"
|
|
73
|
-
});
|
|
74
|
-
await fs_promises.default.writeFile(outfile, content);
|
|
75
|
-
return outfile;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
//#endregion
|
|
79
|
-
exports.createZip = createZip;
|
|
80
|
-
exports.createZipTargetFiles = createZipTargetFiles;
|
package/dist/createZip.d.cts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/createZip.d.ts
|
|
2
|
-
declare const createZipTargetFiles: ({
|
|
3
|
-
outfile,
|
|
4
|
-
targetFiles
|
|
5
|
-
}: {
|
|
6
|
-
targetFiles: {
|
|
7
|
-
path: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
outfile: string;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
declare const createZip: ({
|
|
13
|
-
outfile,
|
|
14
|
-
targetDir,
|
|
15
|
-
excludeExts
|
|
16
|
-
}: {
|
|
17
|
-
targetDir: string;
|
|
18
|
-
outfile: string;
|
|
19
|
-
excludeExts?: string[];
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createZip, createZipTargetFiles };
|
package/dist/createZip.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//#region src/createZip.d.ts
|
|
2
|
-
declare const createZipTargetFiles: ({
|
|
3
|
-
outfile,
|
|
4
|
-
targetFiles
|
|
5
|
-
}: {
|
|
6
|
-
targetFiles: {
|
|
7
|
-
path: string;
|
|
8
|
-
name: string;
|
|
9
|
-
}[];
|
|
10
|
-
outfile: string;
|
|
11
|
-
}) => Promise<string>;
|
|
12
|
-
declare const createZip: ({
|
|
13
|
-
outfile,
|
|
14
|
-
targetDir,
|
|
15
|
-
excludeExts
|
|
16
|
-
}: {
|
|
17
|
-
targetDir: string;
|
|
18
|
-
outfile: string;
|
|
19
|
-
excludeExts?: string[];
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { createZip, createZipTargetFiles };
|
package/dist/createZip.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import JSZip from "jszip";
|
|
4
|
-
|
|
5
|
-
//#region src/createZip.ts
|
|
6
|
-
const createZipTargetFiles = async ({ outfile, targetFiles }) => {
|
|
7
|
-
const zip = new JSZip();
|
|
8
|
-
await fs.rm(outfile, { force: true });
|
|
9
|
-
async function addFiles(dir, zipFolder) {
|
|
10
|
-
const files = await fs.readdir(dir);
|
|
11
|
-
files.sort();
|
|
12
|
-
for (const file of files) {
|
|
13
|
-
const fullPath = path.join(dir, file);
|
|
14
|
-
if ((await fs.stat(fullPath)).isDirectory()) {
|
|
15
|
-
const folder = zipFolder.folder(file);
|
|
16
|
-
if (!folder) continue;
|
|
17
|
-
await addFiles(fullPath, folder);
|
|
18
|
-
} else {
|
|
19
|
-
const data = await fs.readFile(fullPath);
|
|
20
|
-
zipFolder.file(file, data);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
for (const target of targetFiles) if ((await fs.stat(target.path)).isDirectory()) {
|
|
25
|
-
const folder = zip.folder(target.name);
|
|
26
|
-
if (folder) await addFiles(target.path, folder);
|
|
27
|
-
} else {
|
|
28
|
-
const data = await fs.readFile(target.path);
|
|
29
|
-
zip.file(target.name, data);
|
|
30
|
-
}
|
|
31
|
-
const content = await zip.generateAsync({
|
|
32
|
-
type: "nodebuffer",
|
|
33
|
-
compression: "DEFLATE",
|
|
34
|
-
compressionOptions: { level: 9 },
|
|
35
|
-
platform: "UNIX"
|
|
36
|
-
});
|
|
37
|
-
await fs.mkdir(path.dirname(outfile), { recursive: true });
|
|
38
|
-
await fs.writeFile(outfile, content);
|
|
39
|
-
return outfile;
|
|
40
|
-
};
|
|
41
|
-
const createZip = async ({ outfile, targetDir, excludeExts = [] }) => {
|
|
42
|
-
const zip = new JSZip();
|
|
43
|
-
await fs.rm(outfile, { force: true });
|
|
44
|
-
async function addFiles(dir, zipFolder) {
|
|
45
|
-
const files = await fs.readdir(dir);
|
|
46
|
-
files.sort();
|
|
47
|
-
for (const file of files) {
|
|
48
|
-
if (excludeExts.some((pattern) => file.includes(pattern))) continue;
|
|
49
|
-
const fullPath = path.join(dir, file);
|
|
50
|
-
if ((await fs.stat(fullPath)).isDirectory()) {
|
|
51
|
-
const folder = zipFolder.folder(file);
|
|
52
|
-
if (!folder) continue;
|
|
53
|
-
await addFiles(fullPath, folder);
|
|
54
|
-
} else {
|
|
55
|
-
const data = await fs.readFile(fullPath);
|
|
56
|
-
zipFolder.file(file, data);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
await addFiles(targetDir, zip);
|
|
61
|
-
zip.forEach((_, file) => {
|
|
62
|
-
file.date = /* @__PURE__ */ new Date(0);
|
|
63
|
-
});
|
|
64
|
-
const content = await zip.generateAsync({
|
|
65
|
-
type: "nodebuffer",
|
|
66
|
-
compression: "DEFLATE",
|
|
67
|
-
compressionOptions: { level: 9 },
|
|
68
|
-
platform: "UNIX"
|
|
69
|
-
});
|
|
70
|
-
await fs.writeFile(outfile, content);
|
|
71
|
-
return outfile;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
|
-
export { createZip, createZipTargetFiles };
|
package/dist/crypto.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_isObject = require('./isObject.cjs');
|
|
3
|
-
let crypto = require("crypto");
|
|
4
|
-
crypto = require_rolldown_runtime.__toESM(crypto);
|
|
5
|
-
|
|
6
|
-
//#region src/crypto.ts
|
|
7
|
-
const encryptJson = (jsonData, secretKey) => {
|
|
8
|
-
if (require_isObject.isObject(jsonData) === false) throw new Error("jsonData must be an object");
|
|
9
|
-
const iv = crypto.default.randomBytes(16);
|
|
10
|
-
const cipher = crypto.default.createCipheriv("aes-256-cbc", Buffer.from(secretKey, "hex"), iv);
|
|
11
|
-
let encrypted = cipher.update(JSON.stringify(jsonData));
|
|
12
|
-
encrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
13
|
-
return [iv.toString("hex"), encrypted.toString("hex")].join(":");
|
|
14
|
-
};
|
|
15
|
-
const decryptJson = (encryptedData, secretKey) => {
|
|
16
|
-
const parts = encryptedData.split(":");
|
|
17
|
-
const iv = Buffer.from(parts[0], "hex");
|
|
18
|
-
const encryptedText = Buffer.from(parts[1], "hex");
|
|
19
|
-
const decipher = crypto.default.createDecipheriv("aes-256-cbc", Buffer.from(secretKey, "hex"), iv);
|
|
20
|
-
let decrypted = decipher.update(encryptedText);
|
|
21
|
-
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
22
|
-
return JSON.parse(decrypted.toString());
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.decryptJson = decryptJson;
|
|
27
|
-
exports.encryptJson = encryptJson;
|
package/dist/crypto.d.cts
DELETED
package/dist/crypto.d.ts
DELETED
package/dist/crypto.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { isObject } from "./isObject.js";
|
|
2
|
-
import crypto from "crypto";
|
|
3
|
-
|
|
4
|
-
//#region src/crypto.ts
|
|
5
|
-
const encryptJson = (jsonData, secretKey) => {
|
|
6
|
-
if (isObject(jsonData) === false) throw new Error("jsonData must be an object");
|
|
7
|
-
const iv = crypto.randomBytes(16);
|
|
8
|
-
const cipher = crypto.createCipheriv("aes-256-cbc", Buffer.from(secretKey, "hex"), iv);
|
|
9
|
-
let encrypted = cipher.update(JSON.stringify(jsonData));
|
|
10
|
-
encrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
11
|
-
return [iv.toString("hex"), encrypted.toString("hex")].join(":");
|
|
12
|
-
};
|
|
13
|
-
const decryptJson = (encryptedData, secretKey) => {
|
|
14
|
-
const parts = encryptedData.split(":");
|
|
15
|
-
const iv = Buffer.from(parts[0], "hex");
|
|
16
|
-
const encryptedText = Buffer.from(parts[1], "hex");
|
|
17
|
-
const decipher = crypto.createDecipheriv("aes-256-cbc", Buffer.from(secretKey, "hex"), iv);
|
|
18
|
-
let decrypted = decipher.update(encryptedText);
|
|
19
|
-
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
20
|
-
return JSON.parse(decrypted.toString());
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { decryptJson, encryptJson };
|
package/dist/cwd.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let workspace_tools = require("workspace-tools");
|
|
3
|
-
workspace_tools = require_rolldown_runtime.__toESM(workspace_tools);
|
|
4
|
-
|
|
5
|
-
//#region src/cwd.ts
|
|
6
|
-
const getCwd = () => (0, workspace_tools.findPackageRoot)(process.cwd());
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.getCwd = getCwd;
|
package/dist/cwd.d.cts
DELETED
package/dist/cwd.d.ts
DELETED
package/dist/cwd.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/getAndroidSdkPath.ts
|
|
3
|
-
function getAndroidSdkPath() {
|
|
4
|
-
const sdkRoot = process.env["ANDROID_HOME"] || process.env["ANDROID_SDK_ROOT"];
|
|
5
|
-
if (!sdkRoot) throw new Error("ANDROID_HOME or ANDROID_SDK_ROOT environment variable is not set. Please follow instructions at: https://reactnative.dev/docs/set-up-your-environment?platform=android");
|
|
6
|
-
return sdkRoot;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
exports.getAndroidSdkPath = getAndroidSdkPath;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/getAndroidSdkPath.ts
|
|
2
|
-
function getAndroidSdkPath() {
|
|
3
|
-
const sdkRoot = process.env["ANDROID_HOME"] || process.env["ANDROID_SDK_ROOT"];
|
|
4
|
-
if (!sdkRoot) throw new Error("ANDROID_HOME or ANDROID_SDK_ROOT environment variable is not set. Please follow instructions at: https://reactnative.dev/docs/set-up-your-environment?platform=android");
|
|
5
|
-
return sdkRoot;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { getAndroidSdkPath };
|
package/dist/isObject.cjs
DELETED