Skip to content

Conversation

@koji
Copy link
Contributor

@koji koji commented Jun 9, 2025

Overview

switching from yarn V1 to pnpm.

  • speed up the setup process
Done in 18.4s
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C app-shell setup
pnpm rebuild
../node_modules/.pnpm/[email protected]/node_modules/usb: Running install script, done in 804ms
../node_modules/.pnpm/@[email protected]/node_modules/@serialport/bindings-cpp: Running install script, done in 649ms
../node_modules/.pnpm/[email protected]/node_modules/aws-sdk: Running postinstall script, done in 61ms
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C app-shell-odd setup
pnpm rebuild
Execution time: 49.08s          

pnpm version

10.22.0 since components-test is using that version

package.json in each project

some package.jsons got update because pnpm is stricter than yarn v1 and no hoisting so need to align with the versions and add a few opentrons packages to avoid importing errors

tests

  • app-shell/app-shell-odd
    a few test using import somehing from electron without mocking so needed to add mock to pass tests

  • components
    needed to commnet out a few styling test due to path issues (this will be fixed after merge this pr)

for e2e test errors

  • protocol-designer: this is happening on edge too

  • labware-library: Josh is preparing to switch from Cypress to Playwright.

  • dev server quick start

  • can update Storybook to introduce visual testing

close AUTH-2557

Test Plan and Hands on Testing

  1. install pnpm v10 via npm/asdf/mise etc
    v10.22.0

  2. checkout this branch

  3. run make teardonw-js && make setup-js

  4. test commands in the following comment

  5. smoke test

Changelog

Review requests

Risk assessment

mid-high since switching the node package manager

@koji
Copy link
Contributor Author

koji commented Jun 9, 2025

@koji
Copy link
Contributor Author

koji commented Nov 9, 2025

run test

  • make -C app dev
  • make -C app dev-odd
  • make -C protocol-designer dev
  • make -C opentrons-ai-client dev
  • make -C labware-library dev

build

  • make -C app dist
  • make -C app-shell lib
  • make -C app-shell package
  • make -C app-shell-odd lib
  • make -C protocol-designer build
  • make -C opentrons-ai-client build-production
  • make -C labware-library dist
  • make -C components dist
  • make -C components lib
  • make -C shared-data lib-js
  • make -C shared-data build-ts

tsc

  • make check-js

lint

  • make lint-js
  • make lint-css

test

  • make test-js : fix running test issues

others

- [ ] update Storybook --> this will be updated in a following pr

  • modify GitHub Actions. <-- WIP
  • update documents
  • clean up this branch

@koji koji requested review from neo-jesse and y3rsh December 3, 2025 00:09
@koji koji changed the title [WIP] yarn -> pnpm yarn -> pnpm Dec 3, 2025
@koji koji changed the title yarn -> pnpm switch node package manager yarn -> pnpm Dec 3, 2025
@koji koji marked this pull request as ready for review December 3, 2025 16:25
@koji koji requested review from a team as code owners December 3, 2025 16:25
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

Heroic! Thank you!

I have only minor questions and comments. Otherwise, this LGTM once we figure out those last few things that are failing in CI.

Comment on lines +66 to +68
// const successToast = screen.getByTestId('Toast_success')
// expect(successToast).toHaveStyle(`color: #04aa65
// background-color: ##baffcd`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these still meant to be commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

Copy link
Member

Choose a reason for hiding this comment

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

why?

Comment on lines +55 to +58
// ToDo temporary disable style checks due to styled-components issues
// const successToast = screen.getByTestId('Toast_success')
// expect(successToast).toHaveStyle(`color: #04aa65
// background-color: #f3fffa`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

Comment on lines +52 to 53
$(MAKE) -C .. test-js-components tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
make -C .. test-js-components tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like an accidentally duplicated line?

Suggested change
$(MAKE) -C .. test-js-components tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
make -C .. test-js-components tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"
$(MAKE) -C .. test-js-components tests=$(tests) test_opts="$(test_opts)" cov_opts="$(cov_opts)"

Comment on lines +95 to +96
// Note temporarily skip
it.skip('renders an empty slot with all the labware options', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these skips still meant to be in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

// For unknown reasons, PD whitescreens on launch unless we have this.
dedupe: ['tslib'],
alias: {
tslib: path.resolve('node_modules/tslib'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ouch.

This shouldn't block this PR, but this is more reason for us to figure out what's wrong that's requiring us to do all this weird tslib stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think we would need to review all vite.configs.mts to optimize the build.
the thing is that the current vite config files are just converted from webpack config for vite.

Comment on lines 78 to 84
run: |
npm config set cache ${{ github.workspace }}/.npm-cache
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
make setup-js
uses: ./.github/actions/js/setup
# run: |
# npm config set cache ${{ github.workspace }}/.npm-cache
# pnpm config set cache ${{ github.workspace }}/.pnpm-cache
# make setup-js
# Use the if to run all the lint checks even of some fail
shell: bash
# shell: bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these meant to be commented out, still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i will remove them

Comment on lines +44 to +46
return readdir(
path.join(directory, 'somerandomname', contents[0].name)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's going on with these test changes?

"styled-components": "5.3.6"
},
"devDependencies": {
"@storybook/blocks": "7.6.17",
Copy link
Contributor

Choose a reason for hiding this comment

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

Does @storybook/blocks belong in the top-level package.json, instead? That's where the other Storybook addons are installed. And even though we run it with make -C components dev, Storybook generally operates as a monorepo-wide thing, not a components/-specific thing.

Comment on lines +31 to +49
rollupOptions: {
external: [
'electron',
/^node:/,
// Externalize problematic CommonJS modules
'mdns-js',
'is-ip',
'redux',
'reselect',
'lodash',
'lodash/unionBy',
'escape-string-regexp',
'stable',
'to-regex',
],
output: {
format: 'cjs',
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain more about what's happening here? Why are these modules problematic and how does externalizing them help?

Comment on lines -20 to +36
vi.mock('electron')
vi.mock('../../config')
vi.mock('../../dialogs')
vi.mock('../definitions')
vi.mock('../../config', () => ({
getFullConfig: vi.fn(),
handleConfigChange: vi.fn(),
}))

vi.mock('../../dialogs', () => ({
showOpenDirectoryDialog: vi.fn(),
showOpenFileDialog: vi.fn(),
}))

vi.mock('../definitions', () => ({
readLabwareDirectory: vi.fn(),
parseLabwareFiles: vi.fn(),
addLabwareFile: vi.fn(),
removeLabwareFile: vi.fn(),
}))

Copy link
Contributor

Choose a reason for hiding this comment

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

It's surprising to me that this PR needed so many changes in the tests. Why would changing the package manager affect the difference between vi.mock('../../config') and vi.mock('../../config', () => ({ ... })), for example?

I don't necessarily have any problem with this, but could you explain more about what happened here?

@koji
Copy link
Contributor Author

koji commented Dec 3, 2025

Heroic! Thank you!

I have only minor questions and comments. Otherwise, this LGTM once we figure out those last few things that are failing in CI.

spoke with Alex about pd-e2e and at this moment I can modify the e2e test to pass the error.

for ll-e2e, Josh will remove cypress from ll within 2 weeks so I'd like to wait to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants