Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ad5e0c1afc | |||
| cb5d827420 | |||
| 5a5f6c6944 | |||
| 54ac7e7188 |
13
changelog.md
13
changelog.md
@@ -1,5 +1,18 @@
|
|||||||
# Changelog
|
# 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
|
||||||
|
|
||||||
|
- Added keepNames: true to esbuild options in ts/mod_esbuild/index.child.ts for the non-minified/dev build
|
||||||
|
- Added keepNames: true to esbuild options in ts/mod_esbuild/index.child.ts for the minified/production build to improve stack traces, debugging, and runtime reflection
|
||||||
|
|
||||||
## 2026-03-05 - 2.9.1 - fix(mod_custom)
|
## 2026-03-05 - 2.9.1 - fix(mod_custom)
|
||||||
use absolute smartfs entry.path instead of joining with dirPath when building fullPath
|
use absolute smartfs entry.path instead of joining with dirPath when building fullPath
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@git.zone/tsbundle",
|
"name": "@git.zone/tsbundle",
|
||||||
"version": "2.9.1",
|
"version": "2.9.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects",
|
"description": "a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/early": "^4.0.4",
|
"@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/smartcli": "^4.0.20",
|
||||||
"@push.rocks/smartdelay": "^3.0.5",
|
"@push.rocks/smartdelay": "^3.0.5",
|
||||||
"@push.rocks/smartfs": "^1.1.3",
|
"@push.rocks/smartfs": "^1.1.3",
|
||||||
|
|||||||
46
pnpm-lock.yaml
generated
46
pnpm-lock.yaml
generated
@@ -11,12 +11,12 @@ importers:
|
|||||||
'@push.rocks/early':
|
'@push.rocks/early':
|
||||||
specifier: ^4.0.4
|
specifier: ^4.0.4
|
||||||
version: 4.0.4
|
version: 4.0.4
|
||||||
'@push.rocks/npmextra':
|
|
||||||
specifier: ^5.1.3
|
|
||||||
version: 5.3.3
|
|
||||||
'@push.rocks/smartcli':
|
'@push.rocks/smartcli':
|
||||||
specifier: ^4.0.20
|
specifier: ^4.0.20
|
||||||
version: 4.0.20
|
version: 4.0.20
|
||||||
|
'@push.rocks/smartconfig':
|
||||||
|
specifier: ^6.0.0
|
||||||
|
version: 6.0.0
|
||||||
'@push.rocks/smartdelay':
|
'@push.rocks/smartdelay':
|
||||||
specifier: ^3.0.5
|
specifier: ^3.0.5
|
||||||
version: 3.0.5
|
version: 3.0.5
|
||||||
@@ -886,9 +886,6 @@ packages:
|
|||||||
'@push.rocks/mongodump@1.1.0':
|
'@push.rocks/mongodump@1.1.0':
|
||||||
resolution: {integrity: sha512-kW0ZUGyf1e4nwloVwBQjNId+MzgTcNS834C+RxH21i1NqyOubbpWZtJtPP+K+s35nSJRyCTy3ICfBMdDBTAm2w==}
|
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':
|
'@push.rocks/qenv@6.1.3':
|
||||||
resolution: {integrity: sha512-+z2hsAU/7CIgpYLFqvda8cn9rUBMHqLdQLjsFfRn5jPoD7dJ5rFlpkbhfM4Ws8mHMniwWaxGKo+q/YBhtzRBLg==}
|
resolution: {integrity: sha512-+z2hsAU/7CIgpYLFqvda8cn9rUBMHqLdQLjsFfRn5jPoD7dJ5rFlpkbhfM4Ws8mHMniwWaxGKo+q/YBhtzRBLg==}
|
||||||
|
|
||||||
@@ -919,6 +916,9 @@ packages:
|
|||||||
'@push.rocks/smartclickhouse@2.0.17':
|
'@push.rocks/smartclickhouse@2.0.17':
|
||||||
resolution: {integrity: sha512-IYO8Obor/Ruam2KQ2B/+5uQ+rL0exU5KZoSgOc3jkkrfjn+zZenN2xoV8lVqavAtxZVfG7MfxFrcv6I7I9ZMmA==}
|
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':
|
'@push.rocks/smartcrypto@2.0.4':
|
||||||
resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==}
|
resolution: {integrity: sha512-1+/5bsjyataf5uUkUNnnVXGRAt+gHVk1KDzozjTqgqJxHvQk1d9fVDohL6CxUhUucTPtu5VR5xNBiV8YCDuGyw==}
|
||||||
|
|
||||||
@@ -5319,23 +5319,6 @@ snapshots:
|
|||||||
- snappy
|
- snappy
|
||||||
- socks
|
- 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':
|
'@push.rocks/qenv@6.1.3':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@api.global/typedrequest': 3.1.10
|
'@api.global/typedrequest': 3.1.10
|
||||||
@@ -5446,6 +5429,23 @@ snapshots:
|
|||||||
'@push.rocks/smarturl': 3.1.0
|
'@push.rocks/smarturl': 3.1.0
|
||||||
'@push.rocks/webrequest': 3.0.37
|
'@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':
|
'@push.rocks/smartcrypto@2.0.4':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@push.rocks/smartpromise': 4.2.3
|
'@push.rocks/smartpromise': 4.2.3
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@git.zone/tsbundle',
|
name: '@git.zone/tsbundle',
|
||||||
version: '2.9.1',
|
version: '2.9.3',
|
||||||
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
|
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export class CustomBundleHandler {
|
|||||||
* Load configuration from npmextra.json
|
* Load configuration from npmextra.json
|
||||||
*/
|
*/
|
||||||
public async loadConfig(): Promise<boolean> {
|
public async loadConfig(): Promise<boolean> {
|
||||||
const npmextraInstance = new plugins.npmextra.Npmextra(this.cwd);
|
const npmextraInstance = new plugins.npmextra.Smartconfig(this.cwd);
|
||||||
this.config = npmextraInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
|
this.config = npmextraInstance.dataFor<interfaces.ITsbundleConfig>('@git.zone/tsbundle', {
|
||||||
bundles: [],
|
bundles: [],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ export class TsBundleProcess {
|
|||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
target: 'es2022',
|
target: 'es2022',
|
||||||
|
keepNames: true,
|
||||||
entryNames: plugins.path.parse(toArg).name,
|
entryNames: plugins.path.parse(toArg).name,
|
||||||
outdir: plugins.path.parse(toArg).dir,
|
outdir: plugins.path.parse(toArg).dir,
|
||||||
splitting: false,
|
splitting: false,
|
||||||
@@ -67,6 +68,7 @@ export class TsBundleProcess {
|
|||||||
format: 'esm',
|
format: 'esm',
|
||||||
target: 'es2022',
|
target: 'es2022',
|
||||||
minify: true,
|
minify: true,
|
||||||
|
keepNames: true,
|
||||||
entryNames: plugins.path.parse(toArg).name,
|
entryNames: plugins.path.parse(toArg).name,
|
||||||
outdir: plugins.path.parse(toArg).dir,
|
outdir: plugins.path.parse(toArg).dir,
|
||||||
tsconfig: paths.tsconfigPath,
|
tsconfig: paths.tsconfigPath,
|
||||||
|
|||||||
@@ -36,20 +36,20 @@ const PRESETS: Record<string, { description: string; config: interfaces.IBundleC
|
|||||||
|
|
||||||
export class InitHandler {
|
export class InitHandler {
|
||||||
private cwd: string;
|
private cwd: string;
|
||||||
private npmextraPath: string;
|
private smartconfigPath: string;
|
||||||
|
|
||||||
constructor(cwd: string = paths.cwd) {
|
constructor(cwd: string = paths.cwd) {
|
||||||
this.cwd = cwd;
|
this.cwd = cwd;
|
||||||
this.npmextraPath = plugins.path.join(this.cwd, 'npmextra.json');
|
this.smartconfigPath = plugins.path.join(this.cwd, 'smartconfig.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load existing npmextra.json or create empty config
|
* Load existing npmextra.json or create empty config
|
||||||
*/
|
*/
|
||||||
private async loadExistingConfig(): Promise<any> {
|
private async loadExistingConfig(): Promise<any> {
|
||||||
const fileExists = await plugins.fs.file(this.npmextraPath).exists();
|
const fileExists = await plugins.fs.file(this.smartconfigPath).exists();
|
||||||
if (fileExists) {
|
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 {
|
try {
|
||||||
return JSON.parse(content);
|
return JSON.parse(content);
|
||||||
} catch {
|
} catch {
|
||||||
@@ -64,8 +64,8 @@ export class InitHandler {
|
|||||||
*/
|
*/
|
||||||
private async saveConfig(config: any): Promise<void> {
|
private async saveConfig(config: any): Promise<void> {
|
||||||
const content = JSON.stringify(config, null, 2);
|
const content = JSON.stringify(config, null, 2);
|
||||||
await plugins.fs.file(this.npmextraPath).encoding('utf8').write(content);
|
await plugins.fs.file(this.smartconfigPath).encoding('utf8').write(content);
|
||||||
console.log(`\n✅ Configuration saved to npmextra.json`);
|
console.log(`\n✅ Configuration saved to smartconfig.json`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,15 +73,15 @@ export class InitHandler {
|
|||||||
*/
|
*/
|
||||||
public async runWizard(): Promise<void> {
|
public async runWizard(): Promise<void> {
|
||||||
console.log('\n🚀 tsbundle configuration wizard\n');
|
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']) {
|
if (!smartconfigJson['@git.zone/tsbundle']) {
|
||||||
npmextraJson['@git.zone/tsbundle'] = { bundles: [] };
|
smartconfigJson['@git.zone/tsbundle'] = { bundles: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
const existingBundles = npmextraJson['@git.zone/tsbundle'].bundles || [];
|
const existingBundles = smartconfigJson['@git.zone/tsbundle'].bundles || [];
|
||||||
|
|
||||||
if (existingBundles.length > 0) {
|
if (existingBundles.length > 0) {
|
||||||
console.log(`Found ${existingBundles.length} existing bundle configuration(s):\n`);
|
console.log(`Found ${existingBundles.length} existing bundle configuration(s):\n`);
|
||||||
@@ -95,7 +95,7 @@ export class InitHandler {
|
|||||||
while (addMore) {
|
while (addMore) {
|
||||||
const bundle = await this.configureSingleBundle();
|
const bundle = await this.configureSingleBundle();
|
||||||
if (bundle) {
|
if (bundle) {
|
||||||
npmextraJson['@git.zone/tsbundle'].bundles.push(bundle);
|
smartconfigJson['@git.zone/tsbundle'].bundles.push(bundle);
|
||||||
console.log(`\n✅ Bundle configuration added!`);
|
console.log(`\n✅ Bundle configuration added!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,10 +112,10 @@ export class InitHandler {
|
|||||||
addMore = answers.getAnswerFor('addAnother');
|
addMore = answers.getAnswerFor('addAnother');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.saveConfig(npmextraJson);
|
await this.saveConfig(smartconfigJson);
|
||||||
|
|
||||||
console.log('\n📋 Final configuration:\n');
|
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) => {
|
bundles.forEach((bundle: interfaces.IBundleConfig, i: number) => {
|
||||||
console.log(` Bundle ${i + 1}:`);
|
console.log(` Bundle ${i + 1}:`);
|
||||||
console.log(` From: ${bundle.from}`);
|
console.log(` From: ${bundle.from}`);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// pushrocks scope
|
// 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 smartcli from '@push.rocks/smartcli';
|
||||||
import * as smartfs from '@push.rocks/smartfs';
|
import * as smartfs from '@push.rocks/smartfs';
|
||||||
import * as smartinteract from '@push.rocks/smartinteract';
|
import * as smartinteract from '@push.rocks/smartinteract';
|
||||||
|
|||||||
Reference in New Issue
Block a user