fix(cli): replace npmextra config loading with smartconfig

This commit is contained in:
2026-03-24 15:07:43 +00:00
parent e9ad5775a1
commit b85abf7b93
6 changed files with 38 additions and 11 deletions

View File

@@ -53,8 +53,8 @@ export class TsRustCli {
constructor(cwd: string = process.cwd()) {
this.cwd = cwd;
this.cli = new plugins.smartcli.Smartcli();
const npmextraInstance = new plugins.npmextra.Npmextra(this.cwd);
this.config = npmextraInstance.dataFor<ITsrustConfig>('@git.zone/tsrust', { targets: [] });
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.cwd);
this.config = smartconfigInstance.dataFor<ITsrustConfig>('@git.zone/tsrust', { targets: [] });
this.registerCommands();
}
@@ -122,7 +122,7 @@ export class TsRustCli {
const distDir = path.join(this.cwd, 'dist_rust');
const profile = isDebug ? 'debug' : 'release';
// Parse --target flag (can appear multiple times), fall back to npmextra.json config
// Parse --target flag (can appear multiple times), fall back to smartconfig.json config
const cliTargets = (argvArg as any).target;
const targets: string[] = cliTargets
? (Array.isArray(cliTargets) ? cliTargets : [cliTargets])