mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Migrations may resolve files in e.g. `blaze-out` and try to compute a path for the file that is "recognizable" across workers. E.g. in one worker, it may be the actual `.ts` file inside the source tree, while in the other, the file may be inside `blaze-out`. Tsurge currently expects project relative paths to be passed around. Those project relative paths are currently only based on the single root directory. Hence paths inside `blaze-out` would actually not be recognizable. The fix idea here is that we introduce a structure for Project files. This structure will contain two fields: - an ID of a file. This is similar to a module ID in the project. Those are resolved with respect to all root directories. This matches the conceptual virtual roots of `tsconfig#rootDirs`. The IDs can be used for matching files across workers, assuming those are executing using the same root directories, and handle the same overall project (e.g. google3). - a path relative to the primary project root. Multiple roots may be configured, but the primary project root, is the directory that contains all others. See: `tsconfig.rootDir`. This path is NOT necessarily useful for matching files between stages etc, but it's useful for writing replacements for a given file to disk. Note that those two things cannot be combind into one conceptual "project relative path" because a path relative to the most appropriate root directory cannot be used for safe replacements. E.g. consider a replacement matches a file from a root directory like `/sub/`. The path inside `/sub/` would then omit the `/sub/` and later on when writing replacements, we wouldn't know which root directory it actually was part of. Hence the concept of a "project root relative path" and the "ID". ds PR Close #57677 |
||
|---|---|---|
| .. | ||
| tslint | ||
| tsurge | ||
| typescript | ||
| BUILD.bazel | ||
| change_tracker.ts | ||
| extract_metadata.ts | ||
| line_mappings.ts | ||
| load_esm.ts | ||
| ng_component_template.ts | ||
| ng_decorators.ts | ||
| parse_html.ts | ||
| project_tsconfig_paths.ts | ||
| template_ast_visitor.ts | ||