[#3537654] feat(CLI Tool): Detect first-party and data dependency imports
Closes #3537654
Folder structure changes:
- Moved
/code-editor/utils.ts->/code-editor/utils/utils.ts - Moved 2 functions (
getImportsFromAstandgetDataDependencies) into a new file calledast-utils.tsthat the CLI project can import from. CLI also imports fromclassNameCandidates.tswhich is its own file.-
@balintbrews mentioned eventually creating different packages that external projects can import functions from instead of creating individual files to import from. This might be worth having its own issue for but I tried to do the simplest thing for now which was follow the convention of the existing
classNameCandidates.ts
-
@balintbrews mentioned eventually creating different packages that external projects can import functions from instead of creating individual files to import from. This might be worth having its own issue for but I tried to do the simplest thing for now which was follow the convention of the existing
CLI tool changes (from D.O. issue summary):
- Reuse the same code, possibly after some refactoring if needed, as we do on the code editor UI to detect first-party imports and data dependencies in the JavaScript source of a code component.
- Set the appropriate properties in the payload automatically.
- Remove the
importedJsComponentsand propertydataDependenciesfrom theComponenttype (defined incli/src/types/Component.ts) - Update the
downloadcommand so it doesn't write these properties to the metadata file
Edited by Harumi Jang