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')
const modalDialog = require('./app/ui/modaldialog')
const FileManager = require('./app/files/fileManager')
const FileProvider = require('./app/files/fileProvider')
const DGitProvider = require('./app/files/dgitProvider')
const WorkspaceFileProvider = require('./app/files/workspaceFileProvider')
const toolTip = require('./app/ui/tooltip')
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
// ----------------- fileManager service ----------------------------
const fileManager = new FileManager(editor, appManager)
registry.put({ api: fileManager, name: 'filemanager' })
// ----------------- dGit provider ---------------------------------
const dGitProvider = new DGitProvider(fileManager)
// ----------------- import content service ------------------------
const contentImport = new CompilerImport(fileManager)
......@@ -309,7 +312,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
contextualListener,
terminal,
web3Provider,
fetchAndCompile
fetchAndCompile,
dGitProvider
])
// LAYOUT & SYSTEM VIEWS
......
This diff is collapsed.
......@@ -22,7 +22,7 @@ const profile = {
icon: 'assets/img/fileManager.webp',
permission: true,
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'
}
const errorMsg = {
......@@ -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
* @param {string} path path of the directory or file
......
......@@ -35,7 +35,7 @@ const profile = {
name: 'filePanel',
displayName: 'File explorers',
methods: ['createNewFile', 'uploadFile', 'getCurrentWorkspace', 'getWorkspaces', 'createWorkspace'],
events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace'],
events: ['setWorkspace', 'renameWorkspace', 'deleteWorkspace', 'createWorkspace'],
icon: 'assets/img/fileManager.webp',
description: ' - ',
kind: 'fileexplorer',
......@@ -202,7 +202,7 @@ module.exports = class Filepanel extends ViewPlugin {
return browserProvider.exists(workspacePath)
}
async createWorkspace (workspaceName) {
async createWorkspace (workspaceName, setDefaults = true) {
if (!workspaceName) throw new Error('name cannot be empty')
if (checkSpecialChars(workspaceName) || checkSlash(workspaceName)) throw new Error('special characters are not allowed')
if (await this.workspaceExists(workspaceName)) throw new Error('workspace already exists')
......@@ -211,14 +211,16 @@ module.exports = class Filepanel extends ViewPlugin {
await this.processCreateWorkspace(workspaceName)
workspaceProvider.setWorkspace(workspaceName)
await this.request.setWorkspace(workspaceName) // tells the react component to switch to that workspace
for (const file in examples) {
setTimeout(async () => { // space creation of files to give react ui time to update.
try {
await workspaceProvider.set(examples[file].name, examples[file].content)
} catch (error) {
console.error(error)
}
}, 10)
if (setDefaults) {
for (const file in examples) {
setTimeout(async () => { // space creation of files to give react ui time to update.
try {
await workspaceProvider.set(examples[file].name, examples[file].content)
} catch (error) {
console.error(error)
}
}, 10)
}
}
}
}
......
......@@ -67,7 +67,7 @@ export const Workspace = (props: WorkspaceProps) => {
}
props.request.getCurrentWorkspace = () => {
return state.currentWorkspace
return { name: state.currentWorkspace, isLocalhost: state.currentWorkspace === LOCALHOST, absolutePath: `${props.workspace.workspacesPath}/${state.currentWorkspace}` }
}
useEffect(() => {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -134,13 +134,13 @@
"@ethereumjs/common": "^2.2.0",
"@ethereumjs/tx": "^3.1.3",
"@ethereumjs/vm": "^5.3.2",
"@remixproject/engine": "^0.3.16",
"@remixproject/engine-web": "^0.3.16",
"@remixproject/plugin": "^0.3.16",
"@remixproject/plugin-api": "^0.3.16",
"@remixproject/plugin-utils": "^0.3.16",
"@remixproject/plugin-webview": "^0.3.16",
"@remixproject/plugin-ws": "^0.3.16",
"@remixproject/engine": "^0.3.17",
"@remixproject/engine-web": "^0.3.17",
"@remixproject/plugin": "^0.3.17",
"@remixproject/plugin-api": "^0.3.17",
"@remixproject/plugin-utils": "^0.3.17",
"@remixproject/plugin-webview": "^0.3.17",
"@remixproject/plugin-ws": "^0.3.17",
"ansi-gray": "^0.1.1",
"async": "^2.6.2",
"axios": ">=0.21.1",
......@@ -154,9 +154,12 @@
"ethereumjs-util": "^7.0.10",
"ethers": "^5.1.4",
"express-ws": "^4.0.0",
"file-saver": "^2.0.5",
"form-data": "^4.0.0",
"fs-extra": "^3.0.1",
"http-server": "^0.11.1",
"isbinaryfile": "^3.0.2",
"isomorphic-git": "^1.8.2",
"jquery": "^3.3.1",
"jszip": "^3.6.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