@taqueria/plugin-ligo 0.3.1 → 0.4.0-rc3
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 +41 -12
- package/_readme.eta +64 -0
- package/compile.ts +82 -69
- package/index.js +41 -53
- package/index.js.map +1 -1
- package/index.ts +46 -44
- package/package.json +49 -49
- package/tsconfig.json +91 -91
package/README.md
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
# Taqueria LIGO Plugin
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
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 code output to the artifacts folder
|
|
6
|
-
|
|
7
|
-
## Tasks
|
|
8
|
-
|
|
9
|
-
The LIGO plugin provides the following tasks to Taqueria:
|
|
10
|
-
- `compile`
|
|
3
|
+
The LIGO plugin provides a task to compile LIGO smart contracts to Michelson `.tz` files
|
|
11
4
|
|
|
12
5
|
## Requirements
|
|
13
6
|
|
|
@@ -17,15 +10,51 @@ The LIGO plugin provides the following tasks to Taqueria:
|
|
|
17
10
|
|
|
18
11
|
## Installation
|
|
19
12
|
|
|
20
|
-
The LIGO plugin is distributed as an NPM package that can be installed and uninstalled on a project from the Taqueria CLI
|
|
21
|
-
|
|
22
13
|
To install the LIGO plugin on a Taqueria project, navigate to the project folder and run:
|
|
23
14
|
```shell
|
|
24
15
|
taq install @taqueria/plugin-ligo
|
|
25
16
|
```
|
|
26
17
|
|
|
18
|
+
> ### :page_with_curl: Note
|
|
19
|
+
> At this time, all Taqueria projects must also be initialized as node projects by running `npm init -y` from the root of your project directory
|
|
20
|
+
|
|
21
|
+
## Configuration
|
|
22
|
+
|
|
23
|
+
No additional configuration is available
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
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
|
|
27
|
+
|
|
28
|
+
### Running the Compile Task
|
|
29
|
+
|
|
30
|
+
The LIGO plugin's `taq compile` task can be run with or without arguments. The basic syntax for the task is `taq compile <file-name>`
|
|
31
|
+
|
|
32
|
+
Running the `compile` task with no options will result in any source 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 compiled
|
|
33
|
+
|
|
34
|
+
> ### :warning: CAUTION
|
|
35
|
+
> The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, SmartPY). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
|
|
36
|
+
|
|
37
|
+
### Options
|
|
38
|
+
|
|
39
|
+
The LIGO `compile` task will accept the following optional parameters:
|
|
40
|
+
|
|
41
|
+
| flag | name | description |
|
|
42
|
+
|:-----:|:------------|---------------------------------------|
|
|
43
|
+
| -e | entry-point | The entry point that will be compiled |
|
|
44
|
+
| -s | syntax | The syntax used in the contract |
|
|
45
|
+
| -i | infer | Enable type inference |
|
|
46
|
+
|
|
47
|
+
|
|
27
48
|
## Plugin Architecture
|
|
28
49
|
|
|
29
|
-
This is a plugin developed for Taqueria built on NodeJS using the Taqueria Node SDK
|
|
50
|
+
This is a plugin developed for Taqueria built on NodeJS using the Taqueria Node SDK
|
|
51
|
+
|
|
52
|
+
Docker is used under the hood to provide a self contained environment for LIGO to prevent the need for it to be installed on the user's local machine
|
|
53
|
+
|
|
54
|
+
The plugin provides a single task `compile`, used for compiling LIGO smart contracts to Michelson:
|
|
30
55
|
|
|
31
|
-
|
|
56
|
+
| attribute | value |
|
|
57
|
+
|------------|:------------------------:|
|
|
58
|
+
| task | 'compile' |
|
|
59
|
+
| command | 'compile [sourceFile] |
|
|
60
|
+
| aliases | ['c', 'compile-ligo'] |
|
package/_readme.eta
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<% if (it.output == "github") { %>
|
|
2
|
+
# Taqueria LIGO Plugin
|
|
3
|
+
<% } %>
|
|
4
|
+
|
|
5
|
+
The LIGO plugin provides a task to compile LIGO smart contracts to Michelson `.tz` files
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Taqueria v0.0.6 or later
|
|
10
|
+
- Node.js v16 or later
|
|
11
|
+
- Docker v0.8.4 or later
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
To install the LIGO plugin on a Taqueria project, navigate to the project folder and run:
|
|
16
|
+
```shell
|
|
17
|
+
taq install @taqueria/plugin-ligo
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
<%~ it.noteOpenAdmonition %>
|
|
21
|
+
At this time, all Taqueria projects must also be initialized as node projects by running `npm init -y` from the root of your project directory
|
|
22
|
+
<%= it.closeAdmonition %>
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
No additional configuration is available
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
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
|
|
30
|
+
|
|
31
|
+
### Running the Compile Task
|
|
32
|
+
|
|
33
|
+
The LIGO plugin's `taq compile` task can be run with or without arguments. The basic syntax for the task is `taq compile <file-name>`
|
|
34
|
+
|
|
35
|
+
Running the `compile` task with no options will result in any source 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 compiled
|
|
36
|
+
|
|
37
|
+
<%~ it.cautionOpenAdmonition %>
|
|
38
|
+
The `compile` task can be implemented by more than one compiler plugin installed on a project (LIGO, SmartPY). If this is the case, you must use the `--plugin ligo` flag to specify a particular compiler
|
|
39
|
+
<%= it.closeAdmonition %>
|
|
40
|
+
|
|
41
|
+
### Options
|
|
42
|
+
|
|
43
|
+
The LIGO `compile` task will accept the following optional parameters:
|
|
44
|
+
|
|
45
|
+
| flag | name | description |
|
|
46
|
+
|:-----:|:------------|---------------------------------------|
|
|
47
|
+
| -e | entry-point | The entry point that will be compiled |
|
|
48
|
+
| -s | syntax | The syntax used in the contract |
|
|
49
|
+
| -i | infer | Enable type inference |
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Plugin Architecture
|
|
53
|
+
|
|
54
|
+
This is a plugin developed for Taqueria built on NodeJS using the Taqueria Node SDK
|
|
55
|
+
|
|
56
|
+
Docker is used under the hood to provide a self contained environment for LIGO to prevent the need for it to be installed on the user's local machine
|
|
57
|
+
|
|
58
|
+
The plugin provides a single task `compile`, used for compiling LIGO smart contracts to Michelson:
|
|
59
|
+
|
|
60
|
+
| attribute | value |
|
|
61
|
+
|------------|:------------------------:|
|
|
62
|
+
| task | 'compile' |
|
|
63
|
+
| command | 'compile [sourceFile] |
|
|
64
|
+
| aliases | ['c', 'compile-ligo'] |
|
package/compile.ts
CHANGED
|
@@ -1,77 +1,90 @@
|
|
|
1
|
-
import {execCmd, getArch, sendAsyncErr,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import glob = require('fast-glob')
|
|
1
|
+
import { execCmd, getArch, sendAsyncErr, sendErr, sendJsonRes } from '@taqueria/node-sdk';
|
|
2
|
+
import { LikeAPromise, PluginResponse, RequestArgs } from '@taqueria/node-sdk/types';
|
|
3
|
+
import { basename, extname, join } from 'path';
|
|
4
|
+
import glob = require('fast-glob');
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return join(opts.config.artifactsDir, `${outFile}.tz`)
|
|
6
|
+
interface Opts extends RequestArgs.t {
|
|
7
|
+
entrypoint?: string;
|
|
8
|
+
syntax?: string;
|
|
9
|
+
sourceFile?: string;
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const getContractArtifactFilename = (opts: Opts) =>
|
|
13
|
+
(sourceFile: string) => {
|
|
14
|
+
const outFile = basename(sourceFile, extname(sourceFile));
|
|
15
|
+
return join(opts.config.artifactsDir, `${outFile}.tz`);
|
|
16
|
+
};
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const entryPoint = opts.e ? `-e ${opts.e}` : ""
|
|
22
|
-
const syntax = opts["-s"] ? `s ${opts['s']} : ""` : ""
|
|
23
|
-
const outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`
|
|
24
|
-
const cmd = `${baseCommand} ${entryPoint} ${syntax} ${outFile}`
|
|
25
|
-
return cmd
|
|
26
|
-
}
|
|
18
|
+
const getInputFilename = (opts: Opts) =>
|
|
19
|
+
(sourceFile: string) => {
|
|
20
|
+
return join(opts.config.contractsDir, sourceFile);
|
|
21
|
+
};
|
|
27
22
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
.then(execCmd)
|
|
32
|
-
.then(({stderr}) => { // How should we output warnings?
|
|
33
|
-
if (stderr.length > 0) sendErr(stderr)
|
|
34
|
-
return {
|
|
35
|
-
contract: sourceFile,
|
|
36
|
-
artifact: getContractArtifactFilename (opts) (sourceFile)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
.catch(err => {
|
|
40
|
-
sendErr(" ")
|
|
41
|
-
sendErr(err.message.split("\n").slice(1).join("\n"))
|
|
42
|
-
return Promise.resolve({
|
|
43
|
-
contract: sourceFile,
|
|
44
|
-
artifact: "Not compiled"
|
|
45
|
-
})
|
|
46
|
-
})
|
|
23
|
+
const getCompileCommand = (opts: Opts) =>
|
|
24
|
+
(sourceFile: string) => {
|
|
25
|
+
const projectDir = process.env.PROJECT_DIR ?? opts.projectDir;
|
|
47
26
|
|
|
48
|
-
|
|
49
|
-
// TODO: Fetch list of files from SDK
|
|
50
|
-
return glob(
|
|
51
|
-
['**/*.ligo', '**/*.religo', '**/*.mligo', '**/*.jsligo'],
|
|
52
|
-
{cwd: parsedArgs.contractsDir, absolute: false}
|
|
53
|
-
)
|
|
54
|
-
.then(entries => entries.map(compileContract (parsedArgs)))
|
|
55
|
-
.then(processes => processes.length > 0
|
|
56
|
-
? processes
|
|
57
|
-
: [{contract: "None found", artifact: "N/A"}]
|
|
58
|
-
)
|
|
59
|
-
.then(promises => Promise.all(promises))
|
|
60
|
-
}
|
|
27
|
+
if (!projectDir) throw `No project directory provided`;
|
|
61
28
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
29
|
+
const inputFile = getInputFilename(opts)(sourceFile);
|
|
30
|
+
const baseCommand =
|
|
31
|
+
`DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -w /project ligolang/ligo:next compile contract ${inputFile}`;
|
|
32
|
+
const entryPoint = opts.entrypoint ? `-e ${opts.entrypoint}` : '';
|
|
33
|
+
const syntax = opts['syntax'] ? `-s ${opts['syntax']} : ""` : '';
|
|
34
|
+
const outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`;
|
|
35
|
+
const cmd = `${baseCommand} ${entryPoint} ${syntax} ${outFile}`;
|
|
36
|
+
return cmd;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const compileContract = (opts: Opts) =>
|
|
40
|
+
(sourceFile: string): Promise<{ contract: string; artifact: string }> =>
|
|
41
|
+
getArch()
|
|
42
|
+
.then(() => getCompileCommand(opts)(sourceFile))
|
|
43
|
+
.then(execCmd)
|
|
44
|
+
.then(({ stderr }) => { // How should we output warnings?
|
|
45
|
+
if (stderr.length > 0) sendErr(stderr);
|
|
46
|
+
return {
|
|
47
|
+
contract: sourceFile,
|
|
48
|
+
artifact: getContractArtifactFilename(opts)(sourceFile),
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
.catch(err => {
|
|
52
|
+
sendErr(' ');
|
|
53
|
+
sendErr(err.message.split('\n').slice(1).join('\n'));
|
|
54
|
+
return Promise.resolve({
|
|
55
|
+
contract: sourceFile,
|
|
56
|
+
artifact: 'Not compiled',
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const compileAll = (parsedArgs: Opts): Promise<{ contract: string; artifact: string }[]> => {
|
|
61
|
+
// TODO: Fetch list of files from SDK
|
|
62
|
+
return glob(
|
|
63
|
+
['**/*.ligo', '**/*.religo', '**/*.mligo', '**/*.jsligo'],
|
|
64
|
+
{ cwd: parsedArgs.config.contractsDir, absolute: false },
|
|
65
|
+
)
|
|
66
|
+
.then(entries => entries.map(compileContract(parsedArgs)))
|
|
67
|
+
.then(processes =>
|
|
68
|
+
processes.length > 0
|
|
69
|
+
? processes
|
|
70
|
+
: [{ contract: 'None found', artifact: 'N/A' }]
|
|
71
|
+
)
|
|
72
|
+
.then(promises => Promise.all(promises));
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const compile = (parsedArgs: Opts): Promise<PluginResponse> => {
|
|
76
|
+
const p = parsedArgs.sourceFile
|
|
77
|
+
? compileContract(parsedArgs)(parsedArgs.sourceFile as string)
|
|
78
|
+
.then(result => [result])
|
|
79
|
+
: compileAll(parsedArgs)
|
|
80
|
+
.then(results => {
|
|
81
|
+
if (results.length === 0) sendErr('No contracts found to compile.');
|
|
82
|
+
return results;
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
return p
|
|
86
|
+
.then(sendJsonRes)
|
|
87
|
+
.catch(err => sendAsyncErr(err, false));
|
|
88
|
+
};
|
|
76
89
|
|
|
77
|
-
export default compile
|
|
90
|
+
export default compile;
|
package/index.js
CHANGED
|
@@ -7,81 +7,72 @@ var $kQNfl$fastglob = require("fast-glob");
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
const $24b2f47d8f306cb3$var$getContractArtifactFilename = (opts)=>(sourceFile)=>{
|
|
10
|
-
const outFile = $kQNfl$path.basename(sourceFile, $kQNfl$path.extname(sourceFile));
|
|
11
|
-
return $kQNfl$path.join(opts.config.artifactsDir, `${outFile}.tz`);
|
|
12
|
-
}
|
|
13
|
-
;
|
|
10
|
+
const outFile = (0, $kQNfl$path.basename)(sourceFile, (0, $kQNfl$path.extname)(sourceFile));
|
|
11
|
+
return (0, $kQNfl$path.join)(opts.config.artifactsDir, `${outFile}.tz`);
|
|
12
|
+
};
|
|
14
13
|
const $24b2f47d8f306cb3$var$getInputFilename = (opts)=>(sourceFile)=>{
|
|
15
|
-
return $kQNfl$path.join(opts.config.contractsDir, sourceFile);
|
|
16
|
-
}
|
|
17
|
-
;
|
|
14
|
+
return (0, $kQNfl$path.join)(opts.config.contractsDir, sourceFile);
|
|
15
|
+
};
|
|
18
16
|
const $24b2f47d8f306cb3$var$getCompileCommand = (opts)=>(sourceFile)=>{
|
|
19
|
-
const
|
|
17
|
+
const projectDir = process.env.PROJECT_DIR ?? opts.projectDir;
|
|
18
|
+
if (!projectDir) throw `No project directory provided`;
|
|
20
19
|
const inputFile = $24b2f47d8f306cb3$var$getInputFilename(opts)(sourceFile);
|
|
21
20
|
const baseCommand = `DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -w /project ligolang/ligo:next compile contract ${inputFile}`;
|
|
22
|
-
const entryPoint = opts.
|
|
23
|
-
const syntax = opts["
|
|
21
|
+
const entryPoint = opts.entrypoint ? `-e ${opts.entrypoint}` : "";
|
|
22
|
+
const syntax = opts["syntax"] ? `-s ${opts["syntax"]} : ""` : "";
|
|
24
23
|
const outFile = `-o ${$24b2f47d8f306cb3$var$getContractArtifactFilename(opts)(sourceFile)}`;
|
|
25
24
|
const cmd = `${baseCommand} ${entryPoint} ${syntax} ${outFile}`;
|
|
26
25
|
return cmd;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
).then($kQNfl$taquerianodesdk.execCmd).then(({ stderr: stderr })=>{
|
|
31
|
-
if (stderr.length > 0) $kQNfl$taquerianodesdk.sendErr(stderr);
|
|
26
|
+
};
|
|
27
|
+
const $24b2f47d8f306cb3$var$compileContract = (opts)=>(sourceFile)=>(0, $kQNfl$taquerianodesdk.getArch)().then(()=>$24b2f47d8f306cb3$var$getCompileCommand(opts)(sourceFile)).then((0, $kQNfl$taquerianodesdk.execCmd)).then(({ stderr: stderr })=>{
|
|
28
|
+
if (stderr.length > 0) (0, $kQNfl$taquerianodesdk.sendErr)(stderr);
|
|
32
29
|
return {
|
|
33
30
|
contract: sourceFile,
|
|
34
31
|
artifact: $24b2f47d8f306cb3$var$getContractArtifactFilename(opts)(sourceFile)
|
|
35
32
|
};
|
|
36
33
|
}).catch((err)=>{
|
|
37
|
-
$kQNfl$taquerianodesdk.sendErr(" ");
|
|
38
|
-
$kQNfl$taquerianodesdk.sendErr(err.message.split("\n").slice(1).join("\n"));
|
|
34
|
+
(0, $kQNfl$taquerianodesdk.sendErr)(" ");
|
|
35
|
+
(0, $kQNfl$taquerianodesdk.sendErr)(err.message.split("\n").slice(1).join("\n"));
|
|
39
36
|
return Promise.resolve({
|
|
40
37
|
contract: sourceFile,
|
|
41
38
|
artifact: "Not compiled"
|
|
42
39
|
});
|
|
43
|
-
})
|
|
44
|
-
;
|
|
40
|
+
});
|
|
45
41
|
const $24b2f47d8f306cb3$var$compileAll = (parsedArgs)=>{
|
|
46
42
|
// TODO: Fetch list of files from SDK
|
|
47
43
|
return $kQNfl$fastglob([
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
44
|
+
"**/*.ligo",
|
|
45
|
+
"**/*.religo",
|
|
46
|
+
"**/*.mligo",
|
|
47
|
+
"**/*.jsligo"
|
|
52
48
|
], {
|
|
53
|
-
cwd: parsedArgs.contractsDir,
|
|
49
|
+
cwd: parsedArgs.config.contractsDir,
|
|
54
50
|
absolute: false
|
|
55
|
-
}).then((entries)=>entries.map($24b2f47d8f306cb3$var$compileContract(parsedArgs))
|
|
56
|
-
).then((processes)=>processes.length > 0 ? processes : [
|
|
51
|
+
}).then((entries)=>entries.map($24b2f47d8f306cb3$var$compileContract(parsedArgs))).then((processes)=>processes.length > 0 ? processes : [
|
|
57
52
|
{
|
|
58
53
|
contract: "None found",
|
|
59
54
|
artifact: "N/A"
|
|
60
55
|
}
|
|
61
|
-
]
|
|
62
|
-
).then((promises)=>Promise.all(promises)
|
|
63
|
-
);
|
|
56
|
+
]).then((promises)=>Promise.all(promises));
|
|
64
57
|
};
|
|
65
58
|
const $24b2f47d8f306cb3$export$ef7acd7185315e22 = (parsedArgs)=>{
|
|
66
59
|
const p = parsedArgs.sourceFile ? $24b2f47d8f306cb3$var$compileContract(parsedArgs)(parsedArgs.sourceFile).then((result)=>[
|
|
67
60
|
result
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
if (results.length === 0) $kQNfl$taquerianodesdk.sendErr("No contracts found to compile.");
|
|
61
|
+
]) : $24b2f47d8f306cb3$var$compileAll(parsedArgs).then((results)=>{
|
|
62
|
+
if (results.length === 0) (0, $kQNfl$taquerianodesdk.sendErr)("No contracts found to compile.");
|
|
71
63
|
return results;
|
|
72
64
|
});
|
|
73
|
-
return p.then($kQNfl$taquerianodesdk.sendJsonRes).catch((err)
|
|
74
|
-
);
|
|
65
|
+
return p.then((0, $kQNfl$taquerianodesdk.sendJsonRes)).catch((err)=>(0, $kQNfl$taquerianodesdk.sendAsyncErr)(err, false));
|
|
75
66
|
};
|
|
76
67
|
var $24b2f47d8f306cb3$export$2e2bcd8739ae039 = $24b2f47d8f306cb3$export$ef7acd7185315e22;
|
|
77
68
|
|
|
78
69
|
|
|
79
|
-
$kQNfl$taquerianodesdk.Plugin.create((i18n)=>({
|
|
70
|
+
(0, $kQNfl$taquerianodesdk.Plugin).create((i18n)=>({
|
|
80
71
|
schema: "1.0",
|
|
81
72
|
version: "0.1",
|
|
82
73
|
alias: "ligo",
|
|
83
74
|
tasks: [
|
|
84
|
-
$kQNfl$taquerianodesdk.Task.create({
|
|
75
|
+
(0, $kQNfl$taquerianodesdk.Task).create({
|
|
85
76
|
task: "compile",
|
|
86
77
|
command: "compile [sourceFile]",
|
|
87
78
|
aliases: [
|
|
@@ -90,25 +81,25 @@ $kQNfl$taquerianodesdk.Plugin.create((i18n)=>({
|
|
|
90
81
|
],
|
|
91
82
|
description: "Compile a smart contract written in a Ligo syntax to Michelson code",
|
|
92
83
|
options: [
|
|
93
|
-
$kQNfl$taquerianodesdk.Option.create({
|
|
84
|
+
(0, $kQNfl$taquerianodesdk.Option).create({
|
|
94
85
|
shortFlag: "e",
|
|
95
|
-
flag: "
|
|
86
|
+
flag: "entrypoint",
|
|
96
87
|
description: "The entry point that will be compiled"
|
|
97
88
|
}),
|
|
98
|
-
$kQNfl$taquerianodesdk.Option.create({
|
|
89
|
+
(0, $kQNfl$taquerianodesdk.Option).create({
|
|
99
90
|
shortFlag: "s",
|
|
100
91
|
flag: "syntax",
|
|
101
92
|
description: "The syntax used in the contract"
|
|
102
93
|
}),
|
|
103
|
-
$kQNfl$taquerianodesdk.Option.create({
|
|
94
|
+
(0, $kQNfl$taquerianodesdk.Option).create({
|
|
104
95
|
shortFlag: "i",
|
|
105
96
|
flag: "infer",
|
|
106
97
|
description: "Enable type inference"
|
|
107
|
-
})
|
|
98
|
+
}),
|
|
108
99
|
],
|
|
109
|
-
handler:
|
|
110
|
-
encoding:
|
|
111
|
-
})
|
|
100
|
+
handler: "proxy",
|
|
101
|
+
encoding: "json"
|
|
102
|
+
}),
|
|
112
103
|
],
|
|
113
104
|
checkRuntimeDependencies: ()=>Promise.resolve({
|
|
114
105
|
status: "success",
|
|
@@ -119,18 +110,15 @@ $kQNfl$taquerianodesdk.Plugin.create((i18n)=>({
|
|
|
119
110
|
version: ">=0.27.0",
|
|
120
111
|
kind: "required",
|
|
121
112
|
met: true
|
|
122
|
-
}
|
|
113
|
+
},
|
|
123
114
|
]
|
|
124
|
-
})
|
|
125
|
-
,
|
|
115
|
+
}),
|
|
126
116
|
installRunTimeDependencies: ()=>Promise.resolve({
|
|
127
117
|
status: "success",
|
|
128
|
-
output: "LIGO was found in /usr/bin/ligo"
|
|
129
|
-
})
|
|
130
|
-
,
|
|
131
|
-
|
|
132
|
-
})
|
|
133
|
-
, process.argv);
|
|
118
|
+
output: "LIGO was found in /usr/bin/ligo"
|
|
119
|
+
}),
|
|
120
|
+
proxy: (0, $24b2f47d8f306cb3$export$2e2bcd8739ae039)
|
|
121
|
+
}), process.argv);
|
|
134
122
|
|
|
135
123
|
|
|
136
124
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA;ACAA;;;
|
|
1
|
+
{"mappings":";;;;AAAA;ACAA;;;AAWA,MAAM,iDAA2B,GAAG,CAAC,IAAU,GAC9C,CAAC,UAAkB,GAAK;QACvB,MAAM,OAAO,GAAG,CAAA,GAAA,oBAAQ,CAAA,CAAC,UAAU,EAAE,CAAA,GAAA,mBAAO,CAAA,CAAC,UAAU,CAAC,CAAC,AAAC;QAC1D,OAAO,CAAA,GAAA,gBAAI,CAAA,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;KACvD,AAAC;AAEH,MAAM,sCAAgB,GAAG,CAAC,IAAU,GACnC,CAAC,UAAkB,GAAK;QACvB,OAAO,CAAA,GAAA,gBAAI,CAAA,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;KAClD,AAAC;AAEH,MAAM,uCAAiB,GAAG,CAAC,IAAU,GACpC,CAAC,UAAkB,GAAK;QACvB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,AAAC;QAE9D,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC;QAEvD,MAAM,SAAS,GAAG,sCAAgB,CAAC,IAAI,CAAC,CAAC,U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AAI,EAAE,MAAM;wBAAE,OAAO,EAAE,UAAU;wBAAE,IAAI,EAAE,UAAU;wBAAE,GAAG,EAAE,IAAI;qBAAE;iBAChF;aACD,CAAC;QACH,0BAA0B,EAAE,IAC3B,OAAO,CAAC,OAAO,CAAC;gBACf,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,iCAAiC;aACzC,CAAC;QACH,KAAK,EAAE,CAAA,GAAA,wCAAO,CAAA;KACd,CAAA,AAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC","sources":["taqueria-plugin-ligo/index.ts","taqueria-plugin-ligo/compile.ts"],"sourcesContent":["import { Option, Plugin, Task } from '@taqueria/node-sdk';\nimport compile from './compile';\n\nPlugin.create(i18n => ({\n\tschema: '1.0',\n\tversion: '0.1',\n\talias: 'ligo',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'compile',\n\t\t\tcommand: 'compile [sourceFile]',\n\t\t\taliases: ['c', 'compile-ligo'],\n\t\t\tdescription: 'Compile a smart contract written in a Ligo syntax to Michelson code',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'e',\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription: 'The entry point that will be compiled',\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 's',\n\t\t\t\t\tflag: 'syntax',\n\t\t\t\t\tdescription: 'The syntax used in the contract',\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'i',\n\t\t\t\t\tflag: 'infer',\n\t\t\t\t\tdescription: 'Enable type inference',\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t],\n\tcheckRuntimeDependencies: () =>\n\t\tPromise.resolve({\n\t\t\tstatus: 'success',\n\t\t\treport: [\n\t\t\t\t{ name: 'LIGO', path: 'ligo', version: '>=0.27.0', kind: 'required', met: true },\n\t\t\t],\n\t\t}),\n\tinstallRunTimeDependencies: () =>\n\t\tPromise.resolve({\n\t\t\tstatus: 'success',\n\t\t\toutput: 'LIGO was found in /usr/bin/ligo', // TODO this should use i18n\n\t\t}),\n\tproxy: compile,\n}), process.argv);\n","import { execCmd, getArch, sendAsyncErr, sendErr, sendJsonRes } from '@taqueria/node-sdk';\nimport { LikeAPromise, PluginResponse, RequestArgs } from '@taqueria/node-sdk/types';\nimport { basename, extname, join } from 'path';\nimport glob = require('fast-glob');\n\ninterface Opts extends RequestArgs.t {\n\tentrypoint?: string;\n\tsyntax?: string;\n\tsourceFile?: string;\n}\n\nconst getContractArtifactFilename = (opts: Opts) =>\n\t(sourceFile: string) => {\n\t\tconst outFile = basename(sourceFile, extname(sourceFile));\n\t\treturn join(opts.config.artifactsDir, `${outFile}.tz`);\n\t};\n\nconst getInputFilename = (opts: Opts) =>\n\t(sourceFile: string) => {\n\t\treturn join(opts.config.contractsDir, sourceFile);\n\t};\n\nconst getCompileCommand = (opts: Opts) =>\n\t(sourceFile: string) => {\n\t\tconst projectDir = process.env.PROJECT_DIR ?? opts.projectDir;\n\n\t\tif (!projectDir) throw `No project directory provided`;\n\n\t\tconst inputFile = getInputFilename(opts)(sourceFile);\n\t\tconst baseCommand =\n\t\t\t`DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \\\"${projectDir}\\\":/project -w /project ligolang/ligo:next compile contract ${inputFile}`;\n\t\tconst entryPoint = opts.entrypoint ? `-e ${opts.entrypoint}` : '';\n\t\tconst syntax = opts['syntax'] ? `-s ${opts['syntax']} : \"\"` : '';\n\t\tconst outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`;\n\t\tconst cmd = `${baseCommand} ${entryPoint} ${syntax} ${outFile}`;\n\t\treturn cmd;\n\t};\n\nconst compileContract = (opts: Opts) =>\n\t(sourceFile: string): Promise<{ contract: string; artifact: string }> =>\n\t\tgetArch()\n\t\t\t.then(() => getCompileCommand(opts)(sourceFile))\n\t\t\t.then(execCmd)\n\t\t\t.then(({ stderr }) => { // How should we output warnings?\n\t\t\t\tif (stderr.length > 0) sendErr(stderr);\n\t\t\t\treturn {\n\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\tartifact: getContractArtifactFilename(opts)(sourceFile),\n\t\t\t\t};\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tsendErr(' ');\n\t\t\t\tsendErr(err.message.split('\\n').slice(1).join('\\n'));\n\t\t\t\treturn Promise.resolve({\n\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\tartifact: 'Not compiled',\n\t\t\t\t});\n\t\t\t});\n\nconst compileAll = (parsedArgs: Opts): Promise<{ contract: string; artifact: string }[]> => {\n\t// TODO: Fetch list of files from SDK\n\treturn glob(\n\t\t['**/*.ligo', '**/*.religo', '**/*.mligo', '**/*.jsligo'],\n\t\t{ cwd: parsedArgs.config.contractsDir, absolute: false },\n\t)\n\t\t.then(entries => entries.map(compileContract(parsedArgs)))\n\t\t.then(processes =>\n\t\t\tprocesses.length > 0\n\t\t\t\t? processes\n\t\t\t\t: [{ contract: 'None found', artifact: 'N/A' }]\n\t\t)\n\t\t.then(promises => Promise.all(promises));\n};\n\nexport const compile = (parsedArgs: Opts): Promise<PluginResponse> => {\n\tconst p = parsedArgs.sourceFile\n\t\t? compileContract(parsedArgs)(parsedArgs.sourceFile as string)\n\t\t\t.then(result => [result])\n\t\t: compileAll(parsedArgs)\n\t\t\t.then(results => {\n\t\t\t\tif (results.length === 0) sendErr('No contracts found to compile.');\n\t\t\t\treturn results;\n\t\t\t});\n\n\treturn p\n\t\t.then(sendJsonRes)\n\t\t.catch(err => sendAsyncErr(err, false));\n};\n\nexport default compile;\n"],"names":[],"version":3,"file":"index.js.map","sourceRoot":"../"}
|
package/index.ts
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import {Plugin, Task
|
|
2
|
-
import compile from './compile'
|
|
1
|
+
import { Option, Plugin, Task } from '@taqueria/node-sdk';
|
|
2
|
+
import compile from './compile';
|
|
3
3
|
|
|
4
4
|
Plugin.create(i18n => ({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}),
|
|
5
|
+
schema: '1.0',
|
|
6
|
+
version: '0.1',
|
|
7
|
+
alias: 'ligo',
|
|
8
|
+
tasks: [
|
|
9
|
+
Task.create({
|
|
10
|
+
task: 'compile',
|
|
11
|
+
command: 'compile [sourceFile]',
|
|
12
|
+
aliases: ['c', 'compile-ligo'],
|
|
13
|
+
description: 'Compile a smart contract written in a Ligo syntax to Michelson code',
|
|
14
|
+
options: [
|
|
15
|
+
Option.create({
|
|
16
|
+
shortFlag: 'e',
|
|
17
|
+
flag: 'entrypoint',
|
|
18
|
+
description: 'The entry point that will be compiled',
|
|
19
|
+
}),
|
|
20
|
+
Option.create({
|
|
21
|
+
shortFlag: 's',
|
|
22
|
+
flag: 'syntax',
|
|
23
|
+
description: 'The syntax used in the contract',
|
|
24
|
+
}),
|
|
25
|
+
Option.create({
|
|
26
|
+
shortFlag: 'i',
|
|
27
|
+
flag: 'infer',
|
|
28
|
+
description: 'Enable type inference',
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
handler: 'proxy',
|
|
32
|
+
encoding: 'json',
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
checkRuntimeDependencies: () =>
|
|
36
|
+
Promise.resolve({
|
|
37
|
+
status: 'success',
|
|
38
|
+
report: [
|
|
39
|
+
{ name: 'LIGO', path: 'ligo', version: '>=0.27.0', kind: 'required', met: true },
|
|
40
|
+
],
|
|
41
|
+
}),
|
|
42
|
+
installRunTimeDependencies: () =>
|
|
43
|
+
Promise.resolve({
|
|
44
|
+
status: 'success',
|
|
45
|
+
output: 'LIGO was found in /usr/bin/ligo', // TODO this should use i18n
|
|
46
|
+
}),
|
|
47
|
+
proxy: compile,
|
|
48
|
+
}), process.argv);
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
"name": "@taqueria/plugin-ligo",
|
|
3
|
+
"version": "0.4.0-rc3",
|
|
4
|
+
"description": "A taqueria plugin for compiling LIGO smart contracts",
|
|
5
|
+
"targets": {
|
|
6
|
+
"default": {
|
|
7
|
+
"source": "./index.ts",
|
|
8
|
+
"distDir": "./",
|
|
9
|
+
"context": "node",
|
|
10
|
+
"isLibrary": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
15
|
+
"build": "npx tsc -noEmit && npx parcel build --no-cache 2>&1",
|
|
16
|
+
"pluginInfo": "npx ts-node index.ts --taqRun pluginInfo --i18n '{\"foo\":\"bar\"}' --config '{\"contractsDir\":\"contracts\",\"testsDir\": \"tests\",\"artifactsDir\": \"artifacts\"}' --projectDir ../test-project --configDir ./.taq",
|
|
17
|
+
"compile": "npx ts-node index.ts --taqRun proxy --task compile --i18n '{\"foo\":\"bar\"}' --config '{\"contractsDir\":\"contracts\",\"testsDir\": \"tests\",\"artifactsDir\": \"artifacts\"}' --projectDir ../test-project --configDir ./.taq",
|
|
18
|
+
"debugPluginInfo": "npx ts-node --inspect index.ts --taqRun pluginInfo --i18n '{\"foo\":\"bar\"}' --config '{\"contractsDir\":\"contracts\",\"testsDir\": \"tests\"}' --projectDir ../test-project --configDir ./.taq"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"taqueria",
|
|
22
|
+
"tezos",
|
|
23
|
+
"build",
|
|
24
|
+
"ecad",
|
|
25
|
+
"ecadlabs",
|
|
26
|
+
"plugin",
|
|
27
|
+
"ligo",
|
|
28
|
+
"ligolang",
|
|
29
|
+
"smart contract",
|
|
30
|
+
"compile"
|
|
31
|
+
],
|
|
32
|
+
"author": "ECAD Labs",
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/ecadlabs/taqueria.git",
|
|
37
|
+
"directory": "taqueria-plugin-ligo"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/ecadlabs/taqueria/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/ecadlabs/taqueria#readme",
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@taqueria/node-sdk": "^0.4.0",
|
|
45
|
+
"fast-glob": "^3.2.11"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"parcel": "^2.6.0",
|
|
49
|
+
"typescript": "^4.7.2"
|
|
50
|
+
}
|
|
51
51
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Enable incremental compilation */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "ES2021", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
+
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
|
20
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
|
22
|
+
// "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */
|
|
23
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
/* Modules */
|
|
27
|
+
"module": "CommonJS", /* Specify what module code is generated. */
|
|
28
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
29
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
30
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
31
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
32
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
33
|
+
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
|
34
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
35
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
36
|
+
// "resolveJsonModule": true, /* Enable importing .json files */
|
|
37
|
+
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
/* JavaScript Support */
|
|
40
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
|
|
41
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
42
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
44
|
+
/* Emit */
|
|
45
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
46
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
47
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
48
|
+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
49
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
50
|
+
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
51
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
52
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
53
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
54
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
|
|
55
|
+
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
56
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
57
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
58
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
59
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
60
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
61
|
+
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
62
|
+
// "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */
|
|
63
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */
|
|
64
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
65
|
+
// "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */
|
|
66
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
67
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
/* Interop Constraints */
|
|
70
|
+
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
71
|
+
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
72
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */
|
|
73
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
74
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
/* Type Checking */
|
|
77
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
78
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
|
79
|
+
// "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
|
80
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
81
|
+
// "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
|
82
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
83
|
+
// "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
|
84
|
+
// "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
|
85
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
86
|
+
// "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
|
87
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
|
88
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
89
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
90
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
91
|
+
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
|
92
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
93
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
|
94
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
95
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
/* Completeness */
|
|
98
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
99
|
+
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
100
|
+
}
|
|
101
101
|
}
|