Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 00776-validate-a-remo…
Browse files Browse the repository at this point in the history
…teconfig-with-a-deployment-that-has-a-mirror-node-and-explorer-deployed

# Conflicts:
#	src/types/index.ts
  • Loading branch information
instamenta committed Dec 4, 2024
2 parents 9de7dc9 + 29778f0 commit b2cbd4d
Show file tree
Hide file tree
Showing 26 changed files with 1,791 additions and 1,890 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flow-deploy-release-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
npm run build
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@e7cc33a01bc1b1df406bac8a1c4a409a34bdca0a # v4.4.3
uses: jfrog/setup-jfrog-cli@040913fd7ac2a2bcb29a7e963ea99e7c309d63e5 # v4.5.0
env:
JF_URL: ${{ vars.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
Expand Down
25 changes: 13 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"dot-object": "^2.1.5",
"dotenv": "^16.4.6",
"dotenv": "^16.4.7",
"enquirer": "^2.4.1",
"esm": "^3.2.25",
"figlet": "^1.8.0",
Expand Down Expand Up @@ -119,7 +119,7 @@
"mocha-each": "^2.0.1",
"mocha-junit-reporter": "^2.2.1",
"mocha-multi-reporters": "^1.5.1",
"prettier": "^3.4.1",
"prettier": "^3.4.2",
"remark-cli": "^12.0.1",
"remark-frontmatter": "^5.0.0",
"remark-lint-list-item-indent": "^4.0.0",
Expand All @@ -128,7 +128,7 @@
"remark-preset-lint-recommended": "^7.0.0",
"sinon": "^19.0.2",
"sinon-chai": "^4.0.0",
"typedoc": "^0.27.2",
"typedoc": "^0.27.3",
"typescript": "^5.7.2",
"typescript-eslint": "^8.17.0"
},
Expand Down
9 changes: 4 additions & 5 deletions src/commands/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {BaseCommand} from './base.js';
import {SoloError, IllegalArgumentError} from '../core/errors.js';
import {flags} from './index.js';
import {Listr} from 'listr2';
import * as prompts from './prompts.js';
import {constants, type AccountManager} from '../core/index.js';
import {type AccountId, AccountInfo, HbarUnit, PrivateKey} from '@hashgraph/sdk';
import {FREEZE_ADMIN_ACCOUNT} from '../core/constants.js';
Expand Down Expand Up @@ -159,7 +158,7 @@ export class AccountCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
self.configManager.update(argv);
await prompts.execute(task, self.configManager, [flags.namespace]);
await flags.executePrompt(task, self.configManager, [flags.namespace]);

const config = {
namespace: self.configManager.getFlag<string>(flags.namespace) as string,
Expand Down Expand Up @@ -310,7 +309,7 @@ export class AccountCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
self.configManager.update(argv);
await prompts.execute(task, self.configManager, [flags.namespace]);
await flags.executePrompt(task, self.configManager, [flags.namespace]);

const config = {
amount: self.configManager.getFlag<number>(flags.amount) as number,
Expand Down Expand Up @@ -386,7 +385,7 @@ export class AccountCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
self.configManager.update(argv);
await prompts.execute(task, self.configManager, [flags.accountId, flags.namespace]);
await flags.executePrompt(task, self.configManager, [flags.accountId, flags.namespace]);

const config = {
accountId: self.configManager.getFlag<string>(flags.accountId) as string,
Expand Down Expand Up @@ -469,7 +468,7 @@ export class AccountCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
self.configManager.update(argv);
await prompts.execute(task, self.configManager, [flags.accountId, flags.namespace]);
await flags.executePrompt(task, self.configManager, [flags.accountId, flags.namespace]);

const config = {
accountId: self.configManager.getFlag<string>(flags.accountId) as string,
Expand Down
5 changes: 2 additions & 3 deletions src/commands/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
import {ListrEnquirerPromptAdapter} from '@listr2/prompt-adapter-enquirer';
import {Listr} from 'listr2';
import {SoloError} from '../core/errors.js';
import * as flags from './flags.js';
import {flags} from './index.js';
import {BaseCommand} from './base.js';
import chalk from 'chalk';
import {constants} from '../core/index.js';
import * as prompts from './prompts.js';
import path from 'path';
import {ListrLease} from '../core/lease/listr_lease.js';
import {CommandBuilder} from '../types/aliases.js';
Expand Down Expand Up @@ -79,7 +78,7 @@ export class ClusterCommand extends BaseCommand {
title: 'Initialize',
task: async (ctx, task) => {
self.configManager.update(argv);
await prompts.execute(task, self.configManager, [
await flags.executePrompt(task, self.configManager, [
flags.chartDirectory,
flags.clusterSetupNamespace,
flags.deployCertManager,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/context/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
*/

import * as flags from '../flags.js';
import {flags} from '../index.js';

export const USE_FLAGS = {
requiredFlags: [],
Expand Down
3 changes: 1 addition & 2 deletions src/commands/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import type {Opts} from '../../types/index.js';
import {ContextCommandTasks} from './tasks.js';
import {ContextCommandHandlers} from './handlers.js';
import * as ContextFlags from './flags.js';
import {getPromptMap} from '../prompts.js';

/**
* Defines the core functionalities of 'node' command
Expand All @@ -32,7 +31,7 @@ export class ContextCommand extends BaseCommand {
constructor(opts: Opts) {
super(opts);

this.handlers = new ContextCommandHandlers(this, new ContextCommandTasks(this, getPromptMap()));
this.handlers = new ContextCommandHandlers(this, new ContextCommandTasks(this));
}

getCommandDefinition() {
Expand Down
13 changes: 5 additions & 8 deletions src/commands/context/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@
*
*/
import {Task, Templates} from '../../core/index.js';
import * as flags from '../flags.js';
import {flags} from '../index.js';
import type {ListrTaskWrapper} from 'listr2';
import {type BaseCommand} from '../base.js';
import {UserPrompt} from '../../types/aliases.js';

export class ContextCommandTasks {
private readonly parent: BaseCommand;
private readonly promptMap: Map<string, UserPrompt>;

constructor(parent, promptMap) {
constructor(parent) {
this.parent = parent;
this.promptMap = promptMap;
}

updateLocalConfig(argv) {
Expand All @@ -52,19 +49,19 @@ export class ContextCommandTasks {
}
} else {
if (!clusters.length) {
const prompt = this.promptMap.get(flags.clusterName.name);
const prompt = flags.clusterName.prompt;
const unparsedClusterAliases = await prompt(task, clusters);
clusters = Templates.parseClusterAliases(unparsedClusterAliases);
}
if (!contextName) {
const prompt = this.promptMap.get(flags.context.name);
const prompt = flags.context.prompt;
contextName = await prompt(
task,
kubeContexts.map(c => c.name),
);
}
if (!currentDeploymentName) {
const prompt = this.promptMap.get(flags.namespace.name);
const prompt = flags.namespace.prompt;
currentDeploymentName = await prompt(task, currentDeploymentName);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/commands/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
import {Listr, type ListrTaskWrapper} from 'listr2';
import {SoloError} from '../core/errors.js';
import {BaseCommand} from './base.js';
import * as flags from './flags.js';
import {flags} from './index.js';
import {constants, Templates} from '../core/index.js';
import * as prompts from './prompts.js';
import chalk from 'chalk';
import {RemoteConfigTasks} from '../core/config/remote/remote_config_tasks.js';
import {ListrLease} from '../core/lease/listr_lease.js';
Expand Down Expand Up @@ -59,7 +58,7 @@ export class DeploymentCommand extends BaseCommand {
self.configManager.update(argv);
self.logger.debug('Loaded cached config', {config: self.configManager.config});

await prompts.execute(task, self.configManager, DeploymentCommand.DEPLOY_FLAGS_LIST);
await flags.executePrompt(task, self.configManager, DeploymentCommand.DEPLOY_FLAGS_LIST);

ctx.config = {
contextClusterUnparsed: self.configManager.getFlag<string>(flags.contextClusterUnparsed),
Expand Down
Loading

0 comments on commit b2cbd4d

Please sign in to comment.