Skip to content

Commit

Permalink
rename relative imports to include .js extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed May 6, 2024
1 parent eae9f71 commit edca322
Show file tree
Hide file tree
Showing 15 changed files with 1,840 additions and 1,990 deletions.
6 changes: 3 additions & 3 deletions cli/src/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from 'axios'
import { boolean as cmdboolean, command, flag, option, subcommands } from 'cmd-ts'
import { IAdapter, ReadFile } from './cli-types'
import { ORAKL_NETWORK_API_URL } from './settings'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils'
import { IAdapter, ReadFile } from './cli-types.js'
import { ORAKL_NETWORK_API_URL } from './settings.js'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils.js'

const ADAPTER_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'adapter')

Expand Down
6 changes: 3 additions & 3 deletions cli/src/aggregator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import {
string as cmdstring,
subcommands
} from 'cmd-ts'
import { IAggregator, ReadFile } from './cli-types'
import { ORAKL_NETWORK_API_URL, WORKER_SERVICE_HOST, WORKER_SERVICE_PORT } from './settings'
import { IAggregator, ReadFile } from './cli-types.js'
import { ORAKL_NETWORK_API_URL, WORKER_SERVICE_HOST, WORKER_SERVICE_PORT } from './settings.js'
import {
buildUrl,
chainOptionalOption,
fetcherTypeOptionalOption,
idOption,
isOraklNetworkApiHealthy,
isServiceHealthy
} from './utils'
} from './utils.js'

const AGGREGATOR_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'aggregator')

Expand Down
4 changes: 2 additions & 2 deletions cli/src/chain.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import { ORAKL_NETWORK_API_URL } from './settings'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils'
import { ORAKL_NETWORK_API_URL } from './settings.js'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils.js'

const CHAIN_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'chain')

Expand Down
4 changes: 2 additions & 2 deletions cli/src/cli-types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Type } from 'cmd-ts'
import { existsSync } from 'node:fs'
import { CliError, CliErrorCode } from './errors'
import { isValidUrl, loadFile, loadJsonFromUrl } from './utils'
import { CliError, CliErrorCode } from './errors.js'
import { isValidUrl, loadFile, loadJsonFromUrl } from './utils.js'

export async function readFileFromSource(source: string) {
if (await isValidUrl(source)) {
Expand Down
18 changes: 9 additions & 9 deletions cli/src/datafeed.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { command, option, subcommands } from 'cmd-ts'
import { insertHandler as adapterInsertHandler } from './adapter'
import { insertHandler as adapterInsertHandler } from './adapter.js'
import {
activateHandler as aggregatorActivateHandler,
deactivateHandler as aggregatorDeactivateHandler,
insertHandler as aggregatorInsertHandler
} from './aggregator'
} from './aggregator.js'
import {
IAdapter,
IAggregator,
IDatafeedBulk,
IDatafeedBulkInsertElement,
ReadFile,
readFileFromSource
} from './cli-types'
} from './cli-types.js'
import {
contractConnectHandler,
contractInsertHandler,
Expand All @@ -25,22 +25,22 @@ import {
reporterInsertHandler as delegatorReporterInsertHandler,
reporterListHandler as delegatorReporterListHandler,
reporterRemoveHandler as delegatorReporterRemoveHandler
} from './delegator'
import { startHandler as fetcherStartHandler, stopHandler as fetcherStopHandler } from './fetcher'
} from './delegator.js'
import { startHandler as fetcherStartHandler, stopHandler as fetcherStopHandler } from './fetcher.js'

Check failure on line 29 in cli/src/datafeed.ts

View workflow job for this annotation

GitHub Actions / build-publish

Replace `·startHandler·as·fetcherStartHandler,·stopHandler·as·fetcherStopHandler·` with `⏎··startHandler·as·fetcherStartHandler,⏎··stopHandler·as·fetcherStopHandler⏎`
import {
activateHandler as listenerActivateHandler,
deactivateHandler as listenerDeactivateHandler,
insertHandler as listenerInsertHandler,
listHandler as listenerListHandler,
removeHandler as listenerRemoveHandler
} from './listener'
} from './listener.js'
import {
activateHandler as reporterActivateHandler,
deactivateHandler as reporterDeactivateHandler,
insertHandler as reporterInsertHandler,
listHandler as reporterListHandler,
removeHandler as reporterRemoveHandler
} from './reporter'
} from './reporter.js'
import {
FETCHER_HOST,
FETCHER_PORT,
Expand All @@ -50,8 +50,8 @@ import {
REPORTER_SERVICE_PORT,
WORKER_SERVICE_HOST,
WORKER_SERVICE_PORT
} from './settings'
import { isValidUrl } from './utils'
} from './settings.js'
import { isValidUrl } from './utils.js'

export function datafeedSub() {
// datafeed bulk-insert --source ${source}
Expand Down
4 changes: 2 additions & 2 deletions cli/src/delegator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { command, number as cmdnumber, option, string as cmdstring, subcommands } from 'cmd-ts'
import { ORAKL_NETWORK_API_URL, ORAKL_NETWORK_DELEGATOR_URL } from './settings'
import { buildUrl, idOption, isOraklDelegatorHealthy } from './utils'
import { ORAKL_NETWORK_API_URL, ORAKL_NETWORK_DELEGATOR_URL } from './settings.js'
import { buildUrl, idOption, isOraklDelegatorHealthy } from './utils.js'

const AGGREGATOR_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'aggregator')

