From dfa9333b24e59a56ea693aec05d4d9c4d052de41 Mon Sep 17 00:00:00 2001 From: Patrick Organ Date: Fri, 12 May 2023 07:33:21 -0400 Subject: [PATCH] fixes --- rollup.config.js | 7 +++++-- src/ArgumentConverter.ts | 9 +++------ src/Payloads/HtmlMarkupPayload.ts | 4 ++-- src/Payloads/XmlPayload.ts | 4 ++-- src/Ray.ts | 8 ++++---- tsconfig.json | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 317a34e..1d83d16 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -40,6 +40,7 @@ const outputs = { file: 'dist/index.esm.mjs', format: 'esm', sourcemap: options.sourceMapsEnabled, + exports: 'auto', plugins: [], }, ], @@ -57,7 +58,9 @@ export default { }, preventAssignment: true, }), - commonjs(), + commonjs({ + requireReturnsDefault: 'auto', + }), nodeResolve(), json(), typescript(), @@ -68,7 +71,7 @@ export default { 'dayjs', 'stopwatch-node', 'md5', - '@permafrost-dev/pretty-format', + //@permafrost-dev/pretty-format', 'stacktrace-js', 'xml-formatter', 'uuid', diff --git a/src/ArgumentConverter.ts b/src/ArgumentConverter.ts index 0886a26..e79eb79 100644 --- a/src/ArgumentConverter.ts +++ b/src/ArgumentConverter.ts @@ -1,7 +1,6 @@ -const pf = require('@permafrost-dev/pretty-format'); -// import * as format from '@permafrost-dev/pretty-format'; +import { format } from '@permafrost-dev/pretty-format'; -const prettyFormat = pf.format; +const prettyFormat = format; export interface ArgumentConverterResult { value: any; @@ -30,9 +29,7 @@ export class ArgumentConverter { } public static prettyFormatForHtml(arg: any): string { - const formatted = prettyFormat(arg, { - indent: 4, - }) + const formatted = prettyFormat(arg, { indent: ' ' } as any, ' ', 10, [], false) // format whitespace for display in html .replace(/ /g, ' ') .replace(/\r\n|\r|\n/g, '
') diff --git a/src/Payloads/HtmlMarkupPayload.ts b/src/Payloads/HtmlMarkupPayload.ts index d8ccbe4..3a0ce9d 100644 --- a/src/Payloads/HtmlMarkupPayload.ts +++ b/src/Payloads/HtmlMarkupPayload.ts @@ -1,8 +1,8 @@ import { Payload } from '../Payloads/Payload'; -// import formatXml from 'xml-formatter'; +import formatXml from 'xml-formatter'; import { formatHtmlForDisplay } from '../lib/utils'; -const formatXml = require('xml-formatter').default; +// const formatXml = require('xml-formatter').default; export type HtmlMarkupHighlightTypes = 'tailwindcss' | 'none'; export interface HtmlMarkupOptions { diff --git a/src/Payloads/XmlPayload.ts b/src/Payloads/XmlPayload.ts index f72283f..0dd359a 100644 --- a/src/Payloads/XmlPayload.ts +++ b/src/Payloads/XmlPayload.ts @@ -1,8 +1,8 @@ import { Payload } from '../Payloads/Payload'; -// import formatXml from 'xml-formatter/dist/esm/index'; +import formatXml from 'xml-formatter/dist/esm/index'; import { formatHtmlForDisplay } from '../lib/utils'; -const formatXml = require('xml-formatter'); +// const formatXml = require('xml-formatter'); export class XmlPayload extends Payload { protected value: string; diff --git a/src/Ray.ts b/src/Ray.ts index 221d78a..0ae859a 100644 --- a/src/Ray.ts +++ b/src/Ray.ts @@ -5,9 +5,8 @@ // @ts-ignore const BUILDING_STANDALONE_LIB = typeof __BUILDING_STANDALONE_LIB__ !== 'undefined' && __BUILDING_STANDALONE_LIB__ === 'true'; -1; -//import * as md5lib from 'md5'; +import * as md5lib from 'md5'; import { RayScreenColors } from '@/Concerns/RayScreenColors'; import { StackTrace } from '@/lib/stacktrace'; import { Mixin } from 'ts-mixer'; @@ -60,7 +59,8 @@ import { nonCryptoUuidV4, sleep } from './lib/utils'; import PACKAGE_VERSION from './lib/version'; import { Client } from './Client'; -const md5 = require('md5'); +// const md5 = require('md5'); +const md5 = md5lib.default; const getSync = StackTrace.getSync; @@ -871,5 +871,5 @@ function standaloneInitialization() { } //if (BUILDING_STANDALONE_LIB) { -standaloneInitialization(); +// standaloneInitialization(); //} diff --git a/tsconfig.json b/tsconfig.json index 5cc47f4..ef33f38 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ // "incremental": true, /* Enable incremental compilation */ "target": "ES2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, "module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, - "lib": ["esnext", "DOM", "ScriptHost"] /* Specify library files to be included in the compilation. */, + "lib": ["esnext", "DOM"] /* Specify library files to be included in the compilation. */, "allowJs": true /* Allow javascript files to be compiled. */, // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ @@ -54,7 +54,7 @@ "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */, "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ - "allowUmdGlobalAccess": true /* Allow accessing UMD globals from modules. */, + // "allowUmdGlobalAccess": true /* Allow accessing UMD globals from modules. */, /* Source Map Options */ // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */