@fgv/ts-res-browser-cli 5.0.0-3 → 5.0.0-30
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/README.md +35 -11
- package/eslint.config.js +16 -0
- package/lib/cli.d.ts +0 -4
- package/lib/cli.js +8 -17
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/options.d.ts +16 -0
- package/lib/simpleBrowserLauncher.d.ts +32 -0
- package/lib/{browserLauncher.js → simpleBrowserLauncher.js} +53 -162
- package/lib/zipArchiver.d.ts +5 -17
- package/lib/zipArchiver.js +11 -72
- package/package.json +13 -13
- package/.rush/temp/6fdce6325ccacda5ae840a289f20e286e54e4f4b.tar.log +0 -32
- package/.rush/temp/chunked-rush-logs/ts-res-browser-cli.build.chunks.jsonl +0 -5
- package/.rush/temp/operation/build/all.log +0 -5
- package/.rush/temp/operation/build/log-chunks.jsonl +0 -5
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/shrinkwrap-deps.json +0 -651
- package/config/rig.json +0 -16
- package/lib/browserLauncher.d.ts +0 -57
- package/lib/browserLauncher.d.ts.map +0 -1
- package/lib/browserLauncher.js.map +0 -1
- package/lib/cli.d.ts.map +0 -1
- package/lib/cli.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/options.d.ts.map +0 -1
- package/lib/options.js.map +0 -1
- package/lib/zipArchiver.d.ts.map +0 -1
- package/lib/zipArchiver.js.map +0 -1
- package/rush-logs/ts-res-browser-cli.build.cache.log +0 -3
- package/rush-logs/ts-res-browser-cli.build.log +0 -5
- package/src/browserLauncher.ts +0 -406
- package/src/cli.ts +0 -423
- package/src/index.ts +0 -26
- package/src/options.ts +0 -133
- package/src/zipArchiver.ts +0 -153
- package/tsconfig.json +0 -7
package/lib/zipArchiver.js
CHANGED
|
@@ -34,11 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.zipArchiver = exports.ZipArchiver = void 0;
|
|
37
|
-
const archiver = __importStar(require("archiver"));
|
|
38
37
|
const fs = __importStar(require("fs"));
|
|
39
38
|
const path = __importStar(require("path"));
|
|
40
39
|
const os = __importStar(require("os"));
|
|
41
40
|
const ts_utils_1 = require("@fgv/ts-utils");
|
|
41
|
+
const ts_res_1 = require("@fgv/ts-res");
|
|
42
42
|
class ZipArchiver {
|
|
43
43
|
/**
|
|
44
44
|
* Create a ZIP archive containing the specified input and config files/directories
|
|
@@ -53,79 +53,18 @@ class ZipArchiver {
|
|
|
53
53
|
if (!fs.existsSync(outputDir)) {
|
|
54
54
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
56
|
+
// Create ZIP archive using the new zip-archive packlet
|
|
57
|
+
const creator = new ts_res_1.ZipArchive.ZipArchiveCreator();
|
|
58
|
+
const createResult = await creator.createFromBuffer({
|
|
59
|
+
inputPath: options.input,
|
|
60
|
+
configPath: options.config
|
|
59
61
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
timestamp: new Date().toISOString()
|
|
63
|
-
};
|
|
64
|
-
// Promise to handle async archiving
|
|
65
|
-
const archivePromise = new Promise((resolve, reject) => {
|
|
66
|
-
output.on('close', () => {
|
|
67
|
-
resolve();
|
|
68
|
-
});
|
|
69
|
-
output.on('error', (err) => {
|
|
70
|
-
reject(err);
|
|
71
|
-
});
|
|
72
|
-
archive.on('error', (err) => {
|
|
73
|
-
reject(err);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
// Pipe archive data to the file
|
|
77
|
-
archive.pipe(output);
|
|
78
|
-
// Add input files/directory
|
|
79
|
-
if (options.input) {
|
|
80
|
-
const inputPath = path.resolve(options.input);
|
|
81
|
-
if (!fs.existsSync(inputPath)) {
|
|
82
|
-
return (0, ts_utils_1.fail)(`Input path does not exist: ${inputPath}`);
|
|
83
|
-
}
|
|
84
|
-
const stats = fs.statSync(inputPath);
|
|
85
|
-
if (stats.isDirectory()) {
|
|
86
|
-
// Add entire directory recursively, preserving structure
|
|
87
|
-
const dirName = path.basename(inputPath);
|
|
88
|
-
archive.directory(inputPath, `input/${dirName}`);
|
|
89
|
-
manifest.input = {
|
|
90
|
-
type: 'directory',
|
|
91
|
-
originalPath: inputPath,
|
|
92
|
-
archivePath: `input/${dirName}`
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
else if (stats.isFile()) {
|
|
96
|
-
// Add single file
|
|
97
|
-
const fileName = path.basename(inputPath);
|
|
98
|
-
archive.file(inputPath, { name: `input/${fileName}` });
|
|
99
|
-
manifest.input = {
|
|
100
|
-
type: 'file',
|
|
101
|
-
originalPath: inputPath,
|
|
102
|
-
archivePath: `input/${fileName}`
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
// Add config file
|
|
107
|
-
if (options.config) {
|
|
108
|
-
const configPath = path.resolve(options.config);
|
|
109
|
-
if (!fs.existsSync(configPath)) {
|
|
110
|
-
return (0, ts_utils_1.fail)(`Config file does not exist: ${configPath}`);
|
|
111
|
-
}
|
|
112
|
-
const stats = fs.statSync(configPath);
|
|
113
|
-
if (!stats.isFile()) {
|
|
114
|
-
return (0, ts_utils_1.fail)(`Config path must be a file: ${configPath}`);
|
|
115
|
-
}
|
|
116
|
-
const fileName = path.basename(configPath);
|
|
117
|
-
archive.file(configPath, { name: `config/${fileName}` });
|
|
118
|
-
manifest.config = {
|
|
119
|
-
type: 'file',
|
|
120
|
-
originalPath: configPath,
|
|
121
|
-
archivePath: `config/${fileName}`
|
|
122
|
-
};
|
|
62
|
+
if (createResult.isFailure()) {
|
|
63
|
+
return (0, ts_utils_1.fail)(createResult.message);
|
|
123
64
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
await archive.finalize();
|
|
128
|
-
await archivePromise;
|
|
65
|
+
const { zipBuffer, manifest } = createResult.value;
|
|
66
|
+
// Write the ZIP buffer to disk
|
|
67
|
+
fs.writeFileSync(zipPath, zipBuffer);
|
|
129
68
|
return (0, ts_utils_1.succeed)({
|
|
130
69
|
zipPath,
|
|
131
70
|
manifest
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fgv/ts-res-browser-cli",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-30",
|
|
4
4
|
"description": "Command-line interface to launch ts-res-browser with specified options",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"commander": "^11.0.0",
|
|
25
|
-
"
|
|
26
|
-
"@
|
|
27
|
-
"@fgv/ts-
|
|
28
|
-
"@fgv/ts-
|
|
29
|
-
"@fgv/ts-json
|
|
30
|
-
"@fgv/ts-json": "5.0.0-3"
|
|
25
|
+
"@fgv/ts-res": "5.0.0-30",
|
|
26
|
+
"@fgv/ts-json-base": "5.0.0-30",
|
|
27
|
+
"@fgv/ts-utils": "5.0.0-30",
|
|
28
|
+
"@fgv/ts-res-browser": "5.0.0-30",
|
|
29
|
+
"@fgv/ts-json": "5.0.0-30"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
|
-
"@rushstack/
|
|
34
|
-
"@rushstack/heft
|
|
32
|
+
"@rushstack/eslint-config": "4.4.0",
|
|
33
|
+
"@rushstack/heft": "0.74.4",
|
|
34
|
+
"@rushstack/heft-node-rig": "2.9.5",
|
|
35
35
|
"@types/jest": "^29.5.14",
|
|
36
36
|
"@types/node": "^20.14.9",
|
|
37
|
-
"eslint": "^
|
|
37
|
+
"eslint": "^9.35.0",
|
|
38
38
|
"jest": "^29.7.0",
|
|
39
|
-
"typescript": "
|
|
40
|
-
"@fgv/ts-utils-jest": "5.0.0-
|
|
39
|
+
"typescript": "5.8.3",
|
|
40
|
+
"@fgv/ts-utils-jest": "5.0.0-30"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"build": "heft build --clean",
|
|
44
|
-
"test": "
|
|
44
|
+
"test": "echo 'No tests configured for ts-res-browser-cli - this is a CLI launcher tool' && exit 0",
|
|
45
45
|
"clean": "heft clean",
|
|
46
46
|
"lint": "eslint src --ext .ts",
|
|
47
47
|
"fixlint": "eslint src --ext .ts --fix"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
Start time: Tue Jul 22 2025 07:39:14 GMT+0000 (Coordinated Universal Time)
|
|
2
|
-
Invoking "/usr/bin/tar -c -f /home/runner/work/fgv/fgv/common/temp/build-cache/6fdce6325ccacda5ae840a289f20e286e54e4f4b-875defd8b242f650.temp -z --files-from=-"
|
|
3
|
-
|
|
4
|
-
======= BEGIN PROCESS INPUT ======
|
|
5
|
-
.rush/temp/operation/build/all.log
|
|
6
|
-
.rush/temp/operation/build/log-chunks.jsonl
|
|
7
|
-
.rush/temp/operation/build/state.json
|
|
8
|
-
lib/browserLauncher.d.ts
|
|
9
|
-
lib/browserLauncher.d.ts.map
|
|
10
|
-
lib/browserLauncher.js
|
|
11
|
-
lib/browserLauncher.js.map
|
|
12
|
-
lib/cli.d.ts
|
|
13
|
-
lib/cli.d.ts.map
|
|
14
|
-
lib/cli.js
|
|
15
|
-
lib/cli.js.map
|
|
16
|
-
lib/index.d.ts
|
|
17
|
-
lib/index.d.ts.map
|
|
18
|
-
lib/index.js
|
|
19
|
-
lib/index.js.map
|
|
20
|
-
lib/options.d.ts
|
|
21
|
-
lib/options.d.ts.map
|
|
22
|
-
lib/options.js
|
|
23
|
-
lib/options.js.map
|
|
24
|
-
lib/zipArchiver.d.ts
|
|
25
|
-
lib/zipArchiver.d.ts.map
|
|
26
|
-
lib/zipArchiver.js
|
|
27
|
-
lib/zipArchiver.js.map
|
|
28
|
-
======== END PROCESS INPUT =======
|
|
29
|
-
======= BEGIN PROCESS OUTPUT =======
|
|
30
|
-
======== END PROCESS OUTPUT ========
|
|
31
|
-
|
|
32
|
-
Exited with code "0"
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{"kind":"O","text":"Invoking: heft build --clean \n"}
|
|
2
|
-
{"kind":"O","text":" ---- build started ---- \n"}
|
|
3
|
-
{"kind":"O","text":"[build:typescript] Using TypeScript version 5.8.3\n"}
|
|
4
|
-
{"kind":"O","text":" ---- build finished (4.947s) ---- \n"}
|
|
5
|
-
{"kind":"O","text":"-------------------- Finished (4.953s) --------------------\n"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
{"kind":"O","text":"Invoking: heft build --clean \n"}
|
|
2
|
-
{"kind":"O","text":" ---- build started ---- \n"}
|
|
3
|
-
{"kind":"O","text":"[build:typescript] Using TypeScript version 5.8.3\n"}
|
|
4
|
-
{"kind":"O","text":" ---- build finished (4.947s) ---- \n"}
|
|
5
|
-
{"kind":"O","text":"-------------------- Finished (4.953s) --------------------\n"}
|