Skip to content

Commit

Permalink
breaking: Rename analyzeBundle to analyze.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jan 14, 2021
1 parent e1eaeb1 commit 25582fb
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/BundleArtifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export default class BundleArtifact extends Artifact<BundleBuild> {

const features = this.package.getFeatureFlags();

if (options.analyzeBundle !== 'none') {
features.analyze = options.analyzeBundle;
if (options.analyze !== 'none') {
features.analyze = options.analyze;
}

const { output = [], ...input } = getRollupConfig(this, features);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Build.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class BuildCommand extends BaseCommand<Required<BuildOptions>> {
packemon={this.packemon}
addEngines={this.addEngines}
addExports={this.addExports}
analyzeBundle={this.analyze}
analyze={this.analyze}
concurrency={this.concurrency}
declaration={this.declaration}
skipPrivate={this.skipPrivate}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/Pack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class PackCommand extends BuildCommand {
packemon={this.packemon}
addEngines={this.addEngines}
addExports={this.addExports}
analyzeBundle={this.analyze}
analyze={this.analyze}
concurrency={this.concurrency}
declaration={this.declaration}
skipPrivate={this.skipPrivate}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Duration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Duration({ time }: DurationProps) {

return (
<Style type={isFast ? 'muted' : 'default'} bold>
{isFast ? '' : formatMs(time)}
{isFast ? '~' : formatMs(time)}
</Style>
);
}
2 changes: 1 addition & 1 deletion src/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const packemonBlueprint: Blueprint<PackemonPackageConfig> = {
export const buildBlueprint: Blueprint<BuildOptions> = {
addEngines: bool(),
addExports: bool(),
analyzeBundle: string('none').oneOf<AnalyzeType>(['none', 'sunburst', 'treemap', 'network']),
analyze: string('none').oneOf<AnalyzeType>(['none', 'sunburst', 'treemap', 'network']),
concurrency: number(1).gte(1),
declaration: string('none').oneOf<DeclarationType>(['none', 'standard', 'api']),
skipPrivate: bool(),
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type ArtifactState = 'pending' | 'building' | 'passed' | 'failed';
export interface BuildOptions {
addEngines?: boolean;
addExports?: boolean;
analyzeBundle?: AnalyzeType;
analyze?: AnalyzeType;
concurrency?: number;
declaration?: DeclarationType;
skipPrivate?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion tests/BundleArtifact.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('BundleArtifact', () => {
});

it('inherits `analyze` feature flag', async () => {
await artifact.build({ analyzeBundle: 'network' });
await artifact.build({ analyze: 'network' });

expect(getRollupConfig).toHaveBeenCalledWith(artifact, {
analyze: 'network',
Expand Down
2 changes: 1 addition & 1 deletion tests/Packemon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Packemon', () => {
const options = {
addEngines: true,
addExports: false,
analyzeBundle: 'none',
analyze: 'none',
concurrency: 3,
declaration: 'none',
skipPrivate: false,
Expand Down

0 comments on commit 25582fb

Please sign in to comment.