feat(config): switch compile target configuration from npmextra to smartconfig

This commit is contained in:
2026-03-24 15:06:48 +00:00
parent cb60971f27
commit c5bbc1ca26
7 changed files with 39 additions and 13 deletions

View File

@@ -59,18 +59,18 @@ export class TsDeno {
* The package.json hide/restore wraps the entire loop.
*/
public async compileFromConfig(): Promise<void> {
const npmextraInstance = new plugins.npmextra.Npmextra(this.cwd);
const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd);
const config = npmextraInstance.dataFor<ITsdenoConfig>('@git.zone/tsdeno', {
compileTargets: [],
});
if (config.compileTargets.length === 0) {
console.error('tsdeno: no compileTargets found in npmextra.json under "@git.zone/tsdeno"');
console.error('tsdeno: either pass args directly or add config to npmextra.json');
console.error('tsdeno: no compileTargets found in smartconfig.json under "@git.zone/tsdeno"');
console.error('tsdeno: either pass args directly or add config to smartconfig.json');
process.exit(1);
}
console.log(`tsdeno: found ${config.compileTargets.length} compile target(s) in npmextra.json`);
console.log(`tsdeno: found ${config.compileTargets.length} compile target(s) in smartconfig.json`);
const packageJsonPath = plugins.path.join(this.cwd, 'package.json');
const backupPath = plugins.path.join(this.cwd, 'package.json.bak');