desktopmerge
bunsenstraat 1 year ago
parent f29621d1c7
commit 99ca713465
  1. 4
      .circleci/config.yml
  2. 4
      apps/remixdesktop/package.json
  3. 39
      apps/remixdesktop/src/plugins/ripgrepPlugin.ts
  4. 10035
      projects.json

@ -122,9 +122,8 @@ jobs:
mkdir apps/remixdesktop/build
cp -r dist/apps/remix-ide apps/remixdesktop/build/remix-ide
cd apps/remixdesktop/
rm -rf yarn.lock
yarn add node-pty
yarn
yarn --ignore-optional
yarn add @remix-project/remix-ws-templates
yarn dist --linux
rm -rf release/*-unpacked
@ -170,7 +169,6 @@ jobs:
cp -r dist/apps/remix-ide apps/remixdesktop/build/remix-ide
cd apps/remixdesktop/
yarn
yarn add @remix-project/remix-ws-templates
yarn dist --win
rm -rf release/*-unpacked
- save_cache:

@ -36,7 +36,6 @@
"typescript": "^5.1.3"
},
"dependencies": {
"@remix-project/remix-ws-templates": "^1.0.27",
"@remixproject/engine": "0.3.37",
"@remixproject/engine-electron": "0.3.37",
"@remixproject/plugin": "0.3.37",
@ -49,6 +48,9 @@
"node-pty": "^0.10.1",
"yarn": "^1.22.19"
},
"optionalDependencies": {
"@remix-project/remix-ws-templates": "^1.0.27"
},
"build": {
"productName": "Remix IDE",
"appId": "org.ethereum.remix-ide",

@ -1,10 +1,13 @@
import { PluginClient } from "@remixproject/plugin";
import { Profile } from "@remixproject/plugin-utils";
import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron"
import path from "path";
import { rgPath } from "@vscode/ripgrep";
import byline from "byline";
import { spawn } from "child_process";
import {PluginClient} from '@remixproject/plugin'
import {Profile} from '@remixproject/plugin-utils'
import {
ElectronBasePlugin,
ElectronBasePluginClient,
} from '@remixproject/plugin-electron'
import path from 'path'
import {rgPath} from '@vscode/ripgrep'
import byline from 'byline'
import {spawn} from 'child_process'
const profile: Profile = {
name: 'ripgrep',
@ -16,7 +19,6 @@ const convertPathToPosix = (pathName: string): string => {
return pathName.split(path.sep).join(path.posix.sep)
}
export class RipgrepPlugin extends ElectronBasePlugin {
clients: RipgrepPluginClient[] = []
constructor() {
@ -29,20 +31,19 @@ const clientProfile: Profile = {
name: 'ripgrep',
displayName: 'ripgrep',
description: 'ripgrep plugin',
methods: ['glob']
methods: ['glob'],
}
export class RipgrepPluginClient extends ElectronBasePluginClient {
workingDir: string = ''
constructor(webContentsId: number, profile: Profile) {
super(webContentsId, profile)
this.onload(() => {
this.on('fs' as any, 'workingDirChanged', async (path: string) => {
this.workingDir = path
})
})
}
async glob(path: string, pattern: string, options?: any) {
@ -50,17 +51,22 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
console.log('path', path, this.workingDir)
return new Promise((c, e) => {
// replace packed app path with unpacked app path for release on windows
const customRgPath = rgPath.replace('/app.asar/', '/app.asar.unpacked/')
const customRgPath = rgPath.includes('app.asar.unpacked')
? rgPath
: rgPath.replace('app.asar', 'app.asar.unpacked')
const rg = spawn(customRgPath, ['.', '-l', path])
const resultrg: any[] = []
const stream = byline(rg.stdout.setEncoding('utf8'))
stream.on('data', (rgresult: string) => {
console.log('rgresult', rgresult)
let pathWithoutWorkingDir = rgresult.replace(convertPathToPosix(this.workingDir), '')
console.log('rgresult', rgresult)
let pathWithoutWorkingDir = rgresult.replace(
convertPathToPosix(this.workingDir),
''
)
if (pathWithoutWorkingDir.endsWith('/')) {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(0, -1)
}
@ -71,7 +77,7 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
pathWithoutWorkingDir = pathWithoutWorkingDir.slice(1)
}
resultrg.push({
path:convertPathToPosix(pathWithoutWorkingDir),
path: convertPathToPosix(pathWithoutWorkingDir),
isDirectory: false,
})
})
@ -79,7 +85,6 @@ export class RipgrepPluginClient extends ElectronBasePluginClient {
c(resultrg)
})
})
}
fixPath(path: string): string {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save