Skip to content

Commit

Permalink
Update all projects dependencies
Browse files Browse the repository at this point in the history
`yaml-ts`
- Replace `safe*` variants with `load`/`loadall`/`dump` -> https://github.com/nodeca/js-yaml/blob/0d3ca7a27b03a6c974790a30a89e456007d62976/migrate_v3_to_v4.md#safeload-safeloadall-safedump--load-loadall-dump

`immutable`
- `Map([ [ 'k', 'v' ] ])` or `Map({ k: 'v' })` instead of `Map.of` -> https://github.com/immutable-js/immutable-js/blob/b3a1c9f13880048d744366ae561c39a34b26190a/CHANGELOG.md#breaking-changes
- Replace `immutable.Collection<ProtocolName, string[]>` with `immutable.Collection<ProtocolName, immutable.List<string>>`

`oclif/core`
- Use `gluegun.prompt` instead of `ux.prompt` -> oclif/core#999
- Fix `prompt` variable assignments from object destructuring (thanks @YaroShkvorets)
- Migrate to ESM -> https://oclif.io/docs/esm/

`assemblyscript/asc`
- Use `assemblyscript/asc` as import
- `asc.main` no longer as callback for error, uses stderr and is async -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Remove `asc.ready` -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Remove `ascMain` in `package.json` -> https://github.com/AssemblyScript/assemblyscript/releases/tag/v0.20.0
- Replace `Promise.allSettled` with for loop in tests for resolving WASM generation promises in sequence (prevent WASM file corruption since they use same file `outputWasmPath`).

`yaml`
- Remove `strOptions` -> eemeli/yaml#235

`chokidar`
- Import type `FSWatcher` as namespace no longer available
- Remove `await` for `onTrigger` as it's no longer async

`http-ipfs-client`
- Migrate from `http-ipfs-client` to `kubo-rpc-client` with dynamic import as it's ESM only -> ipfs/helia#157
- Make `createCompiler` async due to dynamic import

`cli/package.json`
- Upgrade `moduleResolution` to `bundler`, `module` to `ESNext` and `target` to `ESNext` making it an ESM module

`eslint`
- Move `.eslintignore` inside config ->
- Use `ESLINT_USE_FLAT_CONFIG=false` in pnpm scripts
- Update config annotations

`sync-request`
- Deprecated, replace with async `fetch` call -> https://www.npmjs.com/package/sync-request
- Make `generateTypes` async and update NEAR test snapshot

`web3-eth-abi`
- Import `decodeLogs` method directly as there is no more default export

`vitest`
- Remove `concurrent` for tests using filesystem

`dockerode`
- Remove dependency

`tern`
- Remove dependency

`binary-install-raw`
- Replace with `binary-install`

---------

Co-authored-by: YaroShkvorets <[email protected]>
  • Loading branch information
0237h and YaroShkvorets committed Nov 29, 2024
1 parent 023bac6 commit ca5979a
Show file tree
Hide file tree
Showing 122 changed files with 9,449 additions and 12,888 deletions.
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

