@taqueria/plugin-ligo 0.14.4 → 0.18.0

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.
Files changed (3) hide show
  1. package/README.md +26 -27
  2. package/_readme.eta +29 -28
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -15,48 +15,47 @@ To install the LIGO plugin on a Taqueria project, navigate to the project folder
15
15
  taq install @taqueria/plugin-ligo
16
16
  ```
17
17
 
18
- ## Configuration
18
+ ## The `taq compile` Task
19
19
 
20
- No additional configuration is available
20
+ Basic usage is:
21
21
 
22
- ## Usage
22
+ ```shell
23
+ taq compile <filename>
24
+ ```
23
25
 
24
- The LIGO plugin exposes a `compile` task in Taqueria which can target one, or all the LIGO contracts in the `contracts` folder and compile them to Michelson `.tz` files output to the `artifacts` folder
26
+ > ### :warning: CAUTION
27
+ > The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, Archetype, SmartPy). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
25
28
 
26
- The LIGO plugin also exposes a contract template via the `taq create contract <contractName>` task. This task will create a new LIGO contract in the `contracts` directory, insert some boilerplate LIGO contract code and will register the contract with Taqueria
29
+ ### Basic description
30
+ The LIGO plugin exposes a `compile` task in Taqueria which can target one LIGO contract in the `contracts` folder and compile them to a Michelson `.tz` file output to the `/artifacts` folder.
27
31
 
28
- ## Tasks
32
+ ### A frictionless smart contract development workflow
33
+ Our LIGO plugin introduces a smart contract development workflow by means of two simple file naming formats.
29
34
 
30
- ### The `taq compile` Task
35
+ Suppose you have a contract named `hello.mligo` and you create a file in the same directory as the contract with the naming format of `CONTRACT.storages.EXT`, where `CONTRACT` is the name of the contract this storages file is associated with and `EXT` must match the extension of the associated contract. In our case, the former is `hello` and the latter is `mligo`, so it'd be named `hello.storages.mligo`.
31
36
 
32
- The LIGO plugin's `taq compile` task can be run with or without arguments. The structure for the task is:
37
+ You can define a list of LIGO variables in `hello.storages.mligo` in the form of `let VARIABLE_NAME: STORAGE_TYPE = EXPRESSION` (explicit typing is optional but recommended) and the expressions will be treated as initial storage values for `hello.mligo`.
33
38
 
34
- ```shell
35
- taq compile <file-name>
36
- ```
39
+ > ### :page_with_curl: Note
40
+ > Note that the form is actually mligo code. Variable definitions in other syntax variants will differ.
37
41
 
38
- Running the `compile` task with no options will result in any registered LIGO smart contracts in the `contracts` folder being compiled to Michelson files in the `artifacts` folder. If you speficy an optional filename, only LIGO contracts matching the specified filename in the `contracts` folder will be registered and compiled
42
+ Similarly with `hello.parameters.mligo` but in the form of `let VARIABLE_NAME: PARAMETER_TYPE = EXPRESSION`.
39
43
 
40
- > ### :warning: CAUTION
41
- > The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, Archetype, SmartPY). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
44
+ `taq compile hello.storages.mligo` will compile each definition in `hello.storages.mligo` and will produce a Michelson `.tz` file that contains the storage value, as a Michelson expression, for each of them. If the name of a variable is `storage1`, then its emitted Michelson file will be named `hello.storage.storage1.tz`. For `taq compile hello.parameters.mligo`, the name will be `hello.parameter.param1.tz` if there's a variable named `param1` defined in `hello.parameters.mligo`.
42
45
 
43
- #### Options
46
+ Furthermore, the first variable definition in `hello.storages.mligo` will be treated as the default storage and will produce a Michelson file named `hello.default_storage.tz` instead. The `deploy` task from the Taquito plugin will take advantage of this. Go to that plugin documentation to learn how.
44
47
 
45
- The LIGO `compile` task will accept the following optional parameters:
48
+ Lastly, `taq compile hello.mligo` will compile `hello.mligo` and emit `hello.tz`. Then it'll look for `hello.storages.mligo` and `hello.parameters.mligo` and compile them too if they are found.
46
49
 
47
- | flag | name | description |
48
- |:-----:|:------------|---------------------------------------|
49
- | -e | entry-point | The entry point that will be compiled |
50
- | -s | syntax | The syntax used in the contract |
51
- | -i | infer | Enable type inference |
50
+ > ### :warning: CAUTION
51
+ > Make sure you name it `hello.storages.mligo` and not `hello.storage.mligo` (note the extra `s`).
52
52
 
53
- #### Task Properties
53
+ ### Options
54
54
 
55
- | attribute | value |
56
- |------------|:-----------------------------:|
57
- | task | 'compile' |
58
- | command | 'compile [sourceFile] |
59
- | aliases | ['c', 'compile-ligo'] |
55
+ None for now.
56
+
57
+ ## Template creation
58
+ The LIGO plugin also exposes a contract template via the `taq create contract <contractName>` task. This task will create a new LIGO contract in the `contracts` directory, insert some boilerplate LIGO contract code and will register the contract with Taqueria
60
59
 
61
60
  ### The `create contract` Template
62
61
 
package/_readme.eta CHANGED
@@ -17,49 +17,50 @@ To install the LIGO plugin on a Taqueria project, navigate to the project folder
17
17
  taq install @taqueria/plugin-ligo
18
18
  ```
19
19
 
20
- ## Configuration
20
+ ## The `taq compile` Task
21
21
 
22
- No additional configuration is available
22
+ Basic usage is:
23
23
 
24
- ## Usage
24
+ ```shell
25
+ taq compile <filename>
26
+ ```
25
27
 
26
- The LIGO plugin exposes a `compile` task in Taqueria which can target one, or all the LIGO contracts in the `contracts` folder and compile them to Michelson `.tz` files output to the `artifacts` folder
28
+ <%~ it.cautionOpenAdmonition %>
29
+ The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, Archetype, SmartPy). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
30
+ <%= it.closeAdmonition %>
27
31
 
28
- The LIGO plugin also exposes a contract template via the `taq create contract <contractName>` task. This task will create a new LIGO contract in the `contracts` directory, insert some boilerplate LIGO contract code and will register the contract with Taqueria
32
+ ### Basic description
33
+ The LIGO plugin exposes a `compile` task in Taqueria which can target one LIGO contract in the `contracts` folder and compile them to a Michelson `.tz` file output to the `/artifacts` folder.
29
34
 
30
- ## Tasks
35
+ ### A frictionless smart contract development workflow
36
+ Our LIGO plugin introduces a smart contract development workflow by means of two simple file naming formats.
31
37
 
32
- ### The `taq compile` Task
38
+ Suppose you have a contract named `hello.mligo` and you create a file in the same directory as the contract with the naming format of `CONTRACT.storages.EXT`, where `CONTRACT` is the name of the contract this storages file is associated with and `EXT` must match the extension of the associated contract. In our case, the former is `hello` and the latter is `mligo`, so it'd be named `hello.storages.mligo`.
33
39
 
34
- The LIGO plugin's `taq compile` task can be run with or without arguments. The structure for the task is:
40
+ You can define a list of LIGO variables in `hello.storages.mligo` in the form of `let VARIABLE_NAME: STORAGE_TYPE = EXPRESSION` (explicit typing is optional but recommended) and the expressions will be treated as initial storage values for `hello.mligo`.
35
41
 
36
- ```shell
37
- taq compile <file-name>
38
- ```
42
+ <%~ it.noteOpenAdmonition %>
43
+ Note that the form is actually mligo code. Variable definitions in other syntax variants will differ.
44
+ <%= it.closeAdmonition %>
39
45
 
40
- Running the `compile` task with no options will result in any registered LIGO smart contracts in the `contracts` folder being compiled to Michelson files in the `artifacts` folder. If you speficy an optional filename, only LIGO contracts matching the specified filename in the `contracts` folder will be registered and compiled
46
+ Similarly with `hello.parameters.mligo` but in the form of `let VARIABLE_NAME: PARAMETER_TYPE = EXPRESSION`.
41
47
 
42
- <%~ it.cautionOpenAdmonition %>
43
- The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, Archetype, SmartPY). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
44
- <%= it.closeAdmonition %>
48
+ `taq compile hello.storages.mligo` will compile each definition in `hello.storages.mligo` and will produce a Michelson `.tz` file that contains the storage value, as a Michelson expression, for each of them. If the name of a variable is `storage1`, then its emitted Michelson file will be named `hello.storage.storage1.tz`. For `taq compile hello.parameters.mligo`, the name will be `hello.parameter.param1.tz` if there's a variable named `param1` defined in `hello.parameters.mligo`.
45
49
 
46
- #### Options
50
+ Furthermore, the first variable definition in `hello.storages.mligo` will be treated as the default storage and will produce a Michelson file named `hello.default_storage.tz` instead. The `deploy` task from the Taquito plugin will take advantage of this. Go to that plugin documentation to learn how.
47
51
 
48
- The LIGO `compile` task will accept the following optional parameters:
52
+ Lastly, `taq compile hello.mligo` will compile `hello.mligo` and emit `hello.tz`. Then it'll look for `hello.storages.mligo` and `hello.parameters.mligo` and compile them too if they are found.
49
53
 
50
- | flag | name | description |
51
- |:-----:|:------------|---------------------------------------|
52
- | -e | entry-point | The entry point that will be compiled |
53
- | -s | syntax | The syntax used in the contract |
54
- | -i | infer | Enable type inference |
54
+ <%~ it.cautionOpenAdmonition %>
55
+ Make sure you name it `hello.storages.mligo` and not `hello.storage.mligo` (note the extra `s`).
56
+ <%= it.closeAdmonition %>
57
+
58
+ ### Options
55
59
 
56
- #### Task Properties
60
+ None for now.
57
61
 
58
- | attribute | value |
59
- |------------|:-----------------------------:|
60
- | task | 'compile' |
61
- | command | 'compile [sourceFile] |
62
- | aliases | ['c', 'compile-ligo'] |
62
+ ## Template creation
63
+ The LIGO plugin also exposes a contract template via the `taq create contract <contractName>` task. This task will create a new LIGO contract in the `contracts` directory, insert some boilerplate LIGO contract code and will register the contract with Taqueria
63
64
 
64
65
  ### The `create contract` Template
65
66
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqueria/plugin-ligo",
3
- "version": "0.14.4",
3
+ "version": "0.18.0",
4
4
  "description": "A taqueria plugin for compiling LIGO smart contracts",
5
5
  "targets": {
6
6
  "default": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://github.com/ecadlabs/taqueria#readme",
43
43
  "dependencies": {
44
- "@taqueria/node-sdk": "^0.14.4",
44
+ "@taqueria/node-sdk": "^0.18.0",
45
45
  "fast-glob": "^3.2.11"
46
46
  },
47
47
  "devDependencies": {