Compare commits

..

2 Commits

Author SHA1 Message Date
jkunz f19c7c69af v2.10.1
Default (tags) / security (push) Failing after 1s
Default (tags) / test (push) Failing after 1s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2026-04-30 12:52:26 +00:00
jkunz 3b2e0bebcd fix(mod_custom): make base64ts bundle output deterministic and clean up generated temp sourcemaps 2026-04-30 12:52:26 +00:00
5 changed files with 44 additions and 6 deletions
+8
View File
@@ -1,5 +1,13 @@
# Changelog
## 2026-04-30 - 2.10.1 - fix(mod_custom)
make base64ts bundle output deterministic and clean up generated temp sourcemaps
- Use a stable temporary bundle filename instead of a timestamp-based name so repeated base64ts builds produce identical output.
- Delete the generated temporary sourcemap alongside the temp bundle to avoid leftover build artifacts.
- Add a test covering deterministic base64ts output generation.
- Update package scripts to use pnpm for tests and remove the allowimplicitany build flag.
## 2026-03-24 - 2.10.0 - feat(config)
migrate project configuration to smartconfig.json and update bundler dependencies
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@git.zone/tsbundle",
"version": "2.10.0",
"version": "2.10.1",
"private": false,
"description": "a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects",
"main": "dist_ts/index.js",
@@ -9,8 +9,8 @@
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "npm run build && (tstest test/ --verbose)",
"build": "(tsbuild --web --allowimplicitany)",
"test": "pnpm run build && (tstest test/ --verbose)",
"build": "(tsbuild --web)",
"buildDocs": "tsdoc"
},
"bin": {
+25
View File
@@ -1,5 +1,6 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as tsbundle from '../dist_ts/index.js';
import { CustomBundleHandler } from '../dist_ts/mod_custom/index.js';
import * as path from 'path';
import * as fs from 'fs';
@@ -61,6 +62,30 @@ tap.test('should bundle with rspack in production mode', async () => {
await testBundler('rspack', 'production');
});
tap.test('should generate deterministic base64ts output', async () => {
const testDir = path.join(process.cwd(), 'test');
const outputPath = path.join(testDir, 'dist_manual/base64-output.ts');
const bundleConfig = {
from: './ts_web/index.ts',
to: './dist_manual/base64-output.ts',
outputMode: 'base64ts' as const,
bundler: 'esbuild' as const,
};
const handler = new CustomBundleHandler(testDir);
if (fs.existsSync(outputPath)) {
fs.rmSync(outputPath, { force: true });
}
await handler.processSingleBundle(bundleConfig);
const firstOutput = fs.readFileSync(outputPath, 'utf8');
await handler.processSingleBundle(bundleConfig);
const secondOutput = fs.readFileSync(outputPath, 'utf8');
expect(secondOutput).toEqual(firstOutput);
});
// Test size comparison
tap.test('should show bundle size comparison', async () => {
const testDir = path.join(process.cwd(), 'test');
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@git.zone/tsbundle',
version: '2.10.0',
version: '2.10.1',
description: 'a multi-bundler tool supporting esbuild, rolldown, and rspack for painless bundling of web projects'
}
+7 -2
View File
@@ -9,7 +9,7 @@ const TEMP_DIR = '.nogit/tsbundle-temp';
export class CustomBundleHandler {
private cwd: string;
private config: interfaces.ITsbundleConfig;
private config!: interfaces.ITsbundleConfig;
constructor(cwd: string = paths.cwd) {
this.cwd = cwd;
@@ -54,7 +54,7 @@ export class CustomBundleHandler {
// Determine temp output path
const tempDir = plugins.path.join(this.cwd, TEMP_DIR);
const tempBundlePath = plugins.path.join(tempDir, `bundle-${Date.now()}.js`);
const tempBundlePath = plugins.path.join(tempDir, 'bundle.js');
// Ensure temp directory exists
await plugins.fs.directory(tempDir).create();
@@ -88,6 +88,11 @@ export class CustomBundleHandler {
if (tempFileExists) {
await plugins.fs.file(tempBundlePath).delete();
}
const tempSourceMapPath = `${tempBundlePath}.map`;
const tempSourceMapExists = await plugins.fs.file(tempSourceMapPath).exists();
if (tempSourceMapExists) {
await plugins.fs.file(tempSourceMapPath).delete();
}
}
/**