|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
import { Plugin } from '@remixproject/engine' |
|
|
|
|
import * as packageJson from '../../../../../package.json' |
|
|
|
|
const _paq = window._paq = window._paq || [] |
|
|
|
|
|
|
|
|
|
export const profile = { |
|
|
|
|
name: 'intelligentScriptExecutor', |
|
|
|
@ -26,9 +27,11 @@ export class IntelligentScriptExecutor extends Plugin { |
|
|
|
|
e.preventDefault() |
|
|
|
|
this.targetFileName = file |
|
|
|
|
await this.call('solidity', 'compile', file) |
|
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'compile_solidity']) |
|
|
|
|
} else if (file.endsWith('.js') || file.endsWith('.ts')) { |
|
|
|
|
e.preventDefault() |
|
|
|
|
this.runScript(file, false) |
|
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script']) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -50,7 +53,10 @@ export class IntelligentScriptExecutor extends Plugin { |
|
|
|
|
if (this.targetFileName === contract.file && contract.object && contract.object.devdoc['custom:dev-run-script']) { |
|
|
|
|
this.targetFileName = null |
|
|
|
|
const file = contract.object.devdoc['custom:dev-run-script'] |
|
|
|
|
if (file) this.runScript(file, true) |
|
|
|
|
if (file) { |
|
|
|
|
this.runScript(file, true) |
|
|
|
|
_paq.push(['trackEvent', 'ScriptExecutor', 'run_script_after_compile']) |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|