Loading workspace insights... Statistics interval
7 days30 daysLatest CI Pipeline Executions
1a0b7420 fix(devkit): only rewrite deep-import paths in real import sites
The 23.0.0-beta.6 deep-import migration used a regex sweep to handle
non-named-import shapes (default / namespace / side-effect / require /
dynamic import / jest.mock-style calls). The sweep was too aggressive
and rewrote any `'@nx/devkit/src/...'` literal it found, including:
- Test fixtures inside template literals (mangled the migration's own
spec file as well as several plugin specs in nrwl/nx and downstream
repos).
- `typeof import('@nx/devkit/src/...')` type queries.
- Deep-import paths mentioned in comments.
- String-literal arguments to unrelated functions.
Replace the regex pass with a TypeScript-AST visitor that only rewrites
string-literal arguments to call expressions whose callee is `require`,
the dynamic-`import` keyword, or one of the `jest.*` / `vi.*` mock
helpers (`mock`, `unmock`, `doMock`, `dontMock`, `requireActual`,
`requireMock`, `importActual`, `importMock`). Type queries, template
literals, and comments are all naturally untouched because they aren't
`CallExpression` nodes. Quote style is preserved per literal.
Adds 10 new unit tests covering the previously-mangled cases and the
mock-helper rewrites. 1a0b7420 fix(devkit): only rewrite deep-import paths in real import sites
The 23.0.0-beta.6 deep-import migration used a regex sweep to handle
non-named-import shapes (default / namespace / side-effect / require /
dynamic import / jest.mock-style calls). The sweep was too aggressive
and rewrote any `'@nx/devkit/src/...'` literal it found, including:
- Test fixtures inside template literals (mangled the migration's own
spec file as well as several plugin specs in nrwl/nx and downstream
repos).
- `typeof import('@nx/devkit/src/...')` type queries.
- Deep-import paths mentioned in comments.
- String-literal arguments to unrelated functions.
Replace the regex pass with a TypeScript-AST visitor that only rewrites
string-literal arguments to call expressions whose callee is `require`,
the dynamic-`import` keyword, or one of the `jest.*` / `vi.*` mock
helpers (`mock`, `unmock`, `doMock`, `dontMock`, `requireActual`,
`requireMock`, `importActual`, `importMock`). Type queries, template
literals, and comments are all naturally untouched because they aren't
`CallExpression` nodes. Quote style is preserved per literal.
Adds 10 new unit tests covering the previously-mangled cases and the
mock-helper rewrites.