@wyxos/zephyr 0.2.27 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +55 -2
  2. package/bin/zephyr.mjs +3 -1
  3. package/package.json +7 -2
  4. package/src/application/configuration/app-details.mjs +89 -0
  5. package/src/application/configuration/app-selection.mjs +87 -0
  6. package/src/application/configuration/preset-selection.mjs +59 -0
  7. package/src/application/configuration/select-deployment-target.mjs +165 -0
  8. package/src/application/configuration/server-selection.mjs +87 -0
  9. package/src/application/configuration/service.mjs +109 -0
  10. package/src/application/deploy/build-remote-deployment-plan.mjs +174 -0
  11. package/src/application/deploy/bump-local-package-version.mjs +81 -0
  12. package/src/application/deploy/execute-remote-deployment-plan.mjs +61 -0
  13. package/src/{utils/task-planner.mjs → application/deploy/plan-laravel-deployment-tasks.mjs} +5 -4
  14. package/src/application/deploy/prepare-local-deployment.mjs +52 -0
  15. package/src/application/deploy/resolve-local-deployment-context.mjs +17 -0
  16. package/src/application/deploy/resolve-pending-snapshot.mjs +45 -0
  17. package/src/application/deploy/run-deployment.mjs +147 -0
  18. package/src/application/deploy/run-local-deployment-checks.mjs +80 -0
  19. package/src/application/release/release-node-package.mjs +340 -0
  20. package/src/application/release/release-packagist-package.mjs +223 -0
  21. package/src/config/project.mjs +13 -0
  22. package/src/deploy/local-repo.mjs +187 -67
  23. package/src/deploy/preflight.mjs +10 -1
  24. package/src/deploy/remote-exec.mjs +2 -3
  25. package/src/index.mjs +27 -85
  26. package/src/main.mjs +80 -627
  27. package/src/release/shared.mjs +104 -0
  28. package/src/release-node.mjs +20 -481
  29. package/src/release-packagist.mjs +20 -291
  30. package/src/runtime/app-context.mjs +36 -0
  31. package/src/targets/index.mjs +24 -0
  32. package/src/utils/command.mjs +67 -5
  33. package/src/utils/output.mjs +41 -16
  34. package/src/utils/config-flow.mjs +0 -284
  35. /package/src/{utils/php-version.mjs → infrastructure/php/version.mjs} +0 -0
package/src/index.mjs CHANGED
@@ -1,91 +1,33 @@
1
- import chalk from 'chalk'
2
- import inquirer from 'inquirer'
3
- import { NodeSSH } from 'node-ssh'
4
-
5
- import { createChalkLogger } from './utils/output.mjs'
6
- import { runCommand as runCommandBase, runCommandCapture as runCommandCaptureBase } from './utils/command.mjs'
7
- import { createLocalCommandRunners } from './runtime/local-command.mjs'
8
- import { createRunPrompt } from './runtime/prompt.mjs'
9
- import { createSshClientFactory } from './runtime/ssh-client.mjs'
10
- import { generateId } from './utils/id.mjs'
11
-
12
- import { loadServers as loadServersImpl, saveServers } from './config/servers.mjs'
13
- import { loadProjectConfig as loadProjectConfigImpl, saveProjectConfig } from './config/project.mjs'
14
- import * as configFlow from './utils/config-flow.mjs'
15
- import * as sshKeys from './ssh/keys.mjs'
16
- import { writeToLogFile } from './utils/log-file.mjs'
17
-
18
- export { main, runRemoteTasks } from './main.mjs'
19
- export { connectToServer, executeRemoteCommand, readRemoteFile, downloadRemoteFile, deleteRemoteFile } from './ssh/index.mjs'
20
-
21
- const { logProcessing, logSuccess, logWarning, logError } = createChalkLogger(chalk)
22
- const runPrompt = createRunPrompt({ inquirer })
23
- const { runCommand, runCommandCapture } = createLocalCommandRunners({
24
- runCommandBase,
25
- runCommandCaptureBase
26
- })
27
-
28
- // Keep this aligned with main's test injection behavior
29
- const createSshClient = createSshClientFactory({ NodeSSH })
30
-
31
- export { logProcessing, logSuccess, logWarning, logError, runCommand, runCommandCapture, writeToLogFile, createSshClient }
32
-
33
- export async function loadServers() {
34
- return await loadServersImpl({ logSuccess, logWarning })
35
- }
36
-
37
- export async function loadProjectConfig(rootDir, servers) {
38
- return await loadProjectConfigImpl(rootDir, servers, { logSuccess, logWarning })
39
- }
40
-
41
- export function defaultProjectPath(currentDir) {
42
- return configFlow.defaultProjectPath(currentDir)
43
- }
44
-
45
- export async function listGitBranches(currentDir) {
46
- return await configFlow.listGitBranches(currentDir, { runCommandCapture, logWarning })
47
- }
48
-
49
- export async function promptSshDetails(currentDir, existing = {}) {
50
- return await sshKeys.promptSshDetails(currentDir, existing, { runPrompt })
51
- }
52
-
53
- export async function promptServerDetails(existingServers = []) {
54
- return await configFlow.promptServerDetails(existingServers, { runPrompt, generateId })
55
- }
56
-
57
- export async function selectServer(servers) {
58
- return await configFlow.selectServer(servers, {
59
- runPrompt,
1
+ import {writeToLogFile} from './utils/log-file.mjs'
2
+ import {createAppContext} from './runtime/app-context.mjs'
3
+
4
+ export {main, runRemoteTasks} from './main.mjs'
5
+ export {
6
+ connectToServer,
7
+ executeRemoteCommand,
8
+ readRemoteFile,
9
+ downloadRemoteFile,
10
+ deleteRemoteFile
11
+ } from './ssh/index.mjs'
12
+
13
+ const appContext = createAppContext()
14
+ const {
60
15
  logProcessing,
61
16
  logSuccess,
62
- saveServers,
63
- promptServerDetails
64
- })
65
- }
66
-
67
- export async function promptAppDetails(currentDir, existing = {}) {
68
- return await configFlow.promptAppDetails(currentDir, existing, {
69
- runPrompt,
70
- listGitBranches,
71
- defaultProjectPath,
72
- promptSshDetails
73
- })
74
- }
75
-
76
- export async function selectApp(projectConfig, server, currentDir) {
77
- return await configFlow.selectApp(projectConfig, server, currentDir, {
78
- runPrompt,
79
17
  logWarning,
18
+ logError,
19
+ createSshClient,
20
+ runCommand,
21
+ runCommandCapture
22
+ } = appContext
23
+
24
+ export {
80
25
  logProcessing,
81
26
  logSuccess,
82
- saveProjectConfig,
83
- generateId,
84
- promptAppDetails
85
- })
86
- }
87
-
88
- export async function selectPreset(projectConfig, servers) {
89
- return await configFlow.selectPreset(projectConfig, servers, { runPrompt })
27
+ logWarning,
28
+ logError,
29
+ runCommand,
30
+ runCommandCapture,
31
+ writeToLogFile,
32
+ createSshClient
90
33
  }
91
-