@opentrons/components 0.1.6-alpha.11 → 0.1.6-alpha.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +95 -95
- package/lib/index.mjs +5873 -5905
- package/package.json +2 -2
- package/tsconfig.json +2 -0
- package/vite.config.mts +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentrons/components",
|
|
3
|
-
"version": "0.1.6-alpha.
|
|
3
|
+
"version": "0.1.6-alpha.15",
|
|
4
4
|
"description": "React components library for Opentrons' projects",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"styled-components": "5.3.6"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@opentrons/shared-data": "0.1.6-alpha.
|
|
26
|
+
"@opentrons/shared-data": "0.1.6-alpha.15",
|
|
27
27
|
"@popperjs/core": "2.1.1",
|
|
28
28
|
"@react-spring/types": "9.6.1",
|
|
29
29
|
"@react-spring/web": "9.6.1",
|
package/tsconfig.json
CHANGED
package/vite.config.mts
CHANGED
|
@@ -6,22 +6,35 @@ import postCssApply from 'postcss-apply'
|
|
|
6
6
|
import postColorModFunction from 'postcss-color-mod-function'
|
|
7
7
|
import postCssPresetEnv from 'postcss-preset-env'
|
|
8
8
|
import lostCss from 'lost'
|
|
9
|
+
import commonjs from '@rollup/plugin-commonjs' // Importing @rollup/plugin-commonjs to handle CJS to ESM conversion
|
|
9
10
|
|
|
10
11
|
export default defineConfig({
|
|
11
12
|
build: {
|
|
12
13
|
// Relative to the root
|
|
13
14
|
outDir: 'lib',
|
|
14
|
-
//
|
|
15
|
+
// Do not delete the outdir, TypeScript types might live there, and we don't want to delete them
|
|
15
16
|
emptyOutDir: false,
|
|
16
17
|
lib: {
|
|
17
18
|
entry: 'src/index.ts',
|
|
18
19
|
formats: ['es', 'cjs'], // Generate both ES Module and CommonJS outputs
|
|
19
|
-
fileName:
|
|
20
|
+
fileName: format => (format === 'es' ? 'index.mjs' : 'index.cjs'),
|
|
20
21
|
},
|
|
21
22
|
rollupOptions: {
|
|
22
23
|
external: ['react', 'react-dom', 'styled-components'], // Ensure peer dependencies are not bundled
|
|
24
|
+
output: {
|
|
25
|
+
exports: 'named', // Use named exports for compatibility with styled-components in CJS
|
|
26
|
+
globals: {
|
|
27
|
+
'styled-components': 'styled', // Ensure styled-components maps correctly in UMD builds
|
|
28
|
+
},
|
|
29
|
+
plugins: [
|
|
30
|
+
commonjs({
|
|
31
|
+
include: /node_modules/, // Include node_modules for CommonJS conversion
|
|
32
|
+
transformMixedEsModules: true, // Ensure proper handling of mixed modules
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
},
|
|
23
36
|
},
|
|
24
|
-
target: 'es2017', // Transpile down to a compatible version for Next.js
|
|
37
|
+
target: 'es2017', // Transpile down to a compatible version for Next.js
|
|
25
38
|
},
|
|
26
39
|
plugins: [
|
|
27
40
|
react({
|
|
@@ -51,7 +64,7 @@ export default defineConfig({
|
|
|
51
64
|
},
|
|
52
65
|
define: {
|
|
53
66
|
'process.env': process.env,
|
|
54
|
-
global: 'globalThis',
|
|
67
|
+
global: 'globalThis', // Fix issues with globalThis in some environments
|
|
55
68
|
},
|
|
56
69
|
resolve: {
|
|
57
70
|
alias: {
|