@opentrons/components 0.1.6-alpha.8 → 0.1.6-alpha.9
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 +732 -0
- package/lib/index.mjs +36563 -0
- package/lib/style.css +1 -3786
- package/package.json +3 -4
- package/tsconfig.json +2 -5
- package/vite.config.mts +11 -18
- package/lib/index.js +0 -22440
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.9",
|
|
4
4
|
"description": "React components library for Opentrons' projects",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -19,11 +19,10 @@
|
|
|
19
19
|
"homepage": "https://github.com/Opentrons/opentrons#readme",
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "18.2.0",
|
|
22
|
-
"react-dom": "18.2.0"
|
|
23
|
-
"styled-components": "5.3.6"
|
|
22
|
+
"react-dom": "18.2.0"
|
|
24
23
|
},
|
|
25
24
|
"dependencies": {
|
|
26
|
-
"@opentrons/shared-data": "0.1.6-alpha.
|
|
25
|
+
"@opentrons/shared-data": "0.1.6-alpha.9",
|
|
27
26
|
"@popperjs/core": "2.1.1",
|
|
28
27
|
"@react-spring/types": "9.6.1",
|
|
29
28
|
"@react-spring/web": "9.6.1",
|
package/tsconfig.json
CHANGED
|
@@ -9,10 +9,7 @@
|
|
|
9
9
|
"composite": true,
|
|
10
10
|
"rootDir": "src",
|
|
11
11
|
"outDir": "lib",
|
|
12
|
-
"declarationDir": "lib",
|
|
13
|
-
"noEmit": false,
|
|
14
|
-
"jsx": "preserve"
|
|
15
12
|
},
|
|
16
13
|
"include": ["typings", "src"],
|
|
17
|
-
"exclude": ["**/*.stories.tsx"
|
|
18
|
-
}
|
|
14
|
+
"exclude": ["**/*.stories.tsx"]
|
|
15
|
+
}
|
package/vite.config.mts
CHANGED
|
@@ -9,30 +9,25 @@ import lostCss from 'lost'
|
|
|
9
9
|
|
|
10
10
|
export default defineConfig({
|
|
11
11
|
build: {
|
|
12
|
-
|
|
12
|
+
// Relative to the root
|
|
13
13
|
outDir: 'lib',
|
|
14
|
-
|
|
14
|
+
// do not delete the outdir, typescript types might live there and we dont want to delete them
|
|
15
|
+
emptyOutDir: false,
|
|
15
16
|
lib: {
|
|
16
17
|
entry: 'src/index.ts',
|
|
17
|
-
formats: ['es', 'cjs'],
|
|
18
|
+
formats: ['es', 'cjs'], // Generate both ES Module and CommonJS outputs
|
|
18
19
|
fileName: (format) => (format === 'es' ? 'index.mjs' : 'index.cjs'),
|
|
19
20
|
},
|
|
20
21
|
rollupOptions: {
|
|
21
|
-
external: ['react', 'react-dom', 'styled-components'], //
|
|
22
|
-
output: {
|
|
23
|
-
assetFileNames: '[name].[ext]', // Ensure asset names are kept clean
|
|
24
|
-
entryFileNames: '[name].js', // Ensure only compiled JS is output
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
commonjsOptions: {
|
|
28
|
-
transformMixedEsModules: true,
|
|
29
|
-
esmExternals: true,
|
|
22
|
+
external: ['react', 'react-dom', 'styled-components'], // Ensure peer dependencies are not bundled
|
|
30
23
|
},
|
|
24
|
+
target: 'es2017', // Transpile down to a compatible version for Next.js (for Protocol Library)
|
|
31
25
|
},
|
|
32
26
|
plugins: [
|
|
33
27
|
react({
|
|
34
28
|
include: '**/*.tsx',
|
|
35
29
|
babel: {
|
|
30
|
+
// Use babel.config.js files
|
|
36
31
|
configFile: true,
|
|
37
32
|
},
|
|
38
33
|
}),
|
|
@@ -41,7 +36,7 @@ export default defineConfig({
|
|
|
41
36
|
esbuildOptions: {
|
|
42
37
|
target: 'es2020',
|
|
43
38
|
},
|
|
44
|
-
exclude: ['styled-components'],
|
|
39
|
+
exclude: ['styled-components'], // Avoid pre-bundling styled-components
|
|
45
40
|
},
|
|
46
41
|
css: {
|
|
47
42
|
postcss: {
|
|
@@ -55,11 +50,8 @@ export default defineConfig({
|
|
|
55
50
|
},
|
|
56
51
|
},
|
|
57
52
|
define: {
|
|
58
|
-
'process.env':
|
|
59
|
-
|
|
60
|
-
OPENTRONS_PROJECT: process.env.OPENTRONS_PROJECT,
|
|
61
|
-
},
|
|
62
|
-
global: 'globalThis', // Ensure compatibility with global variables
|
|
53
|
+
'process.env': process.env,
|
|
54
|
+
global: 'globalThis',
|
|
63
55
|
},
|
|
64
56
|
resolve: {
|
|
65
57
|
alias: {
|
|
@@ -68,5 +60,6 @@ export default defineConfig({
|
|
|
68
60
|
'../components/src/index.module.css'
|
|
69
61
|
),
|
|
70
62
|
},
|
|
63
|
+
dedupe: ['styled-components'], // Prevent duplicate styled-components instances
|
|
71
64
|
},
|
|
72
65
|
})
|