Skip to content

feat(packagejson): object format support for workspaces field#236

Merged
pi0 merged 3 commits into
unjs:mainfrom
outslept:object-syntax-workspaces
Aug 19, 2025
Merged

feat(packagejson): object format support for workspaces field#236
pi0 merged 3 commits into
unjs:mainfrom
outslept:object-syntax-workspaces

Conversation

@outslept

@outslept outslept commented Jul 9, 2025

Copy link
Copy Markdown
Contributor

The workspaces field was typed as string[] but should support both array and object formats according to the JSON Schema and Yarn Classic conventions.

Resolves #235

P.S. There is an example of using object syntax in an article on nohoist.
UPD2: There's also an RFC to add nohoist to npm, but this isn't implemented for now - npm/rfcs#287

image

outslept and others added 2 commits July 9, 2025 15:31
The workspaces field was typed as string[] but should support both array
and object formats according to the JSON Schema and Yarn Classic conventions.

Closes `workspaces` field type missing object format support unjs#235
@codecov

codecov Bot commented Jul 9, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.22%. Comparing base (afdf7cb) to head (00e2581).
⚠️ Report is 84 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
+ Coverage   89.40%   91.22%   +1.82%     
==========================================
  Files           5       10       +5     
  Lines         434      262     -172     
  Branches       37       61      +24     
==========================================
- Hits          388      239     -149     
+ Misses         46       23      -23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@43081j

43081j commented Jul 28, 2025

Copy link
Copy Markdown
Member

@pi0 this looks good to me, do you think we'll need a new major though?

its a breaking change to the types but was already wrong 👀

@pi0 pi0 changed the title fix: add object format support to workspaces field type feat(packagejson): object format support for workspaces field Aug 19, 2025

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit c69294f into unjs:main Aug 19, 2025
3 checks passed
@outslept outslept deleted the object-syntax-workspaces branch August 19, 2025 16:23
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.

workspaces field type missing object format support

3 participants