Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): normalize project config paths to properly match them when combining them #15149

Merged

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Feb 21, 2023

Current Behavior

On Windows, when combining globbed project config files with the tree changes there's a mix of Unix-like and Windows-like paths. Globbed files and newly created ones (from the tree) have Windows-like paths while the deleted files (from the tree) have Unix-like paths. That causes a filter where we remove the deleted project files not to work as expected because the file paths don't match. It ultimately results in an error when trying to read a file that no longer exists in the tree (it's deleted).

Expected Behavior

Getting all the project config files should work correctly in Windows.

Related Issue(s)

Fixes #15080

@leosvelperez leosvelperez self-assigned this Feb 21, 2023
@vercel
Copy link

vercel bot commented Feb 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 21, 2023 at 2:37PM (UTC)

@FrozenPandaz FrozenPandaz merged commit 3b056e5 into nrwl:master Feb 21, 2023
@leosvelperez leosvelperez deleted the core/project-files-normalization branch February 21, 2023 15:26
@lislon
Copy link

lislon commented Feb 24, 2023

Thank you for the fix, @leosvelperez. I was trying to reproduce this yesterday and found the e2e test:

/**
* Now try to move lib1
*/
const moveOutput = runCLI(
`generate @nrwl/workspace:move --project ${lib1}-data-access shared/${lib1}/data-access`
);

But I was not able to run it. Its timeouted for me with error log:

Debugger listening on ws://127.0.0.1:52384/d95e5754-0abf-4bf3-b05d-285a53f09c2a
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Debugger listening on ws://127.0.0.1:52388/0832af65-c8bb-4233-b245-b848fba7a8bd
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module 'fork-ts-checker-webpack-plugin'
Require stack:
- C:\Users\ele\AppData\Local\Temp\tmp-6464-xwMZzMDM8Jhx\node_modules\@nrwl\workspace\src\utils\webpack\config.js
- C:\Users\ele\AppData\Local\Temp\tmp-6464-xwMZzMDM8Jhx\node_modules\@nrwl\workspace\index.js
- C:\Users\ele\AppData\Local\Temp\tmp-6464-xwMZzMDM8Jhx\node_modules\@nrwl\workspace\src\command-line\nx.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\ele\AppData\Local\Temp\tmp-6464-xwMZzMDM8Jhx\node_modules\@nrwl\workspace\src\utils\webpack\config.js:19:34)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\ele\\AppData\\Local\\Temp\\tmp-6464-xwMZzMDM8Jhx\\node_modules\\@nrwl\\workspace\\src\\utils\\webpack\\config.js',
    'C:\\Users\\ele\\AppData\\Local\\Temp\\tmp-6464-xwMZzMDM8Jhx\\node_modules\\@nrwl\\workspace\\index.js',
    'C:\\Users\\ele\\AppData\\Local\\Temp\\tmp-6464-xwMZzMDM8Jhx\\node_modules\\@nrwl\\workspace\\src\\command-line\\nx.js'
  ]
}

Node.js v18.12.1
Waiting for the debugger to disconnect...

Do you know if these test are supposed to be green and is it just my configuration or are they broken for everyone?

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't move or rename angular libs
4 participants