Conversation
Switches format of component director structure to the following: $ yarn generate-component Select src/components/Select ├── README.md ├── Select.css ├── Select.tsx ├── index.ts ├── story.js └── test.js This makes
dbd1337 to
653794b
Compare
Try building in pull request once Split install and deploy steps for visibility Prefix with yarn in npm scripts gh-pages got dropped from de dependencies Trying custom Github action for Github Pages
653794b to
9f11d38
Compare
| run: | | ||
| yarn install | ||
| yarn build-storybook | ||
| yarn storybook:build |
There was a problem hiding this comment.
This was the real problem. build-storybook does not build to docs by default
1329384 to
f771b3c
Compare
sebastianvera
left a comment
There was a problem hiding this comment.
Really nice work, I'm happy with the new files' structure, I find it annoying to have the component definition in the index file. It is also nice to see tailwind 🙌 (I know it's just part of the example, but anyway)
🚀
| |-- test.js # Used with an npm command | ||
| `-- story.js # Used by storybook, separate npm command | ||
| |-- index.ts # Re-exports from Modal.tsx | ||
| |-- Modal.tsx # Core component file, imports Modal.css |
There was a problem hiding this comment.
Bikeshedding:
I know I read a couple of places that newer recs were to use .js and not .jsx, even with JSX in the files.
The argument boiled down to "everything is transpiled anyway, and not having to rename files is better ergonomics".
Would that make sense with TS files too (skip the trailing "x"?)
I don't mind much either way, but I have a slight preference for using the same extension for all.
There was a problem hiding this comment.
I have not looked into this much, but when I leave off the s for TS components, TS definitely complains loudly. With the x, it happily parses it.
There was a problem hiding this comment.
@pixelbandito Ah, here's an explanation for this: https://www.typescriptlang.org/docs/handbook/jsx.html#basic-usage. For explicit TS, we need to use the .tsx extension to enable JSX for TypeScript components
Adds CONTRIBUTING.md
Github's official file used for contributing guidelines. Simplifies the main README quite a lot, too
Updates the example App
Updates the
hygengenerated codeFinding component files in Rover has always been a bit difficult due to everything being called
index.jsorstyle.css. For future components, I'm proposing switching to useindex.tsfor simple exporting andComponent.tsxandComponent.module.cssfor easier to file finding.