@wyxos/zephyr 0.3.0 → 0.3.1
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 +22 -38
- package/bin/zephyr.mjs +5 -2
- package/package.json +1 -1
- package/src/application/release/release-node-package.mjs +1 -0
- package/src/deploy/local-repo.mjs +1 -1
- package/src/index.mjs +1 -12
- package/src/release/shared.mjs +17 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npx @wyxos/zephyr
|
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
Navigate to your
|
|
19
|
+
Navigate to your app or package directory and run:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
npm run release
|
|
@@ -34,13 +34,27 @@ See all flags:
|
|
|
34
34
|
zephyr --help
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
Common
|
|
37
|
+
Common workflows:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
#
|
|
40
|
+
# Deploy an app using the saved preset or the interactive prompts
|
|
41
|
+
zephyr
|
|
42
|
+
|
|
43
|
+
# Deploy an app and bump the local npm package version first
|
|
44
|
+
zephyr minor
|
|
45
|
+
|
|
46
|
+
# Release a Node/Vue package (defaults to a patch bump)
|
|
41
47
|
zephyr --type node
|
|
48
|
+
|
|
49
|
+
# Release a Node/Vue package with an explicit bump
|
|
50
|
+
zephyr --type node minor
|
|
51
|
+
|
|
52
|
+
# Release a Packagist package
|
|
53
|
+
zephyr --type packagist patch
|
|
42
54
|
```
|
|
43
55
|
|
|
56
|
+
When `--type node` or `--type vue` is used without a bump argument, Zephyr defaults to `patch`.
|
|
57
|
+
|
|
44
58
|
On a first run inside a project with `package.json`, Zephyr can:
|
|
45
59
|
- add `.zephyr/` to `.gitignore`
|
|
46
60
|
- add a `release` script that runs `npx @wyxos/zephyr@latest`
|
|
@@ -54,47 +68,17 @@ Follow the interactive prompts to configure your deployment target:
|
|
|
54
68
|
|
|
55
69
|
Configuration is saved automatically for future deployments.
|
|
56
70
|
|
|
57
|
-
## Scripts
|
|
71
|
+
## Project Scripts
|
|
58
72
|
|
|
59
|
-
|
|
73
|
+
The recommended entrypoint in consumer projects is:
|
|
60
74
|
|
|
61
75
|
```bash
|
|
62
|
-
npm run lint
|
|
63
|
-
npm test
|
|
64
76
|
npm run release
|
|
65
77
|
```
|
|
66
78
|
|
|
67
|
-
- `npm run
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
## Package API
|
|
72
|
-
|
|
73
|
-
The package surface is intentionally small:
|
|
74
|
-
|
|
75
|
-
```js
|
|
76
|
-
import {
|
|
77
|
-
logProcessing,
|
|
78
|
-
logSuccess,
|
|
79
|
-
logWarning,
|
|
80
|
-
logError,
|
|
81
|
-
runCommand,
|
|
82
|
-
runCommandCapture,
|
|
83
|
-
writeToLogFile
|
|
84
|
-
} from '@wyxos/zephyr'
|
|
85
|
-
|
|
86
|
-
import {selectDeploymentTarget} from '@wyxos/zephyr/targets'
|
|
87
|
-
|
|
88
|
-
import {
|
|
89
|
-
connectToServer,
|
|
90
|
-
executeRemoteCommand,
|
|
91
|
-
readRemoteFile,
|
|
92
|
-
downloadRemoteFile,
|
|
93
|
-
deleteRemoteFile
|
|
94
|
-
} from '@wyxos/zephyr/ssh'
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
The root package does not expose the old interactive configuration helper bag; target selection now lives under `@wyxos/zephyr/targets`.
|
|
79
|
+
- `npm run release` is the recommended app/package entrypoint once the release script has been installed.
|
|
80
|
+
- For `--type node` workflows, Zephyr runs your project's `lint` script when present.
|
|
81
|
+
- For `--type node` workflows, Zephyr runs `test:run` or `test` when present.
|
|
98
82
|
|
|
99
83
|
## Features
|
|
100
84
|
|
package/bin/zephyr.mjs
CHANGED
|
@@ -12,8 +12,11 @@ const program = new Command()
|
|
|
12
12
|
program
|
|
13
13
|
.name('zephyr')
|
|
14
14
|
.description('A streamlined deployment tool for web applications with intelligent Laravel project detection')
|
|
15
|
-
.option('--type <type>', '
|
|
16
|
-
.argument(
|
|
15
|
+
.option('--type <type>', 'Workflow type (node|vue|packagist). Omit for normal app deployments.')
|
|
16
|
+
.argument(
|
|
17
|
+
'[version]',
|
|
18
|
+
'Version or npm bump type for deployments (e.g. 1.2.3, patch, minor, major). --type node/vue/packagist workflows accept bump types only and default to patch.'
|
|
19
|
+
)
|
|
17
20
|
|
|
18
21
|
program.parse(process.argv)
|
|
19
22
|
const options = program.opts()
|
package/package.json
CHANGED
|
@@ -191,6 +191,7 @@ async function bumpVersion(releaseType, rootDir = process.cwd(), {logStep, logSu
|
|
|
191
191
|
const pkg = await readPackage(rootDir)
|
|
192
192
|
const commitMessage = `chore: release ${pkg.version}`
|
|
193
193
|
await runCommand('git', ['commit', '--amend', '-m', commitMessage], {capture: true, cwd: rootDir})
|
|
194
|
+
await runCommand('git', ['tag', '-fa', `v${pkg.version}`, '-m', `v${pkg.version}`], {capture: true, cwd: rootDir})
|
|
194
195
|
|
|
195
196
|
logSuccess?.(`Version updated to ${pkg.version}.`)
|
|
196
197
|
return pkg
|
|
@@ -7,7 +7,7 @@ export async function getCurrentBranch(rootDir) {
|
|
|
7
7
|
|
|
8
8
|
export async function getGitStatus(rootDir, { runCommandCapture } = {}) {
|
|
9
9
|
const output = await runCommandCapture('git', ['status', '--porcelain'], { cwd: rootDir })
|
|
10
|
-
return output.
|
|
10
|
+
return output.trimEnd()
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export function hasStagedChanges(statusOutput) {
|
package/src/index.mjs
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import {writeToLogFile} from './utils/log-file.mjs'
|
|
2
2
|
import {createAppContext} from './runtime/app-context.mjs'
|
|
3
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
4
|
const appContext = createAppContext()
|
|
14
5
|
const {
|
|
15
6
|
logProcessing,
|
|
16
7
|
logSuccess,
|
|
17
8
|
logWarning,
|
|
18
9
|
logError,
|
|
19
|
-
createSshClient,
|
|
20
10
|
runCommand,
|
|
21
11
|
runCommandCapture
|
|
22
12
|
} = appContext
|
|
@@ -28,6 +18,5 @@ export {
|
|
|
28
18
|
logError,
|
|
29
19
|
runCommand,
|
|
30
20
|
runCommandCapture,
|
|
31
|
-
writeToLogFile
|
|
32
|
-
createSshClient
|
|
21
|
+
writeToLogFile
|
|
33
22
|
}
|
package/src/release/shared.mjs
CHANGED
|
@@ -29,7 +29,23 @@ export function parseReleaseArgs({
|
|
|
29
29
|
args = process.argv.slice(2),
|
|
30
30
|
booleanFlags = []
|
|
31
31
|
} = {}) {
|
|
32
|
-
const filteredArgs =
|
|
32
|
+
const filteredArgs = []
|
|
33
|
+
|
|
34
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
35
|
+
const arg = args[index]
|
|
36
|
+
|
|
37
|
+
if (arg === '--type') {
|
|
38
|
+
index += 1
|
|
39
|
+
continue
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (arg.startsWith('--type=')) {
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
filteredArgs.push(arg)
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
const positionals = filteredArgs.filter((arg) => !arg.startsWith('--'))
|
|
34
50
|
const presentFlags = new Set(filteredArgs.filter((arg) => arg.startsWith('--')))
|
|
35
51
|
const releaseType = positionals[0] ?? 'patch'
|