nativescript-schematics icon indicating copy to clipboard operation
nativescript-schematics copied to clipboard

Angular 13+ is not supported

Open 4r7if3x opened this issue 3 years ago • 3 comments

Environment

  • @angular/cli 15.0.0
  • @nativescript/schematics 11.2.0

Describe the bug The schematics cannot be used on Angular v13 or newer.

To Reproduce

$ ng new --collection=@nativescript/schematics app --shared

  An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID
  See "/tmp/ng-8bQx95/angular-errors.log" for further details.

Additional context JSON schemas are using draft-07 format since Angular v13 [1][2]. I tried to patch this myself, but I couldn't push the hotfix branch for PR. Additionally, please apply the following changes as well:

README.md

- You should be using @angular/[email protected] or newer.
+ You should be using @angular/[email protected] or newer.
CONTRIBUTING.md

- npm install
+ npm install --legacy-peer-deps

4r7if3x avatar Nov 18 '22 15:11 4r7if3x

Hi, where did you change to solve the problem?

brnLucas avatar Dec 13 '22 03:12 brnLucas

Hi, where did you change to solve the problem?

You basically need to rename all id keys to $id in all JSON schemas. The files are usually named schema.json, but you can run a recursive text search for "id": to find them all and replace these with "$id": instead.

4r7if3x avatar Dec 16 '22 00:12 4r7if3x

Same here, npm install -g @angular/[email protected] with version 12 works but you get this:

❯ ng generate component channel
"SchematicsNativeScriptAngularComponent" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
"SchematicsAngularComponent" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
Option "entryComponent" is deprecated: Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
CREATE src/app/channel/channel.component.spec.ts (633 bytes)
CREATE src/app/channel/channel.component.ts (278 bytes)
CREATE src/app/channel/channel.component.css (49 bytes)
CREATE src/app/channel/channel.component.html (63 bytes)

This schema needs to be upgraded!

realtica avatar Jan 02 '23 16:01 realtica