feat: create @yardinternet/shared-utils package#141
Merged
Conversation
YvetteNikolov
requested review from
FreakyWizard,
JasperS20,
WybeBosch,
Yannicvanveen,
Copilot,
laravdiemen and
rivanuff
July 14, 2026 07:55
There was a problem hiding this comment.
Pull request overview
This PR introduces a new @yardinternet/shared-utils workspace package to centralize shared theme-discovery utilities used by both @yardinternet/toolkit and @yardinternet/vite-config, and updates consumers to import from that shared package.
Changes:
- Added
@yardinternet/shared-utilspackage exportingresolveThemeContextandgetAllThemeNames. - Updated
@yardinternet/toolkitand@yardinternet/vite-configto depend on and import utilities from@yardinternet/shared-utils, removing duplicated local implementations. - Updated root documentation and lockfile to reflect the new workspace package and dependency graph.
Reviewed changes
Copilot reviewed 15 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds @yardinternet/shared-utils (and ts-config-wordpress) to the package list. |
| pnpm-lock.yaml | Adds the new workspace importer and updates dependency resolution due to the new package/deps. |
| packages/vite-config/src/utils/get-all-theme-names.js | Removes duplicated utility (moved into shared package). |
| packages/vite-config/src/utils/generate-entry-points.js | Switches resolveThemeContext import to @yardinternet/shared-utils. |
| packages/vite-config/src/utils/generate-aliases.js | Switches resolveThemeContext import to @yardinternet/shared-utils. |
| packages/vite-config/src/configs/brave-theme-blocks.js | Switches to importing theme utilities from @yardinternet/shared-utils. |
| packages/vite-config/package.json | Declares @yardinternet/shared-utils as a dependency. |
| packages/toolkit/src/utils/resolve-theme-context.js | Removes duplicated utility (moved into shared package). |
| packages/toolkit/src/utils/get-block-theme-name.js | Switches resolveThemeContext import to @yardinternet/shared-utils. |
| packages/toolkit/src/utils/get-block-paths.js | Switches resolveThemeContext import to @yardinternet/shared-utils. |
| packages/toolkit/src/scripts/build-themes.js | Switches getAllThemeNames import to @yardinternet/shared-utils. |
| packages/toolkit/src/config/modes.js | Switches resolveThemeContext import to @yardinternet/shared-utils. |
| packages/toolkit/package.json | Declares @yardinternet/shared-utils as a dependency. |
| packages/shared-utils/src/resolve-theme-context.js | New shared implementation of theme context resolution. |
| packages/shared-utils/src/get-all-theme-names.js | New shared implementation of theme name discovery. |
| packages/shared-utils/src/index.js | Exposes shared utility exports from the package entrypoint. |
| packages/shared-utils/README.md | Documents @yardinternet/shared-utils purpose and usage. |
| packages/shared-utils/package.json | Defines the new workspace package metadata and entrypoint. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Comment on lines
20
to
+24
| import { generateAliases } from '../utils/generate-aliases.js'; | ||
| import { getAllThemeNames } from '../utils/get-all-theme-names.js'; | ||
| import { resolveThemeContext } from '../utils/resolve-theme-context.js'; | ||
| import { | ||
| getAllThemeNames, | ||
| resolveThemeContext, | ||
| } from '@yardinternet/shared-utils'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.