Skip to content

Commit

Permalink
*: Upgrade dependencies, cleanup unused, update prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
fordN committed Apr 13, 2022
1 parent b1f48e0 commit e659f5d
Show file tree
Hide file tree
Showing 24 changed files with 2,984 additions and 2,747 deletions.
2 changes: 2 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.19.0"
}
22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prepare": "lerna run prepare",
"release": "./scripts/release.sh",
"test": "lerna --concurrency 1 run test --stream --ignore @graphprotocol/indexer-service",
"update-common-ts": "./scripts/update-common-ts.sh 1.8.1",
"update-common-ts": "./scripts/update-common-ts.sh 1.8.3",
"clean": "lerna run clean",
"compile": "lerna run compile"
},
Expand All @@ -25,15 +25,19 @@
"prettier": "2.5.1"
},
"resolutions": {
"ethers": "5.5.2",
"@ethersproject/bignumber": "5.5.0",
"@ethersproject/providers": "5.5.1",
"@urql/core": "2.3.6",
"@urql/exchange-execute": "1.2.2",
"scrypt": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.0.2.tgz"
"ethers": "5.6.2",
"@ethersproject/bignumber": "5.6.0",
"@ethersproject/providers": "5.6.2",
"@urql/core": "2.4.4",
"@urql/exchange-execute": "1.2.2"
},
"dependencies": {
"scrypt": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.0.2.tgz"
"overrides": {
"ethers": "5.6.2",
"@ethersproject/bignumber": "5.6.0",
"@ethersproject/providers": "5.6.2",
"@urql/core": "2.4.4",
"@urql/exchange-execute": "1.2.2",
"graphql": "16.3.0"
},
"engines": {
"node": ">=12.22.0"
Expand Down
6 changes: 1 addition & 5 deletions packages/indexer-agent/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'semi': [2, 'never'],
'@typescript-eslint/no-extra-semi': 'off',
}
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier']
}
52 changes: 26 additions & 26 deletions packages/indexer-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"private": false,
"scripts": {
"format": "prettier --write src/*.ts src/**/*.ts src/**/**/*.ts",
"lint": "eslint . --ext .ts,.tsx",
"compile": "./node_modules/.bin/tsc",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc",
"prepare": "yarn format && yarn lint && yarn compile",
"start": "yarn prepare && node ./dist/index.js start",
"test": "jest --runInBand --detectOpenHandles --passWithNoTests --verbose",
Expand All @@ -24,18 +24,18 @@
"graph-indexer-agent": "bin/graph-indexer-agent"
},
"dependencies": {
"@graphprotocol/common-ts": "1.8.2",
"@graphprotocol/contracts": "v1.9.0",
"@graphprotocol/common-ts": "1.8.3",
"@graphprotocol/contracts": "1.11.1",
"@graphprotocol/indexer-common": "^0.19.0",
"@thi.ng/heaps": "^1.3.1",
"@uniswap/sdk": "3.0.3",
"axios": "0.24.0",
"bs58": "4.0.1",
"axios": "0.26.1",
"bs58": "5.0.0",
"delay": "^5.0.0",
"ethers": "5.5.2",
"ethers": "5.6.2",
"evt": "1.9.12",
"global": "4.4.0",
"graphql": "16.1.0",
"graphql": "16.3.0",
"graphql-tag": "2.12.6",
"isomorphic-fetch": "3.0.0",
"jayson": "3.6.6",
Expand All @@ -46,29 +46,29 @@
"p-reduce": "2.1.0",
"p-retry": "4.6.1",
"umzug": "3.0.0",
"yargs": "17.3.1"
"yargs": "17.4.1"
},
"devDependencies": {
"@types/bs58": "4.0.1",
"@types/isomorphic-fetch": "0.0.35",
"@types/jest": "27.0.3",
"@types/ngeohash": "0.6.2",
"@types/node": "14.14.6",
"@types/yargs": "15.0.9",
"@typescript-eslint/eslint-plugin": "5.8.0",
"@typescript-eslint/parser": "5.8.0",
"eslint": "8.10.0",
"jest": "27.4.5",
"ts-jest": "27.1.2",
"ts-node": "^10.4.0",
"typechain": "6.0.5",
"typescript": "4.1.6"
"@types/isomorphic-fetch": "0.0.36",
"@types/jest": "27.4.1",
"@types/ngeohash": "0.6.4",
"@types/node": "17.0.23",
"@types/yargs": "17.0.10",
"@typescript-eslint/eslint-plugin": "5.19.0",
"@typescript-eslint/parser": "5.19.0",
"eslint": "8.13.0",
"eslint-config-prettier": "8.5.0",
"jest": "27.5.1",
"ts-jest": "27.1.4",
"ts-node": "10.7.0",
"typechain": "8.0.0",
"typescript": "4.6.3"
},
"resolutions": {
"ethers": "5.5.2",
"@ethersproject/bignumber": "5.5.0",
"@ethersproject/providers": "5.5.1",
"scrypt": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.0.2.tgz"
"ethers": "5.6.2",
"@ethersproject/bignumber": "5.6.0",
"@ethersproject/providers": "5.6.2"
},
"gitHead": "972ab96774007b2aee15b1da169d2ff4be9f9d27"
}
6 changes: 1 addition & 5 deletions packages/indexer-cli/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,5 @@ module.exports = {
root: false,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'semi': [2, 'never'],
'@typescript-eslint/no-extra-semi': 'off',
}
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier']
}
28 changes: 14 additions & 14 deletions packages/indexer-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,41 @@
"author": "The Graph Foundation",
"license": "MIT",
"scripts": {
"format": "prettier --write src/*.ts src/**/*.ts src/**/**/*.ts",
"lint": "eslint . --ext .ts,.tsx",
"compile": "./node_modules/.bin/tsc",
"prepare": "rm -rf dist && yarn format && yarn lint && yarn compile",
"format": "prettier --write 'src/**/*.ts'",
"lint": "eslint . --ext .ts,.tsx --fix",
"compile": "tsc",
"prepare": "yarn format && yarn lint && yarn compile",
"disputes": "yarn prepare && ./dist/cli.js indexer disputes get",
"clean": "rm -rf ./node_modules ./dist ./tsconfig.tsbuildinfo",
"test": "jest --colors --verbose --detectOpenHandles",
"test:debug": "LOG_LEVEL=debug jest --runInBand --detectOpenHandles --verbose --forceExit",
"test:watch": "jest --watch --detectOpenHandles --verbose"
},
"dependencies": {
"@graphprotocol/common-ts": "1.8.2",
"@graphprotocol/common-ts": "1.8.3",
"@graphprotocol/indexer-common": "^0.19.0",
"@iarna/toml": "2.2.5",
"@thi.ng/iterators": "5.1.74",
"@urql/core": "2.3.6",
"@urql/core": "2.4.4",
"chalk": "4.1.2",
"env-paths": "2.2.1",
"ethers": "5.5.2",
"ethers": "5.6.2",
"gluegun": "4.7.0",
"graphql-tag": "2.12.6",
"isomorphic-fetch": "3.0.0",
"table": "6.7.5",
"yaml": "1.10.2"
},
"devDependencies": {
"@types/isomorphic-fetch": "0.0.35",
"@typescript-eslint/eslint-plugin": "5.8.0",
"@typescript-eslint/parser": "5.8.0",
"eslint": "8.10.0",
"typescript": "4.1.6"
"@types/isomorphic-fetch": "0.0.36",
"@typescript-eslint/eslint-plugin": "5.19.0",
"@typescript-eslint/parser": "5.19.0",
"eslint": "8.13.0",
"eslint-config-prettier": "8.5.0",
"typescript": "4.6.3"
},
"resolutions": {
"ethers": "5.5.2",
"scrypt": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.0.2.tgz"
"ethers": "5.6.2"
},
"gitHead": "972ab96774007b2aee15b1da169d2ff4be9f9d27"
}
7 changes: 4 additions & 3 deletions packages/indexer-cli/src/commands/indexer/cost/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ module.exports = {
: ['deployment', 'model', 'variables']
const rawDeployment = ['model', 'variables'].includes(first) ? second : first

try{
if (rawDeployment !== 'all') {await validateDeploymentID(rawDeployment)}
try {
if (rawDeployment !== 'all') {
await validateDeploymentID(rawDeployment)
}
} catch (error) {
print.error(error.toString())
process.exitCode = 1
return
}


const config = loadValidatedConfig()
const deployment = parseDeploymentID(rawDeployment)

Expand Down
4 changes: 2 additions & 2 deletions packages/indexer-cli/src/commands/indexer/cost/set/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ module.exports = {
return
}

try{
try {
await validateDeploymentID(deployment)
} catch (error) {
print.error(error.toString())
process.exitCode = 1
return
}

let model = null
try {
model = fs.readFileSync(filename, 'utf8').trim()
Expand Down
13 changes: 6 additions & 7 deletions packages/indexer-cli/src/commands/indexer/rules/clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ import { partition } from '@thi.ng/iterators'
import { loadValidatedConfig } from '../../../config'
import { createIndexerManagementClient } from '../../../client'
import { fixParameters } from '../../../command-helpers'
import {
setIndexingRule,
printIndexingRules,
parseIndexingRule,
} from '../../../rules'
import { processIdentifier } from "@graphprotocol/indexer-common"
import { setIndexingRule, printIndexingRules, parseIndexingRule } from '../../../rules'
import { processIdentifier } from '@graphprotocol/indexer-common'

const HELP = `
${chalk.bold('graph indexer rules clear')} [options] global [<key1> ...]
Expand Down Expand Up @@ -72,7 +68,10 @@ module.exports = {

try {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [identifier, identifierType] = await processIdentifier(id, { all: false, global: true })
const [identifier, identifierType] = await processIdentifier(id, {
all: false,
global: true,
})

// Turn the array into an object, add an `identifier` key
const inputRule = parseIndexingRule({
Expand Down
18 changes: 15 additions & 3 deletions packages/indexer-cli/src/commands/indexer/rules/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,29 @@ module.exports = {
const config = loadValidatedConfig()

try {
const [identifier, identifierType] = await processIdentifier(id, { all: true, global: true })
const [identifier, identifierType] = await processIdentifier(id, {
all: true,
global: true,
})

const client = await createIndexerManagementClient({ url: config.api })

if (identifier === 'all') {
const rules = await indexingRules(client, false)

/* eslint-disable @typescript-eslint/no-non-null-assertion */
await deleteIndexingRules(
client,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
await Promise.all(rules.map(async rule => (await processIdentifier(rule.identifier!, { all: true, global: true }))[0])),
await Promise.all(
rules.map(
async rule =>
(
await processIdentifier(rule.identifier!, { all: true, global: true })
)[0],
),
),
)
/* eslint-enable @typescript-eslint/no-non-null-assertion */
print.info(`Deleted all indexing rules`)
} else if (identifier === 'global') {
await deleteIndexingRules(client, ['global'])
Expand Down
13 changes: 6 additions & 7 deletions packages/indexer-cli/src/commands/indexer/rules/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import chalk from 'chalk'
import { loadValidatedConfig } from '../../../config'
import { createIndexerManagementClient } from '../../../client'
import { fixParameters } from '../../../command-helpers'
import {
indexingRule,
indexingRules,
printIndexingRules,
} from '../../../rules'
import {IndexingRuleAttributes, processIdentifier} from '@graphprotocol/indexer-common'
import { indexingRule, indexingRules, printIndexingRules } from '../../../rules'
import { IndexingRuleAttributes, processIdentifier } from '@graphprotocol/indexer-common'

const HELP = `
${chalk.bold('graph indexer rules get')} [options] all [<key1> ...]
Expand Down Expand Up @@ -47,7 +43,10 @@ module.exports = {

try {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [identifier, identifierType] = await processIdentifier(id, { all: true, global: true })
const [identifier, identifierType] = await processIdentifier(id, {
all: true,
global: true,
})

const config = loadValidatedConfig()

Expand Down
13 changes: 6 additions & 7 deletions packages/indexer-cli/src/commands/indexer/rules/maybe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import chalk from 'chalk'
import { loadValidatedConfig } from '../../../config'
import { createIndexerManagementClient } from '../../../client'
import { fixParameters } from '../../../command-helpers'
import {IndexingDecisionBasis, processIdentifier} from '@graphprotocol/indexer-common'
import {
setIndexingRule,
printIndexingRules,
parseIndexingRule,
} from '../../../rules'
import { IndexingDecisionBasis, processIdentifier } from '@graphprotocol/indexer-common'
import { setIndexingRule, printIndexingRules, parseIndexingRule } from '../../../rules'

const HELP = `
${chalk.bold('graph indexer rules maybe')} [options] global
Expand Down Expand Up @@ -46,7 +42,10 @@ module.exports = {
const config = loadValidatedConfig()

try {
const [identifier, identifierType] = await processIdentifier(id, { all: false, global: true })
const [identifier, identifierType] = await processIdentifier(id, {
all: false,
global: true,
})

const inputRule = parseIndexingRule({
identifier,
Expand Down
15 changes: 7 additions & 8 deletions packages/indexer-cli/src/commands/indexer/rules/offchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@ import chalk from 'chalk'
import { loadValidatedConfig } from '../../../config'
import { createIndexerManagementClient } from '../../../client'
import { fixParameters } from '../../../command-helpers'
import {IndexingDecisionBasis, processIdentifier} from '@graphprotocol/indexer-common'
import {
setIndexingRule,
printIndexingRules,
parseIndexingRule,
} from '../../../rules'
import { IndexingDecisionBasis, processIdentifier } from '@graphprotocol/indexer-common'
import { setIndexingRule, printIndexingRules, parseIndexingRule } from '../../../rules'

const HELP = `
${chalk.bold('graph indexer rules offchain')} [options] global
Expand Down Expand Up @@ -48,15 +44,18 @@ module.exports = {
const config = loadValidatedConfig()

try {
const [identifier, identifierType] = await processIdentifier(id, { all: false, global: true })
const [identifier, identifierType] = await processIdentifier(id, {
all: false,
global: true,
})

const inputRule = parseIndexingRule({
identifier,
identifierType,
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
})

// Update the indexing rule according to the key/value pairs
// Update the indexing rule according to the key/value pairs
const client = await createIndexerManagementClient({ url: config.api })
const rule = await setIndexingRule(client, inputRule)
printIndexingRules(print, outputFormat, identifier, rule, [])
Expand Down
Loading

0 comments on commit e659f5d

Please sign in to comment.