@atlaspack/utils 2.16.2-noselfbuild-8c516162e.0 → 2.16.2-noselfbuild-b8f24f3f8.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/lib/index.js +6 -0
- package/lib/progress-message.js +9 -0
- package/package.json +9 -9
- package/src/index.js +4 -1
- package/src/progress-message.js +15 -0
package/lib/index.js
CHANGED
|
@@ -159,6 +159,12 @@ Object.defineProperty(exports, "getModuleParts", {
|
|
|
159
159
|
return _getModuleParts.default;
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
|
+
Object.defineProperty(exports, "getPackageProgressMessage", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _progressMessage.getPackageProgressMessage;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
162
168
|
Object.defineProperty(exports, "getProgressMessage", {
|
|
163
169
|
enumerable: true,
|
|
164
170
|
get: function () {
|
package/lib/progress-message.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getPackageProgressMessage = getPackageProgressMessage;
|
|
6
7
|
exports.getProgressMessage = getProgressMessage;
|
|
7
8
|
function _path() {
|
|
8
9
|
const data = _interopRequireDefault(require("path"));
|
|
@@ -22,6 +23,14 @@ function getProgressMessage(event) {
|
|
|
22
23
|
return `Packaging ${event.bundle.displayName}...`;
|
|
23
24
|
case 'optimizing':
|
|
24
25
|
return `Optimizing ${event.bundle.displayName}...`;
|
|
26
|
+
case 'packagingAndOptimizing':
|
|
27
|
+
{
|
|
28
|
+
return getPackageProgressMessage(event.completeBundles, event.totalBundles);
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
return null;
|
|
32
|
+
}
|
|
33
|
+
function getPackageProgressMessage(completeBundles, totalBundles) {
|
|
34
|
+
let percent = Math.floor(completeBundles / totalBundles * 100);
|
|
35
|
+
return `Packaging bundles ${completeBundles}/${totalBundles} (${percent}%)`;
|
|
27
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/utils",
|
|
3
|
-
"version": "2.16.2-noselfbuild-
|
|
3
|
+
"version": "2.16.2-noselfbuild-b8f24f3f8.0",
|
|
4
4
|
"description": "Blazing fast, zero configuration web application bundler",
|
|
5
5
|
"license": "(MIT OR Apache-2.0)",
|
|
6
6
|
"publishConfig": {
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaspack/codeframe": "2.13.4-noselfbuild-
|
|
34
|
-
"@atlaspack/diagnostic": "2.14.2-noselfbuild-
|
|
35
|
-
"@atlaspack/feature-flags": "2.18.5-noselfbuild-
|
|
36
|
-
"@atlaspack/logger": "2.14.13-noselfbuild-
|
|
37
|
-
"@atlaspack/markdown-ansi": "2.14.2-noselfbuild-
|
|
38
|
-
"@atlaspack/rust": "3.4.1-noselfbuild-
|
|
33
|
+
"@atlaspack/codeframe": "2.13.4-noselfbuild-b8f24f3f8.0",
|
|
34
|
+
"@atlaspack/diagnostic": "2.14.2-noselfbuild-b8f24f3f8.0",
|
|
35
|
+
"@atlaspack/feature-flags": "2.18.5-noselfbuild-b8f24f3f8.0",
|
|
36
|
+
"@atlaspack/logger": "2.14.13-noselfbuild-b8f24f3f8.0",
|
|
37
|
+
"@atlaspack/markdown-ansi": "2.14.2-noselfbuild-b8f24f3f8.0",
|
|
38
|
+
"@atlaspack/rust": "3.4.1-noselfbuild-b8f24f3f8.0",
|
|
39
39
|
"@iarna/toml": "^2.2.0",
|
|
40
40
|
"@parcel/source-map": "^2.1.1",
|
|
41
41
|
"ansi-html-community": "0.0.8",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"terminal-link": "^2.1.1"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@atlaspack/babel-register": "2.14.2-noselfbuild-
|
|
59
|
+
"@atlaspack/babel-register": "2.14.2-noselfbuild-b8f24f3f8.0",
|
|
60
60
|
"benny": "^3.7.1",
|
|
61
61
|
"random-int": "^1.0.0"
|
|
62
62
|
},
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"@atlaspack/markdown-ansi": false
|
|
68
68
|
},
|
|
69
69
|
"type": "commonjs",
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "b8f24f3f82b06cb57291e1fa02e9655350bb1ac2"
|
|
71
71
|
}
|
package/src/index.js
CHANGED
|
@@ -51,7 +51,10 @@ export {
|
|
|
51
51
|
export {debugTools} from './debug-tools';
|
|
52
52
|
export {DefaultMap, DefaultWeakMap} from './DefaultMap';
|
|
53
53
|
export {makeDeferredWithPromise} from './Deferred';
|
|
54
|
-
export {
|
|
54
|
+
export {
|
|
55
|
+
getProgressMessage,
|
|
56
|
+
getPackageProgressMessage,
|
|
57
|
+
} from './progress-message';
|
|
55
58
|
export {
|
|
56
59
|
isGlob,
|
|
57
60
|
isGlobMatch,
|
package/src/progress-message.js
CHANGED
|
@@ -16,7 +16,22 @@ export function getProgressMessage(event: BuildProgressEvent): ?string {
|
|
|
16
16
|
|
|
17
17
|
case 'optimizing':
|
|
18
18
|
return `Optimizing ${event.bundle.displayName}...`;
|
|
19
|
+
|
|
20
|
+
case 'packagingAndOptimizing': {
|
|
21
|
+
return getPackageProgressMessage(
|
|
22
|
+
event.completeBundles,
|
|
23
|
+
event.totalBundles,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
return null;
|
|
22
29
|
}
|
|
30
|
+
|
|
31
|
+
export function getPackageProgressMessage(
|
|
32
|
+
completeBundles: number,
|
|
33
|
+
totalBundles: number,
|
|
34
|
+
): string {
|
|
35
|
+
let percent = Math.floor((completeBundles / totalBundles) * 100);
|
|
36
|
+
return `Packaging bundles ${completeBundles}/${totalBundles} (${percent}%)`;
|
|
37
|
+
}
|