Skip to content

Debug & test migrations & schematics

Viktor Aladzhov edited this page Jun 11, 2024 · 3 revisions

New way of debugging NodeJS:

From the Terminal window in VSCode, choose the JavaScript debug terminal:

image

and call the command. In the case of the migrations the command is:

ng g igniteui-angular/migrations/migration-collection.json:migration-XX

Old way of debugging NodeJS

Debug migrations

  1. A test project, having an old version of igniteui-angular (with some old properties, events, and classes), on which the migrations are to be applied.
  2. npm i ts-node - executed on the test project.
  3. In igniteui-angular repo, check the 'Run migration' step in the launch.json and modify steps, according to the local directories for the test project and igniteui-angular repo and migrations entry point.
  4. Put a breakpoint and start debugging.

Debug ng add schematics in igniteui-angular

  1. A test project, created with ng CLI (using ng new command), on which the 'ng add' schematic is to be applied.
  2. npm i ts-node - executed on the test project.
  3. In igniteui-angular repo, check the 'Run schematics' step in the launch.json and modify steps, according to the local directories for the test project and igniteui-angular repo and schematics entry point.
  4. Put a breakpoint and start debugging.

Debug schematics in igniteui-cli (ng-new, cli-config)

  1. Use the test project from Debug ng add schematics in igniteui-angular section above.
  2. You need to commit the changes to the test project in order to check the new changes coming from the igniteui-cli schematics.
  3. In igniteui-cli repo, check the Run schematics:ng-new or Run schematics:cli-config step in the launch.json and modify steps, according to the local directories for the test project and igniteui-cli repo and schematics entry point.
  4. Put a breakpoint and start debugging.

Test ng add schematics in igniteui-angular

If you need to test schematics changes from both igniteui-angular and igniteui-cli you need to release a beta package for the igniteui-cli and update it here: "@igniteui/angular-schematics": "~14.0.1000"

Then you need to:

  • build the entire project npm run build:lib
  • build schematics with npm run build:schematics.
  • build the migrations (in case you need to test them) with npm run build:migrations
  • cwd to ./dist/igniteui-angular
  • npm pack
  • copy the pack (igniteui-angular-0.0.1.tgz) to the project you want to test (need to be created beforehand with ng new)
  • ng add .\igniteui-angular-0.0.1.tgz (or use the alternative npm i igniteui-angular-0.0.1.tgz & ng g igniteui-angular:ng-add)
Clone this wiki locally