-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add storybook #46
base: develop
Are you sure you want to change the base?
Add storybook #46
Conversation
Looking at this but no luck so far. I think this is related to why the component isn't rendering in the Addon-Docs either /cc @tomwayson @mjuniper |
@MikeTschudi - I was able to get the preview to work by changing the compiler options in {
"compilerOptions": {
"lib": ["dom", "es2017"],
"target": "es2017"
}
} |
@jmhauck -> For verifying, I tried to change back to "volta": {
"node": "14.17.0",
"npm": "6.14.13"
} |
@tannerjt thanks for the suggestions...but I'm getting errors after npm install when building the storybook when I use this. |
I deleted And it works! Thank you, @tannerjt! (The components continue to work, too! ;-) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you should not have had to move them to from peerDependencies to dependencies if they were in devDependencies, so I'm surprised that's what made it work.
package.json
Outdated
"@esri/arcgis-rest-auth": "^3.4.1", | ||
"@esri/arcgis-rest-feature-layer": "^3.4.1", | ||
"@esri/arcgis-rest-geocoding": "^3.4.1", | ||
"@esri/arcgis-rest-portal": "^3.4.1", | ||
"@esri/arcgis-rest-request": "^3.4.1", | ||
"@esri/arcgis-rest-types": "^3.4.1", | ||
"@esri/calcite-components": "1.0.0-beta.74", | ||
"@esri/calcite-ui-icons": "^3.14.1", | ||
"@esri/eslint-plugin-calcite-components": "^0.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like most (if not all) of these are in dependencies, so leaving them here as well will only cause pain and suffering (mismatched versions). You only need them as devDependencies if they are peerDependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't added the new packages to devDependencies; fixed
.storybook/preview.js
Outdated
const url = new URL(document.currentScript.src); | ||
url.pathname = url.pathname.startsWith('/solutions-components/') ? '/solutions-components/' : '/'; | ||
setAssetPath(`${url.href}solutions-components/solutions-components`); | ||
defineCustomElements(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably best not to use the dist-custom-elements-bundle
here, see the changes I made to the Hub Storybook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having trouble with these changes: nothing appears for arcgis-hub-input-color yet; tinkering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thought that comes to mind off the top of my head is that that component leans heavily on calcite-components.
A review-only PR for adding storybook.js to the repo created because components are rendered as text instead of components in the storybook.
It includes a component--
arcgis-hub-input-color
--copied exactly from hub-components because it contains a known working story. This story is rendered asin this repo instead of
as it is rendered in the hub-components storybook.
Only one solutions-components component has a story at this time:
solution-item-icon
has a trivial story that works when the component is added to the hub-components repo on my computer.Inside React, components in this repo are handled as HostText instead of HostComponent. As a result, they're added to the storybook as a text block:
All development of components and storybook in this repo has been done using Windows 10 computers. Volta was upgraded from 1.0.1 to the latest (1.0.5), and node/npm adjusted to use the latest LTS node and the npm that goes with it. The storybook material was copied from hub-components and modified, and there are library differences between the two repos since I also updated many libraries to their latest versions trying to get this to work.
Thank you, @ajturner & @jmhauck, for offering to look at this!