The implementation of ig update - https://github.com/IgniteUI/igniteui-cli/pull/1057 - requires the usage of external code that is written in a separate module, and is possibly/preferably exported in a default async member. This means that we need to be able to dynamically import that module wherever it is supposed to be executed. Similar to what Angular are doing with their schematics.
This would require something like this to be implemented:
Currently, the CLI is transpiled to CommonJS and the above dynamic import will become a synchronous require call which is incapable of handling an async module without additional code overhead.
So moving to ES modules is a prerequisite for ig update.
There is already a PR that attempts to do this - https://github.com/IgniteUI/igniteui-cli/pull/1059 - but it's been so long that it's really outdated and it's probably best to be abandoned and started from scratch.
We need these changes to update the CLI's packages (Core: chalk & glob) as they are heavily outdated, which is part of this task.
Description
The implementation of
ig update
- https://github.com/IgniteUI/igniteui-cli/pull/1057 - requires the usage of external code that is written in a separate module, and is possibly/preferably exported in a default async member. This means that we need to be able to dynamically import that module wherever it is supposed to be executed. Similar to whatAngular
are doing with their schematics.This would require something like this to be implemented:
Currently, the CLI is transpiled to
CommonJS
and the above dynamic import will become a synchronousrequire
call which is incapable of handling an async module without additional code overhead.So moving to
ES modules
is a prerequisite forig update
.There is already a PR that attempts to do this - https://github.com/IgniteUI/igniteui-cli/pull/1059 - but it's been so long that it's really outdated and it's probably best to be abandoned and started from scratch.
We need these changes to update the CLI's packages (Core: chalk & glob) as they are heavily outdated, which is part of this task.