Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/app-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- 'yarn.lock'
- '.github/workflows/app-test-build-deploy.yaml'
- '.github/workflows/utils.js'
- 'vitest.config.*'
branches:
- '**'
tags:
Expand All @@ -36,6 +37,7 @@ on:
- '*.json'
- 'yarn.lock'
- 'scripts/**'
- '.vitest.config.*'
workflow_dispatch: {}

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/components-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- 'app/src/molecules/**'
- 'protocol-designer/src/components/**'
- 'scripts/static-deploy/**'
- 'vitest.config.*'
push:
branches:
- 'edge'
Expand Down
34 changes: 20 additions & 14 deletions .github/workflows/js-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,29 @@ name: 'JS checks'
on:
pull_request:
paths:
- '**/*.js'
- './.*.js'
- '**/*.ts'
- '**/*.tsx'
- '**/*.json'
- '**/*.css'
- '**/*.md'
- '**.js'
- '**.cjs'
- '**.mjs'
- '**.ts'
- '**.cts'
- '**.mts'
- '**.tsx'
- '**.json'
- '**.css'
- '**.md'
push:
paths:
- '**/*.js'
- './.*.js'
- '**/*.ts'
- '**/*.tsx'
- '**/*.json'
- '**/*.md'
- '**.js'
- '**.cjs'
- '**.mjs'
- '**.ts'
- '**.cts'
- '**.mts'
- '**.tsx'
- '**.json'
- '**.css'
- '**.md'
- '.github/workflows/js-check.yaml'
- '**/*.css'
workflow_dispatch:

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ll-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- '.github/workflows/utils.js'
- 'scripts/static-deploy/**'
- 'scripts/git-version-v2.mjs'
- 'vitest.config.*'
push:
branches:
- 'edge'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/opentrons-ai-client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'components/**'
- 'shared-data/**'
- '.github/workflows/opentrons-ai-client-test.yml'
- 'vitest.config.*'
branches:
- '**'
tags:
Expand All @@ -24,6 +25,7 @@ on:
- 'components/**'
- 'shared-data/**'
- '.github/workflows/opentrons-ai-client-test.yml'
- 'vitest.config.*'
workflow_dispatch:

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- 'scripts/static-deploy/**'
- 'scripts/git-version-protocol-designer.mjs'
- 'scripts/git-version-v2.mjs'
- 'vitest.config.*'
push:
branches:
- 'edge'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/react-api-client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ on:
- 'api-client/**'
- 'package.json'
- '.github/workflows/react-api-client-test.yaml'
- 'vitest.config.*'
push:
paths:
- 'react-api-client/**'
- 'api-client/**'
- 'package.json'
- '.github/workflows/react-api-client-test.yaml'
- 'vitest.config.*'
branches:
- '*'
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/shared-data-test-lint-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- '.github/workflows/shared-data-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
- 'vitest.config.*'
branches:
- 'edge'
- 'release'
Expand All @@ -30,6 +31,7 @@ on:
- '.github/workflows/shared-data-test-lint-deploy.yaml'
- '.github/actions/python/**/*'
- '.github/workflows/utils.js'
- 'vitest.config.*'
workflow_dispatch:

concurrency:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/step-generation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- '.github/actions/js/setup/action.yml'
- '.github/actions/git/resolve-tag/action.yml'
- '.github/actions/environment/complex-variables/action.yml'
- 'vitest.config.*'
push:
paths:
- 'step-generation/**'
Expand All @@ -21,6 +22,7 @@ on:
- '.github/actions/js/setup/action.yml'
- '.github/actions/git/resolve-tag/action.yml'
- '.github/actions/environment/complex-variables/action.yml'
- 'vitest.config.*'
Copy link
Contributor

Choose a reason for hiding this comment

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

is there any reason to use .* instead .mts?
there is only one vitest.config.mts in the monorepo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since Vite and Vitest support multiple extensions (.js, .mjs, .cjs, .ts, .mts, .cts), I was just thinking this would be one less thing that we'd need to update in case we ever wanted to change vitest.config.mts to vitest.config.ts or something like that.

