mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[docs-utils] remove extra api_docs dir (#148658)
In order to avoid searching the `api_docs` directory at the root of the repo in VSCode we have to exclude all api_docs dirs from search, so instead of putting the source of the code that generates the api_docs in a similarly named dir this just removes that wrapper.
This commit is contained in:
parent
d2cb4bb4f7
commit
52d235ae49
72 changed files with 151 additions and 150 deletions
|
@ -171,7 +171,7 @@ There are three great ways to debug issues with the API infrastructure.
|
|||
|
||||
1. Write a test
|
||||
|
||||
[api_doc_suite.test.ts](https://github.com/elastic/kibana/blob/main/packages/kbn-docs-utils/src/api_docs/tests/api_doc_suite.test.ts) is a pretty comprehensive test suite that builds the test docs inside the [**fixtures** folder](https://github.com/elastic/kibana/tree/main/packages/kbn-docs-utils/src/api_docs/tests/__fixtures__/src).
|
||||
[api_doc_suite.test.ts](https://github.com/elastic/kibana/blob/main/packages/kbn-docs-utils/src/tests/api_doc_suite.test.ts) is a pretty comprehensive test suite that builds the test docs inside the [**fixtures** folder](https://github.com/elastic/kibana/tree/main/packages/kbn-docs-utils/src/tests/__fixtures__/src).
|
||||
|
||||
Edit the code inside `__fixtures__` to replicate the bug, write a test to track what should happen, then run `yarn jest api_doc_suite`.
|
||||
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
export { runBuildApiDocsCli } from './src/api_docs';
|
||||
export { runBuildApiDocsCli } from './src';
|
||||
|
|
|
@ -135,7 +135,7 @@ it('test full file imports with a matching plugin', () => {
|
|||
"pluginId": "pluginA",
|
||||
"scope": "public",
|
||||
"section": undefined,
|
||||
"text": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a/public/foo/index",
|
||||
"text": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/public/foo/index",
|
||||
},
|
||||
" something",
|
||||
]
|
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@
|
|||
"signature": [
|
||||
"() => void"
|
||||
],
|
||||
"path": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a/public/foo/index.ts",
|
||||
"path": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/public/foo/index.ts",
|
||||
"deprecated": false,
|
||||
"trackAdoption": false,
|
||||
"children": [],
|
||||
|
@ -34,7 +34,7 @@
|
|||
"signature": [
|
||||
"() => \"foo\""
|
||||
],
|
||||
"path": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a/public/foo/index.ts",
|
||||
"path": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/public/foo/index.ts",
|
||||
"deprecated": false,
|
||||
"trackAdoption": false,
|
||||
"returnComment": [],
|
||||
|
@ -68,7 +68,7 @@
|
|||
"signature": [
|
||||
"\"COMMON VAR!\""
|
||||
],
|
||||
"path": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a/common/foo/index.ts",
|
||||
"path": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/common/foo/index.ts",
|
||||
"deprecated": false,
|
||||
"trackAdoption": false,
|
||||
"initialIsOpen": false
|
||||
|
@ -76,4 +76,4 @@
|
|||
],
|
||||
"objects": []
|
||||
}
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@
|
|||
},
|
||||
"<any>"
|
||||
],
|
||||
"path": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_b/public/index.ts",
|
||||
"path": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_b/public/index.ts",
|
||||
"deprecated": false,
|
||||
"trackAdoption": false,
|
||||
"children": [
|
||||
|
@ -50,7 +50,7 @@
|
|||
},
|
||||
"<any>"
|
||||
],
|
||||
"path": "packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_b/public/index.ts",
|
||||
"path": "packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_b/public/index.ts",
|
||||
"deprecated": false,
|
||||
"trackAdoption": false,
|
||||
"isRequired": true
|
||||
|
@ -81,4 +81,4 @@
|
|||
"misc": [],
|
||||
"objects": []
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
import { ToolingLog } from '@kbn/tooling-log';
|
||||
import Path from 'path';
|
||||
import { Project } from 'ts-morph';
|
||||
import { REPO_ROOT } from '@kbn/repo-info';
|
||||
import { findPlugins } from './find_plugins';
|
||||
import { getPluginApi } from './get_plugin_api';
|
||||
import { getKibanaPlatformPlugin } from './integration_tests/kibana_platform_plugin_mock';
|
||||
|
@ -26,7 +27,7 @@ it('getFileName', () => {
|
|||
|
||||
it('test getPluginForPath', () => {
|
||||
const plugins = findPlugins();
|
||||
const path = Path.resolve(__dirname, '../../../../src/plugins/embeddable/public/service/file.ts');
|
||||
const path = Path.resolve(REPO_ROOT, 'src/plugins/embeddable/public/service/file.ts');
|
||||
expect(getPluginForPath(path, plugins)).toBeDefined();
|
||||
});
|
||||
|
||||
|
@ -53,8 +54,8 @@ it('test getServiceForPath', () => {
|
|||
|
||||
expect(
|
||||
getServiceForPath(
|
||||
'/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a/public/foo/index',
|
||||
'/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/plugin_a'
|
||||
'/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a/public/foo/index',
|
||||
'/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/plugin_a'
|
||||
)
|
||||
).toBe('foo');
|
||||
});
|
|
@ -12,7 +12,7 @@ export const TS_PROJECTS = TsProject.loadAll({
|
|||
/** Array of repo-relative paths to projects which should be ignored and not treated as a TS project in the repo */
|
||||
ignore: [
|
||||
'x-pack/plugins/apm/scripts/optimize_tsconfig/tsconfig.json',
|
||||
'packages/kbn-docs-utils/src/api_docs/integration_tests/__fixtures__/src/**/*',
|
||||
'packages/kbn-docs-utils/src/integration_tests/__fixtures__/src/**/*',
|
||||
],
|
||||
|
||||
/** Array of repo-relative paths to projects which should have their type-check disabled */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue