From e7fc7cddb755519986f95f6950100e2124b6b6f3 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Mon, 23 Sep 2024 16:02:31 -0700 Subject: [PATCH 1/2] Add documentation for simplified `flow deps add` syntax --- docs/tools/flow-cli/dependency-manager.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/tools/flow-cli/dependency-manager.md b/docs/tools/flow-cli/dependency-manager.md index f177140c45..4884a11962 100644 --- a/docs/tools/flow-cli/dependency-manager.md +++ b/docs/tools/flow-cli/dependency-manager.md @@ -15,8 +15,13 @@ If you know the address and name of the contract you want to install (this can u `flow dependencies add testnet://7e60df042a9c0868.FlowToken` +For core contracts, you may add them to your project using a simplified syntax using only the contract name: + +`flow dependencies add FlowToken` + +This will default to using Flow Mainnet as the source network (e.g. this command is equivalent to `flow dependencies add mainnet://1654653399040a61.FlowToken`). + > Note: You can also use the shorthand `deps` -> In this command, the string that will be used as the `source` in the `flow.json` after installation is `testnet://7e60df042a9c0868.FlowToken`. This can be broken down into three sections for formatting it yourself for another contract: @@ -69,4 +74,4 @@ This will look at all the dependencies you have in your `flow.json`, install the - After installation, you will have a local folder named `imports` that you should add to `.gitignore`. This folder is where your dependencies will be stored locally. - If your contracts change on the network, the Dependency Manager will ask if you want to update the local dependencies in your `imports` folder. The hash saved in the dependency object is used for this check, so don't remove it. - Dependencies will function just like contracts. For instance, you can add them to [`deployments` in your `flow.json`](./deployment/deploy-project-contracts.md) and run `flow project deploy`, as well as import them in your scripts, transactions, and contracts just as you would with a contract you added yourself (e.g., `import "FlowToken"`). -- Core contract aliases will be automatically added for you across all networks. \ No newline at end of file +- Core contract aliases will be automatically added for you across all networks. From c57b331af55062daf5839b12f6989113e1c28ed6 Mon Sep 17 00:00:00 2001 From: Jordan Ribbink Date: Tue, 24 Sep 2024 08:48:06 -0700 Subject: [PATCH 2/2] Address feedback --- docs/tools/flow-cli/dependency-manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tools/flow-cli/dependency-manager.md b/docs/tools/flow-cli/dependency-manager.md index 4884a11962..0076ddcfe4 100644 --- a/docs/tools/flow-cli/dependency-manager.md +++ b/docs/tools/flow-cli/dependency-manager.md @@ -15,11 +15,11 @@ If you know the address and name of the contract you want to install (this can u `flow dependencies add testnet://7e60df042a9c0868.FlowToken` -For core contracts, you may add them to your project using a simplified syntax using only the contract name: +For core contracts, you can add them to your project using a simplified syntax using only the contract name (learn more about core contracts [here](../../build/core-contracts/index.md)), for example: `flow dependencies add FlowToken` -This will default to using Flow Mainnet as the source network (e.g. this command is equivalent to `flow dependencies add mainnet://1654653399040a61.FlowToken`). +Th command will default to using Flow Mainnet as the source network (i.e. this command is functionally equivalent to `flow dependencies add mainnet://1654653399040a61.FlowToken`). > Note: You can also use the shorthand `deps`