Skip to content

Commit f57318e

Browse files
committed
npm pack working
1 parent 9e5f63a commit f57318e

19 files changed

+106
-24
lines changed

components/.npmignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Development files - these should NOT be in the published package
2+
src/
3+
*.stories.*
4+
*.test.*
5+
*.spec.*
6+
__tests__/
7+
__mocks__/
8+
.storybook/
9+
coverage/
10+
11+
# Build tools
12+
tsconfig*.json
13+
vite.config.*
14+
babel.config.*
15+
cssModuleSideEffect.*
16+
Makefile
17+
18+
# Local dependencies - these get bundled instead
19+
node_modules/@opentrons/step-generation/
20+
21+
# Other development files
22+
.env*
23+
.DS_Store
24+
*.log

components/package.json

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@
55
"source": "src/index.ts",
66
"types": "lib/index.d.ts",
77
"style": "src/index.module.css",
8-
"main": "src/index.ts",
9-
"module": "src/index.ts",
8+
"main": "lib/index.mjs",
9+
"module": "lib/index.mjs",
1010
"exports": {
11-
"./styles": "./src/styles/global.css"
11+
".": {
12+
"types": "./lib/index.d.ts",
13+
"import": "./lib/index.mjs",
14+
"require": "./lib/index.mjs",
15+
"default": "./lib/index.mjs"
16+
},
17+
"./styles": "./lib/style.css"
1218
},
1319
"repository": {
1420
"type": "git",
@@ -21,12 +27,12 @@
2127
},
2228
"homepage": "https://github.com/Opentrons/opentrons#readme",
2329
"peerDependencies": {
30+
"@opentrons/shared-data": "*",
2431
"react": "18.2.0",
2532
"react-dom": "18.2.0"
2633
},
2734
"dependencies": {
2835
"@opentrons/shared-data": "link:../shared-data",
29-
"@opentrons/step-generation": "link:../step-generation",
3036
"@popperjs/core": "2.1.1",
3137
"@react-spring/types": "9.6.1",
3238
"@react-spring/web": "9.6.1",
@@ -48,6 +54,18 @@
4854
"styled-components": "5.3.6"
4955
},
5056
"devDependencies": {
57+
"@opentrons/step-generation": "link:../step-generation",
5158
"react-redux": "8.1.2"
52-
}
59+
},
60+
"scripts": {
61+
"build": "npm run build-ts && npm run build-lib",
62+
"build-lib": "NODE_ENV=production vite build",
63+
"build-ts": "tsc --build --emitDeclarationOnly",
64+
"prepublishOnly": "npm run build",
65+
"postpack": "echo 'Package ready for publishing with bundled step-generation'"
66+
},
67+
"files": [
68+
"lib/",
69+
"README.md"
70+
]
5371
}

components/src/alerts/alerts.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../index.module.css';
1+
@import '../modules.css';
22

33
.alert {
44
font-size: var(--fs-body-2);

components/src/buttons/buttons.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* button styling */
2-
@import '../index.module.css';
2+
@import '../modules.css';
33

44
:root {
55
--button-pad: 0.5rem;

components/src/controls/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../index.module.css';
1+
@import '../modules.css';
22

33
:root {
44
--mw-labeled-toggle: 25rem;

components/src/forms/Select.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* stylelint-disable selector-class-pattern */
2-
@import '../index.module.css';
2+
@import '../modules.css';
33

44
/* NOTE(mc, 2021-04-27): this class only used by storybook */
55
.example_select_override {

components/src/forms/forms.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../index.module.css';
1+
@import '../modules.css';
22

33
.accessibly_hidden {
44
position: absolute;

components/src/index.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/* opentrons style library */
1+
/* opentrons style library - CSS modules only */
22

33
@import './styles/colors.module.css';
44
@import './styles/typography.module.css';
55
@import './styles/borders.module.css';
6-
@import './styles/global.css';
6+
/* Note: global.css is imported separately in index.ts to avoid CSS modules processing */
77

88
:global(*) {
99
box-sizing: border-box;

components/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
// opentrons components library
22

3+
// Import global CSS first (not as CSS modules)
4+
import './styles/global.css'
5+
36
export * from './hooks'
47
export * from './utils'
58

components/src/legacy-hardware-sim/LabwareNameOverlay.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../index.module.css';
1+
@import '../modules.css';
22

33
.name_overlay {
44
width: 100%;

0 commit comments

Comments
 (0)