@telia-ace/alliance-utilities 1.0.3 → 1.0.4-next.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/CHANGELOG.md +6 -0
- package/dist/index.js +140 -149
- package/dist/index.js.map +1 -1
- package/dist/translations.d.ts +39 -48
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -4,57 +4,48 @@ var se = (e, t, n) => (Vt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
|
4
4
|
import it from "fs";
|
|
5
5
|
import M from "path";
|
|
6
6
|
import { pipeline as zt } from "stream/promises";
|
|
7
|
-
var ot = /* @__PURE__ */ ((e) => (e[e.
|
|
7
|
+
var ot = /* @__PURE__ */ ((e) => (e[e.Done = 0] = "Done", e[e.NoWorkspaceName = 1] = "NoWorkspaceName", e[e.NoAppName = 2] = "NoAppName", e[e.AlreadyExists = 3] = "AlreadyExists", e[e.NoAppOrWorkspaceInCurrentDirectory = 4] = "NoAppOrWorkspaceInCurrentDirectory", e[e.UnrecognizedCommand = 5] = "UnrecognizedCommand", e[e.WorkspaceCreated = 6] = "WorkspaceCreated", e[e.AppCreated = 7] = "AppCreated", e[e.ServedStopped = 8] = "ServedStopped", e[e.WorkspaceNameInquiry = 9] = "WorkspaceNameInquiry", e[e.AppNameInquiry = 10] = "AppNameInquiry", e[e.ServerModeInquiry = 11] = "ServerModeInquiry", e[e.CreateWorkspaceDescription = 12] = "CreateWorkspaceDescription", e[e.CreateAppDescription = 13] = "CreateAppDescription", e[e.ServeDescription = 14] = "ServeDescription", e[e.BuildDescription = 15] = "BuildDescription", e[e.MissingTranslationKey = 16] = "MissingTranslationKey", e[e.OperationCancelled = 17] = "OperationCancelled", e[e.StopServerInstructions = 18] = "StopServerInstructions", e[e.TemplateLanguageInquiry = 19] = "TemplateLanguageInquiry", e[e.TemplateFrameworkInquiry = 20] = "TemplateFrameworkInquiry", e[e.DevServerPortDescription = 21] = "DevServerPortDescription", e[e.ApiGatewayPortDescription = 22] = "ApiGatewayPortDescription", e[e.ApiServerModeDescription = 23] = "ApiServerModeDescription", e[e.DevServerOpenDescription = 24] = "DevServerOpenDescription", e[e.BuildWatchDescription = 25] = "BuildWatchDescription", e[e.CouldNotStartGatewayInDocker = 26] = "CouldNotStartGatewayInDocker", e[e.PullingLatestImage = 27] = "PullingLatestImage", e[e.AppEntryBuildOptionDescription = 28] = "AppEntryBuildOptionDescription", e[e.ManifestEntryBuildOptionDescription = 29] = "ManifestEntryBuildOptionDescription", e[e.BuildModeOptionDescription = 30] = "BuildModeOptionDescription", e[e.FetchPackageVersionError = 31] = "FetchPackageVersionError", e[e.DockerNotStartedOrInstalled = 32] = "DockerNotStartedOrInstalled", e[e.EnableDevAuthentication = 33] = "EnableDevAuthentication", e[e.NoAppNameFound = 34] = "NoAppNameFound", e[e.AppConfigurationPath = 35] = "AppConfigurationPath", e[e.ServerGatewayMode = 36] = "ServerGatewayMode", e[e.ServerProxyMode = 37] = "ServerProxyMode", e[e.ServerMode = 38] = "ServerMode", e))(ot || {});
|
|
8
8
|
const Qt = {
|
|
9
|
-
[0]: "
|
|
10
|
-
[1]: "No",
|
|
11
|
-
[2]: "
|
|
12
|
-
[3]: "
|
|
13
|
-
[4]: "
|
|
14
|
-
[5]: "
|
|
15
|
-
[6]: "
|
|
16
|
-
[7]: "
|
|
17
|
-
[8]: "
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[13]: "Enter the name of your app",
|
|
29
|
-
[20]: "No translation key provided!",
|
|
30
|
-
[21]: "Error occured when running action number {0}, with the message: ",
|
|
31
|
-
[22]: "Tried to set already existing key '{0}' on OperationState.",
|
|
32
|
-
[23]: "Operation cancelled.",
|
|
33
|
-
[24]: `Press CTRL + C to stop the server.
|
|
9
|
+
[0]: "Done",
|
|
10
|
+
[1]: "No workspace name provided!",
|
|
11
|
+
[2]: "No app name provided!",
|
|
12
|
+
[3]: "File or directory '{0}' already exists!",
|
|
13
|
+
[4]: "Could not find any app entry file at '{0}' or any apps under the alliance.apps property in '{1}'!",
|
|
14
|
+
[5]: "Unrecognized command(s) {0}!",
|
|
15
|
+
[6]: "Workspace was created at path '{0}'!",
|
|
16
|
+
[7]: "App was created at path '{0}'!",
|
|
17
|
+
[8]: "Server stopped.",
|
|
18
|
+
[12]: "Creates an Alliance Workspace in the current directory.",
|
|
19
|
+
[13]: "Creates an Alliance Application in the current directory or Alliance Workspace.",
|
|
20
|
+
[14]: "Starts a Alliance development server using the current directory package.json.",
|
|
21
|
+
[15]: "Builds an Alliance Application using Vite.",
|
|
22
|
+
[9]: "Enter the name of your workspace",
|
|
23
|
+
[11]: "Which server mode do you want to use?",
|
|
24
|
+
[10]: "Enter the name of your app",
|
|
25
|
+
[16]: "No translation key provided!",
|
|
26
|
+
[17]: "Operation cancelled.",
|
|
27
|
+
[18]: `Press CTRL + C to stop the server.
|
|
34
28
|
`,
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
54
|
-
[
|
|
55
|
-
[47]: "Server",
|
|
56
|
-
[46]: "Server with proxy",
|
|
57
|
-
[45]: "Server with gateway"
|
|
29
|
+
[19]: "Select preferred language",
|
|
30
|
+
[20]: "Select preferred framework template",
|
|
31
|
+
[21]: "The port that the dev server should use.",
|
|
32
|
+
[22]: "The port that the api gateway should use.",
|
|
33
|
+
[23]: "Which components to start. [server|server-proxy|server-gateway].",
|
|
34
|
+
[24]: "Whether the dev server should automatically open in your browser or not.",
|
|
35
|
+
[25]: "Whether the build should start watching and rebuild when files change or not.",
|
|
36
|
+
[26]: "Could not start Docker container with Alliance gateway.",
|
|
37
|
+
[27]: "Pulling latest image...",
|
|
38
|
+
[28]: "The entry file for the app (./src/app).",
|
|
39
|
+
[29]: "The entry file for the app manifest (./src/manifest).",
|
|
40
|
+
[30]: "Which mode to use when building the app. [production|development]",
|
|
41
|
+
[31]: "Failed to fetch package info from the NPM registry for package '${0}'!",
|
|
42
|
+
[32]: "Docker not started or not installed.",
|
|
43
|
+
[33]: "Whether user authentication should be enabled or not.",
|
|
44
|
+
[34]: "Could not find app name in manifest.",
|
|
45
|
+
[35]: "The path to the app configuration file.",
|
|
46
|
+
[38]: "Server",
|
|
47
|
+
[37]: "Server with proxy",
|
|
48
|
+
[36]: "Server with gateway"
|
|
58
49
|
}, Se = class {
|
|
59
50
|
};
|
|
60
51
|
let te = Se;
|
|
@@ -144,12 +135,12 @@ function tn(e) {
|
|
|
144
135
|
}, e.lchownSync = function() {
|
|
145
136
|
}), Kt === "win32" && (e.rename = typeof e.rename != "function" ? e.rename : function(u) {
|
|
146
137
|
function s(m, l, y) {
|
|
147
|
-
var
|
|
148
|
-
u(m, l, function
|
|
149
|
-
if (B && (B.code === "EACCES" || B.code === "EPERM") && Date.now() -
|
|
138
|
+
var $ = Date.now(), v = 0;
|
|
139
|
+
u(m, l, function g(B) {
|
|
140
|
+
if (B && (B.code === "EACCES" || B.code === "EPERM") && Date.now() - $ < 6e4) {
|
|
150
141
|
setTimeout(function() {
|
|
151
142
|
e.stat(l, function(A, ee) {
|
|
152
|
-
A && A.code === "ENOENT" ? u(m, l,
|
|
143
|
+
A && A.code === "ENOENT" ? u(m, l, g) : y(B);
|
|
153
144
|
});
|
|
154
145
|
}, v), v < 100 && (v += 10);
|
|
155
146
|
return;
|
|
@@ -159,30 +150,30 @@ function tn(e) {
|
|
|
159
150
|
}
|
|
160
151
|
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
161
152
|
}(e.rename)), e.read = typeof e.read != "function" ? e.read : function(u) {
|
|
162
|
-
function s(m, l, y,
|
|
153
|
+
function s(m, l, y, $, v, g) {
|
|
163
154
|
var B;
|
|
164
|
-
if (
|
|
155
|
+
if (g && typeof g == "function") {
|
|
165
156
|
var A = 0;
|
|
166
157
|
B = function(ee, Je, be) {
|
|
167
158
|
if (ee && ee.code === "EAGAIN" && A < 10)
|
|
168
|
-
return A++, u.call(e, m, l, y,
|
|
169
|
-
|
|
159
|
+
return A++, u.call(e, m, l, y, $, v, B);
|
|
160
|
+
g.apply(this, arguments);
|
|
170
161
|
};
|
|
171
162
|
}
|
|
172
|
-
return u.call(e, m, l, y,
|
|
163
|
+
return u.call(e, m, l, y, $, v, B);
|
|
173
164
|
}
|
|
174
165
|
return Object.setPrototypeOf && Object.setPrototypeOf(s, u), s;
|
|
175
166
|
}(e.read), e.readSync = typeof e.readSync != "function" ? e.readSync : function(u) {
|
|
176
|
-
return function(s, m, l, y,
|
|
167
|
+
return function(s, m, l, y, $) {
|
|
177
168
|
for (var v = 0; ; )
|
|
178
169
|
try {
|
|
179
|
-
return u.call(e, s, m, l, y,
|
|
180
|
-
} catch (
|
|
181
|
-
if (
|
|
170
|
+
return u.call(e, s, m, l, y, $);
|
|
171
|
+
} catch (g) {
|
|
172
|
+
if (g.code === "EAGAIN" && v < 10) {
|
|
182
173
|
v++;
|
|
183
174
|
continue;
|
|
184
175
|
}
|
|
185
|
-
throw
|
|
176
|
+
throw g;
|
|
186
177
|
}
|
|
187
178
|
};
|
|
188
179
|
}(e.readSync);
|
|
@@ -192,22 +183,22 @@ function tn(e) {
|
|
|
192
183
|
s,
|
|
193
184
|
q.O_WRONLY | q.O_SYMLINK,
|
|
194
185
|
m,
|
|
195
|
-
function(y,
|
|
186
|
+
function(y, $) {
|
|
196
187
|
if (y) {
|
|
197
188
|
l && l(y);
|
|
198
189
|
return;
|
|
199
190
|
}
|
|
200
|
-
u.fchmod(
|
|
201
|
-
u.close(
|
|
202
|
-
l && l(v ||
|
|
191
|
+
u.fchmod($, m, function(v) {
|
|
192
|
+
u.close($, function(g) {
|
|
193
|
+
l && l(v || g);
|
|
203
194
|
});
|
|
204
195
|
});
|
|
205
196
|
}
|
|
206
197
|
);
|
|
207
198
|
}, u.lchmodSync = function(s, m) {
|
|
208
|
-
var l = u.openSync(s, q.O_WRONLY | q.O_SYMLINK, m), y = !0,
|
|
199
|
+
var l = u.openSync(s, q.O_WRONLY | q.O_SYMLINK, m), y = !0, $;
|
|
209
200
|
try {
|
|
210
|
-
|
|
201
|
+
$ = u.fchmodSync(l, m), y = !1;
|
|
211
202
|
} finally {
|
|
212
203
|
if (y)
|
|
213
204
|
try {
|
|
@@ -217,26 +208,26 @@ function tn(e) {
|
|
|
217
208
|
else
|
|
218
209
|
u.closeSync(l);
|
|
219
210
|
}
|
|
220
|
-
return
|
|
211
|
+
return $;
|
|
221
212
|
};
|
|
222
213
|
}
|
|
223
214
|
function n(u) {
|
|
224
215
|
q.hasOwnProperty("O_SYMLINK") && u.futimes ? (u.lutimes = function(s, m, l, y) {
|
|
225
|
-
u.open(s, q.O_SYMLINK, function(
|
|
226
|
-
if (
|
|
227
|
-
y && y(
|
|
216
|
+
u.open(s, q.O_SYMLINK, function($, v) {
|
|
217
|
+
if ($) {
|
|
218
|
+
y && y($);
|
|
228
219
|
return;
|
|
229
220
|
}
|
|
230
|
-
u.futimes(v, m, l, function(
|
|
221
|
+
u.futimes(v, m, l, function(g) {
|
|
231
222
|
u.close(v, function(B) {
|
|
232
|
-
y && y(
|
|
223
|
+
y && y(g || B);
|
|
233
224
|
});
|
|
234
225
|
});
|
|
235
226
|
});
|
|
236
227
|
}, u.lutimesSync = function(s, m, l) {
|
|
237
|
-
var y = u.openSync(s, q.O_SYMLINK),
|
|
228
|
+
var y = u.openSync(s, q.O_SYMLINK), $, v = !0;
|
|
238
229
|
try {
|
|
239
|
-
|
|
230
|
+
$ = u.futimesSync(y, m, l), v = !1;
|
|
240
231
|
} finally {
|
|
241
232
|
if (v)
|
|
242
233
|
try {
|
|
@@ -246,7 +237,7 @@ function tn(e) {
|
|
|
246
237
|
else
|
|
247
238
|
u.closeSync(y);
|
|
248
239
|
}
|
|
249
|
-
return
|
|
240
|
+
return $;
|
|
250
241
|
}) : u.futimes && (u.lutimes = function(s, m, l, y) {
|
|
251
242
|
y && process.nextTick(y);
|
|
252
243
|
}, u.lutimesSync = function() {
|
|
@@ -271,8 +262,8 @@ function tn(e) {
|
|
|
271
262
|
}
|
|
272
263
|
function o(u) {
|
|
273
264
|
return u && function(s, m, l, y) {
|
|
274
|
-
return u.call(e, s, m, l, function(
|
|
275
|
-
p(
|
|
265
|
+
return u.call(e, s, m, l, function($) {
|
|
266
|
+
p($) && ($ = null), y && y.apply(this, arguments);
|
|
276
267
|
});
|
|
277
268
|
};
|
|
278
269
|
}
|
|
@@ -289,7 +280,7 @@ function tn(e) {
|
|
|
289
280
|
function a(u) {
|
|
290
281
|
return u && function(s, m, l) {
|
|
291
282
|
typeof m == "function" && (l = m, m = null);
|
|
292
|
-
function y(
|
|
283
|
+
function y($, v) {
|
|
293
284
|
v && (v.uid < 0 && (v.uid += 4294967296), v.gid < 0 && (v.gid += 4294967296)), l && l.apply(this, arguments);
|
|
294
285
|
}
|
|
295
286
|
return m ? u.call(e, s, m, y) : u.call(e, s, y);
|
|
@@ -308,7 +299,7 @@ function tn(e) {
|
|
|
308
299
|
return !!(s && (u.code === "EINVAL" || u.code === "EPERM"));
|
|
309
300
|
}
|
|
310
301
|
}
|
|
311
|
-
var
|
|
302
|
+
var Ge = ae.Stream, nn = rn;
|
|
312
303
|
function rn(e) {
|
|
313
304
|
return {
|
|
314
305
|
ReadStream: t,
|
|
@@ -317,7 +308,7 @@ function rn(e) {
|
|
|
317
308
|
function t(i, r) {
|
|
318
309
|
if (!(this instanceof t))
|
|
319
310
|
return new t(i, r);
|
|
320
|
-
|
|
311
|
+
Ge.call(this);
|
|
321
312
|
var o = this;
|
|
322
313
|
this.path = i, this.fd = null, this.readable = !0, this.paused = !1, this.flags = "r", this.mode = 438, this.bufferSize = 64 * 1024, r = r || {};
|
|
323
314
|
for (var c = Object.keys(r), a = 0, f = c.length; a < f; a++) {
|
|
@@ -352,7 +343,7 @@ function rn(e) {
|
|
|
352
343
|
function n(i, r) {
|
|
353
344
|
if (!(this instanceof n))
|
|
354
345
|
return new n(i, r);
|
|
355
|
-
|
|
346
|
+
Ge.call(this), this.path = i, this.fd = null, this.writable = !0, this.flags = "w", this.encoding = "binary", this.mode = 438, this.bytesWritten = 0, r = r || {};
|
|
356
347
|
for (var o = Object.keys(r), c = 0, a = o.length; c < a; c++) {
|
|
357
348
|
var f = o[c];
|
|
358
349
|
this[f] = r[f];
|
|
@@ -403,7 +394,7 @@ if (!F[I]) {
|
|
|
403
394
|
ct(F, mn), F.close = function(e) {
|
|
404
395
|
function t(n, i) {
|
|
405
396
|
return e.call(F, n, function(r) {
|
|
406
|
-
r ||
|
|
397
|
+
r || Ue(), typeof i == "function" && i.apply(this, arguments);
|
|
407
398
|
});
|
|
408
399
|
}
|
|
409
400
|
return Object.defineProperty(t, he, {
|
|
@@ -411,7 +402,7 @@ if (!F[I]) {
|
|
|
411
402
|
}), t;
|
|
412
403
|
}(F.close), F.closeSync = function(e) {
|
|
413
404
|
function t(n) {
|
|
414
|
-
e.apply(F, arguments),
|
|
405
|
+
e.apply(F, arguments), Ue();
|
|
415
406
|
}
|
|
416
407
|
return Object.defineProperty(t, he, {
|
|
417
408
|
value: e
|
|
@@ -500,17 +491,17 @@ function Ae(e) {
|
|
|
500
491
|
}
|
|
501
492
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
502
493
|
var m = fn(e);
|
|
503
|
-
|
|
494
|
+
g = m.ReadStream, A = m.WriteStream;
|
|
504
495
|
}
|
|
505
496
|
var l = e.ReadStream;
|
|
506
|
-
l && (
|
|
497
|
+
l && (g.prototype = Object.create(l.prototype), g.prototype.open = B);
|
|
507
498
|
var y = e.WriteStream;
|
|
508
499
|
y && (A.prototype = Object.create(y.prototype), A.prototype.open = ee), Object.defineProperty(e, "ReadStream", {
|
|
509
500
|
get: function() {
|
|
510
|
-
return
|
|
501
|
+
return g;
|
|
511
502
|
},
|
|
512
503
|
set: function(d) {
|
|
513
|
-
|
|
504
|
+
g = d;
|
|
514
505
|
},
|
|
515
506
|
enumerable: !0,
|
|
516
507
|
configurable: !0
|
|
@@ -524,13 +515,13 @@ function Ae(e) {
|
|
|
524
515
|
enumerable: !0,
|
|
525
516
|
configurable: !0
|
|
526
517
|
});
|
|
527
|
-
var
|
|
518
|
+
var $ = g;
|
|
528
519
|
Object.defineProperty(e, "FileReadStream", {
|
|
529
520
|
get: function() {
|
|
530
|
-
return
|
|
521
|
+
return $;
|
|
531
522
|
},
|
|
532
523
|
set: function(d) {
|
|
533
|
-
|
|
524
|
+
$ = d;
|
|
534
525
|
},
|
|
535
526
|
enumerable: !0,
|
|
536
527
|
configurable: !0
|
|
@@ -546,12 +537,12 @@ function Ae(e) {
|
|
|
546
537
|
enumerable: !0,
|
|
547
538
|
configurable: !0
|
|
548
539
|
});
|
|
549
|
-
function
|
|
550
|
-
return this instanceof
|
|
540
|
+
function g(d, S) {
|
|
541
|
+
return this instanceof g ? (l.apply(this, arguments), this) : g.apply(Object.create(g.prototype), arguments);
|
|
551
542
|
}
|
|
552
543
|
function B() {
|
|
553
544
|
var d = this;
|
|
554
|
-
|
|
545
|
+
ge(d.path, d.flags, d.mode, function(S, h) {
|
|
555
546
|
S ? (d.autoClose && d.destroy(), d.emit("error", S)) : (d.fd = h, d.emit("open", h), d.read());
|
|
556
547
|
});
|
|
557
548
|
}
|
|
@@ -560,7 +551,7 @@ function Ae(e) {
|
|
|
560
551
|
}
|
|
561
552
|
function ee() {
|
|
562
553
|
var d = this;
|
|
563
|
-
|
|
554
|
+
ge(d.path, d.flags, d.mode, function(S, h) {
|
|
564
555
|
S ? (d.destroy(), d.emit("error", S)) : (d.fd = h, d.emit("open", h));
|
|
565
556
|
});
|
|
566
557
|
}
|
|
@@ -570,12 +561,12 @@ function Ae(e) {
|
|
|
570
561
|
function be(d, S) {
|
|
571
562
|
return new e.WriteStream(d, S);
|
|
572
563
|
}
|
|
573
|
-
var
|
|
574
|
-
e.open =
|
|
575
|
-
function
|
|
564
|
+
var Ut = e.open;
|
|
565
|
+
e.open = ge;
|
|
566
|
+
function ge(d, S, h, C) {
|
|
576
567
|
return typeof h == "function" && (C = h, h = null), N(d, S, h, C);
|
|
577
568
|
function N(P, E, D, w, _) {
|
|
578
|
-
return
|
|
569
|
+
return Ut(P, E, D, function(k, Pi) {
|
|
579
570
|
k && (k.code === "EMFILE" || k.code === "ENFILE") ? H([N, [P, E, D, w], k, _ || Date.now(), Date.now()]) : typeof w == "function" && w.apply(this, arguments);
|
|
580
571
|
});
|
|
581
572
|
}
|
|
@@ -586,7 +577,7 @@ function H(e) {
|
|
|
586
577
|
V("ENQUEUE", e[0].name, e[1]), F[I].push(e), xe();
|
|
587
578
|
}
|
|
588
579
|
var me;
|
|
589
|
-
function
|
|
580
|
+
function Ue() {
|
|
590
581
|
for (var e = Date.now(), t = 0; t < F[I].length; ++t)
|
|
591
582
|
F[I][t].length > 2 && (F[I][t][3] = e, F[I][t][4] = e);
|
|
592
583
|
xe();
|
|
@@ -743,7 +734,7 @@ var mt = {
|
|
|
743
734
|
utimesMillis: vn,
|
|
744
735
|
utimesMillisSync: wn
|
|
745
736
|
};
|
|
746
|
-
const Z = z, O = M,
|
|
737
|
+
const Z = z, O = M, $n = ae;
|
|
747
738
|
function kn(e, t, n) {
|
|
748
739
|
const i = n.dereference ? (r) => Z.stat(r, { bigint: !0 }) : (r) => Z.lstat(r, { bigint: !0 });
|
|
749
740
|
return Promise.all([
|
|
@@ -755,7 +746,7 @@ function kn(e, t, n) {
|
|
|
755
746
|
})
|
|
756
747
|
]).then(([r, o]) => ({ srcStat: r, destStat: o }));
|
|
757
748
|
}
|
|
758
|
-
function
|
|
749
|
+
function gn(e, t, n) {
|
|
759
750
|
let i;
|
|
760
751
|
const r = n.dereference ? (c) => Z.statSync(c, { bigint: !0 }) : (c) => Z.lstatSync(c, { bigint: !0 }), o = r(e);
|
|
761
752
|
try {
|
|
@@ -768,7 +759,7 @@ function $n(e, t, n) {
|
|
|
768
759
|
return { srcStat: o, destStat: i };
|
|
769
760
|
}
|
|
770
761
|
function En(e, t, n, i, r) {
|
|
771
|
-
|
|
762
|
+
$n.callbackify(kn)(e, t, i, (o, c) => {
|
|
772
763
|
if (o)
|
|
773
764
|
return r(o);
|
|
774
765
|
const { srcStat: a, destStat: f } = c;
|
|
@@ -786,7 +777,7 @@ function En(e, t, n, i, r) {
|
|
|
786
777
|
});
|
|
787
778
|
}
|
|
788
779
|
function Fn(e, t, n, i) {
|
|
789
|
-
const { srcStat: r, destStat: o } =
|
|
780
|
+
const { srcStat: r, destStat: o } = gn(e, t, i);
|
|
790
781
|
if (o) {
|
|
791
782
|
if (fe(r, o)) {
|
|
792
783
|
const c = O.basename(e), a = O.basename(t);
|
|
@@ -963,8 +954,8 @@ function Jn(e, t, n) {
|
|
|
963
954
|
j.unlink(t, (i) => i ? n(i) : j.symlink(e, t, n));
|
|
964
955
|
}
|
|
965
956
|
var bn = Cn;
|
|
966
|
-
const x = R, ce = M, qn = b.mkdirsSync,
|
|
967
|
-
function
|
|
957
|
+
const x = R, ce = M, qn = b.mkdirsSync, Gn = mt.utimesMillisSync, ue = K;
|
|
958
|
+
function Un(e, t, n) {
|
|
968
959
|
typeof n == "function" && (n = { filter: n }), n = n || {}, n.clobber = "clobber" in n ? !!n.clobber : !0, n.overwrite = "overwrite" in n ? !!n.overwrite : n.clobber, n.preserveTimestamps && process.arch === "ia32" && process.emitWarning(
|
|
969
960
|
`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
970
961
|
|
|
@@ -1014,15 +1005,15 @@ function je(e, t) {
|
|
|
1014
1005
|
}
|
|
1015
1006
|
function Xn(e, t) {
|
|
1016
1007
|
const n = x.statSync(e);
|
|
1017
|
-
return
|
|
1008
|
+
return Gn(t, n.atime, n.mtime);
|
|
1018
1009
|
}
|
|
1019
1010
|
function Zn(e, t, n, i, r) {
|
|
1020
|
-
return t ?
|
|
1011
|
+
return t ? $t(n, i, r) : Tn(e.mode, n, i, r);
|
|
1021
1012
|
}
|
|
1022
1013
|
function Tn(e, t, n, i) {
|
|
1023
|
-
return x.mkdirSync(n),
|
|
1014
|
+
return x.mkdirSync(n), $t(t, n, i), je(n, e);
|
|
1024
1015
|
}
|
|
1025
|
-
function
|
|
1016
|
+
function $t(e, t, n) {
|
|
1026
1017
|
x.readdirSync(e).forEach((i) => Kn(i, e, t, n));
|
|
1027
1018
|
}
|
|
1028
1019
|
function Kn(e, t, n, i) {
|
|
@@ -1054,7 +1045,7 @@ function er(e, t, n, i) {
|
|
|
1054
1045
|
function tr(e, t) {
|
|
1055
1046
|
return x.unlinkSync(t), x.symlinkSync(e, t);
|
|
1056
1047
|
}
|
|
1057
|
-
var nr =
|
|
1048
|
+
var nr = Un;
|
|
1058
1049
|
const rr = W.fromCallback;
|
|
1059
1050
|
var Me = {
|
|
1060
1051
|
copy: rr(bn),
|
|
@@ -1067,14 +1058,14 @@ function or(e, t) {
|
|
|
1067
1058
|
function cr(e) {
|
|
1068
1059
|
kt.rmSync(e, { recursive: !0, force: !0 });
|
|
1069
1060
|
}
|
|
1070
|
-
var
|
|
1061
|
+
var $e = {
|
|
1071
1062
|
remove: ir(or),
|
|
1072
1063
|
removeSync: cr
|
|
1073
1064
|
};
|
|
1074
|
-
const ur = W.fromPromise,
|
|
1065
|
+
const ur = W.fromPromise, gt = z, Et = M, Ft = b, Dt = $e, Ve = ur(async function(t) {
|
|
1075
1066
|
let n;
|
|
1076
1067
|
try {
|
|
1077
|
-
n = await
|
|
1068
|
+
n = await gt.readdir(t);
|
|
1078
1069
|
} catch {
|
|
1079
1070
|
return Ft.mkdirs(t);
|
|
1080
1071
|
}
|
|
@@ -1083,7 +1074,7 @@ const ur = W.fromPromise, $t = z, Et = M, Ft = b, Dt = ge, Ve = ur(async functio
|
|
|
1083
1074
|
function ze(e) {
|
|
1084
1075
|
let t;
|
|
1085
1076
|
try {
|
|
1086
|
-
t =
|
|
1077
|
+
t = gt.readdirSync(e);
|
|
1087
1078
|
} catch {
|
|
1088
1079
|
return Ft.mkdirsSync(e);
|
|
1089
1080
|
}
|
|
@@ -1097,27 +1088,27 @@ var ar = {
|
|
|
1097
1088
|
emptyDir: Ve,
|
|
1098
1089
|
emptydir: Ve
|
|
1099
1090
|
};
|
|
1100
|
-
const fr = W.fromCallback, Pt = M,
|
|
1091
|
+
const fr = W.fromCallback, Pt = M, U = R, Ot = b;
|
|
1101
1092
|
function sr(e, t) {
|
|
1102
1093
|
function n() {
|
|
1103
|
-
|
|
1094
|
+
U.writeFile(e, "", (i) => {
|
|
1104
1095
|
if (i)
|
|
1105
1096
|
return t(i);
|
|
1106
1097
|
t();
|
|
1107
1098
|
});
|
|
1108
1099
|
}
|
|
1109
|
-
|
|
1100
|
+
U.stat(e, (i, r) => {
|
|
1110
1101
|
if (!i && r.isFile())
|
|
1111
1102
|
return t();
|
|
1112
1103
|
const o = Pt.dirname(e);
|
|
1113
|
-
|
|
1104
|
+
U.stat(o, (c, a) => {
|
|
1114
1105
|
if (c)
|
|
1115
1106
|
return c.code === "ENOENT" ? Ot.mkdirs(o, (f) => {
|
|
1116
1107
|
if (f)
|
|
1117
1108
|
return t(f);
|
|
1118
1109
|
n();
|
|
1119
1110
|
}) : t(c);
|
|
1120
|
-
a.isDirectory() ? n() :
|
|
1111
|
+
a.isDirectory() ? n() : U.readdir(o, (f) => {
|
|
1121
1112
|
if (f)
|
|
1122
1113
|
return t(f);
|
|
1123
1114
|
});
|
|
@@ -1127,37 +1118,37 @@ function sr(e, t) {
|
|
|
1127
1118
|
function lr(e) {
|
|
1128
1119
|
let t;
|
|
1129
1120
|
try {
|
|
1130
|
-
t =
|
|
1121
|
+
t = U.statSync(e);
|
|
1131
1122
|
} catch {
|
|
1132
1123
|
}
|
|
1133
1124
|
if (t && t.isFile())
|
|
1134
1125
|
return;
|
|
1135
1126
|
const n = Pt.dirname(e);
|
|
1136
1127
|
try {
|
|
1137
|
-
|
|
1128
|
+
U.statSync(n).isDirectory() || U.readdirSync(n);
|
|
1138
1129
|
} catch (i) {
|
|
1139
1130
|
if (i && i.code === "ENOENT")
|
|
1140
1131
|
Ot.mkdirsSync(n);
|
|
1141
1132
|
else
|
|
1142
1133
|
throw i;
|
|
1143
1134
|
}
|
|
1144
|
-
|
|
1135
|
+
U.writeFileSync(e, "");
|
|
1145
1136
|
}
|
|
1146
1137
|
var mr = {
|
|
1147
1138
|
createFile: fr(sr),
|
|
1148
1139
|
createFileSync: lr
|
|
1149
1140
|
};
|
|
1150
|
-
const yr = W.fromCallback, Ct = M,
|
|
1141
|
+
const yr = W.fromCallback, Ct = M, G = R, Nt = b, pr = Q.pathExists, { areIdentical: _t } = K;
|
|
1151
1142
|
function dr(e, t, n) {
|
|
1152
1143
|
function i(r, o) {
|
|
1153
|
-
|
|
1144
|
+
G.link(r, o, (c) => {
|
|
1154
1145
|
if (c)
|
|
1155
1146
|
return n(c);
|
|
1156
1147
|
n(null);
|
|
1157
1148
|
});
|
|
1158
1149
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1150
|
+
G.lstat(t, (r, o) => {
|
|
1151
|
+
G.lstat(e, (c, a) => {
|
|
1161
1152
|
if (c)
|
|
1162
1153
|
return c.message = c.message.replace("lstat", "ensureLink"), n(c);
|
|
1163
1154
|
if (o && _t(a, o))
|
|
@@ -1180,18 +1171,18 @@ function dr(e, t, n) {
|
|
|
1180
1171
|
function hr(e, t) {
|
|
1181
1172
|
let n;
|
|
1182
1173
|
try {
|
|
1183
|
-
n =
|
|
1174
|
+
n = G.lstatSync(t);
|
|
1184
1175
|
} catch {
|
|
1185
1176
|
}
|
|
1186
1177
|
try {
|
|
1187
|
-
const o =
|
|
1178
|
+
const o = G.lstatSync(e);
|
|
1188
1179
|
if (n && _t(o, n))
|
|
1189
1180
|
return;
|
|
1190
1181
|
} catch (o) {
|
|
1191
1182
|
throw o.message = o.message.replace("lstat", "ensureLink"), o;
|
|
1192
1183
|
}
|
|
1193
1184
|
const i = Ct.dirname(t);
|
|
1194
|
-
return
|
|
1185
|
+
return G.existsSync(i) || Nt.mkdirsSync(i), G.linkSync(e, t);
|
|
1195
1186
|
}
|
|
1196
1187
|
var Sr = {
|
|
1197
1188
|
createLink: yr(dr),
|
|
@@ -1215,7 +1206,7 @@ function wr(e, t, n) {
|
|
|
1215
1206
|
})));
|
|
1216
1207
|
}
|
|
1217
1208
|
}
|
|
1218
|
-
function
|
|
1209
|
+
function $r(e, t) {
|
|
1219
1210
|
let n;
|
|
1220
1211
|
if (Y.isAbsolute(e)) {
|
|
1221
1212
|
if (n = ne.existsSync(e), !n)
|
|
@@ -1241,10 +1232,10 @@ function gr(e, t) {
|
|
|
1241
1232
|
}
|
|
1242
1233
|
var kr = {
|
|
1243
1234
|
symlinkPaths: wr,
|
|
1244
|
-
symlinkPathsSync:
|
|
1235
|
+
symlinkPathsSync: $r
|
|
1245
1236
|
};
|
|
1246
1237
|
const It = R;
|
|
1247
|
-
function
|
|
1238
|
+
function gr(e, t, n) {
|
|
1248
1239
|
if (n = typeof t == "function" ? t : n, t = typeof t == "function" ? !1 : t, t)
|
|
1249
1240
|
return n(null, t);
|
|
1250
1241
|
It.lstat(e, (i, r) => {
|
|
@@ -1265,7 +1256,7 @@ function Er(e, t) {
|
|
|
1265
1256
|
return n && n.isDirectory() ? "dir" : "file";
|
|
1266
1257
|
}
|
|
1267
1258
|
var Fr = {
|
|
1268
|
-
symlinkType:
|
|
1259
|
+
symlinkType: gr,
|
|
1269
1260
|
symlinkTypeSync: Er
|
|
1270
1261
|
};
|
|
1271
1262
|
const Dr = W.fromCallback, At = M, J = z, xt = b, Pr = xt.mkdirs, Or = xt.mkdirsSync, Lt = kr, Cr = Lt.symlinkPaths, Nr = Lt.symlinkPathsSync, Wt = Fr, _r = Wt.symlinkType, Ir = Wt.symlinkTypeSync, Ar = Q.pathExists, { areIdentical: jt } = K;
|
|
@@ -1386,16 +1377,16 @@ async function qr(e, t, n = {}) {
|
|
|
1386
1377
|
const i = n.fs || T, r = Mt(t, n);
|
|
1387
1378
|
await ke.fromCallback(i.writeFile)(e, r, n);
|
|
1388
1379
|
}
|
|
1389
|
-
const
|
|
1390
|
-
function
|
|
1380
|
+
const Gr = ke.fromPromise(qr);
|
|
1381
|
+
function Ur(e, t, n = {}) {
|
|
1391
1382
|
const i = n.fs || T, r = Mt(t, n);
|
|
1392
1383
|
return i.writeFileSync(e, r, n);
|
|
1393
1384
|
}
|
|
1394
1385
|
const Yr = {
|
|
1395
1386
|
readFile: Jr,
|
|
1396
1387
|
readFileSync: br,
|
|
1397
|
-
writeFile:
|
|
1398
|
-
writeFileSync:
|
|
1388
|
+
writeFile: Gr,
|
|
1389
|
+
writeFileSync: Ur
|
|
1399
1390
|
};
|
|
1400
1391
|
var Vr = Yr;
|
|
1401
1392
|
const ye = Vr;
|
|
@@ -1453,7 +1444,7 @@ L.writeJSONSync = L.writeJsonSync;
|
|
|
1453
1444
|
L.readJSON = L.readJson;
|
|
1454
1445
|
L.readJSONSync = L.readJsonSync;
|
|
1455
1446
|
var ui = L;
|
|
1456
|
-
const ai = R, _e = M, fi = Me.copy, bt =
|
|
1447
|
+
const ai = R, _e = M, fi = Me.copy, bt = $e.remove, si = b.mkdirp, li = Q.pathExists, tt = K;
|
|
1457
1448
|
function mi(e, t, n, i) {
|
|
1458
1449
|
typeof n == "function" && (i = n, n = {}), n = n || {};
|
|
1459
1450
|
const r = n.overwrite || n.clobber || !1;
|
|
@@ -1491,21 +1482,21 @@ function pi(e, t, n, i) {
|
|
|
1491
1482
|
}, (o) => o ? i(o) : bt(e, i));
|
|
1492
1483
|
}
|
|
1493
1484
|
var di = mi;
|
|
1494
|
-
const qt = R, Ie = M, hi = Me.copySync,
|
|
1485
|
+
const qt = R, Ie = M, hi = Me.copySync, Gt = $e.removeSync, Si = b.mkdirpSync, rt = K;
|
|
1495
1486
|
function vi(e, t, n) {
|
|
1496
1487
|
n = n || {};
|
|
1497
1488
|
const i = n.overwrite || n.clobber || !1, { srcStat: r, isChangingCase: o = !1 } = rt.checkPathsSync(e, t, "move", n);
|
|
1498
|
-
return rt.checkParentPathsSync(e, r, t, "move"), wi(t) || Si(Ie.dirname(t)),
|
|
1489
|
+
return rt.checkParentPathsSync(e, r, t, "move"), wi(t) || Si(Ie.dirname(t)), $i(e, t, i, o);
|
|
1499
1490
|
}
|
|
1500
1491
|
function wi(e) {
|
|
1501
1492
|
const t = Ie.dirname(e);
|
|
1502
1493
|
return Ie.parse(t).root === t;
|
|
1503
1494
|
}
|
|
1504
|
-
function
|
|
1495
|
+
function $i(e, t, n, i) {
|
|
1505
1496
|
if (i)
|
|
1506
1497
|
return Pe(e, t, n);
|
|
1507
1498
|
if (n)
|
|
1508
|
-
return
|
|
1499
|
+
return Gt(t), Pe(e, t, n);
|
|
1509
1500
|
if (qt.existsSync(t))
|
|
1510
1501
|
throw new Error("dest already exists.");
|
|
1511
1502
|
return Pe(e, t, n);
|
|
@@ -1523,13 +1514,13 @@ function ki(e, t, n) {
|
|
|
1523
1514
|
return hi(e, t, {
|
|
1524
1515
|
overwrite: n,
|
|
1525
1516
|
errorOnExist: !0
|
|
1526
|
-
}),
|
|
1517
|
+
}), Gt(e);
|
|
1527
1518
|
}
|
|
1528
|
-
var
|
|
1519
|
+
var gi = vi;
|
|
1529
1520
|
const Ei = W.fromCallback;
|
|
1530
1521
|
var Fi = {
|
|
1531
1522
|
move: Ei(di),
|
|
1532
|
-
moveSync:
|
|
1523
|
+
moveSync: gi
|
|
1533
1524
|
}, Di = {
|
|
1534
1525
|
...z,
|
|
1535
1526
|
...Me,
|
|
@@ -1540,7 +1531,7 @@ var Fi = {
|
|
|
1540
1531
|
...Fi,
|
|
1541
1532
|
...Be,
|
|
1542
1533
|
...Q,
|
|
1543
|
-
|
|
1534
|
+
...$e
|
|
1544
1535
|
};
|
|
1545
1536
|
const pe = Di;
|
|
1546
1537
|
function Ii(e, t) {
|