-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish bundle-stats-cli and parcel-query (#9431)
* Publish bundle-stats-cli and parcel-query * Add parcel-query and bundle-stats to gulpfile * Rename to @parcel/query, add parcel-query bin * Add condition to bundle-stats bin * Update parcel-query dep in bundle-stats * Update packages/dev/bundle-stats-cli/package.json Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> * Move bin.js to src * Add deep imports for bundle-stats * Add deep imports for @parcel/query * Fix flow errors in bundle-stats * Fix flow errors in @parcel/query * Fix types in deep-imports.js * Fix types in deep-imports.js --------- Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
- Loading branch information
1 parent
bd40574
commit aff2c16
Showing
10 changed files
with
136 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
if ( | ||
process.env.PARCEL_BUILD_ENV !== 'production' || | ||
process.env.PARCEL_SELF_BUILD | ||
) { | ||
require('@parcel/babel-register'); | ||
} | ||
|
||
const cli = require('./cli'); | ||
|
||
cli.command.parse(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// @flow | ||
/* eslint-disable monorepo/no-internal-import */ | ||
import typeof {loadGraphs} from '@parcel/query/src/index.js'; | ||
import typeof {getBundleStats} from '@parcel/reporter-bundle-stats/src/BundleStatsReporter'; | ||
import typeof {PackagedBundle as PackagedBundleClass} from '@parcel/core/src/public/Bundle'; | ||
|
||
module.exports = ((process.env.PARCEL_BUILD_ENV === 'production' | ||
? { | ||
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js | ||
// $FlowFixMe(unsupported-syntax) | ||
loadGraphs: require('@parcel/query' + '/lib/index.js').loadGraphs, | ||
// $FlowFixMe(unsupported-syntax) | ||
getBundleStats: require('@parcel/reporter-bundle-stats' + | ||
'/lib/BundleStatsReporter.js').getBundleStats, | ||
// $FlowFixMe(unsupported-syntax) | ||
PackagedBundleClass: require('@parcel/core' + '/lib/public/Bundle.js') | ||
.PackagedBundle, | ||
} | ||
: { | ||
loadGraphs: require('@parcel/query/src/index.js').loadGraphs, | ||
getBundleStats: | ||
require('@parcel/reporter-bundle-stats/src/BundleStatsReporter.js') | ||
.getBundleStats, | ||
PackagedBundleClass: require('@parcel/core/src/public/Bundle.js') | ||
.PackagedBundle, | ||
}): {| | ||
loadGraphs: loadGraphs, | ||
getBundleStats: getBundleStats, | ||
PackagedBundleClass: PackagedBundleClass, | ||
|}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,59 @@ | ||
// @flow | ||
/* eslint-disable monorepo/no-internal-import */ | ||
import typeof AssetGraph from '@parcel/core/src/AssetGraph.js'; | ||
import typeof BundleGraph from '@parcel/core/src/BundleGraph.js'; | ||
import typeof BundleGraph, { | ||
bundleGraphEdgeTypes, | ||
} from '@parcel/core/src/BundleGraph.js'; | ||
import typeof RequestTracker, { | ||
RequestGraph, | ||
} from '@parcel/core/src/RequestTracker.js'; | ||
import {typeof requestGraphEdgeTypes} from '@parcel/core/src/RequestTracker.js'; | ||
import typeof {requestGraphEdgeTypes} from '@parcel/core/src/RequestTracker.js'; | ||
import typeof {LMDBCache} from '@parcel/cache/src/LMDBCache.js'; | ||
import typeof {Priority} from '@parcel/core/src/types.js'; | ||
import typeof {fromProjectPathRelative} from '@parcel/core/src/projectPath.js'; | ||
|
||
module.exports = ((process.env.PARCEL_BUILD_ENV === 'production' | ||
? { | ||
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js | ||
// $FlowFixMe(unsupported-syntax) | ||
AssetGraph: require('@parcel/core' + '/lib/AssetGraph.js').default, | ||
// $FlowFixMe(unsupported-syntax) | ||
BundleGraph: require('@parcel/core' + '/lib/BundleGraph.js').default, | ||
// $FlowFixMe(unsupported-syntax) | ||
RequestTracker: require('@parcel/core' + '/lib/RequestTracker.js'), | ||
} | ||
: { | ||
AssetGraph: require('@parcel/core/src/AssetGraph.js').default, | ||
BundleGraph: require('@parcel/core/src/BundleGraph.js').default, | ||
RequestTracker: require('@parcel/core/src/RequestTracker.js'), | ||
}): {| | ||
const v = | ||
process.env.PARCEL_BUILD_ENV === 'production' | ||
? { | ||
// Split up require specifier to outsmart packages/dev/babel-register/babel-plugin-module-translate.js | ||
// $FlowFixMe(unsupported-syntax) | ||
AssetGraph: require('@parcel/core' + '/lib/AssetGraph.js').default, | ||
// $FlowFixMe(unsupported-syntax) | ||
BundleGraph: require('@parcel/core' + '/lib/BundleGraph.js'), | ||
// $FlowFixMe(unsupported-syntax) | ||
RequestTracker: require('@parcel/core' + '/lib/RequestTracker.js'), | ||
// $FlowFixMe(unsupported-syntax) | ||
LMDBCache: require('@parcel/cache' + '/lib/LMDBCache.js').LMDBCache, | ||
// $FlowFixMe(unsupported-syntax) | ||
Priority: require('@parcel/core' + '/lib/types.js').Priority, | ||
// $FlowFixMe(unsupported-syntax) | ||
fromProjectPathRelative: require('@parcel/core' + '/lib/projectPath.js') | ||
.fromProjectPathRelative, | ||
} | ||
: { | ||
AssetGraph: require('@parcel/core/src/AssetGraph.js').default, | ||
BundleGraph: require('@parcel/core/src/BundleGraph.js'), | ||
RequestTracker: require('@parcel/core/src/RequestTracker.js'), | ||
LMDBCache: require('@parcel/cache/src/LMDBCache.js').LMDBCache, | ||
Priority: require('@parcel/core/src/types.js').Priority, | ||
fromProjectPathRelative: require('@parcel/core/src/projectPath.js') | ||
.fromProjectPathRelative, | ||
}; | ||
|
||
module.exports = (v: {| | ||
AssetGraph: AssetGraph, | ||
BundleGraph: BundleGraph, | ||
BundleGraph: { | ||
default: BundleGraph, | ||
bundleGraphEdgeTypes: bundleGraphEdgeTypes, | ||
... | ||
}, | ||
RequestTracker: { | ||
default: RequestTracker, | ||
RequestGraph: RequestGraph, | ||
requestGraphEdgeTypes: requestGraphEdgeTypes, | ||
... | ||
}, | ||
LMDBCache: LMDBCache, | ||
Priority: Priority, | ||
fromProjectPathRelative: fromProjectPathRelative, | ||
|}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters