fix(ci): Update CI workflows, build scripts, and export configuration
This commit is contained in:
23
ts_destination_file/index.ts
Normal file
23
ts_destination_file/index.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import * as plugins from './smartfile-destination-file.plugins.js';
|
||||
|
||||
export class SmartlogDestinationFile implements plugins.smartlogInterfaces.ILogDestination {
|
||||
public fileWriteStream: plugins.fs.WriteStream;
|
||||
|
||||
public async handleLog(logPackageArg: plugins.smartlogInterfaces.ILogPackage) {
|
||||
this.fileWriteStream.write(`${new plugins.smarttime.ExtendedDate(Date.now()).toISOString()}: ${logPackageArg.message} \n`);
|
||||
}
|
||||
|
||||
constructor(filePathArg: string) {
|
||||
const extendedDate = new plugins.smarttime.ExtendedDate(Date.now());
|
||||
if (!plugins.path.isAbsolute(filePathArg)) {
|
||||
throw new Error(`filePath needs to be absolute but is not: "${filePathArg}"`);
|
||||
}
|
||||
plugins.smartfile.fs.ensureFileSync(filePathArg, `# Smartlogfile. Created at ${extendedDate.toISOString()}\n`);
|
||||
this.fileWriteStream = plugins.fs.createWriteStream(
|
||||
filePathArg,
|
||||
{
|
||||
flags: 'a+',
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
19
ts_destination_file/smartfile-destination-file.plugins.ts
Normal file
19
ts_destination_file/smartfile-destination-file.plugins.ts
Normal file
@ -0,0 +1,19 @@
|
||||
// node native scope
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
export {
|
||||
fs,
|
||||
path
|
||||
};
|
||||
|
||||
// pushrocks scope
|
||||
import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartlogInterfaces from '../dist_ts_interfaces/index.js';
|
||||
import * as smarttime from '@push.rocks/smarttime';
|
||||
|
||||
export {
|
||||
smartfile,
|
||||
smartlogInterfaces,
|
||||
smarttime
|
||||
};
|
Reference in New Issue
Block a user