diff --git a/packages/nx-infra-plugin/package.json b/packages/nx-infra-plugin/package.json index aab4b5ab4b68..85a4c42f1485 100644 --- a/packages/nx-infra-plugin/package.json +++ b/packages/nx-infra-plugin/package.json @@ -14,6 +14,7 @@ "dependencies": { "fs-extra": "^11.2.0", "glob": "11.1.0", + "normalize-path": "3.0.0", "rimraf": "3.0.2" }, "peerDependencies": { @@ -31,6 +32,7 @@ "devDependencies": { "@types/fs-extra": "11.0.4", "@types/jest": "29.5.12", + "@types/normalize-path": "3.0.2", "@types/node": "18.19.64", "prettier": "catalog:tools", "ts-jest": "29.1.3", diff --git a/packages/nx-infra-plugin/src/executors/generate-components/angular-generator.ts b/packages/nx-infra-plugin/src/executors/generate-components/angular-generator.ts index 72c838a3152b..470053ed3ef8 100644 --- a/packages/nx-infra-plugin/src/executors/generate-components/angular-generator.ts +++ b/packages/nx-infra-plugin/src/executors/generate-components/angular-generator.ts @@ -1,5 +1,6 @@ import * as path from 'path'; import { logger } from '@nx/devkit'; +import normalizePath from 'normalize-path'; import { GenerationConfig } from './framework-handlers'; export async function generateAngularComponents( @@ -24,10 +25,12 @@ export async function generateAngularComponents( AngularCommonReexportsGenerator, } = internalTools; - const componentsDir = config.out.componentsDir; - const indexFileName = config.out.indexFileName; + const componentsDir = normalizePath(config.out.componentsDir); + const indexFileName = normalizePath(config.out.indexFileName); - const metadataDir = path.join(path.dirname(componentsDir), 'metadata', 'generated'); + const metadataDir = normalizePath( + path.join(path.dirname(componentsDir), 'metadata', 'generated'), + ); logger.info('📝 Generating Angular-specific metadata...'); const metadataGenerator = new AngularMetadataGenerator(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96f691454a77..8b8719b45583 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2225,6 +2225,9 @@ importers: ng-packagr: specifier: '>=19.0.0' version: 19.2.2(@angular/compiler-cli@21.0.5(@angular/compiler@21.0.5)(typescript@4.9.5))(tslib@2.8.1)(typescript@4.9.5) + normalize-path: + specifier: 3.0.0 + version: 3.0.0 rimraf: specifier: 3.0.2 version: 3.0.2 @@ -2238,6 +2241,9 @@ importers: '@types/node': specifier: 18.19.64 version: 18.19.64 + '@types/normalize-path': + specifier: 3.0.2 + version: 3.0.2 prettier: specifier: catalog:tools version: 3.5.3 @@ -6731,6 +6737,9 @@ packages: '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} + '@types/normalize-path@3.0.2': + resolution: {integrity: sha512-DO++toKYPaFn0Z8hQ7Tx+3iT9t77IJo/nDiqTXilgEP+kPNIYdpS9kh3fXuc53ugqwp9pxC1PVjCpV1tQDyqMA==} + '@types/pako@2.0.4': resolution: {integrity: sha512-VWDCbrLeVXJM9fihYodcLiIv0ku+AlOa/TQ1SvYOaBuyrSKgEcro95LJyIsJ4vSo6BXIxOKxiJAat04CmST9Fw==} @@ -25501,6 +25510,8 @@ snapshots: '@types/normalize-package-data@2.4.4': {} + '@types/normalize-path@3.0.2': {} + '@types/pako@2.0.4': {} '@types/parse-json@4.0.2': {}