Coder Social home page Coder Social logo

powerplex / spark-docgen-fix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adevinta/spark

0.0 0.0 0.0 12.13 MB

Investigating docgen errors on tree shaken packages

Home Page: https://sparkui.vercel.app

License: MIT License

Shell 0.02% JavaScript 6.10% TypeScript 93.78% CSS 0.02% HTML 0.09%

spark-docgen-fix's Introduction

REPRODUCING THE BUG

  1. npm install (It will build the leaf packages using lerna + vite)
  2. npm run storybook:start (I set it up so that only the broken doc is loaded)
  3. Try to open the Button docs page (or stories) => ERROR
ReferenceError: o is not defined
    at http://localhost:6006/packages/components/icons/dist/index.mjs:587:2

Somehow, docGen is trying to attach its __docgenInfo to undeclared variables.

For example if we focus on a single import in the mjs file generated:

// 1. Name of the export is "df" after compilation.
import {ToysProduct as df} from "/packages/components/icons/dist/icons/ToysProduct.mjs";

export {df as ToysProduct}; 

// 2. But here docgen tries to attach its data to "d" instead of "df"
d.__docgenInfo = {
    "description": "",
    "methods": [],
    "displayName": "ToysProduct",
    "props": {
        "fill": {
            "defaultValue": {
                "value": "\"currentColor\"",
                "computed": false
            },
            "required": false
        },
        "stroke": {
            "defaultValue": {
                "value": "\"none\"",
                "computed": false
            },
            "required": false
        }
    }
};

spark-docgen-fix's People

Contributors

andresin87 avatar acd02 avatar andresz1 avatar github-actions[bot] avatar powerplex avatar kikoruiz avatar arnau-rius avatar spark-ui-bot avatar dependabot[bot] avatar solygambas avatar soykje avatar ferminhg avatar

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.