movehat 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/__tests__/deployContract.test.d.ts +2 -0
- package/dist/__tests__/deployContract.test.d.ts.map +1 -0
- package/dist/__tests__/deployContract.test.js +368 -0
- package/dist/__tests__/deployContract.test.js.map +1 -0
- package/dist/__tests__/errors.test.d.ts +2 -0
- package/dist/__tests__/errors.test.d.ts.map +1 -0
- package/dist/__tests__/errors.test.js +46 -0
- package/dist/__tests__/errors.test.js.map +1 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts +24 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts.map +1 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.js +82 -0
- package/dist/__tests__/fixtures/sigint-deploy-harness.js.map +1 -0
- package/dist/__tests__/fork/api.test.d.ts +2 -0
- package/dist/__tests__/fork/api.test.d.ts.map +1 -0
- package/dist/__tests__/fork/api.test.js +110 -0
- package/dist/__tests__/fork/api.test.js.map +1 -0
- package/dist/__tests__/harness/Harness.createLive.test.d.ts +2 -0
- package/dist/__tests__/harness/Harness.createLive.test.d.ts.map +1 -0
- package/dist/__tests__/harness/Harness.createLive.test.js +53 -0
- package/dist/__tests__/harness/Harness.createLive.test.js.map +1 -0
- package/dist/__tests__/harness/Harness.proxy.test.d.ts +2 -0
- package/dist/__tests__/harness/Harness.proxy.test.d.ts.map +1 -0
- package/dist/__tests__/harness/Harness.proxy.test.js +93 -0
- package/dist/__tests__/harness/Harness.proxy.test.js.map +1 -0
- package/dist/__tests__/harness/_fixture.d.ts +54 -0
- package/dist/__tests__/harness/_fixture.d.ts.map +1 -0
- package/dist/__tests__/harness/_fixture.js +69 -0
- package/dist/__tests__/harness/_fixture.js.map +1 -0
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts +2 -0
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts.map +1 -0
- package/dist/__tests__/harness/codeObject.deploy.test.js +288 -0
- package/dist/__tests__/harness/codeObject.deploy.test.js.map +1 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts +2 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts.map +1 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.js +138 -0
- package/dist/__tests__/harness/codeObject.upgrade.test.js.map +1 -0
- package/dist/__tests__/harness/script.test.d.ts +2 -0
- package/dist/__tests__/harness/script.test.d.ts.map +1 -0
- package/dist/__tests__/harness/script.test.js +219 -0
- package/dist/__tests__/harness/script.test.js.map +1 -0
- package/dist/__tests__/harness/view.test.d.ts +2 -0
- package/dist/__tests__/harness/view.test.d.ts.map +1 -0
- package/dist/__tests__/harness/view.test.js +92 -0
- package/dist/__tests__/harness/view.test.js.map +1 -0
- package/dist/__tests__/runtime.test.d.ts +2 -0
- package/dist/__tests__/runtime.test.d.ts.map +1 -0
- package/dist/__tests__/runtime.test.js +141 -0
- package/dist/__tests__/runtime.test.js.map +1 -0
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/__tests__/compile.test.d.ts +2 -0
- package/dist/commands/__tests__/compile.test.d.ts.map +1 -0
- package/dist/commands/__tests__/compile.test.js +351 -0
- package/dist/commands/__tests__/compile.test.js.map +1 -0
- package/dist/commands/__tests__/init.test.d.ts +2 -0
- package/dist/commands/__tests__/init.test.d.ts.map +1 -0
- package/dist/commands/__tests__/init.test.js +101 -0
- package/dist/commands/__tests__/init.test.js.map +1 -0
- package/dist/commands/__tests__/run.test.d.ts +2 -0
- package/dist/commands/__tests__/run.test.d.ts.map +1 -0
- package/dist/commands/__tests__/run.test.js +166 -0
- package/dist/commands/__tests__/run.test.js.map +1 -0
- package/dist/commands/__tests__/test-move.test.d.ts +2 -0
- package/dist/commands/__tests__/test-move.test.d.ts.map +1 -0
- package/dist/commands/__tests__/test-move.test.js +59 -0
- package/dist/commands/__tests__/test-move.test.js.map +1 -0
- package/dist/commands/__tests__/test.test.d.ts +2 -0
- package/dist/commands/__tests__/test.test.d.ts.map +1 -0
- package/dist/commands/__tests__/test.test.js +168 -0
- package/dist/commands/__tests__/test.test.js.map +1 -0
- package/dist/commands/__tests__/update.test.d.ts +2 -0
- package/dist/commands/__tests__/update.test.d.ts.map +1 -0
- package/dist/commands/__tests__/update.test.js +176 -0
- package/dist/commands/__tests__/update.test.js.map +1 -0
- package/dist/commands/compile.d.ts +7 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +150 -33
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/fork/__tests__/create.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/create.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/create.test.js +108 -0
- package/dist/commands/fork/__tests__/create.test.js.map +1 -0
- package/dist/commands/fork/__tests__/fund.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/fund.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/fund.test.js +72 -0
- package/dist/commands/fork/__tests__/fund.test.js.map +1 -0
- package/dist/commands/fork/__tests__/list.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/list.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/list.test.js +119 -0
- package/dist/commands/fork/__tests__/list.test.js.map +1 -0
- package/dist/commands/fork/__tests__/serve.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/serve.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/serve.test.js +97 -0
- package/dist/commands/fork/__tests__/serve.test.js.map +1 -0
- package/dist/commands/fork/__tests__/view-resource.test.d.ts +2 -0
- package/dist/commands/fork/__tests__/view-resource.test.d.ts.map +1 -0
- package/dist/commands/fork/__tests__/view-resource.test.js +77 -0
- package/dist/commands/fork/__tests__/view-resource.test.js.map +1 -0
- package/dist/commands/fork/create.d.ts +1 -1
- package/dist/commands/fork/create.d.ts.map +1 -1
- package/dist/commands/fork/create.js +3 -2
- package/dist/commands/fork/create.js.map +1 -1
- package/dist/commands/fork/fund.d.ts.map +1 -1
- package/dist/commands/fork/fund.js +15 -8
- package/dist/commands/fork/fund.js.map +1 -1
- package/dist/commands/fork/list.d.ts.map +1 -1
- package/dist/commands/fork/list.js +2 -1
- package/dist/commands/fork/list.js.map +1 -1
- package/dist/commands/fork/serve.d.ts +1 -0
- package/dist/commands/fork/serve.d.ts.map +1 -1
- package/dist/commands/fork/serve.js +4 -2
- package/dist/commands/fork/serve.js.map +1 -1
- package/dist/commands/fork/view-resource.d.ts.map +1 -1
- package/dist/commands/fork/view-resource.js +10 -5
- package/dist/commands/fork/view-resource.js.map +1 -1
- package/dist/commands/run.d.ts +15 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +50 -27
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/test-move.d.ts.map +1 -1
- package/dist/commands/test-move.js +3 -2
- package/dist/commands/test-move.js.map +1 -1
- package/dist/commands/test.js +52 -46
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +15 -13
- package/dist/commands/update.js.map +1 -1
- package/dist/core/AccountManager.d.ts +1 -1
- package/dist/core/AccountManager.d.ts.map +1 -1
- package/dist/core/AccountManager.js +20 -7
- package/dist/core/AccountManager.js.map +1 -1
- package/dist/core/Publisher.d.ts +31 -0
- package/dist/core/Publisher.d.ts.map +1 -0
- package/dist/core/Publisher.js +248 -0
- package/dist/core/Publisher.js.map +1 -0
- package/dist/core/__tests__/AccountManager.test.d.ts +2 -0
- package/dist/core/__tests__/AccountManager.test.d.ts.map +1 -0
- package/dist/core/__tests__/AccountManager.test.js +239 -0
- package/dist/core/__tests__/AccountManager.test.js.map +1 -0
- package/dist/core/__tests__/config.test.d.ts +2 -0
- package/dist/core/__tests__/config.test.d.ts.map +1 -0
- package/dist/core/__tests__/config.test.js +311 -0
- package/dist/core/__tests__/config.test.js.map +1 -0
- package/dist/core/__tests__/deployments.test.d.ts +2 -0
- package/dist/core/__tests__/deployments.test.d.ts.map +1 -0
- package/dist/core/__tests__/deployments.test.js +201 -0
- package/dist/core/__tests__/deployments.test.js.map +1 -0
- package/dist/core/__tests__/shell.test.d.ts +2 -0
- package/dist/core/__tests__/shell.test.d.ts.map +1 -0
- package/dist/core/__tests__/shell.test.js +107 -0
- package/dist/core/__tests__/shell.test.js.map +1 -0
- package/dist/core/config.d.ts +13 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +80 -11
- package/dist/core/config.js.map +1 -1
- package/dist/core/contract.d.ts +1 -1
- package/dist/core/contract.d.ts.map +1 -1
- package/dist/core/contract.js +15 -4
- package/dist/core/contract.js.map +1 -1
- package/dist/core/deployments.d.ts +2 -2
- package/dist/core/deployments.d.ts.map +1 -1
- package/dist/core/deployments.js +8 -6
- package/dist/core/deployments.js.map +1 -1
- package/dist/core/movementProfile.d.ts +34 -0
- package/dist/core/movementProfile.d.ts.map +1 -0
- package/dist/core/movementProfile.js +150 -0
- package/dist/core/movementProfile.js.map +1 -0
- package/dist/core/shell.d.ts +23 -7
- package/dist/core/shell.d.ts.map +1 -1
- package/dist/core/shell.js +32 -14
- package/dist/core/shell.js.map +1 -1
- package/dist/errors.d.ts +35 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +54 -0
- package/dist/errors.js.map +1 -1
- package/dist/fork/__tests__/manager.test.d.ts +2 -0
- package/dist/fork/__tests__/manager.test.d.ts.map +1 -0
- package/dist/fork/__tests__/manager.test.js +309 -0
- package/dist/fork/__tests__/manager.test.js.map +1 -0
- package/dist/fork/__tests__/server.test.d.ts +2 -0
- package/dist/fork/__tests__/server.test.d.ts.map +1 -0
- package/dist/fork/__tests__/server.test.js +54 -0
- package/dist/fork/__tests__/server.test.js.map +1 -0
- package/dist/fork/__tests__/storage.test.d.ts +2 -0
- package/dist/fork/__tests__/storage.test.d.ts.map +1 -0
- package/dist/fork/__tests__/storage.test.js +222 -0
- package/dist/fork/__tests__/storage.test.js.map +1 -0
- package/dist/fork/__tests__/test.test.d.ts +2 -0
- package/dist/fork/__tests__/test.test.d.ts.map +1 -0
- package/dist/fork/__tests__/test.test.js +81 -0
- package/dist/fork/__tests__/test.test.js.map +1 -0
- package/dist/fork/api.d.ts +14 -3
- package/dist/fork/api.d.ts.map +1 -1
- package/dist/fork/api.js +25 -14
- package/dist/fork/api.js.map +1 -1
- package/dist/fork/manager.d.ts +23 -9
- package/dist/fork/manager.d.ts.map +1 -1
- package/dist/fork/manager.js +79 -36
- package/dist/fork/manager.js.map +1 -1
- package/dist/fork/server.d.ts +11 -3
- package/dist/fork/server.d.ts.map +1 -1
- package/dist/fork/server.js +45 -13
- package/dist/fork/server.js.map +1 -1
- package/dist/fork/storage.d.ts +4 -4
- package/dist/fork/storage.d.ts.map +1 -1
- package/dist/fork/storage.js +7 -9
- package/dist/fork/storage.js.map +1 -1
- package/dist/fork/test.d.ts +13 -4
- package/dist/fork/test.d.ts.map +1 -1
- package/dist/fork/test.js +36 -27
- package/dist/fork/test.js.map +1 -1
- package/dist/harness/Harness.d.ts +124 -0
- package/dist/harness/Harness.d.ts.map +1 -0
- package/dist/harness/Harness.js +193 -0
- package/dist/harness/Harness.js.map +1 -0
- package/dist/harness/codeObject.d.ts +31 -0
- package/dist/harness/codeObject.d.ts.map +1 -0
- package/dist/harness/codeObject.js +271 -0
- package/dist/harness/codeObject.js.map +1 -0
- package/dist/harness/errors.d.ts +14 -0
- package/dist/harness/errors.d.ts.map +1 -0
- package/dist/harness/errors.js +22 -0
- package/dist/harness/errors.js.map +1 -0
- package/dist/harness/index.d.ts +4 -0
- package/dist/harness/index.d.ts.map +1 -0
- package/dist/harness/index.js +3 -0
- package/dist/harness/index.js.map +1 -0
- package/dist/harness/proxy.d.ts +7 -0
- package/dist/harness/proxy.d.ts.map +1 -0
- package/dist/harness/proxy.js +36 -0
- package/dist/harness/proxy.js.map +1 -0
- package/dist/harness/script.d.ts +21 -0
- package/dist/harness/script.d.ts.map +1 -0
- package/dist/harness/script.js +155 -0
- package/dist/harness/script.js.map +1 -0
- package/dist/harness/view.d.ts +22 -0
- package/dist/harness/view.d.ts.map +1 -0
- package/dist/harness/view.js +28 -0
- package/dist/harness/view.js.map +1 -0
- package/dist/helpers/__tests__/semver-utils.test.d.ts +2 -0
- package/dist/helpers/__tests__/semver-utils.test.d.ts.map +1 -0
- package/dist/helpers/__tests__/semver-utils.test.js +103 -0
- package/dist/helpers/__tests__/semver-utils.test.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -2
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/move-tests.d.ts +3 -3
- package/dist/helpers/move-tests.d.ts.map +1 -1
- package/dist/helpers/move-tests.js +21 -20
- package/dist/helpers/move-tests.js.map +1 -1
- package/dist/helpers/npm-registry.d.ts.map +1 -1
- package/dist/helpers/npm-registry.js +1 -3
- package/dist/helpers/npm-registry.js.map +1 -1
- package/dist/helpers/semver-utils.d.ts.map +1 -1
- package/dist/helpers/semver-utils.js +4 -3
- package/dist/helpers/semver-utils.js.map +1 -1
- package/dist/helpers/setup.d.ts.map +1 -1
- package/dist/helpers/setup.js +6 -4
- package/dist/helpers/setup.js.map +1 -1
- package/dist/helpers/setupLocalTesting.d.ts +32 -27
- package/dist/helpers/setupLocalTesting.d.ts.map +1 -1
- package/dist/helpers/setupLocalTesting.js +179 -180
- package/dist/helpers/setupLocalTesting.js.map +1 -1
- package/dist/helpers/testFixtures.d.ts +19 -53
- package/dist/helpers/testFixtures.d.ts.map +1 -1
- package/dist/helpers/testFixtures.js +89 -107
- package/dist/helpers/testFixtures.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/node/LocalNodeManager.d.ts +9 -1
- package/dist/node/LocalNodeManager.d.ts.map +1 -1
- package/dist/node/LocalNodeManager.js +75 -58
- package/dist/node/LocalNodeManager.js.map +1 -1
- package/dist/node/__tests__/LocalNodeManager.test.d.ts +2 -0
- package/dist/node/__tests__/LocalNodeManager.test.d.ts.map +1 -0
- package/dist/node/__tests__/LocalNodeManager.test.js +349 -0
- package/dist/node/__tests__/LocalNodeManager.test.js.map +1 -0
- package/dist/runtime.d.ts +12 -15
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +28 -239
- package/dist/runtime.js.map +1 -1
- package/dist/templates/README.md +1 -1
- package/dist/templates/movehat.config.ts +10 -0
- package/dist/templates/package.json +2 -1
- package/dist/templates/scripts/deploy-counter.ts +46 -38
- package/dist/templates/tests/Counter.test.ts +39 -51
- package/dist/templates/types/movehat.d.ts +6 -9
- package/dist/types/config.d.ts +8 -0
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/fork.d.ts +7 -1
- package/dist/types/fork.d.ts.map +1 -1
- package/dist/types/harness.d.ts +166 -0
- package/dist/types/harness.d.ts.map +1 -0
- package/dist/types/harness.js +2 -0
- package/dist/types/harness.js.map +1 -0
- package/dist/types/runtime.d.ts +7 -1
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/ui/__tests__/colors.test.d.ts +2 -0
- package/dist/ui/__tests__/colors.test.d.ts.map +1 -0
- package/dist/ui/__tests__/colors.test.js +127 -0
- package/dist/ui/__tests__/colors.test.js.map +1 -0
- package/dist/ui/colors.d.ts.map +1 -1
- package/dist/ui/colors.js +6 -2
- package/dist/ui/colors.js.map +1 -1
- package/dist/ui/logger.d.ts +17 -0
- package/dist/ui/logger.d.ts.map +1 -1
- package/dist/ui/logger.js +22 -0
- package/dist/ui/logger.js.map +1 -1
- package/dist/ui/symbols.d.ts +1 -0
- package/dist/ui/symbols.d.ts.map +1 -1
- package/dist/ui/symbols.js +7 -1
- package/dist/ui/symbols.js.map +1 -1
- package/dist/utils/__tests__/address.test.d.ts +2 -0
- package/dist/utils/__tests__/address.test.d.ts.map +1 -0
- package/dist/utils/__tests__/address.test.js +70 -0
- package/dist/utils/__tests__/address.test.js.map +1 -0
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts +2 -0
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts.map +1 -0
- package/dist/utils/__tests__/childProcessAdapter.test.js +217 -0
- package/dist/utils/__tests__/childProcessAdapter.test.js.map +1 -0
- package/dist/utils/__tests__/runCli.test.d.ts +2 -0
- package/dist/utils/__tests__/runCli.test.d.ts.map +1 -0
- package/dist/utils/__tests__/runCli.test.js +187 -0
- package/dist/utils/__tests__/runCli.test.js.map +1 -0
- package/dist/utils/address.d.ts +33 -0
- package/dist/utils/address.d.ts.map +1 -0
- package/dist/utils/address.js +52 -0
- package/dist/utils/address.js.map +1 -0
- package/dist/utils/childProcessAdapter.d.ts +93 -0
- package/dist/utils/childProcessAdapter.d.ts.map +1 -0
- package/dist/utils/childProcessAdapter.js +109 -0
- package/dist/utils/childProcessAdapter.js.map +1 -0
- package/dist/utils/parseCliOutput.d.ts +20 -0
- package/dist/utils/parseCliOutput.d.ts.map +1 -0
- package/dist/utils/parseCliOutput.js +26 -0
- package/dist/utils/parseCliOutput.js.map +1 -0
- package/dist/utils/redact.d.ts +15 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +24 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/runCli.d.ts +24 -0
- package/dist/utils/runCli.d.ts.map +1 -0
- package/dist/utils/runCli.js +37 -0
- package/dist/utils/runCli.js.map +1 -0
- package/package.json +14 -4
- package/src/__tests__/deployContract.test.ts +429 -0
- package/src/__tests__/errors.test.ts +84 -0
- package/src/__tests__/fixtures/sigint-deploy-harness.ts +95 -0
- package/src/__tests__/fork/api.test.ts +143 -0
- package/src/__tests__/harness/Harness.createLive.test.ts +57 -0
- package/src/__tests__/harness/Harness.proxy.test.ts +115 -0
- package/src/__tests__/harness/_fixture.ts +131 -0
- package/src/__tests__/harness/codeObject.deploy.test.ts +319 -0
- package/src/__tests__/harness/codeObject.upgrade.test.ts +156 -0
- package/src/__tests__/harness/script.test.ts +245 -0
- package/src/__tests__/harness/view.test.ts +104 -0
- package/src/__tests__/runtime.test.ts +182 -0
- package/src/cli.ts +2 -1
- package/src/commands/__tests__/compile.test.ts +407 -0
- package/src/commands/__tests__/init.test.ts +125 -0
- package/src/commands/__tests__/run.test.ts +192 -0
- package/src/commands/__tests__/test-move.test.ts +81 -0
- package/src/commands/__tests__/test.test.ts +204 -0
- package/src/commands/__tests__/update.test.ts +223 -0
- package/src/commands/compile.ts +168 -32
- package/src/commands/fork/__tests__/create.test.ts +132 -0
- package/src/commands/fork/__tests__/fund.test.ts +104 -0
- package/src/commands/fork/__tests__/list.test.ts +139 -0
- package/src/commands/fork/__tests__/serve.test.ts +121 -0
- package/src/commands/fork/__tests__/view-resource.test.ts +101 -0
- package/src/commands/fork/create.ts +4 -3
- package/src/commands/fork/fund.ts +16 -9
- package/src/commands/fork/list.ts +3 -2
- package/src/commands/fork/serve.ts +6 -3
- package/src/commands/fork/view-resource.ts +11 -6
- package/src/commands/run.ts +54 -28
- package/src/commands/test-move.ts +4 -3
- package/src/commands/test.ts +56 -44
- package/src/commands/update.ts +19 -16
- package/src/core/AccountManager.ts +23 -10
- package/src/core/Publisher.ts +322 -0
- package/src/core/__tests__/AccountManager.test.ts +290 -0
- package/src/core/__tests__/config.test.ts +377 -0
- package/src/core/__tests__/deployments.test.ts +247 -0
- package/src/core/__tests__/shell.test.ts +138 -0
- package/src/core/config.ts +96 -12
- package/src/core/contract.ts +13 -4
- package/src/core/deployments.ts +13 -11
- package/src/core/movementProfile.ts +179 -0
- package/src/core/shell.ts +34 -14
- package/src/errors.ts +60 -0
- package/src/fork/__tests__/manager.test.ts +385 -0
- package/src/fork/__tests__/server.test.ts +65 -0
- package/src/fork/__tests__/storage.test.ts +281 -0
- package/src/fork/__tests__/test.test.ts +97 -0
- package/src/fork/api.ts +28 -14
- package/src/fork/manager.ts +88 -43
- package/src/fork/server.ts +53 -19
- package/src/fork/storage.ts +12 -15
- package/src/fork/test.ts +58 -32
- package/src/harness/Harness.ts +228 -0
- package/src/harness/codeObject.ts +388 -0
- package/src/harness/errors.ts +22 -0
- package/src/harness/index.ts +3 -0
- package/src/harness/proxy.ts +40 -0
- package/src/harness/script.ts +196 -0
- package/src/harness/view.ts +34 -0
- package/src/helpers/__tests__/semver-utils.test.ts +121 -0
- package/src/helpers/index.ts +2 -8
- package/src/helpers/move-tests.ts +27 -23
- package/src/helpers/npm-registry.ts +4 -3
- package/src/helpers/semver-utils.ts +4 -3
- package/src/helpers/setup.ts +6 -4
- package/src/helpers/setupLocalTesting.ts +219 -200
- package/src/helpers/testFixtures.ts +106 -118
- package/src/index.ts +9 -3
- package/src/node/LocalNodeManager.ts +87 -62
- package/src/node/__tests__/LocalNodeManager.test.ts +452 -0
- package/src/runtime.ts +30 -288
- package/src/templates/README.md +1 -1
- package/src/templates/movehat.config.ts +10 -0
- package/src/templates/package.json +2 -1
- package/src/templates/scripts/deploy-counter.ts +46 -38
- package/src/templates/tests/Counter.test.ts +39 -51
- package/src/templates/types/movehat.d.ts +6 -9
- package/src/types/config.ts +8 -0
- package/src/types/fork.ts +7 -1
- package/src/types/harness.ts +182 -0
- package/src/types/runtime.ts +11 -3
- package/src/ui/__tests__/colors.test.ts +156 -0
- package/src/ui/colors.ts +5 -2
- package/src/ui/logger.ts +22 -0
- package/src/ui/symbols.ts +7 -1
- package/src/utils/__tests__/address.test.ts +93 -0
- package/src/utils/__tests__/childProcessAdapter.test.ts +266 -0
- package/src/utils/__tests__/runCli.test.ts +240 -0
- package/src/utils/address.ts +56 -0
- package/src/utils/childProcessAdapter.ts +215 -0
- package/src/utils/parseCliOutput.ts +27 -0
- package/src/utils/redact.ts +24 -0
- package/src/utils/runCli.ts +64 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { CliExecutionError } from '../../errors.js';
|
|
3
|
+
import { redactSecrets, runCli } from '../runCli.js';
|
|
4
|
+
function makeAdapter(result, capture) {
|
|
5
|
+
return {
|
|
6
|
+
async run(input) {
|
|
7
|
+
if (capture)
|
|
8
|
+
capture.last = input;
|
|
9
|
+
return result;
|
|
10
|
+
},
|
|
11
|
+
spawn() {
|
|
12
|
+
throw new Error('spawn not used in runCli tests');
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
describe('redactSecrets', () => {
|
|
17
|
+
it('replaces ed25519-priv-0x… literals', () => {
|
|
18
|
+
const key = '0x' + 'a'.repeat(64);
|
|
19
|
+
const input = `Loaded key ed25519-priv-${key} ok`;
|
|
20
|
+
expect(redactSecrets(input)).toBe('Loaded key ***REDACTED*** ok');
|
|
21
|
+
});
|
|
22
|
+
it('redacts private_key labelled values', () => {
|
|
23
|
+
const input = 'private_key: 0x' + 'b'.repeat(64);
|
|
24
|
+
expect(redactSecrets(input)).toBe('***REDACTED***');
|
|
25
|
+
});
|
|
26
|
+
it('redacts priv-key labelled values with hyphen variants', () => {
|
|
27
|
+
const input = 'priv-key = 0x' + 'c'.repeat(64);
|
|
28
|
+
expect(redactSecrets(input)).toBe('***REDACTED***');
|
|
29
|
+
});
|
|
30
|
+
it('leaves regular hex addresses alone', () => {
|
|
31
|
+
const input = 'Account 0x1234 deployed module counter';
|
|
32
|
+
expect(redactSecrets(input)).toBe(input);
|
|
33
|
+
});
|
|
34
|
+
it('is a no-op on empty input', () => {
|
|
35
|
+
expect(redactSecrets('')).toBe('');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
describe('runCli', () => {
|
|
39
|
+
it('returns redacted stdout and stderr on success', async () => {
|
|
40
|
+
const key = 'ed25519-priv-0x' + 'a'.repeat(64);
|
|
41
|
+
const adapter = makeAdapter({
|
|
42
|
+
exitCode: 0,
|
|
43
|
+
stdout: `ok ${key}`,
|
|
44
|
+
stderr: '',
|
|
45
|
+
});
|
|
46
|
+
const result = await runCli({ command: 'fake', args: [] }, { adapter });
|
|
47
|
+
expect(result.exitCode).toBe(0);
|
|
48
|
+
expect(result.stdout).toBe('ok ***REDACTED***');
|
|
49
|
+
expect(result.stderr).toBe('');
|
|
50
|
+
});
|
|
51
|
+
it('throws CliExecutionError with redacted stderr on non-zero exit', async () => {
|
|
52
|
+
const adapter = makeAdapter({
|
|
53
|
+
exitCode: 1,
|
|
54
|
+
stdout: '',
|
|
55
|
+
stderr: 'boom private_key: 0x' + 'd'.repeat(64),
|
|
56
|
+
});
|
|
57
|
+
await expect(runCli({ command: 'movement', args: ['publish'] }, { adapter })).rejects.toMatchObject({
|
|
58
|
+
name: 'CliExecutionError',
|
|
59
|
+
command: 'movement',
|
|
60
|
+
exitCode: 1,
|
|
61
|
+
});
|
|
62
|
+
try {
|
|
63
|
+
await runCli({ command: 'movement', args: ['publish'] }, { adapter });
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
expect(e).toBeInstanceOf(CliExecutionError);
|
|
67
|
+
const err = e;
|
|
68
|
+
expect(err.stderr).toBe('boom ***REDACTED***');
|
|
69
|
+
expect(err.stderr).not.toContain('private_key');
|
|
70
|
+
expect(err.args).toEqual(['publish']);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
it('does not throw on non-zero exit when throwOnNonZeroExit is false', async () => {
|
|
74
|
+
const adapter = makeAdapter({
|
|
75
|
+
exitCode: 2,
|
|
76
|
+
stdout: 'partial',
|
|
77
|
+
stderr: 'warn',
|
|
78
|
+
});
|
|
79
|
+
const result = await runCli({ command: 'fake', args: [] }, { adapter, throwOnNonZeroExit: false });
|
|
80
|
+
expect(result.exitCode).toBe(2);
|
|
81
|
+
expect(result.stdout).toBe('partial');
|
|
82
|
+
expect(result.stderr).toBe('warn');
|
|
83
|
+
});
|
|
84
|
+
it('passes the input through to the adapter unchanged', async () => {
|
|
85
|
+
const capture = {};
|
|
86
|
+
const adapter = makeAdapter({ exitCode: 0, stdout: '', stderr: '' }, capture);
|
|
87
|
+
const env = { FOO: 'bar' };
|
|
88
|
+
const signal = new AbortController().signal;
|
|
89
|
+
await runCli({
|
|
90
|
+
command: 'movement',
|
|
91
|
+
args: ['move', 'build'],
|
|
92
|
+
cwd: '/tmp/pkg',
|
|
93
|
+
env,
|
|
94
|
+
stdin: 'hello',
|
|
95
|
+
timeoutMs: 1234,
|
|
96
|
+
signal,
|
|
97
|
+
}, { adapter });
|
|
98
|
+
expect(capture.last).toEqual({
|
|
99
|
+
command: 'movement',
|
|
100
|
+
args: ['move', 'build'],
|
|
101
|
+
cwd: '/tmp/pkg',
|
|
102
|
+
env,
|
|
103
|
+
stdin: 'hello',
|
|
104
|
+
timeoutMs: 1234,
|
|
105
|
+
signal,
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
it('truncates stdoutPreview on CliExecutionError', async () => {
|
|
109
|
+
const longStdout = 'x'.repeat(5000);
|
|
110
|
+
const adapter = makeAdapter({
|
|
111
|
+
exitCode: 1,
|
|
112
|
+
stdout: longStdout,
|
|
113
|
+
stderr: '',
|
|
114
|
+
});
|
|
115
|
+
try {
|
|
116
|
+
await runCli({ command: 'fake', args: [] }, { adapter });
|
|
117
|
+
expect.fail('should have thrown');
|
|
118
|
+
}
|
|
119
|
+
catch (e) {
|
|
120
|
+
const err = e;
|
|
121
|
+
expect(err.stdoutPreview.length).toBe(2000);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
it('redacts secret-shaped args inside CliExecutionError.args', async () => {
|
|
125
|
+
const key = 'ed25519-priv-0x' + 'a'.repeat(64);
|
|
126
|
+
const adapter = makeAdapter({ exitCode: 1, stdout: '', stderr: '' });
|
|
127
|
+
try {
|
|
128
|
+
await runCli({ command: 'movement', args: ['publish', '--private-key', key] }, { adapter });
|
|
129
|
+
expect.fail('should have thrown');
|
|
130
|
+
}
|
|
131
|
+
catch (e) {
|
|
132
|
+
const err = e;
|
|
133
|
+
expect(err.args[0]).toBe('publish');
|
|
134
|
+
expect(err.args[1]).toBe('--private-key');
|
|
135
|
+
expect(err.args[2]).toBe('***REDACTED***');
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
it('preserves non-secret args unchanged', async () => {
|
|
139
|
+
const adapter = makeAdapter({ exitCode: 1, stdout: '', stderr: '' });
|
|
140
|
+
const args = ['move', 'publish', '--package-dir', '/tmp/pkg'];
|
|
141
|
+
try {
|
|
142
|
+
await runCli({ command: 'movement', args }, { adapter });
|
|
143
|
+
expect.fail('should have thrown');
|
|
144
|
+
}
|
|
145
|
+
catch (e) {
|
|
146
|
+
const err = e;
|
|
147
|
+
expect(Array.from(err.args)).toEqual(args);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
it('forwards inheritStdio flag to the adapter unchanged', async () => {
|
|
151
|
+
const capture = {};
|
|
152
|
+
const adapter = makeAdapter({ exitCode: 0, stdout: '', stderr: '' }, capture);
|
|
153
|
+
await runCli({ command: 'mocha', args: ['--watch'], inheritStdio: true }, { adapter });
|
|
154
|
+
expect(capture.last?.inheritStdio).toBe(true);
|
|
155
|
+
});
|
|
156
|
+
it('propagates AbortSignal to a slow adapter and returns the killed result', async () => {
|
|
157
|
+
const slowAdapter = {
|
|
158
|
+
run(input) {
|
|
159
|
+
return new Promise((resolve) => {
|
|
160
|
+
const t = setTimeout(() => resolve({ exitCode: 0, stdout: '', stderr: '' }), 5000);
|
|
161
|
+
input.signal?.addEventListener('abort', () => {
|
|
162
|
+
clearTimeout(t);
|
|
163
|
+
resolve({
|
|
164
|
+
exitCode: -1,
|
|
165
|
+
stdout: '',
|
|
166
|
+
stderr: '',
|
|
167
|
+
signal: 'SIGTERM',
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
spawn() {
|
|
173
|
+
throw new Error('spawn not used in this test');
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
const controller = new AbortController();
|
|
177
|
+
const start = Date.now();
|
|
178
|
+
const promise = runCli({ command: 'movement', args: ['move', 'test'], signal: controller.signal }, { adapter: slowAdapter, throwOnNonZeroExit: false });
|
|
179
|
+
setTimeout(() => controller.abort(), 20);
|
|
180
|
+
const result = await promise;
|
|
181
|
+
const elapsed = Date.now() - start;
|
|
182
|
+
expect(result.exitCode).toBe(-1);
|
|
183
|
+
expect(result.signal).toBe('SIGTERM');
|
|
184
|
+
expect(elapsed).toBeLessThan(500);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
//# sourceMappingURL=runCli.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCli.test.js","sourceRoot":"","sources":["../../../src/utils/__tests__/runCli.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAMpD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAErD,SAAS,WAAW,CAAC,MAAiB,EAAE,OAA6B;IACnE,OAAO;QACL,KAAK,CAAC,GAAG,CAAC,KAAK;YACb,IAAI,OAAO;gBAAE,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;YAClC,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,KAAK;YACH,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,2BAA2B,GAAG,KAAK,CAAC;QAClD,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;IACpE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;QAC7C,MAAM,KAAK,GAAG,iBAAiB,G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AAI,eAAe,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,MAAM,CACpB,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,EAC1E,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,CACpD,CAAC;QACF,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QAEzC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QAEnC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address normalization helpers shared across the fork code.
|
|
3
|
+
*
|
|
4
|
+
* Two normalization variants live in production today and are preserved here
|
|
5
|
+
* with identical semantics so the in-place migration in M1.2 is behavior-
|
|
6
|
+
* preserving:
|
|
7
|
+
*
|
|
8
|
+
* - `normalizeAddress` → lowercase + `0x` + left-pad to 64 hex chars.
|
|
9
|
+
* Used by `fork/manager.ts` for storage keys.
|
|
10
|
+
* - `normalizeAddressShort` → lowercase + `0x`, no padding.
|
|
11
|
+
* Used by `fork/api.ts` for HTTP paths.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Lowercase the input, ensure a `0x` prefix, and left-pad the hex tail to
|
|
15
|
+
* 64 characters (66 total). Already-padded inputs are returned unchanged
|
|
16
|
+
* (apart from case folding).
|
|
17
|
+
*
|
|
18
|
+
* No validation: callers that need to reject non-hex input should consult
|
|
19
|
+
* `isHexAddress` first.
|
|
20
|
+
*/
|
|
21
|
+
export declare function normalizeAddress(input: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Lowercase the input and ensure a `0x` prefix. Length is preserved — no
|
|
24
|
+
* padding is applied. Suitable for callers that pass addresses straight to
|
|
25
|
+
* an HTTP endpoint that accepts short forms.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normalizeAddressShort(input: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Returns true when the input is a syntactically valid hex address: optional
|
|
30
|
+
* `0x` prefix followed by 1 to 64 hex characters (case insensitive).
|
|
31
|
+
*/
|
|
32
|
+
export declare function isHexAddress(input: string): boolean;
|
|
33
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/utils/address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYtD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAMnD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Address normalization helpers shared across the fork code.
|
|
3
|
+
*
|
|
4
|
+
* Two normalization variants live in production today and are preserved here
|
|
5
|
+
* with identical semantics so the in-place migration in M1.2 is behavior-
|
|
6
|
+
* preserving:
|
|
7
|
+
*
|
|
8
|
+
* - `normalizeAddress` → lowercase + `0x` + left-pad to 64 hex chars.
|
|
9
|
+
* Used by `fork/manager.ts` for storage keys.
|
|
10
|
+
* - `normalizeAddressShort` → lowercase + `0x`, no padding.
|
|
11
|
+
* Used by `fork/api.ts` for HTTP paths.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Lowercase the input, ensure a `0x` prefix, and left-pad the hex tail to
|
|
15
|
+
* 64 characters (66 total). Already-padded inputs are returned unchanged
|
|
16
|
+
* (apart from case folding).
|
|
17
|
+
*
|
|
18
|
+
* No validation: callers that need to reject non-hex input should consult
|
|
19
|
+
* `isHexAddress` first.
|
|
20
|
+
*/
|
|
21
|
+
export function normalizeAddress(input) {
|
|
22
|
+
let normalized = input.toLowerCase();
|
|
23
|
+
if (!normalized.startsWith('0x')) {
|
|
24
|
+
normalized = `0x${normalized}`;
|
|
25
|
+
}
|
|
26
|
+
if (normalized.length < 66) {
|
|
27
|
+
normalized = '0x' + normalized.slice(2).padStart(64, '0');
|
|
28
|
+
}
|
|
29
|
+
return normalized;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Lowercase the input and ensure a `0x` prefix. Length is preserved — no
|
|
33
|
+
* padding is applied. Suitable for callers that pass addresses straight to
|
|
34
|
+
* an HTTP endpoint that accepts short forms.
|
|
35
|
+
*/
|
|
36
|
+
export function normalizeAddressShort(input) {
|
|
37
|
+
const lower = input.toLowerCase();
|
|
38
|
+
return lower.startsWith('0x') ? lower : `0x${lower}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns true when the input is a syntactically valid hex address: optional
|
|
42
|
+
* `0x` prefix followed by 1 to 64 hex characters (case insensitive).
|
|
43
|
+
*/
|
|
44
|
+
export function isHexAddress(input) {
|
|
45
|
+
const stripped = input.startsWith('0x') || input.startsWith('0X')
|
|
46
|
+
? input.slice(2)
|
|
47
|
+
: input;
|
|
48
|
+
if (stripped.length === 0 || stripped.length > 64)
|
|
49
|
+
return false;
|
|
50
|
+
return /^[0-9a-fA-F]+$/.test(stripped);
|
|
51
|
+
}
|
|
52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C,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
/**
|
|
3
|
+
* Injectable abstraction over `child_process.spawn`.
|
|
4
|
+
*
|
|
5
|
+
* Tests inject a fake adapter; production code uses `defaultChildProcessAdapter`.
|
|
6
|
+
* Higher-level helpers (see `runCli`) wrap this with redaction and error handling.
|
|
7
|
+
*
|
|
8
|
+
* Two affordances:
|
|
9
|
+
* - `run` for one-shot commands whose stdout/stderr fit in memory.
|
|
10
|
+
* - `spawn` for long-running children where the caller wants to stream
|
|
11
|
+
* output incrementally and decide when to kill the process.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChildProcessAdapter {
|
|
14
|
+
run(input: RunInput): Promise<RunResult>;
|
|
15
|
+
spawn(input: SpawnInput): SpawnedProcess;
|
|
16
|
+
}
|
|
17
|
+
export interface RunInput {
|
|
18
|
+
command: string;
|
|
19
|
+
args: readonly string[];
|
|
20
|
+
cwd?: string;
|
|
21
|
+
env?: NodeJS.ProcessEnv;
|
|
22
|
+
stdin?: string;
|
|
23
|
+
timeoutMs?: number;
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
/**
|
|
26
|
+
* When `true`, the child inherits the parent's stdio (stdout, stderr,
|
|
27
|
+
* stdin go straight to the terminal). The resulting `RunResult.stdout`
|
|
28
|
+
* and `RunResult.stderr` will be empty strings because nothing is
|
|
29
|
+
* captured. Useful for interactive commands like `mocha`, `tsx`, or
|
|
30
|
+
* `pnpm install` where the user expects to see live output.
|
|
31
|
+
*
|
|
32
|
+
* If `inheritStdio` is `true`, `stdin` on this input is ignored — the
|
|
33
|
+
* child reads directly from the parent's stdin.
|
|
34
|
+
*
|
|
35
|
+
* Default: `false`.
|
|
36
|
+
*/
|
|
37
|
+
inheritStdio?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface RunResult {
|
|
40
|
+
/**
|
|
41
|
+
* Numeric exit code from the child. `-1` when the child was terminated by
|
|
42
|
+
* a signal (no numeric exit code available) — in that case `signal` is
|
|
43
|
+
* populated.
|
|
44
|
+
*/
|
|
45
|
+
exitCode: number;
|
|
46
|
+
stdout: string;
|
|
47
|
+
stderr: string;
|
|
48
|
+
/**
|
|
49
|
+
* Populated when the child died from a signal (e.g. external abort, kill
|
|
50
|
+
* during shutdown). `undefined` for normal exits.
|
|
51
|
+
*/
|
|
52
|
+
signal?: NodeJS.Signals;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Input for `spawn()`. Mirrors the subset of `RunInput` that applies to
|
|
56
|
+
* long-running children: no `stdin`, no `timeoutMs`, no `signal`. Callers
|
|
57
|
+
* control the lifecycle via the returned `SpawnedProcess`.
|
|
58
|
+
*/
|
|
59
|
+
export interface SpawnInput {
|
|
60
|
+
command: string;
|
|
61
|
+
args: readonly string[];
|
|
62
|
+
cwd?: string;
|
|
63
|
+
env?: NodeJS.ProcessEnv;
|
|
64
|
+
/**
|
|
65
|
+
* `'pipe'` (default) makes stdout/stderr/stdin streams available on the
|
|
66
|
+
* returned `SpawnedProcess`. `'ignore'` silences the child entirely
|
|
67
|
+
* (streams are `null`). For `'inherit'`, use `run` with `inheritStdio: true`
|
|
68
|
+
* instead — the spawn handle isn't useful when the parent owns stdio.
|
|
69
|
+
*/
|
|
70
|
+
stdio?: 'pipe' | 'ignore';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Handle returned by `spawn()`. Callers can listen on streams, kill the
|
|
74
|
+
* process, or await `exited` for the final exit code and signal.
|
|
75
|
+
*/
|
|
76
|
+
export interface SpawnedProcess {
|
|
77
|
+
pid: number | undefined;
|
|
78
|
+
stdout: Readable | null;
|
|
79
|
+
stderr: Readable | null;
|
|
80
|
+
stdin: Writable | null;
|
|
81
|
+
kill(signal?: NodeJS.Signals): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Resolves once when the child exits, regardless of how the caller
|
|
84
|
+
* triggered it (natural exit, `kill`, or process death). Safe to await
|
|
85
|
+
* multiple times.
|
|
86
|
+
*/
|
|
87
|
+
exited: Promise<{
|
|
88
|
+
code: number | null;
|
|
89
|
+
signal: NodeJS.Signals | null;
|
|
90
|
+
}>;
|
|
91
|
+
}
|
|
92
|
+
export declare const defaultChildProcessAdapter: ChildProcessAdapter;
|
|
93
|
+
//# sourceMappingURL=childProcessAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childProcessAdapter.d.ts","sourceRoot":"","sources":["../../src/utils/childProcessAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,mBAAmB;IAClC,GAAG,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,cAAc,CAAC;CAC1C;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;IACvC;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACzE;AAyHD,eAAO,MAAM,0BAA0B,EAAE,mBAAsD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
const DEFAULT_TIMEOUT_MS = 5 * 60 * 1000;
|
|
3
|
+
class DefaultChildProcessAdapter {
|
|
4
|
+
run(input) {
|
|
5
|
+
// Skip the default 5-minute timeout when the caller wires stdio
|
|
6
|
+
// through to the terminal — interactive sessions (mocha, tsx scripts,
|
|
7
|
+
// `movement move test`, `pnpm install`) routinely exceed 5 minutes and
|
|
8
|
+
// SIGTERM'ing them silently is a regression vs the direct-spawn code
|
|
9
|
+
// these callers used before M1.3a. An explicitly-passed `timeoutMs`
|
|
10
|
+
// is always honored, regardless of `inheritStdio`.
|
|
11
|
+
const timeoutMs = input.timeoutMs ?? (input.inheritStdio ? undefined : DEFAULT_TIMEOUT_MS);
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const child = spawn(input.command, [...input.args], {
|
|
14
|
+
cwd: input.cwd,
|
|
15
|
+
env: input.env ?? process.env,
|
|
16
|
+
stdio: input.inheritStdio ? 'inherit' : ['pipe', 'pipe', 'pipe'],
|
|
17
|
+
});
|
|
18
|
+
const stdoutChunks = [];
|
|
19
|
+
const stderrChunks = [];
|
|
20
|
+
// Streams are null when stdio is 'inherit'; the `?.` covers that.
|
|
21
|
+
child.stdout?.on('data', (chunk) => stdoutChunks.push(chunk));
|
|
22
|
+
child.stderr?.on('data', (chunk) => stderrChunks.push(chunk));
|
|
23
|
+
let timeoutHandle;
|
|
24
|
+
const clearTimer = () => {
|
|
25
|
+
if (timeoutHandle)
|
|
26
|
+
clearTimeout(timeoutHandle);
|
|
27
|
+
};
|
|
28
|
+
if (timeoutMs !== undefined) {
|
|
29
|
+
timeoutHandle = setTimeout(() => {
|
|
30
|
+
child.kill('SIGTERM');
|
|
31
|
+
reject(new Error(`Command timed out after ${timeoutMs}ms: ${input.command}`));
|
|
32
|
+
}, timeoutMs);
|
|
33
|
+
}
|
|
34
|
+
const onAbort = () => {
|
|
35
|
+
child.kill('SIGTERM');
|
|
36
|
+
};
|
|
37
|
+
if (input.signal) {
|
|
38
|
+
if (input.signal.aborted) {
|
|
39
|
+
clearTimer();
|
|
40
|
+
child.kill('SIGTERM');
|
|
41
|
+
reject(new Error('Command aborted before start'));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
input.signal.addEventListener('abort', onAbort, { once: true });
|
|
45
|
+
}
|
|
46
|
+
child.on('error', (err) => {
|
|
47
|
+
clearTimer();
|
|
48
|
+
input.signal?.removeEventListener('abort', onAbort);
|
|
49
|
+
reject(err);
|
|
50
|
+
});
|
|
51
|
+
child.on('close', (code, signal) => {
|
|
52
|
+
clearTimer();
|
|
53
|
+
input.signal?.removeEventListener('abort', onAbort);
|
|
54
|
+
const result = {
|
|
55
|
+
exitCode: code !== null ? code : -1,
|
|
56
|
+
stdout: Buffer.concat(stdoutChunks).toString('utf8'),
|
|
57
|
+
stderr: Buffer.concat(stderrChunks).toString('utf8'),
|
|
58
|
+
};
|
|
59
|
+
if (signal) {
|
|
60
|
+
result.signal = signal;
|
|
61
|
+
}
|
|
62
|
+
resolve(result);
|
|
63
|
+
});
|
|
64
|
+
// Under inheritStdio, child.stdin is null and the parent's stdin
|
|
65
|
+
// is wired through; we just skip the close call. Otherwise, end()
|
|
66
|
+
// either with the provided string or empty to close stdin cleanly.
|
|
67
|
+
if (!input.inheritStdio) {
|
|
68
|
+
if (input.stdin !== undefined) {
|
|
69
|
+
child.stdin?.end(input.stdin);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
child.stdin?.end();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
spawn(input) {
|
|
78
|
+
const stdio = input.stdio ?? 'pipe';
|
|
79
|
+
const child = spawn(input.command, [...input.args], {
|
|
80
|
+
cwd: input.cwd,
|
|
81
|
+
env: input.env ?? process.env,
|
|
82
|
+
stdio,
|
|
83
|
+
});
|
|
84
|
+
// `exited` must settle whether the child dies via natural exit, kill,
|
|
85
|
+
// or a spawn-time `error` (e.g. ENOENT). Both events resolve once;
|
|
86
|
+
// a settled guard prevents double-resolve if both happen to fire.
|
|
87
|
+
const exited = new Promise((resolve) => {
|
|
88
|
+
let settled = false;
|
|
89
|
+
const finish = (code, signal) => {
|
|
90
|
+
if (settled)
|
|
91
|
+
return;
|
|
92
|
+
settled = true;
|
|
93
|
+
resolve({ code, signal });
|
|
94
|
+
};
|
|
95
|
+
child.on('exit', (code, signal) => finish(code, signal));
|
|
96
|
+
child.on('error', () => finish(null, null));
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
pid: child.pid,
|
|
100
|
+
stdout: child.stdout,
|
|
101
|
+
stderr: child.stderr,
|
|
102
|
+
stdin: child.stdin,
|
|
103
|
+
kill: (signal) => child.kill(signal),
|
|
104
|
+
exited,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
export const defaultChildProcessAdapter = new DefaultChildProcessAdapter();
|
|
109
|
+
//# sourceMappingURL=childProcessAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"childProcessAdapter.js","sourceRoot":"","sources":["../../src/utils/childProcessAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AA+F3C,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzC,MAAM,0BAA0B;IAC9B,GAAG,CAAC,KAAe;QACjB,gEAAgE;QAChE,sEAAsE;QACtE,uEAAuE;QACvE,qEAAqE;QACrE,oEAAoE;QACpE,mDAAmD;QACnD,MAAM,SAAS,GACb,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAE3E,OAAO,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE;gBAClD,GAAG,EAAE,KAAK,CAAC,GAAG;gBACd,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;gBAC7B,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;aACjE,CAAC,CAAC;YAEH,MAAM,YAAY,GAAa,EAAE,CAAC;YAClC,MAAM,YAAY,GAAa,EAAE,CAAC;YAElC,kEAAkE;YAClE,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,KAAK,CAA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transaction hash from a `movement` CLI subcommand's stdout.
|
|
8
|
+
*
|
|
9
|
+
* Tries the context-bearing pattern first (`transaction hash: 0x…`,
|
|
10
|
+
* `txn hash: 0x…`, `hash: 0x…`) and falls back to any 64-char hex
|
|
11
|
+
* literal in the buffer. Returns `undefined` if no candidate matches.
|
|
12
|
+
*
|
|
13
|
+
* Shared by `core/Publisher.ts` (publish), `harness/codeObject.ts`
|
|
14
|
+
* (deploy-object / upgrade-object), and `harness/script.ts`
|
|
15
|
+
* (run-script). All three CLI subcommands emit the txHash in the same
|
|
16
|
+
* shape — keep this helper as the single source of truth so a future
|
|
17
|
+
* CLI-format change is a one-line fix.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseTxHash(stdout: string): string | undefined;
|
|
20
|
+
//# sourceMappingURL=parseCliOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCliOutput.d.ts","sourceRoot":"","sources":["../../src/utils/parseCliOutput.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAO9D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for extracting fields out of Movement CLI stdout / stderr.
|
|
3
|
+
*
|
|
4
|
+
* @internal — not exported from `src/index.ts`.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Extract the transaction hash from a `movement` CLI subcommand's stdout.
|
|
8
|
+
*
|
|
9
|
+
* Tries the context-bearing pattern first (`transaction hash: 0x…`,
|
|
10
|
+
* `txn hash: 0x…`, `hash: 0x…`) and falls back to any 64-char hex
|
|
11
|
+
* literal in the buffer. Returns `undefined` if no candidate matches.
|
|
12
|
+
*
|
|
13
|
+
* Shared by `core/Publisher.ts` (publish), `harness/codeObject.ts`
|
|
14
|
+
* (deploy-object / upgrade-object), and `harness/script.ts`
|
|
15
|
+
* (run-script). All three CLI subcommands emit the txHash in the same
|
|
16
|
+
* shape — keep this helper as the single source of truth so a future
|
|
17
|
+
* CLI-format change is a one-line fix.
|
|
18
|
+
*/
|
|
19
|
+
export function parseTxHash(stdout) {
|
|
20
|
+
const withContext = stdout.match(/(?:transaction\s*(?:hash)?|txn\s*(?:hash)?|hash):\s*(0x[a-fA-F0-9]{64})\b/i);
|
|
21
|
+
if (withContext?.[1])
|
|
22
|
+
return withContext[1];
|
|
23
|
+
const fallback = stdout.match(/\b(0x[a-fA-F0-9]{64})\b/);
|
|
24
|
+
return fallback?.[1];
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=parseCliOutput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseCliOutput.js","sourceRoot":"","sources":["../../src/utils/parseCliOutput.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAC9B,4EAA4E,CAC7E,CAAC;IACF,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACzD,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patterns that match well-known secret shapes Movement tools emit on
|
|
3
|
+
* stderr / stdout / CLI arguments. Each match is replaced with
|
|
4
|
+
* `***REDACTED***` by `redactSecrets`.
|
|
5
|
+
*
|
|
6
|
+
* The labelled pattern (second entry) intentionally accepts bare `priv` and
|
|
7
|
+
* `key` prefixes. Over-redaction is fine; missing a real key is not.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SECRET_PATTERNS: readonly RegExp[];
|
|
10
|
+
/**
|
|
11
|
+
* Replaces every match of every known secret pattern with `***REDACTED***`.
|
|
12
|
+
* Idempotent: running it on already-redacted text is a no-op.
|
|
13
|
+
*/
|
|
14
|
+
export declare function redactSecrets(text: string): string;
|
|
15
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAG5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMlD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Patterns that match well-known secret shapes Movement tools emit on
|
|
3
|
+
* stderr / stdout / CLI arguments. Each match is replaced with
|
|
4
|
+
* `***REDACTED***` by `redactSecrets`.
|
|
5
|
+
*
|
|
6
|
+
* The labelled pattern (second entry) intentionally accepts bare `priv` and
|
|
7
|
+
* `key` prefixes. Over-redaction is fine; missing a real key is not.
|
|
8
|
+
*/
|
|
9
|
+
export const SECRET_PATTERNS = [
|
|
10
|
+
/ed25519-priv-0x[0-9a-fA-F]{64}/g,
|
|
11
|
+
/(private[_-]?key|priv[_-]?key|priv|key)\s*[:=]\s*0x[0-9a-fA-F]{32,}/gi,
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* Replaces every match of every known secret pattern with `***REDACTED***`.
|
|
15
|
+
* Idempotent: running it on already-redacted text is a no-op.
|
|
16
|
+
*/
|
|
17
|
+
export function redactSecrets(text) {
|
|
18
|
+
let out = text;
|
|
19
|
+
for (const pattern of SECRET_PATTERNS) {
|
|
20
|
+
out = out.replace(pattern, '***REDACTED***');
|
|
21
|
+
}
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,iCAAiC;IACjC,uEAAuE;CACxE,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;QACtC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChildProcessAdapter, type RunInput, type RunResult } from './childProcessAdapter.js';
|
|
2
|
+
export { redactSecrets } from './redact.js';
|
|
3
|
+
export interface RunCliOptions {
|
|
4
|
+
/** Override the child-process adapter (defaults to spawn-based). */
|
|
5
|
+
adapter?: ChildProcessAdapter | undefined;
|
|
6
|
+
/** When true (default), throw `CliExecutionError` on non-zero exit. */
|
|
7
|
+
throwOnNonZeroExit?: boolean | undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Spawns a CLI command through the injectable adapter, redacts well-known
|
|
11
|
+
* secret shapes from stdout and stderr before returning, and throws
|
|
12
|
+
* `CliExecutionError` (with already-redacted payloads) on non-zero exits.
|
|
13
|
+
*
|
|
14
|
+
* Callers that need to inspect raw output should set `throwOnNonZeroExit:false`
|
|
15
|
+
* and consume the returned `RunResult` directly — fields are still redacted.
|
|
16
|
+
*
|
|
17
|
+
* Pass `input.inheritStdio: true` for interactive commands (mocha, tsx,
|
|
18
|
+
* package managers) where the user expects to see live output. Under that
|
|
19
|
+
* flag, `stdout` and `stderr` in the returned `RunResult` are empty strings
|
|
20
|
+
* (and so is `stdoutPreview` on any `CliExecutionError`), since the child
|
|
21
|
+
* writes directly to the terminal rather than to a captured buffer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function runCli(input: RunInput, options?: RunCliOptions): Promise<RunResult>;
|
|
24
|
+
//# sourceMappingURL=runCli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runCli.d.ts","sourceRoot":"","sources":["../../src/utils/runCli.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EACb,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAC1C,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAC1C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,MAAM,CAC1B,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,SAAS,CAAC,CA0BpB"}
|