14 changes: 14 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
module.exports = {
extends: ['@theguild'],
ignorePatterns: [
'node_modules',
'dist',
'build',
'generated',
'packages/cli/tests/cli/init',
'packages/cli/tests/cli/validation',
'packages/ts/test/',
'examples',
'cf-pages/*',
'vitest.config.ts',
],
rules: {
// not necessary here, we dont build with bob
'import/extensions': 'off',
Expand All @@ -16,6 +28,7 @@ module.exports = {
'@typescript-eslint/ban-types': 'off',
// AssemblyScript `===` is a reference equality check, not a value equality check. We are trying to do a value check. Learn more: https://github.com/AssemblyScript/assemblyscript/issues/621#issuecomment-497973428
eqeqeq: 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
overrides: [
{
Expand All @@ -29,6 +42,7 @@ module.exports = {
'sonarjs/no-inverted-boolean-check': 'warn',
// TODO: warning for now, clean up
'@typescript-eslint/no-loss-of-precision': 'warn',
'no-loss-of-precision': 'warn',
// AssemblyScript types are different from TS and in cases we want to use what TS may think we should not,
},
},
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ tmp

*.wasm

.idea
.idea
1 change: 0 additions & 1 deletion .prettierrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@theguild/prettier-config"
60 changes: 28 additions & 32 deletions examples/aggregations/check-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,50 @@ sgd=$1
# Note that these substitutions are done for all possible combinations of
# INTV/DUR and TBL
expand() {
query=${1//SGD/$sgd}
if [[ "$query" =~ "INTV" ]]
then
for pair in hour:3600 day:86400
do
intv=${pair%:*}
duration=${pair#*:}
q=${query//INTV/$intv}
q=${q//DUR/$duration}
if [[ "$q" =~ "TBL" ]]
then
for tbl in stats group_1 group_2 group_3 groups
do
echo "${q//TBL/$tbl};"
done
else
echo "$q;"
fi
query=${1//SGD/$sgd}
if [[ "$query" =~ "INTV" ]]; then
for pair in hour:3600 day:86400; do
intv=${pair%:*}
duration=${pair#*:}
q=${query//INTV/$intv}
q=${q//DUR/$duration}
if [[ "$q" =~ "TBL" ]]; then
for tbl in stats group_1 group_2 group_3 groups; do
echo "${q//TBL/$tbl};"
done
else
echo "$query;"
fi
else
echo "$q;"
fi
done
else
echo "$query;"
fi
}

# Max and last must be the same
read -d '' -r max_last <<'EOF'
read -d '' -r max_last << 'EOF'
select count(*) = 0 as TBL_INTV_max_eq_last
from SGD.TBL_INTV
where max != last
EOF

# Min and first must be the same
read -d '' -r min_first <<'EOF'
read -d '' -r min_first << 'EOF'
select count(*) = 0 as TBL_INTV_min_eq_first
from SGD.TBL_INTV
where min != first
EOF

# The sum over block numbers must be correct
read -d '' -r sum_check <<'EOF'
read -d '' -r sum_check << 'EOF'
select count(*) = 0 as stats_INTV_sum_correct
from SGD.stats_INTV
where sum != (last - first + 1)::numeric*(last + first)::numeric/2
and first > 1
EOF

# The timestamps of all buckets are rounded to the beginning of the period
read -d '' -r bucket_timestamp <<'EOF'
read -d '' -r bucket_timestamp << 'EOF'
select count(*) = 0 as TBL_INTV_bucket_timestamp
from SGD.TBL_INTV
where to_timestamp(timestamp)
Expand All @@ -76,7 +72,7 @@ EOF

# The timestamp of the min and max block for all buckets must be between
# the bucket's timestamp plus the bucket's duration
read -d '' -r block_timestamp <<'EOF'
read -d '' -r block_timestamp << 'EOF'
select count(*) = 0 as TBL_INTV_timestamp
from SGD.TBL_INTV s,
SGD.block_time b
Expand All @@ -87,7 +83,7 @@ EOF
# For group_3_hour, since we split the aggregations into 1000 buckets,
# there can only be one or two blocks in each bucket; if there are two,
# they must differ by 1000 blocks
read -d '' -r group3_count_min_max <<'EOF'
read -d '' -r group3_count_min_max << 'EOF'
select count(*) = 0 as count_min_max
from SGD.group_3_hour
where (count = 1 and min != max)
Expand All @@ -96,15 +92,15 @@ select count(*) = 0 as count_min_max
EOF

# Same as previous for 'groups' instead of 'group_3'
read -d '' -r groups_count_min_max <<'EOF'
read -d '' -r groups_count_min_max << 'EOF'
select count(*) = 0 as count_min_max
from SGD.groups_hour
where (count = 1 and min != max)
or (count = 2 and min + 1000 != max)
or count > 2
EOF

read -d '' -r groups_total_min_max <<'EOF'
read -d '' -r groups_total_min_max << 'EOF'
select count(*) = 0 as total_min_max
from SGD.groups_hour
where total_min != group_3
Expand All @@ -118,14 +114,14 @@ EOF
# is g + (g+1000) + (g+2000) + .. + (g + (tc-1)*1000)
# We don't know what the total count should be since each group can contain
# 1 or 2 blocks, but we can at least relate total_count and total_sum
read -d '' -r groups_total_count_sum <<'EOF'
read -d '' -r groups_total_count_sum << 'EOF'
select count(*) = 0 as total_count_sum
from SGD.groups_hour
where total_sum != total_count * (group_3 + 1000 * (total_count::numeric - 1) / 2)
EOF

# Recalculate total count and sum with a window query
read -d '' -r groups_window_totals <<'EOF'
read -d '' -r groups_window_totals << 'EOF'
select count(*) = 0 as window_totals from
(select group_3, total_count, total_sum,
sum(count) over (partition by group_3 order by timestamp) as new_total_count,
Expand All @@ -144,4 +140,4 @@ expand "$block_timestamp"
expand "$group3_count_min_max"
expand "$groups_total_min_max"
expand "$groups_total_count_sum"
expand "$groups_window_totals"
expand "$groups_window_totals"
6 changes: 3 additions & 3 deletions examples/aggregations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"test": "graph test"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-ts": "^0.32.0"
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "^0.35.1"
},
"devDependencies": {
"matchstick-as": "0.5.0"
"matchstick-as": "0.6.0"
}
}
2 changes: 1 addition & 1 deletion examples/arweave-blocks-transactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"remove-local": "graph remove arweave-example --node http://localhost:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1"
}
}
2 changes: 1 addition & 1 deletion examples/cosmos-block-filtering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos-osmosis-token-swaps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1"
}
}
4 changes: 2 additions & 2 deletions examples/cosmos-validator-delegations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"remove-local": "graph remove cosmos-validator-delegations --node http://127.0.0.1:8020"
},
"dependencies": {
"as-proto": "^0.2.3",
"as-proto": "^1.3.0",
"babel-polyfill": "^6.26.0",
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cosmos-validator-rewards/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"babel-register": "^6.26.0"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1",
"mustache": "^4.2.0"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ethereum-basic-event-handlers/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ typechain-types
# Hardhat files
cache
artifacts/build-info
artifacts/contracts/**/*.dbg.json
artifacts/contracts/**/*.dbg.json
4 changes: 2 additions & 2 deletions examples/ethereum-basic-event-handlers/hardhat/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
#!/bin/sh

# Change to the correct directory
cd /usr/src/app;
cd /usr/src/app

# Run hardhat
pnpm localnode;
pnpm localnode

# Keep node alive
set -e
Expand Down
33 changes: 16 additions & 17 deletions examples/ethereum-basic-event-handlers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,25 @@
"test": "docker compose up -d && sleep 30 && hardhat test --network localhost && docker compose down"
},
"dependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.8",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-etherscan": "^3.1.7",
"@typechain/ethers-v5": "^10.2.0",
"@typechain/hardhat": "^6.1.5",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"chai": "^4.3.7",
"ethers": "v5.7.2",
"hardhat-gas-reporter": "^1.0.9",
"solidity-coverage": "^0.8.2",
"typechain": "^8.1.1",
"typescript": "^5.0.4"
"@nomicfoundation/hardhat-chai-matchers": "^2.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.12",
"@nomicfoundation/hardhat-verify": "^2.0.12",
"@typechain/ethers-v5": "^11.1.2",
"@typechain/hardhat": "^9.1.0",
"@types/chai": "^5.0.1",
"@types/mocha": "^10.0.10",
"chai": "^5.1.2",
"ethers": "6.13.4",
"hardhat-gas-reporter": "^2.2.2",
"solidity-coverage": "^0.8.14",
"typechain": "^8.3.2",
"typescript": "^5.7.2"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"apollo-fetch": "^0.7.0",
"hardhat": "^2.22.1"
"hardhat": "^2.22.16"
}
}
10 changes: 5 additions & 5 deletions examples/ethereum-basic-event-handlers/test/handlers.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const path = require('node:path');
const { system, patching, filesystem } = require('gluegun');
const { createApolloFetch } = require('apollo-fetch');
const { ethers } = require('hardhat');
const { expect } = require('chai');
import path from 'node:path';
import { createApolloFetch } from 'apollo-fetch';
import { expect } from 'chai';
import { filesystem, patching, system } from 'gluegun';
import { ethers } from 'hardhat';

const srcDir = path.join(__dirname, '..');

Expand Down
6 changes: 3 additions & 3 deletions examples/ethereum-gravatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"deploy-local": "graph deploy example --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"hardhat": "^2.13.1"
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
"hardhat": "^2.22.16"
}
}
8 changes: 4 additions & 4 deletions examples/example-subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
},
"private": true,
"scripts": {
"build": "../../packages/cli/bin/run build subgraph.yaml",
"build-ipfs": "../../packages/cli/bin/run build --ipfs /ip4/127.0.0.1/tcp/5001 subgraph.yaml",
"build-wast": "../../packages/cli/bin/run build -t wast subgraph.yaml",
"codegen": "../../packages/cli/bin/run codegen --output-dir src/types/ subgraph.yaml"
"build": "../../packages/cli/bin/run.js build subgraph.yaml",
"build-ipfs": "../../packages/cli/bin/run.js build --ipfs /ip4/127.0.0.1/tcp/5001 subgraph.yaml",
"build-wast": "../../packages/cli/bin/run.js build -t wast subgraph.yaml",
"codegen": "../../packages/cli/bin/run.js codegen --output-dir src/types/ subgraph.yaml"
},
"devDependencies": {
"@graphprotocol/graph-ts": "0.35.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/matic-lens-protocol-posts-subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "graph test"
},
"dependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/near-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1"
}
}
2 changes: 1 addition & 1 deletion examples/near-receipts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ typings/
.next

generated/
build/
build/
2 changes: 1 addition & 1 deletion examples/near-receipts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"deploy-local": "graph deploy example --ipfs http://localhost:5001 --node http://127.0.0.1:8020"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.71.2",
"@graphprotocol/graph-cli": "0.90.1",
"@graphprotocol/graph-ts": "0.35.1"
}
}
Loading

0 comments on commit ca5979a

Please sign in to comment.