@taqueria/plugin-octez-client 0.56.15 → 0.57.9
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/index.d.mts +2 -0
- package/index.js +7 -14
- package/index.js.map +1 -1
- package/index.mjs +7 -14
- package/index.mjs.map +1 -1
- package/package.json +67 -67
- package/tsconfig.json +6 -1
package/index.d.mts
ADDED
package/index.js
CHANGED
|
@@ -45,8 +45,7 @@ var trimTezosClientMenuIfPresent = (msg) => {
|
|
|
45
45
|
var getInputFilename = (opts, sourceFile) => (0, import_path.join)("/project", opts.config.artifactsDir ?? "artifacts", sourceFile);
|
|
46
46
|
var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
|
|
47
47
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
48
|
-
if (!projectDir)
|
|
49
|
-
throw `No project directory provided`;
|
|
48
|
+
if (!projectDir) throw `No project directory provided`;
|
|
50
49
|
const arch = (0, import_node_sdk.getArchSync)();
|
|
51
50
|
const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;
|
|
52
51
|
const inputFile = getInputFilename(parsedArgs, sourceFile);
|
|
@@ -57,8 +56,7 @@ var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
|
|
|
57
56
|
// client.ts
|
|
58
57
|
var getArbitraryClientCmd = async (parsedArgs, userArgs) => {
|
|
59
58
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
60
|
-
if (!projectDir)
|
|
61
|
-
throw `No project directory provided`;
|
|
59
|
+
if (!projectDir) throw `No project directory provided`;
|
|
62
60
|
const arch = await (0, import_node_sdk2.getArch)();
|
|
63
61
|
const flextesaImage = getClientDockerImage();
|
|
64
62
|
const binary = "docker";
|
|
@@ -105,8 +103,7 @@ var getDefaultStorageFilename = (contractName) => {
|
|
|
105
103
|
var getSimulateCmd = async (parsedArgs, sourceFile) => {
|
|
106
104
|
var _a;
|
|
107
105
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
108
|
-
if (!projectDir)
|
|
109
|
-
throw `No project directory provided`;
|
|
106
|
+
if (!projectDir) throw `No project directory provided`;
|
|
110
107
|
const storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);
|
|
111
108
|
const storage = (_a = await (0, import_node_sdk3.getContractContent)(parsedArgs, storageFilename)) == null ? void 0 : _a.trim();
|
|
112
109
|
if (storage === void 0) {
|
|
@@ -131,8 +128,7 @@ You can also manually pass a storage file to the simulate task using the --stora
|
|
|
131
128
|
};
|
|
132
129
|
var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(import_node_sdk3.execCmd).then(
|
|
133
130
|
() => retrySimulateCmd(parsedArgs, sourceFile, 0).then(({ stdout, stderr }) => {
|
|
134
|
-
if (stderr.length > 0)
|
|
135
|
-
(0, import_node_sdk3.sendWarn)(`
|
|
131
|
+
if (stderr.length > 0) (0, import_node_sdk3.sendWarn)(`
|
|
136
132
|
${stderr}`);
|
|
137
133
|
return {
|
|
138
134
|
contract: sourceFile,
|
|
@@ -181,8 +177,7 @@ var simulate_default = simulate;
|
|
|
181
177
|
var import_node_sdk4 = require("@taqueria/node-sdk");
|
|
182
178
|
var getTypecheckCmd = async (parsedArgs, sourceFile) => {
|
|
183
179
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
184
|
-
if (!projectDir)
|
|
185
|
-
throw `No project directory provided`;
|
|
180
|
+
if (!projectDir) throw `No project directory provided`;
|
|
186
181
|
const arch = await (0, import_node_sdk4.getArch)();
|
|
187
182
|
const flextesaImage = getClientDockerImage();
|
|
188
183
|
const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${flextesaImage}`;
|
|
@@ -192,8 +187,7 @@ var getTypecheckCmd = async (parsedArgs, sourceFile) => {
|
|
|
192
187
|
};
|
|
193
188
|
var typecheckContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(import_node_sdk4.execCmd).then(
|
|
194
189
|
() => getTypecheckCmd(parsedArgs, sourceFile).then(import_node_sdk4.execCmd).then(({ stderr }) => {
|
|
195
|
-
if (stderr.length > 0)
|
|
196
|
-
(0, import_node_sdk4.sendWarn)(stderr);
|
|
190
|
+
if (stderr.length > 0) (0, import_node_sdk4.sendWarn)(stderr);
|
|
197
191
|
return {
|
|
198
192
|
contract: sourceFile,
|
|
199
193
|
result: "Valid"
|
|
@@ -236,8 +230,7 @@ var compileAll = async (parsedArgs) => {
|
|
|
236
230
|
{ cwd: (0, import_path3.join)(parsedArgs.config.projectDir, (0, import_node_sdk5.getArtifactsDir)(parsedArgs)), absolute: false }
|
|
237
231
|
);
|
|
238
232
|
for (const filename of contractFilenames) {
|
|
239
|
-
if ((0, import_node_sdk5.isContractFile)(filename))
|
|
240
|
-
p.push(typecheckContract(parsedArgs, filename));
|
|
233
|
+
if ((0, import_node_sdk5.isContractFile)(filename)) p.push(typecheckContract(parsedArgs, filename));
|
|
241
234
|
}
|
|
242
235
|
return Promise.all(p).then(import_node_sdk5.sendJsonRes).catch((err) => (0, import_node_sdk5.sendAsyncErr)(err, false));
|
|
243
236
|
};
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Need to talk to ECAD Labs about how to suppress warnings\n// https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonR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,sBAAK,OAAO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS,CAAC,KAAK;AAAA,MACf,aAAa;AAAA,MACb,SAAS;AAAA,QACR,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,QACD,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,QACD,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,MACF;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA,QACZ,+BAAc,OAAO;AAAA,UACpB,aAAa;AAAA,UACb,aAAa;AAAA,QACd,CAAC;AAAA,MACF;AAAA,MACA,UAAU;AAAA,IACX,CAAC;AAAA,IACD,sBAAK,OAAO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["import_node_sdk","import_node_sdk","import_node_sdk","cmd","import_node_sdk","import_path","import_node_sdk","import_node_sdk","import_path","glob"]}
|
|
1
|
+
{"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Need to talk to ECAD Labs about how to suppress warnings\n// https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => send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AO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,SAAS,CAAC,KAAK;AAAA,MACf,aAAa;AAAA,MACb,SAAS;AAAA,QACR,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,QACD,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,QACD,wBAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,MACF;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA,QACZ,+BAAc,OAAO;AAAA,UACpB,aAAa;AAAA,UACb,aAAa;AAAA,QACd,CAAC;AAAA,MACF;AAAA,MACA,UAAU;AAAA,IACX,CAAC;AAAA,IACD,sBAAK,OAAO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["import_node_sdk","import_node_sdk","import_node_sdk","cmd","import_node_sdk","import_path","import_node_sdk","import_node_sdk","import_path","glob"]}
|
package/index.mjs
CHANGED
|
@@ -21,8 +21,7 @@ var trimTezosClientMenuIfPresent = (msg) => {
|
|
|
21
21
|
var getInputFilename = (opts, sourceFile) => join("/project", opts.config.artifactsDir ?? "artifacts", sourceFile);
|
|
22
22
|
var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
|
|
23
23
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
24
|
-
if (!projectDir)
|
|
25
|
-
throw `No project directory provided`;
|
|
24
|
+
if (!projectDir) throw `No project directory provided`;
|
|
26
25
|
const arch = getArchSync();
|
|
27
26
|
const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;
|
|
28
27
|
const inputFile = getInputFilename(parsedArgs, sourceFile);
|
|
@@ -33,8 +32,7 @@ var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
|
|
|
33
32
|
// client.ts
|
|
34
33
|
var getArbitraryClientCmd = async (parsedArgs, userArgs) => {
|
|
35
34
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
36
|
-
if (!projectDir)
|
|
37
|
-
throw `No project directory provided`;
|
|
35
|
+
if (!projectDir) throw `No project directory provided`;
|
|
38
36
|
const arch = await getArch();
|
|
39
37
|
const flextesaImage = getClientDockerImage();
|
|
40
38
|
const binary = "docker";
|
|
@@ -91,8 +89,7 @@ var getDefaultStorageFilename = (contractName) => {
|
|
|
91
89
|
var getSimulateCmd = async (parsedArgs, sourceFile) => {
|
|
92
90
|
var _a;
|
|
93
91
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
94
|
-
if (!projectDir)
|
|
95
|
-
throw `No project directory provided`;
|
|
92
|
+
if (!projectDir) throw `No project directory provided`;
|
|
96
93
|
const storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);
|
|
97
94
|
const storage = (_a = await getContractContent(parsedArgs, storageFilename)) == null ? void 0 : _a.trim();
|
|
98
95
|
if (storage === void 0) {
|
|
@@ -117,8 +114,7 @@ You can also manually pass a storage file to the simulate task using the --stora
|
|
|
117
114
|
};
|
|
118
115
|
var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(execCmd).then(
|
|
119
116
|
() => retrySimulateCmd(parsedArgs, sourceFile, 0).then(({ stdout, stderr }) => {
|
|
120
|
-
if (stderr.length > 0)
|
|
121
|
-
sendWarn(`
|
|
117
|
+
if (stderr.length > 0) sendWarn(`
|
|
122
118
|
${stderr}`);
|
|
123
119
|
return {
|
|
124
120
|
contract: sourceFile,
|
|
@@ -175,8 +171,7 @@ import {
|
|
|
175
171
|
} from "@taqueria/node-sdk";
|
|
176
172
|
var getTypecheckCmd = async (parsedArgs, sourceFile) => {
|
|
177
173
|
const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
|
|
178
|
-
if (!projectDir)
|
|
179
|
-
throw `No project directory provided`;
|
|
174
|
+
if (!projectDir) throw `No project directory provided`;
|
|
180
175
|
const arch = await getArch3();
|
|
181
176
|
const flextesaImage = getClientDockerImage();
|
|
182
177
|
const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${flextesaImage}`;
|
|
@@ -186,8 +181,7 @@ var getTypecheckCmd = async (parsedArgs, sourceFile) => {
|
|
|
186
181
|
};
|
|
187
182
|
var typecheckContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(execCmd2).then(
|
|
188
183
|
() => getTypecheckCmd(parsedArgs, sourceFile).then(execCmd2).then(({ stderr }) => {
|
|
189
|
-
if (stderr.length > 0)
|
|
190
|
-
sendWarn2(stderr);
|
|
184
|
+
if (stderr.length > 0) sendWarn2(stderr);
|
|
191
185
|
return {
|
|
192
186
|
contract: sourceFile,
|
|
193
187
|
result: "Valid"
|
|
@@ -230,8 +224,7 @@ var compileAll = async (parsedArgs) => {
|
|
|
230
224
|
{ cwd: join2(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false }
|
|
231
225
|
);
|
|
232
226
|
for (const filename of contractFilenames) {
|
|
233
|
-
if (isContractFile(filename))
|
|
234
|
-
p.push(typecheckContract(parsedArgs, filename));
|
|
227
|
+
if (isContractFile(filename)) p.push(typecheckContract(parsedArgs, filename));
|
|
235
228
|
}
|
|
236
229
|
return Promise.all(p).then(sendJsonRes3).catch((err) => sendAsyncErr4(err, false));
|
|
237
230
|
};
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Need to talk to ECAD Labs about how to suppress warnings\n// https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";AAAA,SAAS,QAAQ,QAAQ,eAAe,YAAY;;;ACApD,SAAsB,gBAAAA,eAAc,oBAAoB;;;ACAxD,SAAS,SAAS,cAAc,SAAS,gBAAgB;;;ACAzD,SAAS,aAAa,sBAAkD;AACxE,SAAS,YAAY;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,MACnC,eAAe,iBAAiB,YAAY,CAAC,GAAG,0BAA0B;AA0B3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IAAM,mBAAmB,CAAC,MAAiB,eACjD,KAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa,UAAU;AAE9D,IAAM,+BAA+B,OAAO,YAAuB,eAAwC;AACjH,QAAM,aAAa,QAAQ,IAAI,eAAe,WAAW;AACzD,MAAI,CAAC;AAAY,UAAM;AACvB,QAAM,OAAO,YAAY;AACzB,QAAM,UACL,uBAAwB,UAAU,qCAAsC,IAAI,IAAI,qBAAqB,CAAC;AACvG,QAAM,YAAY,iBAAiB,YAAY,UAAU;AACzD,QAAM,MAAM,GAAG,OAAO,IAAI,SAAS;AACnC,SAAO;AACR;;;ADnDA,IAAM,wBAAwB,OAC7B,YACA,aAC+C;AAC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;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["sendAsyncErr","cmd","getArch","sendAsyncErr","getArch","sendAsyncErr","addTzExtensionIfMissing","execCmd","getArch","sendAsyncErr","sendErr","sendJsonRes","sendWarn","getArch","execCmd","sendWarn","sendErr","addTzExtensionIfMissing","sendJsonRes","sendAsyncErr","sendAsyncErr","sendJsonRes","join","join","sendJsonRes","sendAsyncErr","sendAsyncErr"]}
|
|
1
|
+
{"version":3,"sources":["index.ts","main.ts","client.ts","common.ts","simulate.ts","typecheck.ts","typecheckAll.ts"],"sourcesContent":["import { Option, Plugin, PositionalArg, Task } from '@taqueria/node-sdk';\nimport main from './main';\n\nPlugin.create(i18n => ({\n\talias: 'tezos-client',\n\tschema: '1.0',\n\tversion: '0.1',\n\ttasks: [\n\t\tTask.create({\n\t\t\ttask: 'client',\n\t\t\tcommand: 'client',\n\t\t\tdescription:\n\t\t\t\t'This task allows you to run arbitrary octez-client native commands. Note that they might not benefit from the abstractions provided by Taqueria',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tshortFlag: 'c',\n\t\t\t\t\tflag: 'command',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdescription: 'The command to be passed to the underlying octez-client binary, wrapped in quotes',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'none',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck',\n\t\t\tcommand: 'typecheck <sourceFile>',\n\t\t\taliases: ['tc'],\n\t\t\tdescription: 'Typecheck a Michelson contract',\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to typecheck',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'typecheck-all',\n\t\t\tcommand: 'typecheck-all',\n\t\t\tdescription: 'Typecheck all Michelson contracts in the artifacts directory',\n\t\t\thandler: 'proxy',\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'simulate',\n\t\t\tcommand: 'simulate <sourceFile>',\n\t\t\taliases: ['sim'],\n\t\t\tdescription: 'Run a Michelson contract as a simulation',\n\t\t\toptions: [\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'storage',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the storage file that contains the storage value as a Michelson expression, in the artifacts directory, used for originating a contract',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'param',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Name of the parameter file that contains the parameter value as a Michelson expression, in the artifacts directory, used for invoking a deployed contract',\n\t\t\t\t\trequired: true,\n\t\t\t\t}),\n\t\t\t\tOption.create({\n\t\t\t\t\tflag: 'entrypoint',\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'You may explicitly specify an entrypoint to make the parameter value shorter, without having to specify a chain of (Left (Right ... 14 ...))',\n\t\t\t\t\trequired: false,\n\t\t\t\t}),\n\t\t\t],\n\t\t\thandler: 'proxy',\n\t\t\tpositionals: [\n\t\t\t\tPositionalArg.create({\n\t\t\t\t\tplaceholder: 'sourceFile',\n\t\t\t\t\tdescription: 'The name of the Michelson contract you wish to simulate',\n\t\t\t\t}),\n\t\t\t],\n\t\t\tencoding: 'json',\n\t\t}),\n\t\tTask.create({\n\t\t\ttask: 'get-image',\n\t\t\tcommand: 'get-image',\n\t\t\tdescription: 'Gets the name of the image to be used',\n\t\t\thandler: 'proxy',\n\t\t\thidden: true,\n\t\t}),\n\t],\n\tproxy: main,\n}), process.argv);\n","import { RequestArgs, sendAsyncErr, sendAsyncRes } from '@taqueria/node-sdk';\nimport client from './client';\nimport { getClientDockerImage, IntersectionOpts as Opts } from './common';\nimport simulate from './simulate';\nimport typecheck from './typecheck';\nimport typecheckAll from './typecheckAll';\n\nconst main = (parsedArgs: RequestArgs.t): Promise<void> => {\n\tconst unsafeOpts = parsedArgs as unknown as Opts;\n\tswitch (unsafeOpts.task) {\n\t\tcase 'client':\n\t\t\treturn client(unsafeOpts);\n\t\tcase 'typecheck':\n\t\t\treturn typecheck(unsafeOpts);\n\t\tcase 'typecheck-all':\n\t\t\treturn typecheckAll(unsafeOpts);\n\t\tcase 'simulate':\n\t\t\treturn simulate(unsafeOpts);\n\t\tcase 'get-image':\n\t\t\treturn sendAsyncRes(getClientDockerImage());\n\t\tdefault:\n\t\t\treturn sendAsyncErr(`${unsafeOpts.task} is not an understood task by the Tezos-client plugin`);\n\t}\n};\n\nexport default main;\n","import { getArch, sendAsyncErr, sendRes, spawnCmd } from '@taqueria/node-sdk';\nimport { ClientOpts as Opts, getClientDockerImage } from './common';\n\nconst getArbitraryClientCmd = async (\n\tparsedArgs: Opts,\n\tuserArgs: string,\n): Promise<[string, Record<string, string>]> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst binary = 'docker';\n\tconst baseArgs = [\n\t\t'run',\n\t\t'--rm',\n\t\t'-v',\n\t\t`${projectDir}:/project`,\n\t\t'-w',\n\t\t'/project',\n\t\t'--platform',\n\t\tarch,\n\t\tflextesaImage,\n\t\t'octez-client',\n\t];\n\tconst processedUserArgs = userArgs.split(' ').map(arg => arg.startsWith('\\\\-') ? arg.substring(1) : arg).filter(arg =>\n\t\targ\n\t);\n\tconst args = baseArgs.concat(processedUserArgs);\n\tconst envVars = {};\n\treturn [\n\t\t[binary, ...args].join(' '),\n\t\tenvVars,\n\t];\n};\n\nconst runArbitraryClientCmd = (parsedArgs: Opts, cmd: string): Promise<string> =>\n\tgetArbitraryClientCmd(parsedArgs, cmd)\n\t\t.then(([cmd, envVars]) => spawnCmd(cmd, envVars))\n\t\t.then(code =>\n\t\t\tcode !== null && code === 0\n\t\t\t\t? `Command \"${cmd}\" ran successfully by octez-client`\n\t\t\t\t: `Command \"${cmd}\" failed. Please check your command`\n\t\t)\n\t\t.catch(err => sendAsyncErr(`An internal error has occurred: ${err.message}`));\n\nconst client = (parsedArgs: Opts): Promise<void> => {\n\tconst args = parsedArgs.command;\n\treturn runArbitraryClientCmd(parsedArgs, args).then(sendRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default client;\n","import { getArchSync, getDockerImage, ProxyTaskArgs, RequestArgs } from '@taqueria/node-sdk';\nimport { join } from 'path';\n\n// Should point to the latest stable version, so it needs to be updated as part of our release process.\nconst getFlextesaImage = (_arch: 'linux/arm64/v8' | 'linux/amd64'): string => 'tezos/tezos:octez-v20.2';\n\nconst OCTEZ_CLIENT_IMAGE_ENV_VAR = 'TAQ_OCTEZ_CLIENT_IMAGE';\n\nexport const getClientDockerImage = (): string =>\n\tgetDockerImage(getFlextesaImage(getArchSync()), OCTEZ_CLIENT_IMAGE_ENV_VAR);\n\nexport interface ClientOpts extends ProxyTaskArgs.t {\n\tcommand: string;\n}\n\nexport interface TypeCheckOpts extends ProxyTaskArgs.t {\n\tsourceFile: string;\n}\n\nexport interface TypeCheckAllOpts extends ProxyTaskArgs.t {\n}\n\nexport interface SimulateOpts extends ProxyTaskArgs.t {\n\tsourceFile?: string;\n\tstorage?: string;\n\tparam?: string;\n\tentrypoint?: string;\n}\n\nexport type IntersectionOpts = ClientOpts & TypeCheckOpts & TypeCheckAllOpts & SimulateOpts;\n\ntype UnionOpts = ClientOpts | TypeCheckOpts | TypeCheckAllOpts | SimulateOpts;\n\n// Need to talk to ECAD Labs about how to suppress warnings\n// https://github.com/TezosTaqueria/taqueria/actions/runs/10102868947/job/27961869044\nconst ENDPOINT = process.env['TAQ_TEZOS_CLIENT_RPC'] ?? 'https://ghostnet.smartpy.io';\nexport const GLOBAL_OPTIONS = `--endpoint ${ENDPOINT}`;\n\nexport const trimTezosClientMenuIfPresent = (msg: string): string => {\n\treturn msg.replace(/Usage:(.|\\n)+/, '');\n};\n\nexport const getInputFilename = (opts: UnionOpts, sourceFile: string) =>\n\tjoin('/project', opts.config.artifactsDir ?? 'artifacts', sourceFile);\n\nexport const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = getArchSync();\n\tconst baseCmd =\n\t\t`docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} ${inputFile}`;\n\treturn cmd;\n};\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tgetContractContent,\n\tgetParameter,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport { basename, extname } from 'path';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\tSimulateOpts as Opts,\n\ttrimTezosClientMenuIfPresent,\n} from './common';\n\ntype TableRow = { contract: string; result: string };\n\n// This is needed mostly due to the fact that execCmd() wraps the command in double quotes\nconst preprocessString = (value: string): string => {\n\t// 1. if the string contains escaped double quotes, escape them further\n\tvalue = value.replace(/\\\\\"/g, '\\\\\\\\\\\\\"');\n\t// 2. if the string contains unescaped double quotes, escape them\n\tvalue = value.replace(/(?<!\\\\)\"/g, '\\\\\"');\n\treturn value;\n};\n\nconst getDefaultStorageFilename = (contractName: string): string => {\n\tconst baseFilename = basename(contractName, extname(contractName));\n\tconst extFilename = extname(contractName);\n\tconst defaultStorage = `${baseFilename}.default_storage${extFilename}`;\n\treturn defaultStorage;\n};\n\nconst getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\n\tconst storageFilename = parsedArgs.storage ?? getDefaultStorageFilename(sourceFile);\n\tconst storage = (await getContractContent(parsedArgs, storageFilename))?.trim();\n\n\tif (storage === undefined) {\n\t\treturn Promise.reject(\n\t\t\tnew Error(\n\t\t\t\t`❌ No initial storage file was found for ${sourceFile}\\nStorage must be specified in a file as a Michelson expression and will automatically be linked to this contract if specified with the name \"${\n\t\t\t\t\tgetDefaultStorageFilename(sourceFile)\n\t\t\t\t}\" in the artifacts directory\\nYou can also manually pass a storage file to the simulate task using the --storage STORAGE_FILE_NAME option\\n`,\n\t\t\t),\n\t\t);\n\t}\n\n\tconst paramFilename = parsedArgs.param!;\n\tconst param = (await getParameter(parsedArgs, paramFilename)).trim();\n\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst entrypoint = parsedArgs.entrypoint ? `--entrypoint ${parsedArgs.entrypoint}` : '';\n\n\tconst cmd =\n\t\t`${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage \\'${storage}\\' and input \\'${param}\\' ${entrypoint}`;\n\treturn cmd;\n};\n\nconst simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tretrySimulateCmd(parsedArgs, sourceFile, 0)\n\t\t\t\t.then(({ stdout, stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(`\\n${stderr}`);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: stdout,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst retrySimulateCmd = (\n\tparsedArgs: Opts,\n\tsourceFile: string,\n\tretryCount: number,\n): Promise<{ stdout: string; stderr: string }> => {\n\tconst max_retries = 3;\n\tconst relay_delay_ms = 1000;\n\treturn getSimulateCmd(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.catch(err => {\n\t\t\tif (retryCount < max_retries && err.stderr.includes('503 Service Temporarily')) {\n\t\t\t\tconst delay = relay_delay_ms * Math.pow(2, retryCount);\n\t\t\t\treturn new Promise(resolve => setTimeout(resolve, delay))\n\t\t\t\t\t.then(() => retrySimulateCmd(parsedArgs, sourceFile, retryCount + 1));\n\t\t\t} else {\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t});\n};\n\nconst simulate = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile!);\n\treturn simulateContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default simulate;\n","import {\n\taddTzExtensionIfMissing,\n\texecCmd,\n\tgetArch,\n\tsendAsyncErr,\n\tsendErr,\n\tsendJsonRes,\n\tsendWarn,\n} from '@taqueria/node-sdk';\nimport {\n\tgetCheckFileExistenceCommand,\n\tgetClientDockerImage,\n\tgetInputFilename,\n\tGLOBAL_OPTIONS,\n\ttrimTezosClientMenuIfPresent,\n\tTypeCheckOpts as Opts,\n} from './common';\n\nexport type TableRow = { contract: string; result: string };\n\nconst getTypecheckCmd = async (parsedArgs: Opts, sourceFile: string): Promise<string> => {\n\tconst projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;\n\tif (!projectDir) throw `No project directory provided`;\n\tconst arch = await getArch();\n\tconst flextesaImage = getClientDockerImage();\n\tconst baseCmd = `docker run --rm -v \\\"${projectDir}\\\":/project -w /project --platform ${arch} ${flextesaImage}`;\n\tconst inputFile = getInputFilename(parsedArgs, sourceFile);\n\tconst cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} typecheck script ${inputFile}`;\n\treturn cmd;\n};\n\nexport const typecheckContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>\n\tgetCheckFileExistenceCommand(parsedArgs, sourceFile)\n\t\t.then(execCmd)\n\t\t.then(() =>\n\t\t\tgetTypecheckCmd(parsedArgs, sourceFile)\n\t\t\t\t.then(execCmd)\n\t\t\t\t.then(({ stderr }) => {\n\t\t\t\t\tif (stderr.length > 0) sendWarn(stderr);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Valid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\t\t\tconst msg: string = trimTezosClientMenuIfPresent(err.message);\n\t\t\t\t\tsendErr(msg.replace(/Command failed.+?\\n/, ''));\n\t\t\t\t\treturn {\n\t\t\t\t\t\tcontract: sourceFile,\n\t\t\t\t\t\tresult: 'Invalid',\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t)\n\t\t.catch(err => {\n\t\t\tsendErr(`\\n=== For ${sourceFile} ===`);\n\t\t\tsendErr(err.message.replace(/Command failed.+?\\n/, ''));\n\t\t\treturn {\n\t\t\t\tcontract: sourceFile,\n\t\t\t\tresult: 'N/A',\n\t\t\t};\n\t\t});\n\nconst typecheck = (parsedArgs: Opts): Promise<void> => {\n\tconst sourceFile = addTzExtensionIfMissing(parsedArgs.sourceFile);\n\treturn typecheckContract(parsedArgs, sourceFile).then(result => [result]).then(sendJsonRes).catch(err =>\n\t\tsendAsyncErr(err, false)\n\t);\n};\n\nexport default typecheck;\n","import { getArtifactsDir, isContractFile, sendAsyncErr, sendJsonRes } from '@taqueria/node-sdk';\nimport glob from 'fast-glob';\nimport { join } from 'path';\nimport { TypeCheckAllOpts as Opts, TypeCheckOpts } from './common';\nimport { TableRow, typecheckContract } from './typecheck';\n\nconst compileAll = async (parsedArgs: Opts): Promise<void> => {\n\tlet p: Promise<TableRow>[] = [];\n\n\tconst contractFilenames = await glob(\n\t\t['**/*.tz'],\n\t\t{ cwd: join(parsedArgs.config.projectDir, getArtifactsDir(parsedArgs)), absolute: false },\n\t);\n\n\tfor (const filename of contractFilenames) {\n\t\tif (isContractFile(filename)) p.push(typecheckContract(parsedArgs as TypeCheckOpts, filename));\n\t}\n\n\treturn Promise.all(p).then(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";AAAA,SAAS,QAAQ,QAAQ,eAAe,YAAY;;;ACApD,SAAsB,gBAAAA,eAAc,oBAAoB;;;ACAxD,SAAS,SAAS,cAAc,SAAS,gBAAgB;;;ACAzD,SAAS,aAAa,sBAAkD;AACxE,SAAS,YAAY;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,MACnC,eAAe,iBAAiB,YAAY,CAAC,GAAG,0BAA0B;AA0B3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAAC,QAAwB;AACpE,SAAO,IAAI,QAAQ,iBAAiB,EAAE;AACvC;AAEO,IA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AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,QACD,OAAO,OAAO;AAAA,UACb,MAAM;AAAA,UACN,aACC;AAAA,UACD,UAAU;AAAA,QACX,CAAC;AAAA,MACF;AAAA,MACA,SAAS;AAAA,MACT,aAAa;AAAA,QACZ,cAAc,OAAO;AAAA,UACpB,aAAa;AAAA,UACb,aAAa;AAAA,QACd,CAAC;AAAA,MACF;AAAA,MACA,UAAU;AAAA,IACX,CAAC;AAAA,IACD,KAAK,OAAO;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,MACT,QAAQ;AAAA,IACT,CAAC;AAAA,EACF;AAAA,EACA,OAAO;AACR,IAAI,QAAQ,IAAI;","names":["sendAsyncErr","cmd","getArch","sendAsyncErr","getArch","sendAsyncErr","addTzExtensionIfMissing","execCmd","getArch","sendAsyncErr","sendErr","sendJsonRes","sendWarn","getArch","execCmd","sendWarn","sendErr","addTzExtensionIfMissing","sendJsonRes","sendAsyncErr","sendAsyncErr","sendJsonRes","join","join","sendJsonRes","sendAsyncErr","sendAsyncErr"]}
|
package/package.json
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
2
|
+
"name": "@taqueria/plugin-octez-client",
|
|
3
|
+
"version": "0.57.9",
|
|
4
|
+
"description": "A taqueria plugin for utilizing octez-client",
|
|
5
|
+
"targets": {
|
|
6
|
+
"default": {
|
|
7
|
+
"source": "./index.ts",
|
|
8
|
+
"distDir": "./",
|
|
9
|
+
"context": "node",
|
|
10
|
+
"isLibrary": true
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"taqueria",
|
|
15
|
+
"tezos",
|
|
16
|
+
"pinnaclelabs",
|
|
17
|
+
"pinnacle-labs",
|
|
18
|
+
"plugin",
|
|
19
|
+
"tezos-client",
|
|
20
|
+
"octez-client",
|
|
21
|
+
"typecheck",
|
|
22
|
+
"simulate"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=16"
|
|
26
|
+
},
|
|
27
|
+
"author": "Taqueria",
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/tezostaqueria/taqueria.git",
|
|
32
|
+
"directory": "taqueria-plugin-tezos-client"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/tezostaqueria/taqueria/issues"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/tezostaqueria/taqueria#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"fast-glob": "^3.3.2",
|
|
40
|
+
"@taqueria/node-sdk": "0.57.9"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.0.1",
|
|
44
|
+
"typescript": "^5.3.3"
|
|
45
|
+
},
|
|
46
|
+
"tsup": {
|
|
47
|
+
"entry": [
|
|
48
|
+
"index.ts"
|
|
49
|
+
],
|
|
50
|
+
"sourcemap": true,
|
|
51
|
+
"target": "node16",
|
|
52
|
+
"outDir": "./",
|
|
53
|
+
"dts": true,
|
|
54
|
+
"clean": false,
|
|
55
|
+
"skipNodeModulesBundle": true,
|
|
56
|
+
"platform": "node",
|
|
57
|
+
"format": [
|
|
58
|
+
"esm",
|
|
59
|
+
"cjs"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"gitHead": "ff58a2fc06ad233869ad6be574093c8b3b272e2e",
|
|
63
|
+
"scripts": {
|
|
64
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
65
|
+
"build": "npx tsc -noEmit -p ./tsconfig.json && npx tsup",
|
|
66
|
+
"pluginInfo": "npx ts-node index.ts --taqRun pluginInfo --i18n {\"foo:\"\"bar\"}"
|
|
67
|
+
}
|
|
68
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -99,5 +99,10 @@
|
|
|
99
99
|
/* Completeness */
|
|
100
100
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
101
101
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
102
|
-
}
|
|
102
|
+
},
|
|
103
|
+
"references": [
|
|
104
|
+
{
|
|
105
|
+
"path": "../taqueria-sdk"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
103
108
|
}
|