Expand Down
4 changes: 2 additions & 2 deletions cli/src/fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import { FETCHER_API_VERSION, FETCHER_HOST, FETCHER_PORT } from './settings'
import { buildFetcherUrl, buildUrl, isOraklFetcherHealthy } from './utils'
import { FETCHER_API_VERSION, FETCHER_HOST, FETCHER_PORT } from './settings.js'
import { buildFetcherUrl, buildUrl, isOraklFetcherHealthy } from './utils.js'

export function fetcherSub() {
// fetcher active --host ${host} --port ${port}
Expand Down
22 changes: 11 additions & 11 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env node --no-warnings

import { binary, command, run, subcommands } from 'cmd-ts'
import { adapterSub } from './adapter'
import { aggregatorSub } from './aggregator'
import { chainSub } from './chain'
import { datafeedSub } from './datafeed'
import { delegatorSub } from './delegator'
import { fetcherSub } from './fetcher'
import { listenerSub } from './listener'
import { proxySub } from './proxy'
import { reporterSub } from './reporter'
import { serviceSub } from './service'
import { vrfSub } from './vrf'
import { adapterSub } from './adapter.js'
import { aggregatorSub } from './aggregator.js'
import { chainSub } from './chain.js'
import { datafeedSub } from './datafeed.js'
import { delegatorSub } from './delegator.js'
import { fetcherSub } from './fetcher.js'
import { listenerSub } from './listener.js'
import { proxySub } from './proxy.js'
import { reporterSub } from './reporter.js'
import { serviceSub } from './service.js'
import { vrfSub } from './vrf.js'

async function main() {
const chain = chainSub()
Expand Down
4 changes: 2 additions & 2 deletions cli/src/listener.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import axios from 'axios'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import { LISTENER_SERVICE_HOST, LISTENER_SERVICE_PORT, ORAKL_NETWORK_API_URL } from './settings'
import { LISTENER_SERVICE_HOST, LISTENER_SERVICE_PORT, ORAKL_NETWORK_API_URL } from './settings.js'
import {
buildUrl,
chainOptionalOption,
idOption,
isOraklNetworkApiHealthy,
isServiceHealthy,
serviceOptionalOption
} from './utils'
} from './utils.js'

const LISTENER_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'listener')
const AGGREGATOR_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'aggregator')
Expand Down
4 changes: 2 additions & 2 deletions cli/src/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { command, number, option, string as cmdstring, subcommands } from 'cmd-ts'
import { ORAKL_NETWORK_API_URL } from './settings'
import { buildUrl, idOption, isOraklNetworkApiHealthy, proxyOptionalOption } from './utils'
import { ORAKL_NETWORK_API_URL } from './settings.js'
import { buildUrl, idOption, isOraklNetworkApiHealthy, proxyOptionalOption } from './utils.js'

const PROXY_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'proxy')

Expand Down
4 changes: 2 additions & 2 deletions cli/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
isOraklNetworkApiHealthy,
isServiceHealthy,
serviceOptionalOption
} from './utils'
} from './utils.js'

import { ORAKL_NETWORK_API_URL, REPORTER_SERVICE_HOST, REPORTER_SERVICE_PORT } from './settings'
import { ORAKL_NETWORK_API_URL, REPORTER_SERVICE_HOST, REPORTER_SERVICE_PORT } from './settings.js'

const REPORTER_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'reporter')
const AGGREGATOR_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'aggregator')
Expand Down
4 changes: 2 additions & 2 deletions cli/src/service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import { ORAKL_NETWORK_API_URL } from './settings'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils'
import { ORAKL_NETWORK_API_URL } from './settings.js'
import { buildUrl, idOption, isOraklNetworkApiHealthy } from './utils.js'

const SERVICE_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'service')

Expand Down
2 changes: 1 addition & 1 deletion cli/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios'
import { number as cmdnumber, option, optional, string as cmdstring } from 'cmd-ts'
import { open as openFile, readFile } from 'node:fs/promises'
import { ORAKL_NETWORK_API_URL, ORAKL_NETWORK_DELEGATOR_URL } from './settings'
import { ORAKL_NETWORK_API_URL, ORAKL_NETWORK_DELEGATOR_URL } from './settings.js'

export const chainOptionalOption = option({
type: optional(cmdstring),
Expand Down
4 changes: 2 additions & 2 deletions cli/src/vrf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { keygen } from '@bisonai/orakl-vrf'
import axios from 'axios'
import { command, option, string as cmdstring, subcommands } from 'cmd-ts'
import ethers from 'ethers'
import { ORAKL_NETWORK_API_URL } from './settings'
import { buildUrl, chainOptionalOption, idOption, isOraklNetworkApiHealthy } from './utils'
import { ORAKL_NETWORK_API_URL } from './settings.js'
import { buildUrl, chainOptionalOption, idOption, isOraklNetworkApiHealthy } from './utils.js'

const VRF_ENDPOINT = buildUrl(ORAKL_NETWORK_API_URL, 'vrf')

Expand Down
Loading

0 comments on commit edca322

Please sign in to comment.