From 8e10f373d2c7d948115c591420a11edd1220d15d Mon Sep 17 00:00:00 2001 From: aarontravass Date: Wed, 17 May 2023 13:36:44 -0400 Subject: [PATCH 1/9] feat: added log file streaming --- src/filelogger.ts | 73 ++++++++++++++++++++++++++++++++++++++ src/index.ts | 38 ++++++++++++++------ tests/index.test.ts | 85 +++++++++++++++++++++++++++++++++++++++++++-- tsconfig.json | 6 +++- 4 files changed, 189 insertions(+), 13 deletions(-) create mode 100644 src/filelogger.ts diff --git a/src/filelogger.ts b/src/filelogger.ts new file mode 100644 index 0000000..ab83d9e --- /dev/null +++ b/src/filelogger.ts @@ -0,0 +1,73 @@ +import { + existsSync, + accessSync, + constants as fsConstants, + writeFileSync, + createWriteStream, + WriteStream, + mkdirSync +} from 'fs' +import { dirname as directoryname } from 'path' + +export class FileLogger { + private readonly filename: string + private readonly dirname: string + private writableStream: WriteStream + constructor(filename: string) { + this.dirname = directoryname(filename) + this.filename = filename + this._stat() + this._createWritableStream() + } + + private _stat() { + //check if file exists + if (existsSync(this.filename)) { + try { + // check for permissions + accessSync(this.filename) + return + } catch (error) { + throw new Error('Unable to read file. Check for permissions!') + } + } else { + // check if directory exists + try { + accessSync(this.dirname) + } catch (error) { + mkdirSync(this.dirname, { recursive: true, mode: fsConstants.W_OK }) + } + writeFileSync(this.filename, '') + return + } + } + + private _createWritableStream() { + this.writableStream = createWriteStream(this.filename, { flags: 'a' }) + } + + toFile(stringToLog: string) { + this.writableStream.write(stringToLog + '\n') + } + + private _endStream() { + process.on('exit', (code) => { + this.writableStream.close() + }) + + process.on('SIGTERM', (signal) => { + this.writableStream.close() + process.exit(0) + }) + + process.on('SIGINT', (signal) => { + this.writableStream.close() + process.exit(0) + }) + + process.on('uncaughtException', (err) => { + this.writableStream.close() + process.exit(1) + }) + } +} diff --git a/src/index.ts b/src/index.ts index f4e31a8..719787d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,12 +2,23 @@ import { cyan, red, magenta, bold } from 'colorette' import statusEmoji from 'http-status-emojis' import dayjs from 'dayjs' import { METHODS, ServerResponse as Response, IncomingMessage as Request } from 'http' +import { FileLogger } from './filelogger' + +export enum LogLevel { + error = 'error', + warn = 'warn', + trace = 'trace', + info = 'info', + log = 'log' +} export interface LoggerOptions { methods?: string[] output?: { color: boolean + filename?: string callback: (string: string) => void + level?: LogLevel } timestamp?: boolean | { format?: string } emoji?: boolean @@ -24,12 +35,12 @@ const compileArgs = ( ) => { const { method } = req const { statusCode } = res - const url = req.originalUrl || req.url - const methods = options.methods ?? METHODS const timestamp = options.timestamp ?? false const emojiEnabled = options.emoji + const level = options.output && options.output.level ? options.output.level : null + if (level) args.push('[' + level.toUpperCase() + ']') if (methods.includes(method) && timestamp) { args.push( @@ -52,35 +63,42 @@ const compileArgs = ( export const logger = (options: LoggerOptions = {}) => { const methods = options.methods ?? METHODS - const output = options.output ?? { callback: console.log, color: true } - + const output = options.output ?? { callback: console.log, color: true, level: null } + let filelogger = null + if (options.output && options.output.filename) { + filelogger = new FileLogger(options.output.filename) + } return (req: Request, res: Response, next?: () => void) => { res.on('finish', () => { const args: (string | number)[] = [] - + // every time if (methods.includes(req.method)) { const s = res.statusCode.toString() - + let stringToLog = '' if (!output.color) { compileArgs(args, req, res, options) const m = args.join(' ') - output.callback(m) + stringToLog = m } else { switch (s[0]) { case '2': compileArgs(args, req, res, options, cyan(bold(s)), cyan(res.statusMessage)) - output.callback(args.join(' ')) + stringToLog = args.join(' ') break case '4': compileArgs(args, req, res, options, red(bold(s)), red(res.statusMessage)) - output.callback(args.join(' ')) + stringToLog = args.join(' ') break case '5': compileArgs(args, req, res, options, magenta(bold(s)), magenta(res.statusMessage)) - output.callback(args.join(' ')) + stringToLog = args.join(' ') break } } + output.callback(stringToLog) + if (filelogger) { + filelogger.toFile(stringToLog) + } } }) diff --git a/tests/index.test.ts b/tests/index.test.ts index 98de7ea..33ee27c 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,9 +1,11 @@ import { Context, suite, uvu } from 'uvu' -import { logger } from '../src/index' +import { LogLevel, logger } from '../src/index' import { cyan, red, magenta, bold } from 'colorette' import { makeFetch } from 'supertest-fetch' import { App } from '@tinyhttp/app' import expect from 'expect' +import * as assert from 'uvu/assert' +import { promises, constants as fsConstants, readFileSync, unlinkSync, existsSync } from 'fs' function describe(name: string, fn: (it: uvu.Test) => void) { const s = suite(name) @@ -11,6 +13,13 @@ function describe(name: string, fn: (it: uvu.Test) => void) { s.run() } +function checkFileExists(file) { + return promises + .access(file, fsConstants.F_OK) + .then(() => true) + .catch(() => false) +} + describe('Logger tests', (it) => { it('should use the timestamp format specified in the `format` property', () => { const originalConsoleLog = console.log @@ -35,7 +44,7 @@ describe('Logger tests', (it) => { const originalConsoleLog = console.log console.log = (log: string) => { - expect(log.split(' ')[0]).toMatch(/[0-9]{2}:[0-9]{2}:[0-9]{2}/) + expect(log).toMatch(/[0-9]{2}:[0-9]{2}:[0-9]{2}/) console.log = originalConsoleLog } @@ -50,6 +59,26 @@ describe('Logger tests', (it) => { server.close() }) }) + it('should check for levels when supplied', () => { + const level = LogLevel.log + const originalConsoleLog = console.log + + console.log = (log: string) => { + expect(log).toMatch(`[${level.toUpperCase()}] GET 404 Not Found /`) + console.log = originalConsoleLog + } + + const app = new App() + app.use(logger({ timestamp: false, output: { callback: console.log, color: false, level: level } })) + + const server = app.listen() + + makeFetch(server)('/') + .expect(404) + .then(() => { + server.close() + }) + }) it('should call a custom output function', () => { const customOutput = (log: string) => { @@ -67,6 +96,58 @@ describe('Logger tests', (it) => { server.close() }) }) + describe('Log file tests', (it) => { + it('should check if log file and directory is created', async (test) => { + const filename = './log/tiny.log' + + const app = new App() + app.use( + logger({ + output: { + callback: console.log, + color: false, + filename: filename, + level: LogLevel.log + } + }) + ) + const server = app.listen() + await makeFetch(server)('/') + .expect(404) + .then(async () => { + assert.equal(await checkFileExists(filename), true) + }) + .finally(() => server.close()) + }) + it('should read log file and check if logs are written', async (test) => { + const filename = './log/tiny.log' + const level = LogLevel.warn + const app = new App() + app.use( + logger({ + output: { + callback: console.warn, + color: false, + filename: filename, + level: level + } + }) + ) + + const server = app.listen() + await makeFetch(server)('/') + .expect(404) + .then(async () => { + assert.equal(await checkFileExists(filename), true) + }) + .then(() => { + expect(readFileSync(filename).toString('utf-8').split('\n').slice(-2, -1)[0]).toMatch( + `[${level.toUpperCase()}] GET 404 Not Found /` + ) + }) + .finally(() => server.close()) + }) + }) describe('Color logs', (it) => { const createColorTest = (status: number, color: string) => { diff --git a/tsconfig.json b/tsconfig.json index 29a9b5d..06585db 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,11 @@ "preserveSymlinks": true, "allowSyntheticDefaultImports": true, "moduleResolution": "Node", - "baseUrl": "." + "baseUrl": ".", + "declarationMap": true, + "composite": true, + "sourceMap": true, + "alwaysStrict": true }, "include": ["./src/*.ts"] } From 73b2b4cefc0c6b03251c03012752a9294496ec02 Mon Sep 17 00:00:00 2001 From: aarontravass Date: Sat, 27 May 2023 17:27:15 -0400 Subject: [PATCH 2/9] fix: remived existSync and used accessSync instead --- .gitattributes | 1 + .gitignore | 3 ++- src/filelogger.ts | 52 ++++++++++++++++++++++---------------------- tsconfig.tsbuildinfo | 1 + 4 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 .gitattributes create mode 100644 tsconfig.tsbuildinfo diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5a19e8a..080fd38 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules dist -coverage \ No newline at end of file +coverage +log \ No newline at end of file diff --git a/src/filelogger.ts b/src/filelogger.ts index ab83d9e..c70c1c6 100644 --- a/src/filelogger.ts +++ b/src/filelogger.ts @@ -1,5 +1,4 @@ import { - existsSync, accessSync, constants as fsConstants, writeFileSync, @@ -9,48 +8,49 @@ import { } from 'fs' import { dirname as directoryname } from 'path' + + export class FileLogger { - private readonly filename: string - private readonly dirname: string + readonly #filename: string + readonly #dirname: string private writableStream: WriteStream constructor(filename: string) { - this.dirname = directoryname(filename) - this.filename = filename - this._stat() - this._createWritableStream() + this.#dirname = directoryname(filename) + this.#filename = filename + this.#_stat() + this.#_createWritableStream() + } + + #fsAccess(filename: string, mode: number){ + try { + accessSync(filename, mode); + return true; + } catch (error) { + return false; + } } - private _stat() { + #_stat() { //check if file exists - if (existsSync(this.filename)) { - try { - // check for permissions - accessSync(this.filename) - return - } catch (error) { - throw new Error('Unable to read file. Check for permissions!') - } - } else { + if (!this.#fsAccess(this.#filename, fsConstants.W_OK)) { // check if directory exists - try { - accessSync(this.dirname) - } catch (error) { - mkdirSync(this.dirname, { recursive: true, mode: fsConstants.W_OK }) - } - writeFileSync(this.filename, '') + if (!this.#fsAccess(this.#dirname, fsConstants.W_OK)) { + mkdirSync(this.#dirname, { recursive: true, mode: fsConstants.W_OK }) + } + writeFileSync(this.#filename, '') return } } - private _createWritableStream() { - this.writableStream = createWriteStream(this.filename, { flags: 'a' }) + #_createWritableStream() { + this.writableStream = createWriteStream(this.#filename, { flags: 'a' }) } toFile(stringToLog: string) { this.writableStream.write(stringToLog + '\n') } - private _endStream() { + #_endStream() { process.on('exit', (code) => { this.writableStream.close() }) diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo new file mode 100644 index 0000000..0c33734 --- /dev/null +++ b/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es5.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.full.d.ts","./src/filelogger.ts","./node_modules/colorette/index.d.ts","./node_modules/dayjs/locale/types.d.ts","./node_modules/dayjs/locale/index.d.ts","./node_modules/dayjs/index.d.ts","./src/index.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"a94df2b3153860093bee922d97e272590f9fb04c18bd56c8032b09bd8e41dd16","afe62d5477ecff10ffe731de580eba88b14afd770764192ac05883c066d5502c","c8adda9f45d2f7ec9fb28c59859db32da6c2835f1fec96433e2729e5805fa46f",{"version":"73a0ee6395819b063df4b148211985f2e1442945c1a057204cf4cf6281760dc3","affectsGlobalScope":true},"d05d8c67116dceafc62e691c47ac89f8f10cf7313cd1b2fb4fe801c2bf1bb1a7","09d906c1aeb34304755b072698e6728d3e83ed0b6366cf82e695f7a0f078564e","c388f7099e83812b330b3d37649e6550e096f3d25ed18552d711bf8a5e339a19","9ee13abb39c50c2f45b5362dbadc55334e82dfc9789cfc070808e10dc5f60000","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true},"03c04ba2137908b3b6219ecadc3471d4e39bb9030e6404510ee6e87a3b590a2d",{"version":"772ff00e189d93488d1ca6f0f4dfba77bd090a99ed31e19a14bc16fad4078e48","affectsGlobalScope":true},"3d2bcfb9c4591832ec479f830c49c291419caeb19953506bdeef1c0e6ad79b03","ac0c7cb0a4c1bec60be2c0460b3bda1e674eaf2c98312d7b6f16a0bb58718e2d",{"version":"7e2181a6fc140b4525d5a45c204477c37fa78a635558e88552c68f76a4325403","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","0ea59475772c2a8fdeb1f41ad9b02025aff6423003ec7eaf8129ee846f438aee","276b547eeb8eeeee9a446a3bfa6e07d1c0199269bdcf33813abab1281394a9cb","c999f7816955f75b447823e3e4085f699600e2a4a3327907df9af65b0a9c0df6","64361245fe025cbbad90451dd3698f7e6822d465ef568cbee3a4d8ddb52e7cda","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","9b814e0806922056145bedb096f11b73bdce70cc871f3ccfc4ce00b2cba75718",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"2013a2215691096d953ce7cefbc71a6cd31ef14be092cd003792714c5cd23bde","affectsGlobalScope":true},"60155c38ec392043962a90006153f7e31187b93411f2d8f9b35f595e98b8d75f","2ad6a251b6ef19fd1f8498f83bb7b265033bd52287e1f6569d09544f18806713","bfa08f2c30c475aef1c9451855ba6b2acfdc64f61950a38fae75806d66fb85c2","159807eb55a9439f9a675bd493788190a6203b5f36c315f8c3acbfcb875c7072","fe31b2b31ac5453fc7b8eef32b62017e55b214ceb884f0b177f442af92e84682","dd72576c8ea64d55af46a386068503d3cfcecce84ed7e1cbd4ff4081ba67fafc",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"70a7e8a7880d55396285e4b85ff5bdf3af3083176abe07f944967836f2a43188","3570df7c6f3a976109f55b596a2d88c2f87e0574cd1502272594ee5c4e56d0ef","850e95721334c2aa7697b08782f443ec4286274e5024169d4443933544f359d7",{"version":"74e6cd21f7b5e29fab05060ea24e2b90aa254f16f3f62ccd7055bdb8fc7b2ff5","affectsGlobalScope":true},{"version":"5761c90b0cabdd6bd1f5fb1c3bf942088fdd39e18ed35dbe39b0c34bc733bf13","affectsGlobalScope":true},"1eb6c5569d41e6021832d0a8a71f45fecbc13d03ad7d306da485999148b64955","c05ef0ecf06540ad3039515c10d3b27f9380639ced40f4093fd073e1b5ff21d9","fd25a0d3e6448b61d33e1fe4e0667a1a87a77e53570b65a454937cf2dc92f967","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","24a68c38b5c66d6a6883624342560d88db670e97824b397e78d9dac121aa8bae","9a134dbb29f0af914d90b23f609b39019d66ed53db7d492ab6b04c67114559da","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","7b3781fbdfddbee8dba55ccee5aa74a7c8d6701ade11d49ab7d8cb1fcefe669e","c4aab2ec3a249f2a4caa9cbdb099752a80daf999b79d85aa3504cdfd6e559476",{"version":"666d3f264db693828f6edc2eb53ae6013e40f6e39278ca209c7a8a99ac91b62f","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","c764a6cf523d13f2304a23216cd1084e28c041eebabd8aa9b2a9d99866c668c0","1272a5c2bd05961adc473e905332b7a422b00485c10b41c752f7fcf6835e3436","30ef92bf8135ce36ba1231fe41715276f2a40be72a478ddeb862bc16672e8680",{"version":"4ace0a30a70fe5963442d75ea6e69f525671ae76f6e57ab7556c44839b4237e8","affectsGlobalScope":true},{"version":"a6f03dbf03c001fb3ac1c9bea6dde049dfff27ef8886cc4a886374aacf2e997d","affectsGlobalScope":true},"66bfb3de947abf4b117ee849c245425dbe494d6903e28f9ded566e91c9d05d77","c28d4f58131b93d60e087b86148d4e0c9d9b5c49c23ff1a9d1a9594fdedd5d08","c6b5d7f259544c91024ecf2b17138574a3f6ff2476468fafd7f957d2b68d6d98",{"version":"1ec27c4b695590464113276d174f873e260e468ef226b7dc18f9193875fa559d","affectsGlobalScope":true},"33da4ee2ab9fdd9ef8b3fc526d871ce02ae8c825283f5695e7cad507c087b97c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"71709584ed5ed7d236dc225441ec4634ffc6c718853e04b9c27b9ea121459044"],"root":[49,54],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"composite":true,"declaration":true,"declarationDir":"./dist","declarationMap":true,"emitDeclarationOnly":false,"importHelpers":true,"module":99,"noEmitHelpers":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"target":6},"fileIdsList":[[101],[55,101],[58,101],[59,64,92,101],[60,71,72,79,89,100,101],[60,61,71,79,101],[62,101],[63,64,72,80,101],[64,89,97,101],[65,67,71,79,101],[66,101],[67,68,101],[71,101],[69,71,101],[71,72,73,89,100,101],[71,72,73,86,89,92,101],[101,105],[67,71,74,79,89,100,101],[71,72,74,75,79,89,97,100,101],[74,76,89,97,100,101],[55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],[71,77,101],[78,100,101],[67,71,79,89,101],[80,101],[81,101],[58,82,101],[83,99,101,105],[84,101],[85,101],[71,86,87,101],[86,88,101,103],[59,71,89,90,91,92,101],[59,89,91,101],[89,90,101],[92,101],[93,101],[89,101],[71,95,96,101],[95,96,101],[64,79,89,97,101],[98,101],[79,99,101],[59,74,85,100,101],[64,101],[89,101,102],[101,103],[101,104],[59,64,71,73,82,89,100,101,103,105],[89,101,106],[52,101],[51,101],[72,81,101],[49,50,53,74,101]],"referencedMap":[[46,1],[47,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[48,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[55,2],[56,2],[58,3],[59,4],[60,5],[61,6],[62,7],[63,8],[64,9],[65,10],[66,11],[67,12],[68,12],[70,13],[69,14],[71,13],[72,15],[73,16],[57,17],[107,1],[74,18],[75,19],[76,20],[108,21],[77,22],[78,23],[79,24],[80,25],[81,26],[82,27],[83,28],[84,29],[85,30],[86,31],[87,31],[88,32],[89,33],[91,34],[90,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[50,1],[53,51],[52,52],[51,1],[49,53],[54,54]],"exportedModulesMap":[[46,1],[47,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[48,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[55,2],[56,2],[58,3],[59,4],[60,5],[61,6],[62,7],[63,8],[64,9],[65,10],[66,11],[67,12],[68,12],[70,13],[69,14],[71,13],[72,15],[73,16],[57,17],[107,1],[74,18],[75,19],[76,20],[108,21],[77,22],[78,23],[79,24],[80,25],[81,26],[82,27],[83,28],[84,29],[85,30],[86,31],[87,31],[88,32],[89,33],[91,34],[90,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[50,1],[53,51],[52,52],[51,1],[49,53],[54,54]],"semanticDiagnosticsPerFile":[46,47,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,48,36,33,34,35,37,7,38,43,44,39,40,41,42,1,45,11,10,55,56,58,59,60,61,62,63,64,65,66,67,68,70,69,71,72,73,57,107,74,75,76,108,77,78,79,80,81,82,83,84,85,86,87,88,89,91,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,50,53,52,51,49,54],"emitSignatures":[[49,"3036898736efb447153e19aeeb4a4e05d0cbc5244c93e2b85a6f06b45b6f2b15"],[54,"64428349d3ae81396fb387944e3f2e5e5b508b89841504d1cdf22a088644cf81"]],"latestChangedDtsFile":"./dist/index.d.ts"},"version":"5.0.4"} \ No newline at end of file From c12c4347ad0d31ff5825acc797ceb3723f3879b1 Mon Sep 17 00:00:00 2001 From: aarontravass Date: Sat, 27 May 2023 17:32:54 -0400 Subject: [PATCH 3/9] fix: added tslib to fix build error --- .gitignore | 3 ++- package.json | 2 ++ pnpm-lock.yaml | 20 ++++++++++++++++++-- src/filelogger.ts | 21 ++++++--------------- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 080fd38..648d2af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules dist coverage -log \ No newline at end of file +log +*.tsbuildinfo \ No newline at end of file diff --git a/package.json b/package.json index ca74942..ebf323a 100644 --- a/package.json +++ b/package.json @@ -54,9 +54,11 @@ "eslint-plugin-prettier": "^4.2.1", "expect": "^29.5.0", "husky": "^8.0.3", + "install": "^0.13.0", "prettier": "^2.8.8", "rollup": "^3.21.7", "supertest-fetch": "^1.5.0", + "tslib": "^2.5.2", "tsm": "^2.3.0", "typescript": "^5.0.4", "uvu": "^0.5.6" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6393660..d540f0d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ devDependencies: version: 17.6.3 '@rollup/plugin-typescript': specifier: ^11.1.1 - version: 11.1.1(rollup@3.21.7)(typescript@5.0.4) + version: 11.1.1(rollup@3.21.7)(tslib@2.5.2)(typescript@5.0.4) '@tinyhttp/app': specifier: 2.0.32 version: 2.0.32 @@ -51,6 +51,9 @@ devDependencies: husky: specifier: ^8.0.3 version: 8.0.3 + install: + specifier: ^0.13.0 + version: 0.13.0 prettier: specifier: ^2.8.8 version: 2.8.8 @@ -60,6 +63,9 @@ devDependencies: supertest-fetch: specifier: ^1.5.0 version: 1.5.0 + tslib: + specifier: ^2.5.2 + version: 2.5.2 tsm: specifier: ^2.3.0 version: 2.3.0 @@ -431,7 +437,7 @@ packages: fastq: 1.15.0 dev: true - /@rollup/plugin-typescript@11.1.1(rollup@3.21.7)(typescript@5.0.4): + /@rollup/plugin-typescript@11.1.1(rollup@3.21.7)(tslib@2.5.2)(typescript@5.0.4): resolution: {integrity: sha512-Ioir+x5Bejv72Lx2Zbz3/qGg7tvGbxQZALCLoJaGrkNXak/19+vKgKYJYM3i/fJxvsb23I9FuFQ8CUBEfsmBRg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -447,6 +453,7 @@ packages: '@rollup/pluginutils': 5.0.2(rollup@3.21.7) resolve: 1.22.2 rollup: 3.21.7 + tslib: 2.5.2 typescript: 5.0.4 dev: true @@ -1962,6 +1969,11 @@ packages: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} dev: true + /install@0.13.0: + resolution: {integrity: sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==} + engines: {node: '>= 0.10'} + dev: true + /ipaddr.js@2.0.1: resolution: {integrity: sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==} engines: {node: '>= 10'} @@ -2888,6 +2900,10 @@ packages: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: true + /tslib@2.5.2: + resolution: {integrity: sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==} + dev: true + /tsm@2.3.0: resolution: {integrity: sha512-++0HFnmmR+gMpDtKTnW3XJ4yv9kVGi20n+NfyQWB9qwJvTaIWY9kBmzek2YUQK5APTQ/1DTrXmm4QtFPmW9Rzw==} engines: {node: '>=12'} diff --git a/src/filelogger.ts b/src/filelogger.ts index c70c1c6..5e9dca9 100644 --- a/src/filelogger.ts +++ b/src/filelogger.ts @@ -1,15 +1,6 @@ -import { - accessSync, - constants as fsConstants, - writeFileSync, - createWriteStream, - WriteStream, - mkdirSync -} from 'fs' +import { accessSync, constants as fsConstants, writeFileSync, createWriteStream, WriteStream, mkdirSync } from 'fs' import { dirname as directoryname } from 'path' - - export class FileLogger { readonly #filename: string readonly #dirname: string @@ -21,12 +12,12 @@ export class FileLogger { this.#_createWritableStream() } - #fsAccess(filename: string, mode: number){ + #fsAccess(filename: string, mode: number) { try { - accessSync(filename, mode); - return true; + accessSync(filename, mode) + return true } catch (error) { - return false; + return false } } @@ -36,7 +27,7 @@ export class FileLogger { // check if directory exists if (!this.#fsAccess(this.#dirname, fsConstants.W_OK)) { mkdirSync(this.#dirname, { recursive: true, mode: fsConstants.W_OK }) - } + } writeFileSync(this.#filename, '') return } From 9ad2f37e6821c24783c19351309ea99ad7f52c4f Mon Sep 17 00:00:00 2001 From: aarontravass Date: Sat, 27 May 2023 17:37:12 -0400 Subject: [PATCH 4/9] chore: deleted tsbuildinfo --- tsconfig.tsbuildinfo | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tsconfig.tsbuildinfo diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo deleted file mode 100644 index 0c33734..0000000 --- a/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es5.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.webworker.importscripts.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.scripthost.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/lib/lib.es2019.full.d.ts","./src/filelogger.ts","./node_modules/colorette/index.d.ts","./node_modules/dayjs/locale/types.d.ts","./node_modules/dayjs/locale/index.d.ts","./node_modules/dayjs/index.d.ts","./src/index.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"c5c5565225fce2ede835725a92a28ece149f83542aa4866cfb10290bff7b8996","affectsGlobalScope":true},{"version":"7d2dbc2a0250400af0809b0ad5f84686e84c73526de931f84560e483eb16b03c","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"a94df2b3153860093bee922d97e272590f9fb04c18bd56c8032b09bd8e41dd16","afe62d5477ecff10ffe731de580eba88b14afd770764192ac05883c066d5502c","c8adda9f45d2f7ec9fb28c59859db32da6c2835f1fec96433e2729e5805fa46f",{"version":"73a0ee6395819b063df4b148211985f2e1442945c1a057204cf4cf6281760dc3","affectsGlobalScope":true},"d05d8c67116dceafc62e691c47ac89f8f10cf7313cd1b2fb4fe801c2bf1bb1a7","09d906c1aeb34304755b072698e6728d3e83ed0b6366cf82e695f7a0f078564e","c388f7099e83812b330b3d37649e6550e096f3d25ed18552d711bf8a5e339a19","9ee13abb39c50c2f45b5362dbadc55334e82dfc9789cfc070808e10dc5f60000","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"f749812878fecfa53cfc13b36e5d35086fb6377983a9df44175da83ccc23af1f","affectsGlobalScope":true},"03c04ba2137908b3b6219ecadc3471d4e39bb9030e6404510ee6e87a3b590a2d",{"version":"772ff00e189d93488d1ca6f0f4dfba77bd090a99ed31e19a14bc16fad4078e48","affectsGlobalScope":true},"3d2bcfb9c4591832ec479f830c49c291419caeb19953506bdeef1c0e6ad79b03","ac0c7cb0a4c1bec60be2c0460b3bda1e674eaf2c98312d7b6f16a0bb58718e2d",{"version":"7e2181a6fc140b4525d5a45c204477c37fa78a635558e88552c68f76a4325403","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","0ea59475772c2a8fdeb1f41ad9b02025aff6423003ec7eaf8129ee846f438aee","276b547eeb8eeeee9a446a3bfa6e07d1c0199269bdcf33813abab1281394a9cb","c999f7816955f75b447823e3e4085f699600e2a4a3327907df9af65b0a9c0df6","64361245fe025cbbad90451dd3698f7e6822d465ef568cbee3a4d8ddb52e7cda","8e6b05abc98adba15e1ac78e137c64576c74002e301d682e66feb77a23907ab8","9b814e0806922056145bedb096f11b73bdce70cc871f3ccfc4ce00b2cba75718",{"version":"6b526a5ec4a401ca7c26cfe6a48e641d8f30af76673bad3b06a1b4504594a960","affectsGlobalScope":true},{"version":"2013a2215691096d953ce7cefbc71a6cd31ef14be092cd003792714c5cd23bde","affectsGlobalScope":true},"60155c38ec392043962a90006153f7e31187b93411f2d8f9b35f595e98b8d75f","2ad6a251b6ef19fd1f8498f83bb7b265033bd52287e1f6569d09544f18806713","bfa08f2c30c475aef1c9451855ba6b2acfdc64f61950a38fae75806d66fb85c2","159807eb55a9439f9a675bd493788190a6203b5f36c315f8c3acbfcb875c7072","fe31b2b31ac5453fc7b8eef32b62017e55b214ceb884f0b177f442af92e84682","dd72576c8ea64d55af46a386068503d3cfcecce84ed7e1cbd4ff4081ba67fafc",{"version":"125af9d85cb9d5e508353f10a8d52f01652d2d48b2cea54789a33e5b4d289c1c","affectsGlobalScope":true},"70a7e8a7880d55396285e4b85ff5bdf3af3083176abe07f944967836f2a43188","3570df7c6f3a976109f55b596a2d88c2f87e0574cd1502272594ee5c4e56d0ef","850e95721334c2aa7697b08782f443ec4286274e5024169d4443933544f359d7",{"version":"74e6cd21f7b5e29fab05060ea24e2b90aa254f16f3f62ccd7055bdb8fc7b2ff5","affectsGlobalScope":true},{"version":"5761c90b0cabdd6bd1f5fb1c3bf942088fdd39e18ed35dbe39b0c34bc733bf13","affectsGlobalScope":true},"1eb6c5569d41e6021832d0a8a71f45fecbc13d03ad7d306da485999148b64955","c05ef0ecf06540ad3039515c10d3b27f9380639ced40f4093fd073e1b5ff21d9","fd25a0d3e6448b61d33e1fe4e0667a1a87a77e53570b65a454937cf2dc92f967","c27b01e8ddff5cd280711af5e13aecd9a3228d1c256ea797dd64f8fdec5f7df5","24a68c38b5c66d6a6883624342560d88db670e97824b397e78d9dac121aa8bae","9a134dbb29f0af914d90b23f609b39019d66ed53db7d492ab6b04c67114559da","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","785e5be57d4f20f290a20e7b0c6263f6c57fd6e51283050756cef07d6d651c68","44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","7b3781fbdfddbee8dba55ccee5aa74a7c8d6701ade11d49ab7d8cb1fcefe669e","c4aab2ec3a249f2a4caa9cbdb099752a80daf999b79d85aa3504cdfd6e559476",{"version":"666d3f264db693828f6edc2eb53ae6013e40f6e39278ca209c7a8a99ac91b62f","affectsGlobalScope":true},"ad08154d9602429522cac965a715fde27d421d69b24756c5d291877dda75353e","c764a6cf523d13f2304a23216cd1084e28c041eebabd8aa9b2a9d99866c668c0","1272a5c2bd05961adc473e905332b7a422b00485c10b41c752f7fcf6835e3436","30ef92bf8135ce36ba1231fe41715276f2a40be72a478ddeb862bc16672e8680",{"version":"4ace0a30a70fe5963442d75ea6e69f525671ae76f6e57ab7556c44839b4237e8","affectsGlobalScope":true},{"version":"a6f03dbf03c001fb3ac1c9bea6dde049dfff27ef8886cc4a886374aacf2e997d","affectsGlobalScope":true},"66bfb3de947abf4b117ee849c245425dbe494d6903e28f9ded566e91c9d05d77","c28d4f58131b93d60e087b86148d4e0c9d9b5c49c23ff1a9d1a9594fdedd5d08","c6b5d7f259544c91024ecf2b17138574a3f6ff2476468fafd7f957d2b68d6d98",{"version":"1ec27c4b695590464113276d174f873e260e468ef226b7dc18f9193875fa559d","affectsGlobalScope":true},"33da4ee2ab9fdd9ef8b3fc526d871ce02ae8c825283f5695e7cad507c087b97c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"71709584ed5ed7d236dc225441ec4634ffc6c718853e04b9c27b9ea121459044"],"root":[49,54],"options":{"allowSyntheticDefaultImports":true,"alwaysStrict":true,"composite":true,"declaration":true,"declarationDir":"./dist","declarationMap":true,"emitDeclarationOnly":false,"importHelpers":true,"module":99,"noEmitHelpers":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"target":6},"fileIdsList":[[101],[55,101],[58,101],[59,64,92,101],[60,71,72,79,89,100,101],[60,61,71,79,101],[62,101],[63,64,72,80,101],[64,89,97,101],[65,67,71,79,101],[66,101],[67,68,101],[71,101],[69,71,101],[71,72,73,89,100,101],[71,72,73,86,89,92,101],[101,105],[67,71,74,79,89,100,101],[71,72,74,75,79,89,97,100,101],[74,76,89,97,100,101],[55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],[71,77,101],[78,100,101],[67,71,79,89,101],[80,101],[81,101],[58,82,101],[83,99,101,105],[84,101],[85,101],[71,86,87,101],[86,88,101,103],[59,71,89,90,91,92,101],[59,89,91,101],[89,90,101],[92,101],[93,101],[89,101],[71,95,96,101],[95,96,101],[64,79,89,97,101],[98,101],[79,99,101],[59,74,85,100,101],[64,101],[89,101,102],[101,103],[101,104],[59,64,71,73,82,89,100,101,103,105],[89,101,106],[52,101],[51,101],[72,81,101],[49,50,53,74,101]],"referencedMap":[[46,1],[47,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[48,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[55,2],[56,2],[58,3],[59,4],[60,5],[61,6],[62,7],[63,8],[64,9],[65,10],[66,11],[67,12],[68,12],[70,13],[69,14],[71,13],[72,15],[73,16],[57,17],[107,1],[74,18],[75,19],[76,20],[108,21],[77,22],[78,23],[79,24],[80,25],[81,26],[82,27],[83,28],[84,29],[85,30],[86,31],[87,31],[88,32],[89,33],[91,34],[90,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[50,1],[53,51],[52,52],[51,1],[49,53],[54,54]],"exportedModulesMap":[[46,1],[47,1],[8,1],[9,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[25,1],[22,1],[23,1],[24,1],[26,1],[27,1],[28,1],[5,1],[29,1],[30,1],[31,1],[32,1],[6,1],[48,1],[36,1],[33,1],[34,1],[35,1],[37,1],[7,1],[38,1],[43,1],[44,1],[39,1],[40,1],[41,1],[42,1],[1,1],[45,1],[11,1],[10,1],[55,2],[56,2],[58,3],[59,4],[60,5],[61,6],[62,7],[63,8],[64,9],[65,10],[66,11],[67,12],[68,12],[70,13],[69,14],[71,13],[72,15],[73,16],[57,17],[107,1],[74,18],[75,19],[76,20],[108,21],[77,22],[78,23],[79,24],[80,25],[81,26],[82,27],[83,28],[84,29],[85,30],[86,31],[87,31],[88,32],[89,33],[91,34],[90,35],[92,36],[93,37],[94,38],[95,39],[96,40],[97,41],[98,42],[99,43],[100,44],[101,45],[102,46],[103,47],[104,48],[105,49],[106,50],[50,1],[53,51],[52,52],[51,1],[49,53],[54,54]],"semanticDiagnosticsPerFile":[46,47,8,9,13,12,2,14,15,16,17,18,19,20,21,3,4,25,22,23,24,26,27,28,5,29,30,31,32,6,48,36,33,34,35,37,7,38,43,44,39,40,41,42,1,45,11,10,55,56,58,59,60,61,62,63,64,65,66,67,68,70,69,71,72,73,57,107,74,75,76,108,77,78,79,80,81,82,83,84,85,86,87,88,89,91,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,50,53,52,51,49,54],"emitSignatures":[[49,"3036898736efb447153e19aeeb4a4e05d0cbc5244c93e2b85a6f06b45b6f2b15"],[54,"64428349d3ae81396fb387944e3f2e5e5b508b89841504d1cdf22a088644cf81"]],"latestChangedDtsFile":"./dist/index.d.ts"},"version":"5.0.4"} \ No newline at end of file From 71e3303c549dc0e826f38ab99c21fcc4a836a642 Mon Sep 17 00:00:00 2001 From: aarontravass <43901677+aarontravass@users.noreply.github.com> Date: Sun, 28 May 2023 15:54:51 -0400 Subject: [PATCH 5/9] build: removed install modules --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 5fd06bc..135e02c 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "eslint-plugin-prettier": "^4.2.1", "expect": "^29.5.0", "husky": "^8.0.3", - "install": "^0.13.0", "prettier": "^2.8.8", "rollup": "^3.23.0", "supertest-fetch": "^1.5.0", From b5921e73b2b8ac61fe42143f3241f0e32680d128 Mon Sep 17 00:00:00 2001 From: aarontravass <43901677+aarontravass@users.noreply.github.com> Date: Tue, 30 May 2023 10:16:36 -0400 Subject: [PATCH 6/9] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 52d3cd3..0a8cffb 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,43 @@ new App() .listen(3000) ``` +To Log a level, use the enum `LogLevel` + +```ts +import { App } from '@tinyhttp/app' +import { logger } from '@tinyhttp/logger' + +new App() + .use( + logger({ + methods: ['GET', 'POST'], + timestamp: { format: 'HH:mm:ss' }, + output: { callback: console.log, color: false, level: LogLevel.warn } + }) + ) + .get('/', (req, res) => res.send('Hello world')) + .listen(3000) +``` + +This also includes a simple file logger. To stream to a file, simply supply the filename in the options. Supported file names innclude +`./file.log` or `./log/tiny.log` + +```ts +import { App } from '@tinyhttp/app' +import { logger } from '@tinyhttp/logger' + +new App() + .use( + logger({ + methods: ['GET', 'POST'], + timestamp: { format: 'HH:mm:ss' }, + output: { callback: console.log, color: false, filename: "./log/tiny.log" } + }) + ) + .get('/', (req, res) => res.send('Hello world')) + .listen(3000) +``` + ## Alternatives - [Pino](https://getpino.io) - super fast, all natural json logger. From e30ea48e8938f114b9778740ce9e8fc80ee168a2 Mon Sep 17 00:00:00 2001 From: aarontravass <43901677+aarontravass@users.noreply.github.com> Date: Tue, 30 May 2023 10:17:12 -0400 Subject: [PATCH 7/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a8cffb..0ee725e 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ To Log a level, use the enum `LogLevel` ```ts import { App } from '@tinyhttp/app' -import { logger } from '@tinyhttp/logger' +import { logger, LogLevel } from '@tinyhttp/logger' new App() .use( From a6e2fac556ed79ba8ffde72d957ecea99126749c Mon Sep 17 00:00:00 2001 From: aarontravass Date: Tue, 30 May 2023 19:32:50 -0400 Subject: [PATCH 8/9] test: fix hanging tests --- README.md | 2 +- pnpm-lock.yaml | 13 +++---------- tests/index.test.ts | 4 +++- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0ee725e..6db0242 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ new App() logger({ methods: ['GET', 'POST'], timestamp: { format: 'HH:mm:ss' }, - output: { callback: console.log, color: false, filename: "./log/tiny.log" } + output: { callback: console.log, color: false, filename: './log/tiny.log' } }) ) .get('/', (req, res) => res.send('Hello world')) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3132b8a..6087f81 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ devDependencies: version: 17.6.3 '@rollup/plugin-typescript': specifier: ^11.1.1 - version: 11.1.1(rollup@3.23.0)(typescript@5.0.4) + version: 11.1.1(rollup@3.23.0)(tslib@2.5.2)(typescript@5.0.4) '@tinyhttp/app': specifier: 2.1.0 version: 2.1.0 @@ -51,9 +51,6 @@ devDependencies: husky: specifier: ^8.0.3 version: 8.0.3 - install: - specifier: ^0.13.0 - version: 0.13.0 prettier: specifier: ^2.8.8 version: 2.8.8 @@ -437,7 +434,7 @@ packages: fastq: 1.15.0 dev: true - /@rollup/plugin-typescript@11.1.1(rollup@3.23.0)(typescript@5.0.4): + /@rollup/plugin-typescript@11.1.1(rollup@3.23.0)(tslib@2.5.2)(typescript@5.0.4): resolution: {integrity: sha512-Ioir+x5Bejv72Lx2Zbz3/qGg7tvGbxQZALCLoJaGrkNXak/19+vKgKYJYM3i/fJxvsb23I9FuFQ8CUBEfsmBRg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -453,6 +450,7 @@ packages: '@rollup/pluginutils': 5.0.2(rollup@3.23.0) resolve: 1.22.2 rollup: 3.23.0 + tslib: 2.5.2 typescript: 5.0.4 dev: true @@ -1971,11 +1969,6 @@ packages: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} dev: true - /install@0.13.0: - resolution: {integrity: sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==} - engines: {node: '>= 0.10'} - dev: true - /ipaddr.js@2.0.1: resolution: {integrity: sha512-1qTgH9NG+IIJ4yfKs2e6Pp1bZg8wbDbKHT21HrLIeYBTRLgMYKnMTPAuI3Lcs61nfx5h1xlXnbJtH1kX5/d/ng==} engines: {node: '>= 10'} diff --git a/tests/index.test.ts b/tests/index.test.ts index 33ee27c..a2d3434 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -169,7 +169,9 @@ describe('Logger tests', (it) => { const server = app.listen() - await makeFetch(server)('/').expect(status) + await makeFetch(server)('/') + .expect(status) + .then(async () => await server.close()) } } From 645435903d43a596b92e98d4557f3717f57280c0 Mon Sep 17 00:00:00 2001 From: aarontravass <43901677+aarontravass@users.noreply.github.com> Date: Wed, 31 May 2023 18:07:48 +0000 Subject: [PATCH 9/9] test: fixed hanging tests and permission errors --- src/filelogger.ts | 21 ++++++++++++--------- tests/index.test.ts | 7 ++++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/filelogger.ts b/src/filelogger.ts index 5e9dca9..ceed4ad 100644 --- a/src/filelogger.ts +++ b/src/filelogger.ts @@ -1,4 +1,4 @@ -import { accessSync, constants as fsConstants, writeFileSync, createWriteStream, WriteStream, mkdirSync } from 'fs' +import { accessSync, writeFileSync, createWriteStream, WriteStream, mkdirSync } from 'fs' import { dirname as directoryname } from 'path' export class FileLogger { @@ -10,9 +10,10 @@ export class FileLogger { this.#filename = filename this.#_stat() this.#_createWritableStream() + this.#_endStream() } - #fsAccess(filename: string, mode: number) { + #fsAccess(filename: string, mode?: number) { try { accessSync(filename, mode) return true @@ -23,11 +24,13 @@ export class FileLogger { #_stat() { //check if file exists - if (!this.#fsAccess(this.#filename, fsConstants.W_OK)) { + if (!this.#fsAccess(this.#filename)) { // check if directory exists - if (!this.#fsAccess(this.#dirname, fsConstants.W_OK)) { - mkdirSync(this.#dirname, { recursive: true, mode: fsConstants.W_OK }) + if (!this.#fsAccess(this.#dirname)) { + // create the directory + mkdirSync(this.#dirname, { recursive: true }) } + // create the file and write an empty string to it writeFileSync(this.#filename, '') return } @@ -42,21 +45,21 @@ export class FileLogger { } #_endStream() { - process.on('exit', (code) => { + process.on('exit', () => { this.writableStream.close() }) - process.on('SIGTERM', (signal) => { + process.on('SIGTERM', () => { this.writableStream.close() process.exit(0) }) - process.on('SIGINT', (signal) => { + process.on('SIGINT', () => { this.writableStream.close() process.exit(0) }) - process.on('uncaughtException', (err) => { + process.on('uncaughtException', () => { this.writableStream.close() process.exit(1) }) diff --git a/tests/index.test.ts b/tests/index.test.ts index a2d3434..65cb33e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -6,6 +6,7 @@ import { App } from '@tinyhttp/app' import expect from 'expect' import * as assert from 'uvu/assert' import { promises, constants as fsConstants, readFileSync, unlinkSync, existsSync } from 'fs' +import { resolve } from 'path' function describe(name: string, fn: (it: uvu.Test) => void) { const s = suite(name) @@ -15,7 +16,7 @@ function describe(name: string, fn: (it: uvu.Test) => void) { function checkFileExists(file) { return promises - .access(file, fsConstants.F_OK) + .access(file) .then(() => true) .catch(() => false) } @@ -98,7 +99,7 @@ describe('Logger tests', (it) => { }) describe('Log file tests', (it) => { it('should check if log file and directory is created', async (test) => { - const filename = './log/tiny.log' + const filename = './tests/tiny.log' const app = new App() app.use( @@ -120,7 +121,7 @@ describe('Logger tests', (it) => { .finally(() => server.close()) }) it('should read log file and check if logs are written', async (test) => { - const filename = './log/tiny.log' + const filename = './logs/test1/tiny.log' const level = LogLevel.warn const app = new App() app.use(