Skip to content

Angular Library Generator ignores workspaceLayout.libsDir #29659

Open
@e-oz

Description

Current Behavior

% nx g @nx/angular:library test --dry-run

 NX  Generating @nx/angular:library

CREATE test/project.json
CREATE test/README.md
CREATE test/tsconfig.json
CREATE test/tsconfig.lib.json
CREATE test/src/index.ts
CREATE test/jest.config.ts
CREATE test/src/test-setup.ts
CREATE test/tsconfig.spec.json
CREATE test/src/lib/test/test.component.css
CREATE test/src/lib/test/test.component.html
CREATE test/src/lib/test/test.component.spec.ts
CREATE test/src/lib/test/test.component.ts
CREATE test/eslint.config.cjs
UPDATE tsconfig.base.json

Expected Behavior

% nx g @nx/angular:library test --dry-run

 NX  Generating @nx/angular:library

CREATE libs/test/project.json
CREATE libs/test/README.md
CREATE libs/test/tsconfig.json
CREATE libs/test/tsconfig.lib.json
CREATE libs/test/src/index.ts
CREATE libs/test/jest.config.ts
CREATE libs/test/src/test-setup.ts
CREATE libs/test/tsconfig.spec.json
CREATE libs/test/src/lib/test/test.component.css
CREATE libs/test/src/lib/test/test.component.html
CREATE libs/test/src/lib/test/test.component.spec.ts
CREATE libs/test/src/lib/test/test.component.ts
CREATE libs/test/eslint.config.cjs
UPDATE tsconfig.base.json

GitHub Repo

No response

Steps to Reproduce

  1. npx create-nx-workspace --preset=angular-monorepo --packageManager=yarn
  2. Edit nx.json, and add to the root object:
  "workspaceLayout": {
    "appsDir": "apps",
    "libsDir": "libs"
  },
  1. run nx g @nx/angular:library test --dry-run

Nx Report

Node           : 22.9.0
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 1.22.22

nx                     : 20.3.1
@nx/js                 : 20.3.1
@nx/jest               : 20.3.1
@nx/eslint             : 20.3.1
@nx/workspace          : 20.3.1
@nx/angular            : 20.3.1
@nx/devkit             : 20.3.1
@nx/eslint-plugin      : 20.3.1
@nx/module-federation  : 20.3.1
@nx/playwright         : 20.3.1
@nx/vite               : 20.3.1
@nx/web                : 20.3.1
@nx/webpack            : 20.3.1
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
angular-eslint : 19.0.2

Failure Logs

Package Manager Version

1.22.22

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions