Skip to content

[Bug]: Npm run ng g application fails on existing o3r applications #3754

@cpaulve-1A

Description

@cpaulve-1A

Package version

13.x

Reproduction steps

This issue occurs on projects which have migrated from 12 to 13.
In order to keep the consistency of the existing project naming convention, the following configuration was added to the schematic field of the angular.json:

  "@schematics/angular:component": {
      "type": "component"
    },
    "@schematics/angular:directive": {
      "type": "directive"
    },
    "@schematics/angular:service": {
      "type": "service"
    },
    "@schematics/angular:guard": {
      "typeSeparator": "."
    },
    "@schematics/angular:interceptor": {
      "typeSeparator": "."
    },
    "@schematics/angular:module": {
      "typeSeparator": "."
    },
    "@schematics/angular:pipe": {
      "typeSeparator": "."
    },
    "@schematics/angular:resolver": {
      "typeSeparator": "."
    }

To emulate this behaviour, create a new application with npm create @o3r test
Once your project is created, update the angular.json and append the above config to the "schematics" field.

Now run npm run ng g application my-app
Try to run the npm run ng serve my-app

Current result

The generate application scripts generate a mix of app.ts and app.component.ts files:

Image

Even if the main app should be app.component.ts file, the app file is used instead and will look for a non existing app.scss file:

Expected result

Only the app.component.ts file should be generate and should target the correct template and styling files

Image

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions