Skip to content

Commit 21a2b09

Browse files
authored
fix(nx-infra-plugin): normalize paths for cross-platform angular component generation (#32120)
1 parent b241709 commit 21a2b09

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

packages/nx-infra-plugin/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dependencies": {
1515
"fs-extra": "^11.2.0",
1616
"glob": "11.1.0",
17+
"normalize-path": "3.0.0",
1718
"rimraf": "3.0.2"
1819
},
1920
"peerDependencies": {
@@ -32,6 +33,7 @@
3233
"@types/fs-extra": "^11.0.4",
3334
"@types/jest": "29.5.12",
3435
"@types/node": "^18.0.0",
36+
"@types/normalize-path": "3.0.2",
3537
"prettier": "catalog:tools",
3638
"ts-jest": "29.1.3",
3739
"typescript": "4.9.5"

packages/nx-infra-plugin/src/executors/generate-components/angular-generator.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as path from 'path';
22
import { logger } from '@nx/devkit';
3+
import normalizePath from 'normalize-path';
34
import { GenerationConfig } from './framework-handlers';
45

56
export async function generateAngularComponents(
@@ -24,10 +25,12 @@ export async function generateAngularComponents(
2425
AngularCommonReexportsGenerator,
2526
} = internalTools;
2627

27-
const componentsDir = config.out.componentsDir;
28-
const indexFileName = config.out.indexFileName;
28+
const componentsDir = normalizePath(config.out.componentsDir);
29+
const indexFileName = normalizePath(config.out.indexFileName);
2930

30-
const metadataDir = path.join(path.dirname(componentsDir), 'metadata', 'generated');
31+
const metadataDir = normalizePath(
32+
path.join(path.dirname(componentsDir), 'metadata', 'generated'),
33+
);
3134

3235
logger.info('📝 Generating Angular-specific metadata...');
3336
const metadataGenerator = new AngularMetadataGenerator();

pnpm-lock.yaml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)