SoftwareBrothers / better-docs

Beautiful toolbox for jsdoc generated documentation - with 'typescript', `category` and `component` plugins
MIT License
857 stars 127 forks source link

Parcel error with @component #209

Open Ngc1987 opened 2 years ago

Ngc1987 commented 2 years ago

Hi everyone, i try to make my documentation in my React Typescript project, and if i try to generate it with the @component plugin, i have this error:

Error: Command failed: NODE_ENV=development parcel build docs/entry.js --dist-dir docs/build
error: unknown option `--dist-dir'

You tell on the ReadMe to have parcel-bundler globally installed to do this, it's ok despite a lot of dependences are deprecated. To be sure, i install globally parcel 2.4, the last version who replace parcel-bundler, but the error is the same.

I show you the jsdoc config file and the script to generate the doc, but i think they are ok because without the component plugin it works. But i really want to have this .

{
    "tags": {
        "allowUnknownTags": "all"
    },
    "source": {
        "includePattern": ".+\\.ts(doc|x)?$",
        "excludePattern": "(^|\\/|\\\\)_"
    },
    "plugins": [
        "plugins/markdown",
        "category",
        "typescript",
        "component"
    ],
    "opts": {
        "encoding": "utf8",
        "destination": "docs/",
        "recurse": true,
        "verbose": true,
        "template": "../better-docs"
    },
    "templates": {
        "better-docs": {
            "name": "Sample Documentation"
        }
    }
}
{
   "jsdoc": "npx jsdoc ./src -r -c ./node_modules/better-docs/jsdoc.json"
}

And here the globally installed dependencies on my computer, who works on Linux Mint 20.3 Cinnamon, and the complete error:

root@Ngc1987-X705UVR:/home/ngc1987/Bureau/Dev/Websites/portfolio# npm list -g
/usr/lib
├── corepack@0.10.0
├── netlify-cli@9.3.0
├── npm@8.1.2
├── parcel-bundler@1.12.5
└── parcel@2.4.0

root@Ngc1987-X705UVR:/home/ngc1987/Bureau/Dev/Websites/portfolio# npm run jsdoc

> portfolio@0.1.0 jsdoc
> npx jsdoc ./src -r -c ./node_modules/better-docs/jsdoc.json

glob error [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] {
  errno: -13,
  code: 'EACCES',
  syscall: 'scandir',
  path: '/root/.npm/_logs'
}
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/App.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Alien/Alien.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/CheckBox/CheckBox.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/ContactForm/ContactForm.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/ContactLink/ContactLink.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/DesktopNav/DesktopNav.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Earth/Earth.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Experience/Experience.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Eye/Eye.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/FlyingAlien/FlyingAlien.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/HamburgerButton/HamburgerButton.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/HiAlien/HiAlien.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Loader/Loader.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/MobileNav/MobileNav.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/MobileTitle/MobileTitle.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/NameTitle/NameTitle.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Skill/Skill.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/Stars/Stars.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/StyledDiv/StyledDiv.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Components/WorkSample/WorkSample.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Datas/CvExperiencesDatas.ts ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Datas/WorkSampleDatas.ts ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Hooks/useMousePosition.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Hooks/usePathname.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Hooks/useWindowSize.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Pages/About/About.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Pages/CV/CV.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Pages/Contact/Contact.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Pages/Home/Home.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/Pages/MyWork/MyWork.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/global.d.ts ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/index.tsx ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/react-app-env.d.ts ...
Parsing /home/ngc1987/Bureau/Dev/Websites/portfolio/src/setupTests.ts ...
Generating output files...
Generating entry file for "components" plugin
Bundling components
running: NODE_ENV=development parcel build docs/entry.js --dist-dir docs/build
error: unknown option `--dist-dir'

/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/better-docs/bundler.js:91
    throw error
    ^

Error: Command failed: NODE_ENV=development parcel build docs/entry.js --dist-dir docs/build
error: unknown option `--dist-dir'

    at checkExecSyncError (node:child_process:826:11)
    at execSync (node:child_process:900:15)
    at bundle (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/better-docs/bundler.js:86:5)
    at Object.exports.publish (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/better-docs/publish.js:717:3)
    at Object.module.exports.cli.generateDocs (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/cli.js:441:39)
    at Object.module.exports.cli.processParseResults (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/cli.js:392:24)
    at module.exports.cli.main (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/cli.js:235:18)
    at Object.module.exports.cli.runCommand (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/cli.js:186:9)
    at /home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/jsdoc.js:93:9
    at Object.<anonymous> (/home/ngc1987/Bureau/Dev/Websites/portfolio/node_modules/jsdoc/jsdoc.js:94:3)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(35) [Uint8Array] [
      101, 114, 114, 111, 114,  58,  32, 117,
      110, 107, 110, 111, 119, 110,  32, 111,
      112, 116, 105, 111, 110,  32,  96,  45,
       45, 100, 105, 115, 116,  45, 100, 105,
      114,  39,  10
    ]
  ],
  pid: 6384,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(35) [Uint8Array] [
    101, 114, 114, 111, 114,  58,  32, 117,
    110, 107, 110, 111, 119, 110,  32, 111,
    112, 116, 105, 111, 110,  32,  96,  45,
     45, 100, 105, 115, 116,  45, 100, 105,
    114,  39,  10
  ]
}

I also give root permissions with sudo chown to install and access the parcel directories, but there is the same error.

tomgreco commented 2 years ago

Same issue.

@ariansobczak-rst any idea?

kostas2231 commented 2 years ago

found it they have to change Readme the package is no longer supported , remove parcel-bundler and run this yarn global add parcel it will install the latest version that works fine

Ngc1987 commented 2 years ago

Yes but first i think i have tried with only parcel-bundler, after only with parcel, and each time installed globally. Doesn't work for me, and now after some searchs on similar problems, i put on my linux computer a wrong command who take me the root control of my computer, so i need to reinstall because i just can't now delete one package. And i don't have time now, so i retry in a few days

tomgreco commented 2 years ago

Is anyone able to generate good documentation with this in a react-native / react project with typescript? I've tried and it always comes out horrible. Ended up abandoning this library because of it.

dziraf commented 2 years ago

We're using it internally to generate documentation (https://docs.adminjs.co) for AdminJS: https://github.com/SoftwareBrothers/adminjs-dev

kostas2231 commented 2 years ago

Is anyone able to generate good documentation with this in a react-native / react project with typescript? I've tried and it always comes out horrible. Ended up abandoning this library because of it.

have you found any alternative? I have the same problem as you. Whenever I try to create documentation for components stuff go horible...

tomgreco commented 2 years ago

have you found any alternative? I have the same problem as you. Whenever I try to create documentation for components stuff go horible...

Not yet, unfortunately.

Ngc1987 commented 2 years ago

I don't understand why it's so complicated to have a simple and clean documentation in React. Just hope next updates will help us to do it..