diff --git a/changelog.md b/changelog.md index 8c206d7..feac4cc 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-01-21 - 1.4.2 - fix(classes.dockerfile) +use a single top-level fs import instead of requiring fs inside methods + +- Added top-level import: import * as fs from 'fs' in ts/classes.dockerfile.ts +- Removed inline require('fs') calls and replaced with the imported fs in constructor and test() to keep imports consistent +- No behavioral change expected; this is a cleanup/refactor to standardize module usage + ## 2026-01-20 - 1.4.1 - fix(docs) update README: expand usage, installation, quick start, features, troubleshooting and migration notes diff --git a/cli.js b/cli.js old mode 100644 new mode 100755 diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 18c485d..60424c9 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@git.zone/tsdocker', - version: '1.4.1', + version: '1.4.2', description: 'develop npm modules cross platform with docker' } diff --git a/ts/classes.dockerfile.ts b/ts/classes.dockerfile.ts index 5d4ae04..e935e3c 100644 --- a/ts/classes.dockerfile.ts +++ b/ts/classes.dockerfile.ts @@ -4,6 +4,7 @@ import { logger } from './tsdocker.logging.js'; import { DockerRegistry } from './classes.dockerregistry.js'; import type { IDockerfileOptions, ITsDockerConfig } from './interfaces/index.js'; import type { TsDockerManager } from './classes.tsdockermanager.js'; +import * as fs from 'fs'; const smartshellInstance = new plugins.smartshell.Smartshell({ executor: 'bash', @@ -314,7 +315,6 @@ export class Dockerfile { this.containerName = 'dockerfile-' + this.version; if (options.filePath && options.read) { - const fs = require('fs'); this.content = fs.readFileSync(plugins.path.resolve(options.filePath), 'utf-8'); } else if (options.fileContents) { this.content = options.fileContents; @@ -419,7 +419,6 @@ export class Dockerfile { const testDir = this.managerRef.config.testDir || plugins.path.join(paths.cwd, 'test'); const testFile = plugins.path.join(testDir, 'test_' + this.version + '.sh'); - const fs = require('fs'); const testFileExists = fs.existsSync(testFile); if (testFileExists) {