@atlaspack/bundle-stats 2.14.5-canary.138 → 2.14.5-canary.139
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/lib/deep-imports.d.ts +1 -0
- package/lib/deep-imports.js +1 -3
- package/package.json +13 -12
- package/src/{cli.js → cli.ts} +5 -6
- package/src/deep-imports.ts +33 -0
- package/tsconfig.json +4 -0
- package/src/deep-imports.js +0 -31
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
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/lib/deep-imports.js
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
/* eslint-disable monorepo/no-internal-import */
|
4
|
+
|
4
5
|
module.exports = process.env.ATLASPACK_BUILD_ENV === 'production' || process.env.ATLASPACK_REGISTER_USE_SRC !== 'true' ? {
|
5
6
|
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
|
6
|
-
// $FlowFixMe(unsupported-syntax)
|
7
7
|
loadGraphs: require('@atlaspack/query' + '/lib/index.js').loadGraphs,
|
8
|
-
// $FlowFixMe(unsupported-syntax)
|
9
8
|
getBundleStats: require('@atlaspack/reporter-bundle-stats' + '/lib/BundleStatsReporter.js').getBundleStats,
|
10
|
-
// $FlowFixMe(unsupported-syntax)
|
11
9
|
PackagedBundleClass: require('@atlaspack/core' + '/lib/public/Bundle.js').PackagedBundle
|
12
10
|
} : {
|
13
11
|
loadGraphs: require('@atlaspack/query/src/index.js').loadGraphs,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/bundle-stats",
|
3
|
-
"version": "2.14.5-canary.
|
3
|
+
"version": "2.14.5-canary.139+d2fd84977",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -9,30 +9,31 @@
|
|
9
9
|
"type": "git",
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
11
11
|
},
|
12
|
-
"main": "lib/cli.js",
|
13
|
-
"source": "src/cli.
|
12
|
+
"main": "./lib/cli.js",
|
13
|
+
"source": "./src/cli.ts",
|
14
|
+
"types": "./lib/cli.d.ts",
|
14
15
|
"bin": {
|
15
16
|
"atlaspack-bundle-stats": "bin/bundle-stats.js"
|
16
17
|
},
|
17
18
|
"scripts": {
|
18
|
-
"
|
19
|
-
"
|
19
|
+
"dev:prepare": "rimraf ./lib/ && mkdir -p lib && cp ./bin/dev-bin.js ./lib/bin.js",
|
20
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
20
21
|
},
|
21
22
|
"engines": {
|
22
23
|
"node": ">= 16.0.0"
|
23
24
|
},
|
24
25
|
"dependencies": {
|
25
|
-
"@atlaspack/core": "2.16.2-canary.
|
26
|
-
"@atlaspack/query": "2.14.5-canary.
|
27
|
-
"@atlaspack/reporter-bundle-stats": "2.14.5-canary.
|
28
|
-
"@atlaspack/utils": "2.14.5-canary.
|
26
|
+
"@atlaspack/core": "2.16.2-canary.139+d2fd84977",
|
27
|
+
"@atlaspack/query": "2.14.5-canary.139+d2fd84977",
|
28
|
+
"@atlaspack/reporter-bundle-stats": "2.14.5-canary.139+d2fd84977",
|
29
|
+
"@atlaspack/utils": "2.14.5-canary.139+d2fd84977",
|
29
30
|
"commander": "^7.0.0"
|
30
31
|
},
|
31
32
|
"devDependencies": {
|
32
33
|
"@atlaspack/babel-register": "2.14.1",
|
33
|
-
"@atlaspack/types": "2.14.5-canary.
|
34
|
+
"@atlaspack/types": "2.14.5-canary.139+d2fd84977",
|
34
35
|
"rimraf": "^5.0.5"
|
35
36
|
},
|
36
37
|
"type": "commonjs",
|
37
|
-
"gitHead": "
|
38
|
-
}
|
38
|
+
"gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
|
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')
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/* eslint-disable monorepo/no-internal-import */
|
2
|
+
import {loadGraphs} from '@atlaspack/query/src/index';
|
3
|
+
import {getBundleStats} from '@atlaspack/reporter-bundle-stats/src/BundleStatsReporter';
|
4
|
+
import {PackagedBundle as PackagedBundleClass} from '@atlaspack/core/src/public/Bundle';
|
5
|
+
|
6
|
+
module.exports = (
|
7
|
+
process.env.ATLASPACK_BUILD_ENV === 'production' ||
|
8
|
+
process.env.ATLASPACK_REGISTER_USE_SRC !== 'true'
|
9
|
+
? {
|
10
|
+
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
|
11
|
+
loadGraphs: require('@atlaspack/query' + '/lib/index.js').loadGraphs,
|
12
|
+
getBundleStats: require(
|
13
|
+
'@atlaspack/reporter-bundle-stats' + '/lib/BundleStatsReporter.js',
|
14
|
+
).getBundleStats,
|
15
|
+
PackagedBundleClass: require(
|
16
|
+
'@atlaspack/core' + '/lib/public/Bundle.js',
|
17
|
+
).PackagedBundle,
|
18
|
+
}
|
19
|
+
: {
|
20
|
+
loadGraphs: require('@atlaspack/query/src/index.js').loadGraphs,
|
21
|
+
getBundleStats:
|
22
|
+
require('@atlaspack/reporter-bundle-stats/src/BundleStatsReporter.js')
|
23
|
+
.getBundleStats,
|
24
|
+
PackagedBundleClass: require('@atlaspack/core/src/public/Bundle.js')
|
25
|
+
.PackagedBundle,
|
26
|
+
}
|
27
|
+
) as {
|
28
|
+
// @ts-expect-error TS2749
|
29
|
+
loadGraphs: loadGraphs;
|
30
|
+
// @ts-expect-error TS2749
|
31
|
+
getBundleStats: getBundleStats;
|
32
|
+
PackagedBundleClass: PackagedBundleClass;
|
33
|
+
};
|
package/tsconfig.json
ADDED
package/src/deep-imports.js
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
// @flow
|
2
|
-
/* eslint-disable monorepo/no-internal-import */
|
3
|
-
import typeof {loadGraphs} from '@atlaspack/query/src/index';
|
4
|
-
import typeof {getBundleStats} from '@atlaspack/reporter-bundle-stats/src/BundleStatsReporter';
|
5
|
-
import typeof {PackagedBundle as PackagedBundleClass} from '@atlaspack/core/src/public/Bundle';
|
6
|
-
|
7
|
-
module.exports = ((process.env.ATLASPACK_BUILD_ENV === 'production' ||
|
8
|
-
process.env.ATLASPACK_REGISTER_USE_SRC !== 'true'
|
9
|
-
? {
|
10
|
-
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js
|
11
|
-
// $FlowFixMe(unsupported-syntax)
|
12
|
-
loadGraphs: require('@atlaspack/query' + '/lib/index.js').loadGraphs,
|
13
|
-
// $FlowFixMe(unsupported-syntax)
|
14
|
-
getBundleStats: require('@atlaspack/reporter-bundle-stats' +
|
15
|
-
'/lib/BundleStatsReporter.js').getBundleStats,
|
16
|
-
// $FlowFixMe(unsupported-syntax)
|
17
|
-
PackagedBundleClass: require('@atlaspack/core' + '/lib/public/Bundle.js')
|
18
|
-
.PackagedBundle,
|
19
|
-
}
|
20
|
-
: {
|
21
|
-
loadGraphs: require('@atlaspack/query/src/index.js').loadGraphs,
|
22
|
-
getBundleStats:
|
23
|
-
require('@atlaspack/reporter-bundle-stats/src/BundleStatsReporter.js')
|
24
|
-
.getBundleStats,
|
25
|
-
PackagedBundleClass: require('@atlaspack/core/src/public/Bundle.js')
|
26
|
-
.PackagedBundle,
|
27
|
-
}): {|
|
28
|
-
loadGraphs: loadGraphs,
|
29
|
-
getBundleStats: getBundleStats,
|
30
|
-
PackagedBundleClass: PackagedBundleClass,
|
31
|
-
|});
|