Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] rush build and rush rebuild don't fire prebuild npm scripts #830

Open
raygesualdo opened this issue Sep 20, 2018 · 8 comments
Open
Assignees
Labels
bug Something isn't working as intended effort: easy Probably a quick fix. Want to contribute? :-) help wanted If you're looking to contribute, this issue is a good place to start!

Comments

@raygesualdo
Copy link
Contributor

raygesualdo commented Sep 20, 2018

Hey team, awesome job with Rush. We've been using Lerna on an internal monorepo for the past few months and we've had some issues. Rush seems to solve almost all of them!

I'm in the processing of replacing Lerna with Rush and I noticed the build/rebuild commands don't trigger prebuild npm script hooks we have in place. Is this a known behavior?

@raygesualdo raygesualdo changed the title [rush] rush build and npm rebuild don't fire prebuild npm scripts [rush] rush build and rush rebuild don't fire prebuild npm scripts Sep 20, 2018
@octogonz
Copy link
Collaborator

This is the first I've heard of it. In our own projects, the "build" script invokes a full toolchain with its own phases, so we don't rely very much on the package.json lifecycle fields.

That said, we should certainly fix this. It's probably a pretty small change.

@octogonz octogonz added help wanted If you're looking to contribute, this issue is a good place to start! effort: easy Probably a quick fix. Want to contribute? :-) bug Something isn't working as intended labels Sep 21, 2018
@octogonz
Copy link
Collaborator

Out of curiousity, what does your prebuild script do?

@raygesualdo
Copy link
Contributor Author

build runs rollup for our component library packages and one of those packages needs to copy over some static assets that are outside rollup's purview. We're using the prebuild command to handle copying those assets.

@raygesualdo
Copy link
Contributor Author

I'd be happy to submit a PR, but I might need a little help to know where to look.

@octogonz
Copy link
Collaborator

Take a look at _getScriptToRun().

@nickpape-msft who worked on this code

@halfnibble halfnibble self-assigned this Jun 21, 2019
halfnibble added a commit to halfnibble/web-build-tools that referenced this issue Aug 2, 2019
satotake added a commit to satotake/satotake.github.io that referenced this issue Oct 14, 2019
`prebuild` in package.json is not fired by `rush build`
microsoft/rushstack#830
@ezhikov
Copy link

ezhikov commented Mar 6, 2020

Hi. Is there any movement on this issue? Can I help somehow?

It's important to me, because I prefer not to use && without need and place different actions into separate scripts, e. g. "prebuild": "rimraf lib", "build": "tsc -b", "postbuild": "node build-css"

@Luxcium
Copy link
Contributor

Luxcium commented Sep 28, 2022

Take a look at _getScriptToRun().

@nickpape-msft who worked on this code

I guess it is the fix to the broken link: (I understand it is outdated just that I dug down to find it so I am sharing it here)
_getScriptToRun()

@Luxcium
Copy link
Contributor

Luxcium commented Sep 28, 2022

I must admit that I am unsure why the normal workflow does not include support for package.json lifecycle fields.

Edit

I feel like my comment is far from being useful nor constructive I would love to know what I should do to help. I am kind of struggling to understand how to use the many features of this development stack but I have the feeling that it is a promising way of doing what I want to achieve.

I would love to learn more about how to use this stack but my impression is that the documentation is not telling me all the powerful features that can be leveraged.

I obviously need to use my lifecycle hooks but if I could understand what should be the workflow or workaround I would be happy to use it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended effort: easy Probably a quick fix. Want to contribute? :-) help wanted If you're looking to contribute, this issue is a good place to start!
Projects
Status: In Progress
Development

No branches or pull requests

5 participants