Skip to content

ng config breaks with schema validation after library is added to workspace #20246

@silvioboehme

Description

@silvioboehme

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

This works fine in version 11.2.3 and below and breaks with 11.2.4.
It's directly linked to commit 5f8155d

Description

A clear and concise description of the problem...

🔬 Minimal Reproduction


ng new Demo1 --createApplication=false --newProjectRoot=apps --strict=true
cd Demo1
ng config newProjectRoot apps
ng g application app1 --routing=true --style=scss  --strict=true
ng config newProjectRoot libs1
ng g library mylib1
ng config newProjectRoot libs2

Schema validation failed with the following errors:
  Data path ".projects['mylib1'].architect['build'].builder" should NOT be valid.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].builder" should be equal to constant.
  Data path ".projects['mylib1'].architect['build'].configurations['production']" should have required property 'project'.
  Data path ".projects['mylib1'].architect['build']" should match exactly one schema in oneOf.

Because 5f8155d adds "project" key as required to "configuration" but ng g library don't add this key!
I don't know why this is required now, but i think it's a bug in 5f8155d


        "build": {
          "builder": "@angular-devkit/build-angular:ng-packagr",
          "options": {
            "tsConfig": "libs1/mylib1/tsconfig.lib.json",
            "project": "libs1/mylib1/ng-package.json"
          },
          "configurations": {
            "production": {
              "tsConfig": "libs1/mylib1/tsconfig.lib.prod.json"
                                            <----- missing "project" !!!!!
            }
          }
        },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions