Commit 8f0e7a5b authored by filip mertens's avatar filip mertens

dgit

lint update plugin version update plugin
parent 9e83ecbc
...@@ -34,6 +34,7 @@ const modalDialogCustom = require('./app/ui/modal-dialog-custom') ...@@ -34,6 +34,7 @@ const modalDialogCustom = require('./app/ui/modal-dialog-custom')
const modalDialog = require('./app/ui/modaldialog') const modalDialog = require('./app/ui/modaldialog')
const FileManager = require('./app/files/fileManager') const FileManager = require('./app/files/fileManager')
const FileProvider = require('./app/files/fileProvider') const FileProvider = require('./app/files/fileProvider')
const DGitProvider = require('./app/files/dgitProvider')
const WorkspaceFileProvider = require('./app/files/workspaceFileProvider') const WorkspaceFileProvider = require('./app/files/workspaceFileProvider')
const toolTip = require('./app/ui/tooltip') const toolTip = require('./app/ui/tooltip')
const CompilerMetadata = require('./app/files/compiler-metadata') const CompilerMetadata = require('./app/files/compiler-metadata')
...@@ -256,6 +257,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -256,6 +257,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// ----------------- fileManager service ---------------------------- // ----------------- fileManager service ----------------------------
const fileManager = new FileManager(editor, appManager) const fileManager = new FileManager(editor, appManager)
registry.put({ api: fileManager, name: 'filemanager' }) registry.put({ api: fileManager, name: 'filemanager' })
// ----------------- dGit provider ---------------------------------
const dGitProvider = new DGitProvider(fileManager)
// ----------------- import content service ------------------------ // ----------------- import content service ------------------------
const contentImport = new CompilerImport(fileManager) const contentImport = new CompilerImport(fileManager)
...@@ -309,7 +312,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org ...@@ -309,7 +312,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
contextualListener, contextualListener,
terminal, terminal,
web3Provider, web3Provider,
fetchAndCompile fetchAndCompile,
dGitProvider
]) ])
// LAYOUT & SYSTEM VIEWS // LAYOUT & SYSTEM VIEWS
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ const profile = { ...@@ -22,7 +22,7 @@ const profile = {
icon: 'assets/img/fileManager.webp', icon: 'assets/img/fileManager.webp',
permission: true, permission: true,
version: packageJson.version, version: packageJson.version,
methods: ['file', 'exists', 'open', 'writeFile', 'readFile', 'copyFile', 'copyDir', 'rename', 'mkdir', 'readdir', 'remove', 'getCurrentFile', 'getFile', 'getFolder', 'setFile', 'switchFile'], methods: ['file', 'exists', 'open', 'writeFile', 'readFile', 'copyFile', 'copyDir', 'rename', 'mkdir', 'readdir', 'remove', 'getCurrentFile', 'getFile', 'getFolder', 'setFile', 'switchFile', 'refresh'],
kind: 'file-system' kind: 'file-system'
} }
const errorMsg = { const errorMsg = {
...@@ -129,6 +129,16 @@ class FileManager extends Plugin { ...@@ -129,6 +129,16 @@ class FileManager extends Plugin {
} }
} }
/*
* refresh the file explorer
* TODO: it's a hack, can be better
*/
refresh () {
const provider = this.fileProviderOf('/')
provider.event.emit('folderAdded', '/')
}
/** /**
* Verify if the path provided is a file * Verify if the path provided is a file
* @param {string} path path of the directory or file * @param {string} path path of the directory or file
......
...@@ -35,7 +35,7 @@ const profile = { ...@@ -35,7 +35,7 @@ const profile = {
name: 'filePanel', name: 'filePanel',
displayName: 'File explorers', displayName: 'File explorers',
methods: ['createNewFile', 'uploadFile', 'getCurrentWorkspace', 'getWorkspaces', 'createWorkspace'], methods: ['createNewFile', 'uploadFile', 'getCurrentWorkspace', 'getWorkspaces', 'createWorkspace'],
events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace'], events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace', 'createWorkspace'],
icon: 'assets/img/fileManager.webp', icon: 'assets/img/fileManager.webp',
description: ' - ', description: ' - ',
kind: 'fileexplorer', kind: 'fileexplorer',
...@@ -202,7 +202,7 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -202,7 +202,7 @@ module.exports = class Filepanel extends ViewPlugin {
return browserProvider.exists(workspacePath) return browserProvider.exists(workspacePath)
} }
async createWorkspace (workspaceName) { async createWorkspace (workspaceName, setDefaults = true) {
if (!workspaceName) throw new Error('name cannot be empty') if (!workspaceName) throw new Error('name cannot be empty')
if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed') if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed')
if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists') if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists')
...@@ -211,14 +211,16 @@ module.exports = class Filepanel extends ViewPlugin { ...@@ -211,14 +211,16 @@ module.exports = class Filepanel extends ViewPlugin {
await this.processCreateWorkspace(workspaceName) await this.processCreateWorkspace(workspaceName)
workspaceProvider.setWorkspace(workspaceName) workspaceProvider.setWorkspace(workspaceName)
await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace
for (const file in examples) { if (setDefaults) {
setTimeout(async () => { // space creation of files to give react ui time to update. for (const file in examples) {
try { setTimeout(async () => { // space creation of files to give react ui time to update.
await workspaceProvider.set(examples[file].name, examples[file].content) try {
} catch (error) { await workspaceProvider.set(examples[file].name, examples[file].content)
console.error(error) } catch (error) {
} console.error(error)
}, 10) }
}, 10)
}
} }
} }
} }
......
...@@ -67,7 +67,7 @@ export const Workspace = (props: WorkspaceProps) => { ...@@ -67,7 +67,7 @@ export const Workspace = (props: WorkspaceProps) => {
} }
props.request.getCurrentWorkspace = () => { props.request.getCurrentWorkspace = () => {
return state.currentWorkspace return { name: state.currentWorkspace, isLocalhost: state.currentWorkspace === LOCALHOST, absolutePath: `${props.workspace.workspacesPath}/${state.currentWorkspace}` }
} }
useEffect(() => { useEffect(() => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -134,13 +134,13 @@ ...@@ -134,13 +134,13 @@
"@ethereumjs/common": "^2.2.0", "@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.1.3", "@ethereumjs/tx": "^3.1.3",
"@ethereumjs/vm": "^5.3.2", "@ethereumjs/vm": "^5.3.2",
"@remixproject/engine": "^0.3.16", "@remixproject/engine": "^0.3.17",
"@remixproject/engine-web": "^0.3.16", "@remixproject/engine-web": "^0.3.17",
"@remixproject/plugin": "^0.3.16", "@remixproject/plugin": "^0.3.17",
"@remixproject/plugin-api": "^0.3.16", "@remixproject/plugin-api": "^0.3.17",
"@remixproject/plugin-utils": "^0.3.16", "@remixproject/plugin-utils": "^0.3.17",
"@remixproject/plugin-webview": "^0.3.16", "@remixproject/plugin-webview": "^0.3.17",
"@remixproject/plugin-ws": "^0.3.16", "@remixproject/plugin-ws": "^0.3.17",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"async": "^2.6.2", "async": "^2.6.2",
"axios": ">=0.21.1", "axios": ">=0.21.1",
...@@ -154,9 +154,12 @@ ...@@ -154,9 +154,12 @@
"ethereumjs-util": "^7.0.10", "ethereumjs-util": "^7.0.10",
"ethers": "^5.1.4", "ethers": "^5.1.4",
"express-ws": "^4.0.0", "express-ws": "^4.0.0",
"file-saver": "^2.0.5",
"form-data": "^4.0.0",
"fs-extra": "^3.0.1", "fs-extra": "^3.0.1",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"isbinaryfile": "^3.0.2", "isbinaryfile": "^3.0.2",
"isomorphic-git": "^1.8.2",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"jszip": "^3.6.0", "jszip": "^3.6.0",
"latest-version": "^5.1.0", "latest-version": "^5.1.0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment