@eliware/vyops 1.0.9 → 1.0.11

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/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Release Notes
2
2
 
3
+ ## 1.0.11
4
+
5
+ - Fix VyOS 1.5 `commit-confirm` handling by answering confirmation prompts
6
+ with the full `yes` response.
7
+ - Add real disposable-VyOS integration coverage for deployment, backup,
8
+ script synchronization, and invalid configuration handling.
9
+ - Allow WAN/VPN latency in opt-in real-router integration tests.
10
+
11
+ Verification:
12
+
13
+ - `npm test` (100% coverage across statements, branches, functions, and lines)
14
+ - Real VyOS integration suite (4 tests)
15
+ - `npm run lint`
16
+ - `npm run audit`
17
+
18
+ ## 1.0.10
19
+
20
+ - Make Git integration optional for deployments using standalone config files.
21
+ - Continue downloading the live VyOS configuration after deployment while
22
+ skipping repository checks and pushback outside a Git repository.
23
+ - Add regression coverage for non-Git and unexpected repository paths.
24
+
25
+ Verification:
26
+
27
+ - `npm test` (100% coverage across statements, branches, functions, and lines)
28
+ - `npm run lint`
29
+ - `npm run audit`
30
+
3
31
  ## 1.0.9
4
32
 
5
33
  - Fix `--password-stdin` to read piped passwords correctly on current Node.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eliware/vyops",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Deploy native VyOS configuration files over SSH.",
5
5
  "main": "vyops.mjs",
6
6
  "scripts": {
package/src/git.mjs CHANGED
@@ -59,10 +59,19 @@ function configDirectory(config) {
59
59
  return path(config, '..');
60
60
  }
61
61
 
62
+ async function repositoryRoot(config) {
63
+ try {
64
+ const { stdout } = await git(['rev-parse', '--show-toplevel'], configDirectory(config));
65
+ return stdout.trim();
66
+ } catch (error) {
67
+ if (error.stderr?.includes('not a git repository')) return null;
68
+ throw error;
69
+ }
70
+ }
71
+
62
72
  export async function shouldSkip(config) {
63
- const cwd = configDirectory(config);
64
- const { stdout: root } = await git(['rev-parse', '--show-toplevel'], cwd);
65
- const repo = root.trim();
73
+ const repo = await repositoryRoot(config);
74
+ if (!repo) return false;
66
75
  const relative = config.startsWith(`${repo}/`) ? config.slice(repo.length + 1) : config;
67
76
  const { stdout: status } = await git(['status', '--porcelain', '--', relative], repo);
68
77
  if (status.trim()) return false;
@@ -71,8 +80,8 @@ export async function shouldSkip(config) {
71
80
  }
72
81
 
73
82
  export async function pushBack(config, { force = false } = {}) {
74
- const { stdout: root } = await git(['rev-parse', '--show-toplevel'], configDirectory(config));
75
- const repo = root.trim();
83
+ const repo = await repositoryRoot(config);
84
+ if (!repo) return false;
76
85
  return withRepositoryLock(repo, async () => {
77
86
  const relative = config.startsWith(`${repo}/`) ? config.slice(repo.length + 1) : config;
78
87
  const { stdout: diff } = await git(['diff', 'HEAD', '--', relative], repo);
package/src/ssh.mjs CHANGED
@@ -214,10 +214,10 @@ export function interactive(client, commands, log = () => {}) {
214
214
  }
215
215
  if (/Proceed\s*\?\s*\[Y\/n\]/i.test(cleaned) && !answering) {
216
216
  answering = true;
217
- log('commit-confirm prompt detected; sending: y');
217
+ log('commit-confirm prompt detected; sending: yes');
218
218
  response = '';
219
- stream.write('y\n');
220
- log('write complete: y');
219
+ stream.write('yes\n');
220
+ log('write complete: yes');
221
221
  return;
222
222
  }
223
223
  const commandComplete = waiting