fix(config): update .smartconfig.json handling and harden bundler runtime compatibility

This commit is contained in:
2026-05-09 12:34:00 +00:00
parent f19c7c69af
commit e5b2f2ba30
18 changed files with 2712 additions and 3190 deletions
+5 -5
View File
@@ -40,11 +40,11 @@ export class InitHandler {
constructor(cwd: string = paths.cwd) {
this.cwd = cwd;
this.smartconfigPath = plugins.path.join(this.cwd, 'smartconfig.json');
this.smartconfigPath = plugins.path.join(this.cwd, '.smartconfig.json');
}
/**
* Load existing smartconfig.json or create empty config
* Load existing .smartconfig.json or create empty config
*/
private async loadExistingConfig(): Promise<any> {
const fileExists = await plugins.fs.file(this.smartconfigPath).exists();
@@ -60,12 +60,12 @@ export class InitHandler {
}
/**
* Save config to smartconfig.json
* Save config to .smartconfig.json
*/
private async saveConfig(config: any): Promise<void> {
const content = JSON.stringify(config, null, 2);
await plugins.fs.file(this.smartconfigPath).encoding('utf8').write(content);
console.log(`\n✅ Configuration saved to smartconfig.json`);
console.log(`\n✅ Configuration saved to .smartconfig.json`);
}
/**
@@ -73,7 +73,7 @@ export class InitHandler {
*/
public async runWizard(): Promise<void> {
console.log('\n🚀 tsbundle configuration wizard\n');
console.log('This wizard will help you configure bundle settings in smartconfig.json.\n');
console.log('This wizard will help you configure bundle settings in .smartconfig.json.\n');
const smartconfigJson = await this.loadExistingConfig();