neonctl 1.9.0 → 1.9.2
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/analytics.js +1 -1
- package/commands/help.test.js +11 -0
- package/index.js +2 -2
- package/package.json +2 -2
- package/test_utils.js +6 -6
package/analytics.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect } from '@jest/globals';
|
|
2
|
+
import { testCliCommand } from '../test_utils.js';
|
|
3
|
+
describe('help', () => {
|
|
4
|
+
testCliCommand({
|
|
5
|
+
name: 'without args',
|
|
6
|
+
args: [],
|
|
7
|
+
expected: {
|
|
8
|
+
stderr: expect.stringContaining('usage: neonctl <cmd> [args]'),
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
});
|
package/index.js
CHANGED
|
@@ -45,7 +45,7 @@ const builder = yargs(hideBin(process.argv))
|
|
|
45
45
|
.middleware(ensureConfigDir)
|
|
46
46
|
// Auth flow
|
|
47
47
|
.option('oauth-host', {
|
|
48
|
-
description: 'URL to Neon
|
|
48
|
+
description: 'URL to Neon OAuth host',
|
|
49
49
|
default: 'https://oauth2.neon.tech',
|
|
50
50
|
})
|
|
51
51
|
.option('client-id', {
|
|
@@ -61,7 +61,7 @@ const builder = yargs(hideBin(process.argv))
|
|
|
61
61
|
.option('apiClient', {
|
|
62
62
|
hidden: true,
|
|
63
63
|
coerce: (v) => v,
|
|
64
|
-
default:
|
|
64
|
+
default: null,
|
|
65
65
|
})
|
|
66
66
|
.middleware((args) => fillInArgs(args), true)
|
|
67
67
|
.middleware(ensureAuth)
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git@github.com:neondatabase/neonctl.git"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
|
-
"version": "1.9.
|
|
8
|
+
"version": "1.9.2",
|
|
9
9
|
"description": "CLI tool for NeonDB Cloud management",
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"author": "NeonDB",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"scripts": {
|
|
64
64
|
"watch": "tsc --watch",
|
|
65
65
|
"lint": "tsc --noEmit && eslint src --ext .ts",
|
|
66
|
-
"build": "npm run generateParams && npm run clean && tsc && cp src/*.html package
|
|
66
|
+
"build": "npm run generateParams && npm run clean && tsc && cp src/*.html package*.json README.md ./dist",
|
|
67
67
|
"clean": "rm -rf dist",
|
|
68
68
|
"generateParams": "ts-node --esm generateOptionsFromSpec.ts",
|
|
69
69
|
"start": "node src/index.js",
|
package/test_utils.js
CHANGED
|
@@ -50,17 +50,17 @@ export const testCliCommand = ({ args, name, expected, }) => {
|
|
|
50
50
|
throw err;
|
|
51
51
|
});
|
|
52
52
|
cp.on('close', (code) => {
|
|
53
|
-
if (error) {
|
|
54
|
-
console.log(error);
|
|
55
|
-
}
|
|
56
53
|
try {
|
|
57
54
|
expect(code).toBe(0);
|
|
58
55
|
if (code === 0 && expected) {
|
|
59
|
-
if (
|
|
56
|
+
if (expected.snapshot) {
|
|
60
57
|
expect(output).toMatchSnapshot();
|
|
61
58
|
}
|
|
62
|
-
|
|
63
|
-
expect(output).toEqual(expected.
|
|
59
|
+
if (expected.stdout !== undefined) {
|
|
60
|
+
expect(output).toEqual(expected.stdout);
|
|
61
|
+
}
|
|
62
|
+
if (expected.stderr !== undefined) {
|
|
63
|
+
expect(error).toEqual(expected.stderr);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
resolve();
|