branches:
- '*'

Expand Down
28 changes: 13 additions & 15 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path')
import type { StorybookConfig } from '@storybook/react-vite'

module.exports = {
const config: StorybookConfig = {
stories: [
'../components/**/*.stories.@(js|jsx|ts|tsx)',
'../app/**/*.stories.@(js|jsx|ts|tsx)',
Expand All @@ -19,24 +19,22 @@ module.exports = {
'storybook-addon-pseudo-states',
],

staticDirs: ['../app/src/assets'],

framework: {
name: '@storybook/react-vite',
options: {},
options: {
builder: {
// Storybook would normally find the Vite config automatically.
// That doesn't work for us because we have one monorepo-wide Storybook
// installation, while each project has its own local Vite config.
// So we treat Storybook as its own Vite project with its own config.
viteConfigPath: '.storybook/vite.config.mjs',
},
},
},

docs: {
autodocs: true,
},

async viteFinal(config) {
config.resolve = config.resolve || {}
config.resolve.alias = config.resolve.alias || {}

// Add the same alias as in app/vite.config.mts to support /app/ imports
config.resolve.alias['/app/'] = path.resolve(__dirname, '../app/src/') + '/'

return config
},
Comment on lines -32 to -41
Copy link
Contributor Author

@SyntaxColoring SyntaxColoring Nov 25, 2025

Choose a reason for hiding this comment

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

I think this viteFinal block, introduced in #20228, was not doing anything. vite.config.mts (now moved to .storybook/vite.config.mts) already had this /app/ alias. I tested this removal by looking at some components that were importing things from /app.

FYI @koji

Copy link
Contributor

Choose a reason for hiding this comment

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

this is used to overwrite the path to image in my pr.

}

export default config
21 changes: 3 additions & 18 deletions vite.config.mts → .storybook/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
/// <reference types="vitest" />
/// <reference types="vite/client" />

// todo(mm, 2025-09-15): This file is used under confusing circumstances.
//
// For normal production bundling and dev-serving, each project has its own
// vite.config.mts that gets favored. This one is never used.
//
// For vitest invocations, vitest would normally default to those same project-specific
// vite.config.mts files. However, because we have a single global vitest.config.mts, it
// uses that instead, completely ignoring the project-specific files. From there,
// vitest.config.mts explicitly includes this file.
//
// So, that leaves us with:
// - An arbitrary split between this global vite.config.mts the global vitest.config.mts
// - Global vite.config.mts and global vitest.config.mts comprising, together, an
// amalgamation of all projects' needs -- all projects' aliases, all projects' defines, etc.
// - Which is probably largely duplicating the existing project-local configs,
// which we'd get for free if we didn't override them with our vitest.config.mts

import path from 'path'
import react from '@vitejs/plugin-react'
import lostCss from 'lost'
Expand Down Expand Up @@ -63,7 +46,9 @@ export default defineConfig({
// NOTE: For security, only include environment variables here if they're explicitly allowlisted.
_FF_ENV_VARS_: {},
_NODE_ENV_: JSON.stringify(process.env.NODE_ENV),
_OT_AI_CLIENT_MIXPANEL_ID_: JSON.stringify(process.env.OT_AI_CLIENT_MIXPANEL_ID),
_OT_AI_CLIENT_MIXPANEL_ID_: JSON.stringify(
process.env.OT_AI_CLIENT_MIXPANEL_ID
),
_OT_APP_MIXPANEL_ID_: JSON.stringify(process.env.OT_APP_MIXPANEL_ID),
_OT_LL_MIXPANEL_DEV_ID_: JSON.stringify(process.env.OT_LL_MIXPANEL_DEV_ID),
_OT_LL_MIXPANEL_ID_: JSON.stringify(process.env.OT_LL_MIXPANEL_ID),
Expand Down
Loading
Loading