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

fix(app): display app version again #14844

Merged
merged 5 commits into from
Apr 9, 2024
Merged
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
5 changes: 3 additions & 2 deletions app-shell-odd/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { versionForProject } from '../scripts/git-version'
import { versionForProject } from '../scripts/git-version.mjs'
import pkg from './package.json'
import path from 'path'
import { UserConfig, defineConfig } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssImport from 'postcss-import'
import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'
import type {UserConfig} from 'vite'

export default defineConfig(
async (): Promise<UserConfig> => {
Expand Down
5 changes: 3 additions & 2 deletions app-shell/electron-builder.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict'
const path = require('path')
const { versionForProject } = require('../scripts/git-version')

const {
OT_APP_DEPLOY_BUCKET,
Expand Down Expand Up @@ -45,7 +44,9 @@ module.exports = async () => ({
},
],
extraMetadata: {
version: await versionForProject(project),
version: await (
await import('../scripts/git-version.mjs')
).versionForProject(project),
productName: project === 'robot-stack' ? 'Opentrons' : 'Opentrons-OT3',
},
extraResources: USE_PYTHON ? ['python'] : [],
Expand Down
5 changes: 3 additions & 2 deletions app-shell/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { versionForProject } from '../scripts/git-version'
import { versionForProject } from '../scripts/git-version.mjs'
import pkg from './package.json'
import path from 'path'
import { UserConfig, defineConfig } from 'vite'
import { defineConfig } from 'vite'
import type { UserConfig } from 'vite'

export default defineConfig(
async (): Promise<UserConfig> => {
Expand Down
109 changes: 59 additions & 50 deletions app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,66 @@ import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'
import { versionForProject } from '../scripts/git-version.mjs'
import type { UserConfig } from 'vite'

export default defineConfig({
// this makes imports relative rather than absolute
base: '',
build: {
// Relative to the root
outDir: 'dist',
},
plugins: [
react({
include: '**/*.tsx',
babel: {
// Use babel.config.js files
configFile: true,
export default defineConfig(
async(): Promise<UserConfig> => {
const project = process.env.OPENTRONS_PROJECT ?? 'robot-stack'
const version = await versionForProject(project)
return {
// this makes imports relative rather than absolute
base: '',
build: {
// Relative to the root
outDir: 'dist',
},
}),
],
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
},
css: {
postcss: {
plugins: [
postCssImport({ root: 'src/' }),
postCssApply(),
postColorModFunction(),
postCssPresetEnv({ stage: 0 }),
lostCss(),
react({
include: '**/*.tsx',
babel: {
// Use babel.config.js files
configFile: true,
},
}),
],
},
},
define: {
'process.env': process.env,
global: 'globalThis',
},
resolve: {
alias: {
'@opentrons/components/styles': path.resolve(
'../components/src/index.module.css'
),
'@opentrons/components': path.resolve('../components/src/index.ts'),
'@opentrons/shared-data': path.resolve('../shared-data/js/index.ts'),
'@opentrons/step-generation': path.resolve(
'../step-generation/src/index.ts'
),
'@opentrons/api-client': path.resolve('../api-client/src/index.ts'),
'@opentrons/react-api-client': path.resolve(
'../react-api-client/src/index.ts'
),
},
},
})
optimizeDeps: {
esbuildOptions: {
target: 'es2020',
},
},
css: {
postcss: {
plugins: [
postCssImport({ root: 'src/' }),
postCssApply(),
postColorModFunction(),
postCssPresetEnv({ stage: 0 }),
lostCss(),
],
},
},
define: {
'process.env': process.env,
global: 'globalThis',
_PKG_VERSION_: JSON.stringify(version),
_OPENTRONS_PROJECT_: JSON.stringify(project),
},
resolve: {
alias: {
'@opentrons/components/styles': path.resolve(
'../components/src/index.module.css'
),
'@opentrons/components': path.resolve('../components/src/index.ts'),
'@opentrons/shared-data': path.resolve('../shared-data/js/index.ts'),
'@opentrons/step-generation': path.resolve(
'../step-generation/src/index.ts'
),
'@opentrons/api-client': path.resolve('../api-client/src/index.ts'),
'@opentrons/react-api-client': path.resolve(
'../react-api-client/src/index.ts'
),
},
},
}
})
38 changes: 0 additions & 38 deletions components/webpack.config.js

This file was deleted.

7 changes: 4 additions & 3 deletions discovery-client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { versionForProject } from '../scripts/git-version'
import { versionForProject } from '../scripts/git-version.mjs'
import pkg from './package.json'
import path from 'path'
import { UserConfig, defineConfig } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssImport from 'postcss-import'
import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'

import type { UserConfig } from 'vite
'
export default defineConfig(
async (): Promise<UserConfig> => {
const project = process.env.OPENTRONS_PROJECT ?? 'robot-stack'
Expand Down
26 changes: 0 additions & 26 deletions discovery-client/webpack.config.js

This file was deleted.

26 changes: 0 additions & 26 deletions labware-designer/webpack.config.js

This file was deleted.

67 changes: 0 additions & 67 deletions labware-library/webpack.config.js

This file was deleted.

5 changes: 3 additions & 2 deletions protocol-designer/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import path from 'path'
import { UserConfig, defineConfig } from 'vite'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import postCssImport from 'postcss-import'
import postCssApply from 'postcss-apply'
import postColorModFunction from 'postcss-color-mod-function'
import postCssPresetEnv from 'postcss-preset-env'
import lostCss from 'lost'
import { versionForProject } from '../scripts/git-version'
import { versionForProject } from '../scripts/git-version.mjs'
import type { UserConfig } from 'vite'

const testAliases: {} | { 'file-saver': string } =
process.env.CYPRESS === '1'
Expand Down
Loading
Loading