Skip to content

Commit 1819e4f

Browse files
committed
chore: move leasing packages into a subfolder
Signed-off-by: Nathan Klick <[email protected]>
1 parent 2c4f927 commit 1819e4f

21 files changed

+34
-34
lines changed

src/commands/account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import * as prompts from './prompts.ts'
2323
import { constants, type AccountManager } from '../core/index.ts'
2424
import { type AccountId, AccountInfo, HbarUnit, PrivateKey } from '@hashgraph/sdk'
2525
import { FREEZE_ADMIN_ACCOUNT } from '../core/constants.ts'
26-
import { type Opts } from '../types/index.js'
27-
import { ListrLease } from '../core/listr_lease.js'
26+
import { type Opts } from '../types/index.ts'
27+
import { ListrLease } from '../core/lease/listr_lease.ts'
2828

2929
export class AccountCommand extends BaseCommand {
3030
private readonly accountManager: AccountManager

src/commands/cluster.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import chalk from 'chalk'
2323
import { constants } from '../core/index.ts'
2424
import * as prompts from './prompts.ts'
2525
import path from 'path'
26-
import { ListrLease } from '../core/listr_lease.js'
26+
import { ListrLease } from '../core/lease/listr_lease.ts'
2727

2828
/**
2929
* Define the core functionalities of 'cluster' command

src/commands/mirror_node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import * as prompts from './prompts.ts'
2424
import { getFileContents, getEnvValue } from '../core/helpers.ts'
2525
import { type PodName } from '../types/aliases.ts'
2626
import { type Opts } from '../types/index.ts'
27-
import { ListrLease } from '../core/listr_lease.js'
27+
import { ListrLease } from '../core/lease/listr_lease.ts'
2828

2929
export class MirrorNodeCommand extends BaseCommand {
3030
private readonly accountManager: AccountManager

src/commands/network.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import fs from 'fs'
2929
import type { CertificateManager, KeyManager, PlatformInstaller, ProfileManager } from '../core/index.ts'
3030
import type { NodeAlias, NodeAliases } from '../types/aliases.ts'
3131
import type { Opts } from '../types/index.ts'
32-
import { ListrLease } from '../core/listr_lease.js'
32+
import { ListrLease } from '../core/lease/listr_lease.ts'
3333

3434
export interface NetworkDeployConfigClass {
3535
applicationEnv: string

src/commands/node/handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { IllegalArgumentError } from '../../core/errors.ts'
3434
import type { SoloLogger } from '../../core/logging.ts'
3535
import type { NodeCommand } from './index.ts'
3636
import type { NodeCommandTasks } from './tasks.ts'
37-
import { type Lease } from '../../core/lease.js'
37+
import { type Lease } from '../../core/lease/lease.ts'
3838

3939
export class NodeCommandHandlers {
4040
private readonly accountManager: AccountManager

src/commands/node/tasks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ import * as x509 from '@peculiar/x509'
7171
import { type NodeCommand } from './index.ts'
7272
import type { NodeDeleteConfigClass, NodeRefreshConfigClass, NodeUpdateConfigClass } from './configs.ts'
7373
import type { NodeAddConfigClass } from './configs.ts'
74-
import { type Lease } from '../../core/lease.js'
75-
import { ListrLease } from '../../core/listr_lease.js'
74+
import { type Lease } from '../../core/lease/lease.ts'
75+
import { ListrLease } from '../../core/lease/listr_lease.ts'
7676

7777
export class NodeCommandTasks {
7878
private readonly accountManager: AccountManager

src/commands/relay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import * as prompts from './prompts.ts'
2525
import { getNodeAccountMap } from '../core/helpers.ts'
2626
import { type NodeAliases } from '../types/aliases.ts'
2727
import { type Opts } from '../types/index.ts'
28-
import { ListrLease } from '../core/listr_lease.js'
28+
import { ListrLease } from '../core/lease/listr_lease.ts'
2929

3030
export class RelayCommand extends BaseCommand {
3131
private readonly profileManager: ProfileManager

src/core/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { type CommandFlag } from '../types/index.ts'
3232
import { type V1Pod } from '@kubernetes/client-node'
3333
import { type SoloLogger } from './logging.ts'
3434
import { type NodeCommandHandlers } from '../commands/node/handlers.ts'
35-
import { type Lease } from './lease.js'
35+
import { type Lease } from './lease/lease.ts'
3636

3737
export function sleep (ms: number) {
3838
return new Promise<void>((resolve) => {

src/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { Task } from './task.ts'
3131
import * as helpers from './helpers.ts'
3232
import { DependencyManager } from './dependency_managers/index.ts'
3333
import { AccountManager } from './account_manager.ts'
34-
import { LeaseManager } from './lease_manager.ts'
34+
import { LeaseManager } from './lease/lease_manager.ts'
3535
import { CertificateManager } from './certificate_manager.ts'
3636

3737
// Expose components from the core module

src/core/lease.ts renamed to src/core/lease/lease.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import { MissingArgumentError, SoloError } from './errors.ts'
17+
import { MissingArgumentError, SoloError } from '../errors.ts'
1818
import { type V1Lease } from '@kubernetes/client-node'
19-
import { type K8 } from './k8.ts'
20-
import { SECONDS } from './constants.ts'
19+
import { type K8 } from '../k8.ts'
20+
import { SECONDS } from '../constants.ts'
2121
import { LeaseHolder } from './lease_holder.ts'
2222
import { LeaseAcquisitionError, LeaseRelinquishmentError } from './lease_errors.ts'
2323
import { type LeaseRenewalService } from './lease_renewal.ts'
24-
import { sleep } from './helpers.ts'
24+
import { sleep } from '../helpers.ts'
2525

2626
export class Lease {
2727
/** The default duration in seconds for which the lease is to be held before being considered expired. */

src/core/lease_errors.ts renamed to src/core/lease/lease_errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import { SoloError } from './errors.ts'
17+
import { SoloError } from '../errors.ts'
1818

1919
export class LeaseAcquisitionError extends SoloError {
2020
/**

src/core/lease_holder.ts renamed to src/core/lease/lease_holder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*/
1717

18-
import { MissingArgumentError } from './errors.ts'
18+
import { MissingArgumentError } from '../errors.ts'
1919
import os from 'node:os'
2020
import process from 'node:process'
2121

src/core/lease_manager.ts renamed to src/core/lease/lease_manager.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import { MissingArgumentError } from './errors.ts'
18-
import { flags } from '../commands/index.ts'
19-
import type { ConfigManager } from './config_manager.ts'
20-
import type { K8 } from './k8.ts'
21-
import type { SoloLogger } from './logging.ts'
17+
import { MissingArgumentError } from '../errors.ts'
18+
import { flags } from '../../commands/index.ts'
19+
import type { ConfigManager } from '../config_manager.ts'
20+
import type { K8 } from '../k8.ts'
21+
import type { SoloLogger } from '../logging.ts'
2222
import { type LeaseRenewalService } from './lease_renewal.ts'
2323
import { Lease } from './lease.ts'
2424
import { LeaseHolder } from './lease_holder.ts'

src/core/lease_renewal.ts renamed to src/core/lease/lease_renewal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*/
1717
import { type Lease } from './lease.ts'
18-
import { SECONDS } from './constants.ts'
18+
import { SECONDS } from '../constants.ts'
1919

2020
export interface LeaseRenewalService {
2121
isScheduled (scheduleId: number): Promise<boolean>
File renamed without changes.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { K8 } from './core/k8.ts'
2929
import { ListrLogger } from 'listr2'
3030
import { CustomProcessOutput } from './core/process_output.ts'
3131
import { type Opts } from './types/index.ts'
32-
import { IntervalLeaseRenewalService, type LeaseRenewalService } from './core/lease_renewal.js'
32+
import { IntervalLeaseRenewalService, type LeaseRenewalService } from './core/lease/lease_renewal.ts'
3333

3434
export function main (argv: any) {
3535
const logger = logging.NewLogger('debug')

test/e2e/integration/commands/init.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from '../../../../src/core/index.ts'
2828
import { SECONDS } from '../../../../src/core/constants.ts'
2929
import sinon from 'sinon'
30-
import { IntervalLeaseRenewalService } from '../../../../src/core/lease_renewal.js'
30+
import { IntervalLeaseRenewalService } from '../../../../src/core/lease/lease_renewal.ts'
3131

3232
const testLogger = logging.NewLogger('debug', true)
3333
describe('InitCommand', () => {

test/e2e/integration/core/lease.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import { ConfigManager, logging } from '../../../../src/core/index.ts'
1919
import { K8 } from '../../../../src/core/k8.ts'
2020
import { MINUTES, SECONDS } from '../../../../src/core/constants.ts'
2121
import { expect } from 'chai'
22-
import { Lease } from '../../../../src/core/lease.ts'
23-
import { LeaseHolder } from '../../../../src/core/lease_holder.ts'
22+
import { Lease } from '../../../../src/core/lease/lease.ts'
23+
import { LeaseHolder } from '../../../../src/core/lease/lease_holder.ts'
2424
import { sleep } from '../../../../src/core/helpers.ts'
25-
import { LeaseRelinquishmentError } from '../../../../src/core/lease_errors.ts'
25+
import { LeaseRelinquishmentError } from '../../../../src/core/lease/lease_errors.ts'
2626
import { NoopLeaseRenewalService } from './noop_lease_renewal_service.test.ts'
2727

2828

test/e2e/integration/core/lease_renewal.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import { ConfigManager, logging } from '../../../../src/core/index.ts'
1919
import { K8 } from '../../../../src/core/k8.ts'
2020
import { MINUTES, SECONDS } from '../../../../src/core/constants.ts'
2121
import { expect } from 'chai'
22-
import { Lease } from '../../../../src/core/lease.ts'
23-
import { LeaseHolder } from '../../../../src/core/lease_holder.ts'
22+
import { Lease } from '../../../../src/core/lease/lease.ts'
23+
import { LeaseHolder } from '../../../../src/core/lease/lease_holder.ts'
2424
import { sleep } from '../../../../src/core/helpers.ts'
25-
import { IntervalLeaseRenewalService } from '../../../../src/core/lease_renewal.ts'
25+
import { IntervalLeaseRenewalService } from '../../../../src/core/lease/lease_renewal.ts'
2626
import { type V1Lease } from '@kubernetes/client-node'
2727

2828

test/e2e/integration/core/noop_lease_renewal_service.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
import type { Lease } from '../../../../src/core/lease.ts'
18-
import { type LeaseRenewalService } from '../../../../src/core/lease_renewal.ts'
17+
import type { Lease } from '../../../../src/core/lease/lease.ts'
18+
import { type LeaseRenewalService } from '../../../../src/core/lease/lease_renewal.ts'
1919

2020
export class NoopLeaseRenewalService implements LeaseRenewalService {
2121
private readonly buffer: SharedArrayBuffer

test/test_util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ import type { NodeAlias } from '../src/types/aliases.ts'
6464
import type { NetworkNodeServices } from '../src/core/network_node_services.ts'
6565
import sinon from 'sinon'
6666
import { HEDERA_PLATFORM_VERSION } from '../version.js'
67-
import { IntervalLeaseRenewalService } from '../src/core/lease_renewal.js'
67+
import { IntervalLeaseRenewalService } from '../src/core/lease/lease_renewal.ts'
6868

6969
export const testLogger = logging.NewLogger('debug', true)
7070
export const TEST_CLUSTER = 'solo-e2e'

0 commit comments

Comments
 (0)