-
Notifications
You must be signed in to change notification settings - Fork 240
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
[RFC] Run prepare
Scripts of Linked Bundled Dependencies
#479
Comments
@mysterycommand did you mean for this to be an RRFC or an RFC? Sub note: I'm wondering if the process we move forward with should take into account this RFC: #403. I don't necessarily want to mung those two ideas together, but they are opposing sides to the same coin. (cc. @isaacs wdyt?) |
Ahh yeah, sorry I was moving too fast. There's no formal format for RFCs though, can I just change the title? Do I need to add a label or something? … anyway, updated the title, removed references to RRFC. |
prepare
Scripts of Linked Bundled Dependenciesprepare
Scripts of Linked Bundled Dependencies
@mysterycommand for RFC's they are a PR with a created document the link below describes how :) |
Ahhh … okay, dang. I'll do that in a bit then. |
Once you've got something going, I can either comment on it to contribute, or you can add me as a contributor on your forked repo with push privs and I can also commit to the document. That second bit might be tricky, so maybe I can just comment my contributions or we can collab on a markdown doc with something like https://hackmd.io/ and then you can submit the PR. |
@mikemimik added you as a contributor to my fork mysterycommand/rfcs. I don't really have a preference for how we collaborate on this (I don't mind if you just want to commit right into my fork). It's mostly a copy/paste of the above for now. Closing this in lieu of the fork. |
cc/ @mikemimik @darcyclarke @isaacs
Motivation
Following discussion on #477 and previously on #463, workspaces that depend on sibling workspaces via the
file:
protocol (a.k.a. linked or symlinked dependencies) should run the sibling workspaces'prepare
scripts as part of the depend-ing workspace'spack
operation when those sibling dependencies are also specified as bundle/d dependencies (e.g. their "built" output should make it into the packed workspace's tarball).Example
app-a
andpkg-b
are workspaces in a monorepo.app-a
depends onpkg-b
and lists it as abundledDependency
becauseapp-a
is expected to be distributed as a Node app somewhere (AWS Lambda, Docker, etc.) where it should be deployed along with its production dependencies.pkg-b
is not published to a registry for reasons, and is written in a language or standard that must be compiled or transpiled to be runnable in Node (TypeScript, ES2049, etc.).Assuming
app-a
s package.json contains this:… and
pkg-b
's package.json contains this:… with the appropriate tsconfig.json, .npmignore, and index.ts in
pkg-b
, runningcd app-a ; npm i --package-lock=false ; npm pack
should produce a tarball with contents like:How
Current Behaviour
This is currently possible (I think) but it's "hacky" and involves a lot of plumbing and orchestration to make sure various package scripts are executed in the right order.
Desired Behaviour
It just works as described in the example.
References
Edit: updated to reflect this is an RFC, not an RRFC … I think that's right?
The text was updated successfully, but these errors were encountered: