@atlaspack/bundle-stats 2.14.22-typescript-e99c742e9.0 → 2.14.22-typescript-bc4459c37.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/cli.d.ts +2 -0
- package/lib/cli.js +6 -3
- package/package.json +8 -8
- package/src/{cli.js → cli.ts} +5 -6
package/lib/cli.d.ts
ADDED
package/lib/cli.js
CHANGED
@@ -34,12 +34,17 @@ function _utils() {
|
|
34
34
|
return data;
|
35
35
|
}
|
36
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
37
|
-
/* eslint-disable no-console, monorepo/no-internal-import */
|
37
|
+
/* eslint-disable no-console, monorepo/no-internal-import */
|
38
|
+
|
39
|
+
// @ts-expect-error invalid export
|
40
|
+
|
38
41
|
const {
|
39
42
|
loadGraphs,
|
40
43
|
getBundleStats,
|
41
44
|
PackagedBundleClass
|
42
45
|
} = require('./deep-imports.js');
|
46
|
+
|
47
|
+
// @ts-expect-error no types
|
43
48
|
async function run({
|
44
49
|
cacheDir,
|
45
50
|
outDir
|
@@ -65,8 +70,6 @@ async function run({
|
|
65
70
|
recursive: true
|
66
71
|
});
|
67
72
|
let projectRoot = process.cwd();
|
68
|
-
|
69
|
-
// $FlowFixMe[unclear-type]
|
70
73
|
let parcelOptions = {
|
71
74
|
projectRoot
|
72
75
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/bundle-stats",
|
3
|
-
"version": "2.14.22-typescript-
|
3
|
+
"version": "2.14.22-typescript-bc4459c37.0",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -23,17 +23,17 @@
|
|
23
23
|
"node": ">= 16.0.0"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@atlaspack/core": "2.19.3-typescript-
|
27
|
-
"@atlaspack/query": "2.14.22-typescript-
|
28
|
-
"@atlaspack/reporter-bundle-stats": "2.14.22-typescript-
|
29
|
-
"@atlaspack/utils": "2.17.3-typescript-
|
26
|
+
"@atlaspack/core": "2.19.3-typescript-bc4459c37.0",
|
27
|
+
"@atlaspack/query": "2.14.22-typescript-bc4459c37.0",
|
28
|
+
"@atlaspack/reporter-bundle-stats": "2.14.22-typescript-bc4459c37.0",
|
29
|
+
"@atlaspack/utils": "2.17.3-typescript-bc4459c37.0",
|
30
30
|
"commander": "^7.0.0"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
|
-
"@atlaspack/babel-register": "2.14.2-typescript-
|
34
|
-
"@atlaspack/types": "2.15.11-typescript-
|
33
|
+
"@atlaspack/babel-register": "2.14.2-typescript-bc4459c37.0",
|
34
|
+
"@atlaspack/types": "2.15.11-typescript-bc4459c37.0",
|
35
35
|
"rimraf": "^5.0.5"
|
36
36
|
},
|
37
37
|
"type": "commonjs",
|
38
|
-
"gitHead": "
|
38
|
+
"gitHead": "bc4459c37a38ef1f74772126637e1d8841d1fcb0"
|
39
39
|
}
|
package/src/{cli.js → cli.ts}
RENAMED
@@ -1,10 +1,9 @@
|
|
1
1
|
/* eslint-disable no-console, monorepo/no-internal-import */
|
2
|
-
// @flow strict-local
|
3
2
|
import type {PackagedBundle} from '@atlaspack/types';
|
4
3
|
import type {ParcelOptions} from '@atlaspack/core/src/types';
|
4
|
+
// @ts-expect-error invalid export
|
5
5
|
import type {commander$Command} from 'commander';
|
6
6
|
|
7
|
-
// $FlowFixMe[untyped-import]
|
8
7
|
import {version} from '../package.json';
|
9
8
|
|
10
9
|
import commander from 'commander';
|
@@ -18,6 +17,7 @@ const {
|
|
18
17
|
PackagedBundleClass,
|
19
18
|
} = require('./deep-imports.js');
|
20
19
|
|
20
|
+
// @ts-expect-error no types
|
21
21
|
async function run({cacheDir, outDir}) {
|
22
22
|
// 1. load bundle graph and info via parcel~query
|
23
23
|
let {bundleGraph, bundleInfo} = await loadGraphs(cacheDir);
|
@@ -39,12 +39,11 @@ async function run({cacheDir, outDir}) {
|
|
39
39
|
|
40
40
|
let projectRoot = process.cwd();
|
41
41
|
|
42
|
-
|
43
|
-
let parcelOptions: ParcelOptions = ({projectRoot}: any);
|
42
|
+
let parcelOptions: ParcelOptions = {projectRoot} as any;
|
44
43
|
|
45
44
|
let bundlesByTarget: DefaultMap<
|
46
45
|
string /* target name */,
|
47
|
-
Array<PackagedBundle
|
46
|
+
Array<PackagedBundle>
|
48
47
|
> = new DefaultMap(() => []);
|
49
48
|
for (let bundle of bundleGraph.getBundles()) {
|
50
49
|
bundlesByTarget
|
@@ -67,7 +66,7 @@ async function run({cacheDir, outDir}) {
|
|
67
66
|
}
|
68
67
|
}
|
69
68
|
|
70
|
-
export const command: commander
|
69
|
+
export const command: commander.Command = new commander.Command()
|
71
70
|
.version(version, '-V, --version')
|
72
71
|
.description('Generate a stats report for a Parcel build')
|
73
72
|
.option('-v, --verbose', 'Print verbose output')
|