From 63dd5e35a5856bcd1670b7b1cf21ffd854928ef7 Mon Sep 17 00:00:00 2001 From: Ofek Date: Sun, 27 Oct 2024 15:28:38 +0200 Subject: [PATCH] Various tsifications (#7025) --- app.ts | 31 ++++--- lib/base-compiler.ts | 4 +- lib/buildenvsetup/ceconan.ts | 8 +- lib/clientstate-normalizer.ts | 30 ++++--- lib/clientstate.ts | 1 + lib/compilers/clang.ts | 2 +- lib/compilers/cppfront.ts | 2 +- lib/compilers/gnucobol.ts | 2 +- lib/compilers/jakt.ts | 2 +- lib/compilers/rust.ts | 2 +- lib/compilers/snowball.ts | 2 +- lib/compilers/v.ts | 2 +- lib/compilers/vala.ts | 2 +- lib/compilers/win32.ts | 4 +- lib/handlers/noscript.ts | 4 +- lib/handlers/route-api.ts | 2 +- lib/logger.ts | 4 +- lib/stats.ts | 3 +- package-lock.json | 86 ++++++++++++++++++- package.json | 1 + ...ized => andthekitchensink.normalized.json} | 0 ...alized => conformanceview.normalized.json} | 0 ...on.normalized => executor.normalized.json} | 1 + ...ormalized => executorwrap.normalized.json} | 1 + test/state/libsegfault.normalized.json | 1 + ...ormalized => twocompilers.normalized.json} | 0 test/statenormalisation-tests.ts | 10 +-- test/stats-test.ts | 2 - 28 files changed, 158 insertions(+), 51 deletions(-) rename test/state/{andthekitchensink.json.normalized => andthekitchensink.normalized.json} (100%) rename test/state/{conformanceview.json.normalized => conformanceview.normalized.json} (100%) rename test/state/{executor.json.normalized => executor.normalized.json} (98%) rename test/state/{executorwrap.json.normalized => executorwrap.normalized.json} (98%) rename test/state/{twocompilers.json.normalized => twocompilers.normalized.json} (100%) diff --git a/app.ts b/app.ts index 304a4f2ae..3e1543c94 100755 --- a/app.ts +++ b/app.ts @@ -49,6 +49,7 @@ import urljoin from 'url-join'; import * as aws from './lib/aws.js'; import * as normalizer from './lib/clientstate-normalizer.js'; +import {GoldenLayoutRootStruct} from './lib/clientstate-normalizer.js'; import {CompilationEnvironment} from './lib/compilation-env.js'; import {CompilationQueue} from './lib/compilation-queue.js'; import {CompilerFinder} from './lib/compiler-finder.js'; @@ -59,7 +60,7 @@ import {startExecutionWorkerThread} from './lib/execution/sqs-execution-queue.js import {CompileHandler} from './lib/handlers/compile.js'; import * as healthCheck from './lib/handlers/health-check.js'; import {NoScriptHandler} from './lib/handlers/noscript.js'; -import {RouteAPI} from './lib/handlers/route-api.js'; +import {RouteAPI, ShortLinkMetaData} from './lib/handlers/route-api.js'; import {loadSiteTemplates} from './lib/handlers/site-templates.js'; import {SourceHandler} from './lib/handlers/source.js'; import {languages as allLanguages} from './lib/languages.js'; @@ -80,9 +81,10 @@ import type {Language, LanguageKey} from './types/languages.interfaces.js'; // Used by assert.ts global.ce_base_directory = new URL('.', import.meta.url); -(nopt as any).invalidHandler = (key, val, types) => { +(nopt as any).invalidHandler = (key: string, val: unknown, types: unknown[]) => { logger.error( - `Command line argument type error for "--${key}=${val}", expected ${types.map(t => typeof t).join(' | ')}`, + `Command line argument type error for "--${key}=${val}", + expected ${types.map((t: unknown) => typeof t).join(' | ')}`, ); }; @@ -323,7 +325,7 @@ const httpRoot = urljoin(ceProps('httpRoot', '/'), '/'); const staticUrl = ceProps('staticUrl'); const staticRoot = urljoin(staticUrl || urljoin(httpRoot, 'static'), '/'); -function staticHeaders(res) { +function staticHeaders(res: express.Response) { if (staticMaxAgeSecs) { res.setHeader('Cache-Control', 'public, max-age=' + staticMaxAgeSecs + ', must-revalidate'); } @@ -546,7 +548,7 @@ async function main() { if (releaseBuildNumber) logger.info(` release build ${releaseBuildNumber}`); let initialCompilers: CompilerInfo[]; - let prevCompilers; + let prevCompilers: CompilerInfo[]; const isExecutionWorker = ceProps('execqueue.is_worker', false); @@ -655,7 +657,7 @@ async function main() { .use( responseTime((req, res, time) => { if (sentrySlowRequestMs > 0 && time >= sentrySlowRequestMs) { - Sentry.withScope(scope => { + Sentry.withScope((scope: Sentry.Scope) => { scope.setExtra('duration_ms', time); Sentry.captureMessage('SlowRequest', 'warning'); }); @@ -675,7 +677,7 @@ async function main() { // sentry error handler must be the first error handling middleware .use(Sentry.Handlers.errorHandler) // eslint-disable-next-line no-unused-vars - .use((err, req, res, next) => { + .use((err: any, req: express.Request, res: express.Response, _next: express.NextFunction) => { const status = err.status || err.statusCode || err.status_code || (err.output && err.output.statusCode) || 500; const message = err.message || 'Internal Server Error'; @@ -690,7 +692,7 @@ async function main() { loadSiteTemplates(configDir); - function renderConfig(extra, urlOptions?) { + function renderConfig(extra: Record, urlOptions?: any) { const urlOptionsAllowed = ['readOnly', 'hideEditorToolbars', 'language']; const filteredUrlOptions = _.mapObject(_.pick(urlOptions, urlOptionsAllowed), val => utils.toProperty(val)); const allExtraOptions = _.extend({}, filteredUrlOptions, extra); @@ -720,7 +722,12 @@ async function main() { return req.header('CloudFront-Is-Mobile-Viewer') === 'true'; } - function renderGoldenLayout(config, metadata, req: express.Request, res: express.Response) { + function renderGoldenLayout( + config: GoldenLayoutRootStruct, + metadata: ShortLinkMetaData, + req: express.Request, + res: express.Response, + ) { staticHeaders(res); contentPolicyHeader(res); @@ -768,21 +775,21 @@ async function main() { morgan(morganFormat, { stream: makeLogStream('info'), // Skip for non errors (2xx, 3xx) - skip: (req, res) => res.statusCode >= 400, + skip: (req: express.Request, res: express.Response) => res.statusCode >= 400, }), ) .use( morgan(morganFormat, { stream: makeLogStream('warn'), // Skip for non user errors (4xx) - skip: (req, res) => res.statusCode < 400 || res.statusCode >= 500, + skip: (req: express.Request, res: express.Response) => res.statusCode < 400 || res.statusCode >= 500, }), ) .use( morgan(morganFormat, { stream: makeLogStream('error'), // Skip for non server errors (5xx) - skip: (req, res) => res.statusCode < 500, + skip: (req: express.Request, res: express.Response) => res.statusCode < 500, }), ) .use(compression()) diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts index 2617d1889..0bce23d15 100644 --- a/lib/base-compiler.ts +++ b/lib/base-compiler.ts @@ -2490,7 +2490,7 @@ export class BaseCompiler implements ICompiler { }; } - handleUserBuildError(error, dirPath): BuildResult { + handleUserBuildError(error: any, dirPath: string): BuildResult { return { dirPath, okToCache: false, @@ -2994,7 +2994,7 @@ export class BaseCompiler implements ICompiler { backendOptions: Record, filters: ParseFiltersAndOutputOptions, options: string[], - optOutput, + optOutput: LLVMOptInfo[] | undefined, stackUsageOutput: StackUsage.StackUsageInfo[] | undefined, bypassCache: BypassCache, customBuildPath?: string, diff --git a/lib/buildenvsetup/ceconan.ts b/lib/buildenvsetup/ceconan.ts index ee314378d..222fc2b1d 100644 --- a/lib/buildenvsetup/ceconan.ts +++ b/lib/buildenvsetup/ceconan.ts @@ -99,7 +99,7 @@ export class BuildEnvSetupCeConanDirect extends BuildEnvSetupBase { }); } - async getPackageUrl(libid, version, hash): Promise { + async getPackageUrl(libid: string, version: string, hash: string): Promise { return new Promise((resolve, reject) => { const encLibid = encodeURIComponent(libid); const encVersion = encodeURIComponent(version); @@ -132,8 +132,8 @@ export class BuildEnvSetupCeConanDirect extends BuildEnvSetupBase { } async downloadAndExtractPackage( - libId, - version, + libId: string, + version: string, downloadPath: string, packageUrl: string, ): Promise { @@ -240,7 +240,7 @@ export class BuildEnvSetupCeConanDirect extends BuildEnvSetupBase { }; } - async findMatchingHash(buildProperties: ConanBuildProperties, possibleBuilds) { + async findMatchingHash(buildProperties: ConanBuildProperties, possibleBuilds: any) { return _.findKey(possibleBuilds, elem => { return _.all(buildProperties, (val, key) => { if ((key === 'compiler' || key === 'compiler.version') && elem.settings[key] === 'cshared') { diff --git a/lib/clientstate-normalizer.ts b/lib/clientstate-normalizer.ts index 98c59e83f..fbfab23a0 100644 --- a/lib/clientstate-normalizer.ts +++ b/lib/clientstate-normalizer.ts @@ -50,7 +50,7 @@ type GoldenLayoutComponentStruct = { reorderEnabled: boolean; }; -type GoldenLayoutRootStruct = { +export type GoldenLayoutRootStruct = { settings?: any; dimensions?: Record; labels?: Record; @@ -83,9 +83,10 @@ export class ClientStateNormalizer { compiler.filters.debugCalls = componentState.filters.debugCalls; } - setFilterSettingsFromComponent(compiler: ClientStateCompiler, component) { - this.setFilterSettingsFromComponentState(compiler, component.componentState); - } + // UNUSED, not deleting yet + // setFilterSettingsFromComponent(compiler: ClientStateCompiler, component) { + // this.setFilterSettingsFromComponentState(compiler, component.componentState); + // } findCompilerInGoldenLayout( content: Array, @@ -130,7 +131,8 @@ export class ClientStateNormalizer { if (glCompiler.componentState.source) { const session = this.normalized.findOrCreateSession(glCompiler.componentState.source); compiler = session.findOrCreateCompiler(compilerId); - } else if (glCompiler.componentState.tree) { + } else { + assert(glCompiler.componentState.tree); const tree = this.normalized.findOrCreateTree(glCompiler.componentState.tree); compiler = tree.findOrCreateCompiler(compilerId); } @@ -605,7 +607,7 @@ class GoldenLayoutComponents { }; } - createExecutorComponent(session: ClientStateSession, executor, customSessionId?: number) { + createExecutorComponent(session: ClientStateSession, executor: ClientStateExecutor, customSessionId?: number) { return { type: 'component', componentName: 'executor', @@ -630,7 +632,7 @@ class GoldenLayoutComponents { }; } - createExecutorComponentForTree(tree: ClientStateTree, executor, customTreeId?: number) { + createExecutorComponentForTree(tree: ClientStateTree, executor: ClientStateExecutor, customTreeId?: number) { return { type: 'component', componentName: 'executor', @@ -860,14 +862,22 @@ export class ClientStateGoldenifier extends GoldenLayoutComponents { return this.newStackWithOneComponent(width, component); } - newCompilerStackFromSession(session: ClientStateSession, compiler, width: number): BasicGoldenLayoutStruct { + newCompilerStackFromSession( + session: ClientStateSession, + compiler: ClientStateCompiler, + width: number, + ): BasicGoldenLayoutStruct { return this.newStackWithOneComponent( width, - this.createSourceCompilerComponent(session, compiler, undefined, compiler._internalId), + this.createSourceCompilerComponent(session, compiler, undefined, compiler._internalid), ); } - newExecutorStackFromSession(session: ClientStateSession, executor, width: number): BasicGoldenLayoutStruct { + newExecutorStackFromSession( + session: ClientStateSession, + executor: ClientStateExecutor, + width: number, + ): BasicGoldenLayoutStruct { return this.newStackWithOneComponent(width, this.createExecutorComponent(session, executor)); } diff --git a/lib/clientstate.ts b/lib/clientstate.ts index a7bdd0d21..f1f62311b 100644 --- a/lib/clientstate.ts +++ b/lib/clientstate.ts @@ -128,6 +128,7 @@ export class ClientStateExecutor { compiler: ClientStateCompiler; wrap?: boolean; runtimeTools: any[] = []; + overrides: any[] = []; constructor(jsondata?: any) { if (jsondata) { diff --git a/lib/compilers/clang.ts b/lib/compilers/clang.ts index 0dc45204b..af1e40073 100644 --- a/lib/compilers/clang.ts +++ b/lib/compilers/clang.ts @@ -189,7 +189,7 @@ export class ClangCompiler extends BaseCompiler { } override async afterCompilation( - result, + result: CompilationResult, doExecute: boolean, key: CacheKey, executeParameters: ExecutableExecutionOptions, diff --git a/lib/compilers/cppfront.ts b/lib/compilers/cppfront.ts index 43dd75337..55e6f701a 100644 --- a/lib/compilers/cppfront.ts +++ b/lib/compilers/cppfront.ts @@ -55,7 +55,7 @@ export class CppFrontCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/gnucobol.ts b/lib/compilers/gnucobol.ts index 0113bb267..eb21171ba 100644 --- a/lib/compilers/gnucobol.ts +++ b/lib/compilers/gnucobol.ts @@ -127,7 +127,7 @@ export class GnuCobolCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/jakt.ts b/lib/compilers/jakt.ts index 29b3f4c40..2a1c6d683 100644 --- a/lib/compilers/jakt.ts +++ b/lib/compilers/jakt.ts @@ -90,7 +90,7 @@ export class JaktCompiler extends BaseCompiler { } // We have no dynamic linking in Jakt - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/rust.ts b/lib/compilers/rust.ts index 4e42af737..253880b74 100644 --- a/lib/compilers/rust.ts +++ b/lib/compilers/rust.ts @@ -142,7 +142,7 @@ export class RustCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/snowball.ts b/lib/compilers/snowball.ts index c424553cf..640ad1a52 100644 --- a/lib/compilers/snowball.ts +++ b/lib/compilers/snowball.ts @@ -57,7 +57,7 @@ export class SnowballCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/v.ts b/lib/compilers/v.ts index 2348c422c..152816aec 100644 --- a/lib/compilers/v.ts +++ b/lib/compilers/v.ts @@ -86,7 +86,7 @@ export class VCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/vala.ts b/lib/compilers/vala.ts index c8a3fc6a1..161873f22 100644 --- a/lib/compilers/vala.ts +++ b/lib/compilers/vala.ts @@ -104,7 +104,7 @@ export class ValaCompiler extends BaseCompiler { return []; } - override getSharedLibraryLinks(libraries: any[]): string[] { + override getSharedLibraryLinks(libraries: SelectedLibraryVersion[]): string[] { return []; } diff --git a/lib/compilers/win32.ts b/lib/compilers/win32.ts index 38f186de9..4e371de0a 100644 --- a/lib/compilers/win32.ts +++ b/lib/compilers/win32.ts @@ -70,13 +70,15 @@ export class Win32Compiler extends BaseCompiler { return this.getSharedLibraryPaths(libraries).map(path => libPathFlag + path); } + // Ofek: foundVersion having 'liblink' makes me suspicious of the decision to annotate everywhere + // with `SelectedLibraryVersion`, but can't test at this time override getSharedLibraryLinks(libraries: any[]): string[] { return _.flatten( libraries .map(selectedLib => [selectedLib, this.findLibVersion(selectedLib)]) .filter(([selectedLib, foundVersion]) => !!foundVersion) .map(([selectedLib, foundVersion]) => { - return foundVersion.liblink.filter(Boolean).map(lib => `"${lib}.lib"`); + return foundVersion.liblink.filter(Boolean).map((lib: string) => `"${lib}.lib"`); }) .map(([selectedLib, foundVersion]) => selectedLib), ); diff --git a/lib/handlers/noscript.ts b/lib/handlers/noscript.ts index 35023ecc8..0bf209ad1 100644 --- a/lib/handlers/noscript.ts +++ b/lib/handlers/noscript.ts @@ -46,7 +46,7 @@ export class NoScriptHandler { readonly clientOptionsHandler: ClientOptionsHandler; readonly renderConfig: (a: any, b: any) => any; readonly storageHandler: StorageBase; - readonly defaultLanguage: any; + readonly defaultLanguage: string; readonly compileHandler: CompileHandler; formDataParser: ReturnType | undefined; @@ -62,8 +62,8 @@ export class NoScriptHandler { this.renderConfig = config.renderConfig; this.storageHandler = config.storageHandler; - this.defaultLanguage = config.opts.wantedLanguage; this.compileHandler = config.compileHandler; + this.defaultLanguage = config.opts.wantedLanguage; } InitializeRoutes(options: {limit: string}) { diff --git a/lib/handlers/route-api.ts b/lib/handlers/route-api.ts index c97076f5f..8fbc8fe10 100644 --- a/lib/handlers/route-api.ts +++ b/lib/handlers/route-api.ts @@ -58,7 +58,7 @@ export type HandlerConfig = { compilationEnvironment: CompilationEnvironment; }; -type ShortLinkMetaData = { +export type ShortLinkMetaData = { ogDescription?: string; ogAuthor?: string; ogTitle?: string; diff --git a/lib/logger.ts b/lib/logger.ts index 3747f3f76..e5b7105a1 100644 --- a/lib/logger.ts +++ b/lib/logger.ts @@ -89,7 +89,7 @@ class MyPapertrailTransport extends TransportStream { this.transport = new Papertrail({ host: opts.host, port: opts.port, - logFormat: (level, message) => message, + logFormat: (level: any, message: any) => message, hostname: this.hostname, format: opts.format, }); @@ -101,7 +101,7 @@ class MyPapertrailTransport extends TransportStream { }); // We can't use callback here as winston-papertrail is a bit lax in calling it back - this.transport.sendMessage(this.hostname, this.program, info[LEVEL], info[MESSAGE], x => x); + this.transport.sendMessage(this.hostname, this.program, info[LEVEL], info[MESSAGE], (x: any) => x); callback(); } } diff --git a/lib/stats.ts b/lib/stats.ts index d8485fe64..7ea59c2e4 100644 --- a/lib/stats.ts +++ b/lib/stats.ts @@ -26,6 +26,7 @@ import {StorageClass} from '@aws-sdk/client-s3'; import ems from 'enhanced-ms'; import {FiledataPair} from '../types/compilation/compilation.interfaces.js'; +import {CompilerOverrideOptions} from '../types/compilation/compiler-overrides.interfaces.js'; import {ConfiguredRuntimeTool} from '../types/execution/execution.interfaces.js'; import {SelectedLibraryVersion} from '../types/libraries/libraries.interfaces.js'; @@ -103,7 +104,7 @@ export function makeSafe( bypassCache: !!request.bypassCache, libraries: (request.libraries || []).map((lib: SelectedLibraryVersion) => lib.id + '/' + lib.version), tools: (request.tools || []).map(tool => tool.id), - overrides: (request.backendOptions.overrides || []) + overrides: ((request.backendOptions.overrides || []) as CompilerOverrideOptions) .filter(item => item.name !== 'env' && item.value) .map(item => `${item.name}=${item.value}`), runtimeTools: (request.executeParameters.runtimeTools || []) diff --git a/package-lock.json b/package-lock.json index 800a2bed7..ed04407c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,6 +80,7 @@ "yaml": "^2.6.0" }, "devDependencies": { + "@sentry/types": "^8.35.0", "@smithy/util-stream": "^3.1.9", "@types/body-parser": "^1.19.5", "@types/bootstrap": "^5.2.10", @@ -3926,6 +3927,15 @@ "node": ">=12" } }, + "node_modules/@sentry-internal/feedback/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry-internal/replay-canvas": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.119.2.tgz", @@ -3940,6 +3950,15 @@ "node": ">=12" } }, + "node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry-internal/tracing": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.119.2.tgz", @@ -3953,6 +3972,15 @@ "node": ">=8" } }, + "node_modules/@sentry-internal/tracing/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry/browser": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.119.2.tgz", @@ -3971,6 +3999,15 @@ "node": ">=8" } }, + "node_modules/@sentry/browser/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry/core": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.119.2.tgz", @@ -3983,6 +4020,15 @@ "node": ">=8" } }, + "node_modules/@sentry/core/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry/integrations": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.119.2.tgz", @@ -3997,6 +4043,15 @@ "node": ">=8" } }, + "node_modules/@sentry/integrations/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry/node": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/node/-/node-7.119.2.tgz", @@ -4012,6 +4067,15 @@ "node": ">=8" } }, + "node_modules/@sentry/node/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sentry/replay": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.119.2.tgz", @@ -4026,14 +4090,25 @@ "node": ">=12" } }, - "node_modules/@sentry/types": { + "node_modules/@sentry/replay/node_modules/@sentry/types": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", "engines": { "node": ">=8" } }, + "node_modules/@sentry/types": { + "version": "8.35.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-8.35.0.tgz", + "integrity": "sha512-AVEZjb16MlYPifiDDvJ19dPQyDn0jlrtC1PHs6ZKO+Rzyz+2EX2BRdszvanqArldexPoU1p5Bn2w81XZNXThBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.18" + } + }, "node_modules/@sentry/utils": { "version": "7.119.2", "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.119.2.tgz", @@ -4045,6 +4120,15 @@ "node": ">=8" } }, + "node_modules/@sentry/utils/node_modules/@sentry/types": { + "version": "7.119.2", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.119.2.tgz", + "integrity": "sha512-ydq1tWsdG7QW+yFaTp0gFaowMLNVikIqM70wxWNK+u98QzKnVY/3XTixxNLsUtnAB4Y+isAzFhrc6Vb5GFdFeg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", diff --git a/package.json b/package.json index 0cdaf2b79..46010c590 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "yaml": "^2.6.0" }, "devDependencies": { + "@sentry/types": "^8.35.0", "@smithy/util-stream": "^3.1.9", "@types/body-parser": "^1.19.5", "@types/bootstrap": "^5.2.10", diff --git a/test/state/andthekitchensink.json.normalized b/test/state/andthekitchensink.normalized.json similarity index 100% rename from test/state/andthekitchensink.json.normalized rename to test/state/andthekitchensink.normalized.json diff --git a/test/state/conformanceview.json.normalized b/test/state/conformanceview.normalized.json similarity index 100% rename from test/state/conformanceview.json.normalized rename to test/state/conformanceview.normalized.json diff --git a/test/state/executor.json.normalized b/test/state/executor.normalized.json similarity index 98% rename from test/state/executor.json.normalized rename to test/state/executor.normalized.json index ea72300e6..13f657dc0 100644 --- a/test/state/executor.json.normalized +++ b/test/state/executor.normalized.json @@ -60,6 +60,7 @@ }, "compilerOutputVisible": true, "compilerVisible": false, + "overrides": [], "stdin": "", "stdinVisible": false, "wrap": false, diff --git a/test/state/executorwrap.json.normalized b/test/state/executorwrap.normalized.json similarity index 98% rename from test/state/executorwrap.json.normalized rename to test/state/executorwrap.normalized.json index 66749e77b..cbc0e5656 100644 --- a/test/state/executorwrap.json.normalized +++ b/test/state/executorwrap.normalized.json @@ -31,6 +31,7 @@ "executors": [ { "compilerVisible": true, + "overrides": [], "compilerOutputVisible": true, "arguments": "", "argumentsVisible": false, diff --git a/test/state/libsegfault.normalized.json b/test/state/libsegfault.normalized.json index d58cb4c50..b10d12276 100644 --- a/test/state/libsegfault.normalized.json +++ b/test/state/libsegfault.normalized.json @@ -38,6 +38,7 @@ "argumentsVisible": false, "compilerOutputVisible": true, "compilerVisible": true, + "overrides": [], "stdin": "", "stdinVisible": false, "wrap": true, diff --git a/test/state/twocompilers.json.normalized b/test/state/twocompilers.normalized.json similarity index 100% rename from test/state/twocompilers.json.normalized rename to test/state/twocompilers.normalized.json diff --git a/test/statenormalisation-tests.ts b/test/statenormalisation-tests.ts index acde13485..e9d6aa09a 100644 --- a/test/statenormalisation-tests.ts +++ b/test/statenormalisation-tests.ts @@ -36,7 +36,7 @@ describe('Normalizing clientstate', () => { const data = JSON.parse(fs.readFileSync('test/state/twocompilers.json', {encoding: 'utf8'})); normalizer.fromGoldenLayout(data); - const resultdata = JSON.parse(fs.readFileSync('test/state/twocompilers.json.normalized', {encoding: 'utf8'})); + const resultdata = JSON.parse(fs.readFileSync('test/state/twocompilers.normalized.json', {encoding: 'utf8'})); // note: this trick is to get rid of undefined parameters const normalized = JSON.parse(JSON.stringify(normalizer.normalized)); @@ -52,7 +52,7 @@ describe('Normalizing clientstate', () => { normalizer.fromGoldenLayout(data); const resultdata = JSON.parse( - fs.readFileSync('test/state/andthekitchensink.json.normalized', {encoding: 'utf8'}), + fs.readFileSync('test/state/andthekitchensink.normalized.json', {encoding: 'utf8'}), ); const normalized = JSON.parse(JSON.stringify(normalizer.normalized)); @@ -68,7 +68,7 @@ describe('Normalizing clientstate', () => { normalizer.fromGoldenLayout(data); const resultdata = JSON.parse( - fs.readFileSync('test/state/conformanceview.json.normalized', {encoding: 'utf8'}), + fs.readFileSync('test/state/conformanceview.normalized.json', {encoding: 'utf8'}), ); const normalized = JSON.parse(JSON.stringify(normalizer.normalized)); @@ -83,7 +83,7 @@ describe('Normalizing clientstate', () => { normalizer.fromGoldenLayout(data); - const resultdata = JSON.parse(fs.readFileSync('test/state/executor.json.normalized', {encoding: 'utf8'})); + const resultdata = JSON.parse(fs.readFileSync('test/state/executor.normalized.json', {encoding: 'utf8'})); const normalized = JSON.parse(JSON.stringify(normalizer.normalized)); @@ -97,7 +97,7 @@ describe('Normalizing clientstate', () => { normalizer.fromGoldenLayout(data); - const resultdata = JSON.parse(fs.readFileSync('test/state/executorwrap.json.normalized', {encoding: 'utf8'})); + const resultdata = JSON.parse(fs.readFileSync('test/state/executorwrap.normalized.json', {encoding: 'utf8'})); const normalized = JSON.parse(JSON.stringify(normalizer.normalized)); diff --git a/test/stats-test.ts b/test/stats-test.ts index 8bdc99b51..234ccfbd3 100644 --- a/test/stats-test.ts +++ b/test/stats-test.ts @@ -134,8 +134,6 @@ describe('Stats', () => { SKIPASM: true, skipasm: true, optOutput: true, - preProcessLines: lines => lines, - preProcessBinaryAsmLines: lines => lines, } as ParseFiltersAndOutputOptions, bypassCache: 0, tools: [],