flowbite-react
flowbite-react copied to clipboard
Move docs to a separated project inside the repository
I still not happy with the fact that the docs are inside the src
folder. It always drive me crazy, 'cause it isn't part of the librabry. So we should move it to a separated react application inside our repository, and it will also works as an example.
Describe the solution you'd like
- Inside the repository create a new react project on project root
/docs
folder - Link the dependencies to its
package.json
to use the ones on the librabrynode_modules
, including the ownflowbite-react
librabry - Move the build scripts to the
package.json
for thedocs
project - Move the
src/docs
to the new project
Describe alternatives you've considered n/a
Additional context Better if we could create the docs project without CRA and using NextJS or Remix.
@rluders we could look at introducing https://turborepo.org/ into the mix.
Then we would have the docs and storybook under apps and the library under packages within a monorepo.
@davemooreuws what I want to do with this task is something very similar to it. I also want to make it a monorepo, my main issue right now with the current structure is that we are using CRA, and we do have a lot of folders inside the src/
folder.
IMHO, we need to split it into separated projects, by having, for now, the ./src
storing the library things, while the ./docs
being a separated project, inside the repository, that will only have the documentation.
With that we could simplify the package.json
for both projects as well to remove the CRA to the library itself, removing the "magic layer" that it introduces to the build.
But yep, you got the idea. I'm not sure how it is going to be with the storybook yet, 'cause I consider having the stories close to the components as a HUGE benefit, and I think that I already discussed it with someone about it, based on this post. But of course, we could still have a ./storybook
at the project root to hold some .mdx
files. But this is another task. Right now, docs! :smile:
I'm thinking...
docs/
public/
(Hugo .md files)
..
examples/
flowbite-next-starter
src/
..
flowbite-remix-starter
src/
..
..
src/
components/
*.stories.tsx (include stories also)
..
helpers/
theme
..
tests/
integration/
docs/
examples/
unit/
components/*.spec.tsx
helpers/*.spec.ts
..
I don't think that moving the unit tests away from the components is a good idea. I like to keep it close, maybe because it is a good practice on Go.
But I'm not totally against it, it is just my opinion. So, let's try to find some info.
- What are the pros or cons?
- Is it a community standard?
- If not, what is the community standard for unit testing?
I think Jest suggests __tests__
which is weird.
My logic is keep the integration tests and unit tests together, rather than having Cypress in its own folder cypress
randomly.