@taqueria/plugin-octez-client 0.62.0 → 0.62.1

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/common.ts CHANGED
@@ -48,7 +48,7 @@ export const getCheckFileExistenceCommand = async (parsedArgs: UnionOpts, source
48
48
  if (!projectDir) throw `No project directory provided`;
49
49
  const arch = getArchSync();
50
50
  const baseCmd =
51
- `docker run --rm -v \"${projectDir}\":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;
51
+ `docker run --rm -v \"${projectDir}\":/project -w /project --platform ${arch} --entrypoint /bin/ls ${getClientDockerImage()}`;
52
52
  const inputFile = getInputFilename(parsedArgs, sourceFile);
53
53
  const cmd = `${baseCmd} ${inputFile}`;
54
54
  return cmd;
package/index.js CHANGED
@@ -47,7 +47,7 @@ var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
47
47
  const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
48
48
  if (!projectDir) throw `No project directory provided`;
49
49
  const arch = (0, import_node_sdk.getArchSync)();
50
- const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;
50
+ const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} --entrypoint /bin/ls ${getClientDockerImage()}`;
51
51
  const inputFile = getInputFilename(parsedArgs, sourceFile);
52
52
  const cmd = `${baseCmd} ${inputFile}`;
53
53
  return cmd;
@@ -126,7 +126,11 @@ You can also manually pass a storage file to the simulate task using the --stora
126
126
  const cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage '${storage}' and input '${param}' ${entrypoint}`;
127
127
  return cmd;
128
128
  };
129
- var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(import_node_sdk3.execCmd).then(
129
+ var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(import_node_sdk3.execCmd).catch(
130
+ (_) => Promise.reject(
131
+ new Error(`${(0, import_node_sdk3.joinPaths)(parsedArgs.config.artifactsDir ?? "artifacts", sourceFile)} does not exist`)
132
+ )
133
+ ).then(
130
134
  () => retrySimulateCmd(parsedArgs, sourceFile, 0).then(({ stdout, stderr }) => {
131
135
  if (stderr.length > 0) (0, import_node_sdk3.sendWarn)(`
132
136
  ${stderr}`);
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(sendJsonRes).catch(err => sendAsyncErr(err, false));\n};\n\nexport default compileAll;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,mBAAoD;;;ACApD,IAAAC,mBAAwD;;;ACAxD,IAAAC,mBAAyD;;;ACAzD,sBAAwE;AACxE,kBAAqB;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,UACnC,gCAAe,qBAAiB,6BAAY,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,mBACjD,kBAAK,YAAY,KAAK,OAAO,gBAAgB,aAAa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D,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} --entrypoint /bin/ls ${getClientDockerImage()}`;\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\tjoinPaths,\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.catch(_ =>\n\t\t\tPromise.reject(\n\t\t\t\tnew Error(`${joinPaths(parsedArgs.config.artifactsDir ?? 'artifacts', sourceFile)} does not exist`),\n\t\t\t)\n\t\t)\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,IAAAA,mBAAoD;;;ACApD,IAAAC,mBAAwD;;;ACAxD,IAAAC,mBAAyD;;;ACAzD,sBAAwE;AACxE,kBAAqB;AAGrB,IAAM,mBAAmB,CAAC,UAAoD;AAE9E,IAAM,6BAA6B;AAE5B,IAAM,uBAAuB,UACnC,gCAAe,qBAAiB,6BAAY,CAAC,GAAG,0BAA0B;AA0B3E,IAAM,WAAW,QAAQ,IAAI,sBAAsB,KAAK;AACjD,IAAM,iBAAiB,cAAc,QAAQ;AAE7C,IAAM,+BAA+B,CAA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AC;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
@@ -23,7 +23,7 @@ var getCheckFileExistenceCommand = async (parsedArgs, sourceFile) => {
23
23
  const projectDir = process.env.PROJECT_DIR ?? parsedArgs.projectDir;
24
24
  if (!projectDir) throw `No project directory provided`;
25
25
  const arch = getArchSync();
26
- const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} ${getClientDockerImage()} ls`;
26
+ const baseCmd = `docker run --rm -v "${projectDir}":/project -w /project --platform ${arch} --entrypoint /bin/ls ${getClientDockerImage()}`;
27
27
  const inputFile = getInputFilename(parsedArgs, sourceFile);
28
28
  const cmd = `${baseCmd} ${inputFile}`;
29
29
  return cmd;
@@ -74,6 +74,7 @@ import {
74
74
  getArch as getArch2,
75
75
  getContractContent,
76
76
  getParameter,
77
+ joinPaths,
77
78
  sendAsyncErr as sendAsyncErr2,
78
79
  sendErr,
79
80
  sendJsonRes,
@@ -112,7 +113,11 @@ You can also manually pass a storage file to the simulate task using the --stora
112
113
  const cmd = `${baseCmd} octez-client ${GLOBAL_OPTIONS} run script ${inputFile} on storage '${storage}' and input '${param}' ${entrypoint}`;
113
114
  return cmd;
114
115
  };
115
- var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(execCmd).then(
116
+ var simulateContract = (parsedArgs, sourceFile) => getCheckFileExistenceCommand(parsedArgs, sourceFile).then(execCmd).catch(
117
+ (_) => Promise.reject(
118
+ new Error(`${joinPaths(parsedArgs.config.artifactsDir ?? "artifacts", sourceFile)} does not exist`)
119
+ )
120
+ ).then(
116
121
  () => retrySimulateCmd(parsedArgs, sourceFile, 0).then(({ stdout, stderr }) => {
117
122
  if (stderr.length > 0) sendWarn(`
118
123
  ${stderr}`);
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,IA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,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,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"]}
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} --entrypoint /bin/ls ${getClientDockerImage()}`;\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\tjoinPaths,\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.catch(_ =>\n\t\t\tPromise.reject(\n\t\t\t\tnew Error(`${joinPaths(parsedArgs.config.artifactsDir ?? 'artifacts', sourceFile)} does not exist`),\n\t\t\t)\n\t\t)\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,WAAY,OAAM;AACvB,QAAM,OAAO,YAAY;AACzB,QAAM,UACL,uBAAwB,UAAU,qCAAsC,IAAI,yBAAyB,qBAAqB,CAAC;AAC5H,QAAM,YAAY,iBAAiB,YAAY,UAAU;AACzD,QAAM,MAAM,GAAG,OAAO,IAAI,SAAS;AACnC,SAAO;AACR;;;ADnDA,IAAM,wBAAwB,OAC7B,YACA,aAC+C;AAC/C,QAAM,aAAa,QAAQ,IAAI,eAAe,WAAW;AACzD,MAAI,CAAC,WAAY,OAAM;AACvB,QAAM,OAAO,MAAM,QAAQ;AAC3B,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,SAAS;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,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,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqueria/plugin-octez-client",
3
- "version": "0.62.0",
3
+ "version": "0.62.1",
4
4
  "description": "A taqueria plugin for utilizing octez-client",
5
5
  "targets": {
6
6
  "default": {
@@ -37,7 +37,7 @@
37
37
  "homepage": "https://github.com/tezostaqueria/taqueria#readme",
38
38
  "dependencies": {
39
39
  "fast-glob": "^3.3.2",
40
- "@taqueria/node-sdk": "0.62.0"
40
+ "@taqueria/node-sdk": "0.62.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "tsup": "^8.0.1",
package/simulate.ts CHANGED
@@ -4,6 +4,7 @@ import {
4
4
  getArch,
5
5
  getContractContent,
6
6
  getParameter,
7
+ joinPaths,
7
8
  sendAsyncErr,
8
9
  sendErr,
9
10
  sendJsonRes,
@@ -71,6 +72,11 @@ const getSimulateCmd = async (parsedArgs: Opts, sourceFile: string): Promise<str
71
72
  const simulateContract = (parsedArgs: Opts, sourceFile: string): Promise<TableRow> =>
72
73
  getCheckFileExistenceCommand(parsedArgs, sourceFile)
73
74
  .then(execCmd)
75
+ .catch(_ =>
76
+ Promise.reject(
77
+ new Error(`${joinPaths(parsedArgs.config.artifactsDir ?? 'artifacts', sourceFile)} does not exist`),
78
+ )
79
+ )
74
80
  .then(() =>
75
81
  retrySimulateCmd(parsedArgs, sourceFile, 0)
76
82
  .then(({ stdout, stderr }) => {