bilelmsekni / componizer

vs code extension for refactoring to components
MIT License
32 stars 5 forks source link

feat: do not depend on global ng #21

Closed chihab closed 3 years ago

chihab commented 4 years ago

Feature description

Launch local ng command script rather than the global one.

Implementation

Maybe by replacing

const script = `ng g @componizer/schematics:ng-componize ...`;

by

const script = `npx ng g @componizer/schematics:ng-componize ...`;

in src/utils.ts?

Not sure about the cwd though.

UPDATE npx rather than npm run which depends on "ng": "ng" being present in scripts.

bilelmsekni commented 4 years ago

I'm not sure if I have tried this before but perhaps it deserves another chance. I'll give it a try this weekend and see if it works

chihab commented 3 years ago

I can handle it @bilelmsekni and submit a PR. Theoretically, there should be no issue since npx is now on the CLI requirements (given the required engine version)

It looks that there is no real "e2e" test of the extension, the script is mocked so the update won't be tested out.

bilelmsekni commented 3 years ago

Yes please by all means, submit a PR :)

and also yes, the tests are mostly unit tests not E2E tests.