{"name":"@microsoft/tsdoc-config","version":"0.17.1","description":"A loader for the tsdoc.json file","keywords":["TypeScript","documentation","doc","comments","JSDoc","parser","standard"],"repository":{"type":"git","url":"git+https://github.com/microsoft/tsdoc.git","directory":"tsdoc-config"},"homepage":"https://tsdoc.org/","main":"lib/index.js","typings":"lib/index.d.ts","license":"MIT","dependencies":{"ajv":"~8.12.0","jju":"~1.4.0","resolve":"~1.22.2","@microsoft/tsdoc":"0.15.1"},"devDependencies":{"@rushstack/heft-node-rig":"~2.6.11","@rushstack/heft":"^0.66.13","@types/heft-jest":"1.0.3","@types/jju":"1.4.2","@types/node":"14.18.36","@types/resolve":"1.20.2","eslint":"~8.57.0","eslint-plugin-header":"~3.1.1"},"scripts":{"build":"heft test --clean","watch":"heft test --clean --watch","_phase:build":"heft run --only build -- --clean","_phase:test":"heft run --only test -- --clean"},"_id":"@microsoft/tsdoc-config@0.17.1","gitHead":"03554206c58a127e845e978d194199b2277090d0","bugs":{"url":"https://github.com/microsoft/tsdoc/issues"},"_integrity":"sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==","_resolved":"/tmp/cfcce7f55d934ebe22a11fda19c2ef8a/microsoft-tsdoc-config-0.17.1.tgz","_from":"file:microsoft-tsdoc-config-0.17.1.tgz","_nodeVersion":"18.20.5","_npmVersion":"10.8.2","dist":{"integrity":"sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==","shasum":"e0f0b50628f4ad7fe121ca616beacfe6a25b9335","tarball":"http://registry-npm.ywwl.com/@microsoft/tsdoc-config/download/@microsoft/tsdoc-config-0.17.1.tgz","fileCount":72,"unpackedSize":166638,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClRoW8Nk3tFBRu/mZeYtQpNlt7tyrHBxXsZApxCbK47wIhAIKphnzJ4Lwwznw+oKIcSCmTQLrlOyzMrM5AC+jiS2Cn"}],"size":32864,"noattachment":false,"key":"/@microsoft/tsdoc-config/-/@microsoft/tsdoc-config-0.17.1.tgz"},"_npmUser":{"name":"odspnpm","email":"odspnpm@microsoft.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tsdoc-config_0.17.1_1732321430880_0.4942291329313431"},"_hasShrinkwrap":false,"readme":"# @microsoft/tsdoc-config\r\n\r\n**TSDoc** is a proposal to standardize the doc comments used in [TypeScript](http://www.typescriptlang.org/)\r\nsource files.  The main package [`@microsoft/tsdoc`](https://www.npmjs.com/package/@microsoft/tsdoc) implements\r\nthe TSDoc parser.  The `@microsoft/tsdoc-config` package is an optional add-on for loading the **tsdoc.json**\r\nfile format that enables users to define custom TSDoc tags.  (This functionality was moved to its own package\r\nbecause it requires external dependencies such as NodeJS and `ajv`, whereas the main package is fully self-contained.)\r\n\r\nFor more information about TSDoc, please visit the project website:\r\n\r\nhttps://tsdoc.org\r\n\r\n\r\n## Creating config files\r\n\r\nThe **tsdoc.json** file is optional.  When used, it is expected to be found in the same folder as\r\nthe **tsconfig.json** file for a project.  The loader looks for it by walking upwards in the directory tree\r\nuntil it finds a folder containing **tsconfig.json** or **package.json**, and then it attempts to load\r\n**tsdoc.json** from that location.\r\n\r\nThe **tsdoc.json** file conforms to the [tsdoc.schema.json](\r\nhttps://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json) JSON schema.  It defines tags using\r\nsimilar fields as the\r\n[TSDocTagDefinition](https://github.com/microsoft/tsdoc/blob/main/tsdoc/src/configuration/TSDocTagDefinition.ts)\r\nAPI used by `TSDocParser` from `@microsoft/tsdoc`.\r\n\r\nHere's a simple example:\r\n\r\n**tsdoc.json**\r\n```js\r\n{\r\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json\",\r\n  \"tagDefinitions\": [\r\n    {\r\n      \"tagName\": \"@myTag\",\r\n      \"syntaxKind\": \"modifier\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nIf you want to define custom tags in one place and share them across multiple projects, the `extends` field specifies\r\na list of paths that will be mixed in with the current file:\r\n\r\n**tsdoc.json**\r\n```js\r\n{\r\n  \"$schema\": \"https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json\",\r\n  \"extends\": [\r\n    \"my-package/dist/tsdoc-base.json\",\r\n    \"./path/to/local/file/tsdoc-local.json\"\r\n  ]\r\n}\r\n```\r\n\r\n> NOTE: The `extends` paths are resolved using NodeJS module resolution, so local paths must begin with `./` to avoid\r\n> being interpreted as an NPM package name.\r\n\r\n\r\n## API Usage\r\n\r\nThe code sample below illustrates how to invoke the `@microsoft/tsdoc-config` API to load a\r\n**tsdoc.json** file:\r\n\r\n```ts\r\nimport * as path from 'path';\r\nimport { TSDocParser, TSDocConfiguration } from '@microsoft/tsdoc';\r\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\r\n\r\n// Sample source file to be parsed\r\nconst mySourceFile: string = 'my-project/src/example.ts';\r\n\r\n// Load the nearest config file, for example `my-project/tsdoc.json`\r\nconst tsdocConfigFile: TSDocConfigFile = TSDocConfigFile.loadForFolder(path.dirname(mySourceFile));\r\nif (tsdocConfigFile.hasErrors) {\r\n  // Report any errors\r\n  console.log(tsdocConfigFile.getErrorSummary());\r\n}\r\n\r\n// Use the TSDocConfigFile to configure the parser\r\nconst tsdocConfiguration: TSDocConfiguration = new TSDocConfiguration();\r\ntsdocConfigFile.configureParser(tsdocConfiguration);\r\nconst tsdocParser: TSDocParser = new TSDocParser(tsdocConfiguration);\r\n```\r\n\r\n","publish_time":1732321431124,"maintainers":[{"name":"microsoft1es","email":"npmjs@microsoft.com"},{"name":"odspnpm","email":"odspnpm@microsoft.com"}],"_cnpm_publish_time":1732321431124,"dist-tags":{"latest":"0.18.3"}}