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

feat(plugins/npm): add support for passing publishFolder. #2115

Merged
merged 1 commit into from
Mar 4, 2022

Conversation

kclarkey
Copy link
Contributor

@kclarkey kclarkey commented Dec 6, 2021

What Changed

Added support for specifying a custom 'publishFolder' when using the NPM Plugin.

Why

Closes #1423 without adding much in the way of branching logic or overhead to the auto codebase. Since this type of implementation may generally be considered edge case, all we're doing is surfacing the capability, while requiring consumers own any logic required to ensure their publishFolder package version aligns with the version auto has generated.

Todo:

  • Add tests
  • Add docs

Change Type

Indicate the type of change your pull request is:

  • documentation
  • patch
  • minor
  • major

🐤 Download canary assets:

auto-linux--canary.2115.25151.gz
auto-macos--canary.2115.25151.gz
auto-win.exe--canary.2115.25151.gz

📦 Published PR as canary version: under canary scope @auto-canary@10.33.0--canary.2115.25151.0

✨ Test out this PR locally via:

npm install @auto-canary/bot-list@10.33.0--canary.2115.25151.0
npm install @auto-canary/auto@10.33.0--canary.2115.25151.0
npm install @auto-canary/core@10.33.0--canary.2115.25151.0
npm install @auto-canary/package-json-utils@10.33.0--canary.2115.25151.0
npm install @auto-canary/all-contributors@10.33.0--canary.2115.25151.0
npm install @auto-canary/brew@10.33.0--canary.2115.25151.0
npm install @auto-canary/chrome@10.33.0--canary.2115.25151.0
npm install @auto-canary/cocoapods@10.33.0--canary.2115.25151.0
npm install @auto-canary/conventional-commits@10.33.0--canary.2115.25151.0
npm install @auto-canary/crates@10.33.0--canary.2115.25151.0
npm install @auto-canary/docker@10.33.0--canary.2115.25151.0
npm install @auto-canary/exec@10.33.0--canary.2115.25151.0
npm install @auto-canary/first-time-contributor@10.33.0--canary.2115.25151.0
npm install @auto-canary/gem@10.33.0--canary.2115.25151.0
npm install @auto-canary/gh-pages@10.33.0--canary.2115.25151.0
npm install @auto-canary/git-tag@10.33.0--canary.2115.25151.0
npm install @auto-canary/gradle@10.33.0--canary.2115.25151.0
npm install @auto-canary/jira@10.33.0--canary.2115.25151.0
npm install @auto-canary/magic-zero@10.33.0--canary.2115.25151.0
npm install @auto-canary/maven@10.33.0--canary.2115.25151.0
npm install @auto-canary/microsoft-teams@10.33.0--canary.2115.25151.0
npm install @auto-canary/npm@10.33.0--canary.2115.25151.0
npm install @auto-canary/omit-commits@10.33.0--canary.2115.25151.0
npm install @auto-canary/omit-release-notes@10.33.0--canary.2115.25151.0
npm install @auto-canary/pr-body-labels@10.33.0--canary.2115.25151.0
npm install @auto-canary/released@10.33.0--canary.2115.25151.0
npm install @auto-canary/s3@10.33.0--canary.2115.25151.0
npm install @auto-canary/sbt@10.33.0--canary.2115.25151.0
npm install @auto-canary/slack@10.33.0--canary.2115.25151.0
npm install @auto-canary/twitter@10.33.0--canary.2115.25151.0
npm install @auto-canary/upload-assets@10.33.0--canary.2115.25151.0
npm install @auto-canary/vscode@10.33.0--canary.2115.25151.0
# or 
yarn add @auto-canary/bot-list@10.33.0--canary.2115.25151.0
yarn add @auto-canary/auto@10.33.0--canary.2115.25151.0
yarn add @auto-canary/core@10.33.0--canary.2115.25151.0
yarn add @auto-canary/package-json-utils@10.33.0--canary.2115.25151.0
yarn add @auto-canary/all-contributors@10.33.0--canary.2115.25151.0
yarn add @auto-canary/brew@10.33.0--canary.2115.25151.0
yarn add @auto-canary/chrome@10.33.0--canary.2115.25151.0
yarn add @auto-canary/cocoapods@10.33.0--canary.2115.25151.0
yarn add @auto-canary/conventional-commits@10.33.0--canary.2115.25151.0
yarn add @auto-canary/crates@10.33.0--canary.2115.25151.0
yarn add @auto-canary/docker@10.33.0--canary.2115.25151.0
yarn add @auto-canary/exec@10.33.0--canary.2115.25151.0
yarn add @auto-canary/first-time-contributor@10.33.0--canary.2115.25151.0
yarn add @auto-canary/gem@10.33.0--canary.2115.25151.0
yarn add @auto-canary/gh-pages@10.33.0--canary.2115.25151.0
yarn add @auto-canary/git-tag@10.33.0--canary.2115.25151.0
yarn add @auto-canary/gradle@10.33.0--canary.2115.25151.0
yarn add @auto-canary/jira@10.33.0--canary.2115.25151.0
yarn add @auto-canary/magic-zero@10.33.0--canary.2115.25151.0
yarn add @auto-canary/maven@10.33.0--canary.2115.25151.0
yarn add @auto-canary/microsoft-teams@10.33.0--canary.2115.25151.0
yarn add @auto-canary/npm@10.33.0--canary.2115.25151.0
yarn add @auto-canary/omit-commits@10.33.0--canary.2115.25151.0
yarn add @auto-canary/omit-release-notes@10.33.0--canary.2115.25151.0
yarn add @auto-canary/pr-body-labels@10.33.0--canary.2115.25151.0
yarn add @auto-canary/released@10.33.0--canary.2115.25151.0
yarn add @auto-canary/s3@10.33.0--canary.2115.25151.0
yarn add @auto-canary/sbt@10.33.0--canary.2115.25151.0
yarn add @auto-canary/slack@10.33.0--canary.2115.25151.0
yarn add @auto-canary/twitter@10.33.0--canary.2115.25151.0
yarn add @auto-canary/upload-assets@10.33.0--canary.2115.25151.0
yarn add @auto-canary/vscode@10.33.0--canary.2115.25151.0

