Skip to content

Commit

Permalink
back to unordered list. asciidoctor fails validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Oct 5, 2020
1 parent abbe6eb commit 6efc968
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/developer/best-practices/typescript.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Since `tsc` doesn't support circular project references, the migration order doe

[discrete]
==== Implementation
1. Make sure all the plugins listed as dependencies in `kibana.json` file have migrated to TS project references.
1. Add `tsconfig.json` in the root folder of your plugin.
- Make sure all the plugins listed as dependencies in `kibana.json` file have migrated to TS project references.
- Add `tsconfig.json` in the root folder of your plugin.
[source,json]
----
{
Expand All @@ -54,11 +54,11 @@ Since `tsc` doesn't support circular project references, the migration order doe
}
----
If your plugin imports a file not listed in `include`, the build will fail with the next message `File ‘…’ is not listed within the file list of project …’. Projects must list all files or use an 'include' pattern.`
[start=3]
1. Build you plugin `./node_modules/.bin/tsc -b src/plugins/my_plugin`. Fix errors if `tsc` cannot generate type declarations for your project.
1. Add your project reference to `references` property of `tsconfig.refs.json`
1. Add your plugin to `references` property and plugin folder to `exclude` property of the `tsconfig.json` it used to belong to (for example, for `src/plugins/**` it's `tsconfig.json`; for `x-pack/plugins/**` it’s `x-pack/tsconfig.json`).
1. List the reference to your newly created project in all the Kibana `tsconfig.json` files that could import your project: `tsconfig.json`, `test/tsconfig.json`, `x-pack/tsconfig.json`, `x-pack/test/tsconfig.json`. And in all the plugin-specific `tsconfig.refs.json` for dependent plugins.
1. You can measure how your changes affect `tsc` compiler performance with `node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit`. Compare with `master` branch.

- Build you plugin `./node_modules/.bin/tsc -b src/plugins/my_plugin`. Fix errors if `tsc` cannot generate type declarations for your project.
- Add your project reference to `references` property of `tsconfig.refs.json`
- Add your plugin to `references` property and plugin folder to `exclude` property of the `tsconfig.json` it used to belong to (for example, for `src/plugins/**` it's `tsconfig.json`; for `x-pack/plugins/**` it’s `x-pack/tsconfig.json`).
- List the reference to your newly created project in all the Kibana `tsconfig.json` files that could import your project: `tsconfig.json`, `test/tsconfig.json`, `x-pack/tsconfig.json`, `x-pack/test/tsconfig.json`. And in all the plugin-specific `tsconfig.refs.json` for dependent plugins.
- You can measure how your changes affect `tsc` compiler performance with `node --max-old-space-size=4096 ./node_modules/.bin/tsc -p tsconfig.json --extendedDiagnostics --noEmit`. Compare with `master` branch.

You can use https://github.com/elastic/kibana/pull/79446 as an example.

0 comments on commit 6efc968

Please sign in to comment.