Skip to content

Commit 9359adf

Browse files
shlokaminmjhuffb-cooperkojijerader
authored andcommitted
chore(monorepo): migrate frontend bundling from webpack to vite (#14405)
migrate frontend bundler from webpack to vite Co-authored-by: Jamey Huffnagle <[email protected]> Co-authored-by: Brian Cooper <[email protected]> Co-authored-by: koji <[email protected]> Co-authored-by: Jethary <[email protected]> Co-authored-by: ncdiehl11 <[email protected]> Co-authored-by: smb2268 <[email protected]> Co-authored-by: Brent Hagen <[email protected]>
1 parent 2bf7438 commit 9359adf

File tree

1,824 files changed

+56888
-34047
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,824 files changed

+56888
-34047
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
**/venv/**
77
.opentrons_config
88
**/tsconfig*.json
9-
9+
**/vite.config.ts
1010
# prettier
1111
**/package.json
1212
**/CHANGELOG.md
13-
lerna.json
1413
!api/release-notes.md
1514
!app-shell/build/release-notes.md
1615

.eslintrc.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ module.exports = {
1212
'plugin:react/recommended',
1313
'prettier',
1414
'plugin:json/recommended',
15+
'plugin:storybook/recommended',
1516
],
1617

1718
plugins: ['react', 'react-hooks', 'json', 'jest', 'testing-library'],
@@ -89,6 +90,11 @@ module.exports = {
8990
'@typescript-eslint/unbound-method': 'warn',
9091
'@typescript-eslint/consistent-generic-constructors': 'warn',
9192
'@typescript-eslint/no-misused-promises': 'warn',
93+
// need this to be able to pass in css prop into raw elements (babel adds this at build time for styled-components)
94+
'react/no-unknown-property': [
95+
'error',
96+
{ ignore: ['css', 'indeterminate'] },
97+
],
9298
},
9399
},
94100
{
@@ -98,6 +104,7 @@ module.exports = {
98104
'**/__mocks__/**.@(js|ts|tsx)',
99105
'**/__utils__/**.@(js|ts|tsx)',
100106
'**/__fixtures__/**.@(js|ts|tsx)',
107+
'**/fixtures/**.@(js|ts|tsx)',
101108
'scripts/*.@(js|ts|tsx)',
102109
],
103110
env: {
@@ -108,7 +115,7 @@ module.exports = {
108115
'jest/expect-expect': 'off',
109116
'jest/no-standalone-expect': 'off',
110117
'jest/no-disabled-tests': 'error',
111-
'jest/consistent-test-it': 'error',
118+
'jest/consistent-test-it': ['error', { fn: 'it' }],
112119
'@typescript-eslint/consistent-type-assertions': 'off',
113120
'@typescript-eslint/no-var-requires': 'off',
114121
'@typescript-eslint/explicit-function-return-type': 'off',
@@ -127,6 +134,7 @@ module.exports = {
127134
env: { jest: true },
128135
extends: ['plugin:testing-library/react'],
129136
rules: {
137+
'testing-library/no-manual-cleanup': 'off',
130138
'testing-library/prefer-screen-queries': 'warn',
131139
},
132140
},
@@ -140,6 +148,9 @@ module.exports = {
140148
{
141149
files: ['**/cypress/**'],
142150
extends: ['plugin:cypress/recommended'],
151+
rules: {
152+
'cypress/unsafe-to-chain-command': 'warn',
153+
},
143154
},
144155
],
145156
}

.github/workflows/app-test-build-deploy.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111
- 'app-shell-odd/**/*'
1212
- 'components/**/*'
1313
- 'shared-data/**/*'
14-
- 'webpack-config/**/*'
1514
- 'discovery-client/**/*'
1615
- '*.js'
1716
- 'scripts/**/*'
@@ -32,7 +31,6 @@ on:
3231
- 'app-shell-odd/**/*'
3332
- 'components/**/*'
3433
- 'shared-data/**/*'
35-
- 'webpack-config/**/*'
3634
- 'discovery-client/**/*'
3735
- '*.js'
3836
- '*.json'
@@ -141,7 +139,7 @@ jobs:
141139
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
142140
make setup-js
143141
- name: 'test native(er) packages'
144-
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true --ci=true --collectCoverageFrom='(app-shell|app-shell-odd| discovery-client)/src/**/*.(js|ts|tsx)'"
142+
run: make test-js-internal tests="app-shell/src app-shell-odd/src discovery-client/src" cov_opts="--coverage=true"
145143
- name: 'Upload coverage report'
146144
uses: 'codecov/codecov-action@v3'
147145
with:
@@ -293,7 +291,7 @@ jobs:
293291
OT_APP_DEPLOY_FOLDER: ${{ steps.project.outputs.folder }}
294292

295293
run: |
296-
make -C app-shell dist-${{ matrix.os }}
294+
make -C app-shell dist-${{ matrix.os }} USE_HARD_LINKS=false
297295
298296
- name: 'upload github artifact'
299297
if: matrix.target == 'desktop'
@@ -443,7 +441,6 @@ jobs:
443441
path: |
444442
${{ github.workspace }}/.npm-cache/_prebuild
445443
${{ github.workspace }}/.yarn-cache
446-
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
447444
- name: 'setup-js'
448445
run: |
449446
npm config set cache ${{ github.workspace }}/.npm-cache

.github/workflows/components-test-build-deploy.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ on:
88
- 'Makefile'
99
- 'components/**'
1010
- 'app/**/*.stories.@(js|jsx|ts|tsx)'
11-
- 'webpack-config/**'
1211
- 'package.json'
1312
- '.github/workflows/components-test-build-deploy.yaml'
1413
push:
1514
paths:
1615
- 'components/**'
1716
- 'app/**/*.stories.@(js|jsx|ts|tsx)'
18-
- 'webpack-config/**'
1917
- 'package.json'
2018
- '.github/workflows/components-test-build-deploy.yaml'
2119
branches:
@@ -59,7 +57,6 @@ jobs:
5957
- name: 'setup-js'
6058
run: |
6159
npm config set cache ./.npm-cache
62-
yarn config set cache-folder ./.yarn-cache
6360
make setup-js
6461
- name: 'run components unit tests'
6562
run: make -C components test-cov
@@ -177,21 +174,10 @@ jobs:
177174
with:
178175
node-version: '18.19.0'
179176
registry-url: 'https://registry.npmjs.org'
180-
- name: 'cache yarn cache'
181-
uses: actions/cache@v3
182-
with:
183-
path: |
184-
${{ github.workspace }}/.yarn-cache
185-
${{ github.workspace }}/.npm-cache
186-
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
187-
restore-keys: |
188-
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
189177
- name: 'setup-js'
190178
run: |
191179
npm config set cache ./.npm-cache
192180
yarn config set cache-folder ./.yarn-cache
193-
yarn config set network-timeout 60000
194-
yarn
195181
- name: 'build typescript'
196182
run: make build-ts
197183
- name: 'build library'

.github/workflows/js-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ jobs:
8888
if: always() && steps.setup-js.outcome == 'success'
8989
run: make lint-css
9090
- name: 'test scripts'
91-
run: yarn jest scripts
91+
run: yarn vitest scripts

.github/workflows/ll-test-build-deploy.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- 'labware-library/**'
99
- 'shared-data/labware/**'
1010
- 'components/**'
11-
- 'webpack-config/**'
1211
- 'package.json'
1312
- '.github/workflows/ll-test-build-deploy.yaml'
1413
- '.github/actions/webstack/deploy-to-sandbox/**'
@@ -18,7 +17,6 @@ on:
1817
- 'labware-library/**'
1918
- 'shared-data/labware/**'
2019
- 'components/**'
21-
- 'webpack-config/**'
2220
- 'package.json'
2321
- '.github/workflows/ll-test-build-deploy.yaml'
2422
branches:

.github/workflows/pd-test-build-deploy.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- 'step-generation/**'
1010
- 'shared-data/**'
1111
- 'components/**'
12-
- 'webpack-config/**'
1312
- 'package.json'
1413
- '.github/workflows/pd-test-build-deploy.yaml'
1514
push:
@@ -18,7 +17,6 @@ on:
1817
- 'step-generation/**'
1918
- 'shared-data/**'
2019
- 'components/**'
21-
- 'webpack-config/**'
2220
- 'package.json'
2321
- '.github/workflows/pd-test-build-deploy.yaml'
2422
branches:
@@ -145,8 +143,6 @@ jobs:
145143
${{ github.workspace }}/.yarn-cache
146144
${{ github.workspace }}/.npm-cache
147145
key: js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
148-
restore-keys: |
149-
js-${{ secrets.GH_CACHE_VERSION }}-${{ runner.os }}-yarn-
150146
- name: 'setup-js'
151147
run: |
152148
npm config set cache ./.npm-cache

.github/workflows/shared-data-test-lint-deploy.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ jobs:
237237
- name: 'js deps'
238238
run: |
239239
npm config set cache ./.npm-cache
240-
yarn config set cache-folder ./.yarn-cache
241-
yarn config set network-timeout 60000
242-
yarn
240+
yarn config set cache-folder ./.yarn-cache
243241
- name: 'build typescript'
244242
run: make build-ts
245243
- name: 'build library'

.github/workflows/step-generation-test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ on:
77
paths:
88
- 'step-generation/**'
99
- 'shared-data/**'
10-
- 'webpack-config/**'
1110
- 'package.json'
1211
- '.github/workflows/step-generation-test.yaml'
1312
push:
1413
paths:
1514
- 'step-generation/**'
1615
- 'shared-data/**'
17-
- 'webpack-config/**'
1816
- 'package.json'
1917
- '.github/workflows/step-generation-test.yaml'
2018
branches:

.github/workflows/tag-releases.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ jobs:
3737
npm config set cache ${{ github.workspace }}/.npm-cache
3838
yarn config set cache-folder ${{ github.workspace }}/.yarn-cache
3939
yarn install
40+
4041
- name: 'create release'
4142
run: |
4243
node ./scripts/deploy/create-release.js ${{ github.token }} ${{ github.ref_name }} --deploy

0 commit comments

Comments
 (0)