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

Design System - BUG - Components Package Yarn Workspace Configured Incorrectly #7193

Closed
4 tasks
TimRoe opened this issue Nov 2, 2023 · 0 comments
Closed
4 tasks
Assignees
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

Comments

@TimRoe
Copy link
Contributor

TimRoe commented Nov 2, 2023

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:

  1. Running yarn workspace <workspaceName> <commandName> ... per the yarn workspace doc or
  2. If the script is "global" then it should be able to be run directly from anywhere in the workspace; a "global" script is any script containing a colon in the name (for example, a global command for building the tokens package might be named tokens: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 the yarn.lock fixes the workspace problem, but instead causes another issue: doing a full reinstall (e.g. running rm -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 the tokensBuild 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 as yarn tokens:build.

Acceptance Criteria

  • Fix the components package to work correctly within the yarn workspace
    • Remove the yarn.lock
    • Figure out configuration issues preventing it from looking to the workspace root node_modules for both typescript-level formatting and running Storybook
  • Determine if configuring enableTransparentWorkspaces: false at the root .yarnrc.yml will now work for components to leverage the remote tokens instead of local
@TimRoe TimRoe added ux component-documentation 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 bug Used to identify a bug ticket that will be worked through the bug process and removed ux component-documentation labels Nov 2, 2023
@narin narin self-assigned this Nov 28, 2023
@narin narin closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants