feat: add argument parsing and module resolution for assistant app
- Implemented argument parsing in args.ts to handle root, home, and help options. - Added parseHomeArg and parseHelpArg functions for command line argument handling. - Created ModuleResolver class in assistant-app-resolve.ts to resolve module paths, including scoped packages and relative paths. - Introduced caching mechanism for package.json reads to improve performance. - Added utility functions for checking file existence and clearing the cache.
This commit is contained in:
@@ -33,4 +33,14 @@ export const installDeps = async (opts: InstallDepsOptions) => {
|
||||
} else {
|
||||
syncSpawn('npm', params, { cwd: appPath, stdio: 'inherit', env: process.env });
|
||||
}
|
||||
};
|
||||
|
||||
export const execCommand = (command: string, options: { cwd?: string } = {}) => {
|
||||
const { cwd } = options;
|
||||
return spawnSync(command, {
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
cwd: cwd,
|
||||
env: process.env,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user