Git Product home page Git Product logo

Comments (4)

eric-burel avatar eric-burel commented on May 27, 2024 1

That's not bad already even if it has limitations. Thanks! Vulcan NPM is the priority here, for Vulcan Next you can focus on the local packages in the packages folder.

from vulcan-next.

eric-burel avatar eric-burel commented on May 27, 2024

@Timi-Duban it would be awesome to manage to handle point 2 (automatically generate documentation based on TS typings) for Vulcan NPM. The end result would be a documentation that shows the typings of all exported values for each package, so you can tell what you can import from each package and get the API.

from vulcan-next.

Timi-Duban avatar Timi-Duban commented on May 27, 2024

I found a module that handles this, it's called TypeDoc.
It's based on TS typing and provides a doc about everything that's exported (like classes, interfaces, types aliases, variables, functions...)

It seems to throw if typecheck throws, which can be a problem. For example I have a weird bug in packages/react-ui/components/form/tests/FormContainer.stories.tsx where typescript doesn't want to export buildUpdateQuery so I deleted it to test the documentation tool.

I don't think it's the perfect solution: it kinda feels like you're navigating in our types. But since it can be accessed more easily it can be usefull.
It looks like this:
image
image

Another problem: to have a pretty result, you have to give the command every index.ts file (or it will consider every folder as a module and you'll end up with repetitions). For example in vulcan-npm what seems the best way to use it to me is:

yarn add typedoc --dev -W
npx typedoc packages/core/index.ts packages/demo/index.ts packages/graphql/index.ts packages/i18n/index.ts  packages/mdx/index.ts packages/meteor-legacy/index.ts packages/model/index.ts packages/mongo/index.ts packages/multi-env-demo/index.ts packages/permissions/index.ts packages/react-hooks/index.ts packages/react-ui/index.ts packages/schema/index.ts packages/utils/index.ts

The result is either HTML or JSON files, by default it's HTML located to /docs (but you can change it by doing npx typedoc --out [your new location] [files]
You can also add the flag --excludeNotDocumented, but we don't have much of our functions commented so we lose a lot by doing this.

They have Monorepos handling, but it seems to crash in vulcan-npm. I'll try in vulcan-next and keep you informed.

from vulcan-next.

Timi-Duban avatar Timi-Duban commented on May 27, 2024

It's exactly the same in vulcan-next, but there are very few packages that are interesting (Apollo and Utils could be for example).
So for now the priority is to pass vulcan-npm typecheck to be able to automatically generate documentation !

from vulcan-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.