@taqueria/plugin-ligo 0.14.4 → 0.16.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.
- package/README.md +26 -27
- package/_readme.eta +29 -28
- 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
|
-
##
|
|
18
|
+
## The `taq compile` Task
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Basic usage is:
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
```shell
|
|
23
|
+
taq compile <filename>
|
|
24
|
+
```
|
|
23
25
|
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
35
|
-
|
|
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
|
-
|
|
42
|
+
Similarly with `hello.parameters.mligo` but in the form of `let VARIABLE_NAME: PARAMETER_TYPE = EXPRESSION`.
|
|
39
43
|
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
53
|
+
### Options
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
##
|
|
20
|
+
## The `taq compile` Task
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Basic usage is:
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
```shell
|
|
25
|
+
taq compile <filename>
|
|
26
|
+
```
|
|
25
27
|
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
37
|
-
|
|
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
|
-
|
|
46
|
+
Similarly with `hello.parameters.mligo` but in the form of `let VARIABLE_NAME: PARAMETER_TYPE = EXPRESSION`.
|
|
41
47
|
|
|
42
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
60
|
+
None for now.
|
|
57
61
|
|
|
58
|
-
|
|
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.
|
|
3
|
+
"version": "0.16.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.
|
|
44
|
+
"@taqueria/node-sdk": "^0.16.0",
|
|
45
45
|
"fast-glob": "^3.2.11"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|