Bump TypeScript to 5.3 with verbatimModuleSyntax
This commit upgrades TypeScript to the latest version 5.3 and introduces `verbatimModuleSyntax` in line with the official Vue guide recommendatinos (vuejs/docs#2592). By enforcing `import type` for type-only imports, this commit improves code clarity and supports tooling optimization, ensuring imports are only bundled when necessary for runtime. Changes: - Bump TypeScript to 5.3.3 across the project. - Adjust import statements to utilize `import type` where applicable, promoting cleaner and more efficient code.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||
import { CodeRunError, CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import { SystemOperations } from '../../System/SystemOperations';
|
||||
import type { CodeRunError, CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import { NodeElectronSystemOperations } from '../../System/NodeElectronSystemOperations';
|
||||
import { ScriptDirectoryOutcome, ScriptDirectoryProvider } from './ScriptDirectoryProvider';
|
||||
import type { SystemOperations } from '../../System/SystemOperations';
|
||||
import type { ScriptDirectoryOutcome, ScriptDirectoryProvider } from './ScriptDirectoryProvider';
|
||||
|
||||
export const ExecutionSubdirectory = 'runs';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
import type { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
|
||||
export interface ScriptDirectoryProvider {
|
||||
provideScriptDirectory(): Promise<ScriptDirectoryOutcome>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ScriptFilenameParts } from '../ScriptFileCreator';
|
||||
import type { ScriptFilenameParts } from '../ScriptFileCreator';
|
||||
|
||||
export interface FilenameGenerator {
|
||||
generateFilename(scriptFilenameParts: ScriptFilenameParts): string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ScriptFilenameParts } from '../ScriptFileCreator';
|
||||
import { FilenameGenerator } from './FilenameGenerator';
|
||||
import type { FilenameGenerator } from './FilenameGenerator';
|
||||
import type { ScriptFilenameParts } from '../ScriptFileCreator';
|
||||
|
||||
export class TimestampedFilenameGenerator implements FilenameGenerator {
|
||||
public generateFilename(
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import { CodeRunError, CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import { FileReadbackVerificationErrors, ReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/ReadbackFileWriter';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { CodeRunError, CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import { FileReadbackVerificationErrors, type ReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/ReadbackFileWriter';
|
||||
import { NodeReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/NodeReadbackFileWriter';
|
||||
import { SystemOperations } from '../System/SystemOperations';
|
||||
import { NodeElectronSystemOperations } from '../System/NodeElectronSystemOperations';
|
||||
import { FilenameGenerator } from './Filename/FilenameGenerator';
|
||||
import { ScriptFilenameParts, ScriptFileCreator, ScriptFileCreationOutcome } from './ScriptFileCreator';
|
||||
import { TimestampedFilenameGenerator } from './Filename/TimestampedFilenameGenerator';
|
||||
import { ScriptDirectoryProvider } from './Directory/ScriptDirectoryProvider';
|
||||
import { PersistentDirectoryProvider } from './Directory/PersistentDirectoryProvider';
|
||||
import type { SystemOperations } from '../System/SystemOperations';
|
||||
import type { FilenameGenerator } from './Filename/FilenameGenerator';
|
||||
import type { ScriptFilenameParts, ScriptFileCreator, ScriptFileCreationOutcome } from './ScriptFileCreator';
|
||||
import type { ScriptDirectoryProvider } from './Directory/ScriptDirectoryProvider';
|
||||
|
||||
export class ScriptFileCreationOrchestrator implements ScriptFileCreator {
|
||||
constructor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
import type { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
|
||||
export interface ScriptFileCreator {
|
||||
createScriptFile(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
import type { CodeRunError } from '@/application/CodeRunner/CodeRunner';
|
||||
|
||||
export interface ScriptFileExecutor {
|
||||
executeScriptFile(filePath: string): Promise<ScriptFileExecutionOutcome>;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { CommandOps, SystemOperations } from '@/infrastructure/CodeRunner/System/SystemOperations';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { CommandOps, SystemOperations } from '@/infrastructure/CodeRunner/System/SystemOperations';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||
import { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
|
||||
import type { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
|
||||
import { NodeElectronSystemOperations } from '@/infrastructure/CodeRunner/System/NodeElectronSystemOperations';
|
||||
import { CurrentEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironmentFactory';
|
||||
import { CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import type { CodeRunErrorType } from '@/application/CodeRunner/CodeRunner';
|
||||
import { isString } from '@/TypeHelpers';
|
||||
import { FailedScriptFileExecution, ScriptFileExecutionOutcome, ScriptFileExecutor } from './ScriptFileExecutor';
|
||||
import type { FailedScriptFileExecution, ScriptFileExecutionOutcome, ScriptFileExecutor } from './ScriptFileExecutor';
|
||||
|
||||
export class VisibleTerminalScriptExecutor implements ScriptFileExecutor {
|
||||
constructor(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import { ScriptFilename } from '@/application/CodeRunner/ScriptFilename';
|
||||
import {
|
||||
import type {
|
||||
CodeRunError, CodeRunOutcome, CodeRunner, FailedCodeRun,
|
||||
} from '@/application/CodeRunner/CodeRunner';
|
||||
import { ElectronLogger } from '../Log/ElectronLogger';
|
||||
import { ScriptFileExecutor } from './Execution/ScriptFileExecutor';
|
||||
import { ScriptFileCreator } from './Creation/ScriptFileCreator';
|
||||
import { ScriptFileCreationOrchestrator } from './Creation/ScriptFileCreationOrchestrator';
|
||||
import { VisibleTerminalScriptExecutor } from './Execution/VisibleTerminalScriptFileExecutor';
|
||||
import { ScriptFileCreationOrchestrator } from './Creation/ScriptFileCreationOrchestrator';
|
||||
import type { ScriptFileExecutor } from './Execution/ScriptFileExecutor';
|
||||
import type { ScriptFileCreator } from './Creation/ScriptFileCreator';
|
||||
|
||||
export class ScriptFileCodeRunner implements CodeRunner {
|
||||
constructor(
|
||||
|
||||
@@ -2,7 +2,7 @@ import { join } from 'node:path';
|
||||
import { chmod, mkdir } from 'node:fs/promises';
|
||||
import { exec } from 'node:child_process';
|
||||
import { app } from 'electron/main';
|
||||
import {
|
||||
import type {
|
||||
CommandOps, FileSystemOps, LocationOps, OperatingSystemOps, SystemOperations,
|
||||
} from './SystemOperations';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Dialog, FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import type { Dialog, FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import { FileSaverDialog } from './FileSaverDialog';
|
||||
import { BrowserSaveFileDialog } from './BrowserSaveFileDialog';
|
||||
import type { BrowserSaveFileDialog } from './BrowserSaveFileDialog';
|
||||
|
||||
export class BrowserDialog implements Dialog {
|
||||
constructor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import type { FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
|
||||
export interface BrowserSaveFileDialog {
|
||||
saveFile(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import fileSaver from 'file-saver';
|
||||
import { FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import { BrowserSaveFileDialog } from './BrowserSaveFileDialog';
|
||||
import { FileType, type SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import type { BrowserSaveFileDialog } from './BrowserSaveFileDialog';
|
||||
|
||||
export type SaveAsFunction = (data: Blob, filename?: string) => void;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { dialog } from 'electron/main';
|
||||
import { Dialog, FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import type { Dialog, FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import { NodeElectronSaveFileDialog } from './NodeElectronSaveFileDialog';
|
||||
import { ElectronSaveFileDialog } from './ElectronSaveFileDialog';
|
||||
import type { ElectronSaveFileDialog } from './ElectronSaveFileDialog';
|
||||
|
||||
export class ElectronDialog implements Dialog {
|
||||
constructor(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
import type { FileType, SaveFileOutcome } from '@/presentation/common/Dialog';
|
||||
|
||||
export interface ElectronSaveFileDialog {
|
||||
saveFile(
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { join } from 'node:path';
|
||||
import { app, dialog } from 'electron/main';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
|
||||
import {
|
||||
FileType, SaveFileError, SaveFileErrorType, SaveFileOutcome,
|
||||
FileType, type SaveFileError, type SaveFileErrorType, type SaveFileOutcome,
|
||||
} from '@/presentation/common/Dialog';
|
||||
import { FileReadbackVerificationErrors, ReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/ReadbackFileWriter';
|
||||
import { FileReadbackVerificationErrors, type ReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/ReadbackFileWriter';
|
||||
import { NodeReadbackFileWriter } from '@/infrastructure/ReadbackFileWriter/NodeReadbackFileWriter';
|
||||
import { ElectronSaveFileDialog } from './ElectronSaveFileDialog';
|
||||
import type { ElectronSaveFileDialog } from './ElectronSaveFileDialog';
|
||||
|
||||
export class NodeElectronSaveFileDialog implements ElectronSaveFileDialog {
|
||||
constructor(
|
||||
@@ -16,7 +16,7 @@ export class NodeElectronSaveFileDialog implements ElectronSaveFileDialog {
|
||||
getUserDownloadsPath: () => app.getPath('downloads'),
|
||||
showSaveDialog: dialog.showSaveDialog.bind(dialog),
|
||||
},
|
||||
private readonly node: NodeFileOperations = { join },
|
||||
private readonly node: NodePathOperations = { join },
|
||||
private readonly fileWriter: ReadbackFileWriter = new NodeReadbackFileWriter(),
|
||||
) { }
|
||||
|
||||
@@ -136,7 +136,7 @@ export interface ElectronFileDialogOperations {
|
||||
showSaveDialog(options: Electron.SaveDialogOptions): Promise<Electron.SaveDialogReturnValue>;
|
||||
}
|
||||
|
||||
export interface NodeFileOperations {
|
||||
export interface NodePathOperations {
|
||||
readonly join: typeof join;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import { Dialog, FileType } from '@/presentation/common/Dialog';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Dialog, FileType } from '@/presentation/common/Dialog';
|
||||
|
||||
export function decorateWithLogging(
|
||||
dialog: Dialog,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isNumber } from '@/TypeHelpers';
|
||||
import { IEntity } from './IEntity';
|
||||
import type { IEntity } from './IEntity';
|
||||
|
||||
export abstract class BaseEntity<TId> implements IEntity<TId> {
|
||||
protected constructor(public id: TId) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IEnvironmentVariablesFactory } from './IEnvironmentVariablesFactory';
|
||||
import { validateEnvironmentVariables } from './EnvironmentVariablesValidator';
|
||||
import { ViteEnvironmentVariables } from './Vite/ViteEnvironmentVariables';
|
||||
import { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
import type { IEnvironmentVariablesFactory } from './IEnvironmentVariablesFactory';
|
||||
import type { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
|
||||
export class EnvironmentVariablesFactory implements IEnvironmentVariablesFactory {
|
||||
public static readonly Current = new EnvironmentVariablesFactory();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isBoolean, isFunction } from '@/TypeHelpers';
|
||||
import { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
import type { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
|
||||
/* Validation is externalized to keep the environment objects simple */
|
||||
export function validateEnvironmentVariables(environment: IEnvironmentVariables): void {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAppMetadata } from './IAppMetadata';
|
||||
import type { IAppMetadata } from './IAppMetadata';
|
||||
|
||||
/**
|
||||
* Designed to decouple the process of retrieving environment variables
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
import type { IEnvironmentVariables } from './IEnvironmentVariables';
|
||||
|
||||
export interface IEnvironmentVariablesFactory {
|
||||
readonly instance: IEnvironmentVariables;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IEnvironmentVariables } from '../IEnvironmentVariables';
|
||||
import type { IEnvironmentVariables } from '../IEnvironmentVariables';
|
||||
|
||||
/**
|
||||
* Provides the application's environment variables.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { EventHandler, IEventSource, IEventSubscription } from './IEventSource';
|
||||
import type { EventHandler, IEventSource, IEventSubscription } from './IEventSource';
|
||||
|
||||
export class EventSource<T> implements IEventSource<T> {
|
||||
private handlers = new Map<number, EventHandler<T>>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IEventSubscriptionCollection } from './IEventSubscriptionCollection';
|
||||
import { IEventSubscription } from './IEventSource';
|
||||
import type { IEventSubscriptionCollection } from './IEventSubscriptionCollection';
|
||||
import type { IEventSubscription } from './IEventSource';
|
||||
|
||||
export class EventSubscriptionCollection implements IEventSubscriptionCollection {
|
||||
private readonly subscriptions = new Array<IEventSubscription>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IEventSubscription } from '@/infrastructure/Events/IEventSource';
|
||||
import type { IEventSubscription } from '@/infrastructure/Events/IEventSource';
|
||||
|
||||
export interface IEventSubscriptionCollection {
|
||||
readonly subscriptionCount: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
|
||||
export class ConsoleLogger implements Logger {
|
||||
constructor(private readonly consoleProxy: ConsoleLogFunctions = globalThis.console) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import log from 'electron-log/main';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { LogFunctions } from 'electron-log';
|
||||
|
||||
export function createElectronLogger(logger: LogFunctions = log): Logger {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
|
||||
export class NoopLogger implements Logger {
|
||||
public info(): void { /* NOOP */ }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import { WindowVariables } from '../WindowVariables/WindowVariables';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { WindowVariables } from '../WindowVariables/WindowVariables';
|
||||
|
||||
export class WindowInjectedLogger implements Logger {
|
||||
private readonly logger: Logger;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { writeFile, access, readFile } from 'node:fs/promises';
|
||||
import { constants } from 'node:fs';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import { ElectronLogger } from '../Log/ElectronLogger';
|
||||
import {
|
||||
import type {
|
||||
FailedFileWrite, ReadbackFileWriter, FileWriteErrorType,
|
||||
FileWriteOutcome, SuccessfulFileWrite,
|
||||
} from './ReadbackFileWriter';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IEntity } from '../Entity/IEntity';
|
||||
import { Repository } from '../../application/Repository/Repository';
|
||||
import type { Repository } from '../../application/Repository/Repository';
|
||||
import type { IEntity } from '../Entity/IEntity';
|
||||
|
||||
export class InMemoryRepository<TKey, TEntity extends IEntity<TKey>>
|
||||
implements Repository<TKey, TEntity> {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { BrowserCondition, TouchSupportExpectation } from './BrowserCondition';
|
||||
import { type BrowserCondition, TouchSupportExpectation } from './BrowserCondition';
|
||||
|
||||
// They include "Android", "iPhone" in their user agents.
|
||||
const WindowsMobileIdentifiers: readonly string[] = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { assertInRange } from '@/application/Common/Enum';
|
||||
import { BrowserEnvironment, BrowserOsDetector } from './BrowserOsDetector';
|
||||
import { BrowserCondition, TouchSupportExpectation } from './BrowserCondition';
|
||||
import { type BrowserCondition, TouchSupportExpectation } from './BrowserCondition';
|
||||
import { BrowserConditions } from './BrowserConditions';
|
||||
import type { BrowserEnvironment, BrowserOsDetector } from './BrowserOsDetector';
|
||||
|
||||
export class ConditionBasedOsDetector implements BrowserOsDetector {
|
||||
constructor(private readonly conditions: readonly BrowserCondition[] = BrowserConditions) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { IEnvironmentVariables } from '@/infrastructure/EnvironmentVariables/IEnvironmentVariables';
|
||||
import type { IEnvironmentVariables } from '@/infrastructure/EnvironmentVariables/IEnvironmentVariables';
|
||||
import { EnvironmentVariablesFactory } from '@/infrastructure/EnvironmentVariables/EnvironmentVariablesFactory';
|
||||
import { RuntimeEnvironment } from '../RuntimeEnvironment';
|
||||
import { ConditionBasedOsDetector } from './BrowserOs/ConditionBasedOsDetector';
|
||||
import { BrowserEnvironment, BrowserOsDetector } from './BrowserOs/BrowserOsDetector';
|
||||
import { isTouchEnabledDevice } from './TouchSupportDetection';
|
||||
import type { RuntimeEnvironment } from '../RuntimeEnvironment';
|
||||
import type { BrowserEnvironment, BrowserOsDetector } from './BrowserOs/BrowserOsDetector';
|
||||
|
||||
export class BrowserRuntimeEnvironment implements RuntimeEnvironment {
|
||||
public readonly isRunningAsDesktopApplication: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ElectronEnvironmentDetector, ElectronProcessType } from './ElectronEnvironmentDetector';
|
||||
import type { ElectronEnvironmentDetector, ElectronProcessType } from './ElectronEnvironmentDetector';
|
||||
|
||||
export class ContextIsolatedElectronDetector implements ElectronEnvironmentDetector {
|
||||
constructor(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { RuntimeEnvironment } from '../RuntimeEnvironment';
|
||||
import { convertPlatformToOs } from './NodeOsMapper';
|
||||
import type { RuntimeEnvironment } from '../RuntimeEnvironment';
|
||||
|
||||
export class NodeRuntimeEnvironment implements RuntimeEnvironment {
|
||||
public readonly isRunningAsDesktopApplication: boolean;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ElectronEnvironmentDetector } from './Electron/ElectronEnvironmentDetector';
|
||||
import { BrowserRuntimeEnvironment } from './Browser/BrowserRuntimeEnvironment';
|
||||
import { NodeRuntimeEnvironment } from './Node/NodeRuntimeEnvironment';
|
||||
import { RuntimeEnvironment } from './RuntimeEnvironment';
|
||||
import { ContextIsolatedElectronDetector } from './Electron/ContextIsolatedElectronDetector';
|
||||
import type { RuntimeEnvironment } from './RuntimeEnvironment';
|
||||
import type { ElectronEnvironmentDetector } from './Electron/ElectronEnvironmentDetector';
|
||||
|
||||
export const CurrentEnvironment = determineAndCreateRuntimeEnvironment(globalThis.window);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ISanityCheckOptions } from './ISanityCheckOptions';
|
||||
import { ISanityValidator } from './ISanityValidator';
|
||||
import type { ISanityValidator } from './ISanityValidator';
|
||||
import type { ISanityCheckOptions } from './ISanityCheckOptions';
|
||||
|
||||
export type FactoryFunction<T> = () => T;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ISanityCheckOptions } from './ISanityCheckOptions';
|
||||
import type { ISanityCheckOptions } from './ISanityCheckOptions';
|
||||
|
||||
export interface ISanityValidator {
|
||||
readonly name: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ISanityCheckOptions } from './Common/ISanityCheckOptions';
|
||||
import { ISanityValidator } from './Common/ISanityValidator';
|
||||
import { EnvironmentVariablesValidator } from './Validators/EnvironmentVariablesValidator';
|
||||
import type { ISanityCheckOptions } from './Common/ISanityCheckOptions';
|
||||
import type { ISanityValidator } from './Common/ISanityValidator';
|
||||
|
||||
const DefaultSanityValidators: ISanityValidator[] = [
|
||||
new EnvironmentVariablesValidator(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { IEnvironmentVariables } from '@/infrastructure/EnvironmentVariables/IEnvironmentVariables';
|
||||
import type { IEnvironmentVariables } from '@/infrastructure/EnvironmentVariables/IEnvironmentVariables';
|
||||
import { EnvironmentVariablesFactory } from '@/infrastructure/EnvironmentVariables/EnvironmentVariablesFactory';
|
||||
import { ISanityCheckOptions } from '../Common/ISanityCheckOptions';
|
||||
import { FactoryValidator, FactoryFunction } from '../Common/FactoryValidator';
|
||||
import { FactoryValidator, type FactoryFunction } from '../Common/FactoryValidator';
|
||||
import type { ISanityCheckOptions } from '../Common/ISanityCheckOptions';
|
||||
|
||||
export class EnvironmentVariablesValidator extends FactoryValidator<IEnvironmentVariables> {
|
||||
constructor(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { WindowVariables } from '@/infrastructure/WindowVariables/WindowVariables';
|
||||
import { ISanityCheckOptions } from '../Common/ISanityCheckOptions';
|
||||
import { FactoryValidator, FactoryFunction } from '../Common/FactoryValidator';
|
||||
import type { WindowVariables } from '@/infrastructure/WindowVariables/WindowVariables';
|
||||
import { FactoryValidator, type FactoryFunction } from '../Common/FactoryValidator';
|
||||
import type { ISanityCheckOptions } from '../Common/ISanityCheckOptions';
|
||||
|
||||
export class WindowVariablesValidator extends FactoryValidator<WindowVariables> {
|
||||
constructor(factory: FactoryFunction<WindowVariables> = () => window) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ScriptDiagnosticData, ScriptDiagnosticsCollector } from '@/application/ScriptDiagnostics/ScriptDiagnosticsCollector';
|
||||
import { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
|
||||
import type { ScriptDiagnosticData, ScriptDiagnosticsCollector } from '@/application/ScriptDiagnostics/ScriptDiagnosticsCollector';
|
||||
import type { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
|
||||
import { CurrentEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironmentFactory';
|
||||
import { PersistentDirectoryProvider } from '@/infrastructure/CodeRunner/Creation/Directory/PersistentDirectoryProvider';
|
||||
import { ScriptDirectoryProvider } from '../CodeRunner/Creation/Directory/ScriptDirectoryProvider';
|
||||
import type { ScriptDirectoryProvider } from '../CodeRunner/Creation/Directory/ScriptDirectoryProvider';
|
||||
|
||||
export class ScriptEnvironmentDiagnosticsCollector implements ScriptDiagnosticsCollector {
|
||||
constructor(
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import { Logger } from '@/application/Common/Log/Logger';
|
||||
import { CodeRunner } from '@/application/CodeRunner/CodeRunner';
|
||||
import { Dialog } from '@/presentation/common/Dialog';
|
||||
import { ScriptDiagnosticsCollector } from '@/application/ScriptDiagnostics/ScriptDiagnosticsCollector';
|
||||
import type { Logger } from '@/application/Common/Log/Logger';
|
||||
import type { CodeRunner } from '@/application/CodeRunner/CodeRunner';
|
||||
import type { Dialog } from '@/presentation/common/Dialog';
|
||||
import type { ScriptDiagnosticsCollector } from '@/application/ScriptDiagnostics/ScriptDiagnosticsCollector';
|
||||
|
||||
/* Primary entry point for platform-specific injections */
|
||||
export interface WindowVariables {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ContextIsolatedElectronDetector } from '@/infrastructure/RuntimeEnvironment/Electron/ContextIsolatedElectronDetector';
|
||||
import { ElectronEnvironmentDetector } from '@/infrastructure/RuntimeEnvironment/Electron/ElectronEnvironmentDetector';
|
||||
import type { ElectronEnvironmentDetector } from '@/infrastructure/RuntimeEnvironment/Electron/ElectronEnvironmentDetector';
|
||||
import { OperatingSystem } from '@/domain/OperatingSystem';
|
||||
import {
|
||||
PropertyKeys, isBoolean, isFunction, isNumber, isPlainObject,
|
||||
type PropertyKeys, isBoolean, isFunction, isNumber, isPlainObject,
|
||||
} from '@/TypeHelpers';
|
||||
import { WindowVariables } from './WindowVariables';
|
||||
import type { WindowVariables } from './WindowVariables';
|
||||
|
||||
/**
|
||||
* Checks for consistency in runtime environment properties injected by Electron preloader.
|
||||
|
||||
Reference in New Issue
Block a user