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,80 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import { existsSync } from 'fs';
|
|
3
|
-
import { loadUserConfig } from '../../core/config.js';
|
|
4
|
-
import { ForkServer } from '../../fork/server.js';
|
|
5
|
-
|
|
6
|
-
interface ForkServeOptions {
|
|
7
|
-
fork?: string;
|
|
8
|
-
port?: number;
|
|
9
|
-
host?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Fork serve command: Start a local RPC server serving the fork
|
|
14
|
-
*/
|
|
15
|
-
export default async function forkServeCommand(options: ForkServeOptions): Promise<void> {
|
|
16
|
-
try {
|
|
17
|
-
// Determine fork path
|
|
18
|
-
let forkPath: string;
|
|
19
|
-
|
|
20
|
-
if (options.fork) {
|
|
21
|
-
// Use specified path
|
|
22
|
-
forkPath = options.fork;
|
|
23
|
-
} else {
|
|
24
|
-
// Use default fork path based on current network
|
|
25
|
-
const config = await loadUserConfig();
|
|
26
|
-
const networkName = process.env.MH_CLI_NETWORK || config.defaultNetwork || 'testnet';
|
|
27
|
-
|
|
28
|
-
// Lightweight validation: only check if network exists in config
|
|
29
|
-
// Don't validate accounts/keys since fork serve only reads data
|
|
30
|
-
if (!config.networks || !config.networks[networkName]) {
|
|
31
|
-
throw new Error(`Network "${networkName}" not found in config. Available networks: ${Object.keys(config.networks || {}).join(', ')}`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
forkPath = join(process.cwd(), '.movehat', 'forks', `${networkName}-fork`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Verify fork exists
|
|
38
|
-
if (!existsSync(join(forkPath, 'metadata.json'))) {
|
|
39
|
-
console.error(`\nError: Fork not found at ${forkPath}`);
|
|
40
|
-
console.error(`\nCreate a fork first with:`);
|
|
41
|
-
console.error(` movehat fork create --network <network> --name <name>`);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Get port (already validated by Commander's parsePort in cli.ts)
|
|
46
|
-
const port = options.port ?? 8080;
|
|
47
|
-
const host = options.host ?? '127.0.0.1';
|
|
48
|
-
|
|
49
|
-
// Create and start server
|
|
50
|
-
const server = new ForkServer(forkPath, port, host);
|
|
51
|
-
|
|
52
|
-
// Handle graceful shutdown (use 'once' to prevent duplicate shutdowns)
|
|
53
|
-
const shutdown = async () => {
|
|
54
|
-
console.log('\n\nShutting down...');
|
|
55
|
-
await server.stop();
|
|
56
|
-
process.exit(0);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// Use named handlers so we can remove them if needed
|
|
60
|
-
const sigintHandler = () => { void shutdown(); };
|
|
61
|
-
const sigtermHandler = () => { void shutdown(); };
|
|
62
|
-
|
|
63
|
-
process.once('SIGINT', sigintHandler);
|
|
64
|
-
process.once('SIGTERM', sigtermHandler);
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
// Start server
|
|
68
|
-
await server.start();
|
|
69
|
-
} finally {
|
|
70
|
-
// Remove handlers in case server is stopped by other means
|
|
71
|
-
process.removeListener('SIGINT', sigintHandler);
|
|
72
|
-
process.removeListener('SIGTERM', sigtermHandler);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
} catch (error) {
|
|
76
|
-
const msg = error instanceof Error ? error.message : String(error);
|
|
77
|
-
console.error(`\nError starting fork server:`, msg);
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import { ForkManager } from '../../fork/manager.js';
|
|
3
|
-
import { logger } from '../../ui/index.js';
|
|
4
|
-
|
|
5
|
-
interface ForkViewResourceOptions {
|
|
6
|
-
fork?: string;
|
|
7
|
-
account: string;
|
|
8
|
-
resource: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Fork view-resource command: View a resource from the fork
|
|
13
|
-
*/
|
|
14
|
-
export default async function forkViewResourceCommand(options: ForkViewResourceOptions) {
|
|
15
|
-
try {
|
|
16
|
-
if (!options.account) {
|
|
17
|
-
throw new Error('--account is required');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
if (!options.resource) {
|
|
21
|
-
throw new Error('--resource is required');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Determine fork path
|
|
25
|
-
const forkPath = options.fork || join(process.cwd(), '.movehat', 'forks', 'testnet-fork');
|
|
26
|
-
|
|
27
|
-
logger.newline();
|
|
28
|
-
logger.step("Viewing resource from fork");
|
|
29
|
-
logger.plain(` Fork: ${forkPath}`);
|
|
30
|
-
logger.plain(` Account: ${options.account}`);
|
|
31
|
-
logger.plain(` Resource: ${options.resource}`);
|
|
32
|
-
logger.newline();
|
|
33
|
-
|
|
34
|
-
// Load fork
|
|
35
|
-
const forkManager = new ForkManager(forkPath);
|
|
36
|
-
forkManager.load();
|
|
37
|
-
|
|
38
|
-
// Get resource
|
|
39
|
-
const resource = await forkManager.getResource(options.account, options.resource);
|
|
40
|
-
|
|
41
|
-
// Display result
|
|
42
|
-
console.log(JSON.stringify(resource, null, 2));
|
|
43
|
-
console.log('');
|
|
44
|
-
|
|
45
|
-
} catch (error) {
|
|
46
|
-
logger.newline();
|
|
47
|
-
logger.error(error instanceof Error ? error.message : String(error));
|
|
48
|
-
logger.newline();
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
}
|
package/src/commands/init.ts
DELETED
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import fs from "fs/promises";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import prompts from "prompts";
|
|
5
|
-
import { printMovehatBanner } from "../helpers/banner.js";
|
|
6
|
-
import { logger, createSpinnerChain, formatCommand } from "../ui/index.js";
|
|
7
|
-
|
|
8
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
-
const __dirname = path.dirname(__filename);
|
|
10
|
-
|
|
11
|
-
export class InvalidProjectNameError extends Error {
|
|
12
|
-
constructor(message: string) {
|
|
13
|
-
super(message);
|
|
14
|
-
this.name = "InvalidProjectNameError";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ProjectNames {
|
|
19
|
-
/** User input as-is (after trim) — used for the filesystem target. */
|
|
20
|
-
dirName: string;
|
|
21
|
-
/** Basename of the resolved path — used for package.json + README.md. */
|
|
22
|
-
npmName: string;
|
|
23
|
-
/** Valid Move identifier — used for Move.toml. */
|
|
24
|
-
moveName: string;
|
|
25
|
-
/** True when moveName had to diverge from npmName to satisfy Move identifier rules. */
|
|
26
|
-
sanitized: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Derive filesystem, npm, and Move identifier names from a single user input.
|
|
31
|
-
*
|
|
32
|
-
* Move identifiers must match `[a-zA-Z_][a-zA-Z0-9_]*`. npm package names are
|
|
33
|
-
* looser (hyphens allowed). The filesystem accepts almost anything. Rather
|
|
34
|
-
* than reject inputs that would compile fine for npm but not for Move, we
|
|
35
|
-
* sanitize the Move identifier and leave the npm name + dir unchanged.
|
|
36
|
-
*/
|
|
37
|
-
export function resolveProjectNames(input: string): ProjectNames {
|
|
38
|
-
const trimmed = input.trim();
|
|
39
|
-
if (
|
|
40
|
-
trimmed === "" ||
|
|
41
|
-
trimmed === "." ||
|
|
42
|
-
trimmed === ".." ||
|
|
43
|
-
/^\/+$/.test(trimmed)
|
|
44
|
-
) {
|
|
45
|
-
throw new InvalidProjectNameError(
|
|
46
|
-
`Project name '${input}' must include at least one character besides path separators.`
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const dirName = trimmed;
|
|
51
|
-
const npmName = path.basename(path.resolve(trimmed));
|
|
52
|
-
let moveName = npmName.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
53
|
-
if (!/^[a-zA-Z_]/.test(moveName)) {
|
|
54
|
-
moveName = `pkg_${moveName}`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
dirName,
|
|
59
|
-
npmName,
|
|
60
|
-
moveName,
|
|
61
|
-
sanitized: moveName !== npmName,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Initialize a new Movehat project with template files
|
|
67
|
-
*
|
|
68
|
-
* Creates a complete project structure including:
|
|
69
|
-
* - Configuration files (movehat.config.ts, .env, .gitignore, package.json)
|
|
70
|
-
* - Move smart contract templates
|
|
71
|
-
* - Deployment scripts
|
|
72
|
-
* - Test files
|
|
73
|
-
*
|
|
74
|
-
* @param projectName - Optional project name. If not provided, user will be prompted
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* // With project name
|
|
78
|
-
* await initCommand('my-project');
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* // Interactive prompt
|
|
82
|
-
* await initCommand();
|
|
83
|
-
*/
|
|
84
|
-
export default async function initCommand(projectName?: string) {
|
|
85
|
-
// Show banner only on init command
|
|
86
|
-
printMovehatBanner();
|
|
87
|
-
|
|
88
|
-
// if name is not given
|
|
89
|
-
if (!projectName) {
|
|
90
|
-
const response = await prompts({
|
|
91
|
-
type: 'text',
|
|
92
|
-
name: 'projectName',
|
|
93
|
-
message: 'Project name:',
|
|
94
|
-
initial: 'first-project'
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
// If the user cancels (Ctrl+C), exit
|
|
98
|
-
if (!response.projectName) {
|
|
99
|
-
logger.warning('Project initialization cancelled.');
|
|
100
|
-
process.exit(0);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
projectName = response.projectName;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
let names: ProjectNames;
|
|
107
|
-
try {
|
|
108
|
-
names = resolveProjectNames(projectName!);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
if (error instanceof InvalidProjectNameError) {
|
|
111
|
-
logger.error(error.message);
|
|
112
|
-
process.exit(1);
|
|
113
|
-
}
|
|
114
|
-
throw error;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const { dirName, npmName, moveName, sanitized } = names;
|
|
118
|
-
const projectPath = path.resolve(process.cwd(), dirName);
|
|
119
|
-
|
|
120
|
-
if (sanitized) {
|
|
121
|
-
logger.warning(
|
|
122
|
-
`'${npmName}' is not a valid Move identifier; using '${moveName}' for move/Move.toml. (package.json keeps '${npmName}'.)`
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
logger.newline();
|
|
127
|
-
logger.info(`Initializing new Movehat project in ${projectPath}...`);
|
|
128
|
-
logger.newline();
|
|
129
|
-
|
|
130
|
-
try {
|
|
131
|
-
const templatesDir = path.join(__dirname, "..", "templates");
|
|
132
|
-
const steps = createSpinnerChain();
|
|
133
|
-
|
|
134
|
-
// Step 1: Create project structure
|
|
135
|
-
await steps.add('Creating project structure', async () => {
|
|
136
|
-
await fs.mkdir(projectPath, { recursive: true });
|
|
137
|
-
|
|
138
|
-
await copyFile(
|
|
139
|
-
path.join(templatesDir, "package.json"),
|
|
140
|
-
path.join(projectPath, "package.json"),
|
|
141
|
-
{ projectName: npmName }
|
|
142
|
-
);
|
|
143
|
-
|
|
144
|
-
await copyFile(
|
|
145
|
-
path.join(templatesDir, "tsconfig.json"),
|
|
146
|
-
path.join(projectPath, "tsconfig.json")
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
await copyFile(
|
|
150
|
-
path.join(templatesDir, ".mocharc.json"),
|
|
151
|
-
path.join(projectPath, ".mocharc.json")
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
await copyFile(
|
|
155
|
-
path.join(templatesDir, "movehat.config.ts"),
|
|
156
|
-
path.join(projectPath, "movehat.config.ts")
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
await copyFile(
|
|
160
|
-
path.join(templatesDir, ".env.example"),
|
|
161
|
-
path.join(projectPath, ".env.example")
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
await copyFile(
|
|
165
|
-
path.join(templatesDir, "gitignore"),
|
|
166
|
-
path.join(projectPath, ".gitignore")
|
|
167
|
-
);
|
|
168
|
-
|
|
169
|
-
await copyFile(
|
|
170
|
-
path.join(templatesDir, "README.md"),
|
|
171
|
-
path.join(projectPath, "README.md"),
|
|
172
|
-
{ projectName: npmName }
|
|
173
|
-
);
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// Step 2: Setup Move project
|
|
177
|
-
await steps.add('Setting up Move project', async () => {
|
|
178
|
-
await copyDir(
|
|
179
|
-
path.join(templatesDir, "move"),
|
|
180
|
-
path.join(projectPath, "move"),
|
|
181
|
-
{ projectName: npmName, movePackageName: moveName }
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// Step 3: Add deployment scripts
|
|
186
|
-
await steps.add('Adding deployment scripts', async () => {
|
|
187
|
-
await copyDir(
|
|
188
|
-
path.join(templatesDir, "scripts"),
|
|
189
|
-
path.join(projectPath, "scripts")
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// Step 4: Add test files
|
|
194
|
-
await steps.add('Adding test files', async () => {
|
|
195
|
-
await copyDir(
|
|
196
|
-
path.join(templatesDir, "tests"),
|
|
197
|
-
path.join(projectPath, "tests")
|
|
198
|
-
);
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
steps.complete();
|
|
202
|
-
|
|
203
|
-
// Success message
|
|
204
|
-
logger.newline();
|
|
205
|
-
logger.success('Project created successfully!');
|
|
206
|
-
logger.newline();
|
|
207
|
-
|
|
208
|
-
// Next steps
|
|
209
|
-
logger.section('Next steps');
|
|
210
|
-
logger.item(formatCommand(`cd ${dirName}`), 2);
|
|
211
|
-
logger.item(formatCommand('cp .env.example .env'), 2);
|
|
212
|
-
logger.plain(' # Edit .env with your credentials');
|
|
213
|
-
logger.item(formatCommand('npm install'), 2);
|
|
214
|
-
logger.item(formatCommand('npx movehat compile'), 2);
|
|
215
|
-
logger.item(formatCommand('npm test'), 2);
|
|
216
|
-
logger.newline();
|
|
217
|
-
|
|
218
|
-
} catch (error) {
|
|
219
|
-
logger.error(`Failed to initialize project: ${error}`);
|
|
220
|
-
process.exit(1);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
async function copyFile(
|
|
225
|
-
src: string,
|
|
226
|
-
dest: string,
|
|
227
|
-
replacements?: Record<string, string>
|
|
228
|
-
) {
|
|
229
|
-
let content = await fs.readFile(src, "utf-8");
|
|
230
|
-
|
|
231
|
-
if (replacements) {
|
|
232
|
-
for (const [key, value] of Object.entries(replacements)) {
|
|
233
|
-
const regex = new RegExp(`{{${key}}}`, "g");
|
|
234
|
-
content = content.replace(regex, value);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
await fs.writeFile(dest, content);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
async function copyDir(src: string, dest: string, replacements?: Record<string, string>) {
|
|
241
|
-
await fs.mkdir(dest, { recursive: true });
|
|
242
|
-
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
243
|
-
|
|
244
|
-
for (const entry of entries) {
|
|
245
|
-
// Skip template development files
|
|
246
|
-
if (entry.name === 'types' || entry.name === '.vscode') {
|
|
247
|
-
continue;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const srcPath = path.join(src, entry.name);
|
|
251
|
-
const destPath = path.join(dest, entry.name);
|
|
252
|
-
|
|
253
|
-
if (entry.isDirectory()) {
|
|
254
|
-
await copyDir(srcPath, destPath, replacements);
|
|
255
|
-
} else {
|
|
256
|
-
// Apply replacements to text files
|
|
257
|
-
if (replacements && (entry.name.endsWith('.toml') || entry.name.endsWith('.move'))) {
|
|
258
|
-
await copyFile(srcPath, destPath, replacements);
|
|
259
|
-
} else {
|
|
260
|
-
await fs.copyFile(srcPath, destPath);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
}
|
package/src/commands/run.ts
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { resolve, extname, dirname, join } from "path";
|
|
2
|
-
import { existsSync } from "fs";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { createRequire } from "module";
|
|
5
|
-
import { runCli } from "../utils/runCli.js";
|
|
6
|
-
import { logger } from "../ui/index.js";
|
|
7
|
-
import type { RunResult } from "../utils/childProcessAdapter.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Apply the exit policy for a child whose output was inherited by the
|
|
11
|
-
* parent. When the child dies via signal, re-raise it on the parent so
|
|
12
|
-
* shells and wrappers see the standard 128+N exit convention. Otherwise
|
|
13
|
-
* forward the numeric exit code, clamping any unexpected -1 to 1 (a -1
|
|
14
|
-
* would mask to 255 on Unix and drop signal-context).
|
|
15
|
-
*
|
|
16
|
-
* Exported so the branch is testable in isolation (a unit test against
|
|
17
|
-
* the full runCommand requires mocking fs + tsx resolution + runCli, all
|
|
18
|
-
* for 4 lines of policy).
|
|
19
|
-
*
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export function propagateRunResultExit(result: RunResult): void {
|
|
23
|
-
if (result.signal) {
|
|
24
|
-
process.kill(process.pid, result.signal);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
process.exit(result.exitCode >= 0 ? result.exitCode : 1);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default async function runCommand(scriptPath: string) {
|
|
31
|
-
if (!scriptPath) {
|
|
32
|
-
logger.error("No script path provided");
|
|
33
|
-
logger.plain("Usage: movehat run <script-path> [--network <name>]");
|
|
34
|
-
logger.plain("Example: movehat run scripts/deploy-counter.ts --network testnet");
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const fullPath = resolve(process.cwd(), scriptPath);
|
|
39
|
-
|
|
40
|
-
// Check if file exists
|
|
41
|
-
if (!existsSync(fullPath)) {
|
|
42
|
-
logger.error(`Script not found: ${scriptPath}`);
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Check if it's a TypeScript or JavaScript file
|
|
47
|
-
const ext = extname(fullPath);
|
|
48
|
-
if (![".ts", ".js", ".mjs"].includes(ext)) {
|
|
49
|
-
logger.error(`Unsupported file type: ${ext}`);
|
|
50
|
-
logger.plain("Supported extensions: .ts, .js, .mjs");
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const network = process.env.MH_CLI_NETWORK;
|
|
55
|
-
logger.step(`Running script: ${scriptPath}`);
|
|
56
|
-
if (network) {
|
|
57
|
-
logger.plain(` Network: ${network}`);
|
|
58
|
-
}
|
|
59
|
-
logger.newline();
|
|
60
|
-
|
|
61
|
-
// Find tsx binary - try multiple locations for compatibility
|
|
62
|
-
// Uses require.resolve for cross-platform compatibility (works on Windows, macOS, Linux)
|
|
63
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
64
|
-
const __dirname = dirname(__filename);
|
|
65
|
-
|
|
66
|
-
// Create require function for ESM (needed to use require.resolve in ESM modules)
|
|
67
|
-
const require = createRequire(import.meta.url);
|
|
68
|
-
|
|
69
|
-
let tsxPath: string;
|
|
70
|
-
try {
|
|
71
|
-
// Try to resolve tsx package from user's project first
|
|
72
|
-
const tsxPackagePath = require.resolve("tsx", { paths: [process.cwd()] });
|
|
73
|
-
// require.resolve("tsx") returns .../tsx/dist/loader.mjs
|
|
74
|
-
// We need to go up to the tsx package root, then into dist/cli.mjs
|
|
75
|
-
const tsxPackageRoot = dirname(dirname(tsxPackagePath));
|
|
76
|
-
tsxPath = join(tsxPackageRoot, "dist", "cli.mjs");
|
|
77
|
-
|
|
78
|
-
// Verify the file exists
|
|
79
|
-
if (!existsSync(tsxPath)) {
|
|
80
|
-
throw new Error("cli.mjs not found");
|
|
81
|
-
}
|
|
82
|
-
} catch {
|
|
83
|
-
try {
|
|
84
|
-
// Fallback to movehat's own tsx
|
|
85
|
-
const tsxPackagePath = require.resolve("tsx", { paths: [__dirname] });
|
|
86
|
-
const tsxPackageRoot = dirname(dirname(tsxPackagePath));
|
|
87
|
-
tsxPath = join(tsxPackageRoot, "dist", "cli.mjs");
|
|
88
|
-
|
|
89
|
-
if (!existsSync(tsxPath)) {
|
|
90
|
-
throw new Error("cli.mjs not found");
|
|
91
|
-
}
|
|
92
|
-
} catch {
|
|
93
|
-
tsxPath = "";
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (!tsxPath) {
|
|
98
|
-
logger.error("tsx binary not found");
|
|
99
|
-
logger.plain(" Make sure 'tsx' is installed in your project:");
|
|
100
|
-
logger.plain(" npm install --save-dev tsx");
|
|
101
|
-
process.exit(1);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Execute script with tsx (handles both .ts and .js files)
|
|
105
|
-
// Using 'node' to execute tsx for cross-platform compatibility.
|
|
106
|
-
try {
|
|
107
|
-
const result = await runCli(
|
|
108
|
-
{
|
|
109
|
-
command: "node",
|
|
110
|
-
args: [tsxPath, fullPath],
|
|
111
|
-
env: {
|
|
112
|
-
...process.env,
|
|
113
|
-
// MH_CLI_NETWORK is already set by the CLI hook
|
|
114
|
-
},
|
|
115
|
-
inheritStdio: true,
|
|
116
|
-
},
|
|
117
|
-
{ throwOnNonZeroExit: false }
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
propagateRunResultExit(result);
|
|
121
|
-
} catch (error) {
|
|
122
|
-
logger.error(`Failed to execute script: ${(error as Error).message}`);
|
|
123
|
-
process.exit(1);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { runMoveTests } from "../helpers/move-tests.js";
|
|
2
|
-
|
|
3
|
-
interface TestMoveOptions {
|
|
4
|
-
filter?: string;
|
|
5
|
-
ignoreWarnings?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default async function testMoveCommand(options: TestMoveOptions = {}) {
|
|
9
|
-
try {
|
|
10
|
-
console.log("Running Move unit tests...\n");
|
|
11
|
-
|
|
12
|
-
await runMoveTests({
|
|
13
|
-
filter: options.filter,
|
|
14
|
-
ignoreWarnings: options.ignoreWarnings,
|
|
15
|
-
skipIfMissing: false, // Fail if no Move directory (standalone command mode)
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
process.exit(0);
|
|
19
|
-
} catch (err) {
|
|
20
|
-
console.error("\n✗ Move tests failed");
|
|
21
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
22
|
-
if (msg) {
|
|
23
|
-
console.error(` ${msg}`);
|
|
24
|
-
}
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
}
|