feat(config): migrate project configuration to smartconfig.json and update bundler dependencies

This commit is contained in:
2026-03-24 18:15:30 +00:00
parent ad5e0c1afc
commit aea86bd8f5
14 changed files with 1677 additions and 2342 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tsbundle',
version: '2.9.3',
version: '2.10.0',
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
}

View File

@@ -16,11 +16,11 @@ export class CustomBundleHandler {
}
/**
* Load configuration from npmextra.json
* Load configuration from smartconfig.json
*/
public async loadConfig(): Promise<boolean> {
const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd);
this.config = npmextraInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
const smartconfigInstance = new plugins.smartconfig.Smartconfig(this.cwd);
this.config = smartconfigInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
bundles: [],
});

View File

@@ -44,7 +44,7 @@ export class InitHandler {
}
/**
* Load existing npmextra.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,7 +60,7 @@ export class InitHandler {
}
/**
* Save config to npmextra.json
* Save config to smartconfig.json
*/
private async saveConfig(config: any): Promise<void> {
const content = JSON.stringify(config, null, 2);

View File

@@ -53,7 +53,7 @@ export class TsBundleProcess {
entryFileNames: outputFilename,
format: 'es',
sourcemap: true,
inlineDynamicImports: true,
codeSplitting: false,
});
}
@@ -83,7 +83,7 @@ export class TsBundleProcess {
format: 'es',
sourcemap: true,
minify: true,
inlineDynamicImports: true,
codeSplitting: false,
});
}
}

View File

@@ -4,7 +4,7 @@ import * as path from 'path';
export { path };
// pushrocks scope
import * as npmextra from '@push.rocks/smartconfig';
import * as smartconfig from '@push.rocks/smartconfig';
import * as smartcli from '@push.rocks/smartcli';
import * as smartfs from '@push.rocks/smartfs';
import * as smartinteract from '@push.rocks/smartinteract';
@@ -15,7 +15,7 @@ import * as smartpromise from '@push.rocks/smartpromise';
import * as smartspawn from '@push.rocks/smartspawn';
export {
npmextra,
smartconfig,
smartcli,
smartfs,
smartinteract,

View File

@@ -5,7 +5,7 @@ import { runInit } from './mod_init/index.js';
export const runCli = async () => {
const tsBundleCli = new plugins.smartcli.Smartcli();
// Default command: run custom bundles from npmextra.json
// Default command: run custom bundles from smartconfig.json
tsBundleCli.standardCommand().subscribe(async (argvArg) => {
await runCustomBundles();
});