Skip to content

Commit

Permalink
Remove skip-git deprecation warning (#1866)
Browse files Browse the repository at this point in the history
* show skip-git deprecation warning only when used

* update tests

* fixes #1852
  • Loading branch information
YaroShkvorets authored Dec 19, 2024
1 parent 4ddb562 commit a4f0745
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-flies-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphprotocol/graph-cli': patch
---

show skip-git deprecation warning only when used
10 changes: 6 additions & 4 deletions packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ export default class InitCommand extends Command {
'skip-git': Flags.boolean({
summary: 'Skip initializing a Git repository.',
default: false,
deprecated: {
message:
'In next major version, this flag will be removed. By default we will stop initializing a Git repository.',
},
}),
'start-block': Flags.string({
helpGroup: 'Scaffold from contract',
Expand Down Expand Up @@ -142,6 +138,12 @@ export default class InitCommand extends Command {

initDebugger('Flags: %O', flags);

if (skipGit) {
this.warn(
'The --skip-git flag will be removed in the next major version. By default we will stop initializing a Git repository.',
);
}

const { node } = chooseNodeUrl({
node: nodeFlag,
});
Expand Down
32 changes: 16 additions & 16 deletions packages/cli/tests/cli/__snapshots__/init.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Init > Ethereum > From contract 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -37,8 +37,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From contract with abi 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -73,8 +73,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From contract with abi and structs 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -109,8 +109,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From contract with index events and abi with ID in events 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -145,8 +145,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From contract with list items in abi 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -181,8 +181,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From contract with overloaded elements 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down Expand Up @@ -217,8 +217,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > Ethereum > From example 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Cloning example subgraph
✔ Cloning example subgraph
- Initialize networks config
Expand Down Expand Up @@ -251,8 +251,8 @@ Make sure to visit the documentation on https://thegraph.com/docs/ for further i
`;

exports[`Init > NEAR > From contract 1`] = `
" › Warning: In next major version, this flag will be removed. By default we
› will stop initializing a Git repository.
" › Warning: The --skip-git flag will be removed in the next major version. By
default we will stop initializing a Git repository.
- Create subgraph scaffold
Generate subgraph
- Create subgraph scaffold
Expand Down

0 comments on commit a4f0745

Please sign in to comment.