@graphprotocol/graph-cli 0.51.2-alpha-20230620194216-37a1e4d → 0.51.2-alpha-20230621172007-4f03cf8
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/CHANGELOG.md +1 -1
- package/dist/commands/init.js +9 -12
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -54,7 +54,8 @@ class InitCommand extends core_1.Command {
|
|
|
54
54
|
const commands = {
|
|
55
55
|
link: yarn ? 'yarn link @graphprotocol/graph-cli' : 'npm link @graphprotocol/graph-cli',
|
|
56
56
|
install: yarn ? 'yarn' : 'npm install',
|
|
57
|
-
|
|
57
|
+
// this ensure we run code-generation from our CLI instead of some script in package.json
|
|
58
|
+
codegen: yarn ? 'yarn graph codegen' : 'npx graph codegen',
|
|
58
59
|
deploy: yarn ? 'yarn deploy' : 'npm run deploy',
|
|
59
60
|
};
|
|
60
61
|
// If all parameters are provided from the command-line,
|
|
@@ -646,9 +647,7 @@ Subgraph ${subgraphName} created in ${relativeDir}
|
|
|
646
647
|
|
|
647
648
|
Make sure to visit the documentation on https://thegraph.com/docs/ for further information.`);
|
|
648
649
|
}
|
|
649
|
-
async function initSubgraphFromExample({
|
|
650
|
-
// protocolInstance,
|
|
651
|
-
fromExample, allowSimpleName, subgraphName, directory, }, { commands, }) {
|
|
650
|
+
async function initSubgraphFromExample({ fromExample, allowSimpleName, subgraphName, directory, }, { commands, }) {
|
|
652
651
|
// Fail if the subgraph name is invalid
|
|
653
652
|
if (!revalidateSubgraphName.bind(this)(subgraphName, { allowSimpleName })) {
|
|
654
653
|
process.exitCode = 1;
|
|
@@ -734,14 +733,12 @@ fromExample, allowSimpleName, subgraphName, directory, }, { commands, }) {
|
|
|
734
733
|
this.exit(1);
|
|
735
734
|
return;
|
|
736
735
|
}
|
|
737
|
-
//
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
// }
|
|
744
|
-
// }
|
|
736
|
+
// Run code-generation
|
|
737
|
+
const codegen = await runCodegen(directory, commands.codegen);
|
|
738
|
+
if (codegen !== true) {
|
|
739
|
+
this.exit(1);
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
745
742
|
printNextSteps.bind(this)({ subgraphName, directory }, { commands });
|
|
746
743
|
}
|
|
747
744
|
async function initSubgraphFromContract({ protocolInstance, allowSimpleName, subgraphName, directory, abi, network, contract, indexEvents, contractName, node, studio, product, startBlock, spkgPath, }, { commands, addContract, }) {
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED