@open-audio-stack/core 0.0.16 → 0.0.17
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/build/helpers/file.js
CHANGED
|
@@ -3,7 +3,6 @@ import { execSync } from 'child_process';
|
|
|
3
3
|
import { createReadStream, chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, unlinkSync, writeFileSync, } from 'fs';
|
|
4
4
|
import { createHash } from 'crypto';
|
|
5
5
|
import stream from 'stream/promises';
|
|
6
|
-
import { Transform } from 'stream';
|
|
7
6
|
import { globSync } from 'glob';
|
|
8
7
|
import { moveSync } from 'fs-extra/esm';
|
|
9
8
|
import os from 'os';
|
|
@@ -130,15 +129,10 @@ export function fileJsonCreate(filePath, data) {
|
|
|
130
129
|
return fileCreate(filePath, JSON.stringify(data, null, 2));
|
|
131
130
|
}
|
|
132
131
|
export async function fileHash(filePath, algorithm = 'sha256') {
|
|
133
|
-
|
|
134
|
-
transform(chunk, encoding, callback) {
|
|
135
|
-
const normalized = chunk.toString('utf8').replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
136
|
-
callback(null, Buffer.from(normalized));
|
|
137
|
-
},
|
|
138
|
-
});
|
|
132
|
+
console.log('⎋', filePath);
|
|
139
133
|
const input = createReadStream(filePath);
|
|
140
134
|
const hash = createHash(algorithm);
|
|
141
|
-
await stream.pipeline(input,
|
|
135
|
+
await stream.pipeline(input, hash);
|
|
142
136
|
return hash.digest('hex');
|
|
143
137
|
}
|
|
144
138
|
export function fileMove(filePath, newPath) {
|
package/build/helpers/package.js
CHANGED
|
@@ -41,9 +41,9 @@ export function packageRecommendations(pkgVersion) {
|
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
if (!supportedArchitectures.arm64)
|
|
44
|
-
recs.push({ field: 'architectures', rec: 'should support
|
|
45
|
-
if (!supportedArchitectures.
|
|
46
|
-
recs.push({ field: 'architectures', rec: 'should support
|
|
44
|
+
recs.push({ field: 'architectures', rec: 'should support arm64' });
|
|
45
|
+
if (!supportedArchitectures.x64)
|
|
46
|
+
recs.push({ field: 'architectures', rec: 'should support x64' });
|
|
47
47
|
if (!supportedSystems.linux)
|
|
48
48
|
recs.push({ field: 'systems', rec: 'should support Linux' });
|
|
49
49
|
if (!supportedSystems.mac)
|
|
@@ -2,8 +2,8 @@ export var Architecture;
|
|
|
2
2
|
(function (Architecture) {
|
|
3
3
|
Architecture["Arm32"] = "arm32";
|
|
4
4
|
Architecture["Arm64"] = "arm64";
|
|
5
|
-
Architecture["
|
|
6
|
-
Architecture["
|
|
5
|
+
Architecture["X32"] = "x32";
|
|
6
|
+
Architecture["X64"] = "x64";
|
|
7
7
|
})(Architecture || (Architecture = {}));
|
|
8
8
|
export const architectures = [
|
|
9
9
|
{
|
|
@@ -18,12 +18,12 @@ export const architectures = [
|
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
description: 'X86 processors are commonly used in desktop computers and laptops.',
|
|
21
|
-
value: Architecture.
|
|
21
|
+
value: Architecture.X32,
|
|
22
22
|
name: 'x86 machine - 32-bit',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
description: 'X86 processors are commonly used in desktop computers and laptops.',
|
|
26
|
-
value: Architecture.
|
|
26
|
+
value: Architecture.X64,
|
|
27
27
|
name: 'x86 machine - 64-bit',
|
|
28
28
|
},
|
|
29
29
|
];
|
|
@@ -9,6 +9,7 @@ export var FileFormat;
|
|
|
9
9
|
FileFormat["TarballLegacy"] = "tgz";
|
|
10
10
|
FileFormat["WindowsInstaller"] = "msi";
|
|
11
11
|
FileFormat["Zip"] = "zip";
|
|
12
|
+
FileFormat["Zip7"] = "7z";
|
|
12
13
|
})(FileFormat || (FileFormat = {}));
|
|
13
14
|
export const fileFormats = [
|
|
14
15
|
{
|
|
@@ -56,4 +57,9 @@ export const fileFormats = [
|
|
|
56
57
|
value: FileFormat.Zip,
|
|
57
58
|
name: 'Zip',
|
|
58
59
|
},
|
|
60
|
+
{
|
|
61
|
+
description: 'Archive file format which compresses files and folders into a single file.',
|
|
62
|
+
value: FileFormat.Zip7,
|
|
63
|
+
name: '7-Zip',
|
|
64
|
+
},
|
|
59
65
|
];
|