* Generate core API docs from TSDoc comments Uses api-extractor and api-documenter to generate documentation for the Kibana core API from TSDoc comments in the source code. Documentation can be generated using `npm run docs:api`. I used --no-verify to ignore the following pre-commit hook errors: 1. Filenames MUST use snake_case - api-extractor.json It's possible to specify a different config file, but I prefer to keep the "standard" config file name. 2. UNHANDLED ERROR: Unable to find tsconfig.json file selecting "common/core_api_review/kibana.api.ts". Ensure one exists and it is listed in "src/dev/typescript/projects.ts" This is not a source file, so safe to ignore. * Flesh out API docs a little bit * Ignore snake_case check for api-extractor.json * Ignore api-extractor's review file from pre-commit check * Try to fix build failing by using masters yarn.lock * I'm being stupid * Found a better home for ignoring common/core_api_review/kibana.api.ts * Node script for detecting core API changes I initially wanted to include this as a precommit hook, but it takes quite long to execute (~12s) so might be better suited as a test or as part of the release process. The script currently fails because api-extractor uses an older version of typescript. * Fix tslint precommit hook ignore condition * Write tsdoc-metadata.json into ./build * Add LogMeta and ElasticSearch to exported types & docs * Suppress logging when running api-extractor from script * Improve check_core_api_changes script and run as test * Inline api-extractor.json config * Fix check_core_api_changes --help flag * LogMeta TSDoc comments * check_core_api_changes: fail if api-extractor produces warnings or errors And print more useful messages to the console * Move ignored ts files list into dev/file * Add back build:types since api-exporter cannot operate on source files * Upgrade api-exporter/documenter * api-extractor: independantly analyze core/public and core/server Becasue of https://github.com/Microsoft/web-build-tools/issues/1029 api-extractor can't use core/index.ts as a single entry point for analyzing the public and server API's as isolated namespaces. Instead we analyze these projects separately. This introduces other problems like the api review files and documentation always being called "kibana." from the package.json filename. * Build types as part of build task * Include types in typescript browser compilation * Force inclusion of core/public for building types * Fix api review filename in api-exporter errors * Update docs and API review files * Fix api-extractor warnings * Remove ts file ignored list since it's no longer necessary * Rename exported api package name * Review comments * Export other missing types * Upgrade api-documenter to latest beta * Export more missing types * Fix warnings and add api-exporter to Jenkins tests * Correctly handle runBuildTypes() exceptions * Fix another swallowed exception * Fix api-extractor warnings after master merge
74 lines
2.8 KiB
JSON
74 lines
2.8 KiB
JSON
{
|
|
"compilerOptions": {
|
|
"baseUrl": ".",
|
|
"paths": {
|
|
// Allows for importing from `kibana` package for the exported types.
|
|
"kibana": ["./kibana"],
|
|
"kibana/public": ["src/core/public"],
|
|
"kibana/server": ["src/core/server"],
|
|
"ui/*": [
|
|
"src/legacy/ui/public/*"
|
|
],
|
|
"test_utils/*": [
|
|
"src/test_utils/public/*"
|
|
]
|
|
},
|
|
// Support .tsx files and transform JSX into calls to React.createElement
|
|
"jsx": "react",
|
|
// Enables all strict type checking options.
|
|
"strict": true,
|
|
// enables "core language features"
|
|
"lib": [
|
|
// ESNext auto includes previous versions all the way back to es5
|
|
"esnext",
|
|
// includes support for browser APIs
|
|
"dom"
|
|
],
|
|
// Node 8 should support everything output by esnext, we override this
|
|
// in webpack with loader-level compiler options
|
|
"target": "esnext",
|
|
// Use commonjs for node, overridden in webpack to keep import statements
|
|
// to maintain support for things like `await import()`
|
|
"module": "commonjs",
|
|
// Allows default imports from modules with no default export. This does not affect code emit, just type checking.
|
|
// We have to enable this option explicitly since `esModuleInterop` doesn't enable it automatically when ES2015 or
|
|
// ESNext module format is used.
|
|
"allowSyntheticDefaultImports": true,
|
|
// Emits __importStar and __importDefault helpers for runtime babel ecosystem compatibility.
|
|
"esModuleInterop": true,
|
|
// Resolve modules in the same way as Node.js. Aka make `require` works the
|
|
// same in TypeScript as it does in Node.js.
|
|
"moduleResolution": "node",
|
|
// Disallow inconsistently-cased references to the same file.
|
|
"forceConsistentCasingInFileNames": true,
|
|
// Disable the breaking keyof behaviour introduced in TS 2.9.2 until EUI is updated to support that too
|
|
"keyofStringsOnly": true,
|
|
// Forbid unused local variables as the rule was deprecated by ts-lint
|
|
"noUnusedLocals": true,
|
|
// Provide full support for iterables in for..of, spread and destructuring when targeting ES5 or ES3.
|
|
"downlevelIteration": true,
|
|
// import tslib helpers rather than inlining helpers for iteration or spreading, for instance
|
|
"importHelpers": true,
|
|
// adding global typings
|
|
"types": [
|
|
"node",
|
|
"jest",
|
|
"react"
|
|
]
|
|
},
|
|
"include": [
|
|
"kibana.d.ts",
|
|
"src/**/*",
|
|
"typings/**/*",
|
|
"test_utils/**/*"
|
|
],
|
|
"exclude": [
|
|
"src/**/__fixtures__/**/*"
|
|
// In the build we actually exclude **/public/**/* from this config so that
|
|
// we can run the TSC on both this and the .browser version of this config
|
|
// file, but if we did it during development IDEs would not be able to find
|
|
// the tsconfig.json file for public files correctly.
|
|
// "src/**/public/**/*"
|
|
]
|
|
}
|