{"_id":"remark-mdx-react-docgen-typescript","_rev":"3-b4598a9d926b58d135f08bda4e4295db","name":"remark-mdx-react-docgen-typescript","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"remark-mdx-react-docgen-typescript","version":"0.1.0","description":"remark plugin to support react-docgen-typescript in MDX","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Rippling/remark-mdx-react-docgen-typescript.git"},"bugs":{"url":"https://github.com/Rippling/remark-mdx-react-docgen-typescript/issues"},"author":{"name":"Divyansh Kumar","email":"mr.divyanshindore@gmail.com"},"keywords":["markdown","react-docgen-typescript","mdast","plugin","remark","remark-plugin","unified"],"engines":{"node":">=16"},"sideEffects":false,"exports":"./dist/index.js","scripts":{"build":"npm run clean && tsc","clean":"rimraf dist","format":"prettier --write .","prebuild":"npm run clean","release":"standard-version","test":"npm run build && vitest","watch":"npm run build -- --watch"},"dependencies":{"esast-util-from-js":"^2.0.1","mdast":"^3.0.0","mdast-util-mdx-jsx":"^3.0.0","react-docgen-typescript":"^2.2.2","unist-util-visit":"^5.0.0"},"devDependencies":{"@mdx-js/mdx":"^3.0.0","@types/node":"^20.11.5","eslint":"^8.56.0","mdast-util-directive":"^3.0.0","prettier":"^3.2.4","react":"^18.2.0","remark-cli":"^12.0.0","remark-directive":"^3.0.0","rimraf":"^5.0.5","typescript":"^5.3.3","vfile":"^6.0.1","vitest":"^1.2.2"},"gitHead":"dbc77bd55765aaae9864a890bed7130d857a174c","homepage":"https://github.com/Rippling/remark-mdx-react-docgen-typescript#readme","_id":"remark-mdx-react-docgen-typescript@0.1.0","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-a++CEZZkd36HgzR/wKz01pEf9aZrR4e9PtaTUWEG2lpp4nJCScnay2917YWDEih9GD7opTBNthyfpXdXbQgpng==","shasum":"0f4f371d699d05e123570dc413b75f66d9de182e","tarball":"https://registry.npmjs.org/remark-mdx-react-docgen-typescript/-/remark-mdx-react-docgen-typescript-0.1.0.tgz","fileCount":7,"unpackedSize":24746,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLvp2LHNLeaLIu7GhCz4cz4B/ya3ET2X7oNLwGhcUVjAiBc6oEcg4PUM4iZ74gOhcJnKVSSIDUzQb8XWTLwSmqnVQ=="}]},"_npmUser":{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},"directories":{},"maintainers":[{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-mdx-react-docgen-typescript_0.1.0_1706419077801_0.5658701883392934"},"_hasShrinkwrap":false},"1.0.0":{"name":"remark-mdx-react-docgen-typescript","version":"1.0.0","description":"remark plugin to support react-docgen-typescript in MDX","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Rippling/remark-mdx-react-docgen-typescript.git"},"bugs":{"url":"https://github.com/Rippling/remark-mdx-react-docgen-typescript/issues"},"author":{"name":"Divyansh Kumar","email":"mr.divyanshindore@gmail.com"},"keywords":["markdown","react-docgen-typescript","mdast","plugin","remark","remark-plugin","unified"],"engines":{"node":">=16"},"sideEffects":false,"exports":"./dist/index.js","scripts":{"build":"npm run clean && tsc","clean":"rimraf dist","format":"prettier --write .","prebuild":"npm run clean","prepublishOnly":"npm run build","release":"standard-version","test":"npm run build && vitest","watch":"npm run build -- --watch"},"dependencies":{"esast-util-from-js":"^2.0.1","mdast":"^3.0.0","mdast-util-mdx-jsx":"^3.0.0","react-docgen-typescript":"^2.2.2","unist-util-visit":"^5.0.0"},"devDependencies":{"@mdx-js/mdx":"^3.0.0","@types/node":"^20.11.5","eslint":"^8.56.0","mdast-util-directive":"^3.0.0","prettier":"^3.2.4","react":"^18.2.0","remark-cli":"^12.0.0","remark-directive":"^3.0.0","rimraf":"^5.0.5","typescript":"^5.3.3","vfile":"^6.0.1","vitest":"^1.2.2"},"gitHead":"20896170c1a080c25182747a62480b33e82ff514","homepage":"https://github.com/Rippling/remark-mdx-react-docgen-typescript#readme","_id":"remark-mdx-react-docgen-typescript@1.0.0","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-jCjoSYU1ZHzu5mCDwLS94Ksi4CRcpms+9SznijXQMRxJc03/Aick8hgtle1U4wStogCpISFGvx/i07p14h64/w==","shasum":"ea54b3a3b9ec73ee83e87c4bcb97951b13b5e406","tarball":"https://registry.npmjs.org/remark-mdx-react-docgen-typescript/-/remark-mdx-react-docgen-typescript-1.0.0.tgz","fileCount":7,"unpackedSize":24829,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDFP1zo5fJ11TU9zItybDjSz5utsUUD9XvUj3BxG+XYNAiA5nOS6WIHIVTjl6DEzoQ9Kt2nASrxbRol56zJTgVIuWw=="}]},"_npmUser":{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},"directories":{},"maintainers":[{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},{"name":"divyansh_rippling","email":"divyansh@rippling.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-mdx-react-docgen-typescript_1.0.0_1709719604303_0.7320992205283445"},"_hasShrinkwrap":false},"1.0.1":{"name":"remark-mdx-react-docgen-typescript","version":"1.0.1","description":"remark plugin to support react-docgen-typescript in MDX","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/Rippling/remark-mdx-react-docgen-typescript.git"},"bugs":{"url":"https://github.com/Rippling/remark-mdx-react-docgen-typescript/issues"},"author":{"name":"Divyansh Kumar","email":"mr.divyanshindore@gmail.com"},"keywords":["markdown","react-docgen-typescript","mdast","plugin","remark","remark-plugin","unified"],"engines":{"node":">=16"},"sideEffects":false,"main":"./dist/index.js","type":"commonjs","scripts":{"build":"vite build","prebuild":"npm run clean && npm run lint:fix && tsc","clean":"rimraf dist","format":"prettier --write .","lint":"eslint --ext .ts .","lint:fix":"eslint --ext .ts . --fix","prepublishOnly":"npm run build","test":"npm run build && vitest"},"dependencies":{"esast-util-from-js":"^2.0.1","mdast":"^3.0.0","mdast-util-mdx-jsx":"^3.0.0","react-docgen-typescript":"^2.2.2","unist-util-visit":"^5.0.0"},"devDependencies":{"@mdx-js/mdx":"^3.0.0","@types/node":"^20.11.5","@typescript-eslint/eslint-plugin":"^7.2.0","@typescript-eslint/parser":"^7.2.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","mdast-util-directive":"^3.0.0","prettier":"3.2.4","react":"^18.2.0","remark-cli":"^12.0.0","remark-directive":"^3.0.0","rimraf":"^5.0.5","typescript":"^5.3.3","vfile":"^6.0.1","vite":"^5.1.6","vite-plugin-dts":"^3.7.3","vitest":"^1.2.2"},"types":"./dist/index.d.ts","gitHead":"f0ba687f78048c61e33482b9ad2f13fcaf1c32cb","homepage":"https://github.com/Rippling/remark-mdx-react-docgen-typescript#readme","_id":"remark-mdx-react-docgen-typescript@1.0.1","_nodeVersion":"18.7.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-7pCrcN1U7RclNqx0M3YYOyCHAvQl3X4myjUuY9xuOrrVQSiDI+V2HlaPTl9COdXV+XFZDMc7Ha9PDXl3KA0PTQ==","shasum":"c568d92c36c198c73c98223a25d94b2689cb611c","tarball":"https://registry.npmjs.org/remark-mdx-react-docgen-typescript/-/remark-mdx-react-docgen-typescript-1.0.1.tgz","fileCount":7,"unpackedSize":28771,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDL1KprFas92Cef4Uy1XTQ6L5YLbsd4L+N0sNkF/22IWAiBk03GCqrDqCNoFMDcZ2TBMy6YChwIN2GoY9tjDbAq6eA=="}]},"_npmUser":{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},"directories":{},"maintainers":[{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},{"name":"divyansh_rippling","email":"divyansh@rippling.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-mdx-react-docgen-typescript_1.0.1_1710427597097_0.8021303925103922"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-28T05:17:57.696Z","0.1.0":"2024-01-28T05:17:57.973Z","modified":"2024-03-14T14:46:37.640Z","1.0.0":"2024-03-06T10:06:44.529Z","1.0.1":"2024-03-14T14:46:37.230Z"},"maintainers":[{"name":"mrdivyansh","email":"mr.divyanshindore@gmail.com"},{"name":"divyansh_rippling","email":"divyansh@rippling.com"}],"description":"remark plugin to support react-docgen-typescript in MDX","homepage":"https://github.com/Rippling/remark-mdx-react-docgen-typescript#readme","keywords":["markdown","react-docgen-typescript","mdast","plugin","remark","remark-plugin","unified"],"repository":{"type":"git","url":"git+https://github.com/Rippling/remark-mdx-react-docgen-typescript.git"},"author":{"name":"Divyansh Kumar","email":"mr.divyanshindore@gmail.com"},"bugs":{"url":"https://github.com/Rippling/remark-mdx-react-docgen-typescript/issues"},"license":"Apache-2.0","readme":"# `remark-mdx-react-docgen-typescript`\n\n📝 A mdx plugin to extract a react component documentation using `react-docgen-typescript`\n\n[![npm version](https://badge.fury.io/js/remark-mdx-react-docgen-typescript.svg)](https://badge.fury.io/js/remark-mdx-react-docgen-typescript)\n\n## Installation\n\n```sh\nnpm install -D remark-directive remark-mdx-react-docgen-typescript\n```\n\n## Setup\n\n```js\nimport remarkReactDocgen from 'remark-mdx-react-docgen-typescript';\n// or\n// const remarkReactDocgen = require('remark-mdx-react-docgen-typescript').default;\n```\n\nSee [**Using plugins**](https://github.com/remarkjs/remark/blob/master/doc/plugins.md#using-plugins) for more instructions in the official documentation.\n\n## Usage\n\nFor example, given a file named example.mdx with the following contents:\n\n```md\n::component-docs{file=\"./Component.tsx\"}\n```\n\nThe following script:\n\n```js\nimport { readFile } from 'node:fs/promises';\n\nimport { compile } from '@mdx-js/mdx';\nimport remarkDirective from 'remark-directive';\nimport remarkReactDocgen from 'remark-mdx-react-docgen-typescript';\n\nconst { contents } = await compile(await readFile('example.mdx'), {\n  jsx: true,\n  remarkPlugins: [remarkDirective, remarkReactDocgen],\n});\nconsole.log(contents);\n```\n\nRoughly yields:\n\n```jsx\nexport default function MDXContent() {\n  return <ComponentDocs\n    propsData={[{\n      \"tags\": {},\n      \"filePath\": \"${cwd}/__fixtures__/Component.tsx\",\n      \"description\": \"\",\n      \"displayName\": \"Component\",\n      \"methods\": [],\n      \"props\": {...}\n      ...\n    }]}\n  />\n}\n```\n\nYou may use `@mdx-js/react` to define the component for `ComponentDocs` tag name:\n\n```jsx\nimport { MDXProvider } from '@mdx-js/react';\nimport ComponentDocs from './ComponentDocs';\n// ^-- Assumes an integration is used to compile MDX to JS, such as\n// `@mdx-js/esbuild`, `@mdx-js/loader`, `@mdx-js/node-loader`, or\n// `@mdx-js/rollup`, and that it is configured with\n// `options.providerImportSource: '@mdx-js/react'`.\n\n/** @type {import('mdx/types.js').MDXComponents} */\nconst components = {\n  ComponentDocs,\n};\n\nconsole.log(\n  <MDXProvider components={components}>\n    <Post />\n  </MDXProvider>\n);\n```\n\nThe file path is relative to the markdown file path. You can use `<rootDir>` at the start of the path to import files relatively from the rootDir:\n\n```md\n::component-docs{file=\"<rootDir>/Component.tsx\"}\n```\n\nYou may also specify additional attributes that will be forwarded as props to ComponentDocs component:\n\n```md\n::component-docs{file=\"./Component.tsx\" extraProp=\"value\"}\n```\n\n## Options\n\n- `componentName: string`: The name of tag/component this plugin will use in JSX. Defaults to `ComponentDocs`.\n- `directiveName: string`: The directive name. Defaults to `component-docs`.\n- `fileAttributeName: string`: The attribute name for file path. Defaults to `file`.\n- `rootDir: string`: Change what `<rootDir>` refers to. Defaults to `process.cwd()`.\n- `reactDocGenOptions: object`: Options for [`react-docgen-typescript`](https://github.com/styleguidist/react-docgen-typescript?tab=readme-ov-file#options).\n\n## Testing\n\nAfter installing dependencies with `npm install`, the tests can be run with: `npm test`\n\n## License\n\nRippling People Center Inc.\n[Apache 2.0](LICENSE)\n","readmeFilename":"README.md"}