ATM packageName for local report is being inferred from package folder basename https://github.com/microsoft/monosize/blob/main/packages/monosize/src/utils/collectLocalReport.mts#L23
While this might work for simple use-cases once it should be configurable by the user.
Example
when directory structure is (see within PR)
|-react-alert/
|- library/
|- /bundle-size
|- stories/
|- e2e/
Current:
Expected:
Proposed Implementations:
- change the behaviours to obtain the name from
package.json#name and fallback to folder basename if not present
This would be a BREAKING CHANGE
- enable set this behaviour via configuration
monosize compare-reports --packageName='folder'|'package.json'
export type MonoSizeConfig = {
repository: string;
storage: StorageAdapter;
bundler: BundlerAdapter;
+ commands: {
+ 'compare-report': {
+ packageName: 'directory' | 'packageJSON' | ( packageRoot:string ) => string
+ }
}
};
ATM packageName for local report is being inferred from package folder basename https://github.com/microsoft/monosize/blob/main/packages/monosize/src/utils/collectLocalReport.mts#L23
While this might work for simple use-cases once it should be configurable by the user.
Example
when directory structure is (see within PR)
Current:
Expected:
Proposed Implementations:
package.json#nameand fallback to folder basename if not presentThis would be a BREAKING CHANGE
export type MonoSizeConfig = { repository: string; storage: StorageAdapter; bundler: BundlerAdapter; + commands: { + 'compare-report': { + packageName: 'directory' | 'packageJSON' | ( packageRoot:string ) => string + } } };