@seeka-labs/cli-apps 3.8.2 → 3.8.6
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/ai-context/internal/examples/_index.md +1 -1
- package/dist/ai-context/internal/examples/v1/activecampaign/_ai-summary.md +25 -32
- package/dist/ai-context/internal/examples/v1/complianz/_ai-summary.md +17 -23
- package/dist/ai-context/internal/examples/v1/ivvy/_ai-summary.md +20 -19
- package/dist/ai-context/internal/examples/v1/me-and-u-connect/_ai-summary.md +18 -16
- package/dist/ai-context/internal/examples/v1/me-and-u-manage/_ai-summary.md +22 -34
- package/dist/ai-context/internal/examples/v1/nowbookit/_ai-summary.md +26 -26
- package/dist/ai-context/internal/examples/v1/sevenrooms/_ai-summary.md +22 -21
- package/dist/ai-context/internal/examples/v1/tradable-bits/_ai-summary.md +20 -22
- package/dist/ai-context/internal/examples/v1/transcend/_ai-summary.md +43 -23
- package/dist/ai-context/internal/examples/v2/calendly/_ai-summary.md +19 -16
- package/dist/ai-context/internal/examples/v2/clarity/_ai-summary.md +14 -21
- package/dist/ai-context/internal/examples/v2/google-bigquery/_ai-summary.md +15 -14
- package/dist/ai-context/internal/examples/v2/klaviyo-events/_ai-summary.md +24 -15
- package/dist/ai-context/internal/examples/v2/navitas/_ai-summary.md +16 -28
- package/dist/ai-context/internal/examples/v2/trustarc/_ai-summary.md +14 -16
- package/dist/ai-context/internal/examples/v2/typeform/_ai-summary.md +20 -19
- package/dist/ai-context/internal/examples/v2/webhook/_ai-summary.md +16 -14
- package/dist/ai-context/internal/examples/v2/yeastar/_ai-summary.md +19 -15
- package/dist/ai-context/internal/examples/v3/google-ads/_ai-summary.md +19 -17
- package/dist/index.cjs +2465 -281
- package/dist/index.cjs.map +4 -4
- package/dist/init-template/README.azurefunc.md +1 -1
- package/dist/init-template/app/browser/package.json +1 -1
- package/dist/init-template/app/lib/package.json +1 -1
- package/dist/init-template/app/server-azurefunc/package.json +1 -1
- package/dist/init-template/app/ui/package.json +1 -1
- package/package.json +5 -2
- package/dist/ai-context/internal/architecture/v1-structure.md +0 -192
- package/dist/ai-context/internal/architecture/v2-structure.md +0 -261
- package/dist/ai-context/internal/architecture/v3-structure.md +0 -386
- package/dist/ai-context/internal/examples/v1/_index.md +0 -53
- package/dist/ai-context/internal/examples/v2/_index.md +0 -66
- package/dist/ai-context/internal/examples/v3/_index.md +0 -105
package/dist/index.cjs
CHANGED
|
@@ -177,16 +177,16 @@ var require_util = __commonJS({
|
|
|
177
177
|
}
|
|
178
178
|
exports2.urlGenerate = urlGenerate;
|
|
179
179
|
function normalize2(aPath) {
|
|
180
|
-
var
|
|
180
|
+
var path8 = aPath;
|
|
181
181
|
var url = urlParse(aPath);
|
|
182
182
|
if (url) {
|
|
183
183
|
if (!url.path) {
|
|
184
184
|
return aPath;
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
path8 = url.path;
|
|
187
187
|
}
|
|
188
|
-
var isAbsolute = exports2.isAbsolute(
|
|
189
|
-
var parts =
|
|
188
|
+
var isAbsolute = exports2.isAbsolute(path8);
|
|
189
|
+
var parts = path8.split(/\/+/);
|
|
190
190
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
191
191
|
part = parts[i];
|
|
192
192
|
if (part === ".") {
|
|
@@ -203,15 +203,15 @@ var require_util = __commonJS({
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
|
|
206
|
+
path8 = parts.join("/");
|
|
207
|
+
if (path8 === "") {
|
|
208
|
+
path8 = isAbsolute ? "/" : ".";
|
|
209
209
|
}
|
|
210
210
|
if (url) {
|
|
211
|
-
url.path =
|
|
211
|
+
url.path = path8;
|
|
212
212
|
return urlGenerate(url);
|
|
213
213
|
}
|
|
214
|
-
return
|
|
214
|
+
return path8;
|
|
215
215
|
}
|
|
216
216
|
exports2.normalize = normalize2;
|
|
217
217
|
function join4(aRoot, aPath) {
|
|
@@ -1831,12 +1831,12 @@ var require_buffer_from = __commonJS({
|
|
|
1831
1831
|
var require_source_map_support = __commonJS({
|
|
1832
1832
|
"../../node_modules/source-map-support/source-map-support.js"(exports2, module2) {
|
|
1833
1833
|
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
|
1834
|
-
var
|
|
1835
|
-
var
|
|
1834
|
+
var path8 = require("path");
|
|
1835
|
+
var fs7;
|
|
1836
1836
|
try {
|
|
1837
|
-
|
|
1838
|
-
if (!
|
|
1839
|
-
|
|
1837
|
+
fs7 = require("fs");
|
|
1838
|
+
if (!fs7.existsSync || !fs7.readFileSync) {
|
|
1839
|
+
fs7 = null;
|
|
1840
1840
|
}
|
|
1841
1841
|
} catch (err) {
|
|
1842
1842
|
}
|
|
@@ -1892,26 +1892,26 @@ var require_source_map_support = __commonJS({
|
|
|
1892
1892
|
};
|
|
1893
1893
|
}
|
|
1894
1894
|
var retrieveFile = handlerExec(retrieveFileHandlers);
|
|
1895
|
-
retrieveFileHandlers.push(function(
|
|
1896
|
-
|
|
1897
|
-
if (/^file:/.test(
|
|
1898
|
-
|
|
1895
|
+
retrieveFileHandlers.push(function(path9) {
|
|
1896
|
+
path9 = path9.trim();
|
|
1897
|
+
if (/^file:/.test(path9)) {
|
|
1898
|
+
path9 = path9.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
|
1899
1899
|
return drive ? "" : (
|
|
1900
1900
|
// file:///C:/dir/file -> C:/dir/file
|
|
1901
1901
|
"/"
|
|
1902
1902
|
);
|
|
1903
1903
|
});
|
|
1904
1904
|
}
|
|
1905
|
-
if (
|
|
1906
|
-
return fileContentsCache[
|
|
1905
|
+
if (path9 in fileContentsCache) {
|
|
1906
|
+
return fileContentsCache[path9];
|
|
1907
1907
|
}
|
|
1908
1908
|
var contents = "";
|
|
1909
1909
|
try {
|
|
1910
|
-
if (!
|
|
1910
|
+
if (!fs7) {
|
|
1911
1911
|
var xhr = new XMLHttpRequest();
|
|
1912
1912
|
xhr.open(
|
|
1913
1913
|
"GET",
|
|
1914
|
-
|
|
1914
|
+
path9,
|
|
1915
1915
|
/** async */
|
|
1916
1916
|
false
|
|
1917
1917
|
);
|
|
@@ -1919,24 +1919,24 @@ var require_source_map_support = __commonJS({
|
|
|
1919
1919
|
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
1920
1920
|
contents = xhr.responseText;
|
|
1921
1921
|
}
|
|
1922
|
-
} else if (
|
|
1923
|
-
contents =
|
|
1922
|
+
} else if (fs7.existsSync(path9)) {
|
|
1923
|
+
contents = fs7.readFileSync(path9, "utf8");
|
|
1924
1924
|
}
|
|
1925
1925
|
} catch (er) {
|
|
1926
1926
|
}
|
|
1927
|
-
return fileContentsCache[
|
|
1927
|
+
return fileContentsCache[path9] = contents;
|
|
1928
1928
|
});
|
|
1929
1929
|
function supportRelativeURL(file, url) {
|
|
1930
1930
|
if (!file) return url;
|
|
1931
|
-
var dir =
|
|
1931
|
+
var dir = path8.dirname(file);
|
|
1932
1932
|
var match2 = /^\w+:\/\/[^\/]*/.exec(dir);
|
|
1933
1933
|
var protocol = match2 ? match2[0] : "";
|
|
1934
1934
|
var startPath = dir.slice(protocol.length);
|
|
1935
1935
|
if (protocol && /^\/\w\:/.test(startPath)) {
|
|
1936
1936
|
protocol += "/";
|
|
1937
|
-
return protocol +
|
|
1937
|
+
return protocol + path8.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
|
|
1938
1938
|
}
|
|
1939
|
-
return protocol +
|
|
1939
|
+
return protocol + path8.resolve(dir.slice(protocol.length), url);
|
|
1940
1940
|
}
|
|
1941
1941
|
function retrieveSourceMapURL(source) {
|
|
1942
1942
|
var fileData;
|
|
@@ -2184,9 +2184,9 @@ var require_source_map_support = __commonJS({
|
|
|
2184
2184
|
var line = +match2[2];
|
|
2185
2185
|
var column = +match2[3];
|
|
2186
2186
|
var contents = fileContentsCache[source];
|
|
2187
|
-
if (!contents &&
|
|
2187
|
+
if (!contents && fs7 && fs7.existsSync(source)) {
|
|
2188
2188
|
try {
|
|
2189
|
-
contents =
|
|
2189
|
+
contents = fs7.readFileSync(source, "utf8");
|
|
2190
2190
|
} catch (er) {
|
|
2191
2191
|
contents = "";
|
|
2192
2192
|
}
|
|
@@ -3460,8 +3460,8 @@ var require_command = __commonJS({
|
|
|
3460
3460
|
"../../node_modules/commander/lib/command.js"(exports2) {
|
|
3461
3461
|
var EventEmitter2 = require("node:events").EventEmitter;
|
|
3462
3462
|
var childProcess = require("node:child_process");
|
|
3463
|
-
var
|
|
3464
|
-
var
|
|
3463
|
+
var path8 = require("node:path");
|
|
3464
|
+
var fs7 = require("node:fs");
|
|
3465
3465
|
var process4 = require("node:process");
|
|
3466
3466
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
3467
3467
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -4455,7 +4455,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4455
4455
|
* @param {string} subcommandName
|
|
4456
4456
|
*/
|
|
4457
4457
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
4458
|
-
if (
|
|
4458
|
+
if (fs7.existsSync(executableFile)) return;
|
|
4459
4459
|
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
4460
4460
|
const executableMissing = `'${executableFile}' does not exist
|
|
4461
4461
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -4473,11 +4473,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4473
4473
|
let launchWithNode = false;
|
|
4474
4474
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
4475
4475
|
function findFile(baseDir, baseName) {
|
|
4476
|
-
const localBin =
|
|
4477
|
-
if (
|
|
4478
|
-
if (sourceExt.includes(
|
|
4476
|
+
const localBin = path8.resolve(baseDir, baseName);
|
|
4477
|
+
if (fs7.existsSync(localBin)) return localBin;
|
|
4478
|
+
if (sourceExt.includes(path8.extname(baseName))) return void 0;
|
|
4479
4479
|
const foundExt = sourceExt.find(
|
|
4480
|
-
(ext2) =>
|
|
4480
|
+
(ext2) => fs7.existsSync(`${localBin}${ext2}`)
|
|
4481
4481
|
);
|
|
4482
4482
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
4483
4483
|
return void 0;
|
|
@@ -4489,21 +4489,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4489
4489
|
if (this._scriptPath) {
|
|
4490
4490
|
let resolvedScriptPath;
|
|
4491
4491
|
try {
|
|
4492
|
-
resolvedScriptPath =
|
|
4492
|
+
resolvedScriptPath = fs7.realpathSync(this._scriptPath);
|
|
4493
4493
|
} catch {
|
|
4494
4494
|
resolvedScriptPath = this._scriptPath;
|
|
4495
4495
|
}
|
|
4496
|
-
executableDir =
|
|
4497
|
-
|
|
4496
|
+
executableDir = path8.resolve(
|
|
4497
|
+
path8.dirname(resolvedScriptPath),
|
|
4498
4498
|
executableDir
|
|
4499
4499
|
);
|
|
4500
4500
|
}
|
|
4501
4501
|
if (executableDir) {
|
|
4502
4502
|
let localFile = findFile(executableDir, executableFile);
|
|
4503
4503
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
4504
|
-
const legacyName =
|
|
4504
|
+
const legacyName = path8.basename(
|
|
4505
4505
|
this._scriptPath,
|
|
4506
|
-
|
|
4506
|
+
path8.extname(this._scriptPath)
|
|
4507
4507
|
);
|
|
4508
4508
|
if (legacyName !== this._name) {
|
|
4509
4509
|
localFile = findFile(
|
|
@@ -4514,7 +4514,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4514
4514
|
}
|
|
4515
4515
|
executableFile = localFile || executableFile;
|
|
4516
4516
|
}
|
|
4517
|
-
launchWithNode = sourceExt.includes(
|
|
4517
|
+
launchWithNode = sourceExt.includes(path8.extname(executableFile));
|
|
4518
4518
|
let proc2;
|
|
4519
4519
|
if (process4.platform !== "win32") {
|
|
4520
4520
|
if (launchWithNode) {
|
|
@@ -5429,7 +5429,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5429
5429
|
* @return {Command}
|
|
5430
5430
|
*/
|
|
5431
5431
|
nameFromFilename(filename) {
|
|
5432
|
-
this._name =
|
|
5432
|
+
this._name = path8.basename(filename, path8.extname(filename));
|
|
5433
5433
|
return this;
|
|
5434
5434
|
}
|
|
5435
5435
|
/**
|
|
@@ -5443,9 +5443,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5443
5443
|
* @param {string} [path]
|
|
5444
5444
|
* @return {(string|null|Command)}
|
|
5445
5445
|
*/
|
|
5446
|
-
executableDir(
|
|
5447
|
-
if (
|
|
5448
|
-
this._executableDir =
|
|
5446
|
+
executableDir(path9) {
|
|
5447
|
+
if (path9 === void 0) return this._executableDir;
|
|
5448
|
+
this._executableDir = path9;
|
|
5449
5449
|
return this;
|
|
5450
5450
|
}
|
|
5451
5451
|
/**
|
|
@@ -5728,8 +5728,8 @@ var require_windows = __commonJS({
|
|
|
5728
5728
|
"../../node_modules/cross-spawn/node_modules/isexe/windows.js"(exports2, module2) {
|
|
5729
5729
|
module2.exports = isexe;
|
|
5730
5730
|
isexe.sync = sync3;
|
|
5731
|
-
var
|
|
5732
|
-
function checkPathExt(
|
|
5731
|
+
var fs7 = require("fs");
|
|
5732
|
+
function checkPathExt(path8, options) {
|
|
5733
5733
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
5734
5734
|
if (!pathext) {
|
|
5735
5735
|
return true;
|
|
@@ -5740,25 +5740,25 @@ var require_windows = __commonJS({
|
|
|
5740
5740
|
}
|
|
5741
5741
|
for (var i = 0; i < pathext.length; i++) {
|
|
5742
5742
|
var p = pathext[i].toLowerCase();
|
|
5743
|
-
if (p &&
|
|
5743
|
+
if (p && path8.substr(-p.length).toLowerCase() === p) {
|
|
5744
5744
|
return true;
|
|
5745
5745
|
}
|
|
5746
5746
|
}
|
|
5747
5747
|
return false;
|
|
5748
5748
|
}
|
|
5749
|
-
function checkStat(stat,
|
|
5749
|
+
function checkStat(stat, path8, options) {
|
|
5750
5750
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
5751
5751
|
return false;
|
|
5752
5752
|
}
|
|
5753
|
-
return checkPathExt(
|
|
5753
|
+
return checkPathExt(path8, options);
|
|
5754
5754
|
}
|
|
5755
|
-
function isexe(
|
|
5756
|
-
|
|
5757
|
-
cb(er, er ? false : checkStat(stat,
|
|
5755
|
+
function isexe(path8, options, cb) {
|
|
5756
|
+
fs7.stat(path8, function(er, stat) {
|
|
5757
|
+
cb(er, er ? false : checkStat(stat, path8, options));
|
|
5758
5758
|
});
|
|
5759
5759
|
}
|
|
5760
|
-
function sync3(
|
|
5761
|
-
return checkStat(
|
|
5760
|
+
function sync3(path8, options) {
|
|
5761
|
+
return checkStat(fs7.statSync(path8), path8, options);
|
|
5762
5762
|
}
|
|
5763
5763
|
}
|
|
5764
5764
|
});
|
|
@@ -5768,14 +5768,14 @@ var require_mode = __commonJS({
|
|
|
5768
5768
|
"../../node_modules/cross-spawn/node_modules/isexe/mode.js"(exports2, module2) {
|
|
5769
5769
|
module2.exports = isexe;
|
|
5770
5770
|
isexe.sync = sync3;
|
|
5771
|
-
var
|
|
5772
|
-
function isexe(
|
|
5773
|
-
|
|
5771
|
+
var fs7 = require("fs");
|
|
5772
|
+
function isexe(path8, options, cb) {
|
|
5773
|
+
fs7.stat(path8, function(er, stat) {
|
|
5774
5774
|
cb(er, er ? false : checkStat(stat, options));
|
|
5775
5775
|
});
|
|
5776
5776
|
}
|
|
5777
|
-
function sync3(
|
|
5778
|
-
return checkStat(
|
|
5777
|
+
function sync3(path8, options) {
|
|
5778
|
+
return checkStat(fs7.statSync(path8), options);
|
|
5779
5779
|
}
|
|
5780
5780
|
function checkStat(stat, options) {
|
|
5781
5781
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -5799,7 +5799,7 @@ var require_mode = __commonJS({
|
|
|
5799
5799
|
// ../../node_modules/cross-spawn/node_modules/isexe/index.js
|
|
5800
5800
|
var require_isexe = __commonJS({
|
|
5801
5801
|
"../../node_modules/cross-spawn/node_modules/isexe/index.js"(exports2, module2) {
|
|
5802
|
-
var
|
|
5802
|
+
var fs7 = require("fs");
|
|
5803
5803
|
var core;
|
|
5804
5804
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
5805
5805
|
core = require_windows();
|
|
@@ -5808,7 +5808,7 @@ var require_isexe = __commonJS({
|
|
|
5808
5808
|
}
|
|
5809
5809
|
module2.exports = isexe;
|
|
5810
5810
|
isexe.sync = sync3;
|
|
5811
|
-
function isexe(
|
|
5811
|
+
function isexe(path8, options, cb) {
|
|
5812
5812
|
if (typeof options === "function") {
|
|
5813
5813
|
cb = options;
|
|
5814
5814
|
options = {};
|
|
@@ -5818,7 +5818,7 @@ var require_isexe = __commonJS({
|
|
|
5818
5818
|
throw new TypeError("callback not provided");
|
|
5819
5819
|
}
|
|
5820
5820
|
return new Promise(function(resolve4, reject) {
|
|
5821
|
-
isexe(
|
|
5821
|
+
isexe(path8, options || {}, function(er, is) {
|
|
5822
5822
|
if (er) {
|
|
5823
5823
|
reject(er);
|
|
5824
5824
|
} else {
|
|
@@ -5827,7 +5827,7 @@ var require_isexe = __commonJS({
|
|
|
5827
5827
|
});
|
|
5828
5828
|
});
|
|
5829
5829
|
}
|
|
5830
|
-
core(
|
|
5830
|
+
core(path8, options || {}, function(er, is) {
|
|
5831
5831
|
if (er) {
|
|
5832
5832
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
5833
5833
|
er = null;
|
|
@@ -5837,9 +5837,9 @@ var require_isexe = __commonJS({
|
|
|
5837
5837
|
cb(er, is);
|
|
5838
5838
|
});
|
|
5839
5839
|
}
|
|
5840
|
-
function sync3(
|
|
5840
|
+
function sync3(path8, options) {
|
|
5841
5841
|
try {
|
|
5842
|
-
return core.sync(
|
|
5842
|
+
return core.sync(path8, options || {});
|
|
5843
5843
|
} catch (er) {
|
|
5844
5844
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
5845
5845
|
return false;
|
|
@@ -5855,7 +5855,7 @@ var require_isexe = __commonJS({
|
|
|
5855
5855
|
var require_which = __commonJS({
|
|
5856
5856
|
"../../node_modules/cross-spawn/node_modules/which/which.js"(exports2, module2) {
|
|
5857
5857
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
5858
|
-
var
|
|
5858
|
+
var path8 = require("path");
|
|
5859
5859
|
var COLON = isWindows ? ";" : ":";
|
|
5860
5860
|
var isexe = require_isexe();
|
|
5861
5861
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -5893,7 +5893,7 @@ var require_which = __commonJS({
|
|
|
5893
5893
|
return opt.all && found.length ? resolve4(found) : reject(getNotFoundError(cmd));
|
|
5894
5894
|
const ppRaw = pathEnv[i];
|
|
5895
5895
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
5896
|
-
const pCmd =
|
|
5896
|
+
const pCmd = path8.join(pathPart, cmd);
|
|
5897
5897
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
5898
5898
|
resolve4(subStep(p, i, 0));
|
|
5899
5899
|
});
|
|
@@ -5920,7 +5920,7 @@ var require_which = __commonJS({
|
|
|
5920
5920
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
5921
5921
|
const ppRaw = pathEnv[i];
|
|
5922
5922
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
5923
|
-
const pCmd =
|
|
5923
|
+
const pCmd = path8.join(pathPart, cmd);
|
|
5924
5924
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
5925
5925
|
for (let j = 0; j < pathExt.length; j++) {
|
|
5926
5926
|
const cur = p + pathExt[j];
|
|
@@ -5968,7 +5968,7 @@ var require_path_key = __commonJS({
|
|
|
5968
5968
|
var require_resolveCommand = __commonJS({
|
|
5969
5969
|
"../../node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
5970
5970
|
"use strict";
|
|
5971
|
-
var
|
|
5971
|
+
var path8 = require("path");
|
|
5972
5972
|
var which = require_which();
|
|
5973
5973
|
var getPathKey = require_path_key();
|
|
5974
5974
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -5986,7 +5986,7 @@ var require_resolveCommand = __commonJS({
|
|
|
5986
5986
|
try {
|
|
5987
5987
|
resolved = which.sync(parsed.command, {
|
|
5988
5988
|
path: env[getPathKey({ env })],
|
|
5989
|
-
pathExt: withoutPathExt ?
|
|
5989
|
+
pathExt: withoutPathExt ? path8.delimiter : void 0
|
|
5990
5990
|
});
|
|
5991
5991
|
} catch (e) {
|
|
5992
5992
|
} finally {
|
|
@@ -5995,7 +5995,7 @@ var require_resolveCommand = __commonJS({
|
|
|
5995
5995
|
}
|
|
5996
5996
|
}
|
|
5997
5997
|
if (resolved) {
|
|
5998
|
-
resolved =
|
|
5998
|
+
resolved = path8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
5999
5999
|
}
|
|
6000
6000
|
return resolved;
|
|
6001
6001
|
}
|
|
@@ -6049,8 +6049,8 @@ var require_shebang_command = __commonJS({
|
|
|
6049
6049
|
if (!match2) {
|
|
6050
6050
|
return null;
|
|
6051
6051
|
}
|
|
6052
|
-
const [
|
|
6053
|
-
const binary =
|
|
6052
|
+
const [path8, argument] = match2[0].replace(/#! ?/, "").split(" ");
|
|
6053
|
+
const binary = path8.split("/").pop();
|
|
6054
6054
|
if (binary === "env") {
|
|
6055
6055
|
return argument;
|
|
6056
6056
|
}
|
|
@@ -6063,16 +6063,16 @@ var require_shebang_command = __commonJS({
|
|
|
6063
6063
|
var require_readShebang = __commonJS({
|
|
6064
6064
|
"../../node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
6065
6065
|
"use strict";
|
|
6066
|
-
var
|
|
6066
|
+
var fs7 = require("fs");
|
|
6067
6067
|
var shebangCommand = require_shebang_command();
|
|
6068
6068
|
function readShebang(command) {
|
|
6069
6069
|
const size = 150;
|
|
6070
6070
|
const buffer = Buffer.alloc(size);
|
|
6071
6071
|
let fd;
|
|
6072
6072
|
try {
|
|
6073
|
-
fd =
|
|
6074
|
-
|
|
6075
|
-
|
|
6073
|
+
fd = fs7.openSync(command, "r");
|
|
6074
|
+
fs7.readSync(fd, buffer, 0, size, 0);
|
|
6075
|
+
fs7.closeSync(fd);
|
|
6076
6076
|
} catch (e) {
|
|
6077
6077
|
}
|
|
6078
6078
|
return shebangCommand(buffer.toString());
|
|
@@ -6085,7 +6085,7 @@ var require_readShebang = __commonJS({
|
|
|
6085
6085
|
var require_parse = __commonJS({
|
|
6086
6086
|
"../../node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
6087
6087
|
"use strict";
|
|
6088
|
-
var
|
|
6088
|
+
var path8 = require("path");
|
|
6089
6089
|
var resolveCommand = require_resolveCommand();
|
|
6090
6090
|
var escape2 = require_escape();
|
|
6091
6091
|
var readShebang = require_readShebang();
|
|
@@ -6110,7 +6110,7 @@ var require_parse = __commonJS({
|
|
|
6110
6110
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
6111
6111
|
if (parsed.options.forceShell || needsShell) {
|
|
6112
6112
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
6113
|
-
parsed.command =
|
|
6113
|
+
parsed.command = path8.normalize(parsed.command);
|
|
6114
6114
|
parsed.command = escape2.command(parsed.command);
|
|
6115
6115
|
parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars));
|
|
6116
6116
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -7145,9 +7145,9 @@ var require_pump = __commonJS({
|
|
|
7145
7145
|
"../../node_modules/pump/index.js"(exports2, module2) {
|
|
7146
7146
|
var once = require_once();
|
|
7147
7147
|
var eos = require_end_of_stream();
|
|
7148
|
-
var
|
|
7148
|
+
var fs7;
|
|
7149
7149
|
try {
|
|
7150
|
-
|
|
7150
|
+
fs7 = require("fs");
|
|
7151
7151
|
} catch (e) {
|
|
7152
7152
|
}
|
|
7153
7153
|
var noop = function() {
|
|
@@ -7158,8 +7158,8 @@ var require_pump = __commonJS({
|
|
|
7158
7158
|
};
|
|
7159
7159
|
var isFS = function(stream2) {
|
|
7160
7160
|
if (!ancient) return false;
|
|
7161
|
-
if (!
|
|
7162
|
-
return (stream2 instanceof (
|
|
7161
|
+
if (!fs7) return false;
|
|
7162
|
+
return (stream2 instanceof (fs7.ReadStream || noop) || stream2 instanceof (fs7.WriteStream || noop)) && isFn(stream2.close);
|
|
7163
7163
|
};
|
|
7164
7164
|
var isRequest = function(stream2) {
|
|
7165
7165
|
return stream2.setHeader && isFn(stream2.abort);
|
|
@@ -7371,7 +7371,7 @@ var require_pend = __commonJS({
|
|
|
7371
7371
|
// ../../node_modules/fd-slicer/index.js
|
|
7372
7372
|
var require_fd_slicer = __commonJS({
|
|
7373
7373
|
"../../node_modules/fd-slicer/index.js"(exports2) {
|
|
7374
|
-
var
|
|
7374
|
+
var fs7 = require("fs");
|
|
7375
7375
|
var util = require("util");
|
|
7376
7376
|
var stream2 = require("stream");
|
|
7377
7377
|
var Readable = stream2.Readable;
|
|
@@ -7396,7 +7396,7 @@ var require_fd_slicer = __commonJS({
|
|
|
7396
7396
|
FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
|
|
7397
7397
|
var self2 = this;
|
|
7398
7398
|
self2.pend.go(function(cb) {
|
|
7399
|
-
|
|
7399
|
+
fs7.read(self2.fd, buffer, offset, length, position, function(err, bytesRead, buffer2) {
|
|
7400
7400
|
cb();
|
|
7401
7401
|
callback(err, bytesRead, buffer2);
|
|
7402
7402
|
});
|
|
@@ -7405,7 +7405,7 @@ var require_fd_slicer = __commonJS({
|
|
|
7405
7405
|
FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
|
|
7406
7406
|
var self2 = this;
|
|
7407
7407
|
self2.pend.go(function(cb) {
|
|
7408
|
-
|
|
7408
|
+
fs7.write(self2.fd, buffer, offset, length, position, function(err, written, buffer2) {
|
|
7409
7409
|
cb();
|
|
7410
7410
|
callback(err, written, buffer2);
|
|
7411
7411
|
});
|
|
@@ -7426,7 +7426,7 @@ var require_fd_slicer = __commonJS({
|
|
|
7426
7426
|
if (self2.refCount > 0) return;
|
|
7427
7427
|
if (self2.refCount < 0) throw new Error("invalid unref");
|
|
7428
7428
|
if (self2.autoClose) {
|
|
7429
|
-
|
|
7429
|
+
fs7.close(self2.fd, onCloseDone);
|
|
7430
7430
|
}
|
|
7431
7431
|
function onCloseDone(err) {
|
|
7432
7432
|
if (err) {
|
|
@@ -7463,7 +7463,7 @@ var require_fd_slicer = __commonJS({
|
|
|
7463
7463
|
self2.context.pend.go(function(cb) {
|
|
7464
7464
|
if (self2.destroyed) return cb();
|
|
7465
7465
|
var buffer = new Buffer(toRead);
|
|
7466
|
-
|
|
7466
|
+
fs7.read(self2.context.fd, buffer, 0, toRead, self2.pos, function(err, bytesRead) {
|
|
7467
7467
|
if (err) {
|
|
7468
7468
|
self2.destroy(err);
|
|
7469
7469
|
} else if (bytesRead === 0) {
|
|
@@ -7510,7 +7510,7 @@ var require_fd_slicer = __commonJS({
|
|
|
7510
7510
|
}
|
|
7511
7511
|
self2.context.pend.go(function(cb) {
|
|
7512
7512
|
if (self2.destroyed) return cb();
|
|
7513
|
-
|
|
7513
|
+
fs7.write(self2.context.fd, buffer, 0, buffer.length, self2.pos, function(err2, bytes) {
|
|
7514
7514
|
if (err2) {
|
|
7515
7515
|
self2.destroy();
|
|
7516
7516
|
cb();
|
|
@@ -7937,7 +7937,7 @@ var require_buffer_crc32 = __commonJS({
|
|
|
7937
7937
|
// ../../node_modules/yauzl/index.js
|
|
7938
7938
|
var require_yauzl = __commonJS({
|
|
7939
7939
|
"../../node_modules/yauzl/index.js"(exports2) {
|
|
7940
|
-
var
|
|
7940
|
+
var fs7 = require("fs");
|
|
7941
7941
|
var zlib = require("zlib");
|
|
7942
7942
|
var fd_slicer = require_fd_slicer();
|
|
7943
7943
|
var crc32 = require_buffer_crc32();
|
|
@@ -7955,7 +7955,7 @@ var require_yauzl = __commonJS({
|
|
|
7955
7955
|
exports2.ZipFile = ZipFile;
|
|
7956
7956
|
exports2.Entry = Entry;
|
|
7957
7957
|
exports2.RandomAccessReader = RandomAccessReader;
|
|
7958
|
-
function open(
|
|
7958
|
+
function open(path8, options, callback) {
|
|
7959
7959
|
if (typeof options === "function") {
|
|
7960
7960
|
callback = options;
|
|
7961
7961
|
options = null;
|
|
@@ -7967,10 +7967,10 @@ var require_yauzl = __commonJS({
|
|
|
7967
7967
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
7968
7968
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
7969
7969
|
if (callback == null) callback = defaultCallback;
|
|
7970
|
-
|
|
7970
|
+
fs7.open(path8, "r", function(err, fd) {
|
|
7971
7971
|
if (err) return callback(err);
|
|
7972
7972
|
fromFd(fd, options, function(err2, zipfile) {
|
|
7973
|
-
if (err2)
|
|
7973
|
+
if (err2) fs7.close(fd, defaultCallback);
|
|
7974
7974
|
callback(err2, zipfile);
|
|
7975
7975
|
});
|
|
7976
7976
|
});
|
|
@@ -7987,7 +7987,7 @@ var require_yauzl = __commonJS({
|
|
|
7987
7987
|
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
|
|
7988
7988
|
if (options.strictFileNames == null) options.strictFileNames = false;
|
|
7989
7989
|
if (callback == null) callback = defaultCallback;
|
|
7990
|
-
|
|
7990
|
+
fs7.fstat(fd, function(err, stats) {
|
|
7991
7991
|
if (err) return callback(err);
|
|
7992
7992
|
var reader = fd_slicer.createFromFd(fd, { autoClose: true });
|
|
7993
7993
|
fromRandomAccessReader(reader, stats.size, options, callback);
|
|
@@ -8567,9 +8567,9 @@ var require_yauzl = __commonJS({
|
|
|
8567
8567
|
var require_extract_zip = __commonJS({
|
|
8568
8568
|
"../../node_modules/extract-zip/index.js"(exports2, module2) {
|
|
8569
8569
|
var debug = require_src()("extract-zip");
|
|
8570
|
-
var { createWriteStream, promises:
|
|
8570
|
+
var { createWriteStream, promises: fs7 } = require("fs");
|
|
8571
8571
|
var getStream = require_get_stream();
|
|
8572
|
-
var
|
|
8572
|
+
var path8 = require("path");
|
|
8573
8573
|
var { promisify } = require("util");
|
|
8574
8574
|
var stream2 = require("stream");
|
|
8575
8575
|
var yauzl = require_yauzl();
|
|
@@ -8606,12 +8606,12 @@ var require_extract_zip = __commonJS({
|
|
|
8606
8606
|
this.zipfile.readEntry();
|
|
8607
8607
|
return;
|
|
8608
8608
|
}
|
|
8609
|
-
const destDir =
|
|
8609
|
+
const destDir = path8.dirname(path8.join(this.opts.dir, entry.fileName));
|
|
8610
8610
|
try {
|
|
8611
|
-
await
|
|
8612
|
-
const canonicalDestDir = await
|
|
8613
|
-
const relativeDestDir =
|
|
8614
|
-
if (relativeDestDir.split(
|
|
8611
|
+
await fs7.mkdir(destDir, { recursive: true });
|
|
8612
|
+
const canonicalDestDir = await fs7.realpath(destDir);
|
|
8613
|
+
const relativeDestDir = path8.relative(this.opts.dir, canonicalDestDir);
|
|
8614
|
+
if (relativeDestDir.split(path8.sep).includes("..")) {
|
|
8615
8615
|
throw new Error(`Out of bound path "${canonicalDestDir}" found while processing file ${entry.fileName}`);
|
|
8616
8616
|
}
|
|
8617
8617
|
await this.extractEntry(entry);
|
|
@@ -8633,7 +8633,7 @@ var require_extract_zip = __commonJS({
|
|
|
8633
8633
|
if (this.opts.onEntry) {
|
|
8634
8634
|
this.opts.onEntry(entry, this.zipfile);
|
|
8635
8635
|
}
|
|
8636
|
-
const dest =
|
|
8636
|
+
const dest = path8.join(this.opts.dir, entry.fileName);
|
|
8637
8637
|
const mode = entry.externalFileAttributes >> 16 & 65535;
|
|
8638
8638
|
const IFMT2 = 61440;
|
|
8639
8639
|
const IFDIR2 = 16384;
|
|
@@ -8647,20 +8647,20 @@ var require_extract_zip = __commonJS({
|
|
|
8647
8647
|
if (!isDir) isDir = madeBy === 0 && entry.externalFileAttributes === 16;
|
|
8648
8648
|
debug("extracting entry", { filename: entry.fileName, isDir, isSymlink: symlink });
|
|
8649
8649
|
const procMode = this.getExtractedMode(mode, isDir) & 511;
|
|
8650
|
-
const destDir = isDir ? dest :
|
|
8650
|
+
const destDir = isDir ? dest : path8.dirname(dest);
|
|
8651
8651
|
const mkdirOptions = { recursive: true };
|
|
8652
8652
|
if (isDir) {
|
|
8653
8653
|
mkdirOptions.mode = procMode;
|
|
8654
8654
|
}
|
|
8655
8655
|
debug("mkdir", { dir: destDir, ...mkdirOptions });
|
|
8656
|
-
await
|
|
8656
|
+
await fs7.mkdir(destDir, mkdirOptions);
|
|
8657
8657
|
if (isDir) return;
|
|
8658
8658
|
debug("opening read stream", dest);
|
|
8659
8659
|
const readStream = await promisify(this.zipfile.openReadStream.bind(this.zipfile))(entry);
|
|
8660
8660
|
if (symlink) {
|
|
8661
8661
|
const link = await getStream(readStream);
|
|
8662
8662
|
debug("creating symlink", link, dest);
|
|
8663
|
-
await
|
|
8663
|
+
await fs7.symlink(link, dest);
|
|
8664
8664
|
} else {
|
|
8665
8665
|
await pipeline(readStream, createWriteStream(dest, { mode: procMode }));
|
|
8666
8666
|
}
|
|
@@ -8689,11 +8689,11 @@ var require_extract_zip = __commonJS({
|
|
|
8689
8689
|
};
|
|
8690
8690
|
module2.exports = async function(zipPath, opts) {
|
|
8691
8691
|
debug("creating target directory", opts.dir);
|
|
8692
|
-
if (!
|
|
8692
|
+
if (!path8.isAbsolute(opts.dir)) {
|
|
8693
8693
|
throw new Error("Target directory is expected to be absolute");
|
|
8694
8694
|
}
|
|
8695
|
-
await
|
|
8696
|
-
opts.dir = await
|
|
8695
|
+
await fs7.mkdir(opts.dir, { recursive: true });
|
|
8696
|
+
opts.dir = await fs7.realpath(opts.dir);
|
|
8697
8697
|
return new Extractor(zipPath, opts).extract();
|
|
8698
8698
|
};
|
|
8699
8699
|
}
|
|
@@ -11567,8 +11567,8 @@ var require_utils = __commonJS({
|
|
|
11567
11567
|
var result = transform[inputType][outputType](input);
|
|
11568
11568
|
return result;
|
|
11569
11569
|
};
|
|
11570
|
-
exports2.resolve = function(
|
|
11571
|
-
var parts =
|
|
11570
|
+
exports2.resolve = function(path8) {
|
|
11571
|
+
var parts = path8.split("/");
|
|
11572
11572
|
var result = [];
|
|
11573
11573
|
for (var index2 = 0; index2 < parts.length; index2++) {
|
|
11574
11574
|
var part = parts[index2];
|
|
@@ -17421,18 +17421,18 @@ var require_object = __commonJS({
|
|
|
17421
17421
|
var object = new ZipObject(name, zipObjectContent, o);
|
|
17422
17422
|
this.files[name] = object;
|
|
17423
17423
|
};
|
|
17424
|
-
var parentFolder = function(
|
|
17425
|
-
if (
|
|
17426
|
-
|
|
17424
|
+
var parentFolder = function(path8) {
|
|
17425
|
+
if (path8.slice(-1) === "/") {
|
|
17426
|
+
path8 = path8.substring(0, path8.length - 1);
|
|
17427
17427
|
}
|
|
17428
|
-
var lastSlash =
|
|
17429
|
-
return lastSlash > 0 ?
|
|
17428
|
+
var lastSlash = path8.lastIndexOf("/");
|
|
17429
|
+
return lastSlash > 0 ? path8.substring(0, lastSlash) : "";
|
|
17430
17430
|
};
|
|
17431
|
-
var forceTrailingSlash = function(
|
|
17432
|
-
if (
|
|
17433
|
-
|
|
17431
|
+
var forceTrailingSlash = function(path8) {
|
|
17432
|
+
if (path8.slice(-1) !== "/") {
|
|
17433
|
+
path8 += "/";
|
|
17434
17434
|
}
|
|
17435
|
-
return
|
|
17435
|
+
return path8;
|
|
17436
17436
|
};
|
|
17437
17437
|
var folderAdd = function(name, createFolders) {
|
|
17438
17438
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults2.createFolders;
|
|
@@ -18431,6 +18431,2163 @@ var require_lib3 = __commonJS({
|
|
|
18431
18431
|
}
|
|
18432
18432
|
});
|
|
18433
18433
|
|
|
18434
|
+
// ../../node_modules/universalify/index.js
|
|
18435
|
+
var require_universalify = __commonJS({
|
|
18436
|
+
"../../node_modules/universalify/index.js"(exports2) {
|
|
18437
|
+
"use strict";
|
|
18438
|
+
exports2.fromCallback = function(fn) {
|
|
18439
|
+
return Object.defineProperty(function(...args) {
|
|
18440
|
+
if (typeof args[args.length - 1] === "function") fn.apply(this, args);
|
|
18441
|
+
else {
|
|
18442
|
+
return new Promise((resolve4, reject) => {
|
|
18443
|
+
args.push((err, res) => err != null ? reject(err) : resolve4(res));
|
|
18444
|
+
fn.apply(this, args);
|
|
18445
|
+
});
|
|
18446
|
+
}
|
|
18447
|
+
}, "name", { value: fn.name });
|
|
18448
|
+
};
|
|
18449
|
+
exports2.fromPromise = function(fn) {
|
|
18450
|
+
return Object.defineProperty(function(...args) {
|
|
18451
|
+
const cb = args[args.length - 1];
|
|
18452
|
+
if (typeof cb !== "function") return fn.apply(this, args);
|
|
18453
|
+
else {
|
|
18454
|
+
args.pop();
|
|
18455
|
+
fn.apply(this, args).then((r) => cb(null, r), cb);
|
|
18456
|
+
}
|
|
18457
|
+
}, "name", { value: fn.name });
|
|
18458
|
+
};
|
|
18459
|
+
}
|
|
18460
|
+
});
|
|
18461
|
+
|
|
18462
|
+
// ../../node_modules/graceful-fs/polyfills.js
|
|
18463
|
+
var require_polyfills = __commonJS({
|
|
18464
|
+
"../../node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
18465
|
+
var constants = require("constants");
|
|
18466
|
+
var origCwd = process.cwd;
|
|
18467
|
+
var cwd = null;
|
|
18468
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
18469
|
+
process.cwd = function() {
|
|
18470
|
+
if (!cwd)
|
|
18471
|
+
cwd = origCwd.call(process);
|
|
18472
|
+
return cwd;
|
|
18473
|
+
};
|
|
18474
|
+
try {
|
|
18475
|
+
process.cwd();
|
|
18476
|
+
} catch (er) {
|
|
18477
|
+
}
|
|
18478
|
+
if (typeof process.chdir === "function") {
|
|
18479
|
+
chdir = process.chdir;
|
|
18480
|
+
process.chdir = function(d) {
|
|
18481
|
+
cwd = null;
|
|
18482
|
+
chdir.call(process, d);
|
|
18483
|
+
};
|
|
18484
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
18485
|
+
}
|
|
18486
|
+
var chdir;
|
|
18487
|
+
module2.exports = patch;
|
|
18488
|
+
function patch(fs7) {
|
|
18489
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
18490
|
+
patchLchmod(fs7);
|
|
18491
|
+
}
|
|
18492
|
+
if (!fs7.lutimes) {
|
|
18493
|
+
patchLutimes(fs7);
|
|
18494
|
+
}
|
|
18495
|
+
fs7.chown = chownFix(fs7.chown);
|
|
18496
|
+
fs7.fchown = chownFix(fs7.fchown);
|
|
18497
|
+
fs7.lchown = chownFix(fs7.lchown);
|
|
18498
|
+
fs7.chmod = chmodFix(fs7.chmod);
|
|
18499
|
+
fs7.fchmod = chmodFix(fs7.fchmod);
|
|
18500
|
+
fs7.lchmod = chmodFix(fs7.lchmod);
|
|
18501
|
+
fs7.chownSync = chownFixSync(fs7.chownSync);
|
|
18502
|
+
fs7.fchownSync = chownFixSync(fs7.fchownSync);
|
|
18503
|
+
fs7.lchownSync = chownFixSync(fs7.lchownSync);
|
|
18504
|
+
fs7.chmodSync = chmodFixSync(fs7.chmodSync);
|
|
18505
|
+
fs7.fchmodSync = chmodFixSync(fs7.fchmodSync);
|
|
18506
|
+
fs7.lchmodSync = chmodFixSync(fs7.lchmodSync);
|
|
18507
|
+
fs7.stat = statFix(fs7.stat);
|
|
18508
|
+
fs7.fstat = statFix(fs7.fstat);
|
|
18509
|
+
fs7.lstat = statFix(fs7.lstat);
|
|
18510
|
+
fs7.statSync = statFixSync(fs7.statSync);
|
|
18511
|
+
fs7.fstatSync = statFixSync(fs7.fstatSync);
|
|
18512
|
+
fs7.lstatSync = statFixSync(fs7.lstatSync);
|
|
18513
|
+
if (fs7.chmod && !fs7.lchmod) {
|
|
18514
|
+
fs7.lchmod = function(path8, mode, cb) {
|
|
18515
|
+
if (cb) process.nextTick(cb);
|
|
18516
|
+
};
|
|
18517
|
+
fs7.lchmodSync = function() {
|
|
18518
|
+
};
|
|
18519
|
+
}
|
|
18520
|
+
if (fs7.chown && !fs7.lchown) {
|
|
18521
|
+
fs7.lchown = function(path8, uid, gid, cb) {
|
|
18522
|
+
if (cb) process.nextTick(cb);
|
|
18523
|
+
};
|
|
18524
|
+
fs7.lchownSync = function() {
|
|
18525
|
+
};
|
|
18526
|
+
}
|
|
18527
|
+
if (platform === "win32") {
|
|
18528
|
+
fs7.rename = typeof fs7.rename !== "function" ? fs7.rename : (function(fs$rename) {
|
|
18529
|
+
function rename(from2, to, cb) {
|
|
18530
|
+
var start = Date.now();
|
|
18531
|
+
var backoff = 0;
|
|
18532
|
+
fs$rename(from2, to, function CB(er) {
|
|
18533
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
18534
|
+
setTimeout(function() {
|
|
18535
|
+
fs7.stat(to, function(stater, st) {
|
|
18536
|
+
if (stater && stater.code === "ENOENT")
|
|
18537
|
+
fs$rename(from2, to, CB);
|
|
18538
|
+
else
|
|
18539
|
+
cb(er);
|
|
18540
|
+
});
|
|
18541
|
+
}, backoff);
|
|
18542
|
+
if (backoff < 100)
|
|
18543
|
+
backoff += 10;
|
|
18544
|
+
return;
|
|
18545
|
+
}
|
|
18546
|
+
if (cb) cb(er);
|
|
18547
|
+
});
|
|
18548
|
+
}
|
|
18549
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
18550
|
+
return rename;
|
|
18551
|
+
})(fs7.rename);
|
|
18552
|
+
}
|
|
18553
|
+
fs7.read = typeof fs7.read !== "function" ? fs7.read : (function(fs$read) {
|
|
18554
|
+
function read(fd, buffer, offset, length, position, callback_) {
|
|
18555
|
+
var callback;
|
|
18556
|
+
if (callback_ && typeof callback_ === "function") {
|
|
18557
|
+
var eagCounter = 0;
|
|
18558
|
+
callback = function(er, _2, __) {
|
|
18559
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
18560
|
+
eagCounter++;
|
|
18561
|
+
return fs$read.call(fs7, fd, buffer, offset, length, position, callback);
|
|
18562
|
+
}
|
|
18563
|
+
callback_.apply(this, arguments);
|
|
18564
|
+
};
|
|
18565
|
+
}
|
|
18566
|
+
return fs$read.call(fs7, fd, buffer, offset, length, position, callback);
|
|
18567
|
+
}
|
|
18568
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
18569
|
+
return read;
|
|
18570
|
+
})(fs7.read);
|
|
18571
|
+
fs7.readSync = typeof fs7.readSync !== "function" ? fs7.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
18572
|
+
return function(fd, buffer, offset, length, position) {
|
|
18573
|
+
var eagCounter = 0;
|
|
18574
|
+
while (true) {
|
|
18575
|
+
try {
|
|
18576
|
+
return fs$readSync.call(fs7, fd, buffer, offset, length, position);
|
|
18577
|
+
} catch (er) {
|
|
18578
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
18579
|
+
eagCounter++;
|
|
18580
|
+
continue;
|
|
18581
|
+
}
|
|
18582
|
+
throw er;
|
|
18583
|
+
}
|
|
18584
|
+
}
|
|
18585
|
+
};
|
|
18586
|
+
})(fs7.readSync);
|
|
18587
|
+
function patchLchmod(fs8) {
|
|
18588
|
+
fs8.lchmod = function(path8, mode, callback) {
|
|
18589
|
+
fs8.open(
|
|
18590
|
+
path8,
|
|
18591
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
18592
|
+
mode,
|
|
18593
|
+
function(err, fd) {
|
|
18594
|
+
if (err) {
|
|
18595
|
+
if (callback) callback(err);
|
|
18596
|
+
return;
|
|
18597
|
+
}
|
|
18598
|
+
fs8.fchmod(fd, mode, function(err2) {
|
|
18599
|
+
fs8.close(fd, function(err22) {
|
|
18600
|
+
if (callback) callback(err2 || err22);
|
|
18601
|
+
});
|
|
18602
|
+
});
|
|
18603
|
+
}
|
|
18604
|
+
);
|
|
18605
|
+
};
|
|
18606
|
+
fs8.lchmodSync = function(path8, mode) {
|
|
18607
|
+
var fd = fs8.openSync(path8, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
18608
|
+
var threw = true;
|
|
18609
|
+
var ret;
|
|
18610
|
+
try {
|
|
18611
|
+
ret = fs8.fchmodSync(fd, mode);
|
|
18612
|
+
threw = false;
|
|
18613
|
+
} finally {
|
|
18614
|
+
if (threw) {
|
|
18615
|
+
try {
|
|
18616
|
+
fs8.closeSync(fd);
|
|
18617
|
+
} catch (er) {
|
|
18618
|
+
}
|
|
18619
|
+
} else {
|
|
18620
|
+
fs8.closeSync(fd);
|
|
18621
|
+
}
|
|
18622
|
+
}
|
|
18623
|
+
return ret;
|
|
18624
|
+
};
|
|
18625
|
+
}
|
|
18626
|
+
function patchLutimes(fs8) {
|
|
18627
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs8.futimes) {
|
|
18628
|
+
fs8.lutimes = function(path8, at, mt, cb) {
|
|
18629
|
+
fs8.open(path8, constants.O_SYMLINK, function(er, fd) {
|
|
18630
|
+
if (er) {
|
|
18631
|
+
if (cb) cb(er);
|
|
18632
|
+
return;
|
|
18633
|
+
}
|
|
18634
|
+
fs8.futimes(fd, at, mt, function(er2) {
|
|
18635
|
+
fs8.close(fd, function(er22) {
|
|
18636
|
+
if (cb) cb(er2 || er22);
|
|
18637
|
+
});
|
|
18638
|
+
});
|
|
18639
|
+
});
|
|
18640
|
+
};
|
|
18641
|
+
fs8.lutimesSync = function(path8, at, mt) {
|
|
18642
|
+
var fd = fs8.openSync(path8, constants.O_SYMLINK);
|
|
18643
|
+
var ret;
|
|
18644
|
+
var threw = true;
|
|
18645
|
+
try {
|
|
18646
|
+
ret = fs8.futimesSync(fd, at, mt);
|
|
18647
|
+
threw = false;
|
|
18648
|
+
} finally {
|
|
18649
|
+
if (threw) {
|
|
18650
|
+
try {
|
|
18651
|
+
fs8.closeSync(fd);
|
|
18652
|
+
} catch (er) {
|
|
18653
|
+
}
|
|
18654
|
+
} else {
|
|
18655
|
+
fs8.closeSync(fd);
|
|
18656
|
+
}
|
|
18657
|
+
}
|
|
18658
|
+
return ret;
|
|
18659
|
+
};
|
|
18660
|
+
} else if (fs8.futimes) {
|
|
18661
|
+
fs8.lutimes = function(_a, _b, _c, cb) {
|
|
18662
|
+
if (cb) process.nextTick(cb);
|
|
18663
|
+
};
|
|
18664
|
+
fs8.lutimesSync = function() {
|
|
18665
|
+
};
|
|
18666
|
+
}
|
|
18667
|
+
}
|
|
18668
|
+
function chmodFix(orig) {
|
|
18669
|
+
if (!orig) return orig;
|
|
18670
|
+
return function(target, mode, cb) {
|
|
18671
|
+
return orig.call(fs7, target, mode, function(er) {
|
|
18672
|
+
if (chownErOk(er)) er = null;
|
|
18673
|
+
if (cb) cb.apply(this, arguments);
|
|
18674
|
+
});
|
|
18675
|
+
};
|
|
18676
|
+
}
|
|
18677
|
+
function chmodFixSync(orig) {
|
|
18678
|
+
if (!orig) return orig;
|
|
18679
|
+
return function(target, mode) {
|
|
18680
|
+
try {
|
|
18681
|
+
return orig.call(fs7, target, mode);
|
|
18682
|
+
} catch (er) {
|
|
18683
|
+
if (!chownErOk(er)) throw er;
|
|
18684
|
+
}
|
|
18685
|
+
};
|
|
18686
|
+
}
|
|
18687
|
+
function chownFix(orig) {
|
|
18688
|
+
if (!orig) return orig;
|
|
18689
|
+
return function(target, uid, gid, cb) {
|
|
18690
|
+
return orig.call(fs7, target, uid, gid, function(er) {
|
|
18691
|
+
if (chownErOk(er)) er = null;
|
|
18692
|
+
if (cb) cb.apply(this, arguments);
|
|
18693
|
+
});
|
|
18694
|
+
};
|
|
18695
|
+
}
|
|
18696
|
+
function chownFixSync(orig) {
|
|
18697
|
+
if (!orig) return orig;
|
|
18698
|
+
return function(target, uid, gid) {
|
|
18699
|
+
try {
|
|
18700
|
+
return orig.call(fs7, target, uid, gid);
|
|
18701
|
+
} catch (er) {
|
|
18702
|
+
if (!chownErOk(er)) throw er;
|
|
18703
|
+
}
|
|
18704
|
+
};
|
|
18705
|
+
}
|
|
18706
|
+
function statFix(orig) {
|
|
18707
|
+
if (!orig) return orig;
|
|
18708
|
+
return function(target, options, cb) {
|
|
18709
|
+
if (typeof options === "function") {
|
|
18710
|
+
cb = options;
|
|
18711
|
+
options = null;
|
|
18712
|
+
}
|
|
18713
|
+
function callback(er, stats) {
|
|
18714
|
+
if (stats) {
|
|
18715
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
18716
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
18717
|
+
}
|
|
18718
|
+
if (cb) cb.apply(this, arguments);
|
|
18719
|
+
}
|
|
18720
|
+
return options ? orig.call(fs7, target, options, callback) : orig.call(fs7, target, callback);
|
|
18721
|
+
};
|
|
18722
|
+
}
|
|
18723
|
+
function statFixSync(orig) {
|
|
18724
|
+
if (!orig) return orig;
|
|
18725
|
+
return function(target, options) {
|
|
18726
|
+
var stats = options ? orig.call(fs7, target, options) : orig.call(fs7, target);
|
|
18727
|
+
if (stats) {
|
|
18728
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
18729
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
18730
|
+
}
|
|
18731
|
+
return stats;
|
|
18732
|
+
};
|
|
18733
|
+
}
|
|
18734
|
+
function chownErOk(er) {
|
|
18735
|
+
if (!er)
|
|
18736
|
+
return true;
|
|
18737
|
+
if (er.code === "ENOSYS")
|
|
18738
|
+
return true;
|
|
18739
|
+
var nonroot = !process.getuid || process.getuid() !== 0;
|
|
18740
|
+
if (nonroot) {
|
|
18741
|
+
if (er.code === "EINVAL" || er.code === "EPERM")
|
|
18742
|
+
return true;
|
|
18743
|
+
}
|
|
18744
|
+
return false;
|
|
18745
|
+
}
|
|
18746
|
+
}
|
|
18747
|
+
}
|
|
18748
|
+
});
|
|
18749
|
+
|
|
18750
|
+
// ../../node_modules/graceful-fs/legacy-streams.js
|
|
18751
|
+
var require_legacy_streams = __commonJS({
|
|
18752
|
+
"../../node_modules/graceful-fs/legacy-streams.js"(exports2, module2) {
|
|
18753
|
+
var Stream2 = require("stream").Stream;
|
|
18754
|
+
module2.exports = legacy;
|
|
18755
|
+
function legacy(fs7) {
|
|
18756
|
+
return {
|
|
18757
|
+
ReadStream,
|
|
18758
|
+
WriteStream
|
|
18759
|
+
};
|
|
18760
|
+
function ReadStream(path8, options) {
|
|
18761
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path8, options);
|
|
18762
|
+
Stream2.call(this);
|
|
18763
|
+
var self2 = this;
|
|
18764
|
+
this.path = path8;
|
|
18765
|
+
this.fd = null;
|
|
18766
|
+
this.readable = true;
|
|
18767
|
+
this.paused = false;
|
|
18768
|
+
this.flags = "r";
|
|
18769
|
+
this.mode = 438;
|
|
18770
|
+
this.bufferSize = 64 * 1024;
|
|
18771
|
+
options = options || {};
|
|
18772
|
+
var keys = Object.keys(options);
|
|
18773
|
+
for (var index2 = 0, length = keys.length; index2 < length; index2++) {
|
|
18774
|
+
var key = keys[index2];
|
|
18775
|
+
this[key] = options[key];
|
|
18776
|
+
}
|
|
18777
|
+
if (this.encoding) this.setEncoding(this.encoding);
|
|
18778
|
+
if (this.start !== void 0) {
|
|
18779
|
+
if ("number" !== typeof this.start) {
|
|
18780
|
+
throw TypeError("start must be a Number");
|
|
18781
|
+
}
|
|
18782
|
+
if (this.end === void 0) {
|
|
18783
|
+
this.end = Infinity;
|
|
18784
|
+
} else if ("number" !== typeof this.end) {
|
|
18785
|
+
throw TypeError("end must be a Number");
|
|
18786
|
+
}
|
|
18787
|
+
if (this.start > this.end) {
|
|
18788
|
+
throw new Error("start must be <= end");
|
|
18789
|
+
}
|
|
18790
|
+
this.pos = this.start;
|
|
18791
|
+
}
|
|
18792
|
+
if (this.fd !== null) {
|
|
18793
|
+
process.nextTick(function() {
|
|
18794
|
+
self2._read();
|
|
18795
|
+
});
|
|
18796
|
+
return;
|
|
18797
|
+
}
|
|
18798
|
+
fs7.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
18799
|
+
if (err) {
|
|
18800
|
+
self2.emit("error", err);
|
|
18801
|
+
self2.readable = false;
|
|
18802
|
+
return;
|
|
18803
|
+
}
|
|
18804
|
+
self2.fd = fd;
|
|
18805
|
+
self2.emit("open", fd);
|
|
18806
|
+
self2._read();
|
|
18807
|
+
});
|
|
18808
|
+
}
|
|
18809
|
+
function WriteStream(path8, options) {
|
|
18810
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path8, options);
|
|
18811
|
+
Stream2.call(this);
|
|
18812
|
+
this.path = path8;
|
|
18813
|
+
this.fd = null;
|
|
18814
|
+
this.writable = true;
|
|
18815
|
+
this.flags = "w";
|
|
18816
|
+
this.encoding = "binary";
|
|
18817
|
+
this.mode = 438;
|
|
18818
|
+
this.bytesWritten = 0;
|
|
18819
|
+
options = options || {};
|
|
18820
|
+
var keys = Object.keys(options);
|
|
18821
|
+
for (var index2 = 0, length = keys.length; index2 < length; index2++) {
|
|
18822
|
+
var key = keys[index2];
|
|
18823
|
+
this[key] = options[key];
|
|
18824
|
+
}
|
|
18825
|
+
if (this.start !== void 0) {
|
|
18826
|
+
if ("number" !== typeof this.start) {
|
|
18827
|
+
throw TypeError("start must be a Number");
|
|
18828
|
+
}
|
|
18829
|
+
if (this.start < 0) {
|
|
18830
|
+
throw new Error("start must be >= zero");
|
|
18831
|
+
}
|
|
18832
|
+
this.pos = this.start;
|
|
18833
|
+
}
|
|
18834
|
+
this.busy = false;
|
|
18835
|
+
this._queue = [];
|
|
18836
|
+
if (this.fd === null) {
|
|
18837
|
+
this._open = fs7.open;
|
|
18838
|
+
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
18839
|
+
this.flush();
|
|
18840
|
+
}
|
|
18841
|
+
}
|
|
18842
|
+
}
|
|
18843
|
+
}
|
|
18844
|
+
});
|
|
18845
|
+
|
|
18846
|
+
// ../../node_modules/graceful-fs/clone.js
|
|
18847
|
+
var require_clone = __commonJS({
|
|
18848
|
+
"../../node_modules/graceful-fs/clone.js"(exports2, module2) {
|
|
18849
|
+
"use strict";
|
|
18850
|
+
module2.exports = clone;
|
|
18851
|
+
var getPrototypeOf = Object.getPrototypeOf || function(obj) {
|
|
18852
|
+
return obj.__proto__;
|
|
18853
|
+
};
|
|
18854
|
+
function clone(obj) {
|
|
18855
|
+
if (obj === null || typeof obj !== "object")
|
|
18856
|
+
return obj;
|
|
18857
|
+
if (obj instanceof Object)
|
|
18858
|
+
var copy = { __proto__: getPrototypeOf(obj) };
|
|
18859
|
+
else
|
|
18860
|
+
var copy = /* @__PURE__ */ Object.create(null);
|
|
18861
|
+
Object.getOwnPropertyNames(obj).forEach(function(key) {
|
|
18862
|
+
Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key));
|
|
18863
|
+
});
|
|
18864
|
+
return copy;
|
|
18865
|
+
}
|
|
18866
|
+
}
|
|
18867
|
+
});
|
|
18868
|
+
|
|
18869
|
+
// ../../node_modules/graceful-fs/graceful-fs.js
|
|
18870
|
+
var require_graceful_fs = __commonJS({
|
|
18871
|
+
"../../node_modules/graceful-fs/graceful-fs.js"(exports2, module2) {
|
|
18872
|
+
var fs7 = require("fs");
|
|
18873
|
+
var polyfills = require_polyfills();
|
|
18874
|
+
var legacy = require_legacy_streams();
|
|
18875
|
+
var clone = require_clone();
|
|
18876
|
+
var util = require("util");
|
|
18877
|
+
var gracefulQueue;
|
|
18878
|
+
var previousSymbol;
|
|
18879
|
+
if (typeof Symbol === "function" && typeof Symbol.for === "function") {
|
|
18880
|
+
gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue");
|
|
18881
|
+
previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous");
|
|
18882
|
+
} else {
|
|
18883
|
+
gracefulQueue = "___graceful-fs.queue";
|
|
18884
|
+
previousSymbol = "___graceful-fs.previous";
|
|
18885
|
+
}
|
|
18886
|
+
function noop() {
|
|
18887
|
+
}
|
|
18888
|
+
function publishQueue(context, queue2) {
|
|
18889
|
+
Object.defineProperty(context, gracefulQueue, {
|
|
18890
|
+
get: function() {
|
|
18891
|
+
return queue2;
|
|
18892
|
+
}
|
|
18893
|
+
});
|
|
18894
|
+
}
|
|
18895
|
+
var debug = noop;
|
|
18896
|
+
if (util.debuglog)
|
|
18897
|
+
debug = util.debuglog("gfs4");
|
|
18898
|
+
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
18899
|
+
debug = function() {
|
|
18900
|
+
var m = util.format.apply(util, arguments);
|
|
18901
|
+
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
18902
|
+
console.error(m);
|
|
18903
|
+
};
|
|
18904
|
+
if (!fs7[gracefulQueue]) {
|
|
18905
|
+
queue = global[gracefulQueue] || [];
|
|
18906
|
+
publishQueue(fs7, queue);
|
|
18907
|
+
fs7.close = (function(fs$close) {
|
|
18908
|
+
function close(fd, cb) {
|
|
18909
|
+
return fs$close.call(fs7, fd, function(err) {
|
|
18910
|
+
if (!err) {
|
|
18911
|
+
resetQueue();
|
|
18912
|
+
}
|
|
18913
|
+
if (typeof cb === "function")
|
|
18914
|
+
cb.apply(this, arguments);
|
|
18915
|
+
});
|
|
18916
|
+
}
|
|
18917
|
+
Object.defineProperty(close, previousSymbol, {
|
|
18918
|
+
value: fs$close
|
|
18919
|
+
});
|
|
18920
|
+
return close;
|
|
18921
|
+
})(fs7.close);
|
|
18922
|
+
fs7.closeSync = (function(fs$closeSync) {
|
|
18923
|
+
function closeSync(fd) {
|
|
18924
|
+
fs$closeSync.apply(fs7, arguments);
|
|
18925
|
+
resetQueue();
|
|
18926
|
+
}
|
|
18927
|
+
Object.defineProperty(closeSync, previousSymbol, {
|
|
18928
|
+
value: fs$closeSync
|
|
18929
|
+
});
|
|
18930
|
+
return closeSync;
|
|
18931
|
+
})(fs7.closeSync);
|
|
18932
|
+
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
18933
|
+
process.on("exit", function() {
|
|
18934
|
+
debug(fs7[gracefulQueue]);
|
|
18935
|
+
require("assert").equal(fs7[gracefulQueue].length, 0);
|
|
18936
|
+
});
|
|
18937
|
+
}
|
|
18938
|
+
}
|
|
18939
|
+
var queue;
|
|
18940
|
+
if (!global[gracefulQueue]) {
|
|
18941
|
+
publishQueue(global, fs7[gracefulQueue]);
|
|
18942
|
+
}
|
|
18943
|
+
module2.exports = patch(clone(fs7));
|
|
18944
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs7.__patched) {
|
|
18945
|
+
module2.exports = patch(fs7);
|
|
18946
|
+
fs7.__patched = true;
|
|
18947
|
+
}
|
|
18948
|
+
function patch(fs8) {
|
|
18949
|
+
polyfills(fs8);
|
|
18950
|
+
fs8.gracefulify = patch;
|
|
18951
|
+
fs8.createReadStream = createReadStream;
|
|
18952
|
+
fs8.createWriteStream = createWriteStream;
|
|
18953
|
+
var fs$readFile = fs8.readFile;
|
|
18954
|
+
fs8.readFile = readFile;
|
|
18955
|
+
function readFile(path8, options, cb) {
|
|
18956
|
+
if (typeof options === "function")
|
|
18957
|
+
cb = options, options = null;
|
|
18958
|
+
return go$readFile(path8, options, cb);
|
|
18959
|
+
function go$readFile(path9, options2, cb2, startTime) {
|
|
18960
|
+
return fs$readFile(path9, options2, function(err) {
|
|
18961
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
18962
|
+
enqueue([go$readFile, [path9, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
18963
|
+
else {
|
|
18964
|
+
if (typeof cb2 === "function")
|
|
18965
|
+
cb2.apply(this, arguments);
|
|
18966
|
+
}
|
|
18967
|
+
});
|
|
18968
|
+
}
|
|
18969
|
+
}
|
|
18970
|
+
var fs$writeFile = fs8.writeFile;
|
|
18971
|
+
fs8.writeFile = writeFile;
|
|
18972
|
+
function writeFile(path8, data, options, cb) {
|
|
18973
|
+
if (typeof options === "function")
|
|
18974
|
+
cb = options, options = null;
|
|
18975
|
+
return go$writeFile(path8, data, options, cb);
|
|
18976
|
+
function go$writeFile(path9, data2, options2, cb2, startTime) {
|
|
18977
|
+
return fs$writeFile(path9, data2, options2, function(err) {
|
|
18978
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
18979
|
+
enqueue([go$writeFile, [path9, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
18980
|
+
else {
|
|
18981
|
+
if (typeof cb2 === "function")
|
|
18982
|
+
cb2.apply(this, arguments);
|
|
18983
|
+
}
|
|
18984
|
+
});
|
|
18985
|
+
}
|
|
18986
|
+
}
|
|
18987
|
+
var fs$appendFile = fs8.appendFile;
|
|
18988
|
+
if (fs$appendFile)
|
|
18989
|
+
fs8.appendFile = appendFile;
|
|
18990
|
+
function appendFile(path8, data, options, cb) {
|
|
18991
|
+
if (typeof options === "function")
|
|
18992
|
+
cb = options, options = null;
|
|
18993
|
+
return go$appendFile(path8, data, options, cb);
|
|
18994
|
+
function go$appendFile(path9, data2, options2, cb2, startTime) {
|
|
18995
|
+
return fs$appendFile(path9, data2, options2, function(err) {
|
|
18996
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
18997
|
+
enqueue([go$appendFile, [path9, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
18998
|
+
else {
|
|
18999
|
+
if (typeof cb2 === "function")
|
|
19000
|
+
cb2.apply(this, arguments);
|
|
19001
|
+
}
|
|
19002
|
+
});
|
|
19003
|
+
}
|
|
19004
|
+
}
|
|
19005
|
+
var fs$copyFile = fs8.copyFile;
|
|
19006
|
+
if (fs$copyFile)
|
|
19007
|
+
fs8.copyFile = copyFile;
|
|
19008
|
+
function copyFile(src, dest, flags, cb) {
|
|
19009
|
+
if (typeof flags === "function") {
|
|
19010
|
+
cb = flags;
|
|
19011
|
+
flags = 0;
|
|
19012
|
+
}
|
|
19013
|
+
return go$copyFile(src, dest, flags, cb);
|
|
19014
|
+
function go$copyFile(src2, dest2, flags2, cb2, startTime) {
|
|
19015
|
+
return fs$copyFile(src2, dest2, flags2, function(err) {
|
|
19016
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
19017
|
+
enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
19018
|
+
else {
|
|
19019
|
+
if (typeof cb2 === "function")
|
|
19020
|
+
cb2.apply(this, arguments);
|
|
19021
|
+
}
|
|
19022
|
+
});
|
|
19023
|
+
}
|
|
19024
|
+
}
|
|
19025
|
+
var fs$readdir = fs8.readdir;
|
|
19026
|
+
fs8.readdir = readdir2;
|
|
19027
|
+
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
19028
|
+
function readdir2(path8, options, cb) {
|
|
19029
|
+
if (typeof options === "function")
|
|
19030
|
+
cb = options, options = null;
|
|
19031
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path9, options2, cb2, startTime) {
|
|
19032
|
+
return fs$readdir(path9, fs$readdirCallback(
|
|
19033
|
+
path9,
|
|
19034
|
+
options2,
|
|
19035
|
+
cb2,
|
|
19036
|
+
startTime
|
|
19037
|
+
));
|
|
19038
|
+
} : function go$readdir2(path9, options2, cb2, startTime) {
|
|
19039
|
+
return fs$readdir(path9, options2, fs$readdirCallback(
|
|
19040
|
+
path9,
|
|
19041
|
+
options2,
|
|
19042
|
+
cb2,
|
|
19043
|
+
startTime
|
|
19044
|
+
));
|
|
19045
|
+
};
|
|
19046
|
+
return go$readdir(path8, options, cb);
|
|
19047
|
+
function fs$readdirCallback(path9, options2, cb2, startTime) {
|
|
19048
|
+
return function(err, files) {
|
|
19049
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
19050
|
+
enqueue([
|
|
19051
|
+
go$readdir,
|
|
19052
|
+
[path9, options2, cb2],
|
|
19053
|
+
err,
|
|
19054
|
+
startTime || Date.now(),
|
|
19055
|
+
Date.now()
|
|
19056
|
+
]);
|
|
19057
|
+
else {
|
|
19058
|
+
if (files && files.sort)
|
|
19059
|
+
files.sort();
|
|
19060
|
+
if (typeof cb2 === "function")
|
|
19061
|
+
cb2.call(this, err, files);
|
|
19062
|
+
}
|
|
19063
|
+
};
|
|
19064
|
+
}
|
|
19065
|
+
}
|
|
19066
|
+
if (process.version.substr(0, 4) === "v0.8") {
|
|
19067
|
+
var legStreams = legacy(fs8);
|
|
19068
|
+
ReadStream = legStreams.ReadStream;
|
|
19069
|
+
WriteStream = legStreams.WriteStream;
|
|
19070
|
+
}
|
|
19071
|
+
var fs$ReadStream = fs8.ReadStream;
|
|
19072
|
+
if (fs$ReadStream) {
|
|
19073
|
+
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
19074
|
+
ReadStream.prototype.open = ReadStream$open;
|
|
19075
|
+
}
|
|
19076
|
+
var fs$WriteStream = fs8.WriteStream;
|
|
19077
|
+
if (fs$WriteStream) {
|
|
19078
|
+
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
19079
|
+
WriteStream.prototype.open = WriteStream$open;
|
|
19080
|
+
}
|
|
19081
|
+
Object.defineProperty(fs8, "ReadStream", {
|
|
19082
|
+
get: function() {
|
|
19083
|
+
return ReadStream;
|
|
19084
|
+
},
|
|
19085
|
+
set: function(val) {
|
|
19086
|
+
ReadStream = val;
|
|
19087
|
+
},
|
|
19088
|
+
enumerable: true,
|
|
19089
|
+
configurable: true
|
|
19090
|
+
});
|
|
19091
|
+
Object.defineProperty(fs8, "WriteStream", {
|
|
19092
|
+
get: function() {
|
|
19093
|
+
return WriteStream;
|
|
19094
|
+
},
|
|
19095
|
+
set: function(val) {
|
|
19096
|
+
WriteStream = val;
|
|
19097
|
+
},
|
|
19098
|
+
enumerable: true,
|
|
19099
|
+
configurable: true
|
|
19100
|
+
});
|
|
19101
|
+
var FileReadStream = ReadStream;
|
|
19102
|
+
Object.defineProperty(fs8, "FileReadStream", {
|
|
19103
|
+
get: function() {
|
|
19104
|
+
return FileReadStream;
|
|
19105
|
+
},
|
|
19106
|
+
set: function(val) {
|
|
19107
|
+
FileReadStream = val;
|
|
19108
|
+
},
|
|
19109
|
+
enumerable: true,
|
|
19110
|
+
configurable: true
|
|
19111
|
+
});
|
|
19112
|
+
var FileWriteStream = WriteStream;
|
|
19113
|
+
Object.defineProperty(fs8, "FileWriteStream", {
|
|
19114
|
+
get: function() {
|
|
19115
|
+
return FileWriteStream;
|
|
19116
|
+
},
|
|
19117
|
+
set: function(val) {
|
|
19118
|
+
FileWriteStream = val;
|
|
19119
|
+
},
|
|
19120
|
+
enumerable: true,
|
|
19121
|
+
configurable: true
|
|
19122
|
+
});
|
|
19123
|
+
function ReadStream(path8, options) {
|
|
19124
|
+
if (this instanceof ReadStream)
|
|
19125
|
+
return fs$ReadStream.apply(this, arguments), this;
|
|
19126
|
+
else
|
|
19127
|
+
return ReadStream.apply(Object.create(ReadStream.prototype), arguments);
|
|
19128
|
+
}
|
|
19129
|
+
function ReadStream$open() {
|
|
19130
|
+
var that = this;
|
|
19131
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
19132
|
+
if (err) {
|
|
19133
|
+
if (that.autoClose)
|
|
19134
|
+
that.destroy();
|
|
19135
|
+
that.emit("error", err);
|
|
19136
|
+
} else {
|
|
19137
|
+
that.fd = fd;
|
|
19138
|
+
that.emit("open", fd);
|
|
19139
|
+
that.read();
|
|
19140
|
+
}
|
|
19141
|
+
});
|
|
19142
|
+
}
|
|
19143
|
+
function WriteStream(path8, options) {
|
|
19144
|
+
if (this instanceof WriteStream)
|
|
19145
|
+
return fs$WriteStream.apply(this, arguments), this;
|
|
19146
|
+
else
|
|
19147
|
+
return WriteStream.apply(Object.create(WriteStream.prototype), arguments);
|
|
19148
|
+
}
|
|
19149
|
+
function WriteStream$open() {
|
|
19150
|
+
var that = this;
|
|
19151
|
+
open(that.path, that.flags, that.mode, function(err, fd) {
|
|
19152
|
+
if (err) {
|
|
19153
|
+
that.destroy();
|
|
19154
|
+
that.emit("error", err);
|
|
19155
|
+
} else {
|
|
19156
|
+
that.fd = fd;
|
|
19157
|
+
that.emit("open", fd);
|
|
19158
|
+
}
|
|
19159
|
+
});
|
|
19160
|
+
}
|
|
19161
|
+
function createReadStream(path8, options) {
|
|
19162
|
+
return new fs8.ReadStream(path8, options);
|
|
19163
|
+
}
|
|
19164
|
+
function createWriteStream(path8, options) {
|
|
19165
|
+
return new fs8.WriteStream(path8, options);
|
|
19166
|
+
}
|
|
19167
|
+
var fs$open = fs8.open;
|
|
19168
|
+
fs8.open = open;
|
|
19169
|
+
function open(path8, flags, mode, cb) {
|
|
19170
|
+
if (typeof mode === "function")
|
|
19171
|
+
cb = mode, mode = null;
|
|
19172
|
+
return go$open(path8, flags, mode, cb);
|
|
19173
|
+
function go$open(path9, flags2, mode2, cb2, startTime) {
|
|
19174
|
+
return fs$open(path9, flags2, mode2, function(err, fd) {
|
|
19175
|
+
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
19176
|
+
enqueue([go$open, [path9, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
19177
|
+
else {
|
|
19178
|
+
if (typeof cb2 === "function")
|
|
19179
|
+
cb2.apply(this, arguments);
|
|
19180
|
+
}
|
|
19181
|
+
});
|
|
19182
|
+
}
|
|
19183
|
+
}
|
|
19184
|
+
return fs8;
|
|
19185
|
+
}
|
|
19186
|
+
function enqueue(elem) {
|
|
19187
|
+
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
19188
|
+
fs7[gracefulQueue].push(elem);
|
|
19189
|
+
retry();
|
|
19190
|
+
}
|
|
19191
|
+
var retryTimer;
|
|
19192
|
+
function resetQueue() {
|
|
19193
|
+
var now = Date.now();
|
|
19194
|
+
for (var i = 0; i < fs7[gracefulQueue].length; ++i) {
|
|
19195
|
+
if (fs7[gracefulQueue][i].length > 2) {
|
|
19196
|
+
fs7[gracefulQueue][i][3] = now;
|
|
19197
|
+
fs7[gracefulQueue][i][4] = now;
|
|
19198
|
+
}
|
|
19199
|
+
}
|
|
19200
|
+
retry();
|
|
19201
|
+
}
|
|
19202
|
+
function retry() {
|
|
19203
|
+
clearTimeout(retryTimer);
|
|
19204
|
+
retryTimer = void 0;
|
|
19205
|
+
if (fs7[gracefulQueue].length === 0)
|
|
19206
|
+
return;
|
|
19207
|
+
var elem = fs7[gracefulQueue].shift();
|
|
19208
|
+
var fn = elem[0];
|
|
19209
|
+
var args = elem[1];
|
|
19210
|
+
var err = elem[2];
|
|
19211
|
+
var startTime = elem[3];
|
|
19212
|
+
var lastTime = elem[4];
|
|
19213
|
+
if (startTime === void 0) {
|
|
19214
|
+
debug("RETRY", fn.name, args);
|
|
19215
|
+
fn.apply(null, args);
|
|
19216
|
+
} else if (Date.now() - startTime >= 6e4) {
|
|
19217
|
+
debug("TIMEOUT", fn.name, args);
|
|
19218
|
+
var cb = args.pop();
|
|
19219
|
+
if (typeof cb === "function")
|
|
19220
|
+
cb.call(null, err);
|
|
19221
|
+
} else {
|
|
19222
|
+
var sinceAttempt = Date.now() - lastTime;
|
|
19223
|
+
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
19224
|
+
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
19225
|
+
if (sinceAttempt >= desiredDelay) {
|
|
19226
|
+
debug("RETRY", fn.name, args);
|
|
19227
|
+
fn.apply(null, args.concat([startTime]));
|
|
19228
|
+
} else {
|
|
19229
|
+
fs7[gracefulQueue].push(elem);
|
|
19230
|
+
}
|
|
19231
|
+
}
|
|
19232
|
+
if (retryTimer === void 0) {
|
|
19233
|
+
retryTimer = setTimeout(retry, 0);
|
|
19234
|
+
}
|
|
19235
|
+
}
|
|
19236
|
+
}
|
|
19237
|
+
});
|
|
19238
|
+
|
|
19239
|
+
// ../../node_modules/fs-extra/lib/fs/index.js
|
|
19240
|
+
var require_fs = __commonJS({
|
|
19241
|
+
"../../node_modules/fs-extra/lib/fs/index.js"(exports2) {
|
|
19242
|
+
"use strict";
|
|
19243
|
+
var u = require_universalify().fromCallback;
|
|
19244
|
+
var fs7 = require_graceful_fs();
|
|
19245
|
+
var api = [
|
|
19246
|
+
"access",
|
|
19247
|
+
"appendFile",
|
|
19248
|
+
"chmod",
|
|
19249
|
+
"chown",
|
|
19250
|
+
"close",
|
|
19251
|
+
"copyFile",
|
|
19252
|
+
"cp",
|
|
19253
|
+
"fchmod",
|
|
19254
|
+
"fchown",
|
|
19255
|
+
"fdatasync",
|
|
19256
|
+
"fstat",
|
|
19257
|
+
"fsync",
|
|
19258
|
+
"ftruncate",
|
|
19259
|
+
"futimes",
|
|
19260
|
+
"glob",
|
|
19261
|
+
"lchmod",
|
|
19262
|
+
"lchown",
|
|
19263
|
+
"lutimes",
|
|
19264
|
+
"link",
|
|
19265
|
+
"lstat",
|
|
19266
|
+
"mkdir",
|
|
19267
|
+
"mkdtemp",
|
|
19268
|
+
"open",
|
|
19269
|
+
"opendir",
|
|
19270
|
+
"readdir",
|
|
19271
|
+
"readFile",
|
|
19272
|
+
"readlink",
|
|
19273
|
+
"realpath",
|
|
19274
|
+
"rename",
|
|
19275
|
+
"rm",
|
|
19276
|
+
"rmdir",
|
|
19277
|
+
"stat",
|
|
19278
|
+
"statfs",
|
|
19279
|
+
"symlink",
|
|
19280
|
+
"truncate",
|
|
19281
|
+
"unlink",
|
|
19282
|
+
"utimes",
|
|
19283
|
+
"writeFile"
|
|
19284
|
+
].filter((key) => {
|
|
19285
|
+
return typeof fs7[key] === "function";
|
|
19286
|
+
});
|
|
19287
|
+
Object.assign(exports2, fs7);
|
|
19288
|
+
api.forEach((method) => {
|
|
19289
|
+
exports2[method] = u(fs7[method]);
|
|
19290
|
+
});
|
|
19291
|
+
exports2.exists = function(filename, callback) {
|
|
19292
|
+
if (typeof callback === "function") {
|
|
19293
|
+
return fs7.exists(filename, callback);
|
|
19294
|
+
}
|
|
19295
|
+
return new Promise((resolve4) => {
|
|
19296
|
+
return fs7.exists(filename, resolve4);
|
|
19297
|
+
});
|
|
19298
|
+
};
|
|
19299
|
+
exports2.read = function(fd, buffer, offset, length, position, callback) {
|
|
19300
|
+
if (typeof callback === "function") {
|
|
19301
|
+
return fs7.read(fd, buffer, offset, length, position, callback);
|
|
19302
|
+
}
|
|
19303
|
+
return new Promise((resolve4, reject) => {
|
|
19304
|
+
fs7.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
19305
|
+
if (err) return reject(err);
|
|
19306
|
+
resolve4({ bytesRead, buffer: buffer2 });
|
|
19307
|
+
});
|
|
19308
|
+
});
|
|
19309
|
+
};
|
|
19310
|
+
exports2.write = function(fd, buffer, ...args) {
|
|
19311
|
+
if (typeof args[args.length - 1] === "function") {
|
|
19312
|
+
return fs7.write(fd, buffer, ...args);
|
|
19313
|
+
}
|
|
19314
|
+
return new Promise((resolve4, reject) => {
|
|
19315
|
+
fs7.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
19316
|
+
if (err) return reject(err);
|
|
19317
|
+
resolve4({ bytesWritten, buffer: buffer2 });
|
|
19318
|
+
});
|
|
19319
|
+
});
|
|
19320
|
+
};
|
|
19321
|
+
exports2.readv = function(fd, buffers, ...args) {
|
|
19322
|
+
if (typeof args[args.length - 1] === "function") {
|
|
19323
|
+
return fs7.readv(fd, buffers, ...args);
|
|
19324
|
+
}
|
|
19325
|
+
return new Promise((resolve4, reject) => {
|
|
19326
|
+
fs7.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
19327
|
+
if (err) return reject(err);
|
|
19328
|
+
resolve4({ bytesRead, buffers: buffers2 });
|
|
19329
|
+
});
|
|
19330
|
+
});
|
|
19331
|
+
};
|
|
19332
|
+
exports2.writev = function(fd, buffers, ...args) {
|
|
19333
|
+
if (typeof args[args.length - 1] === "function") {
|
|
19334
|
+
return fs7.writev(fd, buffers, ...args);
|
|
19335
|
+
}
|
|
19336
|
+
return new Promise((resolve4, reject) => {
|
|
19337
|
+
fs7.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
19338
|
+
if (err) return reject(err);
|
|
19339
|
+
resolve4({ bytesWritten, buffers: buffers2 });
|
|
19340
|
+
});
|
|
19341
|
+
});
|
|
19342
|
+
};
|
|
19343
|
+
if (typeof fs7.realpath.native === "function") {
|
|
19344
|
+
exports2.realpath.native = u(fs7.realpath.native);
|
|
19345
|
+
} else {
|
|
19346
|
+
process.emitWarning(
|
|
19347
|
+
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
19348
|
+
"Warning",
|
|
19349
|
+
"fs-extra-WARN0003"
|
|
19350
|
+
);
|
|
19351
|
+
}
|
|
19352
|
+
}
|
|
19353
|
+
});
|
|
19354
|
+
|
|
19355
|
+
// ../../node_modules/fs-extra/lib/mkdirs/utils.js
|
|
19356
|
+
var require_utils2 = __commonJS({
|
|
19357
|
+
"../../node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
19358
|
+
"use strict";
|
|
19359
|
+
var path8 = require("path");
|
|
19360
|
+
module2.exports.checkPath = function checkPath(pth) {
|
|
19361
|
+
if (process.platform === "win32") {
|
|
19362
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path8.parse(pth).root, ""));
|
|
19363
|
+
if (pathHasInvalidWinCharacters) {
|
|
19364
|
+
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
19365
|
+
error.code = "EINVAL";
|
|
19366
|
+
throw error;
|
|
19367
|
+
}
|
|
19368
|
+
}
|
|
19369
|
+
};
|
|
19370
|
+
}
|
|
19371
|
+
});
|
|
19372
|
+
|
|
19373
|
+
// ../../node_modules/fs-extra/lib/mkdirs/make-dir.js
|
|
19374
|
+
var require_make_dir = __commonJS({
|
|
19375
|
+
"../../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) {
|
|
19376
|
+
"use strict";
|
|
19377
|
+
var fs7 = require_fs();
|
|
19378
|
+
var { checkPath } = require_utils2();
|
|
19379
|
+
var getMode = (options) => {
|
|
19380
|
+
const defaults2 = { mode: 511 };
|
|
19381
|
+
if (typeof options === "number") return options;
|
|
19382
|
+
return { ...defaults2, ...options }.mode;
|
|
19383
|
+
};
|
|
19384
|
+
module2.exports.makeDir = async (dir, options) => {
|
|
19385
|
+
checkPath(dir);
|
|
19386
|
+
return fs7.mkdir(dir, {
|
|
19387
|
+
mode: getMode(options),
|
|
19388
|
+
recursive: true
|
|
19389
|
+
});
|
|
19390
|
+
};
|
|
19391
|
+
module2.exports.makeDirSync = (dir, options) => {
|
|
19392
|
+
checkPath(dir);
|
|
19393
|
+
return fs7.mkdirSync(dir, {
|
|
19394
|
+
mode: getMode(options),
|
|
19395
|
+
recursive: true
|
|
19396
|
+
});
|
|
19397
|
+
};
|
|
19398
|
+
}
|
|
19399
|
+
});
|
|
19400
|
+
|
|
19401
|
+
// ../../node_modules/fs-extra/lib/mkdirs/index.js
|
|
19402
|
+
var require_mkdirs = __commonJS({
|
|
19403
|
+
"../../node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) {
|
|
19404
|
+
"use strict";
|
|
19405
|
+
var u = require_universalify().fromPromise;
|
|
19406
|
+
var { makeDir: _makeDir, makeDirSync } = require_make_dir();
|
|
19407
|
+
var makeDir = u(_makeDir);
|
|
19408
|
+
module2.exports = {
|
|
19409
|
+
mkdirs: makeDir,
|
|
19410
|
+
mkdirsSync: makeDirSync,
|
|
19411
|
+
// alias
|
|
19412
|
+
mkdirp: makeDir,
|
|
19413
|
+
mkdirpSync: makeDirSync,
|
|
19414
|
+
ensureDir: makeDir,
|
|
19415
|
+
ensureDirSync: makeDirSync
|
|
19416
|
+
};
|
|
19417
|
+
}
|
|
19418
|
+
});
|
|
19419
|
+
|
|
19420
|
+
// ../../node_modules/fs-extra/lib/path-exists/index.js
|
|
19421
|
+
var require_path_exists = __commonJS({
|
|
19422
|
+
"../../node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) {
|
|
19423
|
+
"use strict";
|
|
19424
|
+
var u = require_universalify().fromPromise;
|
|
19425
|
+
var fs7 = require_fs();
|
|
19426
|
+
function pathExists(path8) {
|
|
19427
|
+
return fs7.access(path8).then(() => true).catch(() => false);
|
|
19428
|
+
}
|
|
19429
|
+
module2.exports = {
|
|
19430
|
+
pathExists: u(pathExists),
|
|
19431
|
+
pathExistsSync: fs7.existsSync
|
|
19432
|
+
};
|
|
19433
|
+
}
|
|
19434
|
+
});
|
|
19435
|
+
|
|
19436
|
+
// ../../node_modules/fs-extra/lib/util/utimes.js
|
|
19437
|
+
var require_utimes = __commonJS({
|
|
19438
|
+
"../../node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
19439
|
+
"use strict";
|
|
19440
|
+
var fs7 = require_fs();
|
|
19441
|
+
var u = require_universalify().fromPromise;
|
|
19442
|
+
async function utimesMillis(path8, atime, mtime) {
|
|
19443
|
+
const fd = await fs7.open(path8, "r+");
|
|
19444
|
+
let closeErr = null;
|
|
19445
|
+
try {
|
|
19446
|
+
await fs7.futimes(fd, atime, mtime);
|
|
19447
|
+
} finally {
|
|
19448
|
+
try {
|
|
19449
|
+
await fs7.close(fd);
|
|
19450
|
+
} catch (e) {
|
|
19451
|
+
closeErr = e;
|
|
19452
|
+
}
|
|
19453
|
+
}
|
|
19454
|
+
if (closeErr) {
|
|
19455
|
+
throw closeErr;
|
|
19456
|
+
}
|
|
19457
|
+
}
|
|
19458
|
+
function utimesMillisSync(path8, atime, mtime) {
|
|
19459
|
+
const fd = fs7.openSync(path8, "r+");
|
|
19460
|
+
fs7.futimesSync(fd, atime, mtime);
|
|
19461
|
+
return fs7.closeSync(fd);
|
|
19462
|
+
}
|
|
19463
|
+
module2.exports = {
|
|
19464
|
+
utimesMillis: u(utimesMillis),
|
|
19465
|
+
utimesMillisSync
|
|
19466
|
+
};
|
|
19467
|
+
}
|
|
19468
|
+
});
|
|
19469
|
+
|
|
19470
|
+
// ../../node_modules/fs-extra/lib/util/stat.js
|
|
19471
|
+
var require_stat = __commonJS({
|
|
19472
|
+
"../../node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
19473
|
+
"use strict";
|
|
19474
|
+
var fs7 = require_fs();
|
|
19475
|
+
var path8 = require("path");
|
|
19476
|
+
var u = require_universalify().fromPromise;
|
|
19477
|
+
function getStats(src, dest, opts) {
|
|
19478
|
+
const statFunc = opts.dereference ? (file) => fs7.stat(file, { bigint: true }) : (file) => fs7.lstat(file, { bigint: true });
|
|
19479
|
+
return Promise.all([
|
|
19480
|
+
statFunc(src),
|
|
19481
|
+
statFunc(dest).catch((err) => {
|
|
19482
|
+
if (err.code === "ENOENT") return null;
|
|
19483
|
+
throw err;
|
|
19484
|
+
})
|
|
19485
|
+
]).then(([srcStat, destStat]) => ({ srcStat, destStat }));
|
|
19486
|
+
}
|
|
19487
|
+
function getStatsSync(src, dest, opts) {
|
|
19488
|
+
let destStat;
|
|
19489
|
+
const statFunc = opts.dereference ? (file) => fs7.statSync(file, { bigint: true }) : (file) => fs7.lstatSync(file, { bigint: true });
|
|
19490
|
+
const srcStat = statFunc(src);
|
|
19491
|
+
try {
|
|
19492
|
+
destStat = statFunc(dest);
|
|
19493
|
+
} catch (err) {
|
|
19494
|
+
if (err.code === "ENOENT") return { srcStat, destStat: null };
|
|
19495
|
+
throw err;
|
|
19496
|
+
}
|
|
19497
|
+
return { srcStat, destStat };
|
|
19498
|
+
}
|
|
19499
|
+
async function checkPaths(src, dest, funcName, opts) {
|
|
19500
|
+
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
19501
|
+
if (destStat) {
|
|
19502
|
+
if (areIdentical(srcStat, destStat)) {
|
|
19503
|
+
const srcBaseName = path8.basename(src);
|
|
19504
|
+
const destBaseName = path8.basename(dest);
|
|
19505
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
19506
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
19507
|
+
}
|
|
19508
|
+
throw new Error("Source and destination must not be the same.");
|
|
19509
|
+
}
|
|
19510
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
19511
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
19512
|
+
}
|
|
19513
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
19514
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
19515
|
+
}
|
|
19516
|
+
}
|
|
19517
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
19518
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
19519
|
+
}
|
|
19520
|
+
return { srcStat, destStat };
|
|
19521
|
+
}
|
|
19522
|
+
function checkPathsSync(src, dest, funcName, opts) {
|
|
19523
|
+
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
19524
|
+
if (destStat) {
|
|
19525
|
+
if (areIdentical(srcStat, destStat)) {
|
|
19526
|
+
const srcBaseName = path8.basename(src);
|
|
19527
|
+
const destBaseName = path8.basename(dest);
|
|
19528
|
+
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
19529
|
+
return { srcStat, destStat, isChangingCase: true };
|
|
19530
|
+
}
|
|
19531
|
+
throw new Error("Source and destination must not be the same.");
|
|
19532
|
+
}
|
|
19533
|
+
if (srcStat.isDirectory() && !destStat.isDirectory()) {
|
|
19534
|
+
throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
|
|
19535
|
+
}
|
|
19536
|
+
if (!srcStat.isDirectory() && destStat.isDirectory()) {
|
|
19537
|
+
throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
|
|
19538
|
+
}
|
|
19539
|
+
}
|
|
19540
|
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
|
|
19541
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
19542
|
+
}
|
|
19543
|
+
return { srcStat, destStat };
|
|
19544
|
+
}
|
|
19545
|
+
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
19546
|
+
const srcParent = path8.resolve(path8.dirname(src));
|
|
19547
|
+
const destParent = path8.resolve(path8.dirname(dest));
|
|
19548
|
+
if (destParent === srcParent || destParent === path8.parse(destParent).root) return;
|
|
19549
|
+
let destStat;
|
|
19550
|
+
try {
|
|
19551
|
+
destStat = await fs7.stat(destParent, { bigint: true });
|
|
19552
|
+
} catch (err) {
|
|
19553
|
+
if (err.code === "ENOENT") return;
|
|
19554
|
+
throw err;
|
|
19555
|
+
}
|
|
19556
|
+
if (areIdentical(srcStat, destStat)) {
|
|
19557
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
19558
|
+
}
|
|
19559
|
+
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
19560
|
+
}
|
|
19561
|
+
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
19562
|
+
const srcParent = path8.resolve(path8.dirname(src));
|
|
19563
|
+
const destParent = path8.resolve(path8.dirname(dest));
|
|
19564
|
+
if (destParent === srcParent || destParent === path8.parse(destParent).root) return;
|
|
19565
|
+
let destStat;
|
|
19566
|
+
try {
|
|
19567
|
+
destStat = fs7.statSync(destParent, { bigint: true });
|
|
19568
|
+
} catch (err) {
|
|
19569
|
+
if (err.code === "ENOENT") return;
|
|
19570
|
+
throw err;
|
|
19571
|
+
}
|
|
19572
|
+
if (areIdentical(srcStat, destStat)) {
|
|
19573
|
+
throw new Error(errMsg(src, dest, funcName));
|
|
19574
|
+
}
|
|
19575
|
+
return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
19576
|
+
}
|
|
19577
|
+
function areIdentical(srcStat, destStat) {
|
|
19578
|
+
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
19579
|
+
}
|
|
19580
|
+
function isSrcSubdir(src, dest) {
|
|
19581
|
+
const srcArr = path8.resolve(src).split(path8.sep).filter((i) => i);
|
|
19582
|
+
const destArr = path8.resolve(dest).split(path8.sep).filter((i) => i);
|
|
19583
|
+
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
19584
|
+
}
|
|
19585
|
+
function errMsg(src, dest, funcName) {
|
|
19586
|
+
return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
|
|
19587
|
+
}
|
|
19588
|
+
module2.exports = {
|
|
19589
|
+
// checkPaths
|
|
19590
|
+
checkPaths: u(checkPaths),
|
|
19591
|
+
checkPathsSync,
|
|
19592
|
+
// checkParent
|
|
19593
|
+
checkParentPaths: u(checkParentPaths),
|
|
19594
|
+
checkParentPathsSync,
|
|
19595
|
+
// Misc
|
|
19596
|
+
isSrcSubdir,
|
|
19597
|
+
areIdentical
|
|
19598
|
+
};
|
|
19599
|
+
}
|
|
19600
|
+
});
|
|
19601
|
+
|
|
19602
|
+
// ../../node_modules/fs-extra/lib/util/async.js
|
|
19603
|
+
var require_async = __commonJS({
|
|
19604
|
+
"../../node_modules/fs-extra/lib/util/async.js"(exports2, module2) {
|
|
19605
|
+
"use strict";
|
|
19606
|
+
async function asyncIteratorConcurrentProcess(iterator, fn) {
|
|
19607
|
+
const promises = [];
|
|
19608
|
+
for await (const item of iterator) {
|
|
19609
|
+
promises.push(
|
|
19610
|
+
fn(item).then(
|
|
19611
|
+
() => null,
|
|
19612
|
+
(err) => err ?? new Error("unknown error")
|
|
19613
|
+
)
|
|
19614
|
+
);
|
|
19615
|
+
}
|
|
19616
|
+
await Promise.all(
|
|
19617
|
+
promises.map(
|
|
19618
|
+
(promise) => promise.then((possibleErr) => {
|
|
19619
|
+
if (possibleErr !== null) throw possibleErr;
|
|
19620
|
+
})
|
|
19621
|
+
)
|
|
19622
|
+
);
|
|
19623
|
+
}
|
|
19624
|
+
module2.exports = {
|
|
19625
|
+
asyncIteratorConcurrentProcess
|
|
19626
|
+
};
|
|
19627
|
+
}
|
|
19628
|
+
});
|
|
19629
|
+
|
|
19630
|
+
// ../../node_modules/fs-extra/lib/copy/copy.js
|
|
19631
|
+
var require_copy = __commonJS({
|
|
19632
|
+
"../../node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
19633
|
+
"use strict";
|
|
19634
|
+
var fs7 = require_fs();
|
|
19635
|
+
var path8 = require("path");
|
|
19636
|
+
var { mkdirs } = require_mkdirs();
|
|
19637
|
+
var { pathExists } = require_path_exists();
|
|
19638
|
+
var { utimesMillis } = require_utimes();
|
|
19639
|
+
var stat = require_stat();
|
|
19640
|
+
var { asyncIteratorConcurrentProcess } = require_async();
|
|
19641
|
+
async function copy(src, dest, opts = {}) {
|
|
19642
|
+
if (typeof opts === "function") {
|
|
19643
|
+
opts = { filter: opts };
|
|
19644
|
+
}
|
|
19645
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
19646
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
19647
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
19648
|
+
process.emitWarning(
|
|
19649
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
19650
|
+
"Warning",
|
|
19651
|
+
"fs-extra-WARN0001"
|
|
19652
|
+
);
|
|
19653
|
+
}
|
|
19654
|
+
const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
|
|
19655
|
+
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
19656
|
+
const include = await runFilter(src, dest, opts);
|
|
19657
|
+
if (!include) return;
|
|
19658
|
+
const destParent = path8.dirname(dest);
|
|
19659
|
+
const dirExists = await pathExists(destParent);
|
|
19660
|
+
if (!dirExists) {
|
|
19661
|
+
await mkdirs(destParent);
|
|
19662
|
+
}
|
|
19663
|
+
await getStatsAndPerformCopy(destStat, src, dest, opts);
|
|
19664
|
+
}
|
|
19665
|
+
async function runFilter(src, dest, opts) {
|
|
19666
|
+
if (!opts.filter) return true;
|
|
19667
|
+
return opts.filter(src, dest);
|
|
19668
|
+
}
|
|
19669
|
+
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
19670
|
+
const statFn = opts.dereference ? fs7.stat : fs7.lstat;
|
|
19671
|
+
const srcStat = await statFn(src);
|
|
19672
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
19673
|
+
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
19674
|
+
if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
19675
|
+
if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
19676
|
+
if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
19677
|
+
throw new Error(`Unknown file: ${src}`);
|
|
19678
|
+
}
|
|
19679
|
+
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
19680
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
19681
|
+
if (opts.overwrite) {
|
|
19682
|
+
await fs7.unlink(dest);
|
|
19683
|
+
return copyFile(srcStat, src, dest, opts);
|
|
19684
|
+
}
|
|
19685
|
+
if (opts.errorOnExist) {
|
|
19686
|
+
throw new Error(`'${dest}' already exists`);
|
|
19687
|
+
}
|
|
19688
|
+
}
|
|
19689
|
+
async function copyFile(srcStat, src, dest, opts) {
|
|
19690
|
+
await fs7.copyFile(src, dest);
|
|
19691
|
+
if (opts.preserveTimestamps) {
|
|
19692
|
+
if (fileIsNotWritable(srcStat.mode)) {
|
|
19693
|
+
await makeFileWritable(dest, srcStat.mode);
|
|
19694
|
+
}
|
|
19695
|
+
const updatedSrcStat = await fs7.stat(src);
|
|
19696
|
+
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
19697
|
+
}
|
|
19698
|
+
return fs7.chmod(dest, srcStat.mode);
|
|
19699
|
+
}
|
|
19700
|
+
function fileIsNotWritable(srcMode) {
|
|
19701
|
+
return (srcMode & 128) === 0;
|
|
19702
|
+
}
|
|
19703
|
+
function makeFileWritable(dest, srcMode) {
|
|
19704
|
+
return fs7.chmod(dest, srcMode | 128);
|
|
19705
|
+
}
|
|
19706
|
+
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
19707
|
+
if (!destStat) {
|
|
19708
|
+
await fs7.mkdir(dest);
|
|
19709
|
+
}
|
|
19710
|
+
await asyncIteratorConcurrentProcess(await fs7.opendir(src), async (item) => {
|
|
19711
|
+
const srcItem = path8.join(src, item.name);
|
|
19712
|
+
const destItem = path8.join(dest, item.name);
|
|
19713
|
+
const include = await runFilter(srcItem, destItem, opts);
|
|
19714
|
+
if (include) {
|
|
19715
|
+
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
19716
|
+
await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
|
|
19717
|
+
}
|
|
19718
|
+
});
|
|
19719
|
+
if (!destStat) {
|
|
19720
|
+
await fs7.chmod(dest, srcStat.mode);
|
|
19721
|
+
}
|
|
19722
|
+
}
|
|
19723
|
+
async function onLink(destStat, src, dest, opts) {
|
|
19724
|
+
let resolvedSrc = await fs7.readlink(src);
|
|
19725
|
+
if (opts.dereference) {
|
|
19726
|
+
resolvedSrc = path8.resolve(process.cwd(), resolvedSrc);
|
|
19727
|
+
}
|
|
19728
|
+
if (!destStat) {
|
|
19729
|
+
return fs7.symlink(resolvedSrc, dest);
|
|
19730
|
+
}
|
|
19731
|
+
let resolvedDest = null;
|
|
19732
|
+
try {
|
|
19733
|
+
resolvedDest = await fs7.readlink(dest);
|
|
19734
|
+
} catch (e) {
|
|
19735
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs7.symlink(resolvedSrc, dest);
|
|
19736
|
+
throw e;
|
|
19737
|
+
}
|
|
19738
|
+
if (opts.dereference) {
|
|
19739
|
+
resolvedDest = path8.resolve(process.cwd(), resolvedDest);
|
|
19740
|
+
}
|
|
19741
|
+
if (resolvedSrc !== resolvedDest) {
|
|
19742
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
19743
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
19744
|
+
}
|
|
19745
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
19746
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
19747
|
+
}
|
|
19748
|
+
}
|
|
19749
|
+
await fs7.unlink(dest);
|
|
19750
|
+
return fs7.symlink(resolvedSrc, dest);
|
|
19751
|
+
}
|
|
19752
|
+
module2.exports = copy;
|
|
19753
|
+
}
|
|
19754
|
+
});
|
|
19755
|
+
|
|
19756
|
+
// ../../node_modules/fs-extra/lib/copy/copy-sync.js
|
|
19757
|
+
var require_copy_sync = __commonJS({
|
|
19758
|
+
"../../node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
19759
|
+
"use strict";
|
|
19760
|
+
var fs7 = require_graceful_fs();
|
|
19761
|
+
var path8 = require("path");
|
|
19762
|
+
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
19763
|
+
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
19764
|
+
var stat = require_stat();
|
|
19765
|
+
function copySync(src, dest, opts) {
|
|
19766
|
+
if (typeof opts === "function") {
|
|
19767
|
+
opts = { filter: opts };
|
|
19768
|
+
}
|
|
19769
|
+
opts = opts || {};
|
|
19770
|
+
opts.clobber = "clobber" in opts ? !!opts.clobber : true;
|
|
19771
|
+
opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
|
|
19772
|
+
if (opts.preserveTimestamps && process.arch === "ia32") {
|
|
19773
|
+
process.emitWarning(
|
|
19774
|
+
"Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269",
|
|
19775
|
+
"Warning",
|
|
19776
|
+
"fs-extra-WARN0002"
|
|
19777
|
+
);
|
|
19778
|
+
}
|
|
19779
|
+
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
19780
|
+
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
19781
|
+
if (opts.filter && !opts.filter(src, dest)) return;
|
|
19782
|
+
const destParent = path8.dirname(dest);
|
|
19783
|
+
if (!fs7.existsSync(destParent)) mkdirsSync(destParent);
|
|
19784
|
+
return getStats(destStat, src, dest, opts);
|
|
19785
|
+
}
|
|
19786
|
+
function getStats(destStat, src, dest, opts) {
|
|
19787
|
+
const statSync2 = opts.dereference ? fs7.statSync : fs7.lstatSync;
|
|
19788
|
+
const srcStat = statSync2(src);
|
|
19789
|
+
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
19790
|
+
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
19791
|
+
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts);
|
|
19792
|
+
else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`);
|
|
19793
|
+
else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`);
|
|
19794
|
+
throw new Error(`Unknown file: ${src}`);
|
|
19795
|
+
}
|
|
19796
|
+
function onFile(srcStat, destStat, src, dest, opts) {
|
|
19797
|
+
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
19798
|
+
return mayCopyFile(srcStat, src, dest, opts);
|
|
19799
|
+
}
|
|
19800
|
+
function mayCopyFile(srcStat, src, dest, opts) {
|
|
19801
|
+
if (opts.overwrite) {
|
|
19802
|
+
fs7.unlinkSync(dest);
|
|
19803
|
+
return copyFile(srcStat, src, dest, opts);
|
|
19804
|
+
} else if (opts.errorOnExist) {
|
|
19805
|
+
throw new Error(`'${dest}' already exists`);
|
|
19806
|
+
}
|
|
19807
|
+
}
|
|
19808
|
+
function copyFile(srcStat, src, dest, opts) {
|
|
19809
|
+
fs7.copyFileSync(src, dest);
|
|
19810
|
+
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
19811
|
+
return setDestMode(dest, srcStat.mode);
|
|
19812
|
+
}
|
|
19813
|
+
function handleTimestamps(srcMode, src, dest) {
|
|
19814
|
+
if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode);
|
|
19815
|
+
return setDestTimestamps(src, dest);
|
|
19816
|
+
}
|
|
19817
|
+
function fileIsNotWritable(srcMode) {
|
|
19818
|
+
return (srcMode & 128) === 0;
|
|
19819
|
+
}
|
|
19820
|
+
function makeFileWritable(dest, srcMode) {
|
|
19821
|
+
return setDestMode(dest, srcMode | 128);
|
|
19822
|
+
}
|
|
19823
|
+
function setDestMode(dest, srcMode) {
|
|
19824
|
+
return fs7.chmodSync(dest, srcMode);
|
|
19825
|
+
}
|
|
19826
|
+
function setDestTimestamps(src, dest) {
|
|
19827
|
+
const updatedSrcStat = fs7.statSync(src);
|
|
19828
|
+
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
19829
|
+
}
|
|
19830
|
+
function onDir(srcStat, destStat, src, dest, opts) {
|
|
19831
|
+
if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
|
|
19832
|
+
return copyDir(src, dest, opts);
|
|
19833
|
+
}
|
|
19834
|
+
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
19835
|
+
fs7.mkdirSync(dest);
|
|
19836
|
+
copyDir(src, dest, opts);
|
|
19837
|
+
return setDestMode(dest, srcMode);
|
|
19838
|
+
}
|
|
19839
|
+
function copyDir(src, dest, opts) {
|
|
19840
|
+
const dir = fs7.opendirSync(src);
|
|
19841
|
+
try {
|
|
19842
|
+
let dirent;
|
|
19843
|
+
while ((dirent = dir.readSync()) !== null) {
|
|
19844
|
+
copyDirItem(dirent.name, src, dest, opts);
|
|
19845
|
+
}
|
|
19846
|
+
} finally {
|
|
19847
|
+
dir.closeSync();
|
|
19848
|
+
}
|
|
19849
|
+
}
|
|
19850
|
+
function copyDirItem(item, src, dest, opts) {
|
|
19851
|
+
const srcItem = path8.join(src, item);
|
|
19852
|
+
const destItem = path8.join(dest, item);
|
|
19853
|
+
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
19854
|
+
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
19855
|
+
return getStats(destStat, srcItem, destItem, opts);
|
|
19856
|
+
}
|
|
19857
|
+
function onLink(destStat, src, dest, opts) {
|
|
19858
|
+
let resolvedSrc = fs7.readlinkSync(src);
|
|
19859
|
+
if (opts.dereference) {
|
|
19860
|
+
resolvedSrc = path8.resolve(process.cwd(), resolvedSrc);
|
|
19861
|
+
}
|
|
19862
|
+
if (!destStat) {
|
|
19863
|
+
return fs7.symlinkSync(resolvedSrc, dest);
|
|
19864
|
+
} else {
|
|
19865
|
+
let resolvedDest;
|
|
19866
|
+
try {
|
|
19867
|
+
resolvedDest = fs7.readlinkSync(dest);
|
|
19868
|
+
} catch (err) {
|
|
19869
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs7.symlinkSync(resolvedSrc, dest);
|
|
19870
|
+
throw err;
|
|
19871
|
+
}
|
|
19872
|
+
if (opts.dereference) {
|
|
19873
|
+
resolvedDest = path8.resolve(process.cwd(), resolvedDest);
|
|
19874
|
+
}
|
|
19875
|
+
if (resolvedSrc !== resolvedDest) {
|
|
19876
|
+
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
19877
|
+
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
19878
|
+
}
|
|
19879
|
+
if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
|
|
19880
|
+
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
19881
|
+
}
|
|
19882
|
+
}
|
|
19883
|
+
return copyLink(resolvedSrc, dest);
|
|
19884
|
+
}
|
|
19885
|
+
}
|
|
19886
|
+
function copyLink(resolvedSrc, dest) {
|
|
19887
|
+
fs7.unlinkSync(dest);
|
|
19888
|
+
return fs7.symlinkSync(resolvedSrc, dest);
|
|
19889
|
+
}
|
|
19890
|
+
module2.exports = copySync;
|
|
19891
|
+
}
|
|
19892
|
+
});
|
|
19893
|
+
|
|
19894
|
+
// ../../node_modules/fs-extra/lib/copy/index.js
|
|
19895
|
+
var require_copy2 = __commonJS({
|
|
19896
|
+
"../../node_modules/fs-extra/lib/copy/index.js"(exports2, module2) {
|
|
19897
|
+
"use strict";
|
|
19898
|
+
var u = require_universalify().fromPromise;
|
|
19899
|
+
module2.exports = {
|
|
19900
|
+
copy: u(require_copy()),
|
|
19901
|
+
copySync: require_copy_sync()
|
|
19902
|
+
};
|
|
19903
|
+
}
|
|
19904
|
+
});
|
|
19905
|
+
|
|
19906
|
+
// ../../node_modules/fs-extra/lib/remove/index.js
|
|
19907
|
+
var require_remove = __commonJS({
|
|
19908
|
+
"../../node_modules/fs-extra/lib/remove/index.js"(exports2, module2) {
|
|
19909
|
+
"use strict";
|
|
19910
|
+
var fs7 = require_graceful_fs();
|
|
19911
|
+
var u = require_universalify().fromCallback;
|
|
19912
|
+
function remove(path8, callback) {
|
|
19913
|
+
fs7.rm(path8, { recursive: true, force: true }, callback);
|
|
19914
|
+
}
|
|
19915
|
+
function removeSync(path8) {
|
|
19916
|
+
fs7.rmSync(path8, { recursive: true, force: true });
|
|
19917
|
+
}
|
|
19918
|
+
module2.exports = {
|
|
19919
|
+
remove: u(remove),
|
|
19920
|
+
removeSync
|
|
19921
|
+
};
|
|
19922
|
+
}
|
|
19923
|
+
});
|
|
19924
|
+
|
|
19925
|
+
// ../../node_modules/fs-extra/lib/empty/index.js
|
|
19926
|
+
var require_empty = __commonJS({
|
|
19927
|
+
"../../node_modules/fs-extra/lib/empty/index.js"(exports2, module2) {
|
|
19928
|
+
"use strict";
|
|
19929
|
+
var u = require_universalify().fromPromise;
|
|
19930
|
+
var fs7 = require_fs();
|
|
19931
|
+
var path8 = require("path");
|
|
19932
|
+
var mkdir = require_mkdirs();
|
|
19933
|
+
var remove = require_remove();
|
|
19934
|
+
var emptyDir = u(async function emptyDir2(dir) {
|
|
19935
|
+
let items;
|
|
19936
|
+
try {
|
|
19937
|
+
items = await fs7.readdir(dir);
|
|
19938
|
+
} catch {
|
|
19939
|
+
return mkdir.mkdirs(dir);
|
|
19940
|
+
}
|
|
19941
|
+
return Promise.all(items.map((item) => remove.remove(path8.join(dir, item))));
|
|
19942
|
+
});
|
|
19943
|
+
function emptyDirSync(dir) {
|
|
19944
|
+
let items;
|
|
19945
|
+
try {
|
|
19946
|
+
items = fs7.readdirSync(dir);
|
|
19947
|
+
} catch {
|
|
19948
|
+
return mkdir.mkdirsSync(dir);
|
|
19949
|
+
}
|
|
19950
|
+
items.forEach((item) => {
|
|
19951
|
+
item = path8.join(dir, item);
|
|
19952
|
+
remove.removeSync(item);
|
|
19953
|
+
});
|
|
19954
|
+
}
|
|
19955
|
+
module2.exports = {
|
|
19956
|
+
emptyDirSync,
|
|
19957
|
+
emptydirSync: emptyDirSync,
|
|
19958
|
+
emptyDir,
|
|
19959
|
+
emptydir: emptyDir
|
|
19960
|
+
};
|
|
19961
|
+
}
|
|
19962
|
+
});
|
|
19963
|
+
|
|
19964
|
+
// ../../node_modules/fs-extra/lib/ensure/file.js
|
|
19965
|
+
var require_file = __commonJS({
|
|
19966
|
+
"../../node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
19967
|
+
"use strict";
|
|
19968
|
+
var u = require_universalify().fromPromise;
|
|
19969
|
+
var path8 = require("path");
|
|
19970
|
+
var fs7 = require_fs();
|
|
19971
|
+
var mkdir = require_mkdirs();
|
|
19972
|
+
async function createFile(file) {
|
|
19973
|
+
let stats;
|
|
19974
|
+
try {
|
|
19975
|
+
stats = await fs7.stat(file);
|
|
19976
|
+
} catch {
|
|
19977
|
+
}
|
|
19978
|
+
if (stats && stats.isFile()) return;
|
|
19979
|
+
const dir = path8.dirname(file);
|
|
19980
|
+
let dirStats = null;
|
|
19981
|
+
try {
|
|
19982
|
+
dirStats = await fs7.stat(dir);
|
|
19983
|
+
} catch (err) {
|
|
19984
|
+
if (err.code === "ENOENT") {
|
|
19985
|
+
await mkdir.mkdirs(dir);
|
|
19986
|
+
await fs7.writeFile(file, "");
|
|
19987
|
+
return;
|
|
19988
|
+
} else {
|
|
19989
|
+
throw err;
|
|
19990
|
+
}
|
|
19991
|
+
}
|
|
19992
|
+
if (dirStats.isDirectory()) {
|
|
19993
|
+
await fs7.writeFile(file, "");
|
|
19994
|
+
} else {
|
|
19995
|
+
await fs7.readdir(dir);
|
|
19996
|
+
}
|
|
19997
|
+
}
|
|
19998
|
+
function createFileSync(file) {
|
|
19999
|
+
let stats;
|
|
20000
|
+
try {
|
|
20001
|
+
stats = fs7.statSync(file);
|
|
20002
|
+
} catch {
|
|
20003
|
+
}
|
|
20004
|
+
if (stats && stats.isFile()) return;
|
|
20005
|
+
const dir = path8.dirname(file);
|
|
20006
|
+
try {
|
|
20007
|
+
if (!fs7.statSync(dir).isDirectory()) {
|
|
20008
|
+
fs7.readdirSync(dir);
|
|
20009
|
+
}
|
|
20010
|
+
} catch (err) {
|
|
20011
|
+
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
20012
|
+
else throw err;
|
|
20013
|
+
}
|
|
20014
|
+
fs7.writeFileSync(file, "");
|
|
20015
|
+
}
|
|
20016
|
+
module2.exports = {
|
|
20017
|
+
createFile: u(createFile),
|
|
20018
|
+
createFileSync
|
|
20019
|
+
};
|
|
20020
|
+
}
|
|
20021
|
+
});
|
|
20022
|
+
|
|
20023
|
+
// ../../node_modules/fs-extra/lib/ensure/link.js
|
|
20024
|
+
var require_link = __commonJS({
|
|
20025
|
+
"../../node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
20026
|
+
"use strict";
|
|
20027
|
+
var u = require_universalify().fromPromise;
|
|
20028
|
+
var path8 = require("path");
|
|
20029
|
+
var fs7 = require_fs();
|
|
20030
|
+
var mkdir = require_mkdirs();
|
|
20031
|
+
var { pathExists } = require_path_exists();
|
|
20032
|
+
var { areIdentical } = require_stat();
|
|
20033
|
+
async function createLink(srcpath, dstpath) {
|
|
20034
|
+
let dstStat;
|
|
20035
|
+
try {
|
|
20036
|
+
dstStat = await fs7.lstat(dstpath);
|
|
20037
|
+
} catch {
|
|
20038
|
+
}
|
|
20039
|
+
let srcStat;
|
|
20040
|
+
try {
|
|
20041
|
+
srcStat = await fs7.lstat(srcpath);
|
|
20042
|
+
} catch (err) {
|
|
20043
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
20044
|
+
throw err;
|
|
20045
|
+
}
|
|
20046
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
20047
|
+
const dir = path8.dirname(dstpath);
|
|
20048
|
+
const dirExists = await pathExists(dir);
|
|
20049
|
+
if (!dirExists) {
|
|
20050
|
+
await mkdir.mkdirs(dir);
|
|
20051
|
+
}
|
|
20052
|
+
await fs7.link(srcpath, dstpath);
|
|
20053
|
+
}
|
|
20054
|
+
function createLinkSync(srcpath, dstpath) {
|
|
20055
|
+
let dstStat;
|
|
20056
|
+
try {
|
|
20057
|
+
dstStat = fs7.lstatSync(dstpath);
|
|
20058
|
+
} catch {
|
|
20059
|
+
}
|
|
20060
|
+
try {
|
|
20061
|
+
const srcStat = fs7.lstatSync(srcpath);
|
|
20062
|
+
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
20063
|
+
} catch (err) {
|
|
20064
|
+
err.message = err.message.replace("lstat", "ensureLink");
|
|
20065
|
+
throw err;
|
|
20066
|
+
}
|
|
20067
|
+
const dir = path8.dirname(dstpath);
|
|
20068
|
+
const dirExists = fs7.existsSync(dir);
|
|
20069
|
+
if (dirExists) return fs7.linkSync(srcpath, dstpath);
|
|
20070
|
+
mkdir.mkdirsSync(dir);
|
|
20071
|
+
return fs7.linkSync(srcpath, dstpath);
|
|
20072
|
+
}
|
|
20073
|
+
module2.exports = {
|
|
20074
|
+
createLink: u(createLink),
|
|
20075
|
+
createLinkSync
|
|
20076
|
+
};
|
|
20077
|
+
}
|
|
20078
|
+
});
|
|
20079
|
+
|
|
20080
|
+
// ../../node_modules/fs-extra/lib/ensure/symlink-paths.js
|
|
20081
|
+
var require_symlink_paths = __commonJS({
|
|
20082
|
+
"../../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
20083
|
+
"use strict";
|
|
20084
|
+
var path8 = require("path");
|
|
20085
|
+
var fs7 = require_fs();
|
|
20086
|
+
var { pathExists } = require_path_exists();
|
|
20087
|
+
var u = require_universalify().fromPromise;
|
|
20088
|
+
async function symlinkPaths(srcpath, dstpath) {
|
|
20089
|
+
if (path8.isAbsolute(srcpath)) {
|
|
20090
|
+
try {
|
|
20091
|
+
await fs7.lstat(srcpath);
|
|
20092
|
+
} catch (err) {
|
|
20093
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
20094
|
+
throw err;
|
|
20095
|
+
}
|
|
20096
|
+
return {
|
|
20097
|
+
toCwd: srcpath,
|
|
20098
|
+
toDst: srcpath
|
|
20099
|
+
};
|
|
20100
|
+
}
|
|
20101
|
+
const dstdir = path8.dirname(dstpath);
|
|
20102
|
+
const relativeToDst = path8.join(dstdir, srcpath);
|
|
20103
|
+
const exists = await pathExists(relativeToDst);
|
|
20104
|
+
if (exists) {
|
|
20105
|
+
return {
|
|
20106
|
+
toCwd: relativeToDst,
|
|
20107
|
+
toDst: srcpath
|
|
20108
|
+
};
|
|
20109
|
+
}
|
|
20110
|
+
try {
|
|
20111
|
+
await fs7.lstat(srcpath);
|
|
20112
|
+
} catch (err) {
|
|
20113
|
+
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
20114
|
+
throw err;
|
|
20115
|
+
}
|
|
20116
|
+
return {
|
|
20117
|
+
toCwd: srcpath,
|
|
20118
|
+
toDst: path8.relative(dstdir, srcpath)
|
|
20119
|
+
};
|
|
20120
|
+
}
|
|
20121
|
+
function symlinkPathsSync(srcpath, dstpath) {
|
|
20122
|
+
if (path8.isAbsolute(srcpath)) {
|
|
20123
|
+
const exists2 = fs7.existsSync(srcpath);
|
|
20124
|
+
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
20125
|
+
return {
|
|
20126
|
+
toCwd: srcpath,
|
|
20127
|
+
toDst: srcpath
|
|
20128
|
+
};
|
|
20129
|
+
}
|
|
20130
|
+
const dstdir = path8.dirname(dstpath);
|
|
20131
|
+
const relativeToDst = path8.join(dstdir, srcpath);
|
|
20132
|
+
const exists = fs7.existsSync(relativeToDst);
|
|
20133
|
+
if (exists) {
|
|
20134
|
+
return {
|
|
20135
|
+
toCwd: relativeToDst,
|
|
20136
|
+
toDst: srcpath
|
|
20137
|
+
};
|
|
20138
|
+
}
|
|
20139
|
+
const srcExists = fs7.existsSync(srcpath);
|
|
20140
|
+
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
20141
|
+
return {
|
|
20142
|
+
toCwd: srcpath,
|
|
20143
|
+
toDst: path8.relative(dstdir, srcpath)
|
|
20144
|
+
};
|
|
20145
|
+
}
|
|
20146
|
+
module2.exports = {
|
|
20147
|
+
symlinkPaths: u(symlinkPaths),
|
|
20148
|
+
symlinkPathsSync
|
|
20149
|
+
};
|
|
20150
|
+
}
|
|
20151
|
+
});
|
|
20152
|
+
|
|
20153
|
+
// ../../node_modules/fs-extra/lib/ensure/symlink-type.js
|
|
20154
|
+
var require_symlink_type = __commonJS({
|
|
20155
|
+
"../../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) {
|
|
20156
|
+
"use strict";
|
|
20157
|
+
var fs7 = require_fs();
|
|
20158
|
+
var u = require_universalify().fromPromise;
|
|
20159
|
+
async function symlinkType(srcpath, type) {
|
|
20160
|
+
if (type) return type;
|
|
20161
|
+
let stats;
|
|
20162
|
+
try {
|
|
20163
|
+
stats = await fs7.lstat(srcpath);
|
|
20164
|
+
} catch {
|
|
20165
|
+
return "file";
|
|
20166
|
+
}
|
|
20167
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
20168
|
+
}
|
|
20169
|
+
function symlinkTypeSync(srcpath, type) {
|
|
20170
|
+
if (type) return type;
|
|
20171
|
+
let stats;
|
|
20172
|
+
try {
|
|
20173
|
+
stats = fs7.lstatSync(srcpath);
|
|
20174
|
+
} catch {
|
|
20175
|
+
return "file";
|
|
20176
|
+
}
|
|
20177
|
+
return stats && stats.isDirectory() ? "dir" : "file";
|
|
20178
|
+
}
|
|
20179
|
+
module2.exports = {
|
|
20180
|
+
symlinkType: u(symlinkType),
|
|
20181
|
+
symlinkTypeSync
|
|
20182
|
+
};
|
|
20183
|
+
}
|
|
20184
|
+
});
|
|
20185
|
+
|
|
20186
|
+
// ../../node_modules/fs-extra/lib/ensure/symlink.js
|
|
20187
|
+
var require_symlink = __commonJS({
|
|
20188
|
+
"../../node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
20189
|
+
"use strict";
|
|
20190
|
+
var u = require_universalify().fromPromise;
|
|
20191
|
+
var path8 = require("path");
|
|
20192
|
+
var fs7 = require_fs();
|
|
20193
|
+
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
20194
|
+
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
20195
|
+
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
20196
|
+
var { pathExists } = require_path_exists();
|
|
20197
|
+
var { areIdentical } = require_stat();
|
|
20198
|
+
async function createSymlink(srcpath, dstpath, type) {
|
|
20199
|
+
let stats;
|
|
20200
|
+
try {
|
|
20201
|
+
stats = await fs7.lstat(dstpath);
|
|
20202
|
+
} catch {
|
|
20203
|
+
}
|
|
20204
|
+
if (stats && stats.isSymbolicLink()) {
|
|
20205
|
+
const [srcStat, dstStat] = await Promise.all([
|
|
20206
|
+
fs7.stat(srcpath),
|
|
20207
|
+
fs7.stat(dstpath)
|
|
20208
|
+
]);
|
|
20209
|
+
if (areIdentical(srcStat, dstStat)) return;
|
|
20210
|
+
}
|
|
20211
|
+
const relative2 = await symlinkPaths(srcpath, dstpath);
|
|
20212
|
+
srcpath = relative2.toDst;
|
|
20213
|
+
const toType = await symlinkType(relative2.toCwd, type);
|
|
20214
|
+
const dir = path8.dirname(dstpath);
|
|
20215
|
+
if (!await pathExists(dir)) {
|
|
20216
|
+
await mkdirs(dir);
|
|
20217
|
+
}
|
|
20218
|
+
return fs7.symlink(srcpath, dstpath, toType);
|
|
20219
|
+
}
|
|
20220
|
+
function createSymlinkSync(srcpath, dstpath, type) {
|
|
20221
|
+
let stats;
|
|
20222
|
+
try {
|
|
20223
|
+
stats = fs7.lstatSync(dstpath);
|
|
20224
|
+
} catch {
|
|
20225
|
+
}
|
|
20226
|
+
if (stats && stats.isSymbolicLink()) {
|
|
20227
|
+
const srcStat = fs7.statSync(srcpath);
|
|
20228
|
+
const dstStat = fs7.statSync(dstpath);
|
|
20229
|
+
if (areIdentical(srcStat, dstStat)) return;
|
|
20230
|
+
}
|
|
20231
|
+
const relative2 = symlinkPathsSync(srcpath, dstpath);
|
|
20232
|
+
srcpath = relative2.toDst;
|
|
20233
|
+
type = symlinkTypeSync(relative2.toCwd, type);
|
|
20234
|
+
const dir = path8.dirname(dstpath);
|
|
20235
|
+
const exists = fs7.existsSync(dir);
|
|
20236
|
+
if (exists) return fs7.symlinkSync(srcpath, dstpath, type);
|
|
20237
|
+
mkdirsSync(dir);
|
|
20238
|
+
return fs7.symlinkSync(srcpath, dstpath, type);
|
|
20239
|
+
}
|
|
20240
|
+
module2.exports = {
|
|
20241
|
+
createSymlink: u(createSymlink),
|
|
20242
|
+
createSymlinkSync
|
|
20243
|
+
};
|
|
20244
|
+
}
|
|
20245
|
+
});
|
|
20246
|
+
|
|
20247
|
+
// ../../node_modules/fs-extra/lib/ensure/index.js
|
|
20248
|
+
var require_ensure = __commonJS({
|
|
20249
|
+
"../../node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) {
|
|
20250
|
+
"use strict";
|
|
20251
|
+
var { createFile, createFileSync } = require_file();
|
|
20252
|
+
var { createLink, createLinkSync } = require_link();
|
|
20253
|
+
var { createSymlink, createSymlinkSync } = require_symlink();
|
|
20254
|
+
module2.exports = {
|
|
20255
|
+
// file
|
|
20256
|
+
createFile,
|
|
20257
|
+
createFileSync,
|
|
20258
|
+
ensureFile: createFile,
|
|
20259
|
+
ensureFileSync: createFileSync,
|
|
20260
|
+
// link
|
|
20261
|
+
createLink,
|
|
20262
|
+
createLinkSync,
|
|
20263
|
+
ensureLink: createLink,
|
|
20264
|
+
ensureLinkSync: createLinkSync,
|
|
20265
|
+
// symlink
|
|
20266
|
+
createSymlink,
|
|
20267
|
+
createSymlinkSync,
|
|
20268
|
+
ensureSymlink: createSymlink,
|
|
20269
|
+
ensureSymlinkSync: createSymlinkSync
|
|
20270
|
+
};
|
|
20271
|
+
}
|
|
20272
|
+
});
|
|
20273
|
+
|
|
20274
|
+
// ../../node_modules/jsonfile/utils.js
|
|
20275
|
+
var require_utils3 = __commonJS({
|
|
20276
|
+
"../../node_modules/jsonfile/utils.js"(exports2, module2) {
|
|
20277
|
+
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
20278
|
+
const EOF2 = finalEOL ? EOL : "";
|
|
20279
|
+
const str = JSON.stringify(obj, replacer, spaces);
|
|
20280
|
+
return str.replace(/\n/g, EOL) + EOF2;
|
|
20281
|
+
}
|
|
20282
|
+
function stripBom(content) {
|
|
20283
|
+
if (Buffer.isBuffer(content)) content = content.toString("utf8");
|
|
20284
|
+
return content.replace(/^\uFEFF/, "");
|
|
20285
|
+
}
|
|
20286
|
+
module2.exports = { stringify, stripBom };
|
|
20287
|
+
}
|
|
20288
|
+
});
|
|
20289
|
+
|
|
20290
|
+
// ../../node_modules/jsonfile/index.js
|
|
20291
|
+
var require_jsonfile = __commonJS({
|
|
20292
|
+
"../../node_modules/jsonfile/index.js"(exports2, module2) {
|
|
20293
|
+
var _fs;
|
|
20294
|
+
try {
|
|
20295
|
+
_fs = require_graceful_fs();
|
|
20296
|
+
} catch (_2) {
|
|
20297
|
+
_fs = require("fs");
|
|
20298
|
+
}
|
|
20299
|
+
var universalify = require_universalify();
|
|
20300
|
+
var { stringify, stripBom } = require_utils3();
|
|
20301
|
+
async function _readFile(file, options = {}) {
|
|
20302
|
+
if (typeof options === "string") {
|
|
20303
|
+
options = { encoding: options };
|
|
20304
|
+
}
|
|
20305
|
+
const fs7 = options.fs || _fs;
|
|
20306
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
20307
|
+
let data = await universalify.fromCallback(fs7.readFile)(file, options);
|
|
20308
|
+
data = stripBom(data);
|
|
20309
|
+
let obj;
|
|
20310
|
+
try {
|
|
20311
|
+
obj = JSON.parse(data, options ? options.reviver : null);
|
|
20312
|
+
} catch (err) {
|
|
20313
|
+
if (shouldThrow) {
|
|
20314
|
+
err.message = `${file}: ${err.message}`;
|
|
20315
|
+
throw err;
|
|
20316
|
+
} else {
|
|
20317
|
+
return null;
|
|
20318
|
+
}
|
|
20319
|
+
}
|
|
20320
|
+
return obj;
|
|
20321
|
+
}
|
|
20322
|
+
var readFile = universalify.fromPromise(_readFile);
|
|
20323
|
+
function readFileSync5(file, options = {}) {
|
|
20324
|
+
if (typeof options === "string") {
|
|
20325
|
+
options = { encoding: options };
|
|
20326
|
+
}
|
|
20327
|
+
const fs7 = options.fs || _fs;
|
|
20328
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
20329
|
+
try {
|
|
20330
|
+
let content = fs7.readFileSync(file, options);
|
|
20331
|
+
content = stripBom(content);
|
|
20332
|
+
return JSON.parse(content, options.reviver);
|
|
20333
|
+
} catch (err) {
|
|
20334
|
+
if (shouldThrow) {
|
|
20335
|
+
err.message = `${file}: ${err.message}`;
|
|
20336
|
+
throw err;
|
|
20337
|
+
} else {
|
|
20338
|
+
return null;
|
|
20339
|
+
}
|
|
20340
|
+
}
|
|
20341
|
+
}
|
|
20342
|
+
async function _writeFile(file, obj, options = {}) {
|
|
20343
|
+
const fs7 = options.fs || _fs;
|
|
20344
|
+
const str = stringify(obj, options);
|
|
20345
|
+
await universalify.fromCallback(fs7.writeFile)(file, str, options);
|
|
20346
|
+
}
|
|
20347
|
+
var writeFile = universalify.fromPromise(_writeFile);
|
|
20348
|
+
function writeFileSync6(file, obj, options = {}) {
|
|
20349
|
+
const fs7 = options.fs || _fs;
|
|
20350
|
+
const str = stringify(obj, options);
|
|
20351
|
+
return fs7.writeFileSync(file, str, options);
|
|
20352
|
+
}
|
|
20353
|
+
module2.exports = {
|
|
20354
|
+
readFile,
|
|
20355
|
+
readFileSync: readFileSync5,
|
|
20356
|
+
writeFile,
|
|
20357
|
+
writeFileSync: writeFileSync6
|
|
20358
|
+
};
|
|
20359
|
+
}
|
|
20360
|
+
});
|
|
20361
|
+
|
|
20362
|
+
// ../../node_modules/fs-extra/lib/json/jsonfile.js
|
|
20363
|
+
var require_jsonfile2 = __commonJS({
|
|
20364
|
+
"../../node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) {
|
|
20365
|
+
"use strict";
|
|
20366
|
+
var jsonFile = require_jsonfile();
|
|
20367
|
+
module2.exports = {
|
|
20368
|
+
// jsonfile exports
|
|
20369
|
+
readJson: jsonFile.readFile,
|
|
20370
|
+
readJsonSync: jsonFile.readFileSync,
|
|
20371
|
+
writeJson: jsonFile.writeFile,
|
|
20372
|
+
writeJsonSync: jsonFile.writeFileSync
|
|
20373
|
+
};
|
|
20374
|
+
}
|
|
20375
|
+
});
|
|
20376
|
+
|
|
20377
|
+
// ../../node_modules/fs-extra/lib/output-file/index.js
|
|
20378
|
+
var require_output_file = __commonJS({
|
|
20379
|
+
"../../node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) {
|
|
20380
|
+
"use strict";
|
|
20381
|
+
var u = require_universalify().fromPromise;
|
|
20382
|
+
var fs7 = require_fs();
|
|
20383
|
+
var path8 = require("path");
|
|
20384
|
+
var mkdir = require_mkdirs();
|
|
20385
|
+
var pathExists = require_path_exists().pathExists;
|
|
20386
|
+
async function outputFile(file, data, encoding = "utf-8") {
|
|
20387
|
+
const dir = path8.dirname(file);
|
|
20388
|
+
if (!await pathExists(dir)) {
|
|
20389
|
+
await mkdir.mkdirs(dir);
|
|
20390
|
+
}
|
|
20391
|
+
return fs7.writeFile(file, data, encoding);
|
|
20392
|
+
}
|
|
20393
|
+
function outputFileSync(file, ...args) {
|
|
20394
|
+
const dir = path8.dirname(file);
|
|
20395
|
+
if (!fs7.existsSync(dir)) {
|
|
20396
|
+
mkdir.mkdirsSync(dir);
|
|
20397
|
+
}
|
|
20398
|
+
fs7.writeFileSync(file, ...args);
|
|
20399
|
+
}
|
|
20400
|
+
module2.exports = {
|
|
20401
|
+
outputFile: u(outputFile),
|
|
20402
|
+
outputFileSync
|
|
20403
|
+
};
|
|
20404
|
+
}
|
|
20405
|
+
});
|
|
20406
|
+
|
|
20407
|
+
// ../../node_modules/fs-extra/lib/json/output-json.js
|
|
20408
|
+
var require_output_json = __commonJS({
|
|
20409
|
+
"../../node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) {
|
|
20410
|
+
"use strict";
|
|
20411
|
+
var { stringify } = require_utils3();
|
|
20412
|
+
var { outputFile } = require_output_file();
|
|
20413
|
+
async function outputJson(file, data, options = {}) {
|
|
20414
|
+
const str = stringify(data, options);
|
|
20415
|
+
await outputFile(file, str, options);
|
|
20416
|
+
}
|
|
20417
|
+
module2.exports = outputJson;
|
|
20418
|
+
}
|
|
20419
|
+
});
|
|
20420
|
+
|
|
20421
|
+
// ../../node_modules/fs-extra/lib/json/output-json-sync.js
|
|
20422
|
+
var require_output_json_sync = __commonJS({
|
|
20423
|
+
"../../node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) {
|
|
20424
|
+
"use strict";
|
|
20425
|
+
var { stringify } = require_utils3();
|
|
20426
|
+
var { outputFileSync } = require_output_file();
|
|
20427
|
+
function outputJsonSync(file, data, options) {
|
|
20428
|
+
const str = stringify(data, options);
|
|
20429
|
+
outputFileSync(file, str, options);
|
|
20430
|
+
}
|
|
20431
|
+
module2.exports = outputJsonSync;
|
|
20432
|
+
}
|
|
20433
|
+
});
|
|
20434
|
+
|
|
20435
|
+
// ../../node_modules/fs-extra/lib/json/index.js
|
|
20436
|
+
var require_json = __commonJS({
|
|
20437
|
+
"../../node_modules/fs-extra/lib/json/index.js"(exports2, module2) {
|
|
20438
|
+
"use strict";
|
|
20439
|
+
var u = require_universalify().fromPromise;
|
|
20440
|
+
var jsonFile = require_jsonfile2();
|
|
20441
|
+
jsonFile.outputJson = u(require_output_json());
|
|
20442
|
+
jsonFile.outputJsonSync = require_output_json_sync();
|
|
20443
|
+
jsonFile.outputJSON = jsonFile.outputJson;
|
|
20444
|
+
jsonFile.outputJSONSync = jsonFile.outputJsonSync;
|
|
20445
|
+
jsonFile.writeJSON = jsonFile.writeJson;
|
|
20446
|
+
jsonFile.writeJSONSync = jsonFile.writeJsonSync;
|
|
20447
|
+
jsonFile.readJSON = jsonFile.readJson;
|
|
20448
|
+
jsonFile.readJSONSync = jsonFile.readJsonSync;
|
|
20449
|
+
module2.exports = jsonFile;
|
|
20450
|
+
}
|
|
20451
|
+
});
|
|
20452
|
+
|
|
20453
|
+
// ../../node_modules/fs-extra/lib/move/move.js
|
|
20454
|
+
var require_move = __commonJS({
|
|
20455
|
+
"../../node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
20456
|
+
"use strict";
|
|
20457
|
+
var fs7 = require_fs();
|
|
20458
|
+
var path8 = require("path");
|
|
20459
|
+
var { copy } = require_copy2();
|
|
20460
|
+
var { remove } = require_remove();
|
|
20461
|
+
var { mkdirp } = require_mkdirs();
|
|
20462
|
+
var { pathExists } = require_path_exists();
|
|
20463
|
+
var stat = require_stat();
|
|
20464
|
+
async function move(src, dest, opts = {}) {
|
|
20465
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
20466
|
+
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
20467
|
+
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
20468
|
+
const destParent = path8.dirname(dest);
|
|
20469
|
+
const parsedParentPath = path8.parse(destParent);
|
|
20470
|
+
if (parsedParentPath.root !== destParent) {
|
|
20471
|
+
await mkdirp(destParent);
|
|
20472
|
+
}
|
|
20473
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
20474
|
+
}
|
|
20475
|
+
async function doRename(src, dest, overwrite, isChangingCase) {
|
|
20476
|
+
if (!isChangingCase) {
|
|
20477
|
+
if (overwrite) {
|
|
20478
|
+
await remove(dest);
|
|
20479
|
+
} else if (await pathExists(dest)) {
|
|
20480
|
+
throw new Error("dest already exists.");
|
|
20481
|
+
}
|
|
20482
|
+
}
|
|
20483
|
+
try {
|
|
20484
|
+
await fs7.rename(src, dest);
|
|
20485
|
+
} catch (err) {
|
|
20486
|
+
if (err.code !== "EXDEV") {
|
|
20487
|
+
throw err;
|
|
20488
|
+
}
|
|
20489
|
+
await moveAcrossDevice(src, dest, overwrite);
|
|
20490
|
+
}
|
|
20491
|
+
}
|
|
20492
|
+
async function moveAcrossDevice(src, dest, overwrite) {
|
|
20493
|
+
const opts = {
|
|
20494
|
+
overwrite,
|
|
20495
|
+
errorOnExist: true,
|
|
20496
|
+
preserveTimestamps: true
|
|
20497
|
+
};
|
|
20498
|
+
await copy(src, dest, opts);
|
|
20499
|
+
return remove(src);
|
|
20500
|
+
}
|
|
20501
|
+
module2.exports = move;
|
|
20502
|
+
}
|
|
20503
|
+
});
|
|
20504
|
+
|
|
20505
|
+
// ../../node_modules/fs-extra/lib/move/move-sync.js
|
|
20506
|
+
var require_move_sync = __commonJS({
|
|
20507
|
+
"../../node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
20508
|
+
"use strict";
|
|
20509
|
+
var fs7 = require_graceful_fs();
|
|
20510
|
+
var path8 = require("path");
|
|
20511
|
+
var copySync = require_copy2().copySync;
|
|
20512
|
+
var removeSync = require_remove().removeSync;
|
|
20513
|
+
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
20514
|
+
var stat = require_stat();
|
|
20515
|
+
function moveSync(src, dest, opts) {
|
|
20516
|
+
opts = opts || {};
|
|
20517
|
+
const overwrite = opts.overwrite || opts.clobber || false;
|
|
20518
|
+
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
20519
|
+
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
20520
|
+
if (!isParentRoot(dest)) mkdirpSync(path8.dirname(dest));
|
|
20521
|
+
return doRename(src, dest, overwrite, isChangingCase);
|
|
20522
|
+
}
|
|
20523
|
+
function isParentRoot(dest) {
|
|
20524
|
+
const parent = path8.dirname(dest);
|
|
20525
|
+
const parsedPath = path8.parse(parent);
|
|
20526
|
+
return parsedPath.root === parent;
|
|
20527
|
+
}
|
|
20528
|
+
function doRename(src, dest, overwrite, isChangingCase) {
|
|
20529
|
+
if (isChangingCase) return rename(src, dest, overwrite);
|
|
20530
|
+
if (overwrite) {
|
|
20531
|
+
removeSync(dest);
|
|
20532
|
+
return rename(src, dest, overwrite);
|
|
20533
|
+
}
|
|
20534
|
+
if (fs7.existsSync(dest)) throw new Error("dest already exists.");
|
|
20535
|
+
return rename(src, dest, overwrite);
|
|
20536
|
+
}
|
|
20537
|
+
function rename(src, dest, overwrite) {
|
|
20538
|
+
try {
|
|
20539
|
+
fs7.renameSync(src, dest);
|
|
20540
|
+
} catch (err) {
|
|
20541
|
+
if (err.code !== "EXDEV") throw err;
|
|
20542
|
+
return moveAcrossDevice(src, dest, overwrite);
|
|
20543
|
+
}
|
|
20544
|
+
}
|
|
20545
|
+
function moveAcrossDevice(src, dest, overwrite) {
|
|
20546
|
+
const opts = {
|
|
20547
|
+
overwrite,
|
|
20548
|
+
errorOnExist: true,
|
|
20549
|
+
preserveTimestamps: true
|
|
20550
|
+
};
|
|
20551
|
+
copySync(src, dest, opts);
|
|
20552
|
+
return removeSync(src);
|
|
20553
|
+
}
|
|
20554
|
+
module2.exports = moveSync;
|
|
20555
|
+
}
|
|
20556
|
+
});
|
|
20557
|
+
|
|
20558
|
+
// ../../node_modules/fs-extra/lib/move/index.js
|
|
20559
|
+
var require_move2 = __commonJS({
|
|
20560
|
+
"../../node_modules/fs-extra/lib/move/index.js"(exports2, module2) {
|
|
20561
|
+
"use strict";
|
|
20562
|
+
var u = require_universalify().fromPromise;
|
|
20563
|
+
module2.exports = {
|
|
20564
|
+
move: u(require_move()),
|
|
20565
|
+
moveSync: require_move_sync()
|
|
20566
|
+
};
|
|
20567
|
+
}
|
|
20568
|
+
});
|
|
20569
|
+
|
|
20570
|
+
// ../../node_modules/fs-extra/lib/index.js
|
|
20571
|
+
var require_lib4 = __commonJS({
|
|
20572
|
+
"../../node_modules/fs-extra/lib/index.js"(exports2, module2) {
|
|
20573
|
+
"use strict";
|
|
20574
|
+
module2.exports = {
|
|
20575
|
+
// Export promiseified graceful-fs:
|
|
20576
|
+
...require_fs(),
|
|
20577
|
+
// Export extra methods:
|
|
20578
|
+
...require_copy2(),
|
|
20579
|
+
...require_empty(),
|
|
20580
|
+
...require_ensure(),
|
|
20581
|
+
...require_json(),
|
|
20582
|
+
...require_mkdirs(),
|
|
20583
|
+
...require_move2(),
|
|
20584
|
+
...require_output_file(),
|
|
20585
|
+
...require_path_exists(),
|
|
20586
|
+
...require_remove()
|
|
20587
|
+
};
|
|
20588
|
+
}
|
|
20589
|
+
});
|
|
20590
|
+
|
|
18434
20591
|
// ../../node_modules/cli-width/index.js
|
|
18435
20592
|
var require_cli_width = __commonJS({
|
|
18436
20593
|
"../../node_modules/cli-width/index.js"(exports2, module2) {
|
|
@@ -18484,7 +20641,7 @@ var require_emoji_regex = __commonJS({
|
|
|
18484
20641
|
});
|
|
18485
20642
|
|
|
18486
20643
|
// ../../node_modules/inquirer/node_modules/mute-stream/lib/index.js
|
|
18487
|
-
var
|
|
20644
|
+
var require_lib5 = __commonJS({
|
|
18488
20645
|
"../../node_modules/inquirer/node_modules/mute-stream/lib/index.js"(exports2, module2) {
|
|
18489
20646
|
var Stream2 = require("stream");
|
|
18490
20647
|
var MuteStream3 = class extends Stream2 {
|
|
@@ -24048,7 +26205,7 @@ var require_iso2022 = __commonJS({
|
|
|
24048
26205
|
});
|
|
24049
26206
|
|
|
24050
26207
|
// ../../node_modules/chardet/lib/utils.js
|
|
24051
|
-
var
|
|
26208
|
+
var require_utils4 = __commonJS({
|
|
24052
26209
|
"../../node_modules/chardet/lib/utils.js"(exports2) {
|
|
24053
26210
|
"use strict";
|
|
24054
26211
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -24063,7 +26220,7 @@ var require_utils2 = __commonJS({
|
|
|
24063
26220
|
});
|
|
24064
26221
|
|
|
24065
26222
|
// ../../node_modules/chardet/lib/index.js
|
|
24066
|
-
var
|
|
26223
|
+
var require_lib6 = __commonJS({
|
|
24067
26224
|
"../../node_modules/chardet/lib/index.js"(exports2) {
|
|
24068
26225
|
"use strict";
|
|
24069
26226
|
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
@@ -24115,7 +26272,7 @@ var require_lib5 = __commonJS({
|
|
|
24115
26272
|
var mbcs = __importStar(require_mbcs());
|
|
24116
26273
|
var sbcs = __importStar(require_sbcs());
|
|
24117
26274
|
var iso2022 = __importStar(require_iso2022());
|
|
24118
|
-
var utils_1 =
|
|
26275
|
+
var utils_1 = require_utils4();
|
|
24119
26276
|
var recognisers = [
|
|
24120
26277
|
new utf8_1.default(),
|
|
24121
26278
|
new unicode.UTF_16BE(),
|
|
@@ -24183,10 +26340,10 @@ var require_lib5 = __commonJS({
|
|
|
24183
26340
|
exports2.analyse = analyse;
|
|
24184
26341
|
var detectFile = (filepath, opts = {}) => new Promise((resolve4, reject) => {
|
|
24185
26342
|
let fd;
|
|
24186
|
-
const
|
|
26343
|
+
const fs7 = (0, node_1.default)();
|
|
24187
26344
|
const handler = (err, buffer) => {
|
|
24188
26345
|
if (fd) {
|
|
24189
|
-
|
|
26346
|
+
fs7.closeSync(fd);
|
|
24190
26347
|
}
|
|
24191
26348
|
if (err) {
|
|
24192
26349
|
reject(err);
|
|
@@ -24198,9 +26355,9 @@ var require_lib5 = __commonJS({
|
|
|
24198
26355
|
};
|
|
24199
26356
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
24200
26357
|
if (sampleSize > 0) {
|
|
24201
|
-
fd =
|
|
26358
|
+
fd = fs7.openSync(filepath, "r");
|
|
24202
26359
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
24203
|
-
|
|
26360
|
+
fs7.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
24204
26361
|
if (err) {
|
|
24205
26362
|
handler(err, null);
|
|
24206
26363
|
} else {
|
|
@@ -24212,22 +26369,22 @@ var require_lib5 = __commonJS({
|
|
|
24212
26369
|
});
|
|
24213
26370
|
return;
|
|
24214
26371
|
}
|
|
24215
|
-
|
|
26372
|
+
fs7.readFile(filepath, handler);
|
|
24216
26373
|
});
|
|
24217
26374
|
exports2.detectFile = detectFile;
|
|
24218
26375
|
var detectFileSync = (filepath, opts = {}) => {
|
|
24219
|
-
const
|
|
26376
|
+
const fs7 = (0, node_1.default)();
|
|
24220
26377
|
if (opts && opts.sampleSize) {
|
|
24221
|
-
const fd =
|
|
26378
|
+
const fd = fs7.openSync(filepath, "r");
|
|
24222
26379
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
24223
|
-
const bytesRead =
|
|
26380
|
+
const bytesRead = fs7.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
24224
26381
|
if (bytesRead < opts.sampleSize) {
|
|
24225
26382
|
sample = sample.subarray(0, bytesRead);
|
|
24226
26383
|
}
|
|
24227
|
-
|
|
26384
|
+
fs7.closeSync(fd);
|
|
24228
26385
|
return (0, exports2.detect)(sample);
|
|
24229
26386
|
}
|
|
24230
|
-
return (0, exports2.detect)(
|
|
26387
|
+
return (0, exports2.detect)(fs7.readFileSync(filepath));
|
|
24231
26388
|
};
|
|
24232
26389
|
exports2.detectFileSync = detectFileSync;
|
|
24233
26390
|
exports2.default = {
|
|
@@ -27890,7 +30047,7 @@ var require_streams = __commonJS({
|
|
|
27890
30047
|
});
|
|
27891
30048
|
|
|
27892
30049
|
// ../../node_modules/iconv-lite/lib/index.js
|
|
27893
|
-
var
|
|
30050
|
+
var require_lib7 = __commonJS({
|
|
27894
30051
|
"../../node_modules/iconv-lite/lib/index.js"(exports2, module2) {
|
|
27895
30052
|
"use strict";
|
|
27896
30053
|
var Buffer2 = require_safer().Buffer;
|
|
@@ -30133,7 +32290,7 @@ var require_asap = __commonJS({
|
|
|
30133
32290
|
});
|
|
30134
32291
|
|
|
30135
32292
|
// ../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js
|
|
30136
|
-
var
|
|
32293
|
+
var require_async2 = __commonJS({
|
|
30137
32294
|
"../../node_modules/rxjs/dist/cjs/internal/scheduler/async.js"(exports2) {
|
|
30138
32295
|
"use strict";
|
|
30139
32296
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -30543,7 +32700,7 @@ var require_VirtualTimeScheduler = __commonJS({
|
|
|
30543
32700
|
});
|
|
30544
32701
|
|
|
30545
32702
|
// ../../node_modules/rxjs/dist/cjs/internal/observable/empty.js
|
|
30546
|
-
var
|
|
32703
|
+
var require_empty2 = __commonJS({
|
|
30547
32704
|
"../../node_modules/rxjs/dist/cjs/internal/observable/empty.js"(exports2) {
|
|
30548
32705
|
"use strict";
|
|
30549
32706
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -31494,7 +33651,7 @@ var require_Notification = __commonJS({
|
|
|
31494
33651
|
"use strict";
|
|
31495
33652
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31496
33653
|
exports2.observeNotification = exports2.Notification = exports2.NotificationKind = void 0;
|
|
31497
|
-
var empty_1 =
|
|
33654
|
+
var empty_1 = require_empty2();
|
|
31498
33655
|
var of_1 = require_of();
|
|
31499
33656
|
var throwError_1 = require_throwError();
|
|
31500
33657
|
var isFunction_1 = require_isFunction();
|
|
@@ -31725,7 +33882,7 @@ var require_timeout = __commonJS({
|
|
|
31725
33882
|
"use strict";
|
|
31726
33883
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
31727
33884
|
exports2.timeout = exports2.TimeoutError = void 0;
|
|
31728
|
-
var async_1 =
|
|
33885
|
+
var async_1 = require_async2();
|
|
31729
33886
|
var isDate_1 = require_isDate();
|
|
31730
33887
|
var lift_1 = require_lift();
|
|
31731
33888
|
var innerFrom_1 = require_innerFrom();
|
|
@@ -32651,7 +34808,7 @@ var require_timer = __commonJS({
|
|
|
32651
34808
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
32652
34809
|
exports2.timer = void 0;
|
|
32653
34810
|
var Observable_1 = require_Observable();
|
|
32654
|
-
var async_1 =
|
|
34811
|
+
var async_1 = require_async2();
|
|
32655
34812
|
var isScheduler_1 = require_isScheduler();
|
|
32656
34813
|
var isDate_1 = require_isDate();
|
|
32657
34814
|
function timer(dueTime, intervalOrScheduler, scheduler) {
|
|
@@ -32697,7 +34854,7 @@ var require_interval = __commonJS({
|
|
|
32697
34854
|
"use strict";
|
|
32698
34855
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
32699
34856
|
exports2.interval = void 0;
|
|
32700
|
-
var async_1 =
|
|
34857
|
+
var async_1 = require_async2();
|
|
32701
34858
|
var timer_1 = require_timer();
|
|
32702
34859
|
function interval(period, scheduler) {
|
|
32703
34860
|
if (period === void 0) {
|
|
@@ -32723,7 +34880,7 @@ var require_merge = __commonJS({
|
|
|
32723
34880
|
exports2.merge = void 0;
|
|
32724
34881
|
var mergeAll_1 = require_mergeAll();
|
|
32725
34882
|
var innerFrom_1 = require_innerFrom();
|
|
32726
|
-
var empty_1 =
|
|
34883
|
+
var empty_1 = require_empty2();
|
|
32727
34884
|
var args_1 = require_args();
|
|
32728
34885
|
var from_1 = require_from();
|
|
32729
34886
|
function merge() {
|
|
@@ -32926,7 +35083,7 @@ var require_range = __commonJS({
|
|
|
32926
35083
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
32927
35084
|
exports2.range = void 0;
|
|
32928
35085
|
var Observable_1 = require_Observable();
|
|
32929
|
-
var empty_1 =
|
|
35086
|
+
var empty_1 = require_empty2();
|
|
32930
35087
|
function range2(start, count, scheduler) {
|
|
32931
35088
|
if (count == null) {
|
|
32932
35089
|
count = start;
|
|
@@ -32966,7 +35123,7 @@ var require_using = __commonJS({
|
|
|
32966
35123
|
exports2.using = void 0;
|
|
32967
35124
|
var Observable_1 = require_Observable();
|
|
32968
35125
|
var innerFrom_1 = require_innerFrom();
|
|
32969
|
-
var empty_1 =
|
|
35126
|
+
var empty_1 = require_empty2();
|
|
32970
35127
|
function using(resourceFactory, observableFactory) {
|
|
32971
35128
|
return new Observable_1.Observable(function(subscriber) {
|
|
32972
35129
|
var resource = resourceFactory();
|
|
@@ -33015,7 +35172,7 @@ var require_zip = __commonJS({
|
|
|
33015
35172
|
var Observable_1 = require_Observable();
|
|
33016
35173
|
var innerFrom_1 = require_innerFrom();
|
|
33017
35174
|
var argsOrArgArray_1 = require_argsOrArgArray();
|
|
33018
|
-
var empty_1 =
|
|
35175
|
+
var empty_1 = require_empty2();
|
|
33019
35176
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
33020
35177
|
var args_1 = require_args();
|
|
33021
35178
|
function zip() {
|
|
@@ -33128,7 +35285,7 @@ var require_auditTime = __commonJS({
|
|
|
33128
35285
|
"use strict";
|
|
33129
35286
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
33130
35287
|
exports2.auditTime = void 0;
|
|
33131
|
-
var async_1 =
|
|
35288
|
+
var async_1 = require_async2();
|
|
33132
35289
|
var audit_1 = require_audit();
|
|
33133
35290
|
var timer_1 = require_timer();
|
|
33134
35291
|
function auditTime(duration, scheduler) {
|
|
@@ -33292,7 +35449,7 @@ var require_bufferTime = __commonJS({
|
|
|
33292
35449
|
var lift_1 = require_lift();
|
|
33293
35450
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
33294
35451
|
var arrRemove_1 = require_arrRemove();
|
|
33295
|
-
var async_1 =
|
|
35452
|
+
var async_1 = require_async2();
|
|
33296
35453
|
var args_1 = require_args();
|
|
33297
35454
|
var executeSchedule_1 = require_executeSchedule();
|
|
33298
35455
|
function bufferTime(bufferTimeSpan) {
|
|
@@ -33933,7 +36090,7 @@ var require_debounceTime = __commonJS({
|
|
|
33933
36090
|
"use strict";
|
|
33934
36091
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
33935
36092
|
exports2.debounceTime = void 0;
|
|
33936
|
-
var async_1 =
|
|
36093
|
+
var async_1 = require_async2();
|
|
33937
36094
|
var lift_1 = require_lift();
|
|
33938
36095
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
33939
36096
|
function debounceTime(dueTime, scheduler) {
|
|
@@ -34014,7 +36171,7 @@ var require_take = __commonJS({
|
|
|
34014
36171
|
"use strict";
|
|
34015
36172
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
34016
36173
|
exports2.take = void 0;
|
|
34017
|
-
var empty_1 =
|
|
36174
|
+
var empty_1 = require_empty2();
|
|
34018
36175
|
var lift_1 = require_lift();
|
|
34019
36176
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
34020
36177
|
function take(count) {
|
|
@@ -34102,7 +36259,7 @@ var require_delay = __commonJS({
|
|
|
34102
36259
|
"use strict";
|
|
34103
36260
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
34104
36261
|
exports2.delay = void 0;
|
|
34105
|
-
var async_1 =
|
|
36262
|
+
var async_1 = require_async2();
|
|
34106
36263
|
var delayWhen_1 = require_delayWhen();
|
|
34107
36264
|
var timer_1 = require_timer();
|
|
34108
36265
|
function delay(due, scheduler) {
|
|
@@ -34648,7 +36805,7 @@ var require_takeLast = __commonJS({
|
|
|
34648
36805
|
};
|
|
34649
36806
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
34650
36807
|
exports2.takeLast = void 0;
|
|
34651
|
-
var empty_1 =
|
|
36808
|
+
var empty_1 = require_empty2();
|
|
34652
36809
|
var lift_1 = require_lift();
|
|
34653
36810
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
34654
36811
|
function takeLast(count) {
|
|
@@ -35188,7 +37345,7 @@ var require_repeat = __commonJS({
|
|
|
35188
37345
|
"use strict";
|
|
35189
37346
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
35190
37347
|
exports2.repeat = void 0;
|
|
35191
|
-
var empty_1 =
|
|
37348
|
+
var empty_1 = require_empty2();
|
|
35192
37349
|
var lift_1 = require_lift();
|
|
35193
37350
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
35194
37351
|
var innerFrom_1 = require_innerFrom();
|
|
@@ -35456,7 +37613,7 @@ var require_sampleTime = __commonJS({
|
|
|
35456
37613
|
"use strict";
|
|
35457
37614
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
35458
37615
|
exports2.sampleTime = void 0;
|
|
35459
|
-
var async_1 =
|
|
37616
|
+
var async_1 = require_async2();
|
|
35460
37617
|
var sample_1 = require_sample();
|
|
35461
37618
|
var interval_1 = require_interval();
|
|
35462
37619
|
function sampleTime(period, scheduler) {
|
|
@@ -36090,7 +38247,7 @@ var require_throttleTime = __commonJS({
|
|
|
36090
38247
|
"use strict";
|
|
36091
38248
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
36092
38249
|
exports2.throttleTime = void 0;
|
|
36093
|
-
var async_1 =
|
|
38250
|
+
var async_1 = require_async2();
|
|
36094
38251
|
var throttle_1 = require_throttle();
|
|
36095
38252
|
var timer_1 = require_timer();
|
|
36096
38253
|
function throttleTime(duration, scheduler, config) {
|
|
@@ -36112,7 +38269,7 @@ var require_timeInterval = __commonJS({
|
|
|
36112
38269
|
"use strict";
|
|
36113
38270
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
36114
38271
|
exports2.TimeInterval = exports2.timeInterval = void 0;
|
|
36115
|
-
var async_1 =
|
|
38272
|
+
var async_1 = require_async2();
|
|
36116
38273
|
var lift_1 = require_lift();
|
|
36117
38274
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
36118
38275
|
function timeInterval(scheduler) {
|
|
@@ -36147,7 +38304,7 @@ var require_timeoutWith = __commonJS({
|
|
|
36147
38304
|
"use strict";
|
|
36148
38305
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
36149
38306
|
exports2.timeoutWith = void 0;
|
|
36150
|
-
var async_1 =
|
|
38307
|
+
var async_1 = require_async2();
|
|
36151
38308
|
var isDate_1 = require_isDate();
|
|
36152
38309
|
var timeout_1 = require_timeout();
|
|
36153
38310
|
function timeoutWith(due, withObservable, scheduler) {
|
|
@@ -36322,7 +38479,7 @@ var require_windowTime = __commonJS({
|
|
|
36322
38479
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
36323
38480
|
exports2.windowTime = void 0;
|
|
36324
38481
|
var Subject_1 = require_Subject();
|
|
36325
|
-
var async_1 =
|
|
38482
|
+
var async_1 = require_async2();
|
|
36326
38483
|
var Subscription_1 = require_Subscription();
|
|
36327
38484
|
var lift_1 = require_lift();
|
|
36328
38485
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
@@ -36767,7 +38924,7 @@ var require_cjs = __commonJS({
|
|
|
36767
38924
|
Object.defineProperty(exports2, "asapScheduler", { enumerable: true, get: function() {
|
|
36768
38925
|
return asap_1.asapScheduler;
|
|
36769
38926
|
} });
|
|
36770
|
-
var async_1 =
|
|
38927
|
+
var async_1 = require_async2();
|
|
36771
38928
|
Object.defineProperty(exports2, "async", { enumerable: true, get: function() {
|
|
36772
38929
|
return async_1.async;
|
|
36773
38930
|
} });
|
|
@@ -36890,7 +39047,7 @@ var require_cjs = __commonJS({
|
|
|
36890
39047
|
Object.defineProperty(exports2, "defer", { enumerable: true, get: function() {
|
|
36891
39048
|
return defer_1.defer;
|
|
36892
39049
|
} });
|
|
36893
|
-
var empty_1 =
|
|
39050
|
+
var empty_1 = require_empty2();
|
|
36894
39051
|
Object.defineProperty(exports2, "empty", { enumerable: true, get: function() {
|
|
36895
39052
|
return empty_1.empty;
|
|
36896
39053
|
} });
|
|
@@ -36974,7 +39131,7 @@ var require_cjs = __commonJS({
|
|
|
36974
39131
|
Object.defineProperty(exports2, "scheduled", { enumerable: true, get: function() {
|
|
36975
39132
|
return scheduled_1.scheduled;
|
|
36976
39133
|
} });
|
|
36977
|
-
var empty_2 =
|
|
39134
|
+
var empty_2 = require_empty2();
|
|
36978
39135
|
Object.defineProperty(exports2, "EMPTY", { enumerable: true, get: function() {
|
|
36979
39136
|
return empty_2.EMPTY;
|
|
36980
39137
|
} });
|
|
@@ -37770,21 +39927,21 @@ function camelCase(input, options) {
|
|
|
37770
39927
|
|
|
37771
39928
|
// src/commands/init/v2/index.ts
|
|
37772
39929
|
var spawn = __toESM(require_cross_spawn(), 1);
|
|
37773
|
-
var
|
|
39930
|
+
var fs6 = __toESM(require("fs"), 1);
|
|
37774
39931
|
var os2 = __toESM(require("os"), 1);
|
|
37775
|
-
var
|
|
39932
|
+
var path6 = __toESM(require("path"), 1);
|
|
37776
39933
|
|
|
37777
39934
|
// package.json
|
|
37778
|
-
var version = "3.8.
|
|
39935
|
+
var version = "3.8.6";
|
|
37779
39936
|
|
|
37780
39937
|
// src/helpers/index.ts
|
|
37781
39938
|
var fs2 = __toESM(require("fs"), 1);
|
|
37782
39939
|
var isAlphaNumericAndHyphens = (str) => {
|
|
37783
39940
|
return /^[a-zA-Z0-9-]+$/.test(str);
|
|
37784
39941
|
};
|
|
37785
|
-
function isEmptyDir(
|
|
39942
|
+
function isEmptyDir(path8) {
|
|
37786
39943
|
try {
|
|
37787
|
-
const directory = fs2.opendirSync(
|
|
39944
|
+
const directory = fs2.opendirSync(path8);
|
|
37788
39945
|
const entry = directory.readSync();
|
|
37789
39946
|
directory.closeSync();
|
|
37790
39947
|
return entry === null;
|
|
@@ -41986,12 +44143,12 @@ var PathBase = class {
|
|
|
41986
44143
|
/**
|
|
41987
44144
|
* Get the Path object referenced by the string path, resolved from this Path
|
|
41988
44145
|
*/
|
|
41989
|
-
resolve(
|
|
41990
|
-
if (!
|
|
44146
|
+
resolve(path8) {
|
|
44147
|
+
if (!path8) {
|
|
41991
44148
|
return this;
|
|
41992
44149
|
}
|
|
41993
|
-
const rootPath = this.getRootString(
|
|
41994
|
-
const dir =
|
|
44150
|
+
const rootPath = this.getRootString(path8);
|
|
44151
|
+
const dir = path8.substring(rootPath.length);
|
|
41995
44152
|
const dirParts = dir.split(this.splitSep);
|
|
41996
44153
|
const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
|
|
41997
44154
|
return result;
|
|
@@ -42743,8 +44900,8 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
42743
44900
|
/**
|
|
42744
44901
|
* @internal
|
|
42745
44902
|
*/
|
|
42746
|
-
getRootString(
|
|
42747
|
-
return import_node_path.win32.parse(
|
|
44903
|
+
getRootString(path8) {
|
|
44904
|
+
return import_node_path.win32.parse(path8).root;
|
|
42748
44905
|
}
|
|
42749
44906
|
/**
|
|
42750
44907
|
* @internal
|
|
@@ -42790,8 +44947,8 @@ var PathPosix = class _PathPosix extends PathBase {
|
|
|
42790
44947
|
/**
|
|
42791
44948
|
* @internal
|
|
42792
44949
|
*/
|
|
42793
|
-
getRootString(
|
|
42794
|
-
return
|
|
44950
|
+
getRootString(path8) {
|
|
44951
|
+
return path8.startsWith("/") ? "/" : "";
|
|
42795
44952
|
}
|
|
42796
44953
|
/**
|
|
42797
44954
|
* @internal
|
|
@@ -42840,8 +44997,8 @@ var PathScurryBase = class {
|
|
|
42840
44997
|
*
|
|
42841
44998
|
* @internal
|
|
42842
44999
|
*/
|
|
42843
|
-
constructor(cwd = process.cwd(), pathImpl, sep3, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
42844
|
-
this.#fs = fsFromOption(
|
|
45000
|
+
constructor(cwd = process.cwd(), pathImpl, sep3, { nocase, childrenCacheSize = 16 * 1024, fs: fs7 = defaultFS } = {}) {
|
|
45001
|
+
this.#fs = fsFromOption(fs7);
|
|
42845
45002
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
42846
45003
|
cwd = (0, import_node_url.fileURLToPath)(cwd);
|
|
42847
45004
|
}
|
|
@@ -42880,11 +45037,11 @@ var PathScurryBase = class {
|
|
|
42880
45037
|
/**
|
|
42881
45038
|
* Get the depth of a provided path, string, or the cwd
|
|
42882
45039
|
*/
|
|
42883
|
-
depth(
|
|
42884
|
-
if (typeof
|
|
42885
|
-
|
|
45040
|
+
depth(path8 = this.cwd) {
|
|
45041
|
+
if (typeof path8 === "string") {
|
|
45042
|
+
path8 = this.cwd.resolve(path8);
|
|
42886
45043
|
}
|
|
42887
|
-
return
|
|
45044
|
+
return path8.depth();
|
|
42888
45045
|
}
|
|
42889
45046
|
/**
|
|
42890
45047
|
* Return the cache of child entries. Exposed so subclasses can create
|
|
@@ -43371,9 +45528,9 @@ var PathScurryBase = class {
|
|
|
43371
45528
|
process4();
|
|
43372
45529
|
return results;
|
|
43373
45530
|
}
|
|
43374
|
-
chdir(
|
|
45531
|
+
chdir(path8 = this.cwd) {
|
|
43375
45532
|
const oldCwd = this.cwd;
|
|
43376
|
-
this.cwd = typeof
|
|
45533
|
+
this.cwd = typeof path8 === "string" ? this.cwd.resolve(path8) : path8;
|
|
43377
45534
|
this.cwd[setAsCwd](oldCwd);
|
|
43378
45535
|
}
|
|
43379
45536
|
};
|
|
@@ -43399,8 +45556,8 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
43399
45556
|
/**
|
|
43400
45557
|
* @internal
|
|
43401
45558
|
*/
|
|
43402
|
-
newRoot(
|
|
43403
|
-
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
45559
|
+
newRoot(fs7) {
|
|
45560
|
+
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 });
|
|
43404
45561
|
}
|
|
43405
45562
|
/**
|
|
43406
45563
|
* Return true if the provided path string is an absolute path
|
|
@@ -43428,8 +45585,8 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
43428
45585
|
/**
|
|
43429
45586
|
* @internal
|
|
43430
45587
|
*/
|
|
43431
|
-
newRoot(
|
|
43432
|
-
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs:
|
|
45588
|
+
newRoot(fs7) {
|
|
45589
|
+
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 });
|
|
43433
45590
|
}
|
|
43434
45591
|
/**
|
|
43435
45592
|
* Return true if the provided path string is an absolute path
|
|
@@ -43729,8 +45886,8 @@ var MatchRecord = class {
|
|
|
43729
45886
|
}
|
|
43730
45887
|
// match, absolute, ifdir
|
|
43731
45888
|
entries() {
|
|
43732
|
-
return [...this.store.entries()].map(([
|
|
43733
|
-
|
|
45889
|
+
return [...this.store.entries()].map(([path8, n]) => [
|
|
45890
|
+
path8,
|
|
43734
45891
|
!!(n & 2),
|
|
43735
45892
|
!!(n & 1)
|
|
43736
45893
|
]);
|
|
@@ -43935,9 +46092,9 @@ var GlobUtil = class {
|
|
|
43935
46092
|
signal;
|
|
43936
46093
|
maxDepth;
|
|
43937
46094
|
includeChildMatches;
|
|
43938
|
-
constructor(patterns,
|
|
46095
|
+
constructor(patterns, path8, opts) {
|
|
43939
46096
|
this.patterns = patterns;
|
|
43940
|
-
this.path =
|
|
46097
|
+
this.path = path8;
|
|
43941
46098
|
this.opts = opts;
|
|
43942
46099
|
this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
|
|
43943
46100
|
this.includeChildMatches = opts.includeChildMatches !== false;
|
|
@@ -43956,11 +46113,11 @@ var GlobUtil = class {
|
|
|
43956
46113
|
});
|
|
43957
46114
|
}
|
|
43958
46115
|
}
|
|
43959
|
-
#ignored(
|
|
43960
|
-
return this.seen.has(
|
|
46116
|
+
#ignored(path8) {
|
|
46117
|
+
return this.seen.has(path8) || !!this.#ignore?.ignored?.(path8);
|
|
43961
46118
|
}
|
|
43962
|
-
#childrenIgnored(
|
|
43963
|
-
return !!this.#ignore?.childrenIgnored?.(
|
|
46119
|
+
#childrenIgnored(path8) {
|
|
46120
|
+
return !!this.#ignore?.childrenIgnored?.(path8);
|
|
43964
46121
|
}
|
|
43965
46122
|
// backpressure mechanism
|
|
43966
46123
|
pause() {
|
|
@@ -44175,8 +46332,8 @@ var GlobUtil = class {
|
|
|
44175
46332
|
};
|
|
44176
46333
|
var GlobWalker = class extends GlobUtil {
|
|
44177
46334
|
matches = /* @__PURE__ */ new Set();
|
|
44178
|
-
constructor(patterns,
|
|
44179
|
-
super(patterns,
|
|
46335
|
+
constructor(patterns, path8, opts) {
|
|
46336
|
+
super(patterns, path8, opts);
|
|
44180
46337
|
}
|
|
44181
46338
|
matchEmit(e) {
|
|
44182
46339
|
this.matches.add(e);
|
|
@@ -44213,8 +46370,8 @@ var GlobWalker = class extends GlobUtil {
|
|
|
44213
46370
|
};
|
|
44214
46371
|
var GlobStream = class extends GlobUtil {
|
|
44215
46372
|
results;
|
|
44216
|
-
constructor(patterns,
|
|
44217
|
-
super(patterns,
|
|
46373
|
+
constructor(patterns, path8, opts) {
|
|
46374
|
+
super(patterns, path8, opts);
|
|
44218
46375
|
this.results = new Minipass({
|
|
44219
46376
|
signal: this.signal,
|
|
44220
46377
|
objectMode: true
|
|
@@ -45878,8 +48035,8 @@ JSONPath.prototype._getPreferredOutput = function(ea) {
|
|
|
45878
48035
|
const resultType = this.currResultType;
|
|
45879
48036
|
switch (resultType) {
|
|
45880
48037
|
case "all": {
|
|
45881
|
-
const
|
|
45882
|
-
ea.pointer = JSONPath.toPointer(
|
|
48038
|
+
const path8 = Array.isArray(ea.path) ? ea.path : JSONPath.toPathArray(ea.path);
|
|
48039
|
+
ea.pointer = JSONPath.toPointer(path8);
|
|
45883
48040
|
ea.path = typeof ea.path === "string" ? ea.path : JSONPath.toPathString(ea.path);
|
|
45884
48041
|
return ea;
|
|
45885
48042
|
}
|
|
@@ -45902,11 +48059,11 @@ JSONPath.prototype._handleCallback = function(fullRetObj, callback, type) {
|
|
|
45902
48059
|
callback(preferredOutput, type, fullRetObj);
|
|
45903
48060
|
}
|
|
45904
48061
|
};
|
|
45905
|
-
JSONPath.prototype._trace = function(expr, val,
|
|
48062
|
+
JSONPath.prototype._trace = function(expr, val, path8, parent, parentPropName, callback, hasArrExpr, literalPriority) {
|
|
45906
48063
|
let retObj;
|
|
45907
48064
|
if (!expr.length) {
|
|
45908
48065
|
retObj = {
|
|
45909
|
-
path:
|
|
48066
|
+
path: path8,
|
|
45910
48067
|
value: val,
|
|
45911
48068
|
parent,
|
|
45912
48069
|
parentProperty: parentPropName,
|
|
@@ -45927,28 +48084,28 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
45927
48084
|
}
|
|
45928
48085
|
}
|
|
45929
48086
|
if ((typeof loc !== "string" || literalPriority) && val && Object.hasOwn(val, loc)) {
|
|
45930
|
-
addRet(this._trace(x, val[loc], push(
|
|
48087
|
+
addRet(this._trace(x, val[loc], push(path8, loc), val, loc, callback, hasArrExpr));
|
|
45931
48088
|
} else if (loc === "*") {
|
|
45932
48089
|
this._walk(val, (m) => {
|
|
45933
|
-
addRet(this._trace(x, val[m], push(
|
|
48090
|
+
addRet(this._trace(x, val[m], push(path8, m), val, m, callback, true, true));
|
|
45934
48091
|
});
|
|
45935
48092
|
} else if (loc === "..") {
|
|
45936
|
-
addRet(this._trace(x, val,
|
|
48093
|
+
addRet(this._trace(x, val, path8, parent, parentPropName, callback, hasArrExpr));
|
|
45937
48094
|
this._walk(val, (m) => {
|
|
45938
48095
|
if (typeof val[m] === "object") {
|
|
45939
|
-
addRet(this._trace(expr.slice(), val[m], push(
|
|
48096
|
+
addRet(this._trace(expr.slice(), val[m], push(path8, m), val, m, callback, true));
|
|
45940
48097
|
}
|
|
45941
48098
|
});
|
|
45942
48099
|
} else if (loc === "^") {
|
|
45943
48100
|
this._hasParentSelector = true;
|
|
45944
48101
|
return {
|
|
45945
|
-
path:
|
|
48102
|
+
path: path8.slice(0, -1),
|
|
45946
48103
|
expr: x,
|
|
45947
48104
|
isParentSelector: true
|
|
45948
48105
|
};
|
|
45949
48106
|
} else if (loc === "~") {
|
|
45950
48107
|
retObj = {
|
|
45951
|
-
path: push(
|
|
48108
|
+
path: push(path8, loc),
|
|
45952
48109
|
value: parentPropName,
|
|
45953
48110
|
parent,
|
|
45954
48111
|
parentProperty: null
|
|
@@ -45956,9 +48113,9 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
45956
48113
|
this._handleCallback(retObj, callback, "property");
|
|
45957
48114
|
return retObj;
|
|
45958
48115
|
} else if (loc === "$") {
|
|
45959
|
-
addRet(this._trace(x, val,
|
|
48116
|
+
addRet(this._trace(x, val, path8, null, null, callback, hasArrExpr));
|
|
45960
48117
|
} else if (/^(-?\d*):(-?\d*):?(\d*)$/u.test(loc)) {
|
|
45961
|
-
addRet(this._slice(loc, x, val,
|
|
48118
|
+
addRet(this._slice(loc, x, val, path8, parent, parentPropName, callback));
|
|
45962
48119
|
} else if (loc.indexOf("?(") === 0) {
|
|
45963
48120
|
if (this.currEval === false) {
|
|
45964
48121
|
throw new Error("Eval [?(expr)] prevented in JSONPath expression.");
|
|
@@ -45969,15 +48126,15 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
45969
48126
|
this._walk(val, (m) => {
|
|
45970
48127
|
const npath = [nested[2]];
|
|
45971
48128
|
const nvalue = nested[1] ? val[m][nested[1]] : val[m];
|
|
45972
|
-
const filterResults = this._trace(npath, nvalue,
|
|
48129
|
+
const filterResults = this._trace(npath, nvalue, path8, parent, parentPropName, callback, true);
|
|
45973
48130
|
if (filterResults.length > 0) {
|
|
45974
|
-
addRet(this._trace(x, val[m], push(
|
|
48131
|
+
addRet(this._trace(x, val[m], push(path8, m), val, m, callback, true));
|
|
45975
48132
|
}
|
|
45976
48133
|
});
|
|
45977
48134
|
} else {
|
|
45978
48135
|
this._walk(val, (m) => {
|
|
45979
|
-
if (this._eval(safeLoc, val[m], m,
|
|
45980
|
-
addRet(this._trace(x, val[m], push(
|
|
48136
|
+
if (this._eval(safeLoc, val[m], m, path8, parent, parentPropName)) {
|
|
48137
|
+
addRet(this._trace(x, val[m], push(path8, m), val, m, callback, true));
|
|
45981
48138
|
}
|
|
45982
48139
|
});
|
|
45983
48140
|
}
|
|
@@ -45985,7 +48142,7 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
45985
48142
|
if (this.currEval === false) {
|
|
45986
48143
|
throw new Error("Eval [(expr)] prevented in JSONPath expression.");
|
|
45987
48144
|
}
|
|
45988
|
-
addRet(this._trace(unshift(this._eval(loc, val,
|
|
48145
|
+
addRet(this._trace(unshift(this._eval(loc, val, path8.at(-1), path8.slice(0, -1), parent, parentPropName), x), val, path8, parent, parentPropName, callback, hasArrExpr));
|
|
45989
48146
|
} else if (loc[0] === "@") {
|
|
45990
48147
|
let addType = false;
|
|
45991
48148
|
const valueType = loc.slice(1, -2);
|
|
@@ -46029,7 +48186,7 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
46029
48186
|
}
|
|
46030
48187
|
break;
|
|
46031
48188
|
case "other":
|
|
46032
|
-
addType = this.currOtherTypeCallback(val,
|
|
48189
|
+
addType = this.currOtherTypeCallback(val, path8, parent, parentPropName);
|
|
46033
48190
|
break;
|
|
46034
48191
|
case "null":
|
|
46035
48192
|
if (val === null) {
|
|
@@ -46042,7 +48199,7 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
46042
48199
|
}
|
|
46043
48200
|
if (addType) {
|
|
46044
48201
|
retObj = {
|
|
46045
|
-
path:
|
|
48202
|
+
path: path8,
|
|
46046
48203
|
value: val,
|
|
46047
48204
|
parent,
|
|
46048
48205
|
parentProperty: parentPropName
|
|
@@ -46052,14 +48209,14 @@ JSONPath.prototype._trace = function(expr, val, path7, parent, parentPropName, c
|
|
|
46052
48209
|
}
|
|
46053
48210
|
} else if (loc[0] === "`" && val && Object.hasOwn(val, loc.slice(1))) {
|
|
46054
48211
|
const locProp = loc.slice(1);
|
|
46055
|
-
addRet(this._trace(x, val[locProp], push(
|
|
48212
|
+
addRet(this._trace(x, val[locProp], push(path8, locProp), val, locProp, callback, hasArrExpr, true));
|
|
46056
48213
|
} else if (loc.includes(",")) {
|
|
46057
48214
|
const parts = loc.split(",");
|
|
46058
48215
|
for (const part of parts) {
|
|
46059
|
-
addRet(this._trace(unshift(part, x), val,
|
|
48216
|
+
addRet(this._trace(unshift(part, x), val, path8, parent, parentPropName, callback, true));
|
|
46060
48217
|
}
|
|
46061
48218
|
} else if (!literalPriority && val && Object.hasOwn(val, loc)) {
|
|
46062
|
-
addRet(this._trace(x, val[loc], push(
|
|
48219
|
+
addRet(this._trace(x, val[loc], push(path8, loc), val, loc, callback, hasArrExpr, true));
|
|
46063
48220
|
}
|
|
46064
48221
|
if (this._hasParentSelector) {
|
|
46065
48222
|
for (let t = 0; t < ret.length; t++) {
|
|
@@ -46093,7 +48250,7 @@ JSONPath.prototype._walk = function(val, f) {
|
|
|
46093
48250
|
});
|
|
46094
48251
|
}
|
|
46095
48252
|
};
|
|
46096
|
-
JSONPath.prototype._slice = function(loc, expr, val,
|
|
48253
|
+
JSONPath.prototype._slice = function(loc, expr, val, path8, parent, parentPropName, callback) {
|
|
46097
48254
|
if (!Array.isArray(val)) {
|
|
46098
48255
|
return void 0;
|
|
46099
48256
|
}
|
|
@@ -46103,14 +48260,14 @@ JSONPath.prototype._slice = function(loc, expr, val, path7, parent, parentPropNa
|
|
|
46103
48260
|
end = end < 0 ? Math.max(0, end + len) : Math.min(len, end);
|
|
46104
48261
|
const ret = [];
|
|
46105
48262
|
for (let i = start; i < end; i += step) {
|
|
46106
|
-
const tmp = this._trace(unshift(i, expr), val,
|
|
48263
|
+
const tmp = this._trace(unshift(i, expr), val, path8, parent, parentPropName, callback, true);
|
|
46107
48264
|
tmp.forEach((t) => {
|
|
46108
48265
|
ret.push(t);
|
|
46109
48266
|
});
|
|
46110
48267
|
}
|
|
46111
48268
|
return ret;
|
|
46112
48269
|
};
|
|
46113
|
-
JSONPath.prototype._eval = function(code, _v, _vname,
|
|
48270
|
+
JSONPath.prototype._eval = function(code, _v, _vname, path8, parent, parentPropName) {
|
|
46114
48271
|
this.currSandbox._$_parentProperty = parentPropName;
|
|
46115
48272
|
this.currSandbox._$_parent = parent;
|
|
46116
48273
|
this.currSandbox._$_property = _vname;
|
|
@@ -46118,7 +48275,7 @@ JSONPath.prototype._eval = function(code, _v, _vname, path7, parent, parentPropN
|
|
|
46118
48275
|
this.currSandbox._$_v = _v;
|
|
46119
48276
|
const containsPath = code.includes("@path");
|
|
46120
48277
|
if (containsPath) {
|
|
46121
|
-
this.currSandbox._$_path = JSONPath.toPathString(
|
|
48278
|
+
this.currSandbox._$_path = JSONPath.toPathString(path8.concat([_vname]));
|
|
46122
48279
|
}
|
|
46123
48280
|
const scriptCacheKey = this.currEval + "Script:" + code;
|
|
46124
48281
|
if (!JSONPath.cache[scriptCacheKey]) {
|
|
@@ -46562,10 +48719,36 @@ var SeekaAppScaffolder = class {
|
|
|
46562
48719
|
};
|
|
46563
48720
|
|
|
46564
48721
|
// src/commands/ai/context/index.ts
|
|
46565
|
-
var
|
|
46566
|
-
var
|
|
48722
|
+
var fs5 = __toESM(require("fs"), 1);
|
|
48723
|
+
var path5 = __toESM(require("path"), 1);
|
|
46567
48724
|
var import_jszip = __toESM(require_lib3(), 1);
|
|
48725
|
+
|
|
48726
|
+
// src/helpers/config/index.ts
|
|
48727
|
+
var import_path = __toESM(require("path"), 1);
|
|
48728
|
+
var import_fs_extra = __toESM(require_lib4(), 1);
|
|
48729
|
+
var getAppInitConfig = (baseDir) => {
|
|
48730
|
+
const initConfigPath = import_path.default.resolve(baseDir || process.cwd(), ".seeka", "init.app.seeka.cli.config.json");
|
|
48731
|
+
if (import_fs_extra.default.existsSync(initConfigPath)) {
|
|
48732
|
+
console.log("Reading init config from", initConfigPath);
|
|
48733
|
+
const initConfig = JSON.parse(import_fs_extra.default.readFileSync(initConfigPath, "utf-8"));
|
|
48734
|
+
if (initConfig) {
|
|
48735
|
+
return initConfig;
|
|
48736
|
+
}
|
|
48737
|
+
}
|
|
48738
|
+
return void 0;
|
|
48739
|
+
};
|
|
46568
48740
|
var DEFAULT_PUBLIC_CONTEXT_URL = "https://saseekaaueaprodpub.blob.core.windows.net/sdk-apps/ai-context/public/ai-context-latest.zip";
|
|
48741
|
+
var getContextPackageUrl = (baseDir, initialPackageUrl) => {
|
|
48742
|
+
if (!initialPackageUrl) {
|
|
48743
|
+
const initConfig = getAppInitConfig(baseDir);
|
|
48744
|
+
if (initConfig?.contextPackageUrl) {
|
|
48745
|
+
return initConfig.contextPackageUrl;
|
|
48746
|
+
}
|
|
48747
|
+
}
|
|
48748
|
+
return initialPackageUrl || DEFAULT_PUBLIC_CONTEXT_URL;
|
|
48749
|
+
};
|
|
48750
|
+
|
|
48751
|
+
// src/commands/ai/context/index.ts
|
|
46569
48752
|
async function downloadFile(url) {
|
|
46570
48753
|
const response = await fetch(url);
|
|
46571
48754
|
if (!response.ok) {
|
|
@@ -46578,30 +48761,30 @@ async function extractZipToDirectory(zipBuffer, destDir) {
|
|
|
46578
48761
|
const zip = await import_jszip.default.loadAsync(zipBuffer);
|
|
46579
48762
|
const entries = Object.entries(zip.files);
|
|
46580
48763
|
for (const [relativePath, zipEntry] of entries) {
|
|
46581
|
-
const destPath =
|
|
48764
|
+
const destPath = path5.join(destDir, relativePath);
|
|
46582
48765
|
if (zipEntry.dir) {
|
|
46583
|
-
|
|
48766
|
+
fs5.mkdirSync(destPath, { recursive: true });
|
|
46584
48767
|
} else {
|
|
46585
|
-
|
|
48768
|
+
fs5.mkdirSync(path5.dirname(destPath), { recursive: true });
|
|
46586
48769
|
const content = await zipEntry.async("nodebuffer");
|
|
46587
|
-
|
|
48770
|
+
fs5.writeFileSync(destPath, content);
|
|
46588
48771
|
}
|
|
46589
48772
|
}
|
|
46590
48773
|
}
|
|
46591
48774
|
var aiContextCommand = async (options = {}) => {
|
|
46592
48775
|
const targetDir = options.targetDir || process.cwd();
|
|
46593
|
-
const contextDestDir =
|
|
46594
|
-
const contextUrl = options.contextPackageUrl
|
|
48776
|
+
const contextDestDir = path5.join(targetDir, ".seeka", "ai", "context");
|
|
48777
|
+
const contextUrl = getContextPackageUrl(targetDir, options.contextPackageUrl);
|
|
46595
48778
|
console.log("Seeka AI Context");
|
|
46596
48779
|
console.log("================");
|
|
46597
48780
|
console.log("");
|
|
46598
48781
|
console.log(`Target: ${contextDestDir}`);
|
|
46599
48782
|
console.log("");
|
|
46600
|
-
if (
|
|
48783
|
+
if (fs5.existsSync(contextDestDir)) {
|
|
46601
48784
|
console.log("Removing existing AI context...");
|
|
46602
|
-
|
|
48785
|
+
fs5.rmSync(contextDestDir, { recursive: true, force: true });
|
|
46603
48786
|
}
|
|
46604
|
-
|
|
48787
|
+
fs5.mkdirSync(contextDestDir, { recursive: true });
|
|
46605
48788
|
console.log("Downloading AI context package...");
|
|
46606
48789
|
let zipBuffer;
|
|
46607
48790
|
try {
|
|
@@ -46639,8 +48822,8 @@ var aiContextCommand = async (options = {}) => {
|
|
|
46639
48822
|
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
46640
48823
|
source: options.contextPackageUrl ? "custom" : "public"
|
|
46641
48824
|
};
|
|
46642
|
-
const metaPath =
|
|
46643
|
-
|
|
48825
|
+
const metaPath = path5.join(contextDestDir, "meta.json");
|
|
48826
|
+
fs5.writeFileSync(metaPath, JSON.stringify(metaJson, null, 2), "utf-8");
|
|
46644
48827
|
console.log("");
|
|
46645
48828
|
console.log("\u2713 AI context installed successfully!");
|
|
46646
48829
|
console.log("");
|
|
@@ -46651,9 +48834,6 @@ var aiContextCommand = async (options = {}) => {
|
|
|
46651
48834
|
console.log(" - Architecture documentation");
|
|
46652
48835
|
console.log(" - Implementation guides");
|
|
46653
48836
|
console.log(" - SDK API reference");
|
|
46654
|
-
if (options.contextPackageUrl) {
|
|
46655
|
-
console.log(" - Example apps (custom package)");
|
|
46656
|
-
}
|
|
46657
48837
|
console.log("");
|
|
46658
48838
|
console.log("AI assistants can now reference .seeka/ai/context/ for app development guidance.");
|
|
46659
48839
|
};
|
|
@@ -46678,35 +48858,35 @@ var initCommandV2 = async (options) => {
|
|
|
46678
48858
|
}
|
|
46679
48859
|
const orgName = options.orgName.toLowerCase();
|
|
46680
48860
|
const projectPascalCase = camelCase(projectName, { pascalCase: true });
|
|
46681
|
-
const projectDir =
|
|
48861
|
+
const projectDir = path6.resolve(options.outputDirectory, !options.skipSubDir ? options.directoryName || projectName : "");
|
|
46682
48862
|
console.log(`Creating new ${options.template.replace(/-/gi, " ")} Seeka app in ${projectDir}`);
|
|
46683
48863
|
console.log("");
|
|
46684
|
-
if (!options.skipSubDir &&
|
|
48864
|
+
if (!options.skipSubDir && fs6.existsSync(projectDir) && isEmptyDir(projectDir) === false) {
|
|
46685
48865
|
if (options.force) {
|
|
46686
48866
|
console.log("--force was used and destination directory is not empty. Clearing out the directory");
|
|
46687
|
-
const gitDirPath =
|
|
46688
|
-
const gitDirExists =
|
|
48867
|
+
const gitDirPath = path6.resolve(projectDir, ".git");
|
|
48868
|
+
const gitDirExists = fs6.existsSync(gitDirPath);
|
|
46689
48869
|
if (gitDirExists) {
|
|
46690
48870
|
console.info(".git directory found in directory, I will preserve it and remove all other files and directories to prepare for the app creation");
|
|
46691
48871
|
}
|
|
46692
|
-
const items =
|
|
48872
|
+
const items = fs6.readdirSync(projectDir);
|
|
46693
48873
|
for (const item of items) {
|
|
46694
48874
|
if (item === ".git") {
|
|
46695
48875
|
continue;
|
|
46696
48876
|
}
|
|
46697
|
-
const itemPath =
|
|
46698
|
-
|
|
48877
|
+
const itemPath = path6.resolve(projectDir, item);
|
|
48878
|
+
fs6.rmSync(itemPath, { recursive: true, force: true });
|
|
46699
48879
|
}
|
|
46700
48880
|
} else {
|
|
46701
48881
|
console.error("Directory is not empty. Use --force to create app in non-empty directory");
|
|
46702
48882
|
return;
|
|
46703
48883
|
}
|
|
46704
48884
|
}
|
|
46705
|
-
if (!
|
|
46706
|
-
|
|
48885
|
+
if (!fs6.existsSync(projectDir)) {
|
|
48886
|
+
fs6.mkdirSync(projectDir, { recursive: true });
|
|
46707
48887
|
}
|
|
46708
|
-
const templateDir =
|
|
46709
|
-
const scaffoldOutputDir = options.skipSubDir ?
|
|
48888
|
+
const templateDir = path6.resolve(__dirname, "init-template");
|
|
48889
|
+
const scaffoldOutputDir = options.skipSubDir ? fs6.mkdtempSync(path6.join(os2.tmpdir(), "seeka-app-init-v2-")) : projectDir;
|
|
46710
48890
|
const scaffolder = new SeekaAppScaffolder();
|
|
46711
48891
|
await scaffolder.scaffoldSeekaApp({
|
|
46712
48892
|
templateDir,
|
|
@@ -46808,8 +48988,8 @@ var initCommandV2 = async (options) => {
|
|
|
46808
48988
|
]
|
|
46809
48989
|
});
|
|
46810
48990
|
if (options.skipSubDir) {
|
|
46811
|
-
|
|
46812
|
-
|
|
48991
|
+
fs6.cpSync(scaffoldOutputDir, projectDir, { recursive: true });
|
|
48992
|
+
fs6.rmSync(scaffoldOutputDir, { recursive: true, force: true });
|
|
46813
48993
|
}
|
|
46814
48994
|
if (options.installDependencies) {
|
|
46815
48995
|
console.info("Installing package dependencies");
|
|
@@ -46819,7 +48999,7 @@ var initCommandV2 = async (options) => {
|
|
|
46819
48999
|
console.error("Error installing package dependencies", err);
|
|
46820
49000
|
}
|
|
46821
49001
|
}
|
|
46822
|
-
const yarnRcFilePath =
|
|
49002
|
+
const yarnRcFilePath = path6.resolve(projectDir, ".yarnrc.yml");
|
|
46823
49003
|
let npmAuthToken = "<< GET TOKEN FROM https://seeka.app/settings/integrations/api >>";
|
|
46824
49004
|
if (!options.npmUsername || !options.npmPassword) {
|
|
46825
49005
|
console.warn('npmUsername and npmPassword was not provided. Either delete the "browser" directory from the app template before installing dependencies or get your NPM login from https://seeka.app/settings/integrations/api');
|
|
@@ -46827,7 +49007,7 @@ var initCommandV2 = async (options) => {
|
|
|
46827
49007
|
console.log("Using NPM registry username " + options.npmUsername);
|
|
46828
49008
|
npmAuthToken = `${options.npmUsername}:${options.npmPassword}`;
|
|
46829
49009
|
}
|
|
46830
|
-
|
|
49010
|
+
fs6.writeFileSync(
|
|
46831
49011
|
yarnRcFilePath,
|
|
46832
49012
|
`nodeLinker: node-modules
|
|
46833
49013
|
|
|
@@ -46838,14 +49018,14 @@ npmScopes:
|
|
|
46838
49018
|
npmRegistryServer: "https://npm.packages.seeka.services"`,
|
|
46839
49019
|
{ encoding: "utf8" }
|
|
46840
49020
|
);
|
|
46841
|
-
const yarnLockFilePath =
|
|
46842
|
-
|
|
46843
|
-
const seekaDir =
|
|
46844
|
-
if (!
|
|
46845
|
-
|
|
49021
|
+
const yarnLockFilePath = path6.resolve(projectDir, "yarn.lock");
|
|
49022
|
+
fs6.writeFileSync(yarnLockFilePath, "", { encoding: "utf8" });
|
|
49023
|
+
const seekaDir = path6.join(projectDir, ".seeka");
|
|
49024
|
+
if (!fs6.existsSync(seekaDir)) {
|
|
49025
|
+
fs6.mkdirSync(seekaDir, { recursive: true });
|
|
46846
49026
|
}
|
|
46847
49027
|
const { environmentVariables, ...otherOptions } = options;
|
|
46848
|
-
const configPath =
|
|
49028
|
+
const configPath = path6.join(seekaDir, "init.app.seeka.cli.config.json");
|
|
46849
49029
|
const configOutput = {
|
|
46850
49030
|
...otherOptions,
|
|
46851
49031
|
sdk: {
|
|
@@ -46854,18 +49034,19 @@ npmScopes:
|
|
|
46854
49034
|
};
|
|
46855
49035
|
delete configOutput.textReplacements;
|
|
46856
49036
|
delete configOutput.jsonActions;
|
|
46857
|
-
|
|
46858
|
-
const secretsConfigPath =
|
|
49037
|
+
fs6.writeFileSync(configPath, JSON.stringify(configOutput, null, 2), { encoding: "utf8" });
|
|
49038
|
+
const secretsConfigPath = path6.join(seekaDir, "init.app.secrets.seeka.cli.config.json");
|
|
46859
49039
|
const secretsConfigOutput = {
|
|
46860
49040
|
environmentVariables: environmentVariables || {}
|
|
46861
49041
|
};
|
|
46862
|
-
|
|
49042
|
+
fs6.writeFileSync(secretsConfigPath, JSON.stringify(secretsConfigOutput, null, 2), { encoding: "utf8" });
|
|
46863
49043
|
console.log("");
|
|
46864
49044
|
console.log("Installing AI context...");
|
|
46865
49045
|
try {
|
|
49046
|
+
let packageUrl = getContextPackageUrl(projectDir, options.contextPackageUrl);
|
|
46866
49047
|
await aiContextCommand({
|
|
46867
49048
|
targetDir: projectDir,
|
|
46868
|
-
contextPackageUrl:
|
|
49049
|
+
contextPackageUrl: packageUrl
|
|
46869
49050
|
});
|
|
46870
49051
|
} catch (err) {
|
|
46871
49052
|
console.warn("Warning: Failed to install AI context", err);
|
|
@@ -46874,7 +49055,7 @@ npmScopes:
|
|
|
46874
49055
|
console.log(`Created ${projectName} in ${projectDir}`);
|
|
46875
49056
|
console.log("Boom! Your new Seeka app is ready!");
|
|
46876
49057
|
writeSeparator();
|
|
46877
|
-
const relativePath = options.skipSubDir ? projectDir :
|
|
49058
|
+
const relativePath = options.skipSubDir ? projectDir : path6.relative(process.cwd(), projectDir);
|
|
46878
49059
|
console.log(`Run "cd ${relativePath}" to change to your apps directory and start creating some magic!`);
|
|
46879
49060
|
console.log("");
|
|
46880
49061
|
console.log("");
|
|
@@ -48009,7 +50190,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
48009
50190
|
// ../../node_modules/inquirer/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
48010
50191
|
var readline2 = __toESM(require("node:readline"), 1);
|
|
48011
50192
|
var import_node_async_hooks3 = require("node:async_hooks");
|
|
48012
|
-
var import_mute_stream = __toESM(
|
|
50193
|
+
var import_mute_stream = __toESM(require_lib5(), 1);
|
|
48013
50194
|
|
|
48014
50195
|
// ../../node_modules/inquirer/node_modules/signal-exit/dist/mjs/signals.js
|
|
48015
50196
|
var signals = [];
|
|
@@ -48632,13 +50813,13 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
48632
50813
|
});
|
|
48633
50814
|
|
|
48634
50815
|
// ../../node_modules/inquirer/node_modules/@inquirer/external-editor/dist/index.js
|
|
48635
|
-
var import_chardet = __toESM(
|
|
50816
|
+
var import_chardet = __toESM(require_lib6(), 1);
|
|
48636
50817
|
var import_child_process = require("child_process");
|
|
48637
50818
|
var import_fs2 = require("fs");
|
|
48638
50819
|
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
48639
50820
|
var import_node_os = __toESM(require("node:os"), 1);
|
|
48640
50821
|
var import_node_crypto = require("node:crypto");
|
|
48641
|
-
var import_iconv_lite = __toESM(
|
|
50822
|
+
var import_iconv_lite = __toESM(require_lib7(), 1);
|
|
48642
50823
|
|
|
48643
50824
|
// ../../node_modules/inquirer/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
|
|
48644
50825
|
var CreateFileError = class extends Error {
|
|
@@ -49711,11 +51892,11 @@ var dist_default11 = createPrompt((config, done) => {
|
|
|
49711
51892
|
var import_node_readline = __toESM(require("node:readline"), 1);
|
|
49712
51893
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
49713
51894
|
var import_run_async = __toESM(require_run_async(), 1);
|
|
49714
|
-
var import_mute_stream2 = __toESM(
|
|
51895
|
+
var import_mute_stream2 = __toESM(require_lib5(), 1);
|
|
49715
51896
|
var _ = {
|
|
49716
|
-
set: (obj,
|
|
51897
|
+
set: (obj, path8 = "", value) => {
|
|
49717
51898
|
let pointer = obj;
|
|
49718
|
-
|
|
51899
|
+
path8.split(".").forEach((key, index2, arr) => {
|
|
49719
51900
|
if (key === "__proto__" || key === "constructor")
|
|
49720
51901
|
return;
|
|
49721
51902
|
if (index2 === arr.length - 1) {
|
|
@@ -49726,8 +51907,8 @@ var _ = {
|
|
|
49726
51907
|
pointer = pointer[key];
|
|
49727
51908
|
});
|
|
49728
51909
|
},
|
|
49729
|
-
get: (obj,
|
|
49730
|
-
const travel = (regexp) => String.prototype.split.call(
|
|
51910
|
+
get: (obj, path8 = "", defaultValue) => {
|
|
51911
|
+
const travel = (regexp) => String.prototype.split.call(path8, regexp).filter(Boolean).reduce(
|
|
49731
51912
|
// @ts-expect-error implicit any on res[key]
|
|
49732
51913
|
(res, key) => res == null ? res : res[key],
|
|
49733
51914
|
obj
|
|
@@ -50168,11 +52349,13 @@ async function runAiContextInteractive() {
|
|
|
50168
52349
|
type: "input",
|
|
50169
52350
|
name: "targetDir",
|
|
50170
52351
|
message: aiCommand.context.interactive.targetDir.message,
|
|
50171
|
-
default:
|
|
52352
|
+
default: process.cwd()
|
|
50172
52353
|
}
|
|
50173
52354
|
]);
|
|
52355
|
+
let packageUrl = getContextPackageUrl(answers.targetDir, void 0);
|
|
50174
52356
|
await aiContextCommand({
|
|
50175
|
-
targetDir: answers.targetDir || void 0
|
|
52357
|
+
targetDir: answers.targetDir || void 0,
|
|
52358
|
+
contextPackageUrl: packageUrl
|
|
50176
52359
|
});
|
|
50177
52360
|
}
|
|
50178
52361
|
async function runInitInteractive() {
|
|
@@ -50256,7 +52439,7 @@ async function runInitInteractive() {
|
|
|
50256
52439
|
type: "input",
|
|
50257
52440
|
name: "outDir",
|
|
50258
52441
|
message: initCommand.interactive.outDir.message,
|
|
50259
|
-
default:
|
|
52442
|
+
default: process.cwd()
|
|
50260
52443
|
},
|
|
50261
52444
|
// {
|
|
50262
52445
|
// type: 'select',
|
|
@@ -50366,15 +52549,16 @@ var buildProgram = () => {
|
|
|
50366
52549
|
// appSettings: options.appSettings ? map(stringArrayToMap(options.appSettings), (k, v) => { return { name: k } }) : [],
|
|
50367
52550
|
npmUsername: options.npmUsername,
|
|
50368
52551
|
npmPassword: options.npmPassword,
|
|
50369
|
-
contextPackageUrl: options.contextPackageUrl
|
|
52552
|
+
contextPackageUrl: getContextPackageUrl(void 0, options.contextPackageUrl)
|
|
50370
52553
|
};
|
|
50371
52554
|
await initCommandV2(initOptions);
|
|
50372
52555
|
}).showHelpAfterError(true);
|
|
50373
52556
|
const aiCmd = program2.command("ai").description(aiCommand.description);
|
|
50374
52557
|
aiCmd.command("context").description(aiCommand.context.description).option("--target <directory>", aiCommand.context.options.target.description).addOption(new Option("--contextPackageUrl <url>", aiCommand.context.options.contextPackageUrl.description).hideHelp()).action(async (options) => {
|
|
52558
|
+
let packageUrl = getContextPackageUrl(options.target, options.contextPackageUrl);
|
|
50375
52559
|
await aiContextCommand({
|
|
50376
52560
|
targetDir: options.target,
|
|
50377
|
-
contextPackageUrl:
|
|
52561
|
+
contextPackageUrl: packageUrl
|
|
50378
52562
|
});
|
|
50379
52563
|
}).showHelpAfterError(true);
|
|
50380
52564
|
program2.showHelpAfterError(true);
|
|
@@ -50384,7 +52568,7 @@ var main = async (argv = process.argv) => {
|
|
|
50384
52568
|
showSeekaLogo();
|
|
50385
52569
|
const program2 = buildProgram();
|
|
50386
52570
|
if (argv.length <= 2) {
|
|
50387
|
-
runInteractive();
|
|
52571
|
+
await runInteractive();
|
|
50388
52572
|
} else {
|
|
50389
52573
|
await program2.parseAsync(argv);
|
|
50390
52574
|
}
|