Skip to content

Commit 6d1a74a

Browse files
authored
Merge pull request #1483 from polywrap/cli/deployer-renaming
cli: deployer rename
2 parents 1c03a32 + 61b76ea commit 6d1a74a

13 files changed

Lines changed: 51 additions & 50 deletions

File tree

packages/cli/src/commands/deploy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
DeployJob,
99
DeployStep,
1010
parseLogFileOption,
11-
PolywrapDeploy,
11+
Deployer,
1212
defaultDeployManifest,
1313
} from "../lib";
1414

@@ -70,7 +70,7 @@ async function run(options: Required<DeployCommandOptions>): Promise<void> {
7070
const { manifestFile, outputFile, verbose, quiet, logFile } = options;
7171
const logger = createLogger({ verbose, quiet, logFile });
7272

73-
const deployer = await PolywrapDeploy.create(manifestFile, logger);
73+
const deployer = await Deployer.create(manifestFile, logger);
7474

7575
const allStepsFromAllJobs = Object.entries(deployer.manifest.jobs).flatMap(
7676
([jobName, job]) => {
@@ -117,7 +117,7 @@ async function run(options: Required<DeployCommandOptions>): Promise<void> {
117117
return new DeployStep({
118118
name: step.name,
119119
uriOrStepResult: step.uri,
120-
deployer: stepToPackageMap[step.name].deployer,
120+
deployModule: stepToPackageMap[step.name].deployModule,
121121
config: step.config ?? {},
122122
});
123123
});

packages/cli/src/lib/defaults/deploy-modules/ens-recursive-name-register/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-require-imports */
22
/* eslint-disable @typescript-eslint/no-var-requires */
3-
import { Deployer } from "../../../deploy";
3+
import { DeployModule } from "../../../deploy";
44

55
import { Wallet } from "@ethersproject/wallet";
66
import { JsonRpcProvider } from "@ethersproject/providers";
@@ -13,7 +13,7 @@ import {
1313
import { embeddedWrappers } from "@polywrap/test-env-js";
1414
import { PolywrapClient } from "@polywrap/client-js";
1515

16-
class ENSRecursiveNameRegisterPublisher implements Deployer {
16+
class ENSRecursiveNameRegisterPublisher implements DeployModule {
1717
async execute(
1818
uri: Uri,
1919
config: {

packages/cli/src/lib/defaults/deploy-modules/ens/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/no-require-imports */
22
/* eslint-disable @typescript-eslint/no-var-requires */
3-
import { Deployer } from "../../../deploy";
3+
import { DeployModule } from "../../../deploy";
44

55
import { Wallet } from "@ethersproject/wallet";
66
import { JsonRpcProvider } from "@ethersproject/providers";
@@ -15,7 +15,7 @@ import { PolywrapClient } from "@polywrap/client-js";
1515

1616
const contentHash = require("content-hash");
1717

18-
class ENSPublisher implements Deployer {
18+
class ENSPublisher implements DeployModule {
1919
async execute(
2020
uri: Uri,
2121
config: {

packages/cli/src/lib/defaults/deploy-modules/http/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Deployer } from "../../../deploy/deployer";
1+
import { DeployModule } from "../../../deploy";
22

33
import { Uri } from "@polywrap/core-js";
44
import FormData from "form-data";
@@ -33,7 +33,7 @@ const dirToFormData = (baseDirPath: string) => {
3333
return formData;
3434
};
3535

36-
class HTTPDeployer implements Deployer {
36+
class HTTPDeployer implements DeployModule {
3737
async execute(uri: Uri, config?: { postUrl: string }): Promise<Uri> {
3838
if (!isValidUri(uri)) {
3939
throw new Error(

packages/cli/src/lib/defaults/deploy-modules/ipfs-test/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Deployer } from "../../../deploy/deployer";
1+
import { DeployModule } from "../../../deploy";
22

33
import { Uri } from "@polywrap/core-js";
44

5-
class IPFSDeployer implements Deployer {
5+
class IPFSDeployer implements DeployModule {
66
// eslint-disable-next-line @typescript-eslint/naming-convention
77
async execute(_: Uri, __: unknown): Promise<Uri> {
88
return new Uri(`ipfs/Qm`);

packages/cli/src/lib/defaults/deploy-modules/ipfs/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Deployer } from "../../../deploy/deployer";
1+
import { DeployModule } from "../../../deploy";
22

33
import { Uri } from "@polywrap/core-js";
44

@@ -8,7 +8,7 @@ const { globSource } = IPFSClient;
88

99
const isValidUri = (uri: Uri) => uri.authority === "fs";
1010

11-
class IPFSDeployer implements Deployer {
11+
class IPFSDeployer implements DeployModule {
1212
async execute(uri: Uri, config?: { gatewayUri: string }): Promise<Uri> {
1313
if (!isValidUri(uri)) {
1414
throw new Error(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DeployStep, StepName, StepResult, UriOrPrevStepResult } from "./step";
1+
import { DeployStep, StepName, StepResult, UriOrPrevStepResult } from "./DeployStep";
22
import { Logger } from "../logging";
33

44
import { Uri } from "@polywrap/core-js";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Uri } from "@polywrap/core-js";
22

3-
export interface Deployer {
3+
export interface DeployModule {
44
execute(uri: Uri, config?: unknown): Promise<Uri>;
55
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { DeployModule } from "./DeployModule";
2+
3+
import { Schema as JsonSchema } from "jsonschema";
4+
5+
export interface DeployPackage {
6+
deployModule: DeployModule;
7+
manifestExt: JsonSchema | undefined;
8+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Deployer } from "./deployer";
1+
import { DeployModule } from "./DeployModule";
22

33
import { Uri } from "@polywrap/core-js";
44

@@ -14,24 +14,24 @@ export interface StepResult {
1414
interface StepArgs {
1515
name: string;
1616
uriOrStepResult: UriOrPrevStepResult;
17-
deployer: Deployer;
17+
deployModule: DeployModule;
1818
config: Record<string, unknown>;
1919
}
2020

2121
export class DeployStep {
2222
public name: string;
23-
public deployer: Deployer;
23+
public deployModule: DeployModule;
2424
public uriOrStepResult: string;
2525
public config: Record<string, unknown>;
2626

2727
constructor(args: StepArgs) {
2828
this.name = args.name;
29-
this.deployer = args.deployer;
29+
this.deployModule = args.deployModule;
3030
this.uriOrStepResult = args.uriOrStepResult;
3131
this.config = args.config;
3232
}
3333

3434
public async run(uri: Uri, config: Record<string, unknown>): Promise<Uri> {
35-
return await this.deployer.execute(uri, config);
35+
return await this.deployModule.execute(uri, config);
3636
}
3737
}

0 commit comments

Comments
 (0)