-
Notifications
You must be signed in to change notification settings - Fork 64
Added functionality for mono-repos (different src and dist folders) #19
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
Conversation
mikeal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a minor change request.
I also want to spend a little more time thinking about this code. It seems fine but since there’s no good way to test GitHub Actions I want to give myself a little more time for reviewing it mentally :)
| const event = JSON.parse(fs.readFileSync('/github/workflow/event.json').toString()) | ||
|
|
||
| let pkg = require(path.join(process.cwd(), 'package.json')) | ||
| const deployDir = path.join(process.cwd(), process.env.DEPLOY_DIR || './') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should also use path.normalize to remove the dangling ./ on the default case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, it looks like .join does normalization now. i wonder why i thought it didn’t.
|
@benwinding thank you for putting this together! Conceptually it looks like exactly what I'm looking for; I'm using pika/pack for my tooling, which builds the package in a I'm trying to use your branched version in my project, but it doesn't appear to be working: Using this approach, my NPM packages still are published at the root:, instead of the subfolder I want https://unpkg.com/browse/[email protected]/ Looking at the Action's entrypoint, I think this is because it's using the NPM version of https://github.com/mikeal/merge-release/blob/master/entrypoint.sh#L31 Which makes me thing this PR needs merged and published for folks to actually use 🙃 @mikeal can you confirm? Is there anything I can do to help get this merged? |
|
pinging @FredKSchott who might find this interesting. |
|
Apologies, I didn’t see the last commit come in after my last review comment. This shouldn’t have sat here for so long, my bad. |
Scope
Added functionality for deploying a package within a subdirectory in a monorepo. Similar to PR #7, but here's my changes anyway...
Features
In mono repos the
srcdirectory and compileddistdirectory are usually in different folders. So I added the 2 environment variables:SRC_PACKAGE_DIR(where the src package.json is to increment)DEPLOY_DIR(where the dist package.json is to runnpm publish)In angular development it's convention to use a projects folder for the src code and a dist folder for the builds.
Here's a working snippet using a forked version of this repo:
Cheers for making this anyway, hope this PR helps someone else 👍