@graphprotocol/graph-cli 0.20.0 → 0.20.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +5 -5
- package/examples/arweave-blocks-transactions/node_modules/.bin/graph +17 -0
- package/examples/basic-event-handlers/node_modules/.bin/truffle +17 -0
- package/examples/basic-event-handlers/package.json +5 -2
- package/examples/basic-event-handlers/yarn.lock +311 -164
- package/examples/cosmos-block-filtering/node_modules/.bin/graph +17 -0
- package/examples/cosmos-block-filtering/node_modules/.bin/mustache +17 -0
- package/examples/cosmos-osmosis-token-swaps/node_modules/.bin/graph +17 -0
- package/examples/cosmos-validator-delegations/node_modules/.bin/graph +17 -0
- package/examples/cosmos-validator-delegations/node_modules/.bin/mustache +17 -0
- package/examples/cosmos-validator-rewards/node_modules/.bin/graph +17 -0
- package/examples/cosmos-validator-rewards/node_modules/.bin/mustache +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/graph +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/hardhat +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/solidity-coverage +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-node +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-node-cwd +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-node-esm +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-node-script +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-node-transpile-only +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/ts-script +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/tsc +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/tsserver +17 -0
- package/examples/ethereum-basic-event-handlers/node_modules/.bin/typechain +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/graph +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/hardhat +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/solidity-coverage +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-node +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-node-cwd +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-node-esm +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-node-script +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-node-transpile-only +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/ts-script +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/tsc +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/tsserver +17 -0
- package/examples/ethereum-gravatar/node_modules/.bin/typechain +17 -0
- package/examples/example-subgraph/package.json +3 -0
- package/examples/example-subgraph/yarn.lock +18 -106
- package/examples/near-blocks/node_modules/.bin/graph +17 -0
- package/examples/near-receipts/node_modules/.bin/graph +17 -0
- package/examples/substreams-powered-subgraph/node_modules/.bin/graph +17 -0
- package/package.json +4 -4
- package/src/codegen/typescript.js +0 -55
- package/src/command-helpers/compiler.js +20 -10
- package/src/command-helpers/jsonrpc.js +1 -0
- package/src/commands/deploy.js +1 -1
- package/src/commands/init.js +17 -3
- package/src/compiler.js +12 -3
- package/src/migrations/mapping_api_version_0_0_1.js +14 -3
- package/src/migrations/mapping_api_version_0_0_2.js +15 -6
- package/src/migrations/mapping_api_version_0_0_3.js +14 -3
- package/src/migrations/spec_version_0_0_2.js +2 -1
- package/src/migrations/util/load-manifest.js +16 -0
- package/src/subgraph.js +8 -1
- package/tests/cli/util.js +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typescript@5.0.4/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/bin/tsserver" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/typescript@5.0.4/node_modules/typescript/bin/tsserver" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/cli/cli.js" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/typechain@8.1.1_jest@29.5.0_typescript@5.0.4/node_modules/typechain/dist/cli/cli.js" "$@"
|
|
17
|
+
fi
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@graphprotocol/graph-cli": "https://github.com/graphprotocol/graph-cli#master",
|
|
11
11
|
"@graphprotocol/graph-ts": "https://github.com/graphprotocol/graph-ts#master"
|
|
12
|
+
},
|
|
13
|
+
"resolutions": {
|
|
14
|
+
"assemblyscript": "git+https://github.com/AssemblyScript/assemblyscript.git#v0.6"
|
|
12
15
|
}
|
|
13
16
|
}
|
|
@@ -25,30 +25,6 @@
|
|
|
25
25
|
dependencies:
|
|
26
26
|
regenerator-runtime "^0.13.2"
|
|
27
27
|
|
|
28
|
-
"@graphprotocol/graph-cli@git+http://github.com/graphprotocol/graph-cli#master":
|
|
29
|
-
version "0.17.1"
|
|
30
|
-
resolved "git+http://github.com/graphprotocol/graph-cli#3a0a892034449e3c722ce11b73c546dff01e653b"
|
|
31
|
-
dependencies:
|
|
32
|
-
assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3"
|
|
33
|
-
chalk "^3.0.0"
|
|
34
|
-
chokidar "^3.0.2"
|
|
35
|
-
debug "^4.1.1"
|
|
36
|
-
fs-extra "^8.1.0"
|
|
37
|
-
glob "^7.1.2"
|
|
38
|
-
gluegun "^4.1.2"
|
|
39
|
-
graphql "^14.0.2"
|
|
40
|
-
immutable "^3.8.2"
|
|
41
|
-
ipfs-http-client "^34.0.0"
|
|
42
|
-
jayson "^3.0.2"
|
|
43
|
-
js-yaml "^3.13.1"
|
|
44
|
-
node-fetch "^2.3.0"
|
|
45
|
-
pkginfo "^0.4.1"
|
|
46
|
-
prettier "^1.13.5"
|
|
47
|
-
request "^2.88.0"
|
|
48
|
-
yaml "^1.5.1"
|
|
49
|
-
optionalDependencies:
|
|
50
|
-
keytar "^4.6.0"
|
|
51
|
-
|
|
52
28
|
"@graphprotocol/graph-cli@https://github.com/graphprotocol/graph-cli#master":
|
|
53
29
|
version "0.17.1"
|
|
54
30
|
resolved "https://github.com/graphprotocol/graph-cli#083c1a8e928dbd22a2bd1d9c301ff2118f3ed030"
|
|
@@ -263,9 +239,9 @@ asn1@~0.2.3:
|
|
|
263
239
|
dependencies:
|
|
264
240
|
safer-buffer "~2.1.0"
|
|
265
241
|
|
|
266
|
-
"assemblyscript@https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3":
|
|
242
|
+
"assemblyscript@git+https://github.com/AssemblyScript/assemblyscript.git#v0.6", "assemblyscript@https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3":
|
|
267
243
|
version "0.6.0"
|
|
268
|
-
resolved "https://github.com/AssemblyScript/assemblyscript#
|
|
244
|
+
resolved "git+https://github.com/AssemblyScript/assemblyscript.git#3ed76a97f05335504166fce1653da75f4face28f"
|
|
269
245
|
dependencies:
|
|
270
246
|
"@protobufjs/utf8" "^1.1.0"
|
|
271
247
|
binaryen "77.0.0-nightly.20190407"
|
|
@@ -740,13 +716,6 @@ decamelize@^1.2.0:
|
|
|
740
716
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
|
741
717
|
integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=
|
|
742
718
|
|
|
743
|
-
decompress-response@^3.3.0:
|
|
744
|
-
version "3.3.0"
|
|
745
|
-
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
|
|
746
|
-
integrity sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=
|
|
747
|
-
dependencies:
|
|
748
|
-
mimic-response "^1.0.0"
|
|
749
|
-
|
|
750
719
|
decompress-response@^4.2.0:
|
|
751
720
|
version "4.2.1"
|
|
752
721
|
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-4.2.1.tgz#414023cc7a302da25ce2ec82d0d5238ccafd8986"
|
|
@@ -1646,14 +1615,6 @@ keypair@^1.0.1:
|
|
|
1646
1615
|
resolved "https://registry.yarnpkg.com/keypair/-/keypair-1.0.1.tgz#7603719270afb6564ed38a22087a06fc9aa4ea1b"
|
|
1647
1616
|
integrity sha1-dgNxknCvtlZO04oiCHoG/Jqk6hs=
|
|
1648
1617
|
|
|
1649
|
-
keytar@^4.6.0:
|
|
1650
|
-
version "4.13.0"
|
|
1651
|
-
resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.13.0.tgz#f3484988e87e692958ce901a36c850422093def0"
|
|
1652
|
-
integrity sha512-qdyZ3XDuv11ANDXJ+shsmc+j/h5BHPDSn33MwkUMDg2EA++xEBleNkghr3Jg95cqVx5WgDYD8V/m3Q0y7kwQ2w==
|
|
1653
|
-
dependencies:
|
|
1654
|
-
nan "2.14.0"
|
|
1655
|
-
prebuild-install "5.3.0"
|
|
1656
|
-
|
|
1657
1618
|
keytar@^5.0.0:
|
|
1658
1619
|
version "5.0.0"
|
|
1659
1620
|
resolved "https://registry.yarnpkg.com/keytar/-/keytar-5.0.0.tgz#c89b6b7a4608fd7af633d9f8474b1a7eb97cbe6f"
|
|
@@ -1868,11 +1829,6 @@ mimic-fn@^2.1.0:
|
|
|
1868
1829
|
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
|
|
1869
1830
|
integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==
|
|
1870
1831
|
|
|
1871
|
-
mimic-response@^1.0.0:
|
|
1872
|
-
version "1.0.1"
|
|
1873
|
-
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
|
|
1874
|
-
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
|
|
1875
|
-
|
|
1876
1832
|
mimic-response@^2.0.0:
|
|
1877
1833
|
version "2.0.0"
|
|
1878
1834
|
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46"
|
|
@@ -2124,9 +2080,9 @@ onetime@^5.1.0:
|
|
|
2124
2080
|
mimic-fn "^2.1.0"
|
|
2125
2081
|
|
|
2126
2082
|
opencollective-postinstall@^2.0.0:
|
|
2127
|
-
version "2.0.
|
|
2128
|
-
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.
|
|
2129
|
-
integrity sha512-
|
|
2083
|
+
version "2.0.3"
|
|
2084
|
+
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
|
|
2085
|
+
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==
|
|
2130
2086
|
|
|
2131
2087
|
optimist@~0.3.5:
|
|
2132
2088
|
version "0.3.7"
|
|
@@ -2149,11 +2105,6 @@ ora@^4.0.0:
|
|
|
2149
2105
|
strip-ansi "^6.0.0"
|
|
2150
2106
|
wcwidth "^1.0.1"
|
|
2151
2107
|
|
|
2152
|
-
os-homedir@^1.0.1:
|
|
2153
|
-
version "1.0.2"
|
|
2154
|
-
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
|
|
2155
|
-
integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=
|
|
2156
|
-
|
|
2157
2108
|
p-finally@^2.0.0:
|
|
2158
2109
|
version "2.0.1"
|
|
2159
2110
|
resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561"
|
|
@@ -2238,28 +2189,6 @@ pluralize@^8.0.0:
|
|
|
2238
2189
|
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"
|
|
2239
2190
|
integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==
|
|
2240
2191
|
|
|
2241
|
-
prebuild-install@5.3.0:
|
|
2242
|
-
version "5.3.0"
|
|
2243
|
-
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-5.3.0.tgz#58b4d8344e03590990931ee088dd5401b03004c8"
|
|
2244
|
-
integrity sha512-aaLVANlj4HgZweKttFNUVNRxDukytuIuxeK2boIMHjagNJCiVKWFsKF4tCE3ql3GbrD2tExPQ7/pwtEJcHNZeg==
|
|
2245
|
-
dependencies:
|
|
2246
|
-
detect-libc "^1.0.3"
|
|
2247
|
-
expand-template "^2.0.3"
|
|
2248
|
-
github-from-package "0.0.0"
|
|
2249
|
-
minimist "^1.2.0"
|
|
2250
|
-
mkdirp "^0.5.1"
|
|
2251
|
-
napi-build-utils "^1.0.1"
|
|
2252
|
-
node-abi "^2.7.0"
|
|
2253
|
-
noop-logger "^0.1.1"
|
|
2254
|
-
npmlog "^4.0.1"
|
|
2255
|
-
os-homedir "^1.0.1"
|
|
2256
|
-
pump "^2.0.1"
|
|
2257
|
-
rc "^1.2.7"
|
|
2258
|
-
simple-get "^2.7.0"
|
|
2259
|
-
tar-fs "^1.13.0"
|
|
2260
|
-
tunnel-agent "^0.6.0"
|
|
2261
|
-
which-pm-runs "^1.0.0"
|
|
2262
|
-
|
|
2263
2192
|
prebuild-install@5.3.3:
|
|
2264
2193
|
version "5.3.3"
|
|
2265
2194
|
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-5.3.3.tgz#ef4052baac60d465f5ba6bf003c9c1de79b9da8e"
|
|
@@ -2353,14 +2282,6 @@ pump@^1.0.0:
|
|
|
2353
2282
|
end-of-stream "^1.1.0"
|
|
2354
2283
|
once "^1.3.1"
|
|
2355
2284
|
|
|
2356
|
-
pump@^2.0.1:
|
|
2357
|
-
version "2.0.1"
|
|
2358
|
-
resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909"
|
|
2359
|
-
integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==
|
|
2360
|
-
dependencies:
|
|
2361
|
-
end-of-stream "^1.1.0"
|
|
2362
|
-
once "^1.3.1"
|
|
2363
|
-
|
|
2364
2285
|
pump@^3.0.0:
|
|
2365
2286
|
version "3.0.0"
|
|
2366
2287
|
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
|
|
@@ -2610,15 +2531,6 @@ simple-concat@^1.0.0:
|
|
|
2610
2531
|
resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6"
|
|
2611
2532
|
integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=
|
|
2612
2533
|
|
|
2613
|
-
simple-get@^2.7.0:
|
|
2614
|
-
version "2.8.1"
|
|
2615
|
-
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d"
|
|
2616
|
-
integrity sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==
|
|
2617
|
-
dependencies:
|
|
2618
|
-
decompress-response "^3.3.0"
|
|
2619
|
-
once "^1.3.1"
|
|
2620
|
-
simple-concat "^1.0.0"
|
|
2621
|
-
|
|
2622
2534
|
simple-get@^3.0.3:
|
|
2623
2535
|
version "3.1.0"
|
|
2624
2536
|
resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-3.1.0.tgz#b45be062435e50d159540b576202ceec40b9c6b3"
|
|
@@ -2629,9 +2541,9 @@ simple-get@^3.0.3:
|
|
|
2629
2541
|
simple-concat "^1.0.0"
|
|
2630
2542
|
|
|
2631
2543
|
source-map-support@^0.5.11:
|
|
2632
|
-
version "0.5.
|
|
2633
|
-
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.
|
|
2634
|
-
integrity sha512-
|
|
2544
|
+
version "0.5.19"
|
|
2545
|
+
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
|
|
2546
|
+
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
|
|
2635
2547
|
dependencies:
|
|
2636
2548
|
buffer-from "^1.0.0"
|
|
2637
2549
|
source-map "^0.6.0"
|
|
@@ -2767,16 +2679,6 @@ supports-color@^7.1.0:
|
|
|
2767
2679
|
dependencies:
|
|
2768
2680
|
has-flag "^4.0.0"
|
|
2769
2681
|
|
|
2770
|
-
tar-fs@^1.13.0, tar-fs@~1.16.3:
|
|
2771
|
-
version "1.16.3"
|
|
2772
|
-
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509"
|
|
2773
|
-
integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==
|
|
2774
|
-
dependencies:
|
|
2775
|
-
chownr "^1.0.1"
|
|
2776
|
-
mkdirp "^0.5.1"
|
|
2777
|
-
pump "^1.0.0"
|
|
2778
|
-
tar-stream "^1.1.2"
|
|
2779
|
-
|
|
2780
2682
|
tar-fs@^2.0.0:
|
|
2781
2683
|
version "2.0.0"
|
|
2782
2684
|
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad"
|
|
@@ -2787,6 +2689,16 @@ tar-fs@^2.0.0:
|
|
|
2787
2689
|
pump "^3.0.0"
|
|
2788
2690
|
tar-stream "^2.0.0"
|
|
2789
2691
|
|
|
2692
|
+
tar-fs@~1.16.3:
|
|
2693
|
+
version "1.16.3"
|
|
2694
|
+
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509"
|
|
2695
|
+
integrity sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==
|
|
2696
|
+
dependencies:
|
|
2697
|
+
chownr "^1.0.1"
|
|
2698
|
+
mkdirp "^0.5.1"
|
|
2699
|
+
pump "^1.0.0"
|
|
2700
|
+
tar-stream "^1.1.2"
|
|
2701
|
+
|
|
2790
2702
|
tar-stream@^1.1.2:
|
|
2791
2703
|
version "1.6.2"
|
|
2792
2704
|
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
17
|
+
fi
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
+
esac
|
|
7
|
+
|
|
8
|
+
if [ -z "$NODE_PATH" ]; then
|
|
9
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules"
|
|
10
|
+
else
|
|
11
|
+
export NODE_PATH="/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/bin/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/cli/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/packages/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules:/Users/saihaj/Desktop/the-guild/node_modules:/Users/saihaj/Desktop/node_modules:/Users/saihaj/node_modules:/Users/node_modules:/node_modules:/Users/saihaj/Desktop/the-guild/graph-tooling/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
+
fi
|
|
13
|
+
if [ -x "$basedir/node" ]; then
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
15
|
+
else
|
|
16
|
+
exec node "$basedir/../../../../packages/cli/bin/run" "$@"
|
|
17
|
+
fi
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphprotocol/graph-cli",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.3",
|
|
4
4
|
"description": "CLI for building for and deploying to The Graph",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"assemblyscript": "https://github.com/AssemblyScript/assemblyscript#
|
|
6
|
+
"assemblyscript": "git+https://github.com/AssemblyScript/assemblyscript.git#v0.6",
|
|
7
7
|
"chalk": "^3.0.0",
|
|
8
8
|
"chokidar": "^3.0.2",
|
|
9
9
|
"debug": "^4.1.1",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"gluegun": "^4.3.1",
|
|
15
15
|
"graphql": "^15.5.0",
|
|
16
16
|
"immutable": "^3.8.2",
|
|
17
|
-
"ipfs-http-client": "
|
|
18
|
-
"jayson": "
|
|
17
|
+
"ipfs-http-client": "55.0.0",
|
|
18
|
+
"jayson": "4.0.0",
|
|
19
19
|
"js-yaml": "^3.13.1",
|
|
20
20
|
"node-fetch": "^2.3.0",
|
|
21
21
|
"pkginfo": "^0.4.1",
|
|
@@ -154,26 +154,6 @@ class NullableType {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
class UnionType {
|
|
158
|
-
constructor(types) {
|
|
159
|
-
this.types = types
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
toString() {
|
|
163
|
-
return this.types.map(t => t.toString()).join(' | ')
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
class MaybeType {
|
|
168
|
-
constructor(type) {
|
|
169
|
-
this.type = type
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
toString() {
|
|
173
|
-
return `?${this.type.name}`
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
157
|
class ModuleImports {
|
|
178
158
|
constructor(nameOrNames, module) {
|
|
179
159
|
this.nameOrNames = nameOrNames
|
|
@@ -187,39 +167,6 @@ class ModuleImports {
|
|
|
187
167
|
}
|
|
188
168
|
}
|
|
189
169
|
|
|
190
|
-
class ModuleImport {
|
|
191
|
-
constructor(alias, module) {
|
|
192
|
-
this.alias = alias
|
|
193
|
-
this.module = module
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
toString() {
|
|
197
|
-
return `import * as ${this.alias} from "${this.module}"`
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
class ValueToCoercion {
|
|
202
|
-
constructor(expr, type) {
|
|
203
|
-
this.expr = expr
|
|
204
|
-
this.type = type
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
toString() {
|
|
208
|
-
return `${this.expr}.${valueToTypeFunction(this.type)}()`
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
class ValueFromCoercion {
|
|
213
|
-
constructor(expr, type) {
|
|
214
|
-
this.expr = expr
|
|
215
|
-
this.type = type
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
toString() {
|
|
219
|
-
return `Value.${valueFromTypeFunction(this.type)}(${this.expr})`
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
170
|
const namedType = name => new NamedType(name)
|
|
224
171
|
const arrayType = name => new ArrayType(name)
|
|
225
172
|
const param = (name, type) => new Param(name, type)
|
|
@@ -229,7 +176,6 @@ const staticMethod = (name, params, returnType, body) =>
|
|
|
229
176
|
new StaticMethod(name, params, returnType, body)
|
|
230
177
|
const klass = (name, options) => new Class(name, options)
|
|
231
178
|
const klassMember = (name, type) => new ClassMember(name, type)
|
|
232
|
-
const unionType = (...types) => new UnionType(types)
|
|
233
179
|
const nullableType = type => new NullableType(type)
|
|
234
180
|
const moduleImports = (nameOrNames, module) => new ModuleImports(nameOrNames, module)
|
|
235
181
|
|
|
@@ -247,6 +193,5 @@ module.exports = {
|
|
|
247
193
|
staticMethod,
|
|
248
194
|
param,
|
|
249
195
|
nullableType,
|
|
250
|
-
unionType,
|
|
251
196
|
moduleImports,
|
|
252
197
|
}
|
|
@@ -3,12 +3,27 @@ const ipfsHttpClient = require('ipfs-http-client')
|
|
|
3
3
|
const toolbox = require('gluegun/toolbox')
|
|
4
4
|
const Compiler = require('../compiler')
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Appends /api/v0 to the end of a The Graph IPFS URL
|
|
8
|
+
*/
|
|
9
|
+
function appendApiVersionForGraph(inputString) {
|
|
10
|
+
// Check if the input string is a valid The Graph IPFS URL
|
|
11
|
+
const pattern = /^(https?:\/\/)?([\w-]+\.)+thegraph\.com\/ipfs\/?$/
|
|
12
|
+
if (pattern.test(inputString)) {
|
|
13
|
+
// account for trailing slash
|
|
14
|
+
if (inputString.endsWith('/')) {
|
|
15
|
+
return inputString.slice(0, -1) + '/api/v0'
|
|
16
|
+
}
|
|
17
|
+
return inputString + '/api/v0'
|
|
18
|
+
}
|
|
19
|
+
return inputString
|
|
20
|
+
}
|
|
21
|
+
|
|
6
22
|
// Helper function to construct a subgraph compiler
|
|
7
23
|
const createCompiler = (manifest, { ipfs, outputDir, outputFormat, skipMigrations }) => {
|
|
8
24
|
// Parse the IPFS URL
|
|
9
|
-
let url
|
|
10
25
|
try {
|
|
11
|
-
|
|
26
|
+
if (ipfs && typeof ipfs === 'string') new URL(ipfs)
|
|
12
27
|
} catch (e) {
|
|
13
28
|
toolbox.print.error(`Invalid IPFS URL: ${ipfs}
|
|
14
29
|
The IPFS URL must be of the following format: http(s)://host[:port]/[path]`)
|
|
@@ -16,17 +31,12 @@ The IPFS URL must be of the following format: http(s)://host[:port]/[path]`)
|
|
|
16
31
|
}
|
|
17
32
|
|
|
18
33
|
// Connect to the IPFS node (if a node address was provided)
|
|
19
|
-
|
|
20
|
-
? ipfsHttpClient({
|
|
21
|
-
protocol: url.protocol.replace(/[:]+$/, ''),
|
|
22
|
-
host: url.hostname,
|
|
23
|
-
port: url.port,
|
|
24
|
-
'api-path': url.pathname.replace(/\/$/, '') + '/api/v0/',
|
|
25
|
-
})
|
|
34
|
+
const ipfsClient = ipfs
|
|
35
|
+
? ipfsHttpClient.create({ url: appendApiVersionForGraph(ipfs.toString()) })
|
|
26
36
|
: undefined
|
|
27
37
|
|
|
28
38
|
return new Compiler({
|
|
29
|
-
ipfs,
|
|
39
|
+
ipfs: ipfsClient,
|
|
30
40
|
subgraphManifest: manifest,
|
|
31
41
|
outputDir: outputDir,
|
|
32
42
|
outputFormat: outputFormat,
|
package/src/commands/deploy.js
CHANGED
|
@@ -157,7 +157,7 @@ module.exports = {
|
|
|
157
157
|
if (jsonRpcError.message.match(/subgraph name not found/)) {
|
|
158
158
|
if (hostedService) {
|
|
159
159
|
print.info(`
|
|
160
|
-
You may need to
|
|
160
|
+
You may need to create it at https://thegraph.com/explorer/dashboard.`)
|
|
161
161
|
} else {
|
|
162
162
|
print.info(`
|
|
163
163
|
Make sure to create the subgraph first by running the following command:
|
package/src/commands/init.js
CHANGED
|
@@ -30,7 +30,7 @@ ${chalk.dim('Choose mode with one of:')}
|
|
|
30
30
|
${chalk.dim('Options for --from-contract:')}
|
|
31
31
|
|
|
32
32
|
--abi <path> Path to the contract ABI (default: download from Etherscan)
|
|
33
|
-
--network <mainnet|kovan|rinkeby|ropsten|goerli|poa-core>
|
|
33
|
+
--network <mainnet|kovan|rinkeby|ropsten|goerli|poa-core|poa-sokol|xdai|matic|mumbai|fantom|bsc|clover|arbitrum-testnet-v5>
|
|
34
34
|
Selects the network the contract is deployed to
|
|
35
35
|
--index-events Index contract events as entities
|
|
36
36
|
--contract-name Name of the contract (default: Contract)
|
|
@@ -40,7 +40,22 @@ const processInitForm = async (
|
|
|
40
40
|
toolbox,
|
|
41
41
|
{abi, address, allowSimpleName, directory, fromExample, network, subgraphName, contractName},
|
|
42
42
|
) => {
|
|
43
|
-
let networkChoices = [
|
|
43
|
+
let networkChoices = [
|
|
44
|
+
'mainnet',
|
|
45
|
+
'kovan',
|
|
46
|
+
'rinkeby',
|
|
47
|
+
'ropsten',
|
|
48
|
+
'goerli',
|
|
49
|
+
'poa-core',
|
|
50
|
+
'poa-sokol',
|
|
51
|
+
'xdai',
|
|
52
|
+
'matic',
|
|
53
|
+
'mumbai',
|
|
54
|
+
'fantom',
|
|
55
|
+
'bsc',
|
|
56
|
+
'clover',
|
|
57
|
+
'arbitrum-testnet-v5',
|
|
58
|
+
]
|
|
44
59
|
let addressPattern = /^(0x)?[0-9a-fA-F]{40}$/
|
|
45
60
|
|
|
46
61
|
let abiFromEtherscan = undefined
|
|
@@ -373,7 +388,6 @@ module.exports = {
|
|
|
373
388
|
// Exit immediately when the form is cancelled
|
|
374
389
|
if (inputs === undefined) {
|
|
375
390
|
process.exit(1)
|
|
376
|
-
return
|
|
377
391
|
}
|
|
378
392
|
|
|
379
393
|
print.info('———')
|
package/src/compiler.js
CHANGED
|
@@ -613,9 +613,18 @@ class Compiler {
|
|
|
613
613
|
|
|
614
614
|
async _uploadToIPFS(file) {
|
|
615
615
|
try {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
616
|
+
const files = this.ipfs.addAll([file])
|
|
617
|
+
|
|
618
|
+
// We get back async iterable
|
|
619
|
+
const filesIterator = files[Symbol.asyncIterator]()
|
|
620
|
+
// We only care about the first item, since that is the file, rest could be directories
|
|
621
|
+
const { value } = await filesIterator.next()
|
|
622
|
+
|
|
623
|
+
// we grab the file and pin it
|
|
624
|
+
const uploadedFile = value
|
|
625
|
+
await this.ipfs.pin.add(uploadedFile.cid)
|
|
626
|
+
|
|
627
|
+
return uploadedFile.cid.toString()
|
|
619
628
|
} catch (e) {
|
|
620
629
|
throw Error(`Failed to upload file to IPFS: ${e.message}`)
|
|
621
630
|
}
|
|
@@ -3,6 +3,7 @@ const semver = require('semver')
|
|
|
3
3
|
const toolbox = require('gluegun/toolbox')
|
|
4
4
|
const yaml = require('js-yaml')
|
|
5
5
|
const { getGraphTsVersion } = require('./util/versions')
|
|
6
|
+
const { loadManifest } = require('./util/load-manifest')
|
|
6
7
|
|
|
7
8
|
// If any of the manifest apiVersions are 0.0.1, replace them with 0.0.2
|
|
8
9
|
module.exports = {
|
|
@@ -18,7 +19,7 @@ module.exports = {
|
|
|
18
19
|
return 'graph-ts dependency not installed yet'
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
let manifest =
|
|
22
|
+
let manifest = loadManifest(manifestFile)
|
|
22
23
|
return (
|
|
23
24
|
// Only migrate if the graph-ts version is > 0.5.1...
|
|
24
25
|
semver.gt(graphTsVersion, '0.5.1') &&
|
|
@@ -26,7 +27,7 @@ module.exports = {
|
|
|
26
27
|
manifest &&
|
|
27
28
|
typeof manifest === 'object' &&
|
|
28
29
|
Array.isArray(manifest.dataSources) &&
|
|
29
|
-
manifest.dataSources.reduce(
|
|
30
|
+
(manifest.dataSources.reduce(
|
|
30
31
|
(hasOldMappings, dataSource) =>
|
|
31
32
|
hasOldMappings ||
|
|
32
33
|
(typeof dataSource === 'object' &&
|
|
@@ -34,7 +35,17 @@ module.exports = {
|
|
|
34
35
|
typeof dataSource.mapping === 'object' &&
|
|
35
36
|
dataSource.mapping.apiVersion === '0.0.1'),
|
|
36
37
|
false,
|
|
37
|
-
)
|
|
38
|
+
) ||
|
|
39
|
+
(Array.isArray(manifest.templates) &&
|
|
40
|
+
manifest.templates.reduce(
|
|
41
|
+
(hasOldMappings, template) =>
|
|
42
|
+
hasOldMappings ||
|
|
43
|
+
(typeof template === 'object' &&
|
|
44
|
+
template.mapping &&
|
|
45
|
+
typeof template.mapping === 'object' &&
|
|
46
|
+
template.mapping.apiVersion === '0.0.1'),
|
|
47
|
+
false,
|
|
48
|
+
)))
|
|
38
49
|
)
|
|
39
50
|
},
|
|
40
51
|
apply: async ({ manifestFile }) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const fs = require('fs-extra')
|
|
2
1
|
const semver = require('semver')
|
|
3
2
|
const toolbox = require('gluegun/toolbox')
|
|
4
|
-
const
|
|
3
|
+
const { loadManifest } = require('./util/load-manifest')
|
|
5
4
|
const { getGraphTsVersion } = require('./util/versions')
|
|
6
5
|
|
|
7
6
|
// If any of the manifest apiVersions are 0.0.2, replace them with 0.0.3
|
|
@@ -18,15 +17,15 @@ module.exports = {
|
|
|
18
17
|
return 'graph-ts dependency not installed yet'
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
let manifest =
|
|
20
|
+
let manifest = loadManifest(manifestFile)
|
|
22
21
|
return (
|
|
23
|
-
// Only migrate if the graph-ts version is > 0.
|
|
22
|
+
// Only migrate if the graph-ts version is > 0.12.0...
|
|
24
23
|
semver.gt(graphTsVersion, '0.12.0') &&
|
|
25
24
|
// ...and we have a manifest with mapping > apiVersion = 0.0.2
|
|
26
25
|
manifest &&
|
|
27
26
|
typeof manifest === 'object' &&
|
|
28
27
|
Array.isArray(manifest.dataSources) &&
|
|
29
|
-
manifest.dataSources.reduce(
|
|
28
|
+
(manifest.dataSources.reduce(
|
|
30
29
|
(hasOldMappings, dataSource) =>
|
|
31
30
|
hasOldMappings ||
|
|
32
31
|
(typeof dataSource === 'object' &&
|
|
@@ -34,7 +33,17 @@ module.exports = {
|
|
|
34
33
|
typeof dataSource.mapping === 'object' &&
|
|
35
34
|
dataSource.mapping.apiVersion === '0.0.2'),
|
|
36
35
|
false,
|
|
37
|
-
)
|
|
36
|
+
) ||
|
|
37
|
+
(Array.isArray(manifest.templates) &&
|
|
38
|
+
manifest.templates.reduce(
|
|
39
|
+
(hasOldMappings, template) =>
|
|
40
|
+
hasOldMappings ||
|
|
41
|
+
(typeof template === 'object' &&
|
|
42
|
+
template.mapping &&
|
|
43
|
+
typeof template.mapping === 'object' &&
|
|
44
|
+
template.mapping.apiVersion === '0.0.2'),
|
|
45
|
+
false,
|
|
46
|
+
)))
|
|
38
47
|
)
|
|
39
48
|
},
|
|
40
49
|
apply: async ({ manifestFile }) => {
|