Skip to content

chore(ui): don't depend on pnpm syntax #7771

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

Merged
merged 1 commit into from
May 23, 2025
Merged

chore(ui): don't depend on pnpm syntax #7771

merged 1 commit into from
May 23, 2025

Conversation

avivkeller
Copy link
Member

When we import @node-core/ui-components from api-docs-tooling, it can't contain non-npm syntax in it's package.json. Therefore, this PR removes the dependency on the workspace:* syntax.

@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 21:24
@avivkeller avivkeller requested a review from a team as a code owner May 21, 2025 21:24
Copy link

vercel bot commented May 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 21, 2025 9:33pm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the non-npm workspace:* dependency and inlines the SimpleLocaleConfig type to eliminate reliance on an external interface.

  • Inline SimpleLocaleConfig instead of using Pick<LocaleConfig> and drop the LocaleConfig import
  • Remove "@node-core/website-i18n": "workspace:*" from devDependencies

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/ui-components/types.ts Inlined SimpleLocaleConfig properties and removed external import
packages/ui-components/package.json Deleted workspace syntax for @node-core/website-i18n
Comments suppressed due to low confidence (2)

packages/ui-components/package.json:50

  • [nitpick] Since the workspace:* syntax was removed, pin @node-core/website-i18n to a fixed npm version (e.g., ^1.2.3) so consumers get a predictable release instead of missing the dependency entirely.
"@node-core/website-i18n": "workspace:*",

packages/ui-components/types.ts:21

  • [nitpick] Consider adding a JSDoc comment to SimpleLocaleConfig explaining its shape and reminding maintainers to sync it with the upstream LocaleConfig interface to avoid divergence over time.
export type SimpleLocaleConfig = {

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.36%. Comparing base (87b1016) to head (40fd13c).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7771      +/-   ##
==========================================
+ Coverage   75.34%   75.36%   +0.01%     
==========================================
  Files          96       96              
  Lines        7858     7858              
  Branches      192      192              
==========================================
+ Hits         5921     5922       +1     
+ Misses       1936     1935       -1     
  Partials        1        1              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

github-actions bot commented May 22, 2025

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 99 🟢 100 🟢 100 🟢 91 🔗
/en/about 🟢 100 🟢 100 🟢 100 🟠 82 🔗
/en/about/previous-releases 🟢 97 🟢 100 🟢 100 🟠 83 🔗
/en/download 🟢 98 🟢 100 🟢 100 🟢 91 🔗
/en/blog 🟢 100 🟢 100 🟢 96 🟢 92 🔗

Copy link
Collaborator

@bmuenzenmeyer bmuenzenmeyer left a comment

Choose a reason for hiding this comment

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

sometimes DRYness is the enemy

@dario-piotrowicz
Copy link
Member

@avivkeller sorry for the silly question, but could you clarify how api-docs-tooling imports the package? 🙏

@avivkeller
Copy link
Member Author

It's not a silly question, we are still trying to figure that out in nodejs/api-docs-tooling#236. Currently, in nodejs/api-docs-tooling#273, I'm using a package I made for us to import @node-core/rehype-shiki

@dario-piotrowicz
Copy link
Member

It's not a silly question, we are still trying to figure that out in nodejs/api-docs-tooling#236. Currently, in nodejs/api-docs-tooling#273, I'm using a package I made for us to import @node-core/rehype-shiki

I see, thanks a lot Aviv 🙂

Personally I would consider the option to publish the package as @AugustinMauroy suggested.

Having to remove pnpm workspace:* dependencies from the package.json seems like a hack to me 🤔
(besides the extra complexity and maintenance burden, also as far as I can tell if non-permalink repository links are used there isn't currently any check to accidentally prevent the re-introduction of workspace:* dependencies and similar ones that would break dependent packages)

So all things considered I think I am not a huge fan of the approach 🤔, however I can live with it if everyone else is happy with it 🙂 (also considering that you're already using it for rehype-shiki)

@avivkeller
Copy link
Member Author

I recommend you raise your concerns in the dedicated issue.

This PR is intended to work for npm installations of this package, which was one of the goals we had in mind when migrating to the monorepo. That's always something we can change, however, I think that's a discussion for the other issue.

@dario-piotrowicz
Copy link
Member

I recommend you raise your concerns in the dedicated issue.

This PR is intended to work for npm installations of this package, which was one of the goals we had in mind when migrating to the monorepo. That's always something we can change, however, I think that's a discussion for the other issue.

I see, sorry for the extra noise then 😓

@avivkeller avivkeller added this pull request to the merge queue May 23, 2025
Merged via the queue into main with commit 9882094 May 23, 2025
17 checks passed
@avivkeller avivkeller deleted the chore/ui/no-pnpm branch May 23, 2025 10:40
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.

7 participants