piral-cli 0.15.0-beta.4696 → 0.15.0-beta.4699
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/lib/common/constants.d.ts +1 -1
- package/lib/common/injectors.js +4 -4
- package/lib/common/injectors.js.map +1 -1
- package/lib/common/log.d.ts +2 -2
- package/lib/common/log.js +18 -47
- package/lib/common/log.js.map +1 -1
- package/lib/external/index.js +59509 -61418
- package/package.json +9 -7
- package/src/common/archive.test.ts +51 -45
- package/src/common/browser.test.ts +17 -7
- package/src/common/http.test.ts +69 -57
- package/src/common/injectors.ts +1 -1
- package/src/common/interactive.test.ts +3 -0
- package/src/common/log.ts +23 -55
- package/src/common/npm.test.ts +2 -7
- package/src/common/port.test.ts +4 -1
- package/src/common/rules.test.ts +3 -3
- package/src/external/index.test.ts +2 -2
- package/src/external/index.ts +6 -3
- package/src/external/resolve.ts +28 -0
- package/lib/external/child.js +0 -144
- package/lib/external/classes.trie +0 -0
- package/lib/external/xdg-open +0 -1066
|
@@ -6,6 +6,6 @@ export declare const frameworkLibs: ("piral-native" | "piral" | "piral-core" | "
|
|
|
6
6
|
export declare const piletJsonSchemaUrl = "https://schema.piral.io/v0/pilet.json";
|
|
7
7
|
export declare const piralJsonSchemaUrl = "https://schema.piral.io/v0/piral.json";
|
|
8
8
|
export declare const entryModuleExtensions: string[];
|
|
9
|
-
export declare const bundlerNames: ("
|
|
9
|
+
export declare const bundlerNames: ("webpack" | "esbuild" | "parcel" | "parcel2" | "rollup" | "webpack5" | "vite" | "xbuild")[];
|
|
10
10
|
export declare const declarationEntryExtensions: string[];
|
|
11
11
|
export declare const legacyCoreExternals: string[];
|
package/lib/common/injectors.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createInitialKrasConfig = exports.notifyServerOnline = void 0;
|
|
4
|
-
const chalk_1 = require("chalk");
|
|
5
4
|
const path_1 = require("path");
|
|
6
5
|
const emoji_1 = require("./emoji");
|
|
7
6
|
const log_1 = require("./log");
|
|
7
|
+
const external_1 = require("../external");
|
|
8
8
|
function notifyServerOnline(bundlers, path, api) {
|
|
9
9
|
return (svc) => {
|
|
10
10
|
(0, log_1.log)('generalDebug_0003', `The kras server for debugging is online!`);
|
|
11
|
-
const address = `${svc.protocol}://localhost:${
|
|
12
|
-
(0, log_1.logInfo)(`${emoji_1.liveIcon} Running at ${
|
|
13
|
-
(0, log_1.logInfo)(`${emoji_1.settingsIcon} Manage via ${
|
|
11
|
+
const address = `${svc.protocol}://localhost:${external_1.chalk.green(svc.port)}`;
|
|
12
|
+
(0, log_1.logInfo)(`${emoji_1.liveIcon} Running at ${external_1.chalk.bold(address + path)}`);
|
|
13
|
+
(0, log_1.logInfo)(`${emoji_1.settingsIcon} Manage via ${external_1.chalk.bold(address + api)}`);
|
|
14
14
|
(0, log_1.logReset)();
|
|
15
15
|
bundlers.forEach((bundler) => bundler.start());
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectors.js","sourceRoot":"","sources":["../../src/common/injectors.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"injectors.js","sourceRoot":"","sources":["../../src/common/injectors.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,mCAAiD;AACjD,+BAA+C;AAC/C,0CAAoC;AAGpC,SAAgB,kBAAkB,CAAC,QAAwB,EAAE,IAAY,EAAE,GAAmB;IAC5F,OAAO,CAAC,GAAQ,EAAE,EAAE;QAClB,IAAA,SAAG,EAAC,mBAAmB,EAAE,0CAA0C,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,QAAQ,gBAAgB,gBAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,IAAA,aAAO,EAAC,GAAG,gBAAQ,eAAe,gBAAK,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;QAChE,IAAA,aAAO,EAAC,GAAG,oBAAY,eAAe,gBAAK,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;QACnE,IAAA,cAAQ,GAAE,CAAC;QACX,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AATD,gDASC;AAED,SAAgB,uBAAuB,CACrC,SAAiB,EACjB,UAAyB,EAAE,EAC3B,MAA8B,EAAE,EAChC,OAA+B,EAAE;IAEjC,OAAO;QACL,GAAG,EAAE,qBAAqB;QAC1B,SAAS;QACT,GAAG,kBACD,GAAG,EAAE,EAAE,IACJ,GAAG,CACP;QACD,GAAG,EAAE,SAAS;QACd,OAAO;QACP,YAAY,EAAE,CAAC,IAAA,cAAO,EAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QAClD,SAAS,EAAE;YACT,MAAM,EAAE;gBACN,MAAM,EAAE,IAAI;aACb;YACD,GAAG,EAAE;gBACH,MAAM,EAAE,IAAI;gBACZ,KAAK,EAAE,KAAK;aACb;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,IAAI;aAChB;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;gBACZ,OAAO,EAAE,EAAE;aACZ;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,EAAE;gBACX,IAAI;aACL;YACD,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI;aACb;SACF;KACF,CAAC;AACJ,CAAC;AA3CD,0DA2CC"}
|
package/lib/common/log.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { LogLevels } from '../types';
|
|
|
3
3
|
declare type Messages = typeof messages;
|
|
4
4
|
declare type MessageTypes = keyof Messages;
|
|
5
5
|
export declare function getLogLevel(): LogLevels;
|
|
6
|
-
export declare function setLogLevel(
|
|
6
|
+
export declare function setLogLevel(value: LogLevels): void;
|
|
7
7
|
export declare function logInfo(message: string, ...args: Array<string | number | boolean>): string;
|
|
8
8
|
export declare function logDebug(message: string, ...args: Array<string | number | boolean>): string;
|
|
9
9
|
export declare function logVerbose(message: string, ...args: Array<string | number | boolean>): string;
|
|
@@ -12,7 +12,7 @@ export declare function logWarn(message: string, ...args: Array<string | number
|
|
|
12
12
|
export declare function logFail(message: string, ...args: Array<string | number | boolean>): string;
|
|
13
13
|
export declare function progress(message: string, ...args: Array<string | number | boolean>): void;
|
|
14
14
|
export declare function logReset(): void;
|
|
15
|
-
export declare function logSuspend(): () =>
|
|
15
|
+
export declare function logSuspend(): () => import("ora").Ora;
|
|
16
16
|
export declare function fail<T extends MessageTypes>(type: T, ...args: Parameters<Messages[T]>): never;
|
|
17
17
|
export declare function log<T extends MessageTypes>(type: T, ...args: Parameters<Messages[T]>): string;
|
|
18
18
|
export {};
|
package/lib/common/log.js
CHANGED
|
@@ -2,101 +2,72 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.log = exports.fail = exports.logSuspend = exports.logReset = exports.progress = exports.logFail = exports.logWarn = exports.logDone = exports.logVerbose = exports.logDebug = exports.logInfo = exports.setLogLevel = exports.getLogLevel = void 0;
|
|
4
4
|
const messages = require("../messages");
|
|
5
|
-
const path_1 = require("path");
|
|
6
5
|
const util_1 = require("util");
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const info_1 = require("./info");
|
|
9
6
|
const external_1 = require("../external");
|
|
10
7
|
const types_1 = require("../types");
|
|
11
8
|
let currentProgress = undefined;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const logger = require('@parcel/logger');
|
|
15
|
-
// check to see if this is really right
|
|
16
|
-
if (typeof logger.verbose === 'function') {
|
|
17
|
-
return logger;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch (_a) { }
|
|
21
|
-
return require('../external').logger;
|
|
22
|
-
})();
|
|
23
|
-
// unfortunately, Parcel's support for verbose logging on Windows is broken
|
|
24
|
-
if (info_1.isWindows) {
|
|
25
|
-
logger.verbose = function (message) {
|
|
26
|
-
if (this.logLevel < 4) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
const currDate = new Date();
|
|
30
|
-
message = `[${currDate.toLocaleTimeString()}]: ${message}`;
|
|
31
|
-
if (this.logLevel > 4) {
|
|
32
|
-
if (!this.logFile) {
|
|
33
|
-
// the critical line is the filename; it must not contain colons!
|
|
34
|
-
const timestamp = currDate.toISOString().replace(/:/g, '');
|
|
35
|
-
const fileName = `parcel-debug-${timestamp}.log`;
|
|
36
|
-
this.logFile = (0, fs_1.createWriteStream)((0, path_1.join)(process.cwd(), fileName));
|
|
37
|
-
}
|
|
38
|
-
this.logFile.write(external_1.stripAnsi.default(message) + '\n');
|
|
39
|
-
}
|
|
40
|
-
this._log(message);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
9
|
+
let logLevel = types_1.LogLevels.info;
|
|
10
|
+
let instance = (0, external_1.ora)();
|
|
43
11
|
function getLogLevel() {
|
|
44
|
-
return
|
|
12
|
+
return logLevel;
|
|
45
13
|
}
|
|
46
14
|
exports.getLogLevel = getLogLevel;
|
|
47
|
-
function setLogLevel(
|
|
48
|
-
|
|
15
|
+
function setLogLevel(value) {
|
|
16
|
+
logLevel = value;
|
|
49
17
|
}
|
|
50
18
|
exports.setLogLevel = setLogLevel;
|
|
51
19
|
function logInfo(message, ...args) {
|
|
52
20
|
const msg = (0, util_1.format)(message, ...args);
|
|
53
|
-
|
|
21
|
+
instance.info(msg);
|
|
54
22
|
return msg;
|
|
55
23
|
}
|
|
56
24
|
exports.logInfo = logInfo;
|
|
57
25
|
function logDebug(message, ...args) {
|
|
58
26
|
const msg = (0, util_1.format)(message, ...args);
|
|
59
|
-
|
|
27
|
+
if (logLevel >= types_1.LogLevels.debug) {
|
|
28
|
+
instance.info(msg);
|
|
29
|
+
}
|
|
60
30
|
return msg;
|
|
61
31
|
}
|
|
62
32
|
exports.logDebug = logDebug;
|
|
63
33
|
function logVerbose(message, ...args) {
|
|
64
34
|
const msg = (0, util_1.format)(message, ...args);
|
|
65
|
-
|
|
35
|
+
if (logLevel >= types_1.LogLevels.verbose) {
|
|
36
|
+
instance.info(msg);
|
|
37
|
+
}
|
|
66
38
|
return msg;
|
|
67
39
|
}
|
|
68
40
|
exports.logVerbose = logVerbose;
|
|
69
41
|
function logDone(message, ...args) {
|
|
70
42
|
const msg = (0, util_1.format)(message, ...args);
|
|
71
|
-
|
|
43
|
+
instance.succeed(msg);
|
|
72
44
|
return msg;
|
|
73
45
|
}
|
|
74
46
|
exports.logDone = logDone;
|
|
75
47
|
function logWarn(message, ...args) {
|
|
76
48
|
const msg = (0, util_1.format)(message, ...args);
|
|
77
|
-
|
|
49
|
+
instance.warn(msg);
|
|
78
50
|
return msg;
|
|
79
51
|
}
|
|
80
52
|
exports.logWarn = logWarn;
|
|
81
53
|
function logFail(message, ...args) {
|
|
82
54
|
const msg = (0, util_1.format)(message, ...args);
|
|
83
|
-
|
|
55
|
+
instance.fail(msg);
|
|
84
56
|
return msg;
|
|
85
57
|
}
|
|
86
58
|
exports.logFail = logFail;
|
|
87
59
|
function progress(message, ...args) {
|
|
88
60
|
currentProgress = (0, util_1.format)(message, ...args);
|
|
89
|
-
|
|
61
|
+
instance.start(message);
|
|
90
62
|
}
|
|
91
63
|
exports.progress = progress;
|
|
92
64
|
function logReset() {
|
|
93
|
-
|
|
94
|
-
logger.stopSpinner();
|
|
65
|
+
instance.stop();
|
|
95
66
|
}
|
|
96
67
|
exports.logReset = logReset;
|
|
97
68
|
function logSuspend() {
|
|
98
69
|
logReset();
|
|
99
|
-
return () =>
|
|
70
|
+
return () => instance.start(currentProgress);
|
|
100
71
|
}
|
|
101
72
|
exports.logSuspend = logSuspend;
|
|
102
73
|
function fail(type, ...args) {
|
package/lib/common/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/common/log.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,+
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/common/log.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,+BAA8B;AAC9B,0CAAkC;AAClC,oCAAmD;AAInD,IAAI,eAAe,GAAW,SAAS,CAAC;AACxC,IAAI,QAAQ,GAAG,iBAAS,CAAC,IAAI,CAAC;AAC9B,IAAI,QAAQ,GAAG,IAAA,cAAG,GAAE,CAAC;AAErB,SAAgB,WAAW;IACzB,OAAO,QAAQ,CAAC;AAClB,CAAC;AAFD,kCAEC;AAED,SAAgB,WAAW,CAAC,KAAgB;IAC1C,QAAQ,GAAG,KAAK,CAAC;AACnB,CAAC;AAFD,kCAEC;AAED,SAAgB,OAAO,CAAC,OAAe,EAAE,GAAG,IAAsC;IAChF,MAAM,GAAG,GAAG,IAAA,aAAM,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACrC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,GAAG,CAAC;AACb,CAAC;AAJD,0BAIC;AAED,SAAgB,QAAQ,CAAC,OAAe,EAAE,GAAG,IAAsC;IACjF,MAAM,GAAG,GAAG,IAAA,aAAM,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAErC,IAAI,QAAQ,IAAI,iBAAS,CAAC,KAAK,EAAE;QAC/B,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpB;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AARD,4BAQC;AAED,SAAgB,UAAU,CAAC,OAAe,EAAE,GAAG,IAAsC;IACnF,MAAM,GAAG,GAAG,IAAA,aAAM,EAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAErC,IAA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