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: infer base from package json scripts during migration #993

Merged

Conversation

GV14982
Copy link
Contributor

@GV14982 GV14982 commented Oct 30, 2023

PR Checklist

Overview

Add a naive solution for checking the existing package.json during migration to infer the base.

🐸

Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looking great! Just requesting changes on tests. Everything else is stylistic and non-blocking. LMK what you think! ✨

Frog quickly dancing/running over water

src/shared/options/readOptions.ts Outdated Show resolved Hide resolved
src/shared/options/readOptions.ts Outdated Show resolved Hide resolved
src/shared/options/readOptions.ts Outdated Show resolved Hide resolved
src/shared/options/readOptions.ts Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author Needs an action taken by the original poster label Oct 30, 2023
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

Merging #993 (329c7fd) into main (8050c83) will decrease coverage by 0.03%.
Report is 2 commits behind head on main.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main     #993      +/-   ##
==========================================
- Coverage   93.61%   93.58%   -0.03%     
==========================================
  Files          92       93       +1     
  Lines        4952     4992      +40     
  Branches      413      420       +7     
==========================================
+ Hits         4636     4672      +36     
- Misses        315      318       +3     
- Partials        1        2       +1     
Flag Coverage Δ
create 70.87% <33.33%> (-0.31%) ⬇️
initialize 38.34% <33.33%> (-0.05%) ⬇️
migrate 69.76% <33.33%> (-0.30%) ⬇️
unit 68.92% <87.50%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/shared/options/getBase.ts 97.05% <97.05%> (ø)
src/shared/types.ts 0.00% <0.00%> (ø)
src/shared/options/readOptions.ts 96.73% <40.00%> (-0.77%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions github-actions bot removed the status: waiting for author Needs an action taken by the original poster label Oct 30, 2023
Copy link
Owner

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks fantastic, thanks!

Seth Meyers giving a monologue hosting SNL saying 'fantastic'

@@ -111,6 +111,11 @@ vi.mock("./createOptionDefaults/index.js", () => ({
},
}));

const readPackageData = vi.hoisted(() => vi.fn());
Copy link
Owner

Choose a reason for hiding this comment

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

TIL about vi.hoisted, very nice! https://vitest.dev/api/vi.html#vi-hoisted

Elsewhere in this repo I've used mock* as a naming convention. I think both are valid and reasonable... but the mock* is used everywhere else, so I'll go ahead and make the change.

@JoshuaKGoldberg JoshuaKGoldberg merged commit 20afaf4 into JoshuaKGoldberg:main Oct 31, 2023
14 checks passed
@github-actions
Copy link

🎉 This is included in version v1.42.0 🎉

The release is available on:

Cheers! 📦🚀

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.

🚀 Feature: Infer --base from existing package.json scripts during migration
2 participants