From fe16a23b6bb726f1834b95be954b2abbce939892 Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 4 Jan 2024 16:22:36 +0100 Subject: [PATCH] chore(runtime): fix linting issues --- runtime/src/App.tsx | 8 +- runtime/src/Console.tsx | 6 +- runtime/src/Errors.tsx | 8 +- runtime/src/Files.tsx | 2 +- runtime/src/LoadingView.tsx | 2 +- runtime/src/Logger.tsx | 2 +- runtime/src/Modules.tsx | 105 +++++++++--------- runtime/src/NativeModules/CanvasKit.web.tsx | 4 +- runtime/src/NativeModules/ReactNativeSkia.tsx | 2 +- runtime/src/NativeModules/ViewShot.web.tsx | 2 +- runtime/src/UrlUtils.ts | 2 +- runtime/src/__tests__/UrlUtils-test.ts | 4 +- runtime/src/aliases/index.tsx | 2 +- runtime/src/aliases/index.web.tsx | 2 +- .../RuntimeTrafficMirroringTransport.ts | 6 +- .../transports/RuntimeTransportImplPubNub.ts | 2 +- .../RuntimeTransportImplSocketIO.ts | 2 +- .../RuntimeTransportImplWebPlayer.ts | 8 +- .../RuntimeTrafficMirroringTransport-test.ts | 6 +- runtime/web/deploy-script.js | 6 +- runtime/webpack.config.js | 4 +- 21 files changed, 94 insertions(+), 91 deletions(-) diff --git a/runtime/src/App.tsx b/runtime/src/App.tsx index a34979e3..ff47539b 100644 --- a/runtime/src/App.tsx +++ b/runtime/src/App.tsx @@ -198,7 +198,7 @@ export default class App extends React.Component { }; _handleAppStateChange = ( - appState: 'active' | 'inactive' | 'background' | 'unknown' | 'extension' + appState: 'active' | 'inactive' | 'background' | 'unknown' | 'extension', ) => { const foreground = appState === 'active'; @@ -232,7 +232,7 @@ export default class App extends React.Component { if (!parsedUrl) { Logger.warn( - `Snack URL didn't have either the format 'https://exp.host/@snack/SAVE_UUID+CHANNEL_UUID' or 'https://exp.host/@snack/sdk.14.0.0-UUID'` + `Snack URL didn't have either the format 'https://exp.host/@snack/SAVE_UUID+CHANNEL_UUID' or 'https://exp.host/@snack/sdk.14.0.0-UUID'`, ); return false; } @@ -278,7 +278,7 @@ export default class App extends React.Component { JSON.stringify({ url, timestamp: Date.now(), - }) + }), ); await Updates.reloadAsync(); @@ -352,7 +352,7 @@ export default class App extends React.Component { this._lastCodeUpdatePromise = this._handleCodeUpdate( message, this._lastCodeUpdatePromise, - deviceId + deviceId, ); break; } diff --git a/runtime/src/Console.tsx b/runtime/src/Console.tsx index adfbee08..ed31cd31 100644 --- a/runtime/src/Console.tsx +++ b/runtime/src/Console.tsx @@ -26,7 +26,7 @@ export const initialize = (callback: (method: string, payload: unknown[]) => voi '%c APP %c ERROR ', 'background: #01FFA2;', 'background: #f44336; color: #fff;', - ...args + ...args, ); break; case 'warn': @@ -34,7 +34,7 @@ export const initialize = (callback: (method: string, payload: unknown[]) => voi '%c APP %c WARN ', 'background: #01FFA2;', 'background: #FF9800; color: #fff;', - ...args + ...args, ); break; } @@ -42,7 +42,7 @@ export const initialize = (callback: (method: string, payload: unknown[]) => voi if ( ignoredWarnings.some( - (warning) => typeof args[0] === 'string' && (args[0] as string).startsWith(warning) + (warning) => typeof args[0] === 'string' && (args[0] as string).startsWith(warning), ) ) { return; diff --git a/runtime/src/Errors.tsx b/runtime/src/Errors.tsx index c1b5231c..f8b41d6f 100644 --- a/runtime/src/Errors.tsx +++ b/runtime/src/Errors.tsx @@ -115,7 +115,7 @@ export function prettyStack(error: Error) { ? // Avoid adding the `column`, `source-map@0.6.1` does not properly resolve the column. It uses the generated column number. u.path + (u.line !== null && u.column !== null ? `:${u.line})\n` : '\n') : match.replace(/module:\/+/, '').replace(/.([a-z]+).js/g, '.$1'); - } + }, ); if (!sourceUnmappedStack) { @@ -222,7 +222,7 @@ export class ErrorBoundary extends React.Component { children.push( {text} - + , ); text = ''; } @@ -231,7 +231,7 @@ export class ErrorBoundary extends React.Component { children.push( {text} - + , ); isCode = false; text = ''; @@ -246,7 +246,7 @@ export class ErrorBoundary extends React.Component { children.push( {text} - + , ); } diff --git a/runtime/src/Files.tsx b/runtime/src/Files.tsx index f2fb5018..d253974a 100644 --- a/runtime/src/Files.tsx +++ b/runtime/src/Files.tsx @@ -118,7 +118,7 @@ export const update = async ({ message }: { message: Message }) => { changedPaths.push(path); } } - }) + }), ); for (const path in files) { diff --git a/runtime/src/LoadingView.tsx b/runtime/src/LoadingView.tsx index b1459b45..e3e477cc 100644 --- a/runtime/src/LoadingView.tsx +++ b/runtime/src/LoadingView.tsx @@ -34,7 +34,7 @@ export default class LoadingView extends React.PureComponent { duration: (inputRange.length - 1) * 1000, useNativeDriver: true, }), - ]) + ]), ).start(); } diff --git a/runtime/src/Logger.tsx b/runtime/src/Logger.tsx index b97fb949..801429b2 100644 --- a/runtime/src/Logger.tsx +++ b/runtime/src/Logger.tsx @@ -10,7 +10,7 @@ const logger = originalConsole.log( `%c ${type.toUpperCase()} `, `background: ${color}; color: ${textColor ?? '#fff'}`, - ...messages + ...messages, ); } }; diff --git a/runtime/src/Modules.tsx b/runtime/src/Modules.tsx index 051abfb9..e960022b 100644 --- a/runtime/src/Modules.tsx +++ b/runtime/src/Modules.tsx @@ -21,14 +21,14 @@ import * as context from 'snack-require-context'; // web-assembly which is not yet supported on react-native. import { SourceMapConsumer, RawSourceMap } from 'source-map'; -import ReanimatedPlugin from '../vendor/reanimated-plugin'; -import System from '../vendor/system.src'; import * as Files from './Files'; import * as Logger from './Logger'; import AssetRegistry from './NativeModules/AssetRegistry'; import FileSystem from './NativeModules/FileSystem'; import * as Profiling from './Profiling'; import aliases from './aliases'; +import ReanimatedPlugin from '../vendor/reanimated-plugin'; +import System from '../vendor/system.src'; type Dependencies = { [key: string]: { resolved?: string; version: string; handle?: string }; @@ -97,10 +97,10 @@ export const updateProjectDependencies = async (newProjectDependencies: Dependen const removedOrChangedDependencies = Object.keys(projectDependencies).filter( (name) => !newProjectDependencies[name] || - newProjectDependencies[name].resolved !== projectDependencies[name].resolved + newProjectDependencies[name].resolved !== projectDependencies[name].resolved, ); const addedDependencies = Object.keys(newProjectDependencies).filter( - (name) => !projectDependencies[name] + (name) => !projectDependencies[name], ); const changedDependencies = removedOrChangedDependencies.concat(addedDependencies); if (changedDependencies.length) { @@ -114,8 +114,8 @@ export const updateProjectDependencies = async (newProjectDependencies: Dependen ? `${projectDependencies[name].resolved} -> ${newProjectDependencies[name].resolved}` : newProjectDependencies[name].resolved : 'removed' - })` - ) + })`, + ), ); } const removedOrChangedUris = removedOrChangedDependencies.map((name) => `module://${name}`); @@ -199,7 +199,7 @@ const fetchPipeline = async (load: Load) => { Logger.module( 'Loaded asset metadata', s3Url, - `from cache ${contents ? contents.length : undefined} bytes` + `from cache ${contents ? contents.length : undefined} bytes`, ); } else { Logger.module('Fetching asset metadata', s3Url, '...'); @@ -230,7 +230,7 @@ const fetchPipeline = async (load: Load) => { undefined, (error) => { Logger.error('Failed to store asset metadata in cache', error); - } + }, ); } } @@ -308,7 +308,7 @@ const fetchPipeline = async (load: Load) => { Logger.module( 'Loaded dependency', cacheHandle, - `from cache ${bundle ? bundle.length : undefined} bytes` + `from cache ${bundle ? bundle.length : undefined} bytes`, ); } else { // In development, try fetching from staging cloudfront first @@ -336,7 +336,7 @@ const fetchPipeline = async (load: Load) => { } else { Logger.warn( 'Dependency could not be loaded from staging, trying production ...', - handle + handle, ); } } @@ -345,7 +345,7 @@ const fetchPipeline = async (load: Load) => { Logger.module( 'Fetched dependency', fetchFrom, - `storing in cache ${bundle.length} bytes` + `storing in cache ${bundle.length} bytes`, ); break; } @@ -441,11 +441,11 @@ const translatePipeline = async (load: Load) => { Logger.module( 'Transpiled', sanitizeModule(filename), - `${result?.code ? result.code.length : '???'} bytes` + `${result?.code ? result.code.length : '???'} bytes`, ); return result; - } + }, ); // @ts-ignore load.metadata.sourceMap = transformed.map; @@ -454,8 +454,8 @@ const translatePipeline = async (load: Load) => { async () => await new SourceMapConsumer( // @ts-ignore - transformed.map - ) + transformed.map, + ), ); return transformed!.code; } catch (e) { @@ -532,7 +532,7 @@ const _initialize = async () => { // and tracing (makes SystemJS collect dependency info). await System.set( 'systemjs-expo-snack-plugin', - System.newModule({ translate: translatePipeline, fetch: fetchPipeline }) + System.newModule({ translate: translatePipeline, fetch: fetchPipeline }), ); await System.config({ packages: { @@ -554,8 +554,8 @@ const _initialize = async () => { await Promise.all( Object.keys(aliases).map( async (key) => - await System.set(key, System.newModule({ default: aliases[key], __useDefault: true })) - ) + await System.set(key, System.newModule({ default: aliases[key], __useDefault: true })), + ), ); // Special handling for vector-icons to allow deep imports @@ -573,7 +573,7 @@ const _initialize = async () => { await System.set(`@expo/vector-icons/${name}`, iconSetModule); await System.set(`react-native-vector-icons/${name}`, iconSetModule); - }) + }), ); // Fix SystemJS path normalization to handle Snack-related special cases @@ -622,7 +622,7 @@ const _initialize = async () => { const regex = new RegExp( `^${escapeStringRegexp(filename.replace(/\.[^.]+$/i, ''))}(${ isImage ? '@\\d+(\\.\\d+)?x' : '()' - })?(\\.([a-z]+(\.expo)?))?\\.${ext}$` // eslint-disable-line no-useless-escape + })?(\\.([a-z]+(\.expo)?))?\\.${ext}$`, // eslint-disable-line no-useless-escape ); // Build a map of files according to the scale and platform @@ -632,37 +632,40 @@ const _initialize = async () => { // 1.5: { path: image@1.5x.png, platform: 'android' }, // 2: { path: image@2x.png, platform: 'android' }, // } - const map = Files.list().reduce((acc, curr) => { - const match = curr.match(regex); + const map = Files.list().reduce( + (acc, curr) => { + const match = curr.match(regex); - if (match) { - // eslint-disable-next-line no-unused-vars - const [, scaleString, , , platform] = match; + if (match) { + // eslint-disable-next-line no-unused-vars + const [, scaleString, , , platform] = match; - // If file doesn't have a scale, default to 1 - // This can happen for asset files without scale, or JS files - const scale = scaleString ? parseFloat(scaleString.substr(1)) : 1; + // If file doesn't have a scale, default to 1 + // This can happen for asset files without scale, or JS files + const scale = scaleString ? parseFloat(scaleString.substr(1)) : 1; - if (platform && !platforms.includes(platform)) { - // If the file has a platform, but it's not the current platform, - // return what we had - return acc; - } + if (platform && !platforms.includes(platform)) { + // If the file has a platform, but it's not the current platform, + // return what we had + return acc; + } - if ( - acc[scale] && - platforms.indexOf(acc[scale].platform) > platforms.indexOf(platform) - ) { - // If we have already found the platform with a higher priority than current platform, - // return what we had - return acc; - } + if ( + acc[scale] && + platforms.indexOf(acc[scale].platform) > platforms.indexOf(platform) + ) { + // If we have already found the platform with a higher priority than current platform, + // return what we had + return acc; + } - return { ...acc, [scale]: { path: curr, platform } }; - } + return { ...acc, [scale]: { path: curr, platform } }; + } - return acc; - }, {} as { [key: string]: { path: string; platform: string } }); + return acc; + }, + {} as { [key: string]: { path: string; platform: string } }, + ); if (Object.keys(map).length) { // Get the device's pixel density and find the closest bigger matching scale @@ -696,7 +699,7 @@ const _initialize = async () => { if (Files.get(basename + '/package.json')) { try { const pack = JSON.parse( - (Files.get(basename + '/package.json') ?? { contents: '' }).contents || '{}' // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing + (Files.get(basename + '/package.json') ?? { contents: '' }).contents || '{}', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing ); index = pack['react-native'] || pack['main'] || 'index'; ext = index.split('.').pop()!; @@ -781,9 +784,9 @@ const _initialize = async () => { Object.keys(this.loads).map((url) => { dependsOn[url] = {}; return this.loads[url].deps.map( - async (dep: string) => (dependsOn[url][await this.resolve(dep, url)] = true) + async (dep: string) => (dependsOn[url][await this.resolve(dep, url)] = true), ); - }) + }), ); // Visit immediate dependents of `rootModuleNames` by post-order DFS, skipping modules that @@ -820,7 +823,7 @@ const _initialize = async () => { export function sanitizeModule(moduleName: string): string { return moduleName.substring( moduleName.startsWith('module://') ? 9 : 0, - moduleName.endsWith('.js.js') ? moduleName.length - 3 : moduleName.length + moduleName.endsWith('.js.js') ? moduleName.length - 3 : moduleName.length, ); } @@ -867,7 +870,7 @@ export const flush = async ({ modules.forEach((dep: string) => System.delete(dep)); changedPaths.forEach( - (path) => delete transformCache[`module://${path}${path.endsWith('.js') ? '' : '.js'}`] + (path) => delete transformCache[`module://${path}${path.endsWith('.js') ? '' : '.js'}`], ); }); @@ -896,7 +899,7 @@ export const load = async (name: string, relativeTo?: string) => { 'Loaded modules', Array.from(System.keys()) .filter((name) => name.toLowerCase().indexOf('app.js') >= 0 || name.indexOf('module://') >= 0) - .map(sanitizeModule) + .map(sanitizeModule), ); return res; }; diff --git a/runtime/src/NativeModules/CanvasKit.web.tsx b/runtime/src/NativeModules/CanvasKit.web.tsx index 136bf7a3..aa9842ce 100644 --- a/runtime/src/NativeModules/CanvasKit.web.tsx +++ b/runtime/src/NativeModules/CanvasKit.web.tsx @@ -36,7 +36,7 @@ export async function loadCanvasKit(options?: CanvasKitInitOptions) { global.CanvasKit = await global.CanvasKitInit(options); } else { console.error( - 'CanvasKitInit is not loaded, this is likely an issue with Snack. - Open a new issue at http://github.com/expo/snack.' + 'CanvasKitInit is not loaded, this is likely an issue with Snack. - Open a new issue at http://github.com/expo/snack.', ); } } @@ -53,7 +53,7 @@ export async function loadCanvasKitScript() { $script.setAttribute('async', ''); $script.setAttribute( 'src', - `https://cdn.jsdelivr.net/npm/canvaskit-wasm@${version}/bin/full/canvaskit.js` + `https://cdn.jsdelivr.net/npm/canvaskit-wasm@${version}/bin/full/canvaskit.js`, ); document.body.appendChild($script); diff --git a/runtime/src/NativeModules/ReactNativeSkia.tsx b/runtime/src/NativeModules/ReactNativeSkia.tsx index 2abed4b1..0c39721f 100644 --- a/runtime/src/NativeModules/ReactNativeSkia.tsx +++ b/runtime/src/NativeModules/ReactNativeSkia.tsx @@ -38,7 +38,7 @@ export function WithSkiaWeb({ fallback, getComponent, opts: options }: WithSkiaP await loadCanvasKit(options); return getComponent(); }), - [getComponent, options] + [getComponent, options], ); return ( diff --git a/runtime/src/NativeModules/ViewShot.web.tsx b/runtime/src/NativeModules/ViewShot.web.tsx index 34e1041e..9e4abd39 100644 --- a/runtime/src/NativeModules/ViewShot.web.tsx +++ b/runtime/src/NativeModules/ViewShot.web.tsx @@ -4,7 +4,7 @@ import type { CaptureOptions } from 'react-native-view-shot'; // Not yet supported export async function captureRef( _viewRef: number | React.Component | Element | React.RefObject, - _options?: CaptureOptions | undefined + _options?: CaptureOptions | undefined, ): Promise { return ''; } diff --git a/runtime/src/UrlUtils.ts b/runtime/src/UrlUtils.ts index 1277ff09..9b2e8917 100644 --- a/runtime/src/UrlUtils.ts +++ b/runtime/src/UrlUtils.ts @@ -1,5 +1,5 @@ export function parseExperienceURL( - experienceURL: string + experienceURL: string, ): { channel: string; testTransport: string | null } | null { const matches = experienceURL.match(/(\+|\/sdk\..*-)([^?]*)\??(.*$)/); if (!matches) { diff --git a/runtime/src/__tests__/UrlUtils-test.ts b/runtime/src/__tests__/UrlUtils-test.ts index 8a42537c..c81db273 100644 --- a/runtime/src/__tests__/UrlUtils-test.ts +++ b/runtime/src/__tests__/UrlUtils-test.ts @@ -9,7 +9,7 @@ describe(parseExperienceURL, () => { it('should parse snack url with testTransport', () => { const result = parseExperienceURL( - 'exp://exp.host/@snack/sdk.47.0.0-4AQkc5pxqe?foo=foo&testTransport=snackpub&bar=bar' + 'exp://exp.host/@snack/sdk.47.0.0-4AQkc5pxqe?foo=foo&testTransport=snackpub&bar=bar', ); expect(result?.channel).toBe('4AQkc5pxqe'); expect(result?.testTransport).toBe('snackpub'); @@ -23,7 +23,7 @@ describe(parseExperienceURL, () => { it('should parse account snack full name url with testTransport', () => { const result = parseExperienceURL( - 'exp://exp.host/@johndoe/the-snack+4AQkc5pxqe?foo=foo&testTransport=snackpub&bar=bar' + 'exp://exp.host/@johndoe/the-snack+4AQkc5pxqe?foo=foo&testTransport=snackpub&bar=bar', ); expect(result?.channel).toBe('4AQkc5pxqe'); expect(result?.testTransport).toBe('snackpub'); diff --git a/runtime/src/aliases/index.tsx b/runtime/src/aliases/index.tsx index eb65fbd6..525d5b20 100644 --- a/runtime/src/aliases/index.tsx +++ b/runtime/src/aliases/index.tsx @@ -1,5 +1,5 @@ -import AssetRegistry from '../NativeModules/AssetRegistry'; import common from './common'; +import AssetRegistry from '../NativeModules/AssetRegistry'; const aliases: { [key: string]: any } = { ...common, diff --git a/runtime/src/aliases/index.web.tsx b/runtime/src/aliases/index.web.tsx index b363a667..0d94a786 100644 --- a/runtime/src/aliases/index.web.tsx +++ b/runtime/src/aliases/index.web.tsx @@ -1,5 +1,5 @@ -import AssetRegistry from '../NativeModules/AssetRegistry'; import common from './common'; +import AssetRegistry from '../NativeModules/AssetRegistry'; const aliases: { [key: string]: any } = { ...common, diff --git a/runtime/src/transports/RuntimeTrafficMirroringTransport.ts b/runtime/src/transports/RuntimeTrafficMirroringTransport.ts index d7741a1e..03a159e5 100644 --- a/runtime/src/transports/RuntimeTrafficMirroringTransport.ts +++ b/runtime/src/transports/RuntimeTrafficMirroringTransport.ts @@ -1,9 +1,9 @@ import AwaitLock from 'await-lock'; -import * as Logger from '../Logger'; import type { Device, RuntimeMessagePayload, RuntimeTransport } from './RuntimeTransport'; import RuntimeTransportImplPubNub from './RuntimeTransportImplPubNub'; import RuntimeTransportImplSocketIO from './RuntimeTransportImplSocketIO'; +import * as Logger from '../Logger'; const FALLBACK_ALWAYS_AFTER_MISSED_THRESHOLD = 5; const FALLBACK_ACK_WAIT_MS = 3000; @@ -48,7 +48,7 @@ export default class RuntimeTrafficMirroringTransport implements RuntimeTranspor Logger.warn( `[RuntimeTrafficMirroringTransport] publish message from fallback transport - primaryTransportConnected[${this.transport.isConnected()}] missedMessageCount[${ this.missedMessageCount - }]` + }]`, ); this.fallbackTransport.publish(message); } @@ -68,7 +68,7 @@ export default class RuntimeTrafficMirroringTransport implements RuntimeTranspor private onMessage = async ( fromFallback: boolean, upperLayerListener: ListenerType, - payload: RuntimeMessagePayload + payload: RuntimeMessagePayload, ) => { if (this.shouldUseFallbackAlways()) { Logger.warn('[RuntimeTrafficMirroringTransport] ack upper from fallback transport'); diff --git a/runtime/src/transports/RuntimeTransportImplPubNub.ts b/runtime/src/transports/RuntimeTransportImplPubNub.ts index 44d2e6ca..27bd56b1 100644 --- a/runtime/src/transports/RuntimeTransportImplPubNub.ts +++ b/runtime/src/transports/RuntimeTransportImplPubNub.ts @@ -2,8 +2,8 @@ import PubNub from 'pubnub'; -import * as Logger from '../Logger'; import type { Device, RuntimeMessagePayload, RuntimeTransport } from './RuntimeTransport'; +import * as Logger from '../Logger'; const PRESENCE_TIMEOUT = 600; const HEARTBEAT_INTERVAL = 60; diff --git a/runtime/src/transports/RuntimeTransportImplSocketIO.ts b/runtime/src/transports/RuntimeTransportImplSocketIO.ts index e3f8c741..d8538687 100644 --- a/runtime/src/transports/RuntimeTransportImplSocketIO.ts +++ b/runtime/src/transports/RuntimeTransportImplSocketIO.ts @@ -2,8 +2,8 @@ import Constants from 'expo-constants'; import { io } from 'socket.io-client'; import type { Socket } from 'socket.io-client'; -import * as Logger from '../Logger'; import type { Device, RuntimeMessagePayload, RuntimeTransport } from './RuntimeTransport'; +import * as Logger from '../Logger'; const SNACKPUB_URL_STAGING = 'https://staging-snackpub.expo.dev'; const SNACKPUB_URL_PRODUCTION = 'https://snackpub.expo.dev'; diff --git a/runtime/src/transports/RuntimeTransportImplWebPlayer.ts b/runtime/src/transports/RuntimeTransportImplWebPlayer.ts index bb47dc29..e38a03c8 100644 --- a/runtime/src/transports/RuntimeTransportImplWebPlayer.ts +++ b/runtime/src/transports/RuntimeTransportImplWebPlayer.ts @@ -1,5 +1,5 @@ -import * as Logger from '../Logger'; import type { Device, RuntimeMessagePayload, RuntimeTransport } from './RuntimeTransport'; +import * as Logger from '../Logger'; /** * The Snack web-player is served directly from S3. This means that anyone @@ -76,7 +76,7 @@ export default class RuntimeTransportImplWebPlayer implements RuntimeTransport { Logger.comm('Connecting to parent'); this.parent?.postMessage( JSON.stringify({ type: 'CONNECT', device: this.device }), - this.origin + this.origin, ); window.addEventListener('message', this.onMessage, false); } @@ -87,7 +87,7 @@ export default class RuntimeTransportImplWebPlayer implements RuntimeTransport { Logger.comm('Disconnecting from parent'); this.parent?.postMessage( JSON.stringify({ type: 'DISCONNECT', device: this.device }), - this.origin + this.origin, ); window.removeEventListener('message', this.onMessage, false); } @@ -105,7 +105,7 @@ export default class RuntimeTransportImplWebPlayer implements RuntimeTransport { type: 'MESSAGE', message: { ...message, device: this.device }, }), - this.origin + this.origin, ); } } diff --git a/runtime/src/transports/__tests__/RuntimeTrafficMirroringTransport-test.ts b/runtime/src/transports/__tests__/RuntimeTrafficMirroringTransport-test.ts index d3d5c76f..60ddd949 100644 --- a/runtime/src/transports/__tests__/RuntimeTrafficMirroringTransport-test.ts +++ b/runtime/src/transports/__tests__/RuntimeTrafficMirroringTransport-test.ts @@ -40,7 +40,7 @@ describe(RuntimeTrafficMirroringTransport, () => { function emitCallbacks( transport: typeof RuntimeTransportImplSocketIO | typeof RuntimeTransportImplPubNub, - message: RuntimeMessagePayload['message'] + message: RuntimeMessagePayload['message'], ) { const mockTransportClass = transport as jest.MockedClass; const mockTransport = mockTransportClass.mock.instances[0]; @@ -63,12 +63,12 @@ describe(RuntimeTrafficMirroringTransport, () => { if (primaryTransport) { const mockLogger = Logger.comm as jest.MockedFunction; expect(mockLogger).toBeCalledWith( - '[RuntimeTrafficMirroringTransport] ack upper from primary transport' + '[RuntimeTrafficMirroringTransport] ack upper from primary transport', ); } else { const mockLogger = Logger.warn as jest.MockedFunction; expect(mockLogger).toBeCalledWith( - '[RuntimeTrafficMirroringTransport] ack upper from fallback transport' + '[RuntimeTrafficMirroringTransport] ack upper from fallback transport', ); } } diff --git a/runtime/web/deploy-script.js b/runtime/web/deploy-script.js index 2f1467fc..5f5efa1b 100644 --- a/runtime/web/deploy-script.js +++ b/runtime/web/deploy-script.js @@ -36,10 +36,10 @@ async function exportWeb(options) { ...process.env, SNACK_EXPORT_WEB: 'true', }, - } + }, ); console.log( - `✅ Exported the Snack Runtime to: ${path.join(options.workingDir, options.exportDir)}` + `✅ Exported the Snack Runtime to: ${path.join(options.workingDir, options.exportDir)}`, ); } @@ -126,7 +126,7 @@ async function uploadWeb(options) { { cwd: options.workingDir, stdio: process.env.CI ? 'inherit' : 'ignore', - } + }, ); console.log(`✅ Uploaded the Snack Runtime to S3: ${bucketName} (v2/${sdkVersion})`); diff --git a/runtime/webpack.config.js b/runtime/webpack.config.js index 93aa3692..49b01ffb 100644 --- a/runtime/webpack.config.js +++ b/runtime/webpack.config.js @@ -12,7 +12,7 @@ module.exports = async function (env, argv) { p.constructor.name !== 'WebpackDeepScopeAnalysisPlugin' && // We don't need PWA support for now\ // Leaving this enabled produces a broken manifest link for sub paths - p.constructor.name !== 'WebpackPwaManifest' + p.constructor.name !== 'WebpackPwaManifest', ); // We serve the app under a subpath @@ -23,7 +23,7 @@ module.exports = async function (env, argv) { path.join(__dirname, 'assets', 'favicon.png'); config.plugins.find( - (p) => p.constructor.name === 'InterpolateHtmlPlugin' + (p) => p.constructor.name === 'InterpolateHtmlPlugin', ).replacements.PUBLIC_URL = ''; config.plugins.find((p) => p.constructor.name === 'ManifestPlugin').opts.publicPath = '';