aboutsummaryrefslogtreecommitdiffstats
path: root/packages/deployer/src/commands.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/deployer/src/commands.ts')
-rw-r--r--packages/deployer/src/commands.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/packages/deployer/src/commands.ts b/packages/deployer/src/commands.ts
new file mode 100644
index 000000000..2acef8e8f
--- /dev/null
+++ b/packages/deployer/src/commands.ts
@@ -0,0 +1,19 @@
+import { migrator } from './migrations/migrate';
+import { Compiler } from './compiler';
+import { Deployer } from './deployer';
+import { CompilerOptions, DeployerOptions } from './utils/types';
+
+export const commands = {
+ async compileAsync(opts: CompilerOptions): Promise<void> {
+ const compiler = new Compiler(opts);
+ await compiler.compileAllAsync();
+ },
+ async migrateAsync(opts: DeployerOptions): Promise<void> {
+ const deployer = new Deployer(opts);
+ await migrator.runMigrationsAsync(deployer);
+ },
+ async deployAsync(contractName: string, args: any[], opts: DeployerOptions): Promise<void> {
+ const deployer = new Deployer(opts);
+ await deployer.deployAndSaveAsync(contractName, args);
+ },
+};