andresz1 / size-limit-action

Compare the real cost to run your JS app or lib to keep good performance in every pull request
ISC License
441 stars 83 forks source link

Directory support for monorepo #38

Closed azu closed 3 years ago

azu commented 3 years ago

I want to use size-limit-action in monorepo. The monorepo has multiple packages in a repository.

.
└── packages/
    ├── foo/
    │   └── package.json
    └── bar/
        ├── package.json/
        └── index.ts  <- Want to analyze the size

However, current size-limit-action can not specify the directory like packages/bar.

📝 Unfortunately, GitHub Actions does not support the combination of working-directory and uses & with. Unable to use working-directory with docker based actions - GitHub Actions - GitHub Support Community

Is there any chance size-limit-action provide current working directory option like cwd?

andresz1 commented 3 years ago

Hi @azu! thank you so much for opening this issue. Currently there is no way to provide the working directory but there is another way, for example using [lerna]():

azu commented 3 years ago

Thanks.

I also want to use this action in large monorepo. It includes multiple architectures like go lang and Node.js. So, the root directory does not depend on npm or yarn.

Example

.github
└── workflows
golangbased-system
└── go-structure
nodebased-system
└── packages/
    ├── foo/
    │   └── package.json
    └── bar/
        ├── package.json/
        └── index.ts  <- Want to analyze the size

Probably, create package.json in root dir and this action can check it, but it inconveniences.

azu commented 3 years ago

📝 https://github.com/Arhia/action-check-compressed-size support directory option.