fix(build): modernize package configuration and remove smartfile dependency from filesystem operations

This commit is contained in:
2026-05-01 16:40:11 +00:00
parent 27fd2efb51
commit 61218599c8
12 changed files with 4044 additions and 5807 deletions
+1 -1
View File
@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartssr',
version: '1.0.40',
version: '1.0.41',
description: 'A smart server-side renderer that supports shadow DOM.'
}
+5 -6
View File
@@ -29,7 +29,7 @@ export class SmartSSR {
const browser = new plugins.smartpuppeteer.IncognitoBrowser();
const renderTimeMeasurement = new plugins.smarttime.HrtMeasurement();
let renderedPageString: string;
let screenshotBuffer: Buffer;
let screenshotBuffer: Buffer | undefined;
await browser.start();
try {
const context = await browser.getNewIncognitoContext();
@@ -84,12 +84,11 @@ export class SmartSSR {
// debug
if (this.options.debug) {
plugins.smartfile.memory.toFsSync(
renderedPageString,
plugins.path.join(paths.noGitDir, 'test.html')
);
const fs = await import('fs');
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer);
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.html'), renderedPageString);
if (screenshotBuffer) {
fs.writeFileSync(plugins.path.join(paths.noGitDir, 'test.png'), screenshotBuffer);
}
}
return resultDeferred.promise;
+1 -1
View File
@@ -5,4 +5,4 @@ export const packageDir = plugins.path.join(
'../'
);
export const noGitDir = plugins.path.join(packageDir, './.nogit');
plugins.smartfile.fs.ensureDirSync(noGitDir);
plugins.fs.mkdirSync(noGitDir, { recursive: true });
+3 -3
View File
@@ -1,14 +1,14 @@
// node native
import * as fs from 'fs';
import * as path from 'path';
export { path };
export { fs, path };
// @pushrocks scope
import * as smartdelay from '@push.rocks/smartdelay';
import * as smartfile from '@push.rocks/smartfile';
import * as smartpuppeteer from '@push.rocks/smartpuppeteer';
import * as smartpath from '@push.rocks/smartpath';
import * as smartpromise from '@push.rocks/smartpromise';
import * as smarttime from '@push.rocks/smarttime';
export { smartdelay, smartfile, smartpath, smartpuppeteer, smartpromise, smarttime };
export { smartdelay, smartpath, smartpuppeteer, smartpromise, smarttime };