From cb5d8274200406656f7ce3a7a013fdd9b36696d9 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Tue, 24 Mar 2026 15:06:01 +0000 Subject: [PATCH] fix(config): migrate configuration loading and init output from npmextra.json to smartconfig.json --- changelog.md | 7 ++++++ package.json | 2 +- pnpm-lock.yaml | 46 ++++++++++++++++++++-------------------- ts/00_commitinfo_data.ts | 2 +- ts/mod_custom/index.ts | 2 +- ts/mod_init/index.ts | 28 ++++++++++++------------ ts/plugins.ts | 2 +- 7 files changed, 48 insertions(+), 41 deletions(-) diff --git a/changelog.md b/changelog.md index e72e559..c20d5a2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-03-24 - 2.9.3 - fix(config) +migrate configuration loading and init output from npmextra.json to smartconfig.json + +- replace @push.rocks/npmextra with @push.rocks/smartconfig +- load project configuration via Smartconfig in the custom module +- update init wizard to read from and write to smartconfig.json and adjust user-facing messages accordingly + ## 2026-03-11 - 2.9.2 - fix(mod_esbuild) preserve function and class names in esbuild output by enabling keepNames in both dev and prod configs diff --git a/package.json b/package.json index f70db5e..c8a3deb 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@push.rocks/early": "^4.0.4", - "@push.rocks/npmextra": "^5.1.3", + "@push.rocks/smartconfig": "^6.0.0", "@push.rocks/smartcli": "^4.0.20", "@push.rocks/smartdelay": "^3.0.5", "@push.rocks/smartfs": "^1.1.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1f5b848..60e7724 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,12 +11,12 @@ importers: '@push.rocks/early': specifier: ^4.0.4 version: 4.0.4 - '@push.rocks/npmextra': - specifier: ^5.1.3 - version: 5.3.3 '@push.rocks/smartcli': specifier: ^4.0.20 version: 4.0.20 + '@push.rocks/smartconfig': + specifier: ^6.0.0 + version: 6.0.0 '@push.rocks/smartdelay': specifier: ^3.0.5 version: 3.0.5 @@ -886,9 +886,6 @@ packages: '@push.rocks/mongodump@1.1.0': resolution: {integrity: sha512-kW0ZUGyf1e4nwloVwBQjNId+MzgTcNS834C+RxH21i1NqyOubbpWZtJtPP+K+s35nSJRyCTy3ICfBMdDBTAm2w==} - '@push.rocks/npmextra@5.3.3': - resolution: {integrity: sha512-snLpSHwaQ5OXlZzF1KX/FY71W5LwajjBzor82Vue0smjEPnSeUPY5/JcVdMwtdprdJe13pc/EQQuIiL/zw4/yg==} - '@push.rocks/qenv@6.1.3': resolution: {integrity: sha512-+z2hsAU/7CIgpYLFqvda8cn9rUBMHqLdQLjsFfRn5jPoD7dJ5rFlpkbhfM4Ws8mHMniwWaxGKo+q/YBhtzRBLg==} @@ -919,6 +916,9 @@ packages: '@push.rocks/smartclickhouse@2.0.17': resolution: {integrity: sha512-IYO8Obor/Ruam2KQ2B/+5uQ+rL0exU5KZoSgOc3jkkrfjn+zZenN2xoV8lVqavAtxZVfG7MfxFrcv6I7I9ZMmA==} + '@push.rocks/smartconfig@6.0.0': + resolution: {integrity: sha512-ohXwJdbDXV2budErnZKWBOz01YkjP6gJsZ7QM9+6Wsh+r7O1CVT3JpV+mD8xJWy5tZRHI+3B9L8z0+WkIDtKzw==} + '@push.rocks/smartcrypto@2.0.4': resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==} @@ -5319,23 +5319,6 @@ snapshots: - snappy - socks - '@push.rocks/npmextra@5.3.3': - dependencies: - '@push.rocks/qenv': 6.1.3 - '@push.rocks/smartfile': 11.2.7 - '@push.rocks/smartjson': 5.2.0 - '@push.rocks/smartlog': 3.1.10 - '@push.rocks/smartpath': 6.0.0 - '@push.rocks/smartpromise': 4.2.3 - '@push.rocks/smartrx': 3.0.10 - '@push.rocks/taskbuffer': 3.4.0 - '@tsclass/tsclass': 9.3.0 - transitivePeerDependencies: - - '@nuxt/kit' - - react - - supports-color - - vue - '@push.rocks/qenv@6.1.3': dependencies: '@api.global/typedrequest': 3.1.10 @@ -5446,6 +5429,23 @@ snapshots: '@push.rocks/smarturl': 3.1.0 '@push.rocks/webrequest': 3.0.37 + '@push.rocks/smartconfig@6.0.0': + dependencies: + '@push.rocks/qenv': 6.1.3 + '@push.rocks/smartfile': 11.2.7 + '@push.rocks/smartjson': 5.2.0 + '@push.rocks/smartlog': 3.1.10 + '@push.rocks/smartpath': 6.0.0 + '@push.rocks/smartpromise': 4.2.3 + '@push.rocks/smartrx': 3.0.10 + '@push.rocks/taskbuffer': 3.4.0 + '@tsclass/tsclass': 9.3.0 + transitivePeerDependencies: + - '@nuxt/kit' + - react + - supports-color + - vue + '@push.rocks/smartcrypto@2.0.4': dependencies: '@push.rocks/smartpromise': 4.2.3 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 5107a38..1ea6f00 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsbundle', - version: '2.9.2', + version: '2.9.3', description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects' } diff --git a/ts/mod_custom/index.ts b/ts/mod_custom/index.ts index 164547e..5817c53 100644 --- a/ts/mod_custom/index.ts +++ b/ts/mod_custom/index.ts @@ -19,7 +19,7 @@ export class CustomBundleHandler { * Load configuration from npmextra.json */ public async loadConfig(): Promise { - const npmextraInstance = new plugins.npmextra.Npmextra(this.cwd); + const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd); this.config = npmextraInstance.dataFor('@git.zone/tsbundle', { bundles: [], }); diff --git a/ts/mod_init/index.ts b/ts/mod_init/index.ts index b08cafd..04942bf 100644 --- a/ts/mod_init/index.ts +++ b/ts/mod_init/index.ts @@ -36,20 +36,20 @@ const PRESETS: Record { - const fileExists = await plugins.fs.file(this.npmextraPath).exists(); + const fileExists = await plugins.fs.file(this.smartconfigPath).exists(); if (fileExists) { - const content = (await plugins.fs.file(this.npmextraPath).encoding('utf8').read()) as string; + const content = (await plugins.fs.file(this.smartconfigPath).encoding('utf8').read()) as string; try { return JSON.parse(content); } catch { @@ -64,8 +64,8 @@ export class InitHandler { */ private async saveConfig(config: any): Promise { const content = JSON.stringify(config, null, 2); - await plugins.fs.file(this.npmextraPath).encoding('utf8').write(content); - console.log(`\nāœ… Configuration saved to npmextra.json`); + await plugins.fs.file(this.smartconfigPath).encoding('utf8').write(content); + console.log(`\nāœ… Configuration saved to smartconfig.json`); } /** @@ -73,15 +73,15 @@ export class InitHandler { */ public async runWizard(): Promise { console.log('\nšŸš€ tsbundle configuration wizard\n'); - console.log('This wizard will help you configure bundle settings in npmextra.json.\n'); + console.log('This wizard will help you configure bundle settings in smartconfig.json.\n'); - const npmextraJson = await this.loadExistingConfig(); + const smartconfigJson = await this.loadExistingConfig(); - if (!npmextraJson['@git.zone/tsbundle']) { - npmextraJson['@git.zone/tsbundle'] = { bundles: [] }; + if (!smartconfigJson['@git.zone/tsbundle']) { + smartconfigJson['@git.zone/tsbundle'] = { bundles: [] }; } - const existingBundles = npmextraJson['@git.zone/tsbundle'].bundles || []; + const existingBundles = smartconfigJson['@git.zone/tsbundle'].bundles || []; if (existingBundles.length > 0) { console.log(`Found ${existingBundles.length} existing bundle configuration(s):\n`); @@ -95,7 +95,7 @@ export class InitHandler { while (addMore) { const bundle = await this.configureSingleBundle(); if (bundle) { - npmextraJson['@git.zone/tsbundle'].bundles.push(bundle); + smartconfigJson['@git.zone/tsbundle'].bundles.push(bundle); console.log(`\nāœ… Bundle configuration added!`); } @@ -112,10 +112,10 @@ export class InitHandler { addMore = answers.getAnswerFor('addAnother'); } - await this.saveConfig(npmextraJson); + await this.saveConfig(smartconfigJson); console.log('\nšŸ“‹ Final configuration:\n'); - const bundles = npmextraJson['@git.zone/tsbundle'].bundles; + const bundles = smartconfigJson['@git.zone/tsbundle'].bundles; bundles.forEach((bundle: interfaces.IBundleConfig, i: number) => { console.log(` Bundle ${i + 1}:`); console.log(` From: ${bundle.from}`); diff --git a/ts/plugins.ts b/ts/plugins.ts index 6781776..a4c0438 100644 --- a/ts/plugins.ts +++ b/ts/plugins.ts @@ -4,7 +4,7 @@ import * as path from 'path'; export { path }; // pushrocks scope -import * as npmextra from '@push.rocks/npmextra'; +import * as npmextra 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';