Skip to content

[8.16] [CI] Only emit .d.ts when running typecheck (#209259)#215308

Merged
delanni merged 1 commit intoelastic:8.16from
delanni:backport/8.16/pr-209259
Mar 21, 2025
Merged

[8.16] [CI] Only emit .d.ts when running typecheck (#209259)#215308
delanni merged 1 commit intoelastic:8.16from
delanni:backport/8.16/pr-209259

Conversation

@delanni
Copy link
Contributor

@delanni delanni commented Mar 20, 2025

Backport

This will backport the following commits from main to 8.16:

Questions ?

Please refer to the Backport tool documentation

## 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
```

(cherry picked from commit 702c9c4)

# Conflicts:
#	packages/kbn-dependency-usage/src/lib/group_by_owners.ts
@delanni delanni requested a review from kibanamachine as a code owner March 20, 2025 10:59
@delanni delanni added the backport This PR is a backport of another PR label Mar 20, 2025
@delanni delanni enabled auto-merge (squash) March 20, 2025 10:59
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

@delanni delanni disabled auto-merge March 21, 2025 12:29
@delanni delanni merged commit 17b5860 into elastic:8.16 Mar 21, 2025
11 checks passed
@delanni
Copy link
Contributor Author

delanni commented Mar 21, 2025

admin-merging because it's a backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants