@e-mc/module 0.9.1 → 0.9.2
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 +6 -6
- package/index.js +9 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
## Interface
|
|
11
11
|
|
|
12
|
-
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.
|
|
12
|
+
* [View Source](https://www.unpkg.com/@e-mc/types@0.9.2/lib/index.d.ts)
|
|
13
13
|
|
|
14
14
|
```typescript
|
|
15
15
|
import type { LogStatus } from "./squared";
|
|
@@ -391,11 +391,11 @@ type ForegroundColor = typeof IForegroundColor | `#${string}`;
|
|
|
391
391
|
|
|
392
392
|
## References
|
|
393
393
|
|
|
394
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
395
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
396
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
397
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
398
|
-
- https://www.unpkg.com/@e-mc/types@0.9.
|
|
394
|
+
- https://www.unpkg.com/@e-mc/types@0.9.2/lib/core.d.ts
|
|
395
|
+
- https://www.unpkg.com/@e-mc/types@0.9.2/lib/logger.d.ts
|
|
396
|
+
- https://www.unpkg.com/@e-mc/types@0.9.2/lib/module.d.ts
|
|
397
|
+
- https://www.unpkg.com/@e-mc/types@0.9.2/lib/node.d.ts
|
|
398
|
+
- https://www.unpkg.com/@e-mc/types@0.9.2/lib/settings.d.ts
|
|
399
399
|
|
|
400
400
|
* https://www.npmjs.com/package/@types/node
|
|
401
401
|
|
package/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const filetype = require("file-type");
|
|
|
9
9
|
const mime = require("mime-types");
|
|
10
10
|
const pm = require("picomatch");
|
|
11
11
|
const chalk = require("chalk");
|
|
12
|
+
const yaml = require("js-yaml");
|
|
12
13
|
const stripansi = require("strip-ansi");
|
|
13
14
|
const EventEmitter = require("events");
|
|
14
15
|
const types_1 = require("@e-mc/types");
|
|
@@ -134,7 +135,7 @@ let TEMP_DIR = path.join(PROCESS_CWD, "tmp");
|
|
|
134
135
|
let PNPM_VER;
|
|
135
136
|
let YARN_VER;
|
|
136
137
|
function parseYaml(pathname) {
|
|
137
|
-
return
|
|
138
|
+
return yaml.load(fs.readFileSync(pathname, 'utf-8'));
|
|
138
139
|
}
|
|
139
140
|
function setPnpmVer() {
|
|
140
141
|
if (PNPM_VER === undefined) {
|
|
@@ -694,7 +695,7 @@ class Module extends EventEmitter {
|
|
|
694
695
|
this[_f] = new AbortController();
|
|
695
696
|
this[_g] = null;
|
|
696
697
|
}
|
|
697
|
-
static get VERSION() { return "0.9.
|
|
698
|
+
static get VERSION() { return "0.9.2"; }
|
|
698
699
|
static get LOG_TYPE() { return types_1.LOG_TYPE; }
|
|
699
700
|
static get STATUS_TYPE() { return types_1.STATUS_TYPE; }
|
|
700
701
|
static get MAX_TIMEOUT() { return 2147483647; }
|
|
@@ -994,7 +995,7 @@ class Module extends EventEmitter {
|
|
|
994
995
|
value = getValue();
|
|
995
996
|
}
|
|
996
997
|
const unit = options.messageUnit ? type & 256 ? options.messageUnit.padStart(options.messageUnitMinWidth || 0) : options.messageUnit : '';
|
|
997
|
-
const getMessage = (m, u) => type & 256 && messageUnitIndent === undefined ? (u + m).trimEnd() : u ? (m + (messageUnitIndent === undefined ? ' ' : '') + u).trimStart() : m;
|
|
998
|
+
const getMessage = (m, u) => (type & 256) && messageUnitIndent === undefined ? (u + m).trimEnd() : u ? (m + (messageUnitIndent === undefined ? ' ' : '') + u).trimStart() : m;
|
|
998
999
|
if (coloring) {
|
|
999
1000
|
let { titleColor, titleBgColor, valueColor, valueBgColor, valueBold, messageWidth, messageColor, messageBgColor, messageBold } = options;
|
|
1000
1001
|
if (!titleColor && !titleBgColor) {
|
|
@@ -2697,7 +2698,7 @@ class Module extends EventEmitter {
|
|
|
2697
2698
|
if (!err) {
|
|
2698
2699
|
setCache(data);
|
|
2699
2700
|
}
|
|
2700
|
-
|
|
2701
|
+
callback(err, data);
|
|
2701
2702
|
});
|
|
2702
2703
|
}
|
|
2703
2704
|
return;
|
|
@@ -2734,7 +2735,7 @@ class Module extends EventEmitter {
|
|
|
2734
2735
|
if (!err) {
|
|
2735
2736
|
this.emit('file:write', outSrc, options);
|
|
2736
2737
|
}
|
|
2737
|
-
|
|
2738
|
+
callback(err);
|
|
2738
2739
|
});
|
|
2739
2740
|
return;
|
|
2740
2741
|
}
|
|
@@ -2771,7 +2772,7 @@ class Module extends EventEmitter {
|
|
|
2771
2772
|
if (!err) {
|
|
2772
2773
|
this.emit('file:delete', outSrc, options);
|
|
2773
2774
|
}
|
|
2774
|
-
|
|
2775
|
+
callback(err);
|
|
2775
2776
|
});
|
|
2776
2777
|
return;
|
|
2777
2778
|
}
|
|
@@ -2826,7 +2827,7 @@ class Module extends EventEmitter {
|
|
|
2826
2827
|
if (!err) {
|
|
2827
2828
|
this.emit('file:copy', outDest, options);
|
|
2828
2829
|
}
|
|
2829
|
-
|
|
2830
|
+
callback(err);
|
|
2830
2831
|
});
|
|
2831
2832
|
return;
|
|
2832
2833
|
}
|
|
@@ -2905,7 +2906,7 @@ class Module extends EventEmitter {
|
|
|
2905
2906
|
if (!err) {
|
|
2906
2907
|
this.emit('file:move', outDest, options);
|
|
2907
2908
|
}
|
|
2908
|
-
|
|
2909
|
+
callback(err);
|
|
2909
2910
|
});
|
|
2910
2911
|
return;
|
|
2911
2912
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/module",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Module base class for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "BSD 3-Clause",
|
|
21
21
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/types": "0.9.
|
|
23
|
+
"@e-mc/types": "0.9.2",
|
|
24
24
|
"chalk": "4.1.2",
|
|
25
25
|
"file-type": "16.5.4",
|
|
26
26
|
"js-yaml": "^4.1.0",
|