From 408798e29f10561fafd72df21299b5dc219f5131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Criado-P=C3=A9rez?= Date: Tue, 29 Mar 2022 15:11:03 +0200 Subject: [PATCH] Clarity software --- package.json | 1 + .../en/write-smart-contracts/software.md | 73 +++++++++++++++++++ yarn.lock | 5 ++ 3 files changed, 79 insertions(+) create mode 100644 src/pages/en/write-smart-contracts/software.md diff --git a/package.json b/package.json index 4259d49b..0dcccbcf 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "unist-util-visit": "^2.0.3", "use-events": "^1.4.2", "use-is-in-viewport": "^1.0.9", + "vale": "^0.1.0", "yaml-loader": "^0.6.0" }, "devDependencies": { diff --git a/src/pages/en/write-smart-contracts/software.md b/src/pages/en/write-smart-contracts/software.md new file mode 100644 index 00000000..6b81e4b6 --- /dev/null +++ b/src/pages/en/write-smart-contracts/software.md @@ -0,0 +1,73 @@ +--- +title: Clarity development software +description: The following tools are useful when developing Clarity smart contracts +--- + +## Language Server Protocol for Clarity (including Visual Studio Code extension) + +The Language Server Protocol (LSP) defines the protocol used between an editor or IDE and a language server that provides language features like auto complete, go to definition, find all references etc. + +This makes programming in Clarity easier and much more intuitive. + +![Clarity LSP Screenshot](https://github.com/hirosystems/clarity-lsp/raw/HEAD/doc/images/screenshot.png?raw=true) + +Clarity LSP repository is available [here](https://github.com/hirosystems/clarity-lsp). The extension for Visual Studio Code can be downloaded directly from [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=HiroSystems.clarity-lsp), but can be and older version. For a more up to date version you can also download it from [open-vsx](https://open-vsx.org/extension/hirosystems/clarity-lsp). + +## Clarity REPL + +A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a simple, interactive computer programming environment that takes single user inputs (i.e., single expressions), evaluates (executes) them, and returns the result to the user; a program written in a REPL environment is executed piecewise. + +![Clarity-repl](https://github.com/hirosystems/clarity-repl/blob/develop/docs/images/screenshot.png?raw=true) + +Instructions on how to install Clarity REPL can be found [here](https://github.com/hirosystems/clarity-repl). + +## Clarinet + +Clarinet is a Clarity runtime packaged as a command line tool, designed to facilitate smart contract understanding, development, testing and deployment. Clarinet consists of a Clarity REPL and a testing harness, which, when used together allow you to rapidly develop and test a Clarity smart contract, with the need to deploy the contract to a local devnet or testnet. + +![Clarinet](https://github.com/hirosystems/clarinet/blob/develop/docs/images/demo.gif?raw=true) + +Installation instructions, including build from source instructions can be found [here](https://github.com/hirosystems/clarinet). If you prefer you can directly download the latest compiled realease for Windows, Mac and Linux [here](https://github.com/hirosystems/clarinet/releases). + +[Clarinet 101](https://www.youtube.com/playlist?list=PL5Ujm489LoJaAz9kUJm8lYUWdGJ2AnQTb) contains multiple Clarinet video tutorials + +### Getting started with Clarinet + +You can verify you have Clarinet installed by checking its version: + +```bash +$ clarinet --version +clarinet 0.70 +``` + +More detailed information on using Clarinet is available [here](https://book.clarity-lang.org/ch07-00-using-clarinet.html). However to get you started, the following commands are important to know. + +Create a new project and enter its directory: + +```bash +clarinet new my-project && cd my-project +``` + +Create a new contract inside my project: + +```bash +clarinet contract new mycoolcontract +``` + +Check the sintax of Clarity: + +```bash +clarity check +``` + +To test your contract: + +```bash +clarinet test +``` + +Enter Clarinet's console: + +```bash +clarinet console +``` diff --git a/yarn.lock b/yarn.lock index 04ad4011..2dc43132 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7844,6 +7844,11 @@ v8-compile-cache@^2.0.3: resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz#9471efa3ef9128d2f7c6a7ca39c4dd6b5055b132" integrity sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q== +vale@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/vale/-/vale-0.1.0.tgz#884cc740a3d5a44d953781f78bc278c294419894" + integrity sha1-iEzHQKPVpE2VN4H3i8J4wpRBmJQ= + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"