@adierkens adierkens added the minor Increment the minor version when merged label Dec 6, 2021
@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #2115 (10be1b9) into main (956f88a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2115      +/-   ##
==========================================
+ Coverage   80.19%   80.22%   +0.02%     
==========================================
  Files          66       66              
  Lines        5413     5420       +7     
  Branches     1263     1267       +4     
==========================================
+ Hits         4341     4348       +7     
  Misses        709      709              
  Partials      363      363              
Impacted Files Coverage Δ
plugins/npm/src/index.ts 72.53% <100.00%> (+0.33%) ⬆️

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 956f88a...10be1b9. Read the comment docs.

@petercm
Copy link

petercm commented Dec 9, 2021

I was surprised this wasnt immediately recognized when brought up on #1423. Its been fairly common in my experience for allowing things like

import Button from "mylib/components/LoadingDots";

without having dist or whatever build dir in the path.

The lifecycle script to repeat the version bump here isn't ideal but this build is working as advertised for me.

@kclarkey
Copy link
Contributor Author

kclarkey commented Dec 9, 2021

The lifecycle script to repeat the version bump here isn't ideal but this build is working as advertised for me.

I personally wouldn't mind if auto attempted to own the versioning of packages in the publishFolder to replace the postversion script cd <publishFolder> && npm version <whatever-auto-has-decided-is-version>--no-git-tag-version --no-commit-hooks --ignore-scripts (actually it would be great).

But outside of this pull-request, I've probably written about 20 lines of typescript/javascript in my life. So beyond the general notion of scope drift in the auto project related to do one thing well, I'm also not confident I could succinctly implement the logic while attempting to maintain feature parity between mono-repo and single-package repos.

@hipstersmoothie hipstersmoothie merged commit d715128 into intuit:main Mar 4, 2022
@intuit-svc
Copy link

🚀 PR was released in v10.33.0 🚀

@intuit-svc intuit-svc added the released This issue/pull request has been released. label Mar 4, 2022
@kclarkey kclarkey deleted the feat/publishfolder-support branch March 4, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a way to publish from a specific directory?
5 participants