etkachev / nx-webstorm

Plugin for Webstorm that strives to function the same as Nx Console for VsCode. UI for Nx
MIT License
35 stars 4 forks source link

Use kebab-case because the other is depraced for options #94

Closed adambrangenberg closed 1 year ago

adambrangenberg commented 2 years ago

Current Behaviour

A clear and concise description of what the bug is.

How to Reproduce

Steps to reproduce the behaviour:

  1. Use the latest Angular Version
  2. Generate a new Component
  3. Check inlineStyle or something different
  4. Run it and look at the console

Expected Behaviour

To use the new way of adding options, so it won't break in the next Angular version

Screenshots

image

LuisTovar0 commented 1 year ago

This makes the plugin unusable in recent Angular CLI versions because of the deprecation of camel case flags (see). image

The reason is that the plugin reads the command schematic's schema.json (f.e. node_modules/@schematics/angular/component/schema.json for ng generate command) to figure out the command's flags and their characteristics. However, the command names in the shcema.json file no longer match the ones in the documentation.

However, I believe that this strategy can still be viable if a couple of tweaks are added. I searched through the Angular CLI repo to try to find where the kebab-case commands are, but couldn't find them, because they just "dasherize" (convert camelCase to kebab-case) the commands found in the schema.json files (I didn't find where the dasherization happens, but I'm 99% sure it happens somewhere).

That can be part of the possible solution:

etkachev commented 1 year ago

Thanks! Yea I'll have to look into why angular would have their schema.json not match what the cli is expecting for the generators. Assuming you guys are setup with just plain angular project and not within nx?

LuisTovar0 commented 1 year ago

I explained this above, but I'll make it clearer: the Angular CLI tool also reads from the schema.json to parse commands, but I'm almost sure that they dasherize those values in runtime, meaning they'll read inlineTemplate from schema.json, buyt only accept inline-template. And that's why we should use a similar strategy in this plugin. Yes, I'm on plain Angular.

adambrangenberg commented 1 year ago

I also was on plain Angular

vKxni commented 1 year ago

hi

etkachev commented 1 year ago

I also wanted to let you know about slowly deprecating this plugin in favor for the official on by Nrwl: https://plugins.jetbrains.com/plugin/21060-nx-console

adambrangenberg commented 1 year ago

Should I close the issue then?