@meltstudio/meltctl 5.20.0 → 5.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/index.js +583 -846
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1726,8 +1726,8 @@ var require_command = __commonJS({
|
|
|
1726
1726
|
"use strict";
|
|
1727
1727
|
var EventEmitter = __require("events").EventEmitter;
|
|
1728
1728
|
var childProcess = __require("child_process");
|
|
1729
|
-
var
|
|
1730
|
-
var
|
|
1729
|
+
var path10 = __require("path");
|
|
1730
|
+
var fs6 = __require("fs");
|
|
1731
1731
|
var process7 = __require("process");
|
|
1732
1732
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1733
1733
|
var { CommanderError: CommanderError2 } = require_error();
|
|
@@ -2722,7 +2722,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2722
2722
|
* @param {string} subcommandName
|
|
2723
2723
|
*/
|
|
2724
2724
|
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
2725
|
-
if (
|
|
2725
|
+
if (fs6.existsSync(executableFile)) return;
|
|
2726
2726
|
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";
|
|
2727
2727
|
const executableMissing = `'${executableFile}' does not exist
|
|
2728
2728
|
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
@@ -2740,11 +2740,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2740
2740
|
let launchWithNode = false;
|
|
2741
2741
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
2742
2742
|
function findFile(baseDir, baseName) {
|
|
2743
|
-
const localBin =
|
|
2744
|
-
if (
|
|
2745
|
-
if (sourceExt.includes(
|
|
2743
|
+
const localBin = path10.resolve(baseDir, baseName);
|
|
2744
|
+
if (fs6.existsSync(localBin)) return localBin;
|
|
2745
|
+
if (sourceExt.includes(path10.extname(baseName))) return void 0;
|
|
2746
2746
|
const foundExt = sourceExt.find(
|
|
2747
|
-
(ext) =>
|
|
2747
|
+
(ext) => fs6.existsSync(`${localBin}${ext}`)
|
|
2748
2748
|
);
|
|
2749
2749
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
2750
2750
|
return void 0;
|
|
@@ -2756,21 +2756,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2756
2756
|
if (this._scriptPath) {
|
|
2757
2757
|
let resolvedScriptPath;
|
|
2758
2758
|
try {
|
|
2759
|
-
resolvedScriptPath =
|
|
2759
|
+
resolvedScriptPath = fs6.realpathSync(this._scriptPath);
|
|
2760
2760
|
} catch {
|
|
2761
2761
|
resolvedScriptPath = this._scriptPath;
|
|
2762
2762
|
}
|
|
2763
|
-
executableDir =
|
|
2764
|
-
|
|
2763
|
+
executableDir = path10.resolve(
|
|
2764
|
+
path10.dirname(resolvedScriptPath),
|
|
2765
2765
|
executableDir
|
|
2766
2766
|
);
|
|
2767
2767
|
}
|
|
2768
2768
|
if (executableDir) {
|
|
2769
2769
|
let localFile = findFile(executableDir, executableFile);
|
|
2770
2770
|
if (!localFile && !subcommand._executableFile && this._scriptPath) {
|
|
2771
|
-
const legacyName =
|
|
2771
|
+
const legacyName = path10.basename(
|
|
2772
2772
|
this._scriptPath,
|
|
2773
|
-
|
|
2773
|
+
path10.extname(this._scriptPath)
|
|
2774
2774
|
);
|
|
2775
2775
|
if (legacyName !== this._name) {
|
|
2776
2776
|
localFile = findFile(
|
|
@@ -2781,7 +2781,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2781
2781
|
}
|
|
2782
2782
|
executableFile = localFile || executableFile;
|
|
2783
2783
|
}
|
|
2784
|
-
launchWithNode = sourceExt.includes(
|
|
2784
|
+
launchWithNode = sourceExt.includes(path10.extname(executableFile));
|
|
2785
2785
|
let proc;
|
|
2786
2786
|
if (process7.platform !== "win32") {
|
|
2787
2787
|
if (launchWithNode) {
|
|
@@ -3697,7 +3697,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3697
3697
|
* @return {Command}
|
|
3698
3698
|
*/
|
|
3699
3699
|
nameFromFilename(filename) {
|
|
3700
|
-
this._name =
|
|
3700
|
+
this._name = path10.basename(filename, path10.extname(filename));
|
|
3701
3701
|
return this;
|
|
3702
3702
|
}
|
|
3703
3703
|
/**
|
|
@@ -3711,9 +3711,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3711
3711
|
* @param {string} [path]
|
|
3712
3712
|
* @return {(string|null|Command)}
|
|
3713
3713
|
*/
|
|
3714
|
-
executableDir(
|
|
3715
|
-
if (
|
|
3716
|
-
this._executableDir =
|
|
3714
|
+
executableDir(path11) {
|
|
3715
|
+
if (path11 === void 0) return this._executableDir;
|
|
3716
|
+
this._executableDir = path11;
|
|
3717
3717
|
return this;
|
|
3718
3718
|
}
|
|
3719
3719
|
/**
|
|
@@ -4067,54 +4067,54 @@ var require_polyfills = __commonJS({
|
|
|
4067
4067
|
}
|
|
4068
4068
|
var chdir;
|
|
4069
4069
|
module.exports = patch;
|
|
4070
|
-
function patch(
|
|
4070
|
+
function patch(fs6) {
|
|
4071
4071
|
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
4072
|
-
patchLchmod(
|
|
4073
|
-
}
|
|
4074
|
-
if (!
|
|
4075
|
-
patchLutimes(
|
|
4076
|
-
}
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
if (
|
|
4096
|
-
|
|
4072
|
+
patchLchmod(fs6);
|
|
4073
|
+
}
|
|
4074
|
+
if (!fs6.lutimes) {
|
|
4075
|
+
patchLutimes(fs6);
|
|
4076
|
+
}
|
|
4077
|
+
fs6.chown = chownFix(fs6.chown);
|
|
4078
|
+
fs6.fchown = chownFix(fs6.fchown);
|
|
4079
|
+
fs6.lchown = chownFix(fs6.lchown);
|
|
4080
|
+
fs6.chmod = chmodFix(fs6.chmod);
|
|
4081
|
+
fs6.fchmod = chmodFix(fs6.fchmod);
|
|
4082
|
+
fs6.lchmod = chmodFix(fs6.lchmod);
|
|
4083
|
+
fs6.chownSync = chownFixSync(fs6.chownSync);
|
|
4084
|
+
fs6.fchownSync = chownFixSync(fs6.fchownSync);
|
|
4085
|
+
fs6.lchownSync = chownFixSync(fs6.lchownSync);
|
|
4086
|
+
fs6.chmodSync = chmodFixSync(fs6.chmodSync);
|
|
4087
|
+
fs6.fchmodSync = chmodFixSync(fs6.fchmodSync);
|
|
4088
|
+
fs6.lchmodSync = chmodFixSync(fs6.lchmodSync);
|
|
4089
|
+
fs6.stat = statFix(fs6.stat);
|
|
4090
|
+
fs6.fstat = statFix(fs6.fstat);
|
|
4091
|
+
fs6.lstat = statFix(fs6.lstat);
|
|
4092
|
+
fs6.statSync = statFixSync(fs6.statSync);
|
|
4093
|
+
fs6.fstatSync = statFixSync(fs6.fstatSync);
|
|
4094
|
+
fs6.lstatSync = statFixSync(fs6.lstatSync);
|
|
4095
|
+
if (fs6.chmod && !fs6.lchmod) {
|
|
4096
|
+
fs6.lchmod = function(path10, mode, cb) {
|
|
4097
4097
|
if (cb) process.nextTick(cb);
|
|
4098
4098
|
};
|
|
4099
|
-
|
|
4099
|
+
fs6.lchmodSync = function() {
|
|
4100
4100
|
};
|
|
4101
4101
|
}
|
|
4102
|
-
if (
|
|
4103
|
-
|
|
4102
|
+
if (fs6.chown && !fs6.lchown) {
|
|
4103
|
+
fs6.lchown = function(path10, uid, gid, cb) {
|
|
4104
4104
|
if (cb) process.nextTick(cb);
|
|
4105
4105
|
};
|
|
4106
|
-
|
|
4106
|
+
fs6.lchownSync = function() {
|
|
4107
4107
|
};
|
|
4108
4108
|
}
|
|
4109
4109
|
if (platform === "win32") {
|
|
4110
|
-
|
|
4110
|
+
fs6.rename = typeof fs6.rename !== "function" ? fs6.rename : (function(fs$rename) {
|
|
4111
4111
|
function rename(from, to, cb) {
|
|
4112
4112
|
var start = Date.now();
|
|
4113
4113
|
var backoff = 0;
|
|
4114
4114
|
fs$rename(from, to, function CB(er) {
|
|
4115
4115
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
4116
4116
|
setTimeout(function() {
|
|
4117
|
-
|
|
4117
|
+
fs6.stat(to, function(stater, st) {
|
|
4118
4118
|
if (stater && stater.code === "ENOENT")
|
|
4119
4119
|
fs$rename(from, to, CB);
|
|
4120
4120
|
else
|
|
@@ -4130,9 +4130,9 @@ var require_polyfills = __commonJS({
|
|
|
4130
4130
|
}
|
|
4131
4131
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
4132
4132
|
return rename;
|
|
4133
|
-
})(
|
|
4133
|
+
})(fs6.rename);
|
|
4134
4134
|
}
|
|
4135
|
-
|
|
4135
|
+
fs6.read = typeof fs6.read !== "function" ? fs6.read : (function(fs$read) {
|
|
4136
4136
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
4137
4137
|
var callback;
|
|
4138
4138
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -4140,22 +4140,22 @@ var require_polyfills = __commonJS({
|
|
|
4140
4140
|
callback = function(er, _, __) {
|
|
4141
4141
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
4142
4142
|
eagCounter++;
|
|
4143
|
-
return fs$read.call(
|
|
4143
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
4144
4144
|
}
|
|
4145
4145
|
callback_.apply(this, arguments);
|
|
4146
4146
|
};
|
|
4147
4147
|
}
|
|
4148
|
-
return fs$read.call(
|
|
4148
|
+
return fs$read.call(fs6, fd, buffer, offset, length, position, callback);
|
|
4149
4149
|
}
|
|
4150
4150
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
4151
4151
|
return read;
|
|
4152
|
-
})(
|
|
4153
|
-
|
|
4152
|
+
})(fs6.read);
|
|
4153
|
+
fs6.readSync = typeof fs6.readSync !== "function" ? fs6.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
4154
4154
|
return function(fd, buffer, offset, length, position) {
|
|
4155
4155
|
var eagCounter = 0;
|
|
4156
4156
|
while (true) {
|
|
4157
4157
|
try {
|
|
4158
|
-
return fs$readSync.call(
|
|
4158
|
+
return fs$readSync.call(fs6, fd, buffer, offset, length, position);
|
|
4159
4159
|
} catch (er) {
|
|
4160
4160
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
4161
4161
|
eagCounter++;
|
|
@@ -4165,11 +4165,11 @@ var require_polyfills = __commonJS({
|
|
|
4165
4165
|
}
|
|
4166
4166
|
}
|
|
4167
4167
|
};
|
|
4168
|
-
})(
|
|
4169
|
-
function patchLchmod(
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4168
|
+
})(fs6.readSync);
|
|
4169
|
+
function patchLchmod(fs7) {
|
|
4170
|
+
fs7.lchmod = function(path10, mode, callback) {
|
|
4171
|
+
fs7.open(
|
|
4172
|
+
path10,
|
|
4173
4173
|
constants.O_WRONLY | constants.O_SYMLINK,
|
|
4174
4174
|
mode,
|
|
4175
4175
|
function(err, fd) {
|
|
@@ -4177,80 +4177,80 @@ var require_polyfills = __commonJS({
|
|
|
4177
4177
|
if (callback) callback(err);
|
|
4178
4178
|
return;
|
|
4179
4179
|
}
|
|
4180
|
-
|
|
4181
|
-
|
|
4180
|
+
fs7.fchmod(fd, mode, function(err2) {
|
|
4181
|
+
fs7.close(fd, function(err22) {
|
|
4182
4182
|
if (callback) callback(err2 || err22);
|
|
4183
4183
|
});
|
|
4184
4184
|
});
|
|
4185
4185
|
}
|
|
4186
4186
|
);
|
|
4187
4187
|
};
|
|
4188
|
-
|
|
4189
|
-
var fd =
|
|
4188
|
+
fs7.lchmodSync = function(path10, mode) {
|
|
4189
|
+
var fd = fs7.openSync(path10, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
4190
4190
|
var threw = true;
|
|
4191
4191
|
var ret;
|
|
4192
4192
|
try {
|
|
4193
|
-
ret =
|
|
4193
|
+
ret = fs7.fchmodSync(fd, mode);
|
|
4194
4194
|
threw = false;
|
|
4195
4195
|
} finally {
|
|
4196
4196
|
if (threw) {
|
|
4197
4197
|
try {
|
|
4198
|
-
|
|
4198
|
+
fs7.closeSync(fd);
|
|
4199
4199
|
} catch (er) {
|
|
4200
4200
|
}
|
|
4201
4201
|
} else {
|
|
4202
|
-
|
|
4202
|
+
fs7.closeSync(fd);
|
|
4203
4203
|
}
|
|
4204
4204
|
}
|
|
4205
4205
|
return ret;
|
|
4206
4206
|
};
|
|
4207
4207
|
}
|
|
4208
|
-
function patchLutimes(
|
|
4209
|
-
if (constants.hasOwnProperty("O_SYMLINK") &&
|
|
4210
|
-
|
|
4211
|
-
|
|
4208
|
+
function patchLutimes(fs7) {
|
|
4209
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs7.futimes) {
|
|
4210
|
+
fs7.lutimes = function(path10, at, mt, cb) {
|
|
4211
|
+
fs7.open(path10, constants.O_SYMLINK, function(er, fd) {
|
|
4212
4212
|
if (er) {
|
|
4213
4213
|
if (cb) cb(er);
|
|
4214
4214
|
return;
|
|
4215
4215
|
}
|
|
4216
|
-
|
|
4217
|
-
|
|
4216
|
+
fs7.futimes(fd, at, mt, function(er2) {
|
|
4217
|
+
fs7.close(fd, function(er22) {
|
|
4218
4218
|
if (cb) cb(er2 || er22);
|
|
4219
4219
|
});
|
|
4220
4220
|
});
|
|
4221
4221
|
});
|
|
4222
4222
|
};
|
|
4223
|
-
|
|
4224
|
-
var fd =
|
|
4223
|
+
fs7.lutimesSync = function(path10, at, mt) {
|
|
4224
|
+
var fd = fs7.openSync(path10, constants.O_SYMLINK);
|
|
4225
4225
|
var ret;
|
|
4226
4226
|
var threw = true;
|
|
4227
4227
|
try {
|
|
4228
|
-
ret =
|
|
4228
|
+
ret = fs7.futimesSync(fd, at, mt);
|
|
4229
4229
|
threw = false;
|
|
4230
4230
|
} finally {
|
|
4231
4231
|
if (threw) {
|
|
4232
4232
|
try {
|
|
4233
|
-
|
|
4233
|
+
fs7.closeSync(fd);
|
|
4234
4234
|
} catch (er) {
|
|
4235
4235
|
}
|
|
4236
4236
|
} else {
|
|
4237
|
-
|
|
4237
|
+
fs7.closeSync(fd);
|
|
4238
4238
|
}
|
|
4239
4239
|
}
|
|
4240
4240
|
return ret;
|
|
4241
4241
|
};
|
|
4242
|
-
} else if (
|
|
4243
|
-
|
|
4242
|
+
} else if (fs7.futimes) {
|
|
4243
|
+
fs7.lutimes = function(_a3, _b, _c, cb) {
|
|
4244
4244
|
if (cb) process.nextTick(cb);
|
|
4245
4245
|
};
|
|
4246
|
-
|
|
4246
|
+
fs7.lutimesSync = function() {
|
|
4247
4247
|
};
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
4250
|
function chmodFix(orig) {
|
|
4251
4251
|
if (!orig) return orig;
|
|
4252
4252
|
return function(target, mode, cb) {
|
|
4253
|
-
return orig.call(
|
|
4253
|
+
return orig.call(fs6, target, mode, function(er) {
|
|
4254
4254
|
if (chownErOk(er)) er = null;
|
|
4255
4255
|
if (cb) cb.apply(this, arguments);
|
|
4256
4256
|
});
|
|
@@ -4260,7 +4260,7 @@ var require_polyfills = __commonJS({
|
|
|
4260
4260
|
if (!orig) return orig;
|
|
4261
4261
|
return function(target, mode) {
|
|
4262
4262
|
try {
|
|
4263
|
-
return orig.call(
|
|
4263
|
+
return orig.call(fs6, target, mode);
|
|
4264
4264
|
} catch (er) {
|
|
4265
4265
|
if (!chownErOk(er)) throw er;
|
|
4266
4266
|
}
|
|
@@ -4269,7 +4269,7 @@ var require_polyfills = __commonJS({
|
|
|
4269
4269
|
function chownFix(orig) {
|
|
4270
4270
|
if (!orig) return orig;
|
|
4271
4271
|
return function(target, uid, gid, cb) {
|
|
4272
|
-
return orig.call(
|
|
4272
|
+
return orig.call(fs6, target, uid, gid, function(er) {
|
|
4273
4273
|
if (chownErOk(er)) er = null;
|
|
4274
4274
|
if (cb) cb.apply(this, arguments);
|
|
4275
4275
|
});
|
|
@@ -4279,7 +4279,7 @@ var require_polyfills = __commonJS({
|
|
|
4279
4279
|
if (!orig) return orig;
|
|
4280
4280
|
return function(target, uid, gid) {
|
|
4281
4281
|
try {
|
|
4282
|
-
return orig.call(
|
|
4282
|
+
return orig.call(fs6, target, uid, gid);
|
|
4283
4283
|
} catch (er) {
|
|
4284
4284
|
if (!chownErOk(er)) throw er;
|
|
4285
4285
|
}
|
|
@@ -4299,13 +4299,13 @@ var require_polyfills = __commonJS({
|
|
|
4299
4299
|
}
|
|
4300
4300
|
if (cb) cb.apply(this, arguments);
|
|
4301
4301
|
}
|
|
4302
|
-
return options ? orig.call(
|
|
4302
|
+
return options ? orig.call(fs6, target, options, callback) : orig.call(fs6, target, callback);
|
|
4303
4303
|
};
|
|
4304
4304
|
}
|
|
4305
4305
|
function statFixSync(orig) {
|
|
4306
4306
|
if (!orig) return orig;
|
|
4307
4307
|
return function(target, options) {
|
|
4308
|
-
var stats = options ? orig.call(
|
|
4308
|
+
var stats = options ? orig.call(fs6, target, options) : orig.call(fs6, target);
|
|
4309
4309
|
if (stats) {
|
|
4310
4310
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
4311
4311
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -4335,16 +4335,16 @@ var require_legacy_streams = __commonJS({
|
|
|
4335
4335
|
"use strict";
|
|
4336
4336
|
var Stream = __require("stream").Stream;
|
|
4337
4337
|
module.exports = legacy;
|
|
4338
|
-
function legacy(
|
|
4338
|
+
function legacy(fs6) {
|
|
4339
4339
|
return {
|
|
4340
4340
|
ReadStream,
|
|
4341
4341
|
WriteStream
|
|
4342
4342
|
};
|
|
4343
|
-
function ReadStream(
|
|
4344
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
4343
|
+
function ReadStream(path10, options) {
|
|
4344
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path10, options);
|
|
4345
4345
|
Stream.call(this);
|
|
4346
4346
|
var self2 = this;
|
|
4347
|
-
this.path =
|
|
4347
|
+
this.path = path10;
|
|
4348
4348
|
this.fd = null;
|
|
4349
4349
|
this.readable = true;
|
|
4350
4350
|
this.paused = false;
|
|
@@ -4378,7 +4378,7 @@ var require_legacy_streams = __commonJS({
|
|
|
4378
4378
|
});
|
|
4379
4379
|
return;
|
|
4380
4380
|
}
|
|
4381
|
-
|
|
4381
|
+
fs6.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
4382
4382
|
if (err) {
|
|
4383
4383
|
self2.emit("error", err);
|
|
4384
4384
|
self2.readable = false;
|
|
@@ -4389,10 +4389,10 @@ var require_legacy_streams = __commonJS({
|
|
|
4389
4389
|
self2._read();
|
|
4390
4390
|
});
|
|
4391
4391
|
}
|
|
4392
|
-
function WriteStream(
|
|
4393
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
4392
|
+
function WriteStream(path10, options) {
|
|
4393
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path10, options);
|
|
4394
4394
|
Stream.call(this);
|
|
4395
|
-
this.path =
|
|
4395
|
+
this.path = path10;
|
|
4396
4396
|
this.fd = null;
|
|
4397
4397
|
this.writable = true;
|
|
4398
4398
|
this.flags = "w";
|
|
@@ -4417,7 +4417,7 @@ var require_legacy_streams = __commonJS({
|
|
|
4417
4417
|
this.busy = false;
|
|
4418
4418
|
this._queue = [];
|
|
4419
4419
|
if (this.fd === null) {
|
|
4420
|
-
this._open =
|
|
4420
|
+
this._open = fs6.open;
|
|
4421
4421
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
4422
4422
|
this.flush();
|
|
4423
4423
|
}
|
|
@@ -4453,7 +4453,7 @@ var require_clone = __commonJS({
|
|
|
4453
4453
|
var require_graceful_fs = __commonJS({
|
|
4454
4454
|
"../../node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
4455
4455
|
"use strict";
|
|
4456
|
-
var
|
|
4456
|
+
var fs6 = __require("fs");
|
|
4457
4457
|
var polyfills = require_polyfills();
|
|
4458
4458
|
var legacy = require_legacy_streams();
|
|
4459
4459
|
var clone2 = require_clone();
|
|
@@ -4485,12 +4485,12 @@ var require_graceful_fs = __commonJS({
|
|
|
4485
4485
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
4486
4486
|
console.error(m);
|
|
4487
4487
|
};
|
|
4488
|
-
if (!
|
|
4488
|
+
if (!fs6[gracefulQueue]) {
|
|
4489
4489
|
queue = global[gracefulQueue] || [];
|
|
4490
|
-
publishQueue(
|
|
4491
|
-
|
|
4490
|
+
publishQueue(fs6, queue);
|
|
4491
|
+
fs6.close = (function(fs$close) {
|
|
4492
4492
|
function close(fd, cb) {
|
|
4493
|
-
return fs$close.call(
|
|
4493
|
+
return fs$close.call(fs6, fd, function(err) {
|
|
4494
4494
|
if (!err) {
|
|
4495
4495
|
resetQueue();
|
|
4496
4496
|
}
|
|
@@ -4502,48 +4502,48 @@ var require_graceful_fs = __commonJS({
|
|
|
4502
4502
|
value: fs$close
|
|
4503
4503
|
});
|
|
4504
4504
|
return close;
|
|
4505
|
-
})(
|
|
4506
|
-
|
|
4505
|
+
})(fs6.close);
|
|
4506
|
+
fs6.closeSync = (function(fs$closeSync) {
|
|
4507
4507
|
function closeSync(fd) {
|
|
4508
|
-
fs$closeSync.apply(
|
|
4508
|
+
fs$closeSync.apply(fs6, arguments);
|
|
4509
4509
|
resetQueue();
|
|
4510
4510
|
}
|
|
4511
4511
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
4512
4512
|
value: fs$closeSync
|
|
4513
4513
|
});
|
|
4514
4514
|
return closeSync;
|
|
4515
|
-
})(
|
|
4515
|
+
})(fs6.closeSync);
|
|
4516
4516
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
4517
4517
|
process.on("exit", function() {
|
|
4518
|
-
debug(
|
|
4519
|
-
__require("assert").equal(
|
|
4518
|
+
debug(fs6[gracefulQueue]);
|
|
4519
|
+
__require("assert").equal(fs6[gracefulQueue].length, 0);
|
|
4520
4520
|
});
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
4523
|
var queue;
|
|
4524
4524
|
if (!global[gracefulQueue]) {
|
|
4525
|
-
publishQueue(global,
|
|
4526
|
-
}
|
|
4527
|
-
module.exports = patch(clone2(
|
|
4528
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
4529
|
-
module.exports = patch(
|
|
4530
|
-
|
|
4531
|
-
}
|
|
4532
|
-
function patch(
|
|
4533
|
-
polyfills(
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
var fs$readFile =
|
|
4538
|
-
|
|
4539
|
-
function readFile2(
|
|
4525
|
+
publishQueue(global, fs6[gracefulQueue]);
|
|
4526
|
+
}
|
|
4527
|
+
module.exports = patch(clone2(fs6));
|
|
4528
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs6.__patched) {
|
|
4529
|
+
module.exports = patch(fs6);
|
|
4530
|
+
fs6.__patched = true;
|
|
4531
|
+
}
|
|
4532
|
+
function patch(fs7) {
|
|
4533
|
+
polyfills(fs7);
|
|
4534
|
+
fs7.gracefulify = patch;
|
|
4535
|
+
fs7.createReadStream = createReadStream;
|
|
4536
|
+
fs7.createWriteStream = createWriteStream;
|
|
4537
|
+
var fs$readFile = fs7.readFile;
|
|
4538
|
+
fs7.readFile = readFile2;
|
|
4539
|
+
function readFile2(path10, options, cb) {
|
|
4540
4540
|
if (typeof options === "function")
|
|
4541
4541
|
cb = options, options = null;
|
|
4542
|
-
return go$readFile(
|
|
4543
|
-
function go$readFile(
|
|
4544
|
-
return fs$readFile(
|
|
4542
|
+
return go$readFile(path10, options, cb);
|
|
4543
|
+
function go$readFile(path11, options2, cb2, startTime) {
|
|
4544
|
+
return fs$readFile(path11, options2, function(err) {
|
|
4545
4545
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4546
|
-
enqueue([go$readFile, [
|
|
4546
|
+
enqueue([go$readFile, [path11, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4547
4547
|
else {
|
|
4548
4548
|
if (typeof cb2 === "function")
|
|
4549
4549
|
cb2.apply(this, arguments);
|
|
@@ -4551,16 +4551,16 @@ var require_graceful_fs = __commonJS({
|
|
|
4551
4551
|
});
|
|
4552
4552
|
}
|
|
4553
4553
|
}
|
|
4554
|
-
var fs$writeFile =
|
|
4555
|
-
|
|
4556
|
-
function writeFile(
|
|
4554
|
+
var fs$writeFile = fs7.writeFile;
|
|
4555
|
+
fs7.writeFile = writeFile;
|
|
4556
|
+
function writeFile(path10, data, options, cb) {
|
|
4557
4557
|
if (typeof options === "function")
|
|
4558
4558
|
cb = options, options = null;
|
|
4559
|
-
return go$writeFile(
|
|
4560
|
-
function go$writeFile(
|
|
4561
|
-
return fs$writeFile(
|
|
4559
|
+
return go$writeFile(path10, data, options, cb);
|
|
4560
|
+
function go$writeFile(path11, data2, options2, cb2, startTime) {
|
|
4561
|
+
return fs$writeFile(path11, data2, options2, function(err) {
|
|
4562
4562
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4563
|
-
enqueue([go$writeFile, [
|
|
4563
|
+
enqueue([go$writeFile, [path11, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4564
4564
|
else {
|
|
4565
4565
|
if (typeof cb2 === "function")
|
|
4566
4566
|
cb2.apply(this, arguments);
|
|
@@ -4568,17 +4568,17 @@ var require_graceful_fs = __commonJS({
|
|
|
4568
4568
|
});
|
|
4569
4569
|
}
|
|
4570
4570
|
}
|
|
4571
|
-
var fs$appendFile =
|
|
4571
|
+
var fs$appendFile = fs7.appendFile;
|
|
4572
4572
|
if (fs$appendFile)
|
|
4573
|
-
|
|
4574
|
-
function appendFile(
|
|
4573
|
+
fs7.appendFile = appendFile;
|
|
4574
|
+
function appendFile(path10, data, options, cb) {
|
|
4575
4575
|
if (typeof options === "function")
|
|
4576
4576
|
cb = options, options = null;
|
|
4577
|
-
return go$appendFile(
|
|
4578
|
-
function go$appendFile(
|
|
4579
|
-
return fs$appendFile(
|
|
4577
|
+
return go$appendFile(path10, data, options, cb);
|
|
4578
|
+
function go$appendFile(path11, data2, options2, cb2, startTime) {
|
|
4579
|
+
return fs$appendFile(path11, data2, options2, function(err) {
|
|
4580
4580
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4581
|
-
enqueue([go$appendFile, [
|
|
4581
|
+
enqueue([go$appendFile, [path11, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4582
4582
|
else {
|
|
4583
4583
|
if (typeof cb2 === "function")
|
|
4584
4584
|
cb2.apply(this, arguments);
|
|
@@ -4586,9 +4586,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4586
4586
|
});
|
|
4587
4587
|
}
|
|
4588
4588
|
}
|
|
4589
|
-
var fs$copyFile =
|
|
4589
|
+
var fs$copyFile = fs7.copyFile;
|
|
4590
4590
|
if (fs$copyFile)
|
|
4591
|
-
|
|
4591
|
+
fs7.copyFile = copyFile;
|
|
4592
4592
|
function copyFile(src, dest, flags, cb) {
|
|
4593
4593
|
if (typeof flags === "function") {
|
|
4594
4594
|
cb = flags;
|
|
@@ -4606,34 +4606,34 @@ var require_graceful_fs = __commonJS({
|
|
|
4606
4606
|
});
|
|
4607
4607
|
}
|
|
4608
4608
|
}
|
|
4609
|
-
var fs$readdir =
|
|
4610
|
-
|
|
4609
|
+
var fs$readdir = fs7.readdir;
|
|
4610
|
+
fs7.readdir = readdir;
|
|
4611
4611
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
4612
|
-
function readdir(
|
|
4612
|
+
function readdir(path10, options, cb) {
|
|
4613
4613
|
if (typeof options === "function")
|
|
4614
4614
|
cb = options, options = null;
|
|
4615
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
4616
|
-
return fs$readdir(
|
|
4617
|
-
|
|
4615
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path11, options2, cb2, startTime) {
|
|
4616
|
+
return fs$readdir(path11, fs$readdirCallback(
|
|
4617
|
+
path11,
|
|
4618
4618
|
options2,
|
|
4619
4619
|
cb2,
|
|
4620
4620
|
startTime
|
|
4621
4621
|
));
|
|
4622
|
-
} : function go$readdir2(
|
|
4623
|
-
return fs$readdir(
|
|
4624
|
-
|
|
4622
|
+
} : function go$readdir2(path11, options2, cb2, startTime) {
|
|
4623
|
+
return fs$readdir(path11, options2, fs$readdirCallback(
|
|
4624
|
+
path11,
|
|
4625
4625
|
options2,
|
|
4626
4626
|
cb2,
|
|
4627
4627
|
startTime
|
|
4628
4628
|
));
|
|
4629
4629
|
};
|
|
4630
|
-
return go$readdir(
|
|
4631
|
-
function fs$readdirCallback(
|
|
4630
|
+
return go$readdir(path10, options, cb);
|
|
4631
|
+
function fs$readdirCallback(path11, options2, cb2, startTime) {
|
|
4632
4632
|
return function(err, files) {
|
|
4633
4633
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4634
4634
|
enqueue([
|
|
4635
4635
|
go$readdir,
|
|
4636
|
-
[
|
|
4636
|
+
[path11, options2, cb2],
|
|
4637
4637
|
err,
|
|
4638
4638
|
startTime || Date.now(),
|
|
4639
4639
|
Date.now()
|
|
@@ -4648,21 +4648,21 @@ var require_graceful_fs = __commonJS({
|
|
|
4648
4648
|
}
|
|
4649
4649
|
}
|
|
4650
4650
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
4651
|
-
var legStreams = legacy(
|
|
4651
|
+
var legStreams = legacy(fs7);
|
|
4652
4652
|
ReadStream = legStreams.ReadStream;
|
|
4653
4653
|
WriteStream = legStreams.WriteStream;
|
|
4654
4654
|
}
|
|
4655
|
-
var fs$ReadStream =
|
|
4655
|
+
var fs$ReadStream = fs7.ReadStream;
|
|
4656
4656
|
if (fs$ReadStream) {
|
|
4657
4657
|
ReadStream.prototype = Object.create(fs$ReadStream.prototype);
|
|
4658
4658
|
ReadStream.prototype.open = ReadStream$open;
|
|
4659
4659
|
}
|
|
4660
|
-
var fs$WriteStream =
|
|
4660
|
+
var fs$WriteStream = fs7.WriteStream;
|
|
4661
4661
|
if (fs$WriteStream) {
|
|
4662
4662
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
4663
4663
|
WriteStream.prototype.open = WriteStream$open;
|
|
4664
4664
|
}
|
|
4665
|
-
Object.defineProperty(
|
|
4665
|
+
Object.defineProperty(fs7, "ReadStream", {
|
|
4666
4666
|
get: function() {
|
|
4667
4667
|
return ReadStream;
|
|
4668
4668
|
},
|
|
@@ -4672,7 +4672,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4672
4672
|
enumerable: true,
|
|
4673
4673
|
configurable: true
|
|
4674
4674
|
});
|
|
4675
|
-
Object.defineProperty(
|
|
4675
|
+
Object.defineProperty(fs7, "WriteStream", {
|
|
4676
4676
|
get: function() {
|
|
4677
4677
|
return WriteStream;
|
|
4678
4678
|
},
|
|
@@ -4683,7 +4683,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4683
4683
|
configurable: true
|
|
4684
4684
|
});
|
|
4685
4685
|
var FileReadStream = ReadStream;
|
|
4686
|
-
Object.defineProperty(
|
|
4686
|
+
Object.defineProperty(fs7, "FileReadStream", {
|
|
4687
4687
|
get: function() {
|
|
4688
4688
|
return FileReadStream;
|
|
4689
4689
|
},
|
|
@@ -4694,7 +4694,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4694
4694
|
configurable: true
|
|
4695
4695
|
});
|
|
4696
4696
|
var FileWriteStream = WriteStream;
|
|
4697
|
-
Object.defineProperty(
|
|
4697
|
+
Object.defineProperty(fs7, "FileWriteStream", {
|
|
4698
4698
|
get: function() {
|
|
4699
4699
|
return FileWriteStream;
|
|
4700
4700
|
},
|
|
@@ -4704,7 +4704,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4704
4704
|
enumerable: true,
|
|
4705
4705
|
configurable: true
|
|
4706
4706
|
});
|
|
4707
|
-
function ReadStream(
|
|
4707
|
+
function ReadStream(path10, options) {
|
|
4708
4708
|
if (this instanceof ReadStream)
|
|
4709
4709
|
return fs$ReadStream.apply(this, arguments), this;
|
|
4710
4710
|
else
|
|
@@ -4724,7 +4724,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4724
4724
|
}
|
|
4725
4725
|
});
|
|
4726
4726
|
}
|
|
4727
|
-
function WriteStream(
|
|
4727
|
+
function WriteStream(path10, options) {
|
|
4728
4728
|
if (this instanceof WriteStream)
|
|
4729
4729
|
return fs$WriteStream.apply(this, arguments), this;
|
|
4730
4730
|
else
|
|
@@ -4742,22 +4742,22 @@ var require_graceful_fs = __commonJS({
|
|
|
4742
4742
|
}
|
|
4743
4743
|
});
|
|
4744
4744
|
}
|
|
4745
|
-
function createReadStream(
|
|
4746
|
-
return new
|
|
4745
|
+
function createReadStream(path10, options) {
|
|
4746
|
+
return new fs7.ReadStream(path10, options);
|
|
4747
4747
|
}
|
|
4748
|
-
function createWriteStream(
|
|
4749
|
-
return new
|
|
4748
|
+
function createWriteStream(path10, options) {
|
|
4749
|
+
return new fs7.WriteStream(path10, options);
|
|
4750
4750
|
}
|
|
4751
|
-
var fs$open =
|
|
4752
|
-
|
|
4753
|
-
function open(
|
|
4751
|
+
var fs$open = fs7.open;
|
|
4752
|
+
fs7.open = open;
|
|
4753
|
+
function open(path10, flags, mode, cb) {
|
|
4754
4754
|
if (typeof mode === "function")
|
|
4755
4755
|
cb = mode, mode = null;
|
|
4756
|
-
return go$open(
|
|
4757
|
-
function go$open(
|
|
4758
|
-
return fs$open(
|
|
4756
|
+
return go$open(path10, flags, mode, cb);
|
|
4757
|
+
function go$open(path11, flags2, mode2, cb2, startTime) {
|
|
4758
|
+
return fs$open(path11, flags2, mode2, function(err, fd) {
|
|
4759
4759
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
4760
|
-
enqueue([go$open, [
|
|
4760
|
+
enqueue([go$open, [path11, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
4761
4761
|
else {
|
|
4762
4762
|
if (typeof cb2 === "function")
|
|
4763
4763
|
cb2.apply(this, arguments);
|
|
@@ -4765,20 +4765,20 @@ var require_graceful_fs = __commonJS({
|
|
|
4765
4765
|
});
|
|
4766
4766
|
}
|
|
4767
4767
|
}
|
|
4768
|
-
return
|
|
4768
|
+
return fs7;
|
|
4769
4769
|
}
|
|
4770
4770
|
function enqueue(elem) {
|
|
4771
4771
|
debug("ENQUEUE", elem[0].name, elem[1]);
|
|
4772
|
-
|
|
4772
|
+
fs6[gracefulQueue].push(elem);
|
|
4773
4773
|
retry();
|
|
4774
4774
|
}
|
|
4775
4775
|
var retryTimer;
|
|
4776
4776
|
function resetQueue() {
|
|
4777
4777
|
var now = Date.now();
|
|
4778
|
-
for (var i = 0; i <
|
|
4779
|
-
if (
|
|
4780
|
-
|
|
4781
|
-
|
|
4778
|
+
for (var i = 0; i < fs6[gracefulQueue].length; ++i) {
|
|
4779
|
+
if (fs6[gracefulQueue][i].length > 2) {
|
|
4780
|
+
fs6[gracefulQueue][i][3] = now;
|
|
4781
|
+
fs6[gracefulQueue][i][4] = now;
|
|
4782
4782
|
}
|
|
4783
4783
|
}
|
|
4784
4784
|
retry();
|
|
@@ -4786,9 +4786,9 @@ var require_graceful_fs = __commonJS({
|
|
|
4786
4786
|
function retry() {
|
|
4787
4787
|
clearTimeout(retryTimer);
|
|
4788
4788
|
retryTimer = void 0;
|
|
4789
|
-
if (
|
|
4789
|
+
if (fs6[gracefulQueue].length === 0)
|
|
4790
4790
|
return;
|
|
4791
|
-
var elem =
|
|
4791
|
+
var elem = fs6[gracefulQueue].shift();
|
|
4792
4792
|
var fn = elem[0];
|
|
4793
4793
|
var args = elem[1];
|
|
4794
4794
|
var err = elem[2];
|
|
@@ -4810,7 +4810,7 @@ var require_graceful_fs = __commonJS({
|
|
|
4810
4810
|
debug("RETRY", fn.name, args);
|
|
4811
4811
|
fn.apply(null, args.concat([startTime]));
|
|
4812
4812
|
} else {
|
|
4813
|
-
|
|
4813
|
+
fs6[gracefulQueue].push(elem);
|
|
4814
4814
|
}
|
|
4815
4815
|
}
|
|
4816
4816
|
if (retryTimer === void 0) {
|
|
@@ -4825,7 +4825,7 @@ var require_fs = __commonJS({
|
|
|
4825
4825
|
"../../node_modules/fs-extra/lib/fs/index.js"(exports) {
|
|
4826
4826
|
"use strict";
|
|
4827
4827
|
var u = require_universalify().fromCallback;
|
|
4828
|
-
var
|
|
4828
|
+
var fs6 = require_graceful_fs();
|
|
4829
4829
|
var api = [
|
|
4830
4830
|
"access",
|
|
4831
4831
|
"appendFile",
|
|
@@ -4866,26 +4866,26 @@ var require_fs = __commonJS({
|
|
|
4866
4866
|
"utimes",
|
|
4867
4867
|
"writeFile"
|
|
4868
4868
|
].filter((key) => {
|
|
4869
|
-
return typeof
|
|
4869
|
+
return typeof fs6[key] === "function";
|
|
4870
4870
|
});
|
|
4871
|
-
Object.assign(exports,
|
|
4871
|
+
Object.assign(exports, fs6);
|
|
4872
4872
|
api.forEach((method) => {
|
|
4873
|
-
exports[method] = u(
|
|
4873
|
+
exports[method] = u(fs6[method]);
|
|
4874
4874
|
});
|
|
4875
4875
|
exports.exists = function(filename, callback) {
|
|
4876
4876
|
if (typeof callback === "function") {
|
|
4877
|
-
return
|
|
4877
|
+
return fs6.exists(filename, callback);
|
|
4878
4878
|
}
|
|
4879
4879
|
return new Promise((resolve) => {
|
|
4880
|
-
return
|
|
4880
|
+
return fs6.exists(filename, resolve);
|
|
4881
4881
|
});
|
|
4882
4882
|
};
|
|
4883
4883
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
4884
4884
|
if (typeof callback === "function") {
|
|
4885
|
-
return
|
|
4885
|
+
return fs6.read(fd, buffer, offset, length, position, callback);
|
|
4886
4886
|
}
|
|
4887
4887
|
return new Promise((resolve, reject) => {
|
|
4888
|
-
|
|
4888
|
+
fs6.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
4889
4889
|
if (err) return reject(err);
|
|
4890
4890
|
resolve({ bytesRead, buffer: buffer2 });
|
|
4891
4891
|
});
|
|
@@ -4893,10 +4893,10 @@ var require_fs = __commonJS({
|
|
|
4893
4893
|
};
|
|
4894
4894
|
exports.write = function(fd, buffer, ...args) {
|
|
4895
4895
|
if (typeof args[args.length - 1] === "function") {
|
|
4896
|
-
return
|
|
4896
|
+
return fs6.write(fd, buffer, ...args);
|
|
4897
4897
|
}
|
|
4898
4898
|
return new Promise((resolve, reject) => {
|
|
4899
|
-
|
|
4899
|
+
fs6.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
4900
4900
|
if (err) return reject(err);
|
|
4901
4901
|
resolve({ bytesWritten, buffer: buffer2 });
|
|
4902
4902
|
});
|
|
@@ -4904,10 +4904,10 @@ var require_fs = __commonJS({
|
|
|
4904
4904
|
};
|
|
4905
4905
|
exports.readv = function(fd, buffers, ...args) {
|
|
4906
4906
|
if (typeof args[args.length - 1] === "function") {
|
|
4907
|
-
return
|
|
4907
|
+
return fs6.readv(fd, buffers, ...args);
|
|
4908
4908
|
}
|
|
4909
4909
|
return new Promise((resolve, reject) => {
|
|
4910
|
-
|
|
4910
|
+
fs6.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
|
|
4911
4911
|
if (err) return reject(err);
|
|
4912
4912
|
resolve({ bytesRead, buffers: buffers2 });
|
|
4913
4913
|
});
|
|
@@ -4915,17 +4915,17 @@ var require_fs = __commonJS({
|
|
|
4915
4915
|
};
|
|
4916
4916
|
exports.writev = function(fd, buffers, ...args) {
|
|
4917
4917
|
if (typeof args[args.length - 1] === "function") {
|
|
4918
|
-
return
|
|
4918
|
+
return fs6.writev(fd, buffers, ...args);
|
|
4919
4919
|
}
|
|
4920
4920
|
return new Promise((resolve, reject) => {
|
|
4921
|
-
|
|
4921
|
+
fs6.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
4922
4922
|
if (err) return reject(err);
|
|
4923
4923
|
resolve({ bytesWritten, buffers: buffers2 });
|
|
4924
4924
|
});
|
|
4925
4925
|
});
|
|
4926
4926
|
};
|
|
4927
|
-
if (typeof
|
|
4928
|
-
exports.realpath.native = u(
|
|
4927
|
+
if (typeof fs6.realpath.native === "function") {
|
|
4928
|
+
exports.realpath.native = u(fs6.realpath.native);
|
|
4929
4929
|
} else {
|
|
4930
4930
|
process.emitWarning(
|
|
4931
4931
|
"fs.realpath.native is not a function. Is fs being monkey-patched?",
|
|
@@ -4940,10 +4940,10 @@ var require_fs = __commonJS({
|
|
|
4940
4940
|
var require_utils = __commonJS({
|
|
4941
4941
|
"../../node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module) {
|
|
4942
4942
|
"use strict";
|
|
4943
|
-
var
|
|
4943
|
+
var path10 = __require("path");
|
|
4944
4944
|
module.exports.checkPath = function checkPath(pth) {
|
|
4945
4945
|
if (process.platform === "win32") {
|
|
4946
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
4946
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path10.parse(pth).root, ""));
|
|
4947
4947
|
if (pathHasInvalidWinCharacters) {
|
|
4948
4948
|
const error51 = new Error(`Path contains invalid characters: ${pth}`);
|
|
4949
4949
|
error51.code = "EINVAL";
|
|
@@ -4958,7 +4958,7 @@ var require_utils = __commonJS({
|
|
|
4958
4958
|
var require_make_dir = __commonJS({
|
|
4959
4959
|
"../../node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module) {
|
|
4960
4960
|
"use strict";
|
|
4961
|
-
var
|
|
4961
|
+
var fs6 = require_fs();
|
|
4962
4962
|
var { checkPath } = require_utils();
|
|
4963
4963
|
var getMode = (options) => {
|
|
4964
4964
|
const defaults = { mode: 511 };
|
|
@@ -4967,14 +4967,14 @@ var require_make_dir = __commonJS({
|
|
|
4967
4967
|
};
|
|
4968
4968
|
module.exports.makeDir = async (dir, options) => {
|
|
4969
4969
|
checkPath(dir);
|
|
4970
|
-
return
|
|
4970
|
+
return fs6.mkdir(dir, {
|
|
4971
4971
|
mode: getMode(options),
|
|
4972
4972
|
recursive: true
|
|
4973
4973
|
});
|
|
4974
4974
|
};
|
|
4975
4975
|
module.exports.makeDirSync = (dir, options) => {
|
|
4976
4976
|
checkPath(dir);
|
|
4977
|
-
return
|
|
4977
|
+
return fs6.mkdirSync(dir, {
|
|
4978
4978
|
mode: getMode(options),
|
|
4979
4979
|
recursive: true
|
|
4980
4980
|
});
|
|
@@ -5006,13 +5006,13 @@ var require_path_exists = __commonJS({
|
|
|
5006
5006
|
"../../node_modules/fs-extra/lib/path-exists/index.js"(exports, module) {
|
|
5007
5007
|
"use strict";
|
|
5008
5008
|
var u = require_universalify().fromPromise;
|
|
5009
|
-
var
|
|
5010
|
-
function pathExists(
|
|
5011
|
-
return
|
|
5009
|
+
var fs6 = require_fs();
|
|
5010
|
+
function pathExists(path10) {
|
|
5011
|
+
return fs6.access(path10).then(() => true).catch(() => false);
|
|
5012
5012
|
}
|
|
5013
5013
|
module.exports = {
|
|
5014
5014
|
pathExists: u(pathExists),
|
|
5015
|
-
pathExistsSync:
|
|
5015
|
+
pathExistsSync: fs6.existsSync
|
|
5016
5016
|
};
|
|
5017
5017
|
}
|
|
5018
5018
|
});
|
|
@@ -5021,18 +5021,18 @@ var require_path_exists = __commonJS({
|
|
|
5021
5021
|
var require_utimes = __commonJS({
|
|
5022
5022
|
"../../node_modules/fs-extra/lib/util/utimes.js"(exports, module) {
|
|
5023
5023
|
"use strict";
|
|
5024
|
-
var
|
|
5024
|
+
var fs6 = require_fs();
|
|
5025
5025
|
var u = require_universalify().fromPromise;
|
|
5026
|
-
async function utimesMillis(
|
|
5027
|
-
const fd = await
|
|
5026
|
+
async function utimesMillis(path10, atime, mtime) {
|
|
5027
|
+
const fd = await fs6.open(path10, "r+");
|
|
5028
5028
|
let error51 = null;
|
|
5029
5029
|
try {
|
|
5030
|
-
await
|
|
5030
|
+
await fs6.futimes(fd, atime, mtime);
|
|
5031
5031
|
} catch (futimesErr) {
|
|
5032
5032
|
error51 = futimesErr;
|
|
5033
5033
|
} finally {
|
|
5034
5034
|
try {
|
|
5035
|
-
await
|
|
5035
|
+
await fs6.close(fd);
|
|
5036
5036
|
} catch (closeErr) {
|
|
5037
5037
|
if (!error51) error51 = closeErr;
|
|
5038
5038
|
}
|
|
@@ -5041,16 +5041,16 @@ var require_utimes = __commonJS({
|
|
|
5041
5041
|
throw error51;
|
|
5042
5042
|
}
|
|
5043
5043
|
}
|
|
5044
|
-
function utimesMillisSync(
|
|
5045
|
-
const fd =
|
|
5044
|
+
function utimesMillisSync(path10, atime, mtime) {
|
|
5045
|
+
const fd = fs6.openSync(path10, "r+");
|
|
5046
5046
|
let error51 = null;
|
|
5047
5047
|
try {
|
|
5048
|
-
|
|
5048
|
+
fs6.futimesSync(fd, atime, mtime);
|
|
5049
5049
|
} catch (futimesErr) {
|
|
5050
5050
|
error51 = futimesErr;
|
|
5051
5051
|
} finally {
|
|
5052
5052
|
try {
|
|
5053
|
-
|
|
5053
|
+
fs6.closeSync(fd);
|
|
5054
5054
|
} catch (closeErr) {
|
|
5055
5055
|
if (!error51) error51 = closeErr;
|
|
5056
5056
|
}
|
|
@@ -5070,11 +5070,11 @@ var require_utimes = __commonJS({
|
|
|
5070
5070
|
var require_stat = __commonJS({
|
|
5071
5071
|
"../../node_modules/fs-extra/lib/util/stat.js"(exports, module) {
|
|
5072
5072
|
"use strict";
|
|
5073
|
-
var
|
|
5074
|
-
var
|
|
5073
|
+
var fs6 = require_fs();
|
|
5074
|
+
var path10 = __require("path");
|
|
5075
5075
|
var u = require_universalify().fromPromise;
|
|
5076
5076
|
function getStats(src, dest, opts) {
|
|
5077
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
5077
|
+
const statFunc = opts.dereference ? (file2) => fs6.stat(file2, { bigint: true }) : (file2) => fs6.lstat(file2, { bigint: true });
|
|
5078
5078
|
return Promise.all([
|
|
5079
5079
|
statFunc(src),
|
|
5080
5080
|
statFunc(dest).catch((err) => {
|
|
@@ -5085,7 +5085,7 @@ var require_stat = __commonJS({
|
|
|
5085
5085
|
}
|
|
5086
5086
|
function getStatsSync(src, dest, opts) {
|
|
5087
5087
|
let destStat;
|
|
5088
|
-
const statFunc = opts.dereference ? (file2) =>
|
|
5088
|
+
const statFunc = opts.dereference ? (file2) => fs6.statSync(file2, { bigint: true }) : (file2) => fs6.lstatSync(file2, { bigint: true });
|
|
5089
5089
|
const srcStat = statFunc(src);
|
|
5090
5090
|
try {
|
|
5091
5091
|
destStat = statFunc(dest);
|
|
@@ -5099,8 +5099,8 @@ var require_stat = __commonJS({
|
|
|
5099
5099
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
5100
5100
|
if (destStat) {
|
|
5101
5101
|
if (areIdentical(srcStat, destStat)) {
|
|
5102
|
-
const srcBaseName =
|
|
5103
|
-
const destBaseName =
|
|
5102
|
+
const srcBaseName = path10.basename(src);
|
|
5103
|
+
const destBaseName = path10.basename(dest);
|
|
5104
5104
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
5105
5105
|
return { srcStat, destStat, isChangingCase: true };
|
|
5106
5106
|
}
|
|
@@ -5122,8 +5122,8 @@ var require_stat = __commonJS({
|
|
|
5122
5122
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
5123
5123
|
if (destStat) {
|
|
5124
5124
|
if (areIdentical(srcStat, destStat)) {
|
|
5125
|
-
const srcBaseName =
|
|
5126
|
-
const destBaseName =
|
|
5125
|
+
const srcBaseName = path10.basename(src);
|
|
5126
|
+
const destBaseName = path10.basename(dest);
|
|
5127
5127
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
5128
5128
|
return { srcStat, destStat, isChangingCase: true };
|
|
5129
5129
|
}
|
|
@@ -5142,12 +5142,12 @@ var require_stat = __commonJS({
|
|
|
5142
5142
|
return { srcStat, destStat };
|
|
5143
5143
|
}
|
|
5144
5144
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
5145
|
-
const srcParent =
|
|
5146
|
-
const destParent =
|
|
5147
|
-
if (destParent === srcParent || destParent ===
|
|
5145
|
+
const srcParent = path10.resolve(path10.dirname(src));
|
|
5146
|
+
const destParent = path10.resolve(path10.dirname(dest));
|
|
5147
|
+
if (destParent === srcParent || destParent === path10.parse(destParent).root) return;
|
|
5148
5148
|
let destStat;
|
|
5149
5149
|
try {
|
|
5150
|
-
destStat = await
|
|
5150
|
+
destStat = await fs6.stat(destParent, { bigint: true });
|
|
5151
5151
|
} catch (err) {
|
|
5152
5152
|
if (err.code === "ENOENT") return checkParentPaths(src, srcStat, destParent, funcName);
|
|
5153
5153
|
throw err;
|
|
@@ -5158,12 +5158,12 @@ var require_stat = __commonJS({
|
|
|
5158
5158
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
5159
5159
|
}
|
|
5160
5160
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
5161
|
-
const srcParent =
|
|
5162
|
-
const destParent =
|
|
5163
|
-
if (destParent === srcParent || destParent ===
|
|
5161
|
+
const srcParent = path10.resolve(path10.dirname(src));
|
|
5162
|
+
const destParent = path10.resolve(path10.dirname(dest));
|
|
5163
|
+
if (destParent === srcParent || destParent === path10.parse(destParent).root) return;
|
|
5164
5164
|
let destStat;
|
|
5165
5165
|
try {
|
|
5166
|
-
destStat =
|
|
5166
|
+
destStat = fs6.statSync(destParent, { bigint: true });
|
|
5167
5167
|
} catch (err) {
|
|
5168
5168
|
if (err.code === "ENOENT") return checkParentPathsSync(src, srcStat, destParent, funcName);
|
|
5169
5169
|
throw err;
|
|
@@ -5177,8 +5177,8 @@ var require_stat = __commonJS({
|
|
|
5177
5177
|
return destStat.ino !== void 0 && destStat.dev !== void 0 && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
5178
5178
|
}
|
|
5179
5179
|
function isSrcSubdir(src, dest) {
|
|
5180
|
-
const srcArr =
|
|
5181
|
-
const destArr =
|
|
5180
|
+
const srcArr = path10.resolve(src).split(path10.sep).filter((i) => i);
|
|
5181
|
+
const destArr = path10.resolve(dest).split(path10.sep).filter((i) => i);
|
|
5182
5182
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
5183
5183
|
}
|
|
5184
5184
|
function errMsg(src, dest, funcName) {
|
|
@@ -5230,8 +5230,8 @@ var require_async = __commonJS({
|
|
|
5230
5230
|
var require_copy = __commonJS({
|
|
5231
5231
|
"../../node_modules/fs-extra/lib/copy/copy.js"(exports, module) {
|
|
5232
5232
|
"use strict";
|
|
5233
|
-
var
|
|
5234
|
-
var
|
|
5233
|
+
var fs6 = require_fs();
|
|
5234
|
+
var path10 = __require("path");
|
|
5235
5235
|
var { mkdirs } = require_mkdirs();
|
|
5236
5236
|
var { pathExists } = require_path_exists();
|
|
5237
5237
|
var { utimesMillis } = require_utimes();
|
|
@@ -5254,7 +5254,7 @@ var require_copy = __commonJS({
|
|
|
5254
5254
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
5255
5255
|
const include = await runFilter(src, dest, opts);
|
|
5256
5256
|
if (!include) return;
|
|
5257
|
-
const destParent =
|
|
5257
|
+
const destParent = path10.dirname(dest);
|
|
5258
5258
|
const dirExists = await pathExists(destParent);
|
|
5259
5259
|
if (!dirExists) {
|
|
5260
5260
|
await mkdirs(destParent);
|
|
@@ -5266,7 +5266,7 @@ var require_copy = __commonJS({
|
|
|
5266
5266
|
return opts.filter(src, dest);
|
|
5267
5267
|
}
|
|
5268
5268
|
async function getStatsAndPerformCopy(destStat, src, dest, opts) {
|
|
5269
|
-
const statFn = opts.dereference ?
|
|
5269
|
+
const statFn = opts.dereference ? fs6.stat : fs6.lstat;
|
|
5270
5270
|
const srcStat = await statFn(src);
|
|
5271
5271
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
5272
5272
|
if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -5278,7 +5278,7 @@ var require_copy = __commonJS({
|
|
|
5278
5278
|
async function onFile(srcStat, destStat, src, dest, opts) {
|
|
5279
5279
|
if (!destStat) return copyFile(srcStat, src, dest, opts);
|
|
5280
5280
|
if (opts.overwrite) {
|
|
5281
|
-
await
|
|
5281
|
+
await fs6.unlink(dest);
|
|
5282
5282
|
return copyFile(srcStat, src, dest, opts);
|
|
5283
5283
|
}
|
|
5284
5284
|
if (opts.errorOnExist) {
|
|
@@ -5286,29 +5286,29 @@ var require_copy = __commonJS({
|
|
|
5286
5286
|
}
|
|
5287
5287
|
}
|
|
5288
5288
|
async function copyFile(srcStat, src, dest, opts) {
|
|
5289
|
-
await
|
|
5289
|
+
await fs6.copyFile(src, dest);
|
|
5290
5290
|
if (opts.preserveTimestamps) {
|
|
5291
5291
|
if (fileIsNotWritable(srcStat.mode)) {
|
|
5292
5292
|
await makeFileWritable(dest, srcStat.mode);
|
|
5293
5293
|
}
|
|
5294
|
-
const updatedSrcStat = await
|
|
5294
|
+
const updatedSrcStat = await fs6.stat(src);
|
|
5295
5295
|
await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5296
5296
|
}
|
|
5297
|
-
return
|
|
5297
|
+
return fs6.chmod(dest, srcStat.mode);
|
|
5298
5298
|
}
|
|
5299
5299
|
function fileIsNotWritable(srcMode) {
|
|
5300
5300
|
return (srcMode & 128) === 0;
|
|
5301
5301
|
}
|
|
5302
5302
|
function makeFileWritable(dest, srcMode) {
|
|
5303
|
-
return
|
|
5303
|
+
return fs6.chmod(dest, srcMode | 128);
|
|
5304
5304
|
}
|
|
5305
5305
|
async function onDir(srcStat, destStat, src, dest, opts) {
|
|
5306
5306
|
if (!destStat) {
|
|
5307
|
-
await
|
|
5307
|
+
await fs6.mkdir(dest);
|
|
5308
5308
|
}
|
|
5309
|
-
await asyncIteratorConcurrentProcess(await
|
|
5310
|
-
const srcItem =
|
|
5311
|
-
const destItem =
|
|
5309
|
+
await asyncIteratorConcurrentProcess(await fs6.opendir(src), async (item) => {
|
|
5310
|
+
const srcItem = path10.join(src, item.name);
|
|
5311
|
+
const destItem = path10.join(dest, item.name);
|
|
5312
5312
|
const include = await runFilter(srcItem, destItem, opts);
|
|
5313
5313
|
if (include) {
|
|
5314
5314
|
const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
|
|
@@ -5316,26 +5316,26 @@ var require_copy = __commonJS({
|
|
|
5316
5316
|
}
|
|
5317
5317
|
});
|
|
5318
5318
|
if (!destStat) {
|
|
5319
|
-
await
|
|
5319
|
+
await fs6.chmod(dest, srcStat.mode);
|
|
5320
5320
|
}
|
|
5321
5321
|
}
|
|
5322
5322
|
async function onLink(destStat, src, dest, opts) {
|
|
5323
|
-
let resolvedSrc = await
|
|
5323
|
+
let resolvedSrc = await fs6.readlink(src);
|
|
5324
5324
|
if (opts.dereference) {
|
|
5325
|
-
resolvedSrc =
|
|
5325
|
+
resolvedSrc = path10.resolve(process.cwd(), resolvedSrc);
|
|
5326
5326
|
}
|
|
5327
5327
|
if (!destStat) {
|
|
5328
|
-
return
|
|
5328
|
+
return fs6.symlink(resolvedSrc, dest);
|
|
5329
5329
|
}
|
|
5330
5330
|
let resolvedDest = null;
|
|
5331
5331
|
try {
|
|
5332
|
-
resolvedDest = await
|
|
5332
|
+
resolvedDest = await fs6.readlink(dest);
|
|
5333
5333
|
} catch (e) {
|
|
5334
|
-
if (e.code === "EINVAL" || e.code === "UNKNOWN") return
|
|
5334
|
+
if (e.code === "EINVAL" || e.code === "UNKNOWN") return fs6.symlink(resolvedSrc, dest);
|
|
5335
5335
|
throw e;
|
|
5336
5336
|
}
|
|
5337
5337
|
if (opts.dereference) {
|
|
5338
|
-
resolvedDest =
|
|
5338
|
+
resolvedDest = path10.resolve(process.cwd(), resolvedDest);
|
|
5339
5339
|
}
|
|
5340
5340
|
if (resolvedSrc !== resolvedDest) {
|
|
5341
5341
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -5345,8 +5345,8 @@ var require_copy = __commonJS({
|
|
|
5345
5345
|
throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
|
|
5346
5346
|
}
|
|
5347
5347
|
}
|
|
5348
|
-
await
|
|
5349
|
-
return
|
|
5348
|
+
await fs6.unlink(dest);
|
|
5349
|
+
return fs6.symlink(resolvedSrc, dest);
|
|
5350
5350
|
}
|
|
5351
5351
|
module.exports = copy;
|
|
5352
5352
|
}
|
|
@@ -5356,8 +5356,8 @@ var require_copy = __commonJS({
|
|
|
5356
5356
|
var require_copy_sync = __commonJS({
|
|
5357
5357
|
"../../node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module) {
|
|
5358
5358
|
"use strict";
|
|
5359
|
-
var
|
|
5360
|
-
var
|
|
5359
|
+
var fs6 = require_graceful_fs();
|
|
5360
|
+
var path10 = __require("path");
|
|
5361
5361
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
5362
5362
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
5363
5363
|
var stat = require_stat();
|
|
@@ -5378,12 +5378,12 @@ var require_copy_sync = __commonJS({
|
|
|
5378
5378
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
5379
5379
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
5380
5380
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
5381
|
-
const destParent =
|
|
5382
|
-
if (!
|
|
5381
|
+
const destParent = path10.dirname(dest);
|
|
5382
|
+
if (!fs6.existsSync(destParent)) mkdirsSync(destParent);
|
|
5383
5383
|
return getStats(destStat, src, dest, opts);
|
|
5384
5384
|
}
|
|
5385
5385
|
function getStats(destStat, src, dest, opts) {
|
|
5386
|
-
const statSync = opts.dereference ?
|
|
5386
|
+
const statSync = opts.dereference ? fs6.statSync : fs6.lstatSync;
|
|
5387
5387
|
const srcStat = statSync(src);
|
|
5388
5388
|
if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts);
|
|
5389
5389
|
else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts);
|
|
@@ -5398,14 +5398,14 @@ var require_copy_sync = __commonJS({
|
|
|
5398
5398
|
}
|
|
5399
5399
|
function mayCopyFile(srcStat, src, dest, opts) {
|
|
5400
5400
|
if (opts.overwrite) {
|
|
5401
|
-
|
|
5401
|
+
fs6.unlinkSync(dest);
|
|
5402
5402
|
return copyFile(srcStat, src, dest, opts);
|
|
5403
5403
|
} else if (opts.errorOnExist) {
|
|
5404
5404
|
throw new Error(`'${dest}' already exists`);
|
|
5405
5405
|
}
|
|
5406
5406
|
}
|
|
5407
5407
|
function copyFile(srcStat, src, dest, opts) {
|
|
5408
|
-
|
|
5408
|
+
fs6.copyFileSync(src, dest);
|
|
5409
5409
|
if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest);
|
|
5410
5410
|
return setDestMode(dest, srcStat.mode);
|
|
5411
5411
|
}
|
|
@@ -5420,10 +5420,10 @@ var require_copy_sync = __commonJS({
|
|
|
5420
5420
|
return setDestMode(dest, srcMode | 128);
|
|
5421
5421
|
}
|
|
5422
5422
|
function setDestMode(dest, srcMode) {
|
|
5423
|
-
return
|
|
5423
|
+
return fs6.chmodSync(dest, srcMode);
|
|
5424
5424
|
}
|
|
5425
5425
|
function setDestTimestamps(src, dest) {
|
|
5426
|
-
const updatedSrcStat =
|
|
5426
|
+
const updatedSrcStat = fs6.statSync(src);
|
|
5427
5427
|
return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
5428
5428
|
}
|
|
5429
5429
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -5431,12 +5431,12 @@ var require_copy_sync = __commonJS({
|
|
|
5431
5431
|
return copyDir(src, dest, opts);
|
|
5432
5432
|
}
|
|
5433
5433
|
function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
5434
|
-
|
|
5434
|
+
fs6.mkdirSync(dest);
|
|
5435
5435
|
copyDir(src, dest, opts);
|
|
5436
5436
|
return setDestMode(dest, srcMode);
|
|
5437
5437
|
}
|
|
5438
5438
|
function copyDir(src, dest, opts) {
|
|
5439
|
-
const dir =
|
|
5439
|
+
const dir = fs6.opendirSync(src);
|
|
5440
5440
|
try {
|
|
5441
5441
|
let dirent;
|
|
5442
5442
|
while ((dirent = dir.readSync()) !== null) {
|
|
@@ -5447,29 +5447,29 @@ var require_copy_sync = __commonJS({
|
|
|
5447
5447
|
}
|
|
5448
5448
|
}
|
|
5449
5449
|
function copyDirItem(item, src, dest, opts) {
|
|
5450
|
-
const srcItem =
|
|
5451
|
-
const destItem =
|
|
5450
|
+
const srcItem = path10.join(src, item);
|
|
5451
|
+
const destItem = path10.join(dest, item);
|
|
5452
5452
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
5453
5453
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
5454
5454
|
return getStats(destStat, srcItem, destItem, opts);
|
|
5455
5455
|
}
|
|
5456
5456
|
function onLink(destStat, src, dest, opts) {
|
|
5457
|
-
let resolvedSrc =
|
|
5457
|
+
let resolvedSrc = fs6.readlinkSync(src);
|
|
5458
5458
|
if (opts.dereference) {
|
|
5459
|
-
resolvedSrc =
|
|
5459
|
+
resolvedSrc = path10.resolve(process.cwd(), resolvedSrc);
|
|
5460
5460
|
}
|
|
5461
5461
|
if (!destStat) {
|
|
5462
|
-
return
|
|
5462
|
+
return fs6.symlinkSync(resolvedSrc, dest);
|
|
5463
5463
|
} else {
|
|
5464
5464
|
let resolvedDest;
|
|
5465
5465
|
try {
|
|
5466
|
-
resolvedDest =
|
|
5466
|
+
resolvedDest = fs6.readlinkSync(dest);
|
|
5467
5467
|
} catch (err) {
|
|
5468
|
-
if (err.code === "EINVAL" || err.code === "UNKNOWN") return
|
|
5468
|
+
if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs6.symlinkSync(resolvedSrc, dest);
|
|
5469
5469
|
throw err;
|
|
5470
5470
|
}
|
|
5471
5471
|
if (opts.dereference) {
|
|
5472
|
-
resolvedDest =
|
|
5472
|
+
resolvedDest = path10.resolve(process.cwd(), resolvedDest);
|
|
5473
5473
|
}
|
|
5474
5474
|
if (resolvedSrc !== resolvedDest) {
|
|
5475
5475
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
@@ -5483,8 +5483,8 @@ var require_copy_sync = __commonJS({
|
|
|
5483
5483
|
}
|
|
5484
5484
|
}
|
|
5485
5485
|
function copyLink(resolvedSrc, dest) {
|
|
5486
|
-
|
|
5487
|
-
return
|
|
5486
|
+
fs6.unlinkSync(dest);
|
|
5487
|
+
return fs6.symlinkSync(resolvedSrc, dest);
|
|
5488
5488
|
}
|
|
5489
5489
|
module.exports = copySync;
|
|
5490
5490
|
}
|
|
@@ -5506,13 +5506,13 @@ var require_copy2 = __commonJS({
|
|
|
5506
5506
|
var require_remove = __commonJS({
|
|
5507
5507
|
"../../node_modules/fs-extra/lib/remove/index.js"(exports, module) {
|
|
5508
5508
|
"use strict";
|
|
5509
|
-
var
|
|
5509
|
+
var fs6 = require_graceful_fs();
|
|
5510
5510
|
var u = require_universalify().fromCallback;
|
|
5511
|
-
function remove(
|
|
5512
|
-
|
|
5511
|
+
function remove(path10, callback) {
|
|
5512
|
+
fs6.rm(path10, { recursive: true, force: true }, callback);
|
|
5513
5513
|
}
|
|
5514
|
-
function removeSync(
|
|
5515
|
-
|
|
5514
|
+
function removeSync(path10) {
|
|
5515
|
+
fs6.rmSync(path10, { recursive: true, force: true });
|
|
5516
5516
|
}
|
|
5517
5517
|
module.exports = {
|
|
5518
5518
|
remove: u(remove),
|
|
@@ -5526,28 +5526,28 @@ var require_empty = __commonJS({
|
|
|
5526
5526
|
"../../node_modules/fs-extra/lib/empty/index.js"(exports, module) {
|
|
5527
5527
|
"use strict";
|
|
5528
5528
|
var u = require_universalify().fromPromise;
|
|
5529
|
-
var
|
|
5530
|
-
var
|
|
5529
|
+
var fs6 = require_fs();
|
|
5530
|
+
var path10 = __require("path");
|
|
5531
5531
|
var mkdir = require_mkdirs();
|
|
5532
5532
|
var remove = require_remove();
|
|
5533
5533
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
5534
5534
|
let items;
|
|
5535
5535
|
try {
|
|
5536
|
-
items = await
|
|
5536
|
+
items = await fs6.readdir(dir);
|
|
5537
5537
|
} catch {
|
|
5538
5538
|
return mkdir.mkdirs(dir);
|
|
5539
5539
|
}
|
|
5540
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
5540
|
+
return Promise.all(items.map((item) => remove.remove(path10.join(dir, item))));
|
|
5541
5541
|
});
|
|
5542
5542
|
function emptyDirSync(dir) {
|
|
5543
5543
|
let items;
|
|
5544
5544
|
try {
|
|
5545
|
-
items =
|
|
5545
|
+
items = fs6.readdirSync(dir);
|
|
5546
5546
|
} catch {
|
|
5547
5547
|
return mkdir.mkdirsSync(dir);
|
|
5548
5548
|
}
|
|
5549
5549
|
items.forEach((item) => {
|
|
5550
|
-
item =
|
|
5550
|
+
item = path10.join(dir, item);
|
|
5551
5551
|
remove.removeSync(item);
|
|
5552
5552
|
});
|
|
5553
5553
|
}
|
|
@@ -5565,52 +5565,52 @@ var require_file = __commonJS({
|
|
|
5565
5565
|
"../../node_modules/fs-extra/lib/ensure/file.js"(exports, module) {
|
|
5566
5566
|
"use strict";
|
|
5567
5567
|
var u = require_universalify().fromPromise;
|
|
5568
|
-
var
|
|
5569
|
-
var
|
|
5568
|
+
var path10 = __require("path");
|
|
5569
|
+
var fs6 = require_fs();
|
|
5570
5570
|
var mkdir = require_mkdirs();
|
|
5571
5571
|
async function createFile(file2) {
|
|
5572
5572
|
let stats;
|
|
5573
5573
|
try {
|
|
5574
|
-
stats = await
|
|
5574
|
+
stats = await fs6.stat(file2);
|
|
5575
5575
|
} catch {
|
|
5576
5576
|
}
|
|
5577
5577
|
if (stats && stats.isFile()) return;
|
|
5578
|
-
const dir =
|
|
5578
|
+
const dir = path10.dirname(file2);
|
|
5579
5579
|
let dirStats = null;
|
|
5580
5580
|
try {
|
|
5581
|
-
dirStats = await
|
|
5581
|
+
dirStats = await fs6.stat(dir);
|
|
5582
5582
|
} catch (err) {
|
|
5583
5583
|
if (err.code === "ENOENT") {
|
|
5584
5584
|
await mkdir.mkdirs(dir);
|
|
5585
|
-
await
|
|
5585
|
+
await fs6.writeFile(file2, "");
|
|
5586
5586
|
return;
|
|
5587
5587
|
} else {
|
|
5588
5588
|
throw err;
|
|
5589
5589
|
}
|
|
5590
5590
|
}
|
|
5591
5591
|
if (dirStats.isDirectory()) {
|
|
5592
|
-
await
|
|
5592
|
+
await fs6.writeFile(file2, "");
|
|
5593
5593
|
} else {
|
|
5594
|
-
await
|
|
5594
|
+
await fs6.readdir(dir);
|
|
5595
5595
|
}
|
|
5596
5596
|
}
|
|
5597
5597
|
function createFileSync(file2) {
|
|
5598
5598
|
let stats;
|
|
5599
5599
|
try {
|
|
5600
|
-
stats =
|
|
5600
|
+
stats = fs6.statSync(file2);
|
|
5601
5601
|
} catch {
|
|
5602
5602
|
}
|
|
5603
5603
|
if (stats && stats.isFile()) return;
|
|
5604
|
-
const dir =
|
|
5604
|
+
const dir = path10.dirname(file2);
|
|
5605
5605
|
try {
|
|
5606
|
-
if (!
|
|
5607
|
-
|
|
5606
|
+
if (!fs6.statSync(dir).isDirectory()) {
|
|
5607
|
+
fs6.readdirSync(dir);
|
|
5608
5608
|
}
|
|
5609
5609
|
} catch (err) {
|
|
5610
5610
|
if (err && err.code === "ENOENT") mkdir.mkdirsSync(dir);
|
|
5611
5611
|
else throw err;
|
|
5612
5612
|
}
|
|
5613
|
-
|
|
5613
|
+
fs6.writeFileSync(file2, "");
|
|
5614
5614
|
}
|
|
5615
5615
|
module.exports = {
|
|
5616
5616
|
createFile: u(createFile),
|
|
@@ -5624,50 +5624,50 @@ var require_link = __commonJS({
|
|
|
5624
5624
|
"../../node_modules/fs-extra/lib/ensure/link.js"(exports, module) {
|
|
5625
5625
|
"use strict";
|
|
5626
5626
|
var u = require_universalify().fromPromise;
|
|
5627
|
-
var
|
|
5628
|
-
var
|
|
5627
|
+
var path10 = __require("path");
|
|
5628
|
+
var fs6 = require_fs();
|
|
5629
5629
|
var mkdir = require_mkdirs();
|
|
5630
5630
|
var { pathExists } = require_path_exists();
|
|
5631
5631
|
var { areIdentical } = require_stat();
|
|
5632
5632
|
async function createLink(srcpath, dstpath) {
|
|
5633
5633
|
let dstStat;
|
|
5634
5634
|
try {
|
|
5635
|
-
dstStat = await
|
|
5635
|
+
dstStat = await fs6.lstat(dstpath, { bigint: true });
|
|
5636
5636
|
} catch {
|
|
5637
5637
|
}
|
|
5638
5638
|
let srcStat;
|
|
5639
5639
|
try {
|
|
5640
|
-
srcStat = await
|
|
5640
|
+
srcStat = await fs6.lstat(srcpath, { bigint: true });
|
|
5641
5641
|
} catch (err) {
|
|
5642
5642
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5643
5643
|
throw err;
|
|
5644
5644
|
}
|
|
5645
5645
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5646
|
-
const dir =
|
|
5646
|
+
const dir = path10.dirname(dstpath);
|
|
5647
5647
|
const dirExists = await pathExists(dir);
|
|
5648
5648
|
if (!dirExists) {
|
|
5649
5649
|
await mkdir.mkdirs(dir);
|
|
5650
5650
|
}
|
|
5651
|
-
await
|
|
5651
|
+
await fs6.link(srcpath, dstpath);
|
|
5652
5652
|
}
|
|
5653
5653
|
function createLinkSync(srcpath, dstpath) {
|
|
5654
5654
|
let dstStat;
|
|
5655
5655
|
try {
|
|
5656
|
-
dstStat =
|
|
5656
|
+
dstStat = fs6.lstatSync(dstpath, { bigint: true });
|
|
5657
5657
|
} catch {
|
|
5658
5658
|
}
|
|
5659
5659
|
try {
|
|
5660
|
-
const srcStat =
|
|
5660
|
+
const srcStat = fs6.lstatSync(srcpath, { bigint: true });
|
|
5661
5661
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
5662
5662
|
} catch (err) {
|
|
5663
5663
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
5664
5664
|
throw err;
|
|
5665
5665
|
}
|
|
5666
|
-
const dir =
|
|
5667
|
-
const dirExists =
|
|
5668
|
-
if (dirExists) return
|
|
5666
|
+
const dir = path10.dirname(dstpath);
|
|
5667
|
+
const dirExists = fs6.existsSync(dir);
|
|
5668
|
+
if (dirExists) return fs6.linkSync(srcpath, dstpath);
|
|
5669
5669
|
mkdir.mkdirsSync(dir);
|
|
5670
|
-
return
|
|
5670
|
+
return fs6.linkSync(srcpath, dstpath);
|
|
5671
5671
|
}
|
|
5672
5672
|
module.exports = {
|
|
5673
5673
|
createLink: u(createLink),
|
|
@@ -5680,14 +5680,14 @@ var require_link = __commonJS({
|
|
|
5680
5680
|
var require_symlink_paths = __commonJS({
|
|
5681
5681
|
"../../node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module) {
|
|
5682
5682
|
"use strict";
|
|
5683
|
-
var
|
|
5684
|
-
var
|
|
5683
|
+
var path10 = __require("path");
|
|
5684
|
+
var fs6 = require_fs();
|
|
5685
5685
|
var { pathExists } = require_path_exists();
|
|
5686
5686
|
var u = require_universalify().fromPromise;
|
|
5687
5687
|
async function symlinkPaths(srcpath, dstpath) {
|
|
5688
|
-
if (
|
|
5688
|
+
if (path10.isAbsolute(srcpath)) {
|
|
5689
5689
|
try {
|
|
5690
|
-
await
|
|
5690
|
+
await fs6.lstat(srcpath);
|
|
5691
5691
|
} catch (err) {
|
|
5692
5692
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5693
5693
|
throw err;
|
|
@@ -5697,8 +5697,8 @@ var require_symlink_paths = __commonJS({
|
|
|
5697
5697
|
toDst: srcpath
|
|
5698
5698
|
};
|
|
5699
5699
|
}
|
|
5700
|
-
const dstdir =
|
|
5701
|
-
const relativeToDst =
|
|
5700
|
+
const dstdir = path10.dirname(dstpath);
|
|
5701
|
+
const relativeToDst = path10.join(dstdir, srcpath);
|
|
5702
5702
|
const exists = await pathExists(relativeToDst);
|
|
5703
5703
|
if (exists) {
|
|
5704
5704
|
return {
|
|
@@ -5707,39 +5707,39 @@ var require_symlink_paths = __commonJS({
|
|
|
5707
5707
|
};
|
|
5708
5708
|
}
|
|
5709
5709
|
try {
|
|
5710
|
-
await
|
|
5710
|
+
await fs6.lstat(srcpath);
|
|
5711
5711
|
} catch (err) {
|
|
5712
5712
|
err.message = err.message.replace("lstat", "ensureSymlink");
|
|
5713
5713
|
throw err;
|
|
5714
5714
|
}
|
|
5715
5715
|
return {
|
|
5716
5716
|
toCwd: srcpath,
|
|
5717
|
-
toDst:
|
|
5717
|
+
toDst: path10.relative(dstdir, srcpath)
|
|
5718
5718
|
};
|
|
5719
5719
|
}
|
|
5720
5720
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
5721
|
-
if (
|
|
5722
|
-
const exists2 =
|
|
5721
|
+
if (path10.isAbsolute(srcpath)) {
|
|
5722
|
+
const exists2 = fs6.existsSync(srcpath);
|
|
5723
5723
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
5724
5724
|
return {
|
|
5725
5725
|
toCwd: srcpath,
|
|
5726
5726
|
toDst: srcpath
|
|
5727
5727
|
};
|
|
5728
5728
|
}
|
|
5729
|
-
const dstdir =
|
|
5730
|
-
const relativeToDst =
|
|
5731
|
-
const exists =
|
|
5729
|
+
const dstdir = path10.dirname(dstpath);
|
|
5730
|
+
const relativeToDst = path10.join(dstdir, srcpath);
|
|
5731
|
+
const exists = fs6.existsSync(relativeToDst);
|
|
5732
5732
|
if (exists) {
|
|
5733
5733
|
return {
|
|
5734
5734
|
toCwd: relativeToDst,
|
|
5735
5735
|
toDst: srcpath
|
|
5736
5736
|
};
|
|
5737
5737
|
}
|
|
5738
|
-
const srcExists =
|
|
5738
|
+
const srcExists = fs6.existsSync(srcpath);
|
|
5739
5739
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
5740
5740
|
return {
|
|
5741
5741
|
toCwd: srcpath,
|
|
5742
|
-
toDst:
|
|
5742
|
+
toDst: path10.relative(dstdir, srcpath)
|
|
5743
5743
|
};
|
|
5744
5744
|
}
|
|
5745
5745
|
module.exports = {
|
|
@@ -5753,13 +5753,13 @@ var require_symlink_paths = __commonJS({
|
|
|
5753
5753
|
var require_symlink_type = __commonJS({
|
|
5754
5754
|
"../../node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module) {
|
|
5755
5755
|
"use strict";
|
|
5756
|
-
var
|
|
5756
|
+
var fs6 = require_fs();
|
|
5757
5757
|
var u = require_universalify().fromPromise;
|
|
5758
5758
|
async function symlinkType(srcpath, type) {
|
|
5759
5759
|
if (type) return type;
|
|
5760
5760
|
let stats;
|
|
5761
5761
|
try {
|
|
5762
|
-
stats = await
|
|
5762
|
+
stats = await fs6.lstat(srcpath);
|
|
5763
5763
|
} catch {
|
|
5764
5764
|
return "file";
|
|
5765
5765
|
}
|
|
@@ -5769,7 +5769,7 @@ var require_symlink_type = __commonJS({
|
|
|
5769
5769
|
if (type) return type;
|
|
5770
5770
|
let stats;
|
|
5771
5771
|
try {
|
|
5772
|
-
stats =
|
|
5772
|
+
stats = fs6.lstatSync(srcpath);
|
|
5773
5773
|
} catch {
|
|
5774
5774
|
return "file";
|
|
5775
5775
|
}
|
|
@@ -5787,8 +5787,8 @@ var require_symlink = __commonJS({
|
|
|
5787
5787
|
"../../node_modules/fs-extra/lib/ensure/symlink.js"(exports, module) {
|
|
5788
5788
|
"use strict";
|
|
5789
5789
|
var u = require_universalify().fromPromise;
|
|
5790
|
-
var
|
|
5791
|
-
var
|
|
5790
|
+
var path10 = __require("path");
|
|
5791
|
+
var fs6 = require_fs();
|
|
5792
5792
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
5793
5793
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
5794
5794
|
var { symlinkType, symlinkTypeSync } = require_symlink_type();
|
|
@@ -5797,25 +5797,25 @@ var require_symlink = __commonJS({
|
|
|
5797
5797
|
async function createSymlink(srcpath, dstpath, type) {
|
|
5798
5798
|
let stats;
|
|
5799
5799
|
try {
|
|
5800
|
-
stats = await
|
|
5800
|
+
stats = await fs6.lstat(dstpath);
|
|
5801
5801
|
} catch {
|
|
5802
5802
|
}
|
|
5803
5803
|
if (stats && stats.isSymbolicLink()) {
|
|
5804
5804
|
let srcStat;
|
|
5805
|
-
if (
|
|
5806
|
-
srcStat = await
|
|
5805
|
+
if (path10.isAbsolute(srcpath)) {
|
|
5806
|
+
srcStat = await fs6.stat(srcpath, { bigint: true });
|
|
5807
5807
|
} else {
|
|
5808
|
-
const dstdir =
|
|
5809
|
-
const relativeToDst =
|
|
5808
|
+
const dstdir = path10.dirname(dstpath);
|
|
5809
|
+
const relativeToDst = path10.join(dstdir, srcpath);
|
|
5810
5810
|
try {
|
|
5811
|
-
srcStat = await
|
|
5811
|
+
srcStat = await fs6.stat(relativeToDst, { bigint: true });
|
|
5812
5812
|
} catch {
|
|
5813
|
-
srcStat = await
|
|
5813
|
+
srcStat = await fs6.stat(srcpath, { bigint: true });
|
|
5814
5814
|
}
|
|
5815
5815
|
}
|
|
5816
5816
|
let dstStat;
|
|
5817
5817
|
try {
|
|
5818
|
-
dstStat = await
|
|
5818
|
+
dstStat = await fs6.stat(dstpath, { bigint: true });
|
|
5819
5819
|
} catch (err) {
|
|
5820
5820
|
if (err.code !== "ENOENT") throw err;
|
|
5821
5821
|
}
|
|
@@ -5824,34 +5824,34 @@ var require_symlink = __commonJS({
|
|
|
5824
5824
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
5825
5825
|
srcpath = relative.toDst;
|
|
5826
5826
|
const toType = await symlinkType(relative.toCwd, type);
|
|
5827
|
-
const dir =
|
|
5827
|
+
const dir = path10.dirname(dstpath);
|
|
5828
5828
|
if (!await pathExists(dir)) {
|
|
5829
5829
|
await mkdirs(dir);
|
|
5830
5830
|
}
|
|
5831
|
-
return
|
|
5831
|
+
return fs6.symlink(srcpath, dstpath, toType);
|
|
5832
5832
|
}
|
|
5833
5833
|
function createSymlinkSync(srcpath, dstpath, type) {
|
|
5834
5834
|
let stats;
|
|
5835
5835
|
try {
|
|
5836
|
-
stats =
|
|
5836
|
+
stats = fs6.lstatSync(dstpath);
|
|
5837
5837
|
} catch {
|
|
5838
5838
|
}
|
|
5839
5839
|
if (stats && stats.isSymbolicLink()) {
|
|
5840
5840
|
let srcStat;
|
|
5841
|
-
if (
|
|
5842
|
-
srcStat =
|
|
5841
|
+
if (path10.isAbsolute(srcpath)) {
|
|
5842
|
+
srcStat = fs6.statSync(srcpath, { bigint: true });
|
|
5843
5843
|
} else {
|
|
5844
|
-
const dstdir =
|
|
5845
|
-
const relativeToDst =
|
|
5844
|
+
const dstdir = path10.dirname(dstpath);
|
|
5845
|
+
const relativeToDst = path10.join(dstdir, srcpath);
|
|
5846
5846
|
try {
|
|
5847
|
-
srcStat =
|
|
5847
|
+
srcStat = fs6.statSync(relativeToDst, { bigint: true });
|
|
5848
5848
|
} catch {
|
|
5849
|
-
srcStat =
|
|
5849
|
+
srcStat = fs6.statSync(srcpath, { bigint: true });
|
|
5850
5850
|
}
|
|
5851
5851
|
}
|
|
5852
5852
|
let dstStat;
|
|
5853
5853
|
try {
|
|
5854
|
-
dstStat =
|
|
5854
|
+
dstStat = fs6.statSync(dstpath, { bigint: true });
|
|
5855
5855
|
} catch (err) {
|
|
5856
5856
|
if (err.code !== "ENOENT") throw err;
|
|
5857
5857
|
}
|
|
@@ -5860,11 +5860,11 @@ var require_symlink = __commonJS({
|
|
|
5860
5860
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
5861
5861
|
srcpath = relative.toDst;
|
|
5862
5862
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
5863
|
-
const dir =
|
|
5864
|
-
const exists =
|
|
5865
|
-
if (exists) return
|
|
5863
|
+
const dir = path10.dirname(dstpath);
|
|
5864
|
+
const exists = fs6.existsSync(dir);
|
|
5865
|
+
if (exists) return fs6.symlinkSync(srcpath, dstpath, type);
|
|
5866
5866
|
mkdirsSync(dir);
|
|
5867
|
-
return
|
|
5867
|
+
return fs6.symlinkSync(srcpath, dstpath, type);
|
|
5868
5868
|
}
|
|
5869
5869
|
module.exports = {
|
|
5870
5870
|
createSymlink: u(createSymlink),
|
|
@@ -5933,9 +5933,9 @@ var require_jsonfile = __commonJS({
|
|
|
5933
5933
|
if (typeof options === "string") {
|
|
5934
5934
|
options = { encoding: options };
|
|
5935
5935
|
}
|
|
5936
|
-
const
|
|
5936
|
+
const fs6 = options.fs || _fs;
|
|
5937
5937
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
5938
|
-
let data = await universalify.fromCallback(
|
|
5938
|
+
let data = await universalify.fromCallback(fs6.readFile)(file2, options);
|
|
5939
5939
|
data = stripBom(data);
|
|
5940
5940
|
let obj;
|
|
5941
5941
|
try {
|
|
@@ -5955,10 +5955,10 @@ var require_jsonfile = __commonJS({
|
|
|
5955
5955
|
if (typeof options === "string") {
|
|
5956
5956
|
options = { encoding: options };
|
|
5957
5957
|
}
|
|
5958
|
-
const
|
|
5958
|
+
const fs6 = options.fs || _fs;
|
|
5959
5959
|
const shouldThrow = "throws" in options ? options.throws : true;
|
|
5960
5960
|
try {
|
|
5961
|
-
let content =
|
|
5961
|
+
let content = fs6.readFileSync(file2, options);
|
|
5962
5962
|
content = stripBom(content);
|
|
5963
5963
|
return JSON.parse(content, options.reviver);
|
|
5964
5964
|
} catch (err) {
|
|
@@ -5971,15 +5971,15 @@ var require_jsonfile = __commonJS({
|
|
|
5971
5971
|
}
|
|
5972
5972
|
}
|
|
5973
5973
|
async function _writeFile(file2, obj, options = {}) {
|
|
5974
|
-
const
|
|
5974
|
+
const fs6 = options.fs || _fs;
|
|
5975
5975
|
const str = stringify(obj, options);
|
|
5976
|
-
await universalify.fromCallback(
|
|
5976
|
+
await universalify.fromCallback(fs6.writeFile)(file2, str, options);
|
|
5977
5977
|
}
|
|
5978
5978
|
var writeFile = universalify.fromPromise(_writeFile);
|
|
5979
5979
|
function writeFileSync2(file2, obj, options = {}) {
|
|
5980
|
-
const
|
|
5980
|
+
const fs6 = options.fs || _fs;
|
|
5981
5981
|
const str = stringify(obj, options);
|
|
5982
|
-
return
|
|
5982
|
+
return fs6.writeFileSync(file2, str, options);
|
|
5983
5983
|
}
|
|
5984
5984
|
module.exports = {
|
|
5985
5985
|
readFile: readFile2,
|
|
@@ -6010,23 +6010,23 @@ var require_output_file = __commonJS({
|
|
|
6010
6010
|
"../../node_modules/fs-extra/lib/output-file/index.js"(exports, module) {
|
|
6011
6011
|
"use strict";
|
|
6012
6012
|
var u = require_universalify().fromPromise;
|
|
6013
|
-
var
|
|
6014
|
-
var
|
|
6013
|
+
var fs6 = require_fs();
|
|
6014
|
+
var path10 = __require("path");
|
|
6015
6015
|
var mkdir = require_mkdirs();
|
|
6016
6016
|
var pathExists = require_path_exists().pathExists;
|
|
6017
6017
|
async function outputFile(file2, data, encoding = "utf-8") {
|
|
6018
|
-
const dir =
|
|
6018
|
+
const dir = path10.dirname(file2);
|
|
6019
6019
|
if (!await pathExists(dir)) {
|
|
6020
6020
|
await mkdir.mkdirs(dir);
|
|
6021
6021
|
}
|
|
6022
|
-
return
|
|
6022
|
+
return fs6.writeFile(file2, data, encoding);
|
|
6023
6023
|
}
|
|
6024
6024
|
function outputFileSync(file2, ...args) {
|
|
6025
|
-
const dir =
|
|
6026
|
-
if (!
|
|
6025
|
+
const dir = path10.dirname(file2);
|
|
6026
|
+
if (!fs6.existsSync(dir)) {
|
|
6027
6027
|
mkdir.mkdirsSync(dir);
|
|
6028
6028
|
}
|
|
6029
|
-
|
|
6029
|
+
fs6.writeFileSync(file2, ...args);
|
|
6030
6030
|
}
|
|
6031
6031
|
module.exports = {
|
|
6032
6032
|
outputFile: u(outputFile),
|
|
@@ -6085,8 +6085,8 @@ var require_json = __commonJS({
|
|
|
6085
6085
|
var require_move = __commonJS({
|
|
6086
6086
|
"../../node_modules/fs-extra/lib/move/move.js"(exports, module) {
|
|
6087
6087
|
"use strict";
|
|
6088
|
-
var
|
|
6089
|
-
var
|
|
6088
|
+
var fs6 = require_fs();
|
|
6089
|
+
var path10 = __require("path");
|
|
6090
6090
|
var { copy } = require_copy2();
|
|
6091
6091
|
var { remove } = require_remove();
|
|
6092
6092
|
var { mkdirp } = require_mkdirs();
|
|
@@ -6096,8 +6096,8 @@ var require_move = __commonJS({
|
|
|
6096
6096
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
6097
6097
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
6098
6098
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
6099
|
-
const destParent =
|
|
6100
|
-
const parsedParentPath =
|
|
6099
|
+
const destParent = path10.dirname(dest);
|
|
6100
|
+
const parsedParentPath = path10.parse(destParent);
|
|
6101
6101
|
if (parsedParentPath.root !== destParent) {
|
|
6102
6102
|
await mkdirp(destParent);
|
|
6103
6103
|
}
|
|
@@ -6112,7 +6112,7 @@ var require_move = __commonJS({
|
|
|
6112
6112
|
}
|
|
6113
6113
|
}
|
|
6114
6114
|
try {
|
|
6115
|
-
await
|
|
6115
|
+
await fs6.rename(src, dest);
|
|
6116
6116
|
} catch (err) {
|
|
6117
6117
|
if (err.code !== "EXDEV") {
|
|
6118
6118
|
throw err;
|
|
@@ -6137,8 +6137,8 @@ var require_move = __commonJS({
|
|
|
6137
6137
|
var require_move_sync = __commonJS({
|
|
6138
6138
|
"../../node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
|
|
6139
6139
|
"use strict";
|
|
6140
|
-
var
|
|
6141
|
-
var
|
|
6140
|
+
var fs6 = require_graceful_fs();
|
|
6141
|
+
var path10 = __require("path");
|
|
6142
6142
|
var copySync = require_copy2().copySync;
|
|
6143
6143
|
var removeSync = require_remove().removeSync;
|
|
6144
6144
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -6148,12 +6148,12 @@ var require_move_sync = __commonJS({
|
|
|
6148
6148
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
6149
6149
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
6150
6150
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
6151
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
6151
|
+
if (!isParentRoot(dest)) mkdirpSync(path10.dirname(dest));
|
|
6152
6152
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
6153
6153
|
}
|
|
6154
6154
|
function isParentRoot(dest) {
|
|
6155
|
-
const parent =
|
|
6156
|
-
const parsedPath =
|
|
6155
|
+
const parent = path10.dirname(dest);
|
|
6156
|
+
const parsedPath = path10.parse(parent);
|
|
6157
6157
|
return parsedPath.root === parent;
|
|
6158
6158
|
}
|
|
6159
6159
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -6162,12 +6162,12 @@ var require_move_sync = __commonJS({
|
|
|
6162
6162
|
removeSync(dest);
|
|
6163
6163
|
return rename(src, dest, overwrite);
|
|
6164
6164
|
}
|
|
6165
|
-
if (
|
|
6165
|
+
if (fs6.existsSync(dest)) throw new Error("dest already exists.");
|
|
6166
6166
|
return rename(src, dest, overwrite);
|
|
6167
6167
|
}
|
|
6168
6168
|
function rename(src, dest, overwrite) {
|
|
6169
6169
|
try {
|
|
6170
|
-
|
|
6170
|
+
fs6.renameSync(src, dest);
|
|
6171
6171
|
} catch (err) {
|
|
6172
6172
|
if (err.code !== "EXDEV") throw err;
|
|
6173
6173
|
return moveAcrossDevice(src, dest, overwrite);
|
|
@@ -7499,7 +7499,7 @@ var CLI_VERSION;
|
|
|
7499
7499
|
var init_version = __esm({
|
|
7500
7500
|
"src/utils/version.ts"() {
|
|
7501
7501
|
"use strict";
|
|
7502
|
-
CLI_VERSION = "5.
|
|
7502
|
+
CLI_VERSION = "5.22.0";
|
|
7503
7503
|
}
|
|
7504
7504
|
});
|
|
7505
7505
|
|
|
@@ -14962,10 +14962,10 @@ var require_lib3 = __commonJS({
|
|
|
14962
14962
|
exports.analyse = analyse;
|
|
14963
14963
|
var detectFile = (filepath, opts = {}) => new Promise((resolve, reject) => {
|
|
14964
14964
|
let fd;
|
|
14965
|
-
const
|
|
14965
|
+
const fs6 = (0, node_1.default)();
|
|
14966
14966
|
const handler = (err, buffer) => {
|
|
14967
14967
|
if (fd) {
|
|
14968
|
-
|
|
14968
|
+
fs6.closeSync(fd);
|
|
14969
14969
|
}
|
|
14970
14970
|
if (err) {
|
|
14971
14971
|
reject(err);
|
|
@@ -14977,9 +14977,9 @@ var require_lib3 = __commonJS({
|
|
|
14977
14977
|
};
|
|
14978
14978
|
const sampleSize = (opts === null || opts === void 0 ? void 0 : opts.sampleSize) || 0;
|
|
14979
14979
|
if (sampleSize > 0) {
|
|
14980
|
-
fd =
|
|
14980
|
+
fd = fs6.openSync(filepath, "r");
|
|
14981
14981
|
let sample = Buffer.allocUnsafe(sampleSize);
|
|
14982
|
-
|
|
14982
|
+
fs6.read(fd, sample, 0, sampleSize, opts.offset, (err, bytesRead) => {
|
|
14983
14983
|
if (err) {
|
|
14984
14984
|
handler(err, null);
|
|
14985
14985
|
} else {
|
|
@@ -14991,22 +14991,22 @@ var require_lib3 = __commonJS({
|
|
|
14991
14991
|
});
|
|
14992
14992
|
return;
|
|
14993
14993
|
}
|
|
14994
|
-
|
|
14994
|
+
fs6.readFile(filepath, handler);
|
|
14995
14995
|
});
|
|
14996
14996
|
exports.detectFile = detectFile;
|
|
14997
14997
|
var detectFileSync = (filepath, opts = {}) => {
|
|
14998
|
-
const
|
|
14998
|
+
const fs6 = (0, node_1.default)();
|
|
14999
14999
|
if (opts && opts.sampleSize) {
|
|
15000
|
-
const fd =
|
|
15000
|
+
const fd = fs6.openSync(filepath, "r");
|
|
15001
15001
|
let sample = Buffer.allocUnsafe(opts.sampleSize);
|
|
15002
|
-
const bytesRead =
|
|
15002
|
+
const bytesRead = fs6.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
|
|
15003
15003
|
if (bytesRead < opts.sampleSize) {
|
|
15004
15004
|
sample = sample.subarray(0, bytesRead);
|
|
15005
15005
|
}
|
|
15006
|
-
|
|
15006
|
+
fs6.closeSync(fd);
|
|
15007
15007
|
return (0, exports.detect)(sample);
|
|
15008
15008
|
}
|
|
15009
|
-
return (0, exports.detect)(
|
|
15009
|
+
return (0, exports.detect)(fs6.readFileSync(filepath));
|
|
15010
15010
|
};
|
|
15011
15011
|
exports.detectFileSync = detectFileSync;
|
|
15012
15012
|
exports.default = {
|
|
@@ -22826,8 +22826,8 @@ var require_utils4 = __commonJS({
|
|
|
22826
22826
|
}
|
|
22827
22827
|
return ind;
|
|
22828
22828
|
}
|
|
22829
|
-
function removeDotSegments(
|
|
22830
|
-
let input =
|
|
22829
|
+
function removeDotSegments(path10) {
|
|
22830
|
+
let input = path10;
|
|
22831
22831
|
const output = [];
|
|
22832
22832
|
let nextSlash = -1;
|
|
22833
22833
|
let len = 0;
|
|
@@ -23079,8 +23079,8 @@ var require_schemes = __commonJS({
|
|
|
23079
23079
|
wsComponent.secure = void 0;
|
|
23080
23080
|
}
|
|
23081
23081
|
if (wsComponent.resourceName) {
|
|
23082
|
-
const [
|
|
23083
|
-
wsComponent.path =
|
|
23082
|
+
const [path10, query] = wsComponent.resourceName.split("?");
|
|
23083
|
+
wsComponent.path = path10 && path10 !== "/" ? path10 : void 0;
|
|
23084
23084
|
wsComponent.query = query;
|
|
23085
23085
|
wsComponent.resourceName = void 0;
|
|
23086
23086
|
}
|
|
@@ -26473,12 +26473,12 @@ var require_dist = __commonJS({
|
|
|
26473
26473
|
throw new Error(`Unknown format "${name}"`);
|
|
26474
26474
|
return f;
|
|
26475
26475
|
};
|
|
26476
|
-
function addFormats(ajv, list,
|
|
26476
|
+
function addFormats(ajv, list, fs6, exportName) {
|
|
26477
26477
|
var _a3;
|
|
26478
26478
|
var _b;
|
|
26479
26479
|
(_a3 = (_b = ajv.opts.code).formats) !== null && _a3 !== void 0 ? _a3 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
26480
26480
|
for (const f of list)
|
|
26481
|
-
ajv.addFormat(f,
|
|
26481
|
+
ajv.addFormat(f, fs6[f]);
|
|
26482
26482
|
}
|
|
26483
26483
|
module.exports = exports = formatsPlugin;
|
|
26484
26484
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -26515,7 +26515,7 @@ var MIGRATION_DOC = `# Migrate this repo to Melt's current model
|
|
|
26515
26515
|
|
|
26516
26516
|
You are reading this because \`meltctl project templates\` was run (most likely by the legacy
|
|
26517
26517
|
\`/melt-update\` skill). The per-repo Melt skill model has been **retired company-wide** and
|
|
26518
|
-
replaced by
|
|
26518
|
+
replaced by the \`melt-dev\` Claude plugin (\`/melt-dev:*\` skills). **This migration is mandatory \u2014 it is not a
|
|
26519
26519
|
content refresh.** Perform the steps below now. Do NOT do a file-by-file template sync, and do
|
|
26520
26520
|
NOT offer to skip, abort, or keep the old files.
|
|
26521
26521
|
|
|
@@ -26534,12 +26534,12 @@ not just Melt boilerplate. **Never delete or "slim" their content** \u2014 not t
|
|
|
26534
26534
|
standards, not their own rules. ADD what's missing:
|
|
26535
26535
|
- A \`## Stack\` block (languages, frameworks, test runner, package manager, database, deploy)
|
|
26536
26536
|
- A \`## Project docs\` index pointing at satellite docs (TECH_DEBT.md, ARCHITECTURE.md, \u2026)
|
|
26537
|
-
- One line noting Melt's universal standards also ship with the \`/melt-dev
|
|
26537
|
+
- One line noting Melt's universal standards also ship with the \`/melt-dev:*\` skills now
|
|
26538
26538
|
|
|
26539
26539
|
**One exception \u2014 replace the retired Melt skill-list.** If AGENTS.md has a \`## Workflow
|
|
26540
26540
|
Skills\` section that is the standard Melt list (a boilerplate intro plus \`/melt-*\` bullets),
|
|
26541
|
-
remove that section as part of this migration: the skills
|
|
26542
|
-
auto-discovered now, so it is obsolete and points at skills you just deleted. Preserve any
|
|
26541
|
+
remove that section as part of this migration: the skills ship as an org plugin and
|
|
26542
|
+
are auto-discovered now, so it is obsolete and points at skills you just deleted. Preserve any
|
|
26543
26543
|
custom entries the developer added inside it. This is the ONLY Melt-authored section the
|
|
26544
26544
|
migration removes \u2014 everything else stays untouched.
|
|
26545
26545
|
|
|
@@ -26568,8 +26568,9 @@ unilaterally deleting their content.
|
|
|
26568
26568
|
|
|
26569
26569
|
## After migrating
|
|
26570
26570
|
|
|
26571
|
-
The \`/melt-dev
|
|
26572
|
-
|
|
26571
|
+
The \`/melt-dev:*\` skills ship as the \`melt-dev\` plugin from the Melt Studio org marketplace
|
|
26572
|
+
and auto-update. If they are not available in your session, sign in to Claude Code with your Melt
|
|
26573
|
+
claude.ai account (\`/status\` shows it) and run \`/reload-plugins\`; if they still don't appear,
|
|
26573
26574
|
raise it in #dev. It is not a reason to stay on the old model.
|
|
26574
26575
|
`;
|
|
26575
26576
|
async function templatesCommand() {
|
|
@@ -26581,7 +26582,7 @@ async function templatesCommand() {
|
|
|
26581
26582
|
source_default.bold.yellow("\u26A0 The per-repo Melt skill model has been retired (company-wide)."),
|
|
26582
26583
|
"This command now hands back MIGRATION INSTRUCTIONS, not a template refresh.",
|
|
26583
26584
|
`\u2192 Follow ${source_default.cyan("MIGRATION.md")} in the directory printed below to migrate this repo now.`,
|
|
26584
|
-
` (In Claude Code with the
|
|
26585
|
+
` (In Claude Code with the melt-dev plugin, ${source_default.cyan("/melt-dev:setup")} does the same migration.)`,
|
|
26585
26586
|
""
|
|
26586
26587
|
].join("\n");
|
|
26587
26588
|
console.error(notice);
|
|
@@ -26621,8 +26622,8 @@ function createAuditsResource(config2) {
|
|
|
26621
26622
|
if (filters?.projectId)
|
|
26622
26623
|
params.set("projectId", String(filters.projectId));
|
|
26623
26624
|
const query = params.toString();
|
|
26624
|
-
const
|
|
26625
|
-
const { data, status } = await apiFetch(config2,
|
|
26625
|
+
const path10 = `/audits${query ? `?${query}` : ""}`;
|
|
26626
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26626
26627
|
if (status === 403)
|
|
26627
26628
|
throw new Error("Access denied. Only Team Managers can list audits.");
|
|
26628
26629
|
if (status !== 200)
|
|
@@ -26671,8 +26672,8 @@ function createPlansResource(config2) {
|
|
|
26671
26672
|
if (filters?.projectId)
|
|
26672
26673
|
params.set("projectId", String(filters.projectId));
|
|
26673
26674
|
const query = params.toString();
|
|
26674
|
-
const
|
|
26675
|
-
const { data, status } = await apiFetch(config2,
|
|
26675
|
+
const path10 = `/plans${query ? `?${query}` : ""}`;
|
|
26676
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26676
26677
|
if (status === 403)
|
|
26677
26678
|
throw new Error(`Access denied. ${data.error ?? ""}`.trim());
|
|
26678
26679
|
if (status !== 200)
|
|
@@ -26714,8 +26715,8 @@ function createPlansResource(config2) {
|
|
|
26714
26715
|
if (filters?.author)
|
|
26715
26716
|
params.set("author", filters.author);
|
|
26716
26717
|
const query = params.toString();
|
|
26717
|
-
const
|
|
26718
|
-
const { data, status } = await apiFetch(config2,
|
|
26718
|
+
const path10 = `/plans/stats${query ? `?${query}` : ""}`;
|
|
26719
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26719
26720
|
if (status === 403)
|
|
26720
26721
|
throw new Error("Access denied. Only Team Managers can view plan stats.");
|
|
26721
26722
|
if (status !== 200)
|
|
@@ -26754,8 +26755,8 @@ function createEventsResource(config2) {
|
|
|
26754
26755
|
if (filters?.projectId)
|
|
26755
26756
|
params.set("projectId", String(filters.projectId));
|
|
26756
26757
|
const query = params.toString();
|
|
26757
|
-
const
|
|
26758
|
-
const { data, status } = await apiFetch(config2,
|
|
26758
|
+
const path10 = `/events${query ? `?${query}` : ""}`;
|
|
26759
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26759
26760
|
if (status === 403)
|
|
26760
26761
|
throw new Error("Access denied. Only Team Managers can view analytics.");
|
|
26761
26762
|
if (status !== 200)
|
|
@@ -26771,8 +26772,8 @@ function createEventsResource(config2) {
|
|
|
26771
26772
|
if (filters?.projectId)
|
|
26772
26773
|
params.set("projectId", String(filters.projectId));
|
|
26773
26774
|
const query = params.toString();
|
|
26774
|
-
const
|
|
26775
|
-
const { data, status } = await apiFetch(config2,
|
|
26775
|
+
const path10 = `/events/stats${query ? `?${query}` : ""}`;
|
|
26776
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26776
26777
|
if (status === 403)
|
|
26777
26778
|
throw new Error("Access denied. Only Team Managers can view analytics.");
|
|
26778
26779
|
if (status !== 200)
|
|
@@ -26806,8 +26807,8 @@ function createStandupsResource(config2) {
|
|
|
26806
26807
|
const params = new URLSearchParams();
|
|
26807
26808
|
if (filters?.projectId)
|
|
26808
26809
|
params.set("projectId", String(filters.projectId));
|
|
26809
|
-
const
|
|
26810
|
-
const { data, status } = await apiFetch(config2,
|
|
26810
|
+
const path10 = `/standups/stats${params.toString() ? `?${params}` : ""}`;
|
|
26811
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26811
26812
|
if (status === 403)
|
|
26812
26813
|
throw new Error("Access denied. Only Team Managers can view standup stats.");
|
|
26813
26814
|
if (status !== 200)
|
|
@@ -26832,8 +26833,8 @@ function createStandupsResource(config2) {
|
|
|
26832
26833
|
const params = new URLSearchParams();
|
|
26833
26834
|
if (opts?.windowDays)
|
|
26834
26835
|
params.set("windowDays", String(opts.windowDays));
|
|
26835
|
-
const
|
|
26836
|
-
const { data, status } = await apiFetch(config2,
|
|
26836
|
+
const path10 = `/standups/per-person-stats${params.toString() ? `?${params}` : ""}`;
|
|
26837
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26837
26838
|
if (status === 403)
|
|
26838
26839
|
throw new Error("Access denied. Only Team Managers can view standup stats.");
|
|
26839
26840
|
if (status !== 200)
|
|
@@ -26891,8 +26892,8 @@ function createFeedbackResource(config2) {
|
|
|
26891
26892
|
if (filters.limit !== void 0)
|
|
26892
26893
|
params.set("limit", String(filters.limit));
|
|
26893
26894
|
const qs = params.toString();
|
|
26894
|
-
const
|
|
26895
|
-
const { data, status } = await apiFetch(config2,
|
|
26895
|
+
const path10 = qs ? `/feedback/dashboard?${qs}` : "/feedback/dashboard";
|
|
26896
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
26896
26897
|
if (status !== 200) {
|
|
26897
26898
|
const err = data.error;
|
|
26898
26899
|
throw new Error(err ?? `Failed to load dashboard feedback (${status})`);
|
|
@@ -26932,22 +26933,6 @@ function createTemplatesResource(config2) {
|
|
|
26932
26933
|
};
|
|
26933
26934
|
}
|
|
26934
26935
|
|
|
26935
|
-
// ../sdk/dist/resources/skills.js
|
|
26936
|
-
function createSkillsResource(config2) {
|
|
26937
|
-
return {
|
|
26938
|
-
async getDevSkills() {
|
|
26939
|
-
const { data, status } = await apiFetch(config2, "/skills/dev", {
|
|
26940
|
-
method: "GET"
|
|
26941
|
-
});
|
|
26942
|
-
if (status !== 200) {
|
|
26943
|
-
const error51 = data.error;
|
|
26944
|
-
throw new Error(error51 ?? `Failed to fetch dev skills (${status})`);
|
|
26945
|
-
}
|
|
26946
|
-
return data;
|
|
26947
|
-
}
|
|
26948
|
-
};
|
|
26949
|
-
}
|
|
26950
|
-
|
|
26951
26936
|
// ../sdk/dist/resources/auth.js
|
|
26952
26937
|
function createAuthResource(config2) {
|
|
26953
26938
|
return {
|
|
@@ -27004,8 +26989,8 @@ function createProjectsResource(config2) {
|
|
|
27004
26989
|
params.set("activeOnly", "true");
|
|
27005
26990
|
if (opts?.includeInternal)
|
|
27006
26991
|
params.set("includeInternal", "true");
|
|
27007
|
-
const
|
|
27008
|
-
const { data, status } = await apiFetch(config2,
|
|
26992
|
+
const path10 = `/projects${params.toString() ? `?${params}` : ""}`;
|
|
26993
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27009
26994
|
if (status === 403)
|
|
27010
26995
|
throw new Error("Access denied. Only Team Managers can view projects.");
|
|
27011
26996
|
if (status !== 200)
|
|
@@ -27075,8 +27060,8 @@ function createFindingsResource(config2) {
|
|
|
27075
27060
|
if (filters?.limit)
|
|
27076
27061
|
params.set("limit", String(filters.limit));
|
|
27077
27062
|
const query = params.toString();
|
|
27078
|
-
const
|
|
27079
|
-
const { data, status } = await apiFetch(config2,
|
|
27063
|
+
const path10 = `/findings${query ? `?${query}` : ""}`;
|
|
27064
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27080
27065
|
if (status === 403)
|
|
27081
27066
|
throw new Error("Access denied. Only Team Managers can list findings.");
|
|
27082
27067
|
if (status !== 200)
|
|
@@ -27098,8 +27083,8 @@ function createFindingsResource(config2) {
|
|
|
27098
27083
|
if (filters?.auditId)
|
|
27099
27084
|
params.set("auditId", filters.auditId);
|
|
27100
27085
|
const query = params.toString();
|
|
27101
|
-
const
|
|
27102
|
-
const { data, status } = await apiFetch(config2,
|
|
27086
|
+
const path10 = `/findings/stats${query ? `?${query}` : ""}`;
|
|
27087
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27103
27088
|
if (status === 403)
|
|
27104
27089
|
throw new Error("Access denied. Only Team Managers can view findings stats.");
|
|
27105
27090
|
if (status !== 200)
|
|
@@ -27262,8 +27247,8 @@ function createBoardAuditsResource(config2) {
|
|
|
27262
27247
|
params.set("projectId", String(filters.projectId));
|
|
27263
27248
|
if (filters?.limit)
|
|
27264
27249
|
params.set("limit", String(filters.limit));
|
|
27265
|
-
const
|
|
27266
|
-
const { data, status } = await apiFetch(config2,
|
|
27250
|
+
const path10 = `/board-audits${params.toString() ? `?${params}` : ""}`;
|
|
27251
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27267
27252
|
if (status === 403)
|
|
27268
27253
|
throw new Error("Access denied. Only Team Managers can view board audits.");
|
|
27269
27254
|
if (status !== 200)
|
|
@@ -27790,8 +27775,8 @@ function createSlackResource(config2) {
|
|
|
27790
27775
|
if (opts?.limit !== void 0)
|
|
27791
27776
|
params.set("limit", String(opts.limit));
|
|
27792
27777
|
const qs = params.toString();
|
|
27793
|
-
const
|
|
27794
|
-
const { data, status } = await apiFetch(config2,
|
|
27778
|
+
const path10 = `/slack/notifications${qs ? `?${qs}` : ""}`;
|
|
27779
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27795
27780
|
if (status === 403)
|
|
27796
27781
|
throw new Error("Access denied. Only Team Managers can view this.");
|
|
27797
27782
|
if (status !== 200)
|
|
@@ -27837,8 +27822,8 @@ function createJobsResource(config2) {
|
|
|
27837
27822
|
if (filters?.limit)
|
|
27838
27823
|
params.set("limit", String(filters.limit));
|
|
27839
27824
|
const query = params.toString();
|
|
27840
|
-
const
|
|
27841
|
-
const { data, status } = await apiFetch(config2,
|
|
27825
|
+
const path10 = `/jobs${query ? `?${query}` : ""}`;
|
|
27826
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27842
27827
|
if (status === 403)
|
|
27843
27828
|
throw new Error("Access denied. Only Team Managers can list jobs.");
|
|
27844
27829
|
if (status !== 200)
|
|
@@ -27988,8 +27973,8 @@ function createProfileAuditsResource(config2) {
|
|
|
27988
27973
|
if (filters?.limit)
|
|
27989
27974
|
params.set("limit", String(filters.limit));
|
|
27990
27975
|
const query = params.toString();
|
|
27991
|
-
const
|
|
27992
|
-
const { data, status } = await apiFetch(config2,
|
|
27976
|
+
const path10 = `/profile-audits${query ? `?${query}` : ""}`;
|
|
27977
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
27993
27978
|
if (status === 403)
|
|
27994
27979
|
throw new Error("Access denied. Only Team Managers can list profile audits.");
|
|
27995
27980
|
if (status !== 200)
|
|
@@ -28046,8 +28031,8 @@ function createSupportEffortResource(config2) {
|
|
|
28046
28031
|
if (opts.period)
|
|
28047
28032
|
params.set("period", opts.period);
|
|
28048
28033
|
const query = params.toString();
|
|
28049
|
-
const
|
|
28050
|
-
const { data, status } = await apiFetch(config2,
|
|
28034
|
+
const path10 = query ? `/support-effort?${query}` : "/support-effort";
|
|
28035
|
+
const { data, status } = await apiFetch(config2, path10);
|
|
28051
28036
|
if (status === 403)
|
|
28052
28037
|
throw new Error("Access denied. Only Team Managers can view support effort.");
|
|
28053
28038
|
if (status !== 200) {
|
|
@@ -28072,7 +28057,7 @@ function buildSignal(timeoutMs, caller) {
|
|
|
28072
28057
|
const anyFn = AbortSignal.any;
|
|
28073
28058
|
return anyFn ? anyFn([caller, timeout]) : timeout;
|
|
28074
28059
|
}
|
|
28075
|
-
async function apiFetch(config2,
|
|
28060
|
+
async function apiFetch(config2, path10, options = {}) {
|
|
28076
28061
|
const method = (options.method ?? "GET").toUpperCase();
|
|
28077
28062
|
const idempotent = method === "GET" || method === "HEAD";
|
|
28078
28063
|
const timeoutMs = config2.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
@@ -28080,7 +28065,7 @@ async function apiFetch(config2, path11, options = {}) {
|
|
|
28080
28065
|
let lastError;
|
|
28081
28066
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
28082
28067
|
try {
|
|
28083
|
-
const response = await fetch(`${config2.baseUrl}${
|
|
28068
|
+
const response = await fetch(`${config2.baseUrl}${path10}`, {
|
|
28084
28069
|
...options,
|
|
28085
28070
|
signal: buildSignal(timeoutMs, options.signal),
|
|
28086
28071
|
headers: {
|
|
@@ -28116,7 +28101,6 @@ function createMeltClient(config2) {
|
|
|
28116
28101
|
feedback: createFeedbackResource(config2),
|
|
28117
28102
|
coins: createCoinsResource(config2),
|
|
28118
28103
|
templates: createTemplatesResource(config2),
|
|
28119
|
-
skills: createSkillsResource(config2),
|
|
28120
28104
|
auth: createAuthResource(config2),
|
|
28121
28105
|
people: createPeopleResource(config2),
|
|
28122
28106
|
projects: createProjectsResource(config2),
|
|
@@ -28901,10 +28885,10 @@ function mergeDefs(...defs) {
|
|
|
28901
28885
|
function cloneDef(schema) {
|
|
28902
28886
|
return mergeDefs(schema._zod.def);
|
|
28903
28887
|
}
|
|
28904
|
-
function getElementAtPath(obj,
|
|
28905
|
-
if (!
|
|
28888
|
+
function getElementAtPath(obj, path10) {
|
|
28889
|
+
if (!path10)
|
|
28906
28890
|
return obj;
|
|
28907
|
-
return
|
|
28891
|
+
return path10.reduce((acc, key) => acc?.[key], obj);
|
|
28908
28892
|
}
|
|
28909
28893
|
function promiseAllObject(promisesObj) {
|
|
28910
28894
|
const keys = Object.keys(promisesObj);
|
|
@@ -29313,11 +29297,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
29313
29297
|
}
|
|
29314
29298
|
return false;
|
|
29315
29299
|
}
|
|
29316
|
-
function prefixIssues(
|
|
29300
|
+
function prefixIssues(path10, issues) {
|
|
29317
29301
|
return issues.map((iss) => {
|
|
29318
29302
|
var _a3;
|
|
29319
29303
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
29320
|
-
iss.path.unshift(
|
|
29304
|
+
iss.path.unshift(path10);
|
|
29321
29305
|
return iss;
|
|
29322
29306
|
});
|
|
29323
29307
|
}
|
|
@@ -29464,16 +29448,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
29464
29448
|
}
|
|
29465
29449
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
29466
29450
|
const fieldErrors = { _errors: [] };
|
|
29467
|
-
const processError = (error52,
|
|
29451
|
+
const processError = (error52, path10 = []) => {
|
|
29468
29452
|
for (const issue2 of error52.issues) {
|
|
29469
29453
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
29470
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
29454
|
+
issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
|
|
29471
29455
|
} else if (issue2.code === "invalid_key") {
|
|
29472
|
-
processError({ issues: issue2.issues }, [...
|
|
29456
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
29473
29457
|
} else if (issue2.code === "invalid_element") {
|
|
29474
|
-
processError({ issues: issue2.issues }, [...
|
|
29458
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
29475
29459
|
} else {
|
|
29476
|
-
const fullpath = [...
|
|
29460
|
+
const fullpath = [...path10, ...issue2.path];
|
|
29477
29461
|
if (fullpath.length === 0) {
|
|
29478
29462
|
fieldErrors._errors.push(mapper(issue2));
|
|
29479
29463
|
} else {
|
|
@@ -29500,17 +29484,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
29500
29484
|
}
|
|
29501
29485
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
29502
29486
|
const result = { errors: [] };
|
|
29503
|
-
const processError = (error52,
|
|
29487
|
+
const processError = (error52, path10 = []) => {
|
|
29504
29488
|
var _a3, _b;
|
|
29505
29489
|
for (const issue2 of error52.issues) {
|
|
29506
29490
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
29507
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
29491
|
+
issue2.errors.map((issues) => processError({ issues }, [...path10, ...issue2.path]));
|
|
29508
29492
|
} else if (issue2.code === "invalid_key") {
|
|
29509
|
-
processError({ issues: issue2.issues }, [...
|
|
29493
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
29510
29494
|
} else if (issue2.code === "invalid_element") {
|
|
29511
|
-
processError({ issues: issue2.issues }, [...
|
|
29495
|
+
processError({ issues: issue2.issues }, [...path10, ...issue2.path]);
|
|
29512
29496
|
} else {
|
|
29513
|
-
const fullpath = [...
|
|
29497
|
+
const fullpath = [...path10, ...issue2.path];
|
|
29514
29498
|
if (fullpath.length === 0) {
|
|
29515
29499
|
result.errors.push(mapper(issue2));
|
|
29516
29500
|
continue;
|
|
@@ -29542,8 +29526,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
29542
29526
|
}
|
|
29543
29527
|
function toDotPath(_path) {
|
|
29544
29528
|
const segs = [];
|
|
29545
|
-
const
|
|
29546
|
-
for (const seg of
|
|
29529
|
+
const path10 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
29530
|
+
for (const seg of path10) {
|
|
29547
29531
|
if (typeof seg === "number")
|
|
29548
29532
|
segs.push(`[${seg}]`);
|
|
29549
29533
|
else if (typeof seg === "symbol")
|
|
@@ -42235,13 +42219,13 @@ function resolveRef(ref, ctx) {
|
|
|
42235
42219
|
if (!ref.startsWith("#")) {
|
|
42236
42220
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
42237
42221
|
}
|
|
42238
|
-
const
|
|
42239
|
-
if (
|
|
42222
|
+
const path10 = ref.slice(1).split("/").filter(Boolean);
|
|
42223
|
+
if (path10.length === 0) {
|
|
42240
42224
|
return ctx.rootSchema;
|
|
42241
42225
|
}
|
|
42242
42226
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
42243
|
-
if (
|
|
42244
|
-
const key =
|
|
42227
|
+
if (path10[0] === defsKey) {
|
|
42228
|
+
const key = path10[1];
|
|
42245
42229
|
if (!key || !ctx.defs[key]) {
|
|
42246
42230
|
throw new Error(`Reference not found: ${ref}`);
|
|
42247
42231
|
}
|
|
@@ -43071,7 +43055,7 @@ var ISSUE_RULES = [
|
|
|
43071
43055
|
severity: "low",
|
|
43072
43056
|
label: "Never audited",
|
|
43073
43057
|
category: "audits",
|
|
43074
|
-
howToFix: "Run `/melt-dev
|
|
43058
|
+
howToFix: "Run `/melt-dev:tech-audit` on the repo to create the baseline",
|
|
43075
43059
|
scope: "project",
|
|
43076
43060
|
suppressedInStatuses: ["commercial"]
|
|
43077
43061
|
},
|
|
@@ -43082,7 +43066,7 @@ var ISSUE_RULES = [
|
|
|
43082
43066
|
severity: "low",
|
|
43083
43067
|
label: "Audit over 90 days old",
|
|
43084
43068
|
category: "audits",
|
|
43085
|
-
howToFix: "Run `/melt-dev
|
|
43069
|
+
howToFix: "Run `/melt-dev:tech-audit` on the repo to refresh the baseline",
|
|
43086
43070
|
scope: "project"
|
|
43087
43071
|
},
|
|
43088
43072
|
{
|
|
@@ -43095,7 +43079,7 @@ var ISSUE_RULES = [
|
|
|
43095
43079
|
severity: "low",
|
|
43096
43080
|
label: "Audit overdue (30+ days)",
|
|
43097
43081
|
category: "audits",
|
|
43098
|
-
howToFix: "A repo's last audit is over 30 days old \u2014 re-run `/melt-dev
|
|
43082
|
+
howToFix: "A repo's last audit is over 30 days old \u2014 re-run `/melt-dev:tech-audit` (or the relevant audit skill) to refresh the findings.",
|
|
43099
43083
|
scope: "project"
|
|
43100
43084
|
},
|
|
43101
43085
|
{
|
|
@@ -43105,7 +43089,7 @@ var ISSUE_RULES = [
|
|
|
43105
43089
|
severity: "low",
|
|
43106
43090
|
label: "Some repos never audited",
|
|
43107
43091
|
category: "audits",
|
|
43108
|
-
howToFix: "Run `/melt-dev
|
|
43092
|
+
howToFix: "Run `/melt-dev:tech-audit` on each unaudited repo to create its baseline",
|
|
43109
43093
|
scope: "project",
|
|
43110
43094
|
suppressedInStatuses: ["commercial"]
|
|
43111
43095
|
},
|
|
@@ -43413,271 +43397,6 @@ async function logoutCommand() {
|
|
|
43413
43397
|
// src/index.ts
|
|
43414
43398
|
init_version_check();
|
|
43415
43399
|
|
|
43416
|
-
// src/utils/skills-sync.ts
|
|
43417
|
-
init_source();
|
|
43418
|
-
|
|
43419
|
-
// src/utils/debug.ts
|
|
43420
|
-
init_source();
|
|
43421
|
-
function debugLog(message) {
|
|
43422
|
-
if (process.env["MELTCTL_DEBUG"]) {
|
|
43423
|
-
console.error(source_default.dim(`[debug] ${message}`));
|
|
43424
|
-
}
|
|
43425
|
-
}
|
|
43426
|
-
|
|
43427
|
-
// src/commands/skills.ts
|
|
43428
|
-
init_source();
|
|
43429
|
-
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
43430
|
-
import { createHash } from "crypto";
|
|
43431
|
-
import os5 from "os";
|
|
43432
|
-
import path6 from "path";
|
|
43433
|
-
|
|
43434
|
-
// src/utils/api.ts
|
|
43435
|
-
init_source();
|
|
43436
|
-
async function getToken() {
|
|
43437
|
-
const envToken = process.env["MELTCTL_TOKEN"];
|
|
43438
|
-
if (envToken) {
|
|
43439
|
-
return envToken;
|
|
43440
|
-
}
|
|
43441
|
-
const auth = await getStoredAuth();
|
|
43442
|
-
if (!auth) {
|
|
43443
|
-
console.error(
|
|
43444
|
-
source_default.red(
|
|
43445
|
-
"Not authenticated. Run `npx @meltstudio/meltctl@latest login` or set MELTCTL_TOKEN for CI."
|
|
43446
|
-
)
|
|
43447
|
-
);
|
|
43448
|
-
process.exit(1);
|
|
43449
|
-
}
|
|
43450
|
-
if (new Date(auth.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
43451
|
-
console.error(
|
|
43452
|
-
source_default.red(
|
|
43453
|
-
"Session expired. Run `npx @meltstudio/meltctl@latest login` to re-authenticate, or set MELTCTL_TOKEN for CI."
|
|
43454
|
-
)
|
|
43455
|
-
);
|
|
43456
|
-
process.exit(1);
|
|
43457
|
-
}
|
|
43458
|
-
return auth.token;
|
|
43459
|
-
}
|
|
43460
|
-
async function getClient() {
|
|
43461
|
-
const token = await getToken();
|
|
43462
|
-
return createMeltClient({ baseUrl: API_BASE, token });
|
|
43463
|
-
}
|
|
43464
|
-
|
|
43465
|
-
// src/commands/skills.ts
|
|
43466
|
-
var MARKER_FILE = ".melt-skills.json";
|
|
43467
|
-
function getSkillsRoot() {
|
|
43468
|
-
const configDir = process.env["CLAUDE_CONFIG_DIR"];
|
|
43469
|
-
if (configDir) {
|
|
43470
|
-
return path6.join(configDir, "skills");
|
|
43471
|
-
}
|
|
43472
|
-
return path6.join(os5.homedir(), ".claude", "skills");
|
|
43473
|
-
}
|
|
43474
|
-
function getSkillsRoots() {
|
|
43475
|
-
const roots = [getSkillsRoot()];
|
|
43476
|
-
if (import_fs_extra3.default.existsSync(path6.join(os5.homedir(), ".cursor"))) {
|
|
43477
|
-
roots.push(path6.join(os5.homedir(), ".cursor", "skills"));
|
|
43478
|
-
}
|
|
43479
|
-
return roots;
|
|
43480
|
-
}
|
|
43481
|
-
function computeSkillHash(files) {
|
|
43482
|
-
const hash2 = createHash("sha256");
|
|
43483
|
-
for (const filePath of Object.keys(files).sort()) {
|
|
43484
|
-
hash2.update(filePath);
|
|
43485
|
-
hash2.update(files[filePath] ?? "");
|
|
43486
|
-
}
|
|
43487
|
-
return hash2.digest("hex").slice(0, 12);
|
|
43488
|
-
}
|
|
43489
|
-
function readMarker(skillsRoot) {
|
|
43490
|
-
const markerPath = path6.join(skillsRoot, MARKER_FILE);
|
|
43491
|
-
if (!import_fs_extra3.default.existsSync(markerPath)) return null;
|
|
43492
|
-
try {
|
|
43493
|
-
const raw = import_fs_extra3.default.readJsonSync(markerPath);
|
|
43494
|
-
const skills2 = Array.isArray(raw.skills) ? raw.skills.map((entry) => {
|
|
43495
|
-
if (typeof entry === "string") {
|
|
43496
|
-
return { name: entry, hash: "" };
|
|
43497
|
-
}
|
|
43498
|
-
if (entry && typeof entry === "object") {
|
|
43499
|
-
const e = entry;
|
|
43500
|
-
return {
|
|
43501
|
-
name: typeof e.name === "string" ? e.name : "",
|
|
43502
|
-
hash: typeof e.hash === "string" ? e.hash : ""
|
|
43503
|
-
};
|
|
43504
|
-
}
|
|
43505
|
-
return { name: "", hash: "" };
|
|
43506
|
-
}) : [];
|
|
43507
|
-
return {
|
|
43508
|
-
version: typeof raw.version === "string" ? raw.version : "",
|
|
43509
|
-
installedAt: typeof raw.installedAt === "string" ? raw.installedAt : "",
|
|
43510
|
-
lastCheckedAt: typeof raw.lastCheckedAt === "string" ? raw.lastCheckedAt : void 0,
|
|
43511
|
-
skills: skills2
|
|
43512
|
-
};
|
|
43513
|
-
} catch {
|
|
43514
|
-
return null;
|
|
43515
|
-
}
|
|
43516
|
-
}
|
|
43517
|
-
function computeDiff(previous, next) {
|
|
43518
|
-
const prevByName = new Map(previous.map((s) => [s.name, s]));
|
|
43519
|
-
const nextNames = new Set(next.map((s) => s.name));
|
|
43520
|
-
const added = [];
|
|
43521
|
-
const changed = [];
|
|
43522
|
-
for (const skill of next) {
|
|
43523
|
-
const prev = prevByName.get(skill.name);
|
|
43524
|
-
if (!prev) {
|
|
43525
|
-
added.push(skill.name);
|
|
43526
|
-
continue;
|
|
43527
|
-
}
|
|
43528
|
-
if (prev.hash && prev.hash !== skill.hash) {
|
|
43529
|
-
changed.push(skill.name);
|
|
43530
|
-
}
|
|
43531
|
-
}
|
|
43532
|
-
const removed = previous.filter((s) => s.name && !nextNames.has(s.name)).map((s) => s.name);
|
|
43533
|
-
return { added, changed, removed };
|
|
43534
|
-
}
|
|
43535
|
-
function applyDevSkills(manifest, skillsRoot) {
|
|
43536
|
-
const previous = readMarker(skillsRoot)?.skills ?? [];
|
|
43537
|
-
const nextEntries = manifest.skills.map((s) => ({
|
|
43538
|
-
name: s.name,
|
|
43539
|
-
hash: computeSkillHash(s.files)
|
|
43540
|
-
}));
|
|
43541
|
-
const diff = computeDiff(previous, nextEntries);
|
|
43542
|
-
for (const name of diff.removed) {
|
|
43543
|
-
import_fs_extra3.default.removeSync(path6.join(skillsRoot, name));
|
|
43544
|
-
}
|
|
43545
|
-
for (const skill of manifest.skills) {
|
|
43546
|
-
const dir = path6.join(skillsRoot, skill.name);
|
|
43547
|
-
import_fs_extra3.default.removeSync(dir);
|
|
43548
|
-
for (const [relPath, content] of Object.entries(skill.files)) {
|
|
43549
|
-
import_fs_extra3.default.outputFileSync(path6.join(dir, relPath), content);
|
|
43550
|
-
}
|
|
43551
|
-
}
|
|
43552
|
-
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
43553
|
-
const marker = {
|
|
43554
|
-
version: manifest.version,
|
|
43555
|
-
installedAt: now,
|
|
43556
|
-
lastCheckedAt: now,
|
|
43557
|
-
skills: nextEntries
|
|
43558
|
-
};
|
|
43559
|
-
import_fs_extra3.default.outputFileSync(path6.join(skillsRoot, MARKER_FILE), `${JSON.stringify(marker, null, 2)}
|
|
43560
|
-
`);
|
|
43561
|
-
return diff;
|
|
43562
|
-
}
|
|
43563
|
-
function touchMarkerLastChecked(skillsRoot) {
|
|
43564
|
-
const marker = readMarker(skillsRoot);
|
|
43565
|
-
if (!marker) return;
|
|
43566
|
-
marker.lastCheckedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
43567
|
-
import_fs_extra3.default.outputFileSync(path6.join(skillsRoot, MARKER_FILE), `${JSON.stringify(marker, null, 2)}
|
|
43568
|
-
`);
|
|
43569
|
-
}
|
|
43570
|
-
async function skillsInstallCommand(opts) {
|
|
43571
|
-
const client = await getClient();
|
|
43572
|
-
let manifest;
|
|
43573
|
-
try {
|
|
43574
|
-
manifest = await client.skills.getDevSkills();
|
|
43575
|
-
} catch (error51) {
|
|
43576
|
-
console.error(
|
|
43577
|
-
source_default.red(
|
|
43578
|
-
`Failed to fetch Melt dev skills: ${error51 instanceof Error ? error51.message : "Unknown error"}`
|
|
43579
|
-
)
|
|
43580
|
-
);
|
|
43581
|
-
process.exit(1);
|
|
43582
|
-
}
|
|
43583
|
-
const roots = opts.path ? [path6.resolve(opts.path)] : getSkillsRoots();
|
|
43584
|
-
const stale = opts.force ? roots : roots.filter((root) => readMarker(root)?.version !== manifest.version);
|
|
43585
|
-
if (stale.length === 0) {
|
|
43586
|
-
console.log(
|
|
43587
|
-
source_default.dim(
|
|
43588
|
-
`
|
|
43589
|
-
Melt dev skills already up to date (v${manifest.version}). Use --force to reinstall.
|
|
43590
|
-
`
|
|
43591
|
-
)
|
|
43592
|
-
);
|
|
43593
|
-
return;
|
|
43594
|
-
}
|
|
43595
|
-
for (const root of stale) {
|
|
43596
|
-
applyDevSkills(manifest, root);
|
|
43597
|
-
}
|
|
43598
|
-
const where = stale.map((root) => `${root.replace(os5.homedir(), "~")}/`).join(" and ");
|
|
43599
|
-
console.log(
|
|
43600
|
-
source_default.green(
|
|
43601
|
-
`
|
|
43602
|
-
\u2713 Installed ${manifest.skills.length} Melt dev skills (v${manifest.version}) to ${where}.`
|
|
43603
|
-
)
|
|
43604
|
-
);
|
|
43605
|
-
console.log(
|
|
43606
|
-
source_default.dim(
|
|
43607
|
-
" Restart Claude Code / Cursor to load them (they appear as /melt-dev-plan, /melt-dev-review, \u2026).\n"
|
|
43608
|
-
)
|
|
43609
|
-
);
|
|
43610
|
-
}
|
|
43611
|
-
|
|
43612
|
-
// src/utils/skills-sync.ts
|
|
43613
|
-
var TWENTY_FOUR_HOURS_MS = 24 * 60 * 60 * 1e3;
|
|
43614
|
-
var SKIP_SYNC_COMMANDS = /* @__PURE__ */ new Set(["skills", "login", "logout", "update", "version"]);
|
|
43615
|
-
function formatSyncNotice(oldVersion, newVersion, diff) {
|
|
43616
|
-
const groups = [];
|
|
43617
|
-
if (diff.changed.length > 0) groups.push(`changed ${diff.changed.join(", ")}`);
|
|
43618
|
-
if (diff.added.length > 0) groups.push(`added ${diff.added.join(", ")}`);
|
|
43619
|
-
if (diff.removed.length > 0) groups.push(`removed ${diff.removed.join(", ")}`);
|
|
43620
|
-
const suffix = groups.length > 0 ? `: ${groups.join("; ")}` : "";
|
|
43621
|
-
return `\u2191 Melt dev skills updated (v${oldVersion} \u2192 v${newVersion})${suffix}`;
|
|
43622
|
-
}
|
|
43623
|
-
function isCheckDue(lastCheckedAt, now) {
|
|
43624
|
-
if (!lastCheckedAt) return true;
|
|
43625
|
-
const last = Date.parse(lastCheckedAt);
|
|
43626
|
-
if (Number.isNaN(last)) return true;
|
|
43627
|
-
return now - last >= TWENTY_FOUR_HOURS_MS;
|
|
43628
|
-
}
|
|
43629
|
-
async function maybeSyncSkills(commandName) {
|
|
43630
|
-
try {
|
|
43631
|
-
if (process.env["MELTCTL_SKIP_SKILLS_SYNC"]) {
|
|
43632
|
-
debugLog("Skills sync disabled via MELTCTL_SKIP_SKILLS_SYNC");
|
|
43633
|
-
return;
|
|
43634
|
-
}
|
|
43635
|
-
if (commandName && SKIP_SYNC_COMMANDS.has(commandName)) {
|
|
43636
|
-
debugLog(`Skills sync skipped for command "${commandName}"`);
|
|
43637
|
-
return;
|
|
43638
|
-
}
|
|
43639
|
-
const auth = await getStoredAuth();
|
|
43640
|
-
if (!auth || new Date(auth.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
43641
|
-
debugLog("Skills sync skipped: not authenticated or token expired");
|
|
43642
|
-
return;
|
|
43643
|
-
}
|
|
43644
|
-
const skillsRoot = getSkillsRoot();
|
|
43645
|
-
const marker = readMarker(skillsRoot);
|
|
43646
|
-
if (!marker) {
|
|
43647
|
-
debugLog("Skills sync skipped: no skills marker (not installed)");
|
|
43648
|
-
return;
|
|
43649
|
-
}
|
|
43650
|
-
if (!isCheckDue(marker.lastCheckedAt, Date.now())) {
|
|
43651
|
-
debugLog("Skills sync skipped: checked within the last 24h");
|
|
43652
|
-
return;
|
|
43653
|
-
}
|
|
43654
|
-
const client = createMeltClient({ baseUrl: API_BASE, token: auth.token });
|
|
43655
|
-
let manifest;
|
|
43656
|
-
try {
|
|
43657
|
-
manifest = await client.skills.getDevSkills();
|
|
43658
|
-
} catch (e) {
|
|
43659
|
-
touchMarkerLastChecked(skillsRoot);
|
|
43660
|
-
debugLog(`Skills sync fetch error: ${e instanceof Error ? e.message : e}`);
|
|
43661
|
-
return;
|
|
43662
|
-
}
|
|
43663
|
-
if (manifest.version === marker.version) {
|
|
43664
|
-
touchMarkerLastChecked(skillsRoot);
|
|
43665
|
-
debugLog("Skills sync: already up to date");
|
|
43666
|
-
return;
|
|
43667
|
-
}
|
|
43668
|
-
const oldVersion = marker.version;
|
|
43669
|
-
let diff = { added: [], changed: [], removed: [] };
|
|
43670
|
-
for (const root of getSkillsRoots()) {
|
|
43671
|
-
const rootDiff = applyDevSkills(manifest, root);
|
|
43672
|
-
if (root === skillsRoot) diff = rootDiff;
|
|
43673
|
-
}
|
|
43674
|
-
console.log(source_default.dim(source_default.green(formatSyncNotice(oldVersion, manifest.version, diff))));
|
|
43675
|
-
debugLog(`Skills sync: updated ${oldVersion} \u2192 ${manifest.version}`);
|
|
43676
|
-
} catch (e) {
|
|
43677
|
-
debugLog(`Skills sync error: ${e instanceof Error ? e.message : e}`);
|
|
43678
|
-
}
|
|
43679
|
-
}
|
|
43680
|
-
|
|
43681
43400
|
// src/commands/version.ts
|
|
43682
43401
|
init_source();
|
|
43683
43402
|
init_version_check();
|
|
@@ -43774,6 +43493,39 @@ async function versionCheckCommand() {
|
|
|
43774
43493
|
// src/commands/standup.ts
|
|
43775
43494
|
init_source();
|
|
43776
43495
|
init_dist11();
|
|
43496
|
+
|
|
43497
|
+
// src/utils/api.ts
|
|
43498
|
+
init_source();
|
|
43499
|
+
async function getToken() {
|
|
43500
|
+
const envToken = process.env["MELTCTL_TOKEN"];
|
|
43501
|
+
if (envToken) {
|
|
43502
|
+
return envToken;
|
|
43503
|
+
}
|
|
43504
|
+
const auth = await getStoredAuth();
|
|
43505
|
+
if (!auth) {
|
|
43506
|
+
console.error(
|
|
43507
|
+
source_default.red(
|
|
43508
|
+
"Not authenticated. Run `npx @meltstudio/meltctl@latest login` or set MELTCTL_TOKEN for CI."
|
|
43509
|
+
)
|
|
43510
|
+
);
|
|
43511
|
+
process.exit(1);
|
|
43512
|
+
}
|
|
43513
|
+
if (new Date(auth.expiresAt) <= /* @__PURE__ */ new Date()) {
|
|
43514
|
+
console.error(
|
|
43515
|
+
source_default.red(
|
|
43516
|
+
"Session expired. Run `npx @meltstudio/meltctl@latest login` to re-authenticate, or set MELTCTL_TOKEN for CI."
|
|
43517
|
+
)
|
|
43518
|
+
);
|
|
43519
|
+
process.exit(1);
|
|
43520
|
+
}
|
|
43521
|
+
return auth.token;
|
|
43522
|
+
}
|
|
43523
|
+
async function getClient() {
|
|
43524
|
+
const token = await getToken();
|
|
43525
|
+
return createMeltClient({ baseUrl: API_BASE, token });
|
|
43526
|
+
}
|
|
43527
|
+
|
|
43528
|
+
// src/commands/standup.ts
|
|
43777
43529
|
var EDITOR_HINT = source_default.dim("(type \\e to open your editor)");
|
|
43778
43530
|
async function promptField(message, required2) {
|
|
43779
43531
|
const value = await dist_default7({ message: `${message} ${EDITOR_HINT}` });
|
|
@@ -43995,12 +43747,12 @@ async function showLeaderboard() {
|
|
|
43995
43747
|
|
|
43996
43748
|
// src/commands/audit.ts
|
|
43997
43749
|
init_source();
|
|
43998
|
-
var import_fs_extra5 = __toESM(require_lib(), 1);
|
|
43999
|
-
import path8 from "path";
|
|
44000
|
-
|
|
44001
|
-
// src/utils/git.ts
|
|
44002
43750
|
var import_fs_extra4 = __toESM(require_lib(), 1);
|
|
44003
43751
|
import path7 from "path";
|
|
43752
|
+
|
|
43753
|
+
// src/utils/git.ts
|
|
43754
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
43755
|
+
import path6 from "path";
|
|
44004
43756
|
import { execSync as execSync4 } from "child_process";
|
|
44005
43757
|
function getGitBranch() {
|
|
44006
43758
|
try {
|
|
@@ -44038,34 +43790,34 @@ function getGitRepository() {
|
|
|
44038
43790
|
function getProjectName() {
|
|
44039
43791
|
const cwd = process.cwd();
|
|
44040
43792
|
try {
|
|
44041
|
-
const pkgPath =
|
|
44042
|
-
if (
|
|
44043
|
-
const pkg =
|
|
43793
|
+
const pkgPath = path6.join(cwd, "package.json");
|
|
43794
|
+
if (import_fs_extra3.default.pathExistsSync(pkgPath)) {
|
|
43795
|
+
const pkg = import_fs_extra3.default.readJsonSync(pkgPath);
|
|
44044
43796
|
if (pkg.name) {
|
|
44045
43797
|
return pkg.name;
|
|
44046
43798
|
}
|
|
44047
43799
|
}
|
|
44048
43800
|
} catch {
|
|
44049
43801
|
}
|
|
44050
|
-
return
|
|
43802
|
+
return path6.basename(cwd);
|
|
44051
43803
|
}
|
|
44052
43804
|
function extractTicketId(branch) {
|
|
44053
43805
|
const match = branch.match(/([A-Z]+-\d+)/i);
|
|
44054
43806
|
return match ? match[1] : null;
|
|
44055
43807
|
}
|
|
44056
43808
|
async function findMdFiles(dir) {
|
|
44057
|
-
if (!await
|
|
43809
|
+
if (!await import_fs_extra3.default.pathExists(dir)) {
|
|
44058
43810
|
return [];
|
|
44059
43811
|
}
|
|
44060
43812
|
const results = [];
|
|
44061
43813
|
async function walk(current) {
|
|
44062
|
-
const entries = await
|
|
43814
|
+
const entries = await import_fs_extra3.default.readdir(current, { withFileTypes: true });
|
|
44063
43815
|
for (const entry of entries) {
|
|
44064
|
-
const fullPath =
|
|
43816
|
+
const fullPath = path6.join(current, entry.name);
|
|
44065
43817
|
if (entry.isDirectory()) {
|
|
44066
43818
|
await walk(fullPath);
|
|
44067
43819
|
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
44068
|
-
const stat = await
|
|
43820
|
+
const stat = await import_fs_extra3.default.stat(fullPath);
|
|
44069
43821
|
results.push({ path: fullPath, mtime: stat.mtimeMs });
|
|
44070
43822
|
}
|
|
44071
43823
|
}
|
|
@@ -44085,15 +43837,15 @@ function detectAuditType(filename) {
|
|
|
44085
43837
|
}
|
|
44086
43838
|
async function autoDetectAuditFile() {
|
|
44087
43839
|
const cwd = process.cwd();
|
|
44088
|
-
const auditsDir =
|
|
43840
|
+
const auditsDir = path7.join(cwd, ".audits");
|
|
44089
43841
|
const auditFiles = await findMdFiles(auditsDir);
|
|
44090
43842
|
if (auditFiles.length > 0) {
|
|
44091
43843
|
return auditFiles[0] ?? null;
|
|
44092
43844
|
}
|
|
44093
43845
|
const candidates = ["AUDIT.md", "UX-AUDIT.md", "SECURITY-AUDIT.md"];
|
|
44094
43846
|
for (const name of candidates) {
|
|
44095
|
-
const filePath =
|
|
44096
|
-
if (await
|
|
43847
|
+
const filePath = path7.join(cwd, name);
|
|
43848
|
+
if (await import_fs_extra4.default.pathExists(filePath)) {
|
|
44097
43849
|
return filePath;
|
|
44098
43850
|
}
|
|
44099
43851
|
}
|
|
@@ -44103,7 +43855,7 @@ async function auditSubmitCommand(file2) {
|
|
|
44103
43855
|
const client = await getClient();
|
|
44104
43856
|
let filePath;
|
|
44105
43857
|
if (file2) {
|
|
44106
|
-
filePath =
|
|
43858
|
+
filePath = path7.resolve(file2);
|
|
44107
43859
|
} else {
|
|
44108
43860
|
const detected = await autoDetectAuditFile();
|
|
44109
43861
|
if (!detected) {
|
|
@@ -44115,14 +43867,14 @@ async function auditSubmitCommand(file2) {
|
|
|
44115
43867
|
process.exit(1);
|
|
44116
43868
|
}
|
|
44117
43869
|
filePath = detected;
|
|
44118
|
-
console.log(source_default.dim(`Auto-detected audit file: ${
|
|
43870
|
+
console.log(source_default.dim(`Auto-detected audit file: ${path7.relative(process.cwd(), filePath)}`));
|
|
44119
43871
|
}
|
|
44120
|
-
if (!await
|
|
43872
|
+
if (!await import_fs_extra4.default.pathExists(filePath)) {
|
|
44121
43873
|
console.error(source_default.red(`File not found: ${filePath}`));
|
|
44122
43874
|
process.exit(1);
|
|
44123
43875
|
}
|
|
44124
|
-
const content = await
|
|
44125
|
-
const filename =
|
|
43876
|
+
const content = await import_fs_extra4.default.readFile(filePath, "utf-8");
|
|
43877
|
+
const filename = path7.basename(filePath);
|
|
44126
43878
|
const auditType = detectAuditType(filename);
|
|
44127
43879
|
const project2 = getProjectName();
|
|
44128
43880
|
const branch = getGitBranch();
|
|
@@ -44248,11 +44000,11 @@ async function auditViewCommand(id, options) {
|
|
|
44248
44000
|
try {
|
|
44249
44001
|
const audit2 = await client.audits.get(id);
|
|
44250
44002
|
if (options.output) {
|
|
44251
|
-
const outputPath =
|
|
44252
|
-
await
|
|
44253
|
-
await
|
|
44003
|
+
const outputPath = path7.resolve(options.output);
|
|
44004
|
+
await import_fs_extra4.default.ensureDir(path7.dirname(outputPath));
|
|
44005
|
+
await import_fs_extra4.default.writeFile(outputPath, audit2.content, "utf-8");
|
|
44254
44006
|
console.log(source_default.green(`
|
|
44255
|
-
\u2713 Audit saved to ${
|
|
44007
|
+
\u2713 Audit saved to ${path7.relative(process.cwd(), outputPath)}
|
|
44256
44008
|
`));
|
|
44257
44009
|
} else {
|
|
44258
44010
|
const typeLabels = {
|
|
@@ -44285,8 +44037,8 @@ async function auditViewCommand(id, options) {
|
|
|
44285
44037
|
|
|
44286
44038
|
// src/commands/plan.ts
|
|
44287
44039
|
init_source();
|
|
44288
|
-
var
|
|
44289
|
-
import
|
|
44040
|
+
var import_fs_extra5 = __toESM(require_lib(), 1);
|
|
44041
|
+
import path8 from "path";
|
|
44290
44042
|
function extractFrontmatterStatus(content) {
|
|
44291
44043
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
44292
44044
|
if (!match) return null;
|
|
@@ -44295,7 +44047,7 @@ function extractFrontmatterStatus(content) {
|
|
|
44295
44047
|
}
|
|
44296
44048
|
async function autoDetectPlanFile() {
|
|
44297
44049
|
const cwd = process.cwd();
|
|
44298
|
-
const plansDir =
|
|
44050
|
+
const plansDir = path8.join(cwd, ".plans");
|
|
44299
44051
|
const mdFiles = await findMdFiles(plansDir);
|
|
44300
44052
|
if (mdFiles.length === 0) {
|
|
44301
44053
|
return null;
|
|
@@ -44304,7 +44056,7 @@ async function autoDetectPlanFile() {
|
|
|
44304
44056
|
const ticketId = extractTicketId(branch);
|
|
44305
44057
|
if (ticketId) {
|
|
44306
44058
|
const ticketLower = ticketId.toLowerCase();
|
|
44307
|
-
const match = mdFiles.find((f) =>
|
|
44059
|
+
const match = mdFiles.find((f) => path8.basename(f).toLowerCase().includes(ticketLower));
|
|
44308
44060
|
if (match) {
|
|
44309
44061
|
return match;
|
|
44310
44062
|
}
|
|
@@ -44315,7 +44067,7 @@ async function planSubmitCommand(file2) {
|
|
|
44315
44067
|
const client = await getClient();
|
|
44316
44068
|
let filePath;
|
|
44317
44069
|
if (file2) {
|
|
44318
|
-
filePath =
|
|
44070
|
+
filePath = path8.resolve(file2);
|
|
44319
44071
|
} else {
|
|
44320
44072
|
const detected = await autoDetectPlanFile();
|
|
44321
44073
|
if (!detected) {
|
|
@@ -44327,14 +44079,14 @@ async function planSubmitCommand(file2) {
|
|
|
44327
44079
|
process.exit(1);
|
|
44328
44080
|
}
|
|
44329
44081
|
filePath = detected;
|
|
44330
|
-
console.log(source_default.dim(`Auto-detected plan file: ${
|
|
44082
|
+
console.log(source_default.dim(`Auto-detected plan file: ${path8.relative(process.cwd(), filePath)}`));
|
|
44331
44083
|
}
|
|
44332
|
-
if (!await
|
|
44084
|
+
if (!await import_fs_extra5.default.pathExists(filePath)) {
|
|
44333
44085
|
console.error(source_default.red(`File not found: ${filePath}`));
|
|
44334
44086
|
process.exit(1);
|
|
44335
44087
|
}
|
|
44336
|
-
const content = await
|
|
44337
|
-
const filename =
|
|
44088
|
+
const content = await import_fs_extra5.default.readFile(filePath, "utf-8");
|
|
44089
|
+
const filename = path8.basename(filePath);
|
|
44338
44090
|
const project2 = getProjectName();
|
|
44339
44091
|
const branch = getGitBranch();
|
|
44340
44092
|
const commit = getGitCommit();
|
|
@@ -44424,6 +44176,14 @@ async function planListCommand(options) {
|
|
|
44424
44176
|
// src/index.ts
|
|
44425
44177
|
init_update();
|
|
44426
44178
|
|
|
44179
|
+
// src/utils/debug.ts
|
|
44180
|
+
init_source();
|
|
44181
|
+
function debugLog(message) {
|
|
44182
|
+
if (process.env["MELTCTL_DEBUG"]) {
|
|
44183
|
+
console.error(source_default.dim(`[debug] ${message}`));
|
|
44184
|
+
}
|
|
44185
|
+
}
|
|
44186
|
+
|
|
44427
44187
|
// src/utils/analytics.ts
|
|
44428
44188
|
init_version();
|
|
44429
44189
|
async function trackCommand(command, success2, errorMessage) {
|
|
@@ -46114,8 +45874,8 @@ var StdioServerTransport = class {
|
|
|
46114
45874
|
|
|
46115
45875
|
// ../meltctl-mcp/dist/index.js
|
|
46116
45876
|
import { readFile } from "fs/promises";
|
|
46117
|
-
import
|
|
46118
|
-
import
|
|
45877
|
+
import path9 from "path";
|
|
45878
|
+
import os5 from "os";
|
|
46119
45879
|
|
|
46120
45880
|
// ../../node_modules/zod/v3/helpers/util.js
|
|
46121
45881
|
var util;
|
|
@@ -46476,8 +46236,8 @@ function getErrorMap2() {
|
|
|
46476
46236
|
|
|
46477
46237
|
// ../../node_modules/zod/v3/helpers/parseUtil.js
|
|
46478
46238
|
var makeIssue = (params) => {
|
|
46479
|
-
const { data, path:
|
|
46480
|
-
const fullPath = [...
|
|
46239
|
+
const { data, path: path10, errorMaps, issueData } = params;
|
|
46240
|
+
const fullPath = [...path10, ...issueData.path || []];
|
|
46481
46241
|
const fullIssue = {
|
|
46482
46242
|
...issueData,
|
|
46483
46243
|
path: fullPath
|
|
@@ -46592,11 +46352,11 @@ var errorUtil;
|
|
|
46592
46352
|
|
|
46593
46353
|
// ../../node_modules/zod/v3/types.js
|
|
46594
46354
|
var ParseInputLazyPath = class {
|
|
46595
|
-
constructor(parent, value,
|
|
46355
|
+
constructor(parent, value, path10, key) {
|
|
46596
46356
|
this._cachedPath = [];
|
|
46597
46357
|
this.parent = parent;
|
|
46598
46358
|
this.data = value;
|
|
46599
|
-
this._path =
|
|
46359
|
+
this._path = path10;
|
|
46600
46360
|
this._key = key;
|
|
46601
46361
|
}
|
|
46602
46362
|
get path() {
|
|
@@ -50123,11 +49883,11 @@ function normalizeObjectSchema(schema) {
|
|
|
50123
49883
|
}
|
|
50124
49884
|
return void 0;
|
|
50125
49885
|
}
|
|
50126
|
-
function getDotPath(
|
|
50127
|
-
if (
|
|
49886
|
+
function getDotPath(path10) {
|
|
49887
|
+
if (path10.length === 0) {
|
|
50128
49888
|
return "object root";
|
|
50129
49889
|
}
|
|
50130
|
-
return
|
|
49890
|
+
return path10.reduce((acc, seg, index) => {
|
|
50131
49891
|
if (index === 0) {
|
|
50132
49892
|
return String(seg);
|
|
50133
49893
|
}
|
|
@@ -54375,20 +54135,6 @@ function createTemplatesResource2(config2) {
|
|
|
54375
54135
|
}
|
|
54376
54136
|
};
|
|
54377
54137
|
}
|
|
54378
|
-
function createSkillsResource2(config2) {
|
|
54379
|
-
return {
|
|
54380
|
-
async getDevSkills() {
|
|
54381
|
-
const { data, status } = await apiFetch2(config2, "/skills/dev", {
|
|
54382
|
-
method: "GET"
|
|
54383
|
-
});
|
|
54384
|
-
if (status !== 200) {
|
|
54385
|
-
const error51 = data.error;
|
|
54386
|
-
throw new Error(error51 ?? `Failed to fetch dev skills (${status})`);
|
|
54387
|
-
}
|
|
54388
|
-
return data;
|
|
54389
|
-
}
|
|
54390
|
-
};
|
|
54391
|
-
}
|
|
54392
54138
|
function createAuthResource2(config2) {
|
|
54393
54139
|
return {
|
|
54394
54140
|
async exchangeToken(code, redirectUri) {
|
|
@@ -55526,7 +55272,6 @@ function createMeltClient2(config2) {
|
|
|
55526
55272
|
feedback: createFeedbackResource2(config2),
|
|
55527
55273
|
coins: createCoinsResource2(config2),
|
|
55528
55274
|
templates: createTemplatesResource2(config2),
|
|
55529
|
-
skills: createSkillsResource2(config2),
|
|
55530
55275
|
auth: createAuthResource2(config2),
|
|
55531
55276
|
people: createPeopleResource2(config2),
|
|
55532
55277
|
projects: createProjectsResource2(config2),
|
|
@@ -55963,7 +55708,7 @@ var ISSUE_RULES2 = [
|
|
|
55963
55708
|
severity: "low",
|
|
55964
55709
|
label: "Never audited",
|
|
55965
55710
|
category: "audits",
|
|
55966
|
-
howToFix: "Run `/melt-dev
|
|
55711
|
+
howToFix: "Run `/melt-dev:tech-audit` on the repo to create the baseline",
|
|
55967
55712
|
scope: "project",
|
|
55968
55713
|
suppressedInStatuses: ["commercial"]
|
|
55969
55714
|
},
|
|
@@ -55974,7 +55719,7 @@ var ISSUE_RULES2 = [
|
|
|
55974
55719
|
severity: "low",
|
|
55975
55720
|
label: "Audit over 90 days old",
|
|
55976
55721
|
category: "audits",
|
|
55977
|
-
howToFix: "Run `/melt-dev
|
|
55722
|
+
howToFix: "Run `/melt-dev:tech-audit` on the repo to refresh the baseline",
|
|
55978
55723
|
scope: "project"
|
|
55979
55724
|
},
|
|
55980
55725
|
{
|
|
@@ -55987,7 +55732,7 @@ var ISSUE_RULES2 = [
|
|
|
55987
55732
|
severity: "low",
|
|
55988
55733
|
label: "Audit overdue (30+ days)",
|
|
55989
55734
|
category: "audits",
|
|
55990
|
-
howToFix: "A repo's last audit is over 30 days old \u2014 re-run `/melt-dev
|
|
55735
|
+
howToFix: "A repo's last audit is over 30 days old \u2014 re-run `/melt-dev:tech-audit` (or the relevant audit skill) to refresh the findings.",
|
|
55991
55736
|
scope: "project"
|
|
55992
55737
|
},
|
|
55993
55738
|
{
|
|
@@ -55997,7 +55742,7 @@ var ISSUE_RULES2 = [
|
|
|
55997
55742
|
severity: "low",
|
|
55998
55743
|
label: "Some repos never audited",
|
|
55999
55744
|
category: "audits",
|
|
56000
|
-
howToFix: "Run `/melt-dev
|
|
55745
|
+
howToFix: "Run `/melt-dev:tech-audit` on each unaudited repo to create its baseline",
|
|
56001
55746
|
scope: "project",
|
|
56002
55747
|
suppressedInStatuses: ["commercial"]
|
|
56003
55748
|
},
|
|
@@ -56013,8 +55758,8 @@ var ISSUE_RULES2 = [
|
|
|
56013
55758
|
];
|
|
56014
55759
|
var RULE_BY_ID2 = new Map(ISSUE_RULES2.map((r) => [r.id, r]));
|
|
56015
55760
|
var FOURTEEN_DAYS_MS2 = 14 * 24 * 60 * 60 * 1e3;
|
|
56016
|
-
var AUTH_DIR2 =
|
|
56017
|
-
var AUTH_FILE2 =
|
|
55761
|
+
var AUTH_DIR2 = path9.join(os5.homedir(), ".meltctl");
|
|
55762
|
+
var AUTH_FILE2 = path9.join(AUTH_DIR2, "auth.json");
|
|
56018
55763
|
var API_BASE2 = process.env["MELTCTL_API_URL"] ?? "https://api.meltctl.meltstudio.co";
|
|
56019
55764
|
var AuthError = class extends Error {
|
|
56020
55765
|
constructor(message) {
|
|
@@ -56772,7 +56517,7 @@ function registerDailyPlanTools(server, getClient2) {
|
|
|
56772
56517
|
"get_pm_daily_plan",
|
|
56773
56518
|
{
|
|
56774
56519
|
title: "Get the PM's daily plan",
|
|
56775
|
-
description: "Returns the calling PM's daily plan for a day (defaults to today, Colombia time), or null if none exists. Each agenda item has a label, optional project/meeting/suggestedSkill, a status (pending/done/blocked/carried), and an optional note. Use this in melt-pm
|
|
56520
|
+
description: "Returns the calling PM's daily plan for a day (defaults to today, Colombia time), or null if none exists. Each agenda item has a label, optional project/meeting/suggestedSkill, a status (pending/done/blocked/carried), and an optional note. Use this in melt-pm:close-my-day to read back the morning's plan and reconcile it. Self-scoped \u2014 a PM only ever reads their own plan.",
|
|
56776
56521
|
inputSchema: {
|
|
56777
56522
|
date: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe("YYYY-MM-DD. Omit for today.")
|
|
56778
56523
|
}
|
|
@@ -56783,7 +56528,7 @@ function registerDailyPlanTools(server, getClient2) {
|
|
|
56783
56528
|
"submit_pm_daily_plan",
|
|
56784
56529
|
{
|
|
56785
56530
|
title: "Submit/update the PM's daily plan",
|
|
56786
|
-
description: "Upserts the calling PM's daily plan for a day (defaults to today). melt-pm
|
|
56531
|
+
description: "Upserts the calling PM's daily plan for a day (defaults to today). melt-pm:plan-my-day calls this once it has built the morning agenda (items with status='pending'); melt-pm:close-my-day calls it again with the same items flipped to done/blocked/carried. Idempotent per (PM, day) \u2014 calling again replaces the day's agenda. Self-scoped.",
|
|
56787
56532
|
inputSchema: {
|
|
56788
56533
|
planDate: external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe("YYYY-MM-DD. Omit for today."),
|
|
56789
56534
|
agenda: external_exports.array(planItemSchema)
|
|
@@ -56839,7 +56584,7 @@ function registerEndpointCheckTools(server, getClient2) {
|
|
|
56839
56584
|
"submit_endpoint_check",
|
|
56840
56585
|
{
|
|
56841
56586
|
title: "Submit an endpoint-security self-check",
|
|
56842
|
-
description: "Records the calling person's endpoint-security self-check against Melt's baseline (#507). melt-verify-endpoint calls this once it has run the read-only checks and produced the report: pass the 9 control results (5 technical pass/fail/unknown + 3 verbal confirmed/no/unknown), the OS, the one-line summary, what was remediated, and the full secrets-free markdown report. Self-scoped \u2014 the author comes from the JWT, so a caller only ever writes their own posture. Latest-check-wins per person. NEVER pass secrets (passwords, keys, tokens, internal hostnames) in any field.",
|
|
56587
|
+
description: "Records the calling person's endpoint-security self-check against Melt's baseline (#507). melt-company:verify-endpoint calls this once it has run the read-only checks and produced the report: pass the 9 control results (5 technical pass/fail/unknown + 3 verbal confirmed/no/unknown), the OS, the one-line summary, what was remediated, and the full secrets-free markdown report. Self-scoped \u2014 the author comes from the JWT, so a caller only ever writes their own posture. Latest-check-wins per person. NEVER pass secrets (passwords, keys, tokens, internal hostnames) in any field.",
|
|
56843
56588
|
inputSchema: submitEndpointCheckShape
|
|
56844
56589
|
},
|
|
56845
56590
|
withClientArgs(getClient2, submitEndpointCheck)
|
|
@@ -56921,29 +56666,28 @@ async function mcpCommand() {
|
|
|
56921
56666
|
init_version();
|
|
56922
56667
|
var program2 = new Command();
|
|
56923
56668
|
program2.name("meltctl").description(
|
|
56924
|
-
"Companion CLI for the Melt AI-first development workflow.\n\nThe Melt dev skills
|
|
56669
|
+
"Companion CLI for the Melt AI-first development workflow.\n\nThe Melt dev skills ship as the melt-dev Claude plugin from the Melt Studio org marketplace and update automatically in Claude Code \u2014 no per-repo install. Run /melt-dev:setup in Claude Code to scaffold AGENTS.md + MCP config in a repo.\n\nRequires a @meltstudio.co Google Workspace account. Run `npx @meltstudio/meltctl@latest login` first."
|
|
56925
56670
|
).version(CLI_VERSION).addHelpText("beforeAll", () => {
|
|
56926
56671
|
printBanner();
|
|
56927
56672
|
return "";
|
|
56928
56673
|
}).addHelpText(
|
|
56929
56674
|
"after",
|
|
56930
56675
|
`
|
|
56931
|
-
${source_default.bold("AI Skills")} ${source_default.dim("(run these in Claude Code, not the CLI
|
|
56932
|
-
${source_default.dim(" /melt-dev
|
|
56933
|
-
${source_default.dim(" /melt-dev
|
|
56934
|
-
${source_default.dim(" /melt-dev
|
|
56935
|
-
${source_default.dim(" /melt-dev
|
|
56936
|
-
${source_default.dim(" /melt-dev
|
|
56937
|
-
${source_default.dim(" /melt-dev
|
|
56938
|
-
${source_default.dim(" /melt-dev
|
|
56939
|
-
${source_default.dim(" /melt-dev
|
|
56940
|
-
${source_default.dim(" /melt-dev
|
|
56941
|
-
${source_default.dim(" /melt-dev
|
|
56942
|
-
${source_default.dim(" /melt-dev
|
|
56943
|
-
${source_default.dim(" /melt-dev
|
|
56676
|
+
${source_default.bold("AI Skills")} ${source_default.dim("(the melt-dev Claude plugin; run these in Claude Code, not the CLI):")}
|
|
56677
|
+
${source_default.dim(" /melt-dev:setup Analyze the project and customize AGENTS.md")}
|
|
56678
|
+
${source_default.dim(" /melt-dev:link Connect and verify ticket tracker + browser testing")}
|
|
56679
|
+
${source_default.dim(" /melt-dev:plan Design an implementation approach before writing code")}
|
|
56680
|
+
${source_default.dim(" /melt-dev:validate Run the validation plan and verify end-to-end")}
|
|
56681
|
+
${source_default.dim(" /melt-dev:review Review changes against project standards")}
|
|
56682
|
+
${source_default.dim(" /melt-dev:pr Create a well-structured pull request")}
|
|
56683
|
+
${source_default.dim(" /melt-dev:debug Systematically investigate and fix bugs")}
|
|
56684
|
+
${source_default.dim(" /melt-dev:tech-audit Run a project compliance audit")}
|
|
56685
|
+
${source_default.dim(" /melt-dev:ux-audit Review UI against usability heuristics")}
|
|
56686
|
+
${source_default.dim(" /melt-dev:security-audit Run a security posture audit across the platform")}
|
|
56687
|
+
${source_default.dim(" /melt-dev:cost-audit Run an AWS cost optimization audit")}
|
|
56688
|
+
${source_default.dim(" /melt-dev:help Answer questions about the development playbook")}
|
|
56944
56689
|
|
|
56945
56690
|
${source_default.bold("Setup")}
|
|
56946
|
-
${source_default.dim(" skills install Install the dev skills (/melt-dev-*) into Claude Code (+ Cursor; respects CLAUDE_CONFIG_DIR, or --path <dir>)")}
|
|
56947
56691
|
|
|
56948
56692
|
${source_default.bold("Admin Commands")} ${source_default.dim("(used by skills and team managers):")}
|
|
56949
56693
|
${source_default.dim(" audit submit [file] Submit an audit report")}
|
|
@@ -56959,7 +56703,6 @@ ${source_default.dim(" event track --skill Track skill usage (called by skil
|
|
|
56959
56703
|
cmd = cmd.parent;
|
|
56960
56704
|
}
|
|
56961
56705
|
await checkAndEnforceUpdate(cmd.name());
|
|
56962
|
-
await maybeSyncSkills(cmd.name());
|
|
56963
56706
|
}).hook("postAction", async (_thisCommand, actionCommand) => {
|
|
56964
56707
|
try {
|
|
56965
56708
|
const parts = [];
|
|
@@ -56983,23 +56726,17 @@ program2.command("mcp").description(
|
|
|
56983
56726
|
).action(async () => {
|
|
56984
56727
|
await mcpCommand();
|
|
56985
56728
|
});
|
|
56986
|
-
var skills = program2.command("skills").description("install the Melt dev skills (/melt-dev-*) into Claude Code");
|
|
56987
|
-
skills.command("install").description(
|
|
56988
|
-
"install the Melt dev skills into ~/.claude/skills/ (re-run to update; respects CLAUDE_CONFIG_DIR)"
|
|
56989
|
-
).option("--force", "reinstall even if already up to date").option("--path <dir>", "install into this directory only (overrides CLAUDE_CONFIG_DIR)").action(async (options) => {
|
|
56990
|
-
await skillsInstallCommand(options);
|
|
56991
|
-
});
|
|
56992
56729
|
var project = program2.command("project").description("manage project configuration").addHelpText(
|
|
56993
56730
|
"after",
|
|
56994
56731
|
`
|
|
56995
56732
|
${source_default.dim("Project scaffolding now lives in the Melt dev skills (run these in Claude Code,")}
|
|
56996
|
-
${source_default.dim("
|
|
56997
|
-
${source_default.dim(" /melt-dev
|
|
56998
|
-
${source_default.dim(" /melt-dev
|
|
56733
|
+
${source_default.dim("from the melt-dev Claude plugin):")}
|
|
56734
|
+
${source_default.dim(" /melt-dev:setup Analyze the project, write AGENTS.md, and propose MCP config")}
|
|
56735
|
+
${source_default.dim(" /melt-dev:link Connect and verify ticket tracker + browser testing")}
|
|
56999
56736
|
`
|
|
57000
56737
|
);
|
|
57001
56738
|
project.command("templates").description(
|
|
57002
|
-
"write the repo-migration playbook to a temp dir (the /melt-update \u2192 /melt-dev
|
|
56739
|
+
"write the repo-migration playbook to a temp dir (the /melt-update \u2192 /melt-dev:* path); /melt-dev:setup does the same"
|
|
57003
56740
|
).action(async () => {
|
|
57004
56741
|
await templatesCommand();
|
|
57005
56742
|
});
|
|
@@ -57016,10 +56753,10 @@ var audit = program2.command("audit", { hidden: true }).description("submit and
|
|
|
57016
56753
|
"after",
|
|
57017
56754
|
`
|
|
57018
56755
|
${source_default.dim("Related skills (run in your AI coding tool):")}
|
|
57019
|
-
${source_default.dim(" /melt-dev
|
|
57020
|
-
${source_default.dim(" /melt-dev
|
|
57021
|
-
${source_default.dim(" /melt-dev
|
|
57022
|
-
${source_default.dim(" /melt-dev
|
|
56756
|
+
${source_default.dim(" /melt-dev:tech-audit Run a project compliance audit")}
|
|
56757
|
+
${source_default.dim(" /melt-dev:ux-audit Review UI against usability heuristics")}
|
|
56758
|
+
${source_default.dim(" /melt-dev:security-audit Run a security posture audit across the platform")}
|
|
56759
|
+
${source_default.dim(" /melt-dev:cost-audit Run an AWS cost optimization audit")}
|
|
57023
56760
|
`
|
|
57024
56761
|
);
|
|
57025
56762
|
audit.command("submit").description("submit an audit report from a markdown file").argument("[file]", "path to the audit file (auto-detects from .audits/ if omitted)").action(async (file2) => {
|
|
@@ -57035,7 +56772,7 @@ var plan = program2.command("plan", { hidden: true }).description("submit and li
|
|
|
57035
56772
|
"after",
|
|
57036
56773
|
`
|
|
57037
56774
|
${source_default.dim("Related skill (run in Claude Code):")}
|
|
57038
|
-
${source_default.dim(" /melt-dev
|
|
56775
|
+
${source_default.dim(" /melt-dev:plan Design an implementation approach before writing code")}
|
|
57039
56776
|
`
|
|
57040
56777
|
);
|
|
57041
56778
|
plan.command("submit").description("submit or update a plan from a markdown file").argument("[file]", "path to the plan file (auto-detects from .plans/ if omitted)").action(async (file2) => {
|