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

feature(cli): add support for publishing from a subdirectory using publishConfig.directory #428

Merged
merged 7 commits into from
Aug 4, 2020

Conversation

dotansimha
Copy link
Contributor

@dotansimha dotansimha commented Aug 4, 2020

The PR resolves this issue: #423

@Andarist

@atlassian-cla-bot
Copy link

atlassian-cla-bot bot commented Aug 4, 2020

Hooray! All contributors have signed the CLA.

@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2020

🦋 Changeset is good to go

Latest commit: f1a1f5a

We got this.

This PR includes changesets to release 2 packages
Name Type
@changesets/cli Minor
@changesets/types Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist
Copy link
Member

Andarist commented Aug 4, 2020

If a different location needs to be published, then changesets version should be executed in order to update the original package.json with the new version number, and commit it.

Is this any different from what we do now? I fail to see the difference.

In tools like lerna, it's possible to set publishConfig.directory and this tell the publish command that the actual directory is different.

Could you link to their docs about this feature? Are there any tools handling it in the same way?

@dotansimha
Copy link
Contributor Author

dotansimha commented Aug 4, 2020

@Andarist The difference is where do you run the npm run publish.
Our setup has this after changesets version and yarn build:

packages/
  - a/
     - package.json
     - dist/
         - compiled.js
         - package.json
     - src/...

So there is a temporary package.json under dist, and this is the one we would like to publish, not the source one. To do that, we need to run the npm run publish from ./dist and not from ./ (the current one, hardcoded)

And here's a reference for that: https://www.npmjs.com/package/@lerna/publish#publishconfigdirectory

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@dca4a91). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #428   +/-   ##
=========================================
  Coverage          ?   77.84%           
=========================================
  Files             ?       42           
  Lines             ?     1255           
  Branches          ?      301           
=========================================
  Hits              ?      977           
  Misses            ?      268           
  Partials          ?       10           
Impacted Files Coverage Δ
...ckages/cli/src/commands/publish/publishPackages.ts 74.46% <100.00%> (ø)
packages/get-github-info/src/index.ts 80.85% <0.00%> (ø)
packages/git/src/index.ts 87.80% <0.00%> (ø)
packages/logger/src/index.ts 100.00% <0.00%> (ø)
packages/get-release-plan/src/index.ts 100.00% <0.00%> (ø)
packages/cli/src/utils/isCI.ts 0.00% <0.00%> (ø)
packages/cli/src/changelog/index.ts 100.00% <0.00%> (ø)
...y-release-plan/src/test-utils/failing-functions.ts 50.00% <0.00%> (ø)
packages/cli/src/commands/add/createChangeset.ts 50.61% <0.00%> (ø)
...ages/apply-release-plan/src/get-changelog-entry.ts 100.00% <0.00%> (ø)
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dca4a91...f1a1f5a. Read the comment docs.

@dotansimha
Copy link
Contributor Author

@Andarist resolved all comments :)

@Andarist
Copy link
Member

Andarist commented Aug 4, 2020

@Andarist The difference is where do you run the npm run publish.

Right, this matter for the publish alone though - it doesn't matter for the versioning step though. Maybe I've misunderstood your original comment somehow.

Copy link
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'm going to keep this open for a little bit more time so others have a chance to look at this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants