script runner

desktopoffline
bunsenstraat 1 year ago
parent 9006f906a8
commit ddd58cc6a5
  1. 6
      apps/remix-ide/src/app.js
  2. 11
      apps/remix-ide/src/app/plugins/electron/scriptRunnerPlugin.ts
  3. 1
      apps/remix-ide/src/remixAppManager.js
  4. 8
      apps/remixdesktop/ethers
  5. 3
      apps/remixdesktop/package.json
  6. 3
      apps/remixdesktop/src/engine.ts
  7. 18
      apps/remixdesktop/src/main.ts
  8. 6
      apps/remixdesktop/src/plugins/compilerLoader.ts
  9. 14
      apps/remixdesktop/src/plugins/configPlugin.ts
  10. 98
      apps/remixdesktop/src/plugins/scriptRunner.ts
  11. 20
      apps/remixdesktop/src/plugins/utility.ts
  12. 2
      apps/remixdesktop/src/plugins/xtermPlugin.ts
  13. 2
      apps/remixdesktop/src/preload.ts
  14. 115
      apps/remixdesktop/yarn.lock
  15. 1
      libs/remix-url-resolver/src/resolve.ts

@ -55,6 +55,7 @@ import { electronConfig } from './app/plugins/electron/electronConfigPlugin'
import { electronTemplates } from './app/plugins/electron/templatesPlugin'
import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
import { scriptRunnerPlugin } from './app/plugins/electron/scriptRunnerPlugin'
import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
import {OpenAIGpt} from './app/plugins/openaigpt'
@ -366,7 +367,8 @@ class AppComponent {
this.engine.register([xterm])
const ripgrep = new ripgrepPlugin()
this.engine.register([ripgrep])
const scriptRunner = new scriptRunnerPlugin()
this.engine.register([scriptRunner])
}
const compilerloader = isElectron()? new compilerLoaderPluginDesktop(): new compilerLoaderPlugin()
@ -490,7 +492,7 @@ class AppComponent {
await this.appManager.activatePlugin(['solidity-script', 'remix-templates'])
if(isElectron()){
await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep'])
await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep', 'scriptRunner'])
}
this.appManager.on(

@ -0,0 +1,11 @@
import { ElectronPlugin } from '@remixproject/engine-electron';
export class scriptRunnerPlugin extends ElectronPlugin {
constructor(){
super({
displayName: 'scriptRunner',
name: 'scriptRunner',
description: 'scriptRunner'
})
}
}

@ -237,6 +237,7 @@ export class RemixAppManager extends PluginManager {
const res = await fetch(this.pluginsDirectory)
plugins = await res.json()
plugins = plugins.filter((plugin) => {
if(plugin.name === 'scriptRunner') return false
if (plugin.targets && Array.isArray(plugin.targets) && plugin.targets.length > 0) {
return plugin.targets.includes('remix')
}

@ -0,0 +1,8 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/ethers@6.8.1/lib.commonjs/index.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ethers=void 0;const tslib_1=require("tslib"),ethers=tslib_1.__importStar(require("./ethers.js"));exports.ethers=ethers,tslib_1.__exportStar(require("./ethers.js"),exports);
//# sourceMappingURL=/sm/a1c32dfeb6df16b35d6019f0c3e6ba14be89dc94667adee6e919d228ff2f0493.map

@ -36,6 +36,7 @@
"typescript": "^5.1.3"
},
"dependencies": {
"@remix-project/remix-url-resolver": "^0.0.65",
"@remixproject/engine": "0.3.37",
"@remixproject/engine-electron": "0.3.37",
"@remixproject/plugin": "0.3.37",
@ -49,7 +50,7 @@
"express": "^4.18.2",
"isomorphic-git": "^1.24.2",
"node-pty": "^0.10.1",
"yarn": "^1.22.19"
"yarn": "^1.22.21"
},
"optionalDependencies": {
"@remix-project/remix-ws-templates": "^1.0.27"

@ -9,6 +9,7 @@ import { ConfigPlugin } from './plugins/configPlugin';
import { TemplatesPlugin } from './plugins/templates';
import { RipgrepPlugin } from './plugins/ripgrepPlugin';
import { CompilerLoaderPlugin } from './plugins/compilerLoader';
import { ScriptRunnerPlugin } from './plugins/scriptRunner';
const engine = new Engine()
const appManager = new PluginManager()
@ -19,6 +20,7 @@ const configPlugin = new ConfigPlugin()
const templatesPlugin = new TemplatesPlugin()
const ripgrepPlugin = new RipgrepPlugin()
const compilerLoaderPlugin = new CompilerLoaderPlugin()
const scriptRunnerPlugin = new ScriptRunnerPlugin()
engine.register(appManager)
engine.register(fsPlugin)
engine.register(xtermPlugin)
@ -27,6 +29,7 @@ engine.register(configPlugin)
engine.register(templatesPlugin)
engine.register(ripgrepPlugin)
engine.register(compilerLoaderPlugin)
engine.register(scriptRunnerPlugin)
appManager.activatePlugin('electronconfig')
appManager.activatePlugin('fs')

@ -1,4 +1,4 @@
import { app, BrowserWindow, dialog, Menu, MenuItem } from 'electron';
import { app, BrowserWindow, dialog, Menu, MenuItem, utilityProcess } from 'electron';
import path from 'path';
@ -27,7 +27,7 @@ export const createWindow = async (dir?: string): Promise<void> => {
},
});
if (dir && dir.endsWith('/')) dir = dir.slice(0, -1)
let params = dir ? `?opendir=${encodeURIComponent(dir)}` : '';
const params = dir ? `?opendir=${encodeURIComponent(dir)}` : '';
// and load the index.html of the app.
mainWindow.loadURL(
process.env.NODE_ENV === 'production' || isPackaged ? `file://${__dirname}/remix-ide/index.html` + params :
@ -104,13 +104,15 @@ const commandKeys: Record<string, string> = {
};
const menu = [...(process.platform === 'darwin' ? [darwinMenu(commandKeys, execCommand, showAbout)] : []),
FileMenu(commandKeys, execCommand),
GitMenu(commandKeys, execCommand),
EditMenu(commandKeys, execCommand),
ViewMenu(commandKeys, execCommand),
TerminalMenu(commandKeys, execCommand),
WindowMenu(commandKeys, execCommand, []),
FileMenu(commandKeys, execCommand),
GitMenu(commandKeys, execCommand),
EditMenu(commandKeys, execCommand),
ViewMenu(commandKeys, execCommand),
TerminalMenu(commandKeys, execCommand),
WindowMenu(commandKeys, execCommand, []),
]
Menu.setApplicationMenu(Menu.buildFromTemplate(menu))

@ -112,7 +112,7 @@ class CompilerLoaderPluginClient extends ElectronBasePluginClient {
}
async getLists(){
return await getLists()
}
}
@ -123,14 +123,14 @@ const getLists = async()=>{
let wasmData
try{
let binRes = await axios.get(baseURLBin + '/list.json')
const binRes = await axios.get(baseURLBin + '/list.json')
await fs.writeFile(cacheDir + '/binlist.json', JSON.stringify(binRes.data, null, 2))
binData = binRes.data
}catch(e) {
}
try{
let wasmRes = await axios.get(baseURLWasm + '/list.json')
const wasmRes = await axios.get(baseURLWasm + '/list.json')
await fs.writeFile(cacheDir + '/wasmlist.json', JSON.stringify(wasmRes.data, null, 2))
wasmData = wasmRes.data
}catch(e) {

@ -2,6 +2,8 @@ import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plug
import { Profile } from "@remixproject/plugin-utils";
import { readConfig, writeConfig } from "../utils/config";
import { app, utilityProcess } from "electron";
import path from "path";
const profile: Profile = {
displayName: 'electronconfig',
@ -37,6 +39,18 @@ class ConfigPluginClient extends ElectronBasePluginClient {
constructor(webContentsId: number, profile: Profile) {
super(webContentsId, profile)
}
async onActivation(): Promise<void> {
//utilityProcess.fork('/Users/filipmertens/Documents/GitHub/remix-project/apps/remixdesktop/node_modules/yarn/bin/yarn.js')
/*const child = utilityProcess.fork(path.join(__dirname, 'utility.js'), [app.getPath('userData')])
this.call('terminal' as any, 'log', JSON.stringify(process.env))
child.on('message', (data) => {
console.log('message from child', data)
this.call('terminal', 'log', data)
})
*/
}
async writeConfig(data: any): Promise<void> {

@ -0,0 +1,98 @@
import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron"
import { utilityProcess } from "electron"
import path from "path"
import * as esbuild from 'esbuild'
import { RemixURLResolver } from '@remix-project/remix-url-resolver'
import fs from 'fs/promises'
import os, { arch } from 'os'
const resolver = new RemixURLResolver()
export const cacheDir = path.join(os.homedir(), '.cache_remix_ide')
const profile = {
"name": "scriptRunner",
"displayName": "Script Runner",
"description": "Execute script and emit logs",
}
const convertPathToPosix = (pathName: string): string => {
return pathName.split(path.sep).join(path.posix.sep)
}
export class ScriptRunnerPlugin extends ElectronBasePlugin {
constructor() {
super(profile, clientProfile, ScriptRunnerClient)
this.methods = [...super.methods, 'execute']
}
}
const clientProfile = {
"name": "scriptRunner",
"displayName": "Script Runner",
"description": "Execute script and emit logs",
"methods": ["execute"]
}
class ScriptRunnerClient extends ElectronBasePluginClient {
workingDir: string = ''
constructor(webContentsId: number, profile: any) {
super(webContentsId, profile)
this.onload(() => {
this.on('fs' as any, 'workingDirChanged', async (path: string) => {
this.workingDir = path
})
})
}
async execute(content: string, path: string): Promise<void> {
path = convertPathToPosix(this.fixPath(path))
console.log('execute', path)
const out = convertPathToPosix(this.fixPath('dist'))
const build = await esbuild.build({
entryPoints: [path],
bundle: true,
outdir: out,
plugins: [onResolvePlugin],
})
console.log(build)
if(build.errors.length > 0) {
console.log('ERRORS', build.errors)
return
}
}
fixPath(path: string): string {
if (this.workingDir === '') throw new Error('workingDir is not set')
if (path) {
if (path.startsWith('/')) {
path = path.slice(1)
}
}
path = this.workingDir + (!this.workingDir.endsWith('/') ? '/' : '') + path
return path
}
}
const onResolvePlugin = {
name: 'onResolve',
setup(build: esbuild.PluginBuild) {
build.onLoad({
filter: /.*/,
}, async args => {
console.log('onLoad', args)
/*if(args.namespace && args.namespace !== 'file'){
const imported = await resolver.resolve(args.path)
console.log('imported', imported)
return {
contents: imported.content,
loader: 'js',
}
}*/
return undefined
})
}
}

@ -0,0 +1,20 @@
console.log('Starting utilities')
process.parentPort.postMessage('start utilities')
import { spawn } from 'node:child_process';
const ls = spawn('ls', ['-la'])
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
process.parentPort.postMessage(data.toString())
});
process.parentPort.postMessage(JSON.stringify(process.env))
const ls2 = spawn('yarn', ['-v'])
ls2.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
process.parentPort.postMessage(data.toString())
});
ls.stderr.on('data', (data) => {
console.error(`stderr: ${data}`);
process.parentPort.postMessage(data.toString())
})

@ -143,7 +143,7 @@ class XtermPluginClient extends ElectronBasePluginClient {
parsedEnv = parseEnv(stdout)
}
let env = parsedEnv || process.env
const env = parsedEnv || process.env
const ptyProcess = pty.spawn(shell || defaultShell, [], {
name: 'xterm-color',

@ -6,7 +6,7 @@ console.log('preload.ts', new Date().toLocaleTimeString())
/* preload script needs statically defined API for each plugin */
const exposedPLugins = ['fs', 'git', 'xterm', 'isogit', 'electronconfig', 'electronTemplates', 'ripgrep', 'compilerloader']
const exposedPLugins = ['fs', 'git', 'xterm', 'isogit', 'electronconfig', 'electronTemplates', 'ripgrep', 'compilerloader', 'scriptRunner']
let webContentsId: number | undefined

@ -7,6 +7,13 @@
resolved "https://registry.npmjs.org/7zip-bin/-/7zip-bin-5.1.1.tgz"
integrity sha512-sAP4LldeWNz0lNzmTird3uWfFDWWTeg6V/MsmyyLR9X1idwKBWIgt/ZvinqQldJm3LecKEs1emkbquO6PCiLVQ==
"@babel/runtime@^7.8.3":
version "7.23.2"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885"
integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==
dependencies:
regenerator-runtime "^0.14.0"
"@develar/schema-utils@~2.6.5":
version "2.6.5"
resolved "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz"
@ -62,6 +69,24 @@
minimatch "^3.0.4"
plist "^3.0.4"
"@erebos/bzz-node@^0.13.0":
version "0.13.0"
resolved "https://registry.yarnpkg.com/@erebos/bzz-node/-/bzz-node-0.13.0.tgz#495240c8b4fa67fa920c52a2d8db2cf82e673e1a"
integrity sha512-Mmo9awJG/Agj6lPqicj8VRdUELoT9pP2xIVniaoUqIMMZkf+lswXFylkyH578ZCNaehyZTTttaXS5WA+T9UVyA==
dependencies:
"@babel/runtime" "^7.8.3"
"@erebos/bzz" "^0.13.0"
form-data "^3.0.0"
node-fetch "^2.6.0"
tar-stream "^2.1.0"
"@erebos/bzz@^0.13.0":
version "0.13.0"
resolved "https://registry.yarnpkg.com/@erebos/bzz/-/bzz-0.13.0.tgz#8ddd4e685c8ed53b5147653e041c21fc35553468"
integrity sha512-ETjXxeNzT7wGofz0CcrNEc/dLeLg0DALuxpMymrzK+AvLvP8PZUfiFn+tZoupSMGaLldfSLJXweOfs3BimVaRg==
dependencies:
"@babel/runtime" "^7.8.3"
"@esbuild/android-arm64@0.19.5":
version "0.19.5"
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz#276c5f99604054d3dbb733577e09adae944baa90"
@ -621,6 +646,16 @@
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
"@remix-project/remix-url-resolver@^0.0.65":
version "0.0.65"
resolved "https://registry.yarnpkg.com/@remix-project/remix-url-resolver/-/remix-url-resolver-0.0.65.tgz#11f035b18169a5e311748943412373ca1a27d360"
integrity sha512-KsBX5QriY6WV+cFuRWR+xkQVE490ZqQJSt9mtx5K4ua3y4M3rRvl4tG5nfCSo4bPxXnVglErSw7HOZtJM6JHvA==
dependencies:
"@erebos/bzz-node" "^0.13.0"
axios "1.2.2"
url "^0.11.0"
valid-url "^1.0.9"
"@remix-project/remix-ws-templates@^1.0.27":
version "1.0.27"
resolved "https://registry.yarnpkg.com/@remix-project/remix-ws-templates/-/remix-ws-templates-1.0.27.tgz#dc3b5ea43e077f5f0c792bb1987376e5ee365af4"
@ -1140,6 +1175,15 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3"
integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==
axios@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.2.tgz#72681724c6e6a43a9fea860fc558127dbe32f9f1"
integrity sha512-bz/J4gS2S3I7mpN/YZfGFTqhXTYzRho8Ay38w2otuuDR322KzFIWm/4W2K6gIwvWaws5n+mnb7D1lN9uD+QH6Q==
dependencies:
follow-redirects "^1.15.0"
form-data "^4.0.0"
proxy-from-env "^1.1.0"
axios@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7"
@ -1188,7 +1232,7 @@ binary-extensions@^2.0.0:
resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz"
integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==
bl@^4.1.0:
bl@^4.0.3, bl@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz"
integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
@ -2041,7 +2085,7 @@ encoding@^0.1.13:
dependencies:
iconv-lite "^0.6.2"
end-of-stream@^1.1.0:
end-of-stream@^1.1.0, end-of-stream@^1.4.1:
version "1.4.4"
resolved "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz"
integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
@ -2501,6 +2545,15 @@ form-data-encoder@1.7.1:
resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.1.tgz#ac80660e4f87ee0d3d3c3638b7da8278ddb8ec96"
integrity sha512-EFRDrsMm/kyqbTQocNvRXMLjc7Es2Vk+IQFx/YW7hkUH1eBl4J1fqiP34l74Yt0pFLCNpc06fkbVk00008mzjg==
form-data@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==
dependencies:
asynckit "^0.4.0"
combined-stream "^1.0.8"
mime-types "^2.1.12"
form-data@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz"
@ -2529,6 +2582,11 @@ fresh@0.5.2:
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7"
integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==
fs-constants@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
fs-extra@^10.0.0, fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz"
@ -3783,7 +3841,7 @@ node-api-version@^0.1.4:
dependencies:
semver "^7.3.5"
node-fetch@^2.6.12:
node-fetch@^2.6.0, node-fetch@^2.6.12:
version "2.7.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d"
integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==
@ -4070,6 +4128,11 @@ punycode@2.1.0:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
integrity sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA==
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==
punycode@^2.1.0, punycode@^2.1.1:
version "2.3.0"
resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz"
@ -4082,6 +4145,13 @@ qs@6.11.0:
dependencies:
side-channel "^1.0.4"
qs@^6.11.2:
version "6.11.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9"
integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==
dependencies:
side-channel "^1.0.4"
qs@~6.5.2:
version "6.5.3"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
@ -4144,7 +4214,7 @@ read-config-file@6.2.0:
json5 "^2.2.0"
lazy-val "^1.0.4"
readable-stream@^3.4.0, readable-stream@^3.6.0:
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
version "3.6.2"
resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz"
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
@ -4160,6 +4230,11 @@ readdirp@~3.6.0:
dependencies:
picomatch "^2.2.1"
regenerator-runtime@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45"
integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==
regexp.prototype.flags@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e"
@ -4681,6 +4756,17 @@ swarm-js@^0.1.40:
tar "^4.0.2"
xhr-request "^1.0.1"
tar-stream@^2.1.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
dependencies:
bl "^4.0.3"
end-of-stream "^1.4.1"
fs-constants "^1.0.0"
inherits "^2.0.3"
readable-stream "^3.1.1"
tar@^4.0.2:
version "4.4.19"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
@ -4912,6 +4998,14 @@ url-set-query@^1.0.0:
resolved "https://registry.yarnpkg.com/url-set-query/-/url-set-query-1.0.0.tgz#016e8cfd7c20ee05cafe7795e892bd0702faa339"
integrity sha512-3AChu4NiXquPfeckE5R5cGdiHCMWJx1dwCWOmWIL4KHAziJNOFIYJlpGFeKDvwLPHovZRCxK3cYlwzqI9Vp+Gg==
url@^0.11.0:
version "0.11.3"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.3.tgz#6f495f4b935de40ce4a0a52faee8954244f3d3ad"
integrity sha512-6hxOLGfZASQK/cijlZnZJTq8OXAkt/3YGfQX45vvMYXpZoo8NdWZcY73K108Jf759lS1Bv/8wXnHDTSz17dSRw==
dependencies:
punycode "^1.4.1"
qs "^6.11.2"
utf-8-validate@^5.0.2:
version "5.0.10"
resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.10.tgz#d7d10ea39318171ca982718b6b96a8d2442571a2"
@ -4960,6 +5054,11 @@ uuid@^9.0.0:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
valid-url@^1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200"
integrity sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==
varint@^5.0.0:
version "5.0.2"
resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4"
@ -5401,10 +5500,10 @@ yargs@^17.0.1, yargs@^17.5.1:
y18n "^5.0.5"
yargs-parser "^21.1.1"
yarn@^1.22.19:
version "1.22.19"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.19.tgz#4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
integrity sha512-/0V5q0WbslqnwP91tirOvldvYISzaqhClxzyUKXYxs07yUILIs5jx/k6CFe8bvKSkds5w+eiOqta39Wk3WxdcQ==
yarn@^1.22.21:
version "1.22.21"
resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.21.tgz#1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
integrity sha512-ynXaJsADJ9JiZ84zU25XkPGOvVMmZ5b7tmTSpKURYwgELdjucAOydqIOrOfTxVYcNXe91xvLZwcRh68SR3liCg==
yauzl@^2.10.0:
version "2.10.0"

@ -246,6 +246,7 @@ export class RemixURLResolver {
const builtinHandlers: Handler[] = this.getHandlers()
const handlers: Handler[] = customHandlers ? [...builtinHandlers, ...customHandlers] : [...builtinHandlers]
const matchedHandler = handlers.filter(handler => handler.match(filePath))
console.log('matchedHandler', matchedHandler)
const handler: Handler = matchedHandler[0]
const match = handler.match(filePath)
const { content, cleanUrl } = await handler.handle(match)

Loading…
Cancel
Save