From f203a2f7e23777cbb8bcfb113f2f6d55ca90db16 Mon Sep 17 00:00:00 2001 From: Jubal Mabaquiao Date: Fri, 22 Nov 2024 13:59:42 +0800 Subject: [PATCH 1/5] fixed build error when app/js folder does not exist --- build/bundler.mts | 15 ++++++++++++--- build/vendor.mts | 8 ++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/build/bundler.mts b/build/bundler.mts index d0fb084d..e90fe4cc 100644 --- a/build/bundler.mts +++ b/build/bundler.mts @@ -1,6 +1,6 @@ -import * as path from 'path' -import * as url from 'url' -import { promises as fs } from 'fs' +import * as path from 'node:path' +import * as url from 'node:url' +import { promises as fs } from 'node:fs' const directoryOfThisFile = path.dirname(url.fileURLToPath(import.meta.url)) @@ -62,12 +62,21 @@ async function* getFiles(topDir: string): AsyncGenerator } } +async function ensureDirectoryExists(dir: string) { + try { + await fs.access(dir) + } catch { + await fs.mkdir(dir, { recursive: true }) + } +} + async function replaceImportsInJSFiles() { const folders = [ path.join(directoryOfThisFile, '..', 'app', 'js'), path.join(directoryOfThisFile, '..', 'app', 'vendor') ] for (const folder of folders) { + await ensureDirectoryExists(folder) for await (const filePath of getFiles(folder)) { if (path.extname(filePath) !== '.js' && path.extname(filePath) !== '.mjs') continue const replaced = replaceImport(filePath, await fs.readFile(filePath, 'utf8')) diff --git a/build/vendor.mts b/build/vendor.mts index 098568eb..8d655627 100644 --- a/build/vendor.mts +++ b/build/vendor.mts @@ -1,7 +1,7 @@ -import * as path from 'path' -import * as url from 'url' -import { promises as fs } from 'fs' -import { FileType, recursiveDirectoryCopy } from '@zoltu/file-copier' +import * as path from 'node:path' +import * as url from 'node:url' +import { promises as fs } from 'node:fs' +import { type FileType, recursiveDirectoryCopy } from '@zoltu/file-copier' import { createHash } from 'node:crypto' const directoryOfThisFile = path.dirname(url.fileURLToPath(import.meta.url)) From 6af3e78d45c9e495466ef43a0fe5c6099509447a Mon Sep 17 00:00:00 2001 From: KillariDev Date: Fri, 22 Nov 2024 12:11:50 +0200 Subject: [PATCH 2/5] move chain selector to left --- app/ts/components/subcomponents/ChainSelector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ts/components/subcomponents/ChainSelector.tsx b/app/ts/components/subcomponents/ChainSelector.tsx index b26f09a8..307d0749 100644 --- a/app/ts/components/subcomponents/ChainSelector.tsx +++ b/app/ts/components/subcomponents/ChainSelector.tsx @@ -57,7 +57,7 @@ export function ChainSelector(params: ChainSelectorParams) { setIsOpen(false) } - return
+ return