System Guide SPIKE

Why?

Our goal is to keep our npm packages up-to-date in the monorepo.  The system guide has not been updated in many years.

Solution 1: Manual migration of SG to Gatsby 5

 

  • ​SG is currently on Gatsby v2

    • We'd have to update all the packages in our Gatsby theme, including the Gatsby package and Gatsby plugins

      • v4 --> v5

      • v3 --> v4

      • v2 --> v3

  • We are considering creating a new, more generic Gatsby theme to be used by other teams.  We would need to start from scratch for this anyway.

 

 

Solution 2: Rip that package out of the monorepo!

 

  • We would keep the system guide as it is, but move it out of the monorepo

  • ​Biggest Challenge: getting the data for the props table since that data is coming from the relative path from the react directory in the monorepo

  • The Props Table grabs its data from our JSDocs

  • Cameron had already created a new build process for the react package to keep our JSDocs, but we realized that the Props Table actually uses more than just the JSDocs...

 

 

Props Table

  • gatsby-transformer-react-docgen pulls in propType data

    • name, type, required, etc.

  • gatsby-transformer-documentationjs pulls in JSDocs data
    • name, description, returns, params, examples from main index file of component
    • also pulls in config file enums data

 

 

How to get the props data

  • We could roll our own utility functions to get the propType data, JSDocs data, and enum data using the npm packages that the Gatsby plugins use under the hood

    • This would take some time
       

  • We could just copy the whole components directory from our react package into our dist folder every time we build the package and then point the Gatsby plugins at that folder
    • Quick!
      • we did consider just copying over the main component file and the config file for each component, but that gets complicated as some components are within sub-folders

 

 

So far so good

  • Copied all React component source data (and same process for the Luna tables package)

  • Confirmed success in locally environment
     
  • Next steps
    • how to deploy system guide
      • AWS permissions and pipeline build

 

 

System Guide SPIKE

By sarahelynch

System Guide SPIKE

  • 56