flowbite-react icon indicating copy to clipboard operation
flowbite-react copied to clipboard

Move docs to a separated project inside the repository

Open rluders opened this issue 2 years ago • 5 comments

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 librabry node_modules, including the own flowbite-react librabry
  • Move the build scripts to the package.json for the docs 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 avatar May 23 '22 07:05 rluders

@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 avatar Jun 14 '22 06:06 davemooreuws

@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:

rluders avatar Jun 14 '22 07:06 rluders

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
  ..

tulup-conner avatar Jul 31 '22 21:07 tulup-conner

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?

rluders avatar Aug 01 '22 06:08 rluders

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.

tulup-conner avatar Aug 01 '22 07:08 tulup-conner