Design System - BUG - Components Package Yarn Workspace Configured Incorrectly #7193
Labels
bug
Used to identify a bug ticket that will be worked through the bug process
design-system
front-end
Ticket requires front-end work
mobile-platform
work associated with building & maintaining the VA Mobile Platform
sev-3
Lowest bug severity level based on QA bug severity scale - QA to assign this
What happened?
While working on #6989, an issue was encountered that running commands from within the components package to other areas of the workspace did not work correctly. Per yarn workspaces functionality, you are supposed to be able to run both root-level and other package-level scripts from any part of the workspace by either:
yarn workspace <workspaceName> <commandName> ...
per the yarn workspace doc ortokens:build
)These do not work within the components package. They do not work because the workspace should not have their own
yarn.lock
file, but the components package does. Removing theyarn.lock
fixes the workspace problem, but instead causes another issue: doing a full reinstall (e.g. runningrm -rf node_modules && yarn install
that cleans up any stale node_modules data that could cause problems) does not install the node_modules at the package level (correct), but it also fails to instead look to the workspace-level node_modules that contains all the relevant packages which causes errors (typescript in IDE and crashes trying to run Storybook without dependencies).Steps to Reproduce
See above.
Desired behavior
Our workspaces are correctly configured so the components package can both leverage workspace functionality and look to workspace-level node_modules.
Once fixed, this may also allow more proper resolution of #6989 since then theoretically setting
enableTransparentWorkspaces: false
should now work so we could pull the remote version of workspace packages. Alternatively, if that didn't work, at the very least thetokensBuild
script in the components package can instead be replaced by a global script (tokens:build
) in the tokens package that can simply be called within the components asyarn tokens:build
.Acceptance Criteria
yarn.lock
enableTransparentWorkspaces: false
at the root.yarnrc.yml
will now work for components to leverage the remote tokens instead of localdist/
folder in local dev environment #6989 fix to: have a global script from the tokens package (tokens:build
) that can be run in components, remove the components convenience scripttokensBuild
, and update the setup doc to reflect the changeThe text was updated successfully, but these errors were encountered: