@taqueria/plugin-archetype 0.4.2 → 0.5.3-rc1
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 +2 -5
- package/_readme.eta +2 -6
- package/compile.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@ The Archetype plugin provides a task to compile Archetype smart contracts (`.arl
|
|
|
6
6
|
|
|
7
7
|
## Requirements
|
|
8
8
|
|
|
9
|
-
- Node.js v16 or later
|
|
10
|
-
- Docker v0.8.
|
|
9
|
+
- Node.js v16.3 or later
|
|
10
|
+
- Docker v0.8.6 or later
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -16,9 +16,6 @@ To install the Archetype plugin on a Taqueria project, navigate to the project f
|
|
|
16
16
|
taq install @taqueria/plugin-archetype
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
> ### :page_with_curl: Note
|
|
20
|
-
> 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
|
|
21
|
-
|
|
22
19
|
## Configuration
|
|
23
20
|
|
|
24
21
|
No additional configuration is available
|
package/_readme.eta
CHANGED
|
@@ -8,8 +8,8 @@ The Archetype plugin provides a task to compile Archetype smart contracts (`.arl
|
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
11
|
-
- Node.js v16 or later
|
|
12
|
-
- Docker v0.8.
|
|
11
|
+
- Node.js v16.3 or later
|
|
12
|
+
- Docker v0.8.6 or later
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -18,10 +18,6 @@ To install the Archetype plugin on a Taqueria project, navigate to the project f
|
|
|
18
18
|
taq install @taqueria/plugin-archetype
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
<%~ it.noteOpenAdmonition %>
|
|
22
|
-
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
|
|
23
|
-
<%~ it.closeAdmonition %>
|
|
24
|
-
|
|
25
21
|
## Configuration
|
|
26
22
|
|
|
27
23
|
No additional configuration is available
|
package/compile.ts
CHANGED
|
@@ -25,7 +25,7 @@ const getCompileCommand = (opts: Opts) =>
|
|
|
25
25
|
const { projectDir } = opts;
|
|
26
26
|
const inputFile = getInputFilename(opts)(sourceFile);
|
|
27
27
|
const baseCommand =
|
|
28
|
-
`DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -w /project completium/archetype:1.2.12 ${inputFile}`;
|
|
28
|
+
`DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -u $(id -u):$(id -g) -w /project completium/archetype:1.2.12 ${inputFile}`;
|
|
29
29
|
const outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`;
|
|
30
30
|
const cmd = `${baseCommand} ${outFile}`;
|
|
31
31
|
return cmd;
|
package/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const $bb055a91efa18df7$var$getContractArtifactFilename = (opts)=>(sourceFile)=>
|
|
|
20
20
|
const $bb055a91efa18df7$var$getCompileCommand = (opts)=>(sourceFile)=>{
|
|
21
21
|
const { projectDir: projectDir } = opts;
|
|
22
22
|
const inputFile = $bb055a91efa18df7$var$getInputFilename(opts)(sourceFile);
|
|
23
|
-
const baseCommand = `DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -w /project completium/archetype:1.2.12 ${inputFile}`;
|
|
23
|
+
const baseCommand = `DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -v \"${projectDir}\":/project -u $(id -u):$(id -g) -w /project completium/archetype:1.2.12 ${inputFile}`;
|
|
24
24
|
const outFile = `-o ${$bb055a91efa18df7$var$getContractArtifactFilename(opts)(sourceFile)}`;
|
|
25
25
|
const cmd = `${baseCommand} ${outFile}`;
|
|
26
26
|
return cmd;
|
package/index.js.map
CHANGED
|
@@ -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,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,2CAA2C;aACnD,CAAC;QACH,KAAK,EAAE,CAAA,GAAA,wCAAO,CAAA;KACd,CAAA,AAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC","sources":["taqueria-plugin-archetype/index.ts","taqueria-plugin-archetype/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: 'archetype',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'compile',\n\t\t\tcommand: 'compile [sourceFile]',\n\t\t\taliases: ['c', 'compile-archetype'],\n\t\t\tdescription: 'Compile a smart contract written in a Archetype syntax to Michelson code',\n\t\t\toptions: [],\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: 'Archetype', path: 'archetype', version: '>=1.2.12', 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: 'Archetype was found in /usr/bin/archetype', // TODO this should use i18n\n\t\t}),\n\tproxy: compile,\n}), process.argv);\n","import { execCmd, sendAsyncErr, sendErr, sendJsonRes } from '@taqueria/node-sdk';\nimport { LikeAPromise, PluginResponse, RequestArgs, TaqError } from '@taqueria/node-sdk/types';\nimport glob from 'fast-glob';\nimport { readFile } from 'fs/promises';\nimport { basename, extname, join } from 'path';\n\ninterface Opts extends RequestArgs.t {\n\tsourceFile?: string;\n}\n\nconst getInputFilename = (opts: Opts) =>\n\t(sourceFile: string) => {\n\t\tconst inputFile = basename(sourceFile, extname(sourceFile));\n\t\treturn join(opts.config.contractsDir, `${inputFile}.arl`);\n\t};\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 getCompileCommand = (opts: Opts) =>\n\t(sourceFile: string) => {\n\t\tconst { projectDir } = opts;\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 -u $(id -u):$(id -g) -w /project completium/archetype:1.2.12 ${inputFile}`;\n\t\tconst outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`;\n\t\tconst cmd = `${baseCommand} ${outFile}`;\n\t\treturn cmd;\n\t};\n\nconst compileContract = (opts: Opts) =>\n\t(sourceFile: string): Promise<{ contract: string; artifact: string }> =>\n\t\t// const sourceAbspath = join(opts.contractsDir, sourceFile)\n\t\texecCmd(getCompileCommand(opts)(sourceFile))\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 = (opts: Opts): Promise<{ contract: string; artifact: string }[]> => {\n\t// TODO: Fetch list of files from SDK\n\treturn glob(\n\t\t['**/*.arl'],\n\t\t{ cwd: opts.config.contractsDir, absolute: false },\n\t)\n\t\t.then(entries => entries.map(compileContract(opts)))\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\nconst compile = <T>(parsedArgs: Opts): LikeAPromise<PluginResponse, TaqError.t> => {\n\tconst p = parsedArgs.sourceFile\n\t\t? compileContract(parsedArgs)(parsedArgs.sourceFile)\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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taqueria/plugin-archetype",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.3-rc1",
|
|
4
4
|
"description": "A taqueria plugin for compiling Archetype smart contracts",
|
|
5
5
|
"targets": {
|
|
6
6
|
"default": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/ecadlabs/taqueria#readme",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@taqueria/node-sdk": "^0.
|
|
43
|
+
"@taqueria/node-sdk": "^0.6.2",
|
|
44
44
|
"fast-glob": "^3.2.11"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|