From 6de839a6d6fa743bba52ed4b2db033b2ced32c0c Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 7 Aug 2022 15:13:56 -0500 Subject: [PATCH] Make scan imports relative for Worker compat --- helpers/scanner/client.mjs | 2 +- helpers/scanner/parsers/macho-node/parser.js | 2 +- helpers/scanner/parsers/macho.js | 2 +- helpers/scanner/scan.mjs | 8 ++++---- helpers/scanner/{worker.js => worker.mjs} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename helpers/scanner/{worker.js => worker.mjs} (93%) diff --git a/helpers/scanner/client.mjs b/helpers/scanner/client.mjs index ee28ee2..51fadec 100644 --- a/helpers/scanner/client.mjs +++ b/helpers/scanner/client.mjs @@ -1,4 +1,4 @@ -import AppScanWorker from '~/helpers/scanner/worker.js?worker' +import AppScanWorker from './worker.mjs?worker' export async function runScanWorker ( file ) { // console.log( 'file', file ) diff --git a/helpers/scanner/parsers/macho-node/parser.js b/helpers/scanner/parsers/macho-node/parser.js index 89aa2b4..20264a1 100644 --- a/helpers/scanner/parsers/macho-node/parser.js +++ b/helpers/scanner/parsers/macho-node/parser.js @@ -2,7 +2,7 @@ import { Reader } from './endian-reader' import { constants } from './constants' -import { MAGIC } from '~/helpers/macho/macho.magic.js' +import { MAGIC } from '../../../macho/macho.magic.js' function determineMagicBits ( magic ) { for ( const [ key, value ] of Object.entries( MAGIC ) ) { diff --git a/helpers/scanner/parsers/macho.js b/helpers/scanner/parsers/macho.js index a03b9cb..aaa70ba 100644 --- a/helpers/scanner/parsers/macho.js +++ b/helpers/scanner/parsers/macho.js @@ -1,6 +1,6 @@ import { Buffer } from 'buffer/index.js' -import parseMacho from '~/helpers/macho/index.js' +import parseMacho from '../../macho/index.js' import { Parser as MachoNodeParser } from './macho-node/parser.js' diff --git a/helpers/scanner/scan.mjs b/helpers/scanner/scan.mjs index 00026b1..dfb5fc9 100644 --- a/helpers/scanner/scan.mjs +++ b/helpers/scanner/scan.mjs @@ -2,10 +2,10 @@ import { Buffer } from 'buffer/index.js' import prettyBytes from 'pretty-bytes' import * as zip from '@zip.js/zip.js' -import * as FileApi from '~/helpers/scanner/file-api.js' -import { isString, isNonEmptyString } from '~/helpers/check-types.js' -import { parsePlistBuffer } from '~/helpers/scanner/parsers/plist.js' -import { extractMachoMeta } from '~/helpers/scanner/parsers/macho.js' +import * as FileApi from './file-api.js' +import { isString, isNonEmptyString } from '../check-types.js' +import { parsePlistBuffer } from './parsers/plist.js' +import { extractMachoMeta } from './parsers/macho.js' // https://gildas-lormeau.github.io/zip.js/core-api.html#configuration zip.configure({ diff --git a/helpers/scanner/worker.js b/helpers/scanner/worker.mjs similarity index 93% rename from helpers/scanner/worker.js rename to helpers/scanner/worker.mjs index 502ebdd..cb5e0df 100644 --- a/helpers/scanner/worker.js +++ b/helpers/scanner/worker.mjs @@ -1,4 +1,4 @@ -import { AppScan } from '~/helpers/scanner/scan.mjs' +import { AppScan } from './scan.mjs' self.onmessage = async ( event ) => {