movehat 0.2.3 → 0.2.5
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 +0 -1
- package/dist/commands/run.js +0 -1
- 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 +0 -1
- 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 +15 -2
- package/dist/fork/manager.js +20 -2
- 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 +2 -3
- 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 +1 -2
- package/dist/node/LocalNodeManager.js +6 -4
- 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 +0 -1
- package/dist/utils/parseCliOutput.js +0 -1
- 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
package/src/commands/test.ts
DELETED
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
import { join } from "path";
|
|
2
|
-
import { existsSync } from "fs";
|
|
3
|
-
import prompts from "prompts";
|
|
4
|
-
import { runMoveTests } from "../helpers/move-tests.js";
|
|
5
|
-
import { logger, colors, symbols } from "../ui/index.js";
|
|
6
|
-
import { runCli } from "../utils/runCli.js";
|
|
7
|
-
|
|
8
|
-
interface TestOptions {
|
|
9
|
-
move?: boolean;
|
|
10
|
-
ts?: boolean;
|
|
11
|
-
all?: boolean;
|
|
12
|
-
watch?: boolean;
|
|
13
|
-
filter?: string;
|
|
14
|
-
// Legacy flags (for backward compatibility)
|
|
15
|
-
moveOnly?: boolean;
|
|
16
|
-
tsOnly?: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
type TestType = "move" | "ts" | "all";
|
|
20
|
-
|
|
21
|
-
export default async function testCommand(options: TestOptions = {}) {
|
|
22
|
-
// Handle legacy flags
|
|
23
|
-
if (options.moveOnly) options.move = true;
|
|
24
|
-
if (options.tsOnly) options.ts = true;
|
|
25
|
-
|
|
26
|
-
// Determine test type from flags
|
|
27
|
-
let testType: TestType | undefined;
|
|
28
|
-
|
|
29
|
-
if (options.all) {
|
|
30
|
-
testType = "all";
|
|
31
|
-
} else if (options.move && options.ts) {
|
|
32
|
-
testType = "all";
|
|
33
|
-
} else if (options.move) {
|
|
34
|
-
testType = "move";
|
|
35
|
-
} else if (options.ts) {
|
|
36
|
-
testType = "ts";
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// If no flags provided, show interactive menu
|
|
40
|
-
if (!testType) {
|
|
41
|
-
testType = await showTestMenu();
|
|
42
|
-
if (!testType) {
|
|
43
|
-
// User cancelled
|
|
44
|
-
process.exit(0);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Execute based on test type
|
|
49
|
-
switch (testType) {
|
|
50
|
-
case "move":
|
|
51
|
-
await runMoveTestsOnly(options.filter);
|
|
52
|
-
break;
|
|
53
|
-
case "ts":
|
|
54
|
-
await runTypeScriptTestsOnly(options.watch);
|
|
55
|
-
break;
|
|
56
|
-
case "all":
|
|
57
|
-
await runAllTests(options.filter);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Show interactive menu to select test type
|
|
64
|
-
*/
|
|
65
|
-
async function showTestMenu(): Promise<TestType | undefined> {
|
|
66
|
-
logger.newline();
|
|
67
|
-
|
|
68
|
-
const response = await prompts({
|
|
69
|
-
type: "select",
|
|
70
|
-
name: "testType",
|
|
71
|
-
message: "What tests do you want to run?",
|
|
72
|
-
choices: [
|
|
73
|
-
{
|
|
74
|
-
title: `${colors.success("Move unit tests")} ${colors.muted("(fast, no node required)")}`,
|
|
75
|
-
value: "move",
|
|
76
|
-
description: "Run #[test] functions in your Move contracts",
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
title: `${colors.info("TypeScript integration tests")} ${colors.muted("(starts local node)")}`,
|
|
80
|
-
value: "ts",
|
|
81
|
-
description: "Run .test.ts files with a local Movement node",
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
title: `${colors.brand("All tests")} ${colors.muted("(Move + TypeScript)")}`,
|
|
85
|
-
value: "all",
|
|
86
|
-
description: "Run both Move and TypeScript tests sequentially",
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
initial: 0,
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return response.testType;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Run only Move unit tests
|
|
97
|
-
*/
|
|
98
|
-
async function runMoveTestsOnly(filter?: string): Promise<void> {
|
|
99
|
-
logger.newline();
|
|
100
|
-
logger.phase("Move Unit Tests");
|
|
101
|
-
logger.newline();
|
|
102
|
-
|
|
103
|
-
try {
|
|
104
|
-
await runMoveTests({
|
|
105
|
-
filter,
|
|
106
|
-
skipIfMissing: false, // Fail if no Move directory
|
|
107
|
-
});
|
|
108
|
-
} catch (error) {
|
|
109
|
-
logger.newline();
|
|
110
|
-
logger.error("Move tests failed");
|
|
111
|
-
process.exit(1);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Run only TypeScript integration tests
|
|
117
|
-
*/
|
|
118
|
-
async function runTypeScriptTestsOnly(watch: boolean = false): Promise<void> {
|
|
119
|
-
logger.newline();
|
|
120
|
-
logger.phase("TypeScript Integration Tests");
|
|
121
|
-
|
|
122
|
-
if (!watch) {
|
|
123
|
-
logger.newline();
|
|
124
|
-
logger.info("This will start a local Movement node for testing");
|
|
125
|
-
logger.newline();
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
try {
|
|
129
|
-
await runTypeScriptTests(watch);
|
|
130
|
-
if (!watch) {
|
|
131
|
-
logger.newline();
|
|
132
|
-
logger.success("TypeScript tests passed");
|
|
133
|
-
}
|
|
134
|
-
} catch (error) {
|
|
135
|
-
logger.newline();
|
|
136
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
-
logger.error(message);
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Run all tests (Move + TypeScript)
|
|
144
|
-
*/
|
|
145
|
-
async function runAllTests(filter?: string): Promise<void> {
|
|
146
|
-
logger.newline();
|
|
147
|
-
logger.phase("Running All Tests");
|
|
148
|
-
|
|
149
|
-
// Section 1: Move Tests
|
|
150
|
-
logger.newline();
|
|
151
|
-
logger.phase("1. Move Unit Tests");
|
|
152
|
-
logger.newline();
|
|
153
|
-
|
|
154
|
-
try {
|
|
155
|
-
await runMoveTests({
|
|
156
|
-
filter,
|
|
157
|
-
skipIfMissing: true, // Gracefully skip if no Move directory
|
|
158
|
-
});
|
|
159
|
-
} catch (error) {
|
|
160
|
-
logger.newline();
|
|
161
|
-
logger.error("Move tests failed");
|
|
162
|
-
logger.divider();
|
|
163
|
-
process.exit(1);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Section 2: TypeScript Tests
|
|
167
|
-
logger.newline();
|
|
168
|
-
logger.phase("2. TypeScript Integration Tests");
|
|
169
|
-
logger.newline();
|
|
170
|
-
|
|
171
|
-
try {
|
|
172
|
-
await runTypeScriptTests(false);
|
|
173
|
-
logger.newline();
|
|
174
|
-
logger.divider();
|
|
175
|
-
logger.newline();
|
|
176
|
-
logger.success("All tests passed!");
|
|
177
|
-
logger.newline();
|
|
178
|
-
} catch (error) {
|
|
179
|
-
logger.newline();
|
|
180
|
-
logger.divider();
|
|
181
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
182
|
-
logger.error(message);
|
|
183
|
-
process.exit(1);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Run TypeScript tests using Mocha
|
|
189
|
-
*/
|
|
190
|
-
async function runTypeScriptTests(watch: boolean = false): Promise<void> {
|
|
191
|
-
const testDir = join(process.cwd(), "tests");
|
|
192
|
-
|
|
193
|
-
if (!existsSync(testDir)) {
|
|
194
|
-
logger.plain(`${colors.muted(symbols.info)} No TypeScript tests found ${colors.muted("(tests/ directory not found)")}`);
|
|
195
|
-
logger.plain(` ${colors.muted("Skipping TypeScript tests...")}`);
|
|
196
|
-
logger.newline();
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
const mochaPath = join(process.cwd(), "node_modules", ".bin", "mocha");
|
|
201
|
-
|
|
202
|
-
if (!existsSync(mochaPath)) {
|
|
203
|
-
logger.error("Mocha not found in project dependencies");
|
|
204
|
-
logger.plain(` ${colors.muted("Install it with:")} ${colors.info("npm install --save-dev mocha")}`);
|
|
205
|
-
throw new Error("Mocha not found");
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
const args = watch ? ["--watch"] : [];
|
|
209
|
-
|
|
210
|
-
// Watch mode: Mocha never exits. We fire-and-forget runCli so it owns the
|
|
211
|
-
// terminal until the user Ctrl+Cs the parent (which kills the child via
|
|
212
|
-
// inherited stdio). Attach .catch so a spawn-time failure doesn't become
|
|
213
|
-
// an unhandled rejection.
|
|
214
|
-
if (watch) {
|
|
215
|
-
runCli(
|
|
216
|
-
{
|
|
217
|
-
command: mochaPath,
|
|
218
|
-
args,
|
|
219
|
-
env: { ...process.env },
|
|
220
|
-
inheritStdio: true,
|
|
221
|
-
},
|
|
222
|
-
{ throwOnNonZeroExit: false }
|
|
223
|
-
).catch((error) => {
|
|
224
|
-
logger.error(`Mocha watch crashed: ${(error as Error).message}`);
|
|
225
|
-
process.exit(1);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
logger.plain(`${colors.info(symbols.info)} Watch mode active. Press Ctrl+C to exit.`);
|
|
229
|
-
logger.newline();
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Non-watch mode: await the run, surface the exit code as a thrown error
|
|
234
|
-
// so the orchestrator above can summarize the failure.
|
|
235
|
-
let result;
|
|
236
|
-
try {
|
|
237
|
-
result = await runCli(
|
|
238
|
-
{
|
|
239
|
-
command: mochaPath,
|
|
240
|
-
args,
|
|
241
|
-
env: { ...process.env },
|
|
242
|
-
inheritStdio: true,
|
|
243
|
-
},
|
|
244
|
-
{ throwOnNonZeroExit: false }
|
|
245
|
-
);
|
|
246
|
-
} catch (error) {
|
|
247
|
-
logger.error(`Failed to run TypeScript tests: ${(error as Error).message}`);
|
|
248
|
-
throw error;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
if (result.exitCode === 0) {
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
254
|
-
throw new Error(`TypeScript tests failed with exit code ${result.exitCode}`);
|
|
255
|
-
}
|
package/src/commands/update.ts
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from "fs";
|
|
2
|
-
import { join, dirname, resolve } from "path";
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { homedir } from "os";
|
|
5
|
-
import prompts from "prompts";
|
|
6
|
-
import { isNewerVersion } from "../helpers/semver-utils.js";
|
|
7
|
-
import { fetchLatestVersion } from "../helpers/npm-registry.js";
|
|
8
|
-
import { logger, withSpinner, box, colors } from "../ui/index.js";
|
|
9
|
-
import { runCli } from "../utils/runCli.js";
|
|
10
|
-
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = dirname(__filename);
|
|
13
|
-
|
|
14
|
-
interface PackageJson {
|
|
15
|
-
name: string;
|
|
16
|
-
version: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Detect which package manager to use for update
|
|
21
|
-
* Searches for lockfiles upward from cwd, checks user agent, or falls back to defaults
|
|
22
|
-
*/
|
|
23
|
-
function detectPackageManager(): "yarn" | "npm" | "pnpm" {
|
|
24
|
-
// First, try to detect from lockfiles by searching upward
|
|
25
|
-
let currentDir = process.cwd();
|
|
26
|
-
const root = resolve("/");
|
|
27
|
-
|
|
28
|
-
while (currentDir !== root) {
|
|
29
|
-
if (existsSync(join(currentDir, "pnpm-lock.yaml"))) {
|
|
30
|
-
return "pnpm";
|
|
31
|
-
}
|
|
32
|
-
if (existsSync(join(currentDir, "yarn.lock"))) {
|
|
33
|
-
return "yarn";
|
|
34
|
-
}
|
|
35
|
-
if (
|
|
36
|
-
existsSync(join(currentDir, "package-lock.json")) ||
|
|
37
|
-
existsSync(join(currentDir, "npm-shrinkwrap.json"))
|
|
38
|
-
) {
|
|
39
|
-
return "npm";
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const parentDir = dirname(currentDir);
|
|
43
|
-
if (parentDir === currentDir) break; // Reached root
|
|
44
|
-
currentDir = parentDir;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// No lockfile found, check user agent environment variables
|
|
48
|
-
const userAgent =
|
|
49
|
-
process.env.npm_config_user_agent || process.env.npm_execpath || "";
|
|
50
|
-
|
|
51
|
-
if (userAgent.includes("pnpm")) {
|
|
52
|
-
return "pnpm";
|
|
53
|
-
}
|
|
54
|
-
if (userAgent.includes("yarn")) {
|
|
55
|
-
return "yarn";
|
|
56
|
-
}
|
|
57
|
-
if (userAgent.includes("npm")) {
|
|
58
|
-
return "npm";
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Default fallback to npm for global installs
|
|
62
|
-
return "npm";
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Update Movehat CLI to the latest version from npm
|
|
67
|
-
*
|
|
68
|
-
* This command:
|
|
69
|
-
* - Fetches the latest version from npm registry
|
|
70
|
-
* - Compares with currently installed version
|
|
71
|
-
* - Auto-detects package manager (npm/yarn/pnpm)
|
|
72
|
-
* - Installs the update if a newer version is available
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* // Update to latest version
|
|
76
|
-
* await updateCommand();
|
|
77
|
-
*/
|
|
78
|
-
export default async function updateCommand() {
|
|
79
|
-
try {
|
|
80
|
-
// Read current version from package.json
|
|
81
|
-
const packageJsonPath = join(__dirname, "../../package.json");
|
|
82
|
-
const packageJson: PackageJson = JSON.parse(
|
|
83
|
-
readFileSync(packageJsonPath, "utf-8")
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const currentVersion = packageJson.version;
|
|
87
|
-
const packageName = packageJson.name;
|
|
88
|
-
|
|
89
|
-
logger.newline();
|
|
90
|
-
logger.info(`Current version: ${currentVersion}`);
|
|
91
|
-
|
|
92
|
-
// Fetch latest version from npm with spinner
|
|
93
|
-
const latestVersion = await withSpinner(
|
|
94
|
-
'Checking for updates...',
|
|
95
|
-
async () => await fetchLatestVersion(packageName, { throwOnError: true }),
|
|
96
|
-
'Update check complete'
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
if (!latestVersion) {
|
|
100
|
-
logger.error("Failed to fetch latest version from npm registry");
|
|
101
|
-
logger.newline();
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
logger.info(`Latest version: ${latestVersion}`);
|
|
106
|
-
logger.newline();
|
|
107
|
-
|
|
108
|
-
// Compare versions
|
|
109
|
-
if (!isNewerVersion(currentVersion, latestVersion)) {
|
|
110
|
-
logger.success('You are already using the latest version!');
|
|
111
|
-
logger.newline();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Show update available box
|
|
116
|
-
const updateBox = box(
|
|
117
|
-
`${colors.brandBright('Update Available!')}\n\n` +
|
|
118
|
-
`Current: ${currentVersion}\n` +
|
|
119
|
-
`Latest: ${colors.success(latestVersion)}`,
|
|
120
|
-
{ borderColor: 'warning', padding: 1 }
|
|
121
|
-
);
|
|
122
|
-
console.log(updateBox);
|
|
123
|
-
logger.newline();
|
|
124
|
-
|
|
125
|
-
// Ask for confirmation
|
|
126
|
-
const response = await prompts({
|
|
127
|
-
type: 'confirm',
|
|
128
|
-
name: 'confirm',
|
|
129
|
-
message: `Do you want to update to version ${latestVersion}?`,
|
|
130
|
-
initial: true
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// Handle cancellation (Ctrl+C) or explicit "no"
|
|
134
|
-
if (response.confirm === undefined || !response.confirm) {
|
|
135
|
-
logger.info('Update cancelled');
|
|
136
|
-
logger.newline();
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
logger.newline();
|
|
141
|
-
logger.info('Updating movehat...');
|
|
142
|
-
logger.newline();
|
|
143
|
-
|
|
144
|
-
// Detect package manager
|
|
145
|
-
const packageManager = detectPackageManager();
|
|
146
|
-
|
|
147
|
-
// Build update command based on package manager
|
|
148
|
-
let updateArgs: string[];
|
|
149
|
-
switch (packageManager) {
|
|
150
|
-
case "yarn":
|
|
151
|
-
updateArgs = ["global", "upgrade", packageName];
|
|
152
|
-
break;
|
|
153
|
-
case "pnpm":
|
|
154
|
-
updateArgs = ["add", "-g", `${packageName}@latest`];
|
|
155
|
-
break;
|
|
156
|
-
case "npm":
|
|
157
|
-
default:
|
|
158
|
-
updateArgs = ["update", "-g", packageName];
|
|
159
|
-
break;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Execute update.
|
|
163
|
-
// Use home directory as cwd to avoid packageManager conflicts from local package.json.
|
|
164
|
-
try {
|
|
165
|
-
const result = await runCli(
|
|
166
|
-
{
|
|
167
|
-
command: packageManager,
|
|
168
|
-
args: updateArgs,
|
|
169
|
-
cwd: homedir() || process.cwd(),
|
|
170
|
-
inheritStdio: true,
|
|
171
|
-
},
|
|
172
|
-
{ throwOnNonZeroExit: false }
|
|
173
|
-
);
|
|
174
|
-
|
|
175
|
-
if (result.exitCode === 0) {
|
|
176
|
-
logger.newline();
|
|
177
|
-
logger.success(`Successfully updated to version ${latestVersion}!`);
|
|
178
|
-
logger.newline();
|
|
179
|
-
process.exit(0);
|
|
180
|
-
} else {
|
|
181
|
-
logger.newline();
|
|
182
|
-
logger.error("Update failed");
|
|
183
|
-
logger.plain(` Try manually: ${packageManager} ${updateArgs.join(" ")}`);
|
|
184
|
-
logger.newline();
|
|
185
|
-
process.exit(1);
|
|
186
|
-
}
|
|
187
|
-
} catch (error) {
|
|
188
|
-
logger.newline();
|
|
189
|
-
logger.error(`Failed to update: ${(error as Error).message}`);
|
|
190
|
-
logger.plain(` Try manually: ${packageManager} ${updateArgs.join(" ")}`);
|
|
191
|
-
logger.newline();
|
|
192
|
-
process.exit(1);
|
|
193
|
-
}
|
|
194
|
-
} catch (error) {
|
|
195
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
196
|
-
logger.newline();
|
|
197
|
-
logger.error(`Error: ${message}`);
|
|
198
|
-
logger.newline();
|
|
199
|
-
process.exit(1);
|
|
200
|
-
}
|
|
201
|
-
}
|