mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[CI] Only emit .d.ts when running typecheck (#209259)
## Summary Stop emitting any `.js` files during typechecking. We only depend on the declarations, not the emitted, compiled javascript files. An added benefit, is making some bad import errors more obvious. We'll no longer try to build javascript files in place if a poor import/require is made, rather the error of importing outside projects (in the forest of a bunch of errors possibly) will be visible in the typescript logs: ``` # instead of: proc [tsc] error TS5055: Cannot write file '/opt/buildkite-agent/builds/bk-agent-prod-gcp-1741789017236110254/elastic/kibana-pull-request/kibana/src/platform/packages/shared/kbn-babel-register/cache/no_cache_cache.js' because it would overwrite input file. # we'll see: ... several others like this proc [tsc] src/platform/packages/shared/kbn-grok-ui/scripts/generate_patterns.js:10:9 - error TS6307: File '/Users/alex/Git/elastic-kibana/src/setup_node_env/index.js' is not listed within the file list of project '/Users/alex/Git/elastic-kibana/src/platform/packages/shared/kbn-grok-ui/tsconfig.type_check.json'. Projects must list all files or use an 'include' pattern. proc [tsc] proc [tsc] 10 require('../../../../../setup_node_env'); ... several others like this ```
This commit is contained in:
parent
53970f276c
commit
702c9c49dc
2 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,7 @@
|
|||
|
||||
import { getCodeOwnersForFile, getPathsWithOwnersReversed } from './code_owners.ts';
|
||||
|
||||
interface DependencyByOwnerEntry<T = string[]> {
|
||||
export interface DependencyByOwnerEntry<T = string[]> {
|
||||
modules: T;
|
||||
deps: T;
|
||||
teams: T;
|
||||
|
|
|
@ -47,6 +47,8 @@ async function createTypeCheckConfigs(log: SomeDevLog, projects: TsProject[]) {
|
|||
...config.compilerOptions,
|
||||
composite: true,
|
||||
rootDir: '.',
|
||||
noEmit: false,
|
||||
emitDeclarationOnly: true,
|
||||
paths: project.repoRel === 'tsconfig.base.json' ? config.compilerOptions?.paths : undefined,
|
||||
},
|
||||
kbn_references: undefined,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue