movehat 0.2.4 → 0.2.6
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 +1 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +0 -1
- package/dist/commands/compile.d.ts +0 -1
- package/dist/commands/compile.js +0 -1
- package/dist/commands/fork/create.d.ts +1 -1
- package/dist/commands/fork/create.js +18 -3
- package/dist/commands/fork/fund.d.ts +0 -1
- package/dist/commands/fork/fund.js +0 -1
- package/dist/commands/fork/list.d.ts +0 -1
- package/dist/commands/fork/list.js +0 -1
- package/dist/commands/fork/serve.d.ts +0 -1
- package/dist/commands/fork/serve.js +0 -1
- package/dist/commands/fork/view-resource.d.ts +0 -1
- package/dist/commands/fork/view-resource.js +0 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.js +0 -1
- package/dist/commands/run.d.ts +17 -1
- package/dist/commands/run.js +46 -33
- package/dist/commands/test-move.d.ts +0 -1
- package/dist/commands/test-move.js +0 -1
- package/dist/commands/test.d.ts +0 -1
- package/dist/commands/test.js +8 -1
- package/dist/commands/update.d.ts +0 -1
- package/dist/commands/update.js +0 -1
- package/dist/core/AccountManager.d.ts +15 -2
- package/dist/core/AccountManager.js +32 -20
- package/dist/core/Publisher.d.ts +0 -1
- package/dist/core/Publisher.js +0 -1
- package/dist/core/config.d.ts +0 -1
- package/dist/core/config.js +109 -28
- package/dist/core/contract.d.ts +0 -1
- package/dist/core/contract.js +0 -1
- package/dist/core/deployments.d.ts +0 -1
- package/dist/core/deployments.js +0 -1
- package/dist/core/movementProfile.d.ts +0 -1
- package/dist/core/movementProfile.js +0 -1
- package/dist/core/shell.d.ts +0 -1
- package/dist/core/shell.js +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -1
- package/dist/fork/api.d.ts +24 -1
- package/dist/fork/api.js +95 -1
- package/dist/fork/manager.d.ts +14 -1
- package/dist/fork/manager.js +19 -1
- package/dist/fork/server.d.ts +19 -1
- package/dist/fork/server.js +188 -8
- package/dist/fork/storage.d.ts +0 -1
- package/dist/fork/storage.js +50 -32
- package/dist/fork/test.d.ts +0 -1
- package/dist/fork/test.js +0 -1
- package/dist/harness/Harness.d.ts +0 -1
- package/dist/harness/Harness.js +6 -2
- package/dist/harness/codeObject.d.ts +0 -1
- package/dist/harness/codeObject.js +0 -1
- package/dist/harness/errors.d.ts +0 -1
- package/dist/harness/errors.js +0 -1
- package/dist/harness/index.d.ts +0 -1
- package/dist/harness/index.js +0 -1
- package/dist/harness/proxy.d.ts +12 -1
- package/dist/harness/proxy.js +23 -1
- package/dist/harness/script.d.ts +0 -1
- package/dist/harness/script.js +0 -1
- package/dist/harness/view.d.ts +0 -1
- package/dist/harness/view.js +0 -1
- package/dist/helpers/assertions.d.ts +0 -1
- package/dist/helpers/assertions.js +0 -1
- package/dist/helpers/banner.d.ts +0 -1
- package/dist/helpers/banner.js +0 -1
- package/dist/helpers/index.d.ts +0 -1
- package/dist/helpers/index.js +0 -1
- package/dist/helpers/move-tests.d.ts +0 -1
- package/dist/helpers/move-tests.js +0 -1
- package/dist/helpers/npm-registry.d.ts +0 -1
- package/dist/helpers/npm-registry.js +0 -1
- package/dist/helpers/semver-utils.d.ts +0 -1
- package/dist/helpers/semver-utils.js +0 -1
- package/dist/helpers/setup.d.ts +0 -1
- package/dist/helpers/setup.js +0 -1
- package/dist/helpers/setupLocalTesting.d.ts +2 -5
- package/dist/helpers/setupLocalTesting.js +0 -1
- package/dist/helpers/testFixtures.d.ts +0 -1
- package/dist/helpers/testFixtures.js +0 -1
- package/dist/helpers/version-check.d.ts +0 -1
- package/dist/helpers/version-check.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/node/LocalNodeManager.d.ts +0 -1
- package/dist/node/LocalNodeManager.js +4 -2
- package/dist/runtime.d.ts +0 -1
- package/dist/runtime.js +0 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/config.js +0 -1
- package/dist/types/fork.d.ts +0 -1
- package/dist/types/fork.js +0 -1
- package/dist/types/harness.d.ts +0 -1
- package/dist/types/harness.js +0 -1
- package/dist/types/runtime.d.ts +0 -1
- package/dist/types/runtime.js +0 -1
- package/dist/ui/colors.d.ts +0 -1
- package/dist/ui/colors.js +0 -1
- package/dist/ui/formatters.d.ts +0 -1
- package/dist/ui/formatters.js +0 -1
- package/dist/ui/index.d.ts +0 -1
- package/dist/ui/index.js +0 -1
- package/dist/ui/logger.d.ts +0 -1
- package/dist/ui/logger.js +0 -1
- package/dist/ui/spinner.d.ts +0 -1
- package/dist/ui/spinner.js +0 -1
- package/dist/ui/symbols.d.ts +0 -1
- package/dist/ui/symbols.js +0 -1
- package/dist/ui/table.d.ts +0 -1
- package/dist/ui/table.js +0 -1
- package/dist/utils/address.d.ts +0 -1
- package/dist/utils/address.js +0 -1
- package/dist/utils/childProcessAdapter.d.ts +0 -1
- package/dist/utils/childProcessAdapter.js +46 -20
- package/dist/utils/movementCli.d.ts +5 -0
- package/dist/utils/movementCli.js +91 -0
- package/dist/utils/parseCliOutput.d.ts +6 -4
- package/dist/utils/parseCliOutput.js +10 -6
- package/dist/utils/redact.d.ts +3 -3
- package/dist/utils/redact.js +6 -5
- package/dist/utils/runCli.d.ts +0 -1
- package/dist/utils/runCli.js +10 -2
- package/package.json +4 -4
- package/dist/__tests__/deployContract.test.d.ts +0 -2
- package/dist/__tests__/deployContract.test.d.ts.map +0 -1
- package/dist/__tests__/deployContract.test.js +0 -377
- package/dist/__tests__/deployContract.test.js.map +0 -1
- package/dist/__tests__/errors.test.d.ts +0 -2
- package/dist/__tests__/errors.test.d.ts.map +0 -1
- package/dist/__tests__/errors.test.js +0 -46
- package/dist/__tests__/errors.test.js.map +0 -1
- package/dist/__tests__/exports.test.d.ts +0 -2
- package/dist/__tests__/exports.test.d.ts.map +0 -1
- package/dist/__tests__/exports.test.js +0 -30
- package/dist/__tests__/exports.test.js.map +0 -1
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts +0 -25
- package/dist/__tests__/fixtures/sigint-deploy-harness.d.ts.map +0 -1
- package/dist/__tests__/fixtures/sigint-deploy-harness.js +0 -83
- package/dist/__tests__/fixtures/sigint-deploy-harness.js.map +0 -1
- package/dist/__tests__/fork/api.test.d.ts +0 -2
- package/dist/__tests__/fork/api.test.d.ts.map +0 -1
- package/dist/__tests__/fork/api.test.js +0 -115
- package/dist/__tests__/fork/api.test.js.map +0 -1
- package/dist/__tests__/fork/api.timeout.test.d.ts +0 -2
- package/dist/__tests__/fork/api.timeout.test.d.ts.map +0 -1
- package/dist/__tests__/fork/api.timeout.test.js +0 -98
- package/dist/__tests__/fork/api.timeout.test.js.map +0 -1
- package/dist/__tests__/harness/Harness.createLive.test.d.ts +0 -2
- package/dist/__tests__/harness/Harness.createLive.test.d.ts.map +0 -1
- package/dist/__tests__/harness/Harness.createLive.test.js +0 -53
- package/dist/__tests__/harness/Harness.createLive.test.js.map +0 -1
- package/dist/__tests__/harness/Harness.proxy.test.d.ts +0 -2
- package/dist/__tests__/harness/Harness.proxy.test.d.ts.map +0 -1
- package/dist/__tests__/harness/Harness.proxy.test.js +0 -89
- package/dist/__tests__/harness/Harness.proxy.test.js.map +0 -1
- package/dist/__tests__/harness/_fixture.d.ts +0 -54
- package/dist/__tests__/harness/_fixture.d.ts.map +0 -1
- package/dist/__tests__/harness/_fixture.js +0 -69
- package/dist/__tests__/harness/_fixture.js.map +0 -1
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts +0 -2
- package/dist/__tests__/harness/codeObject.deploy.test.d.ts.map +0 -1
- package/dist/__tests__/harness/codeObject.deploy.test.js +0 -288
- package/dist/__tests__/harness/codeObject.deploy.test.js.map +0 -1
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts +0 -2
- package/dist/__tests__/harness/codeObject.upgrade.test.d.ts.map +0 -1
- package/dist/__tests__/harness/codeObject.upgrade.test.js +0 -138
- package/dist/__tests__/harness/codeObject.upgrade.test.js.map +0 -1
- package/dist/__tests__/harness/script.test.d.ts +0 -2
- package/dist/__tests__/harness/script.test.d.ts.map +0 -1
- package/dist/__tests__/harness/script.test.js +0 -219
- package/dist/__tests__/harness/script.test.js.map +0 -1
- package/dist/__tests__/harness/view.test.d.ts +0 -2
- package/dist/__tests__/harness/view.test.d.ts.map +0 -1
- package/dist/__tests__/harness/view.test.js +0 -92
- package/dist/__tests__/harness/view.test.js.map +0 -1
- package/dist/__tests__/runtime.test.d.ts +0 -2
- package/dist/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/__tests__/runtime.test.js +0 -141
- package/dist/__tests__/runtime.test.js.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/__tests__/compile.test.d.ts +0 -2
- package/dist/commands/__tests__/compile.test.d.ts.map +0 -1
- package/dist/commands/__tests__/compile.test.js +0 -351
- package/dist/commands/__tests__/compile.test.js.map +0 -1
- package/dist/commands/__tests__/compile.toml-mutation.test.d.ts +0 -2
- package/dist/commands/__tests__/compile.toml-mutation.test.d.ts.map +0 -1
- package/dist/commands/__tests__/compile.toml-mutation.test.js +0 -69
- package/dist/commands/__tests__/compile.toml-mutation.test.js.map +0 -1
- package/dist/commands/__tests__/init.test.d.ts +0 -2
- package/dist/commands/__tests__/init.test.d.ts.map +0 -1
- package/dist/commands/__tests__/init.test.js +0 -163
- package/dist/commands/__tests__/init.test.js.map +0 -1
- package/dist/commands/__tests__/run.test.d.ts +0 -2
- package/dist/commands/__tests__/run.test.d.ts.map +0 -1
- package/dist/commands/__tests__/run.test.js +0 -166
- package/dist/commands/__tests__/run.test.js.map +0 -1
- package/dist/commands/__tests__/test-move.test.d.ts +0 -2
- package/dist/commands/__tests__/test-move.test.d.ts.map +0 -1
- package/dist/commands/__tests__/test-move.test.js +0 -59
- package/dist/commands/__tests__/test-move.test.js.map +0 -1
- package/dist/commands/__tests__/test.test.d.ts +0 -2
- package/dist/commands/__tests__/test.test.d.ts.map +0 -1
- package/dist/commands/__tests__/test.test.js +0 -168
- package/dist/commands/__tests__/test.test.js.map +0 -1
- package/dist/commands/__tests__/update.test.d.ts +0 -2
- package/dist/commands/__tests__/update.test.d.ts.map +0 -1
- package/dist/commands/__tests__/update.test.js +0 -176
- package/dist/commands/__tests__/update.test.js.map +0 -1
- package/dist/commands/compile.d.ts.map +0 -1
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/fork/__tests__/create.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/create.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/create.test.js +0 -108
- package/dist/commands/fork/__tests__/create.test.js.map +0 -1
- package/dist/commands/fork/__tests__/fund.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/fund.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/fund.test.js +0 -72
- package/dist/commands/fork/__tests__/fund.test.js.map +0 -1
- package/dist/commands/fork/__tests__/list.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/list.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/list.test.js +0 -119
- package/dist/commands/fork/__tests__/list.test.js.map +0 -1
- package/dist/commands/fork/__tests__/serve.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/serve.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/serve.test.js +0 -97
- package/dist/commands/fork/__tests__/serve.test.js.map +0 -1
- package/dist/commands/fork/__tests__/view-resource.test.d.ts +0 -2
- package/dist/commands/fork/__tests__/view-resource.test.d.ts.map +0 -1
- package/dist/commands/fork/__tests__/view-resource.test.js +0 -77
- package/dist/commands/fork/__tests__/view-resource.test.js.map +0 -1
- package/dist/commands/fork/create.d.ts.map +0 -1
- package/dist/commands/fork/create.js.map +0 -1
- package/dist/commands/fork/fund.d.ts.map +0 -1
- package/dist/commands/fork/fund.js.map +0 -1
- package/dist/commands/fork/list.d.ts.map +0 -1
- package/dist/commands/fork/list.js.map +0 -1
- package/dist/commands/fork/serve.d.ts.map +0 -1
- package/dist/commands/fork/serve.js.map +0 -1
- package/dist/commands/fork/view-resource.d.ts.map +0 -1
- package/dist/commands/fork/view-resource.js.map +0 -1
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/test-move.d.ts.map +0 -1
- package/dist/commands/test-move.js.map +0 -1
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js.map +0 -1
- package/dist/core/AccountManager.d.ts.map +0 -1
- package/dist/core/AccountManager.js.map +0 -1
- package/dist/core/Publisher.d.ts.map +0 -1
- package/dist/core/Publisher.js.map +0 -1
- package/dist/core/__tests__/AccountManager.global-state.test.d.ts +0 -2
- package/dist/core/__tests__/AccountManager.global-state.test.d.ts.map +0 -1
- package/dist/core/__tests__/AccountManager.global-state.test.js +0 -69
- package/dist/core/__tests__/AccountManager.global-state.test.js.map +0 -1
- package/dist/core/__tests__/AccountManager.test.d.ts +0 -2
- package/dist/core/__tests__/AccountManager.test.d.ts.map +0 -1
- package/dist/core/__tests__/AccountManager.test.js +0 -239
- package/dist/core/__tests__/AccountManager.test.js.map +0 -1
- package/dist/core/__tests__/config.test.d.ts +0 -2
- package/dist/core/__tests__/config.test.d.ts.map +0 -1
- package/dist/core/__tests__/config.test.js +0 -311
- package/dist/core/__tests__/config.test.js.map +0 -1
- package/dist/core/__tests__/deployments.test.d.ts +0 -2
- package/dist/core/__tests__/deployments.test.d.ts.map +0 -1
- package/dist/core/__tests__/deployments.test.js +0 -201
- package/dist/core/__tests__/deployments.test.js.map +0 -1
- package/dist/core/__tests__/movementProfile.test.d.ts +0 -2
- package/dist/core/__tests__/movementProfile.test.d.ts.map +0 -1
- package/dist/core/__tests__/movementProfile.test.js +0 -112
- package/dist/core/__tests__/movementProfile.test.js.map +0 -1
- package/dist/core/__tests__/shell.test.d.ts +0 -2
- package/dist/core/__tests__/shell.test.d.ts.map +0 -1
- package/dist/core/__tests__/shell.test.js +0 -107
- package/dist/core/__tests__/shell.test.js.map +0 -1
- package/dist/core/config.d.ts.map +0 -1
- package/dist/core/config.js.map +0 -1
- package/dist/core/contract.d.ts.map +0 -1
- package/dist/core/contract.js.map +0 -1
- package/dist/core/deployments.d.ts.map +0 -1
- package/dist/core/deployments.js.map +0 -1
- package/dist/core/movementProfile.d.ts.map +0 -1
- package/dist/core/movementProfile.js.map +0 -1
- package/dist/core/shell.d.ts.map +0 -1
- package/dist/core/shell.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/fork/__tests__/manager.test.d.ts +0 -2
- package/dist/fork/__tests__/manager.test.d.ts.map +0 -1
- package/dist/fork/__tests__/manager.test.js +0 -309
- package/dist/fork/__tests__/manager.test.js.map +0 -1
- package/dist/fork/__tests__/server.cors.test.d.ts +0 -2
- package/dist/fork/__tests__/server.cors.test.d.ts.map +0 -1
- package/dist/fork/__tests__/server.cors.test.js +0 -79
- package/dist/fork/__tests__/server.cors.test.js.map +0 -1
- package/dist/fork/__tests__/server.test.d.ts +0 -2
- package/dist/fork/__tests__/server.test.d.ts.map +0 -1
- package/dist/fork/__tests__/server.test.js +0 -54
- package/dist/fork/__tests__/server.test.js.map +0 -1
- package/dist/fork/__tests__/storage.test.d.ts +0 -2
- package/dist/fork/__tests__/storage.test.d.ts.map +0 -1
- package/dist/fork/__tests__/storage.test.js +0 -222
- package/dist/fork/__tests__/storage.test.js.map +0 -1
- package/dist/fork/__tests__/test.test.d.ts +0 -2
- package/dist/fork/__tests__/test.test.d.ts.map +0 -1
- package/dist/fork/__tests__/test.test.js +0 -81
- package/dist/fork/__tests__/test.test.js.map +0 -1
- package/dist/fork/api.d.ts.map +0 -1
- package/dist/fork/api.js.map +0 -1
- package/dist/fork/manager.d.ts.map +0 -1
- package/dist/fork/manager.js.map +0 -1
- package/dist/fork/server.d.ts.map +0 -1
- package/dist/fork/server.js.map +0 -1
- package/dist/fork/storage.d.ts.map +0 -1
- package/dist/fork/storage.js.map +0 -1
- package/dist/fork/test.d.ts.map +0 -1
- package/dist/fork/test.js.map +0 -1
- package/dist/harness/Harness.d.ts.map +0 -1
- package/dist/harness/Harness.js.map +0 -1
- package/dist/harness/codeObject.d.ts.map +0 -1
- package/dist/harness/codeObject.js.map +0 -1
- package/dist/harness/errors.d.ts.map +0 -1
- package/dist/harness/errors.js.map +0 -1
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/proxy.d.ts.map +0 -1
- package/dist/harness/proxy.js.map +0 -1
- package/dist/harness/script.d.ts.map +0 -1
- package/dist/harness/script.js.map +0 -1
- package/dist/harness/view.d.ts.map +0 -1
- package/dist/harness/view.js.map +0 -1
- package/dist/helpers/__tests__/semver-utils.test.d.ts +0 -2
- package/dist/helpers/__tests__/semver-utils.test.d.ts.map +0 -1
- package/dist/helpers/__tests__/semver-utils.test.js +0 -103
- package/dist/helpers/__tests__/semver-utils.test.js.map +0 -1
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.d.ts +0 -2
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.d.ts.map +0 -1
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.js +0 -172
- package/dist/helpers/__tests__/setupLocalTesting.fork-network.test.js.map +0 -1
- package/dist/helpers/assertions.d.ts.map +0 -1
- package/dist/helpers/assertions.js.map +0 -1
- package/dist/helpers/banner.d.ts.map +0 -1
- package/dist/helpers/banner.js.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/index.js.map +0 -1
- package/dist/helpers/move-tests.d.ts.map +0 -1
- package/dist/helpers/move-tests.js.map +0 -1
- package/dist/helpers/npm-registry.d.ts.map +0 -1
- package/dist/helpers/npm-registry.js.map +0 -1
- package/dist/helpers/semver-utils.d.ts.map +0 -1
- package/dist/helpers/semver-utils.js.map +0 -1
- package/dist/helpers/setup.d.ts.map +0 -1
- package/dist/helpers/setup.js.map +0 -1
- package/dist/helpers/setupLocalTesting.d.ts.map +0 -1
- package/dist/helpers/setupLocalTesting.js.map +0 -1
- package/dist/helpers/testFixtures.d.ts.map +0 -1
- package/dist/helpers/testFixtures.js.map +0 -1
- package/dist/helpers/version-check.d.ts.map +0 -1
- package/dist/helpers/version-check.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/node/LocalNodeManager.d.ts.map +0 -1
- package/dist/node/LocalNodeManager.js.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.api-port.test.d.ts +0 -2
- package/dist/node/__tests__/LocalNodeManager.api-port.test.d.ts.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.api-port.test.js +0 -55
- package/dist/node/__tests__/LocalNodeManager.api-port.test.js.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.test.d.ts +0 -2
- package/dist/node/__tests__/LocalNodeManager.test.d.ts.map +0 -1
- package/dist/node/__tests__/LocalNodeManager.test.js +0 -449
- package/dist/node/__tests__/LocalNodeManager.test.js.map +0 -1
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/config.js.map +0 -1
- package/dist/types/fork.d.ts.map +0 -1
- package/dist/types/fork.js.map +0 -1
- package/dist/types/harness.d.ts.map +0 -1
- package/dist/types/harness.js.map +0 -1
- package/dist/types/runtime.d.ts.map +0 -1
- package/dist/types/runtime.js.map +0 -1
- package/dist/ui/__tests__/colors.test.d.ts +0 -2
- package/dist/ui/__tests__/colors.test.d.ts.map +0 -1
- package/dist/ui/__tests__/colors.test.js +0 -127
- package/dist/ui/__tests__/colors.test.js.map +0 -1
- package/dist/ui/__tests__/logger.test.d.ts +0 -2
- package/dist/ui/__tests__/logger.test.d.ts.map +0 -1
- package/dist/ui/__tests__/logger.test.js +0 -75
- package/dist/ui/__tests__/logger.test.js.map +0 -1
- package/dist/ui/colors.d.ts.map +0 -1
- package/dist/ui/colors.js.map +0 -1
- package/dist/ui/formatters.d.ts.map +0 -1
- package/dist/ui/formatters.js.map +0 -1
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/logger.d.ts.map +0 -1
- package/dist/ui/logger.js.map +0 -1
- package/dist/ui/spinner.d.ts.map +0 -1
- package/dist/ui/spinner.js.map +0 -1
- package/dist/ui/symbols.d.ts.map +0 -1
- package/dist/ui/symbols.js.map +0 -1
- package/dist/ui/table.d.ts.map +0 -1
- package/dist/ui/table.js.map +0 -1
- package/dist/utils/__tests__/address.test.d.ts +0 -2
- package/dist/utils/__tests__/address.test.d.ts.map +0 -1
- package/dist/utils/__tests__/address.test.js +0 -70
- package/dist/utils/__tests__/address.test.js.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.d.ts +0 -2
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.d.ts.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.js +0 -43
- package/dist/utils/__tests__/childProcessAdapter.maxBuffer.test.js.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts +0 -2
- package/dist/utils/__tests__/childProcessAdapter.test.d.ts.map +0 -1
- package/dist/utils/__tests__/childProcessAdapter.test.js +0 -217
- package/dist/utils/__tests__/childProcessAdapter.test.js.map +0 -1
- package/dist/utils/__tests__/runCli.test.d.ts +0 -2
- package/dist/utils/__tests__/runCli.test.d.ts.map +0 -1
- package/dist/utils/__tests__/runCli.test.js +0 -187
- package/dist/utils/__tests__/runCli.test.js.map +0 -1
- package/dist/utils/address.d.ts.map +0 -1
- package/dist/utils/address.js.map +0 -1
- package/dist/utils/childProcessAdapter.d.ts.map +0 -1
- package/dist/utils/childProcessAdapter.js.map +0 -1
- package/dist/utils/parseCliOutput.d.ts.map +0 -1
- package/dist/utils/parseCliOutput.js.map +0 -1
- package/dist/utils/redact.d.ts.map +0 -1
- package/dist/utils/redact.js.map +0 -1
- package/dist/utils/runCli.d.ts.map +0 -1
- package/dist/utils/runCli.js.map +0 -1
- package/src/__tests__/deployContract.test.ts +0 -438
- package/src/__tests__/errors.test.ts +0 -84
- package/src/__tests__/exports.test.ts +0 -32
- package/src/__tests__/fixtures/sigint-deploy-harness.ts +0 -96
- package/src/__tests__/fork/api.test.ts +0 -148
- package/src/__tests__/fork/api.timeout.test.ts +0 -150
- package/src/__tests__/harness/Harness.createLive.test.ts +0 -57
- package/src/__tests__/harness/Harness.proxy.test.ts +0 -111
- package/src/__tests__/harness/_fixture.ts +0 -131
- package/src/__tests__/harness/codeObject.deploy.test.ts +0 -319
- package/src/__tests__/harness/codeObject.upgrade.test.ts +0 -156
- package/src/__tests__/harness/script.test.ts +0 -245
- package/src/__tests__/harness/view.test.ts +0 -104
- package/src/__tests__/runtime.test.ts +0 -182
- package/src/cli.ts +0 -164
- package/src/commands/__tests__/compile.test.ts +0 -407
- package/src/commands/__tests__/compile.toml-mutation.test.ts +0 -77
- package/src/commands/__tests__/init.test.ts +0 -210
- package/src/commands/__tests__/run.test.ts +0 -192
- package/src/commands/__tests__/test-move.test.ts +0 -81
- package/src/commands/__tests__/test.test.ts +0 -204
- package/src/commands/__tests__/update.test.ts +0 -223
- package/src/commands/compile.ts +0 -339
- package/src/commands/fork/__tests__/create.test.ts +0 -132
- package/src/commands/fork/__tests__/fund.test.ts +0 -104
- package/src/commands/fork/__tests__/list.test.ts +0 -139
- package/src/commands/fork/__tests__/serve.test.ts +0 -121
- package/src/commands/fork/__tests__/view-resource.test.ts +0 -101
- package/src/commands/fork/create.ts +0 -110
- package/src/commands/fork/fund.ts +0 -64
- package/src/commands/fork/list.ts +0 -98
- package/src/commands/fork/serve.ts +0 -80
- package/src/commands/fork/view-resource.ts +0 -51
- package/src/commands/init.ts +0 -264
- package/src/commands/run.ts +0 -125
- package/src/commands/test-move.ts +0 -27
- package/src/commands/test.ts +0 -255
- package/src/commands/update.ts +0 -201
- package/src/core/AccountManager.ts +0 -457
- package/src/core/Publisher.ts +0 -310
- package/src/core/__tests__/AccountManager.global-state.test.ts +0 -83
- package/src/core/__tests__/AccountManager.test.ts +0 -290
- package/src/core/__tests__/config.test.ts +0 -377
- package/src/core/__tests__/deployments.test.ts +0 -247
- package/src/core/__tests__/movementProfile.test.ts +0 -131
- package/src/core/__tests__/shell.test.ts +0 -138
- package/src/core/config.ts +0 -286
- package/src/core/contract.ts +0 -103
- package/src/core/deployments.ts +0 -155
- package/src/core/movementProfile.ts +0 -127
- package/src/core/shell.ts +0 -86
- package/src/errors.ts +0 -81
- package/src/fork/__tests__/manager.test.ts +0 -385
- package/src/fork/__tests__/server.cors.test.ts +0 -101
- package/src/fork/__tests__/server.test.ts +0 -65
- package/src/fork/__tests__/storage.test.ts +0 -281
- package/src/fork/__tests__/test.test.ts +0 -97
- package/src/fork/api.ts +0 -190
- package/src/fork/manager.ts +0 -343
- package/src/fork/server.ts +0 -380
- package/src/fork/storage.ts +0 -253
- package/src/fork/test.ts +0 -221
- package/src/harness/Harness.ts +0 -231
- package/src/harness/codeObject.ts +0 -381
- package/src/harness/errors.ts +0 -22
- package/src/harness/index.ts +0 -3
- package/src/harness/proxy.ts +0 -40
- package/src/harness/script.ts +0 -200
- package/src/harness/view.ts +0 -34
- package/src/helpers/__tests__/semver-utils.test.ts +0 -121
- package/src/helpers/__tests__/setupLocalTesting.fork-network.test.ts +0 -212
- package/src/helpers/assertions.ts +0 -29
- package/src/helpers/banner.ts +0 -63
- package/src/helpers/index.ts +0 -37
- package/src/helpers/move-tests.ts +0 -72
- package/src/helpers/npm-registry.ts +0 -72
- package/src/helpers/semver-utils.ts +0 -54
- package/src/helpers/setup.ts +0 -54
- package/src/helpers/setupLocalTesting.ts +0 -387
- package/src/helpers/testFixtures.ts +0 -210
- package/src/helpers/version-check.ts +0 -114
- package/src/index.ts +0 -30
- package/src/node/LocalNodeManager.ts +0 -383
- package/src/node/__tests__/LocalNodeManager.api-port.test.ts +0 -62
- package/src/node/__tests__/LocalNodeManager.test.ts +0 -579
- package/src/runtime.ts +0 -157
- package/src/templates/.env.example +0 -9
- package/src/templates/.mocharc.json +0 -8
- package/src/templates/.vscode/settings.json +0 -11
- package/src/templates/README.md +0 -146
- package/src/templates/gitignore +0 -22
- package/src/templates/move/Move.toml +0 -19
- package/src/templates/move/sources/Counter.move +0 -96
- package/src/templates/movehat.config.ts +0 -57
- package/src/templates/package.json +0 -27
- package/src/templates/scripts/deploy-counter.ts +0 -66
- package/src/templates/tests/Counter.test.ts +0 -113
- package/src/templates/tsconfig.json +0 -15
- package/src/templates/types/movehat.d.ts +0 -101
- package/src/types/config.ts +0 -83
- package/src/types/fork.ts +0 -47
- package/src/types/harness.ts +0 -182
- package/src/types/runtime.ts +0 -57
- package/src/ui/__tests__/colors.test.ts +0 -156
- package/src/ui/__tests__/logger.test.ts +0 -89
- package/src/ui/colors.ts +0 -144
- package/src/ui/formatters.ts +0 -246
- package/src/ui/index.ts +0 -62
- package/src/ui/logger.ts +0 -310
- package/src/ui/spinner.ts +0 -218
- package/src/ui/symbols.ts +0 -80
- package/src/ui/table.ts +0 -191
- package/src/utils/__tests__/address.test.ts +0 -93
- package/src/utils/__tests__/childProcessAdapter.maxBuffer.test.ts +0 -51
- package/src/utils/__tests__/childProcessAdapter.test.ts +0 -266
- package/src/utils/__tests__/runCli.test.ts +0 -240
- package/src/utils/address.ts +0 -52
- package/src/utils/childProcessAdapter.ts +0 -244
- package/src/utils/parseCliOutput.ts +0 -27
- package/src/utils/redact.ts +0 -24
- package/src/utils/runCli.ts +0 -64
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import { homedir } from "os";
|
|
4
|
-
import { isNewerVersion } from "./semver-utils.js";
|
|
5
|
-
import { fetchLatestVersion } from "./npm-registry.js";
|
|
6
|
-
import { box, colors, formatCommand } from "../ui/index.js";
|
|
7
|
-
|
|
8
|
-
interface VersionCache {
|
|
9
|
-
lastChecked: number;
|
|
10
|
-
latestVersion: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const CACHE_DURATION = 24 * 60 * 60 * 1000; // 24 hours in milliseconds
|
|
14
|
-
const CACHE_DIR = join(homedir(), ".movehat");
|
|
15
|
-
const CACHE_FILE = join(CACHE_DIR, "version-cache.json");
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Read version from cache
|
|
19
|
-
*/
|
|
20
|
-
function readCache(): VersionCache | null {
|
|
21
|
-
try {
|
|
22
|
-
if (!existsSync(CACHE_FILE)) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const cacheContent = readFileSync(CACHE_FILE, "utf-8");
|
|
27
|
-
return JSON.parse(cacheContent) as VersionCache;
|
|
28
|
-
} catch (error) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Write version to cache
|
|
35
|
-
*/
|
|
36
|
-
function writeCache(latestVersion: string): void {
|
|
37
|
-
try {
|
|
38
|
-
if (!existsSync(CACHE_DIR)) {
|
|
39
|
-
mkdirSync(CACHE_DIR, { recursive: true });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const cache: VersionCache = {
|
|
43
|
-
lastChecked: Date.now(),
|
|
44
|
-
latestVersion,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
writeFileSync(CACHE_FILE, JSON.stringify(cache, null, 2));
|
|
48
|
-
} catch (error) {
|
|
49
|
-
// Silently fail - don't interrupt user's workflow
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Check if a newer version is available and notify the user
|
|
55
|
-
*
|
|
56
|
-
* This function:
|
|
57
|
-
* - Runs synchronously using cached version data
|
|
58
|
-
* - Displays update notification immediately if cache indicates newer version
|
|
59
|
-
* - Asynchronously updates cache in background (non-blocking)
|
|
60
|
-
* - Respects 24-hour cache duration to avoid excessive network requests
|
|
61
|
-
*
|
|
62
|
-
* @param currentVersion - Currently installed version (e.g., '1.0.0')
|
|
63
|
-
* @param packageName - npm package name to check (e.g., 'movehat')
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* checkForUpdates('1.0.0', 'movehat');
|
|
67
|
-
*/
|
|
68
|
-
export function checkForUpdates(currentVersion: string, packageName: string): void {
|
|
69
|
-
try {
|
|
70
|
-
// Skip update check for development versions (0.0.0)
|
|
71
|
-
if (currentVersion === '0.0.0') {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const cache = readCache();
|
|
76
|
-
let shouldNotify = false;
|
|
77
|
-
|
|
78
|
-
// Check cache synchronously for immediate notification
|
|
79
|
-
if (cache && isNewerVersion(currentVersion, cache.latestVersion)) {
|
|
80
|
-
shouldNotify = true;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// Display notification immediately if cache says there's an update
|
|
84
|
-
if (shouldNotify && cache) {
|
|
85
|
-
const updateMessage = box(
|
|
86
|
-
`${colors.brandBright('Update Available!')}\n\n` +
|
|
87
|
-
`${currentVersion} ${colors.dim('→')} ${colors.success(cache.latestVersion)}\n\n` +
|
|
88
|
-
`${formatCommand('movehat update')}`,
|
|
89
|
-
{ borderColor: 'warning', padding: 1 }
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
console.error('\n' + updateMessage + '\n');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Update cache in background if needed (doesn't block)
|
|
96
|
-
if (!cache || Date.now() - cache.lastChecked > CACHE_DURATION) {
|
|
97
|
-
setImmediate(async () => {
|
|
98
|
-
try {
|
|
99
|
-
const latestVersion = await fetchLatestVersion(packageName, {
|
|
100
|
-
timeout: 2000,
|
|
101
|
-
throwOnError: false,
|
|
102
|
-
});
|
|
103
|
-
if (latestVersion) {
|
|
104
|
-
writeCache(latestVersion);
|
|
105
|
-
}
|
|
106
|
-
} catch (error) {
|
|
107
|
-
// Silently fail
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
} catch (error) {
|
|
112
|
-
// Silently fail - never interrupt user's workflow
|
|
113
|
-
}
|
|
114
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Export all helpers for end users
|
|
2
|
-
export * from "./helpers/index.js";
|
|
3
|
-
export type { MovehatConfig } from "./types/config.js";
|
|
4
|
-
|
|
5
|
-
// Movehat Runtime Environment. `initRuntime` is a public utility but
|
|
6
|
-
// external callers should prefer Harness; it's the construction primitive
|
|
7
|
-
// `Harness.createLive` uses.
|
|
8
|
-
export { initRuntime } from "./runtime.js";
|
|
9
|
-
export type { MovehatRuntime, NetworkInfo } from "./types/runtime.js";
|
|
10
|
-
|
|
11
|
-
// Export Fork system
|
|
12
|
-
export { ForkManager } from "./fork/manager.js";
|
|
13
|
-
export { MovementApiClient } from "./fork/api.js";
|
|
14
|
-
export { ForkStorage } from "./fork/storage.js";
|
|
15
|
-
export { ForkServer } from "./fork/server.js";
|
|
16
|
-
export type { ForkMetadata, AccountState, LedgerInfo, AccountData, AccountResource } from "./types/fork.js";
|
|
17
|
-
|
|
18
|
-
// Export custom errors
|
|
19
|
-
export { ModuleAlreadyDeployedError, PostPublishError } from "./errors.js";
|
|
20
|
-
|
|
21
|
-
export { Harness, HarnessDisposedError } from "./harness/index.js";
|
|
22
|
-
export type { HarnessMode } from "./harness/index.js";
|
|
23
|
-
export type {
|
|
24
|
-
DeployCodeObjectOptions,
|
|
25
|
-
UpgradeCodeObjectOptions,
|
|
26
|
-
CodeObjectInfo,
|
|
27
|
-
RunViewFunctionOptions,
|
|
28
|
-
RunMoveScriptOptions,
|
|
29
|
-
MoveScriptResult,
|
|
30
|
-
} from "./types/harness.js";
|
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
import { existsSync, rmSync } from "fs";
|
|
2
|
-
import { join } from "path";
|
|
3
|
-
import { Account } from "@aptos-labs/ts-sdk";
|
|
4
|
-
import {
|
|
5
|
-
defaultChildProcessAdapter,
|
|
6
|
-
type ChildProcessAdapter,
|
|
7
|
-
type SpawnedProcess,
|
|
8
|
-
} from "../utils/childProcessAdapter.js";
|
|
9
|
-
import { logger, isVerbose, colors, symbols } from "../ui/index.js";
|
|
10
|
-
import { withTimedSpinner, withSpinner } from "../ui/spinner.js";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Substrings that always surface from the movement subprocess regardless
|
|
14
|
-
* of verbosity. These are signals the user must see to debug a stuck
|
|
15
|
-
* startup (panic, fatal, address-in-use). Tested in
|
|
16
|
-
* __tests__/LocalNodeManager.test.ts to guard against silent regressions.
|
|
17
|
-
*/
|
|
18
|
-
const CRITICAL_NODE_OUTPUT = /panic|fatal|address already in use|EADDRINUSE/i;
|
|
19
|
-
|
|
20
|
-
export interface LocalNodeOptions {
|
|
21
|
-
testDir?: string; // Directory for node data (default: .movehat/local-node)
|
|
22
|
-
forceRestart?: boolean; // Clean state and start fresh
|
|
23
|
-
faucetPort?: number; // Faucet port (default: 8081)
|
|
24
|
-
/**
|
|
25
|
-
* REST API port. Movement CLI (`movement node run-localnet`) does
|
|
26
|
-
* not accept a flag to change this — the node always binds 8080.
|
|
27
|
-
* Passing any other value triggers a warning at construction time
|
|
28
|
-
* and is replaced with 8080. Field is kept for source compatibility.
|
|
29
|
-
*
|
|
30
|
-
* @deprecated Movement CLI does not honor this. Omit it.
|
|
31
|
-
*/
|
|
32
|
-
apiPort?: number;
|
|
33
|
-
readyPort?: number; // Ready server port (default: 8070)
|
|
34
|
-
silent?: boolean; // Suppress node output
|
|
35
|
-
/**
|
|
36
|
-
* Override the child-process adapter. Tests inject a fake adapter so
|
|
37
|
-
* the daemon spawn never reaches the real `movement` binary.
|
|
38
|
-
*/
|
|
39
|
-
adapter?: ChildProcessAdapter;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const MOVEMENT_API_PORT = 8080;
|
|
43
|
-
|
|
44
|
-
export interface LocalNodeInfo {
|
|
45
|
-
rpcUrl: string;
|
|
46
|
-
faucetUrl: string;
|
|
47
|
-
readyUrl: string;
|
|
48
|
-
testDir: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Manages the lifecycle of a local Movement node
|
|
53
|
-
*
|
|
54
|
-
* This class handles:
|
|
55
|
-
* - Starting/stopping a local Movement node
|
|
56
|
-
* - Health checks and ready detection
|
|
57
|
-
* - Auto-funding from the built-in faucet
|
|
58
|
-
* - Cleanup on shutdown
|
|
59
|
-
*/
|
|
60
|
-
export class LocalNodeManager {
|
|
61
|
-
private spawned: SpawnedProcess | null = null;
|
|
62
|
-
private killed = false;
|
|
63
|
-
private options: Required<Omit<LocalNodeOptions, "adapter">>;
|
|
64
|
-
private readonly adapter: ChildProcessAdapter;
|
|
65
|
-
private starting: boolean = false;
|
|
66
|
-
|
|
67
|
-
constructor(options: LocalNodeOptions = {}) {
|
|
68
|
-
this.adapter = options.adapter ?? defaultChildProcessAdapter;
|
|
69
|
-
if (
|
|
70
|
-
options.apiPort !== undefined &&
|
|
71
|
-
options.apiPort !== MOVEMENT_API_PORT
|
|
72
|
-
) {
|
|
73
|
-
// Movement CLI hardcodes the REST API port to 8080. Surfacing
|
|
74
|
-
// the requested port via getNodeInfo() would lie about where
|
|
75
|
-
// the node actually listens.
|
|
76
|
-
logger.warning(
|
|
77
|
-
`LocalNodeManager: apiPort=${options.apiPort} is not supported by ` +
|
|
78
|
-
`movement node run-localnet; forcing REST API port to 8080.`
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
this.options = {
|
|
82
|
-
testDir: options.testDir || join(process.cwd(), ".movehat", "local-node"),
|
|
83
|
-
forceRestart: options.forceRestart ?? false,
|
|
84
|
-
faucetPort: options.faucetPort || 8081,
|
|
85
|
-
apiPort: MOVEMENT_API_PORT,
|
|
86
|
-
readyPort: options.readyPort || 8070,
|
|
87
|
-
silent: options.silent ?? false,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Start the local Movement node
|
|
93
|
-
*
|
|
94
|
-
* @returns LocalNodeInfo with connection details
|
|
95
|
-
*/
|
|
96
|
-
async start(): Promise<LocalNodeInfo> {
|
|
97
|
-
if (this.spawned) {
|
|
98
|
-
logger.info("Local node already running");
|
|
99
|
-
return this.getNodeInfo();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (this.starting) {
|
|
103
|
-
throw new Error("Node is already starting");
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
this.starting = true;
|
|
107
|
-
|
|
108
|
-
try {
|
|
109
|
-
logger.newline();
|
|
110
|
-
logger.step("Starting local Movement node");
|
|
111
|
-
logger.kv("Test directory", this.options.testDir, 2);
|
|
112
|
-
logger.kv("RPC port", String(this.options.apiPort), 2);
|
|
113
|
-
logger.kv("Faucet port", String(this.options.faucetPort), 2);
|
|
114
|
-
logger.kv("Ready port", String(this.options.readyPort), 2);
|
|
115
|
-
logger.newline();
|
|
116
|
-
|
|
117
|
-
// Clean state if force restart
|
|
118
|
-
if (this.options.forceRestart && existsSync(this.options.testDir)) {
|
|
119
|
-
logger.step("Cleaning previous node state...");
|
|
120
|
-
rmSync(this.options.testDir, { recursive: true, force: true });
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Build command arguments
|
|
124
|
-
const args = [
|
|
125
|
-
"node",
|
|
126
|
-
"run-localnet",
|
|
127
|
-
"--test-dir", this.options.testDir,
|
|
128
|
-
"--faucet-port", this.options.faucetPort.toString(),
|
|
129
|
-
"--ready-server-listen-port", this.options.readyPort.toString(),
|
|
130
|
-
"--assume-yes", // Auto-accept prompts
|
|
131
|
-
];
|
|
132
|
-
|
|
133
|
-
if (this.options.forceRestart) {
|
|
134
|
-
args.push("--force-restart");
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Start the node process via the injectable adapter.
|
|
138
|
-
this.killed = false;
|
|
139
|
-
this.spawned = this.adapter.spawn({
|
|
140
|
-
command: "movement",
|
|
141
|
-
args,
|
|
142
|
-
stdio: this.options.silent ? "ignore" : "pipe",
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
// Subprocess output handling (see §9 Console UX in CLAUDE.md):
|
|
146
|
-
// - stdout chatter is hidden by default; gated by isVerbose()
|
|
147
|
-
// - lines matching CRITICAL_NODE_OUTPUT always surface as warnings
|
|
148
|
-
// so the user is never silenced through a real failure
|
|
149
|
-
// - stderr is always surfaced (real signal), modulo benign WARN
|
|
150
|
-
// lines that the movement binary emits during normal startup
|
|
151
|
-
if (!this.options.silent && this.spawned.stdout && this.spawned.stderr) {
|
|
152
|
-
this.spawned.stdout.on("data", (data: Buffer) => {
|
|
153
|
-
const output = data.toString().trim();
|
|
154
|
-
if (!output) return;
|
|
155
|
-
if (CRITICAL_NODE_OUTPUT.test(output)) {
|
|
156
|
-
logger.warning(output);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
if (isVerbose()) {
|
|
160
|
-
for (const line of output.split("\n")) {
|
|
161
|
-
if (line) console.log(` ${colors.muted(symbols.pointer + " " + line)}`);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
this.spawned.stderr.on("data", (data: Buffer) => {
|
|
167
|
-
const output = data.toString().trim();
|
|
168
|
-
if (!output) return;
|
|
169
|
-
// Movement CLI uses stderr for both progress messages
|
|
170
|
-
// ("Applying post startup steps...", "Compiling...") and
|
|
171
|
-
// real errors. Stream channel alone isn't a reliable
|
|
172
|
-
// signal — gate routine lines behind verbosity, escalate
|
|
173
|
-
// anything matching CRITICAL_NODE_OUTPUT regardless.
|
|
174
|
-
if (CRITICAL_NODE_OUTPUT.test(output)) {
|
|
175
|
-
logger.error(output);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
if (isVerbose()) {
|
|
179
|
-
for (const line of output.split("\n")) {
|
|
180
|
-
if (line) console.error(` ${colors.muted(symbols.pointer + " " + line)}`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// The adapter's `exited` promise settles on both natural exit and on
|
|
187
|
-
// spawn-time error (e.g. ENOENT). On error the code is `null` — we don't
|
|
188
|
-
// log a generic "spawn failed" message here because `waitForReady` will
|
|
189
|
-
// surface a detailed timeout-with-hints error if movement never starts.
|
|
190
|
-
void this.spawned.exited.then(({ code }) => {
|
|
191
|
-
if (code !== null && code !== 0) {
|
|
192
|
-
logger.error(`Local node exited with code ${code}`);
|
|
193
|
-
}
|
|
194
|
-
this.spawned = null;
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
// Wait for node to be ready — wrapped in withTimedSpinner so the
|
|
198
|
-
// user sees live elapsed-time feedback while subprocess chatter is
|
|
199
|
-
// hidden in non-verbose mode.
|
|
200
|
-
await withTimedSpinner("Waiting for node to be ready", () =>
|
|
201
|
-
this.waitForReady(60000)
|
|
202
|
-
);
|
|
203
|
-
|
|
204
|
-
logger.newline();
|
|
205
|
-
|
|
206
|
-
this.starting = false;
|
|
207
|
-
return this.getNodeInfo();
|
|
208
|
-
|
|
209
|
-
} catch (error) {
|
|
210
|
-
this.starting = false;
|
|
211
|
-
|
|
212
|
-
// Cleanup on failure
|
|
213
|
-
if (this.spawned) {
|
|
214
|
-
this.killed = true;
|
|
215
|
-
this.spawned.kill();
|
|
216
|
-
this.spawned = null;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
throw error;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Stop the local node
|
|
225
|
-
*/
|
|
226
|
-
async stop(): Promise<void> {
|
|
227
|
-
if (!this.spawned) {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
logger.newline();
|
|
232
|
-
logger.step("Stopping local Movement node...");
|
|
233
|
-
|
|
234
|
-
const spawned = this.spawned;
|
|
235
|
-
|
|
236
|
-
// Mark killed synchronously so isRunning() reflects the intent right away,
|
|
237
|
-
// mirroring node's ChildProcess.killed semantics.
|
|
238
|
-
this.killed = true;
|
|
239
|
-
|
|
240
|
-
// Send SIGTERM for graceful shutdown
|
|
241
|
-
spawned.kill("SIGTERM");
|
|
242
|
-
|
|
243
|
-
// Force kill after 5 seconds if still running
|
|
244
|
-
const forceTimer = setTimeout(() => {
|
|
245
|
-
if (this.spawned === spawned) {
|
|
246
|
-
logger.warning("Force killing node...");
|
|
247
|
-
spawned.kill("SIGKILL");
|
|
248
|
-
}
|
|
249
|
-
}, 5000);
|
|
250
|
-
|
|
251
|
-
try {
|
|
252
|
-
await spawned.exited;
|
|
253
|
-
logger.success("Local node stopped");
|
|
254
|
-
logger.newline();
|
|
255
|
-
} finally {
|
|
256
|
-
clearTimeout(forceTimer);
|
|
257
|
-
if (this.spawned === spawned) {
|
|
258
|
-
this.spawned = null;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Check if the node is running
|
|
265
|
-
*/
|
|
266
|
-
isRunning(): boolean {
|
|
267
|
-
return this.spawned !== null && !this.killed;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Get node connection info
|
|
272
|
-
*/
|
|
273
|
-
getNodeInfo(): LocalNodeInfo {
|
|
274
|
-
return {
|
|
275
|
-
rpcUrl: `http://127.0.0.1:${this.options.apiPort}`,
|
|
276
|
-
faucetUrl: `http://127.0.0.1:${this.options.faucetPort}`,
|
|
277
|
-
readyUrl: `http://127.0.0.1:${this.options.readyPort}`,
|
|
278
|
-
testDir: this.options.testDir,
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Wait for the node to be ready by checking the ready endpoint
|
|
284
|
-
*/
|
|
285
|
-
private async waitForReady(timeoutMs: number = 60000): Promise<void> {
|
|
286
|
-
const startTime = Date.now();
|
|
287
|
-
const readyUrl = `http://127.0.0.1:${this.options.readyPort}`;
|
|
288
|
-
|
|
289
|
-
while (Date.now() - startTime < timeoutMs) {
|
|
290
|
-
try {
|
|
291
|
-
const response = await fetch(readyUrl);
|
|
292
|
-
|
|
293
|
-
if (response.ok) {
|
|
294
|
-
return; // Node is ready!
|
|
295
|
-
}
|
|
296
|
-
} catch (error) {
|
|
297
|
-
// Node not ready yet, continue waiting
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// Wait 1 second before next check
|
|
301
|
-
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
throw new Error(
|
|
305
|
-
`Local node did not become ready within ${timeoutMs / 1000} seconds. ` +
|
|
306
|
-
`Check that 'movement' CLI is installed and ports ${this.options.apiPort}, ` +
|
|
307
|
-
`${this.options.faucetPort}, and ${this.options.readyPort} are available.`
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Fund an account using the local faucet
|
|
313
|
-
*
|
|
314
|
-
* @param account Account instance or address to fund
|
|
315
|
-
* @param amount Amount in octas (default: 100_000_000 = 1 MOVE)
|
|
316
|
-
*/
|
|
317
|
-
async fundAccount(account: Account | string, amount: number = 100_000_000): Promise<void> {
|
|
318
|
-
if (!this.isRunning()) {
|
|
319
|
-
throw new Error("Local node is not running. Call start() first.");
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
// Extract address if Account is provided
|
|
323
|
-
const address = typeof account === 'string'
|
|
324
|
-
? account
|
|
325
|
-
: account.accountAddress.toString();
|
|
326
|
-
|
|
327
|
-
// Use query parameters for the Movement faucet
|
|
328
|
-
const faucetUrl = `http://127.0.0.1:${this.options.faucetPort}/mint?amount=${amount}&address=${address}`;
|
|
329
|
-
|
|
330
|
-
try {
|
|
331
|
-
const response = await fetch(faucetUrl, {
|
|
332
|
-
method: "POST",
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
if (!response.ok) {
|
|
336
|
-
const errorText = await response.text();
|
|
337
|
-
throw new Error(`Faucet request failed: ${errorText}`);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const result = await response.json();
|
|
341
|
-
if (isVerbose()) {
|
|
342
|
-
logger.success(`Funded ${address} with ${amount} octas`, 2);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
return result;
|
|
346
|
-
} catch (error) {
|
|
347
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
348
|
-
throw new Error(`Failed to fund account: ${msg}`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* Fund multiple accounts in batch
|
|
354
|
-
*/
|
|
355
|
-
async fundAccounts(accounts: (Account | string)[], amount: number = 100_000_000): Promise<void> {
|
|
356
|
-
logger.newline();
|
|
357
|
-
await withSpinner(
|
|
358
|
-
`Funding ${accounts.length} accounts from local faucet`,
|
|
359
|
-
async () => {
|
|
360
|
-
for (const account of accounts) {
|
|
361
|
-
await this.fundAccount(account, amount);
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
`Funded ${accounts.length} accounts (${(amount / 1e8).toFixed(0)} MOVE each)`,
|
|
365
|
-
);
|
|
366
|
-
logger.newline();
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Clean up node data directory
|
|
371
|
-
*/
|
|
372
|
-
async clean(): Promise<void> {
|
|
373
|
-
if (this.isRunning()) {
|
|
374
|
-
throw new Error("Cannot clean while node is running. Stop the node first.");
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
if (existsSync(this.options.testDir)) {
|
|
378
|
-
logger.step(`Cleaning node data at ${this.options.testDir}...`);
|
|
379
|
-
rmSync(this.options.testDir, { recursive: true, force: true });
|
|
380
|
-
logger.success("Node data cleaned");
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { mkdtempSync, rmSync } from "node:fs";
|
|
3
|
-
import { tmpdir } from "node:os";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
|
|
6
|
-
import { LocalNodeManager } from "../LocalNodeManager.js";
|
|
7
|
-
import { logger } from "../../ui/index.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* F9 — `apiPort` must not lie about where the node listens.
|
|
11
|
-
*
|
|
12
|
-
* `movement node run-localnet` (Movement CLI 7.4.0) does NOT accept a
|
|
13
|
-
* flag to change the REST API port. It always binds 8080. Earlier
|
|
14
|
-
* versions of LocalNodeManager accepted `apiPort: 9000` from the
|
|
15
|
-
* caller, stored it, and surfaced `http://127.0.0.1:9000` from
|
|
16
|
-
* `getNodeInfo()` — but the actual node was still on 8080. That
|
|
17
|
-
* mismatch would silently surface as "Movement command failed" with
|
|
18
|
-
* no useful signal. F9 closes the gap by refusing to lie: the
|
|
19
|
-
* effective port is 8080 regardless of what the caller passes, with a
|
|
20
|
-
* warning when they pass anything else.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
describe("F9 — LocalNodeManager apiPort is constrained to 8080", () => {
|
|
24
|
-
let tmpDir: string;
|
|
25
|
-
let warnSpy: ReturnType<typeof vi.spyOn>;
|
|
26
|
-
|
|
27
|
-
beforeEach(() => {
|
|
28
|
-
tmpDir = mkdtempSync(join(tmpdir(), "movehat-f9-"));
|
|
29
|
-
warnSpy = vi.spyOn(logger, "warning").mockImplementation(() => undefined);
|
|
30
|
-
vi.spyOn(logger, "step").mockImplementation(() => undefined);
|
|
31
|
-
vi.spyOn(logger, "plain").mockImplementation(() => undefined);
|
|
32
|
-
vi.spyOn(logger, "newline").mockImplementation(() => undefined);
|
|
33
|
-
vi.spyOn(logger, "success").mockImplementation(() => undefined);
|
|
34
|
-
vi.spyOn(logger, "error").mockImplementation(() => undefined);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
afterEach(() => {
|
|
38
|
-
vi.restoreAllMocks();
|
|
39
|
-
rmSync(tmpDir, { recursive: true, force: true });
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("ignores non-default apiPort, forces 8080, and warns", () => {
|
|
43
|
-
const mgr = new LocalNodeManager({ testDir: tmpDir, apiPort: 9000 });
|
|
44
|
-
expect(mgr.getNodeInfo().rpcUrl).toBe("http://127.0.0.1:8080");
|
|
45
|
-
expect(warnSpy).toHaveBeenCalledTimes(1);
|
|
46
|
-
const msg = warnSpy.mock.calls[0]?.[0] as string;
|
|
47
|
-
expect(msg).toMatch(/8080/);
|
|
48
|
-
expect(msg).toMatch(/apiPort|REST API port/i);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("accepts apiPort: 8080 without warning", () => {
|
|
52
|
-
const mgr = new LocalNodeManager({ testDir: tmpDir, apiPort: 8080 });
|
|
53
|
-
expect(mgr.getNodeInfo().rpcUrl).toBe("http://127.0.0.1:8080");
|
|
54
|
-
expect(warnSpy).not.toHaveBeenCalled();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("accepts omitted apiPort without warning (default path)", () => {
|
|
58
|
-
const mgr = new LocalNodeManager({ testDir: tmpDir });
|
|
59
|
-
expect(mgr.getNodeInfo().rpcUrl).toBe("http://127.0.0.1:8080");
|
|
60
|
-
expect(warnSpy).not.toHaveBeenCalled();
|
|
61
|
-
});
|
|
62
|
-
});
|