neonctl 1.31.0 → 1.32.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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+ssh://git@github.com/neondatabase/neonctl.git"
6
6
  },
7
7
  "type": "module",
8
- "version": "1.31.0",
8
+ "version": "1.32.0",
9
9
  "description": "CLI tool for NeonDB Cloud management",
10
10
  "main": "index.js",
11
11
  "author": "NeonDB",
@@ -22,17 +22,18 @@
22
22
  "@apidevtools/swagger-parser": "^10.1.0",
23
23
  "@commitlint/cli": "^17.6.5",
24
24
  "@commitlint/config-conventional": "^17.6.5",
25
- "@jest/globals": "^29.5.0",
26
25
  "@rollup/plugin-commonjs": "^25.0.2",
27
26
  "@rollup/plugin-json": "^6.0.0",
28
27
  "@rollup/plugin-node-resolve": "^15.1.0",
29
28
  "@semantic-release/exec": "^6.0.3",
30
29
  "@semantic-release/git": "^10.0.1",
30
+ "@types/bun": "^1.1.4",
31
31
  "@types/cli-table": "^0.3.0",
32
32
  "@types/diff": "^5.2.1",
33
33
  "@types/express": "^4.17.17",
34
- "@types/inquirer": "^9.0.3",
35
34
  "@types/node": "^18.7.13",
35
+ "@types/prompts": "2.4.9",
36
+ "@types/validate-npm-package-name": "4.0.2",
36
37
  "@types/which": "^3.0.0",
37
38
  "@types/yargs": "^17.0.24",
38
39
  "@typescript-eslint/eslint-plugin": "^5.34.0",
@@ -41,7 +42,6 @@
41
42
  "eslint": "^8.22.0",
42
43
  "express": "^4.18.2",
43
44
  "husky": "^8.0.3",
44
- "jest": "^29.5.0",
45
45
  "lint-staged": "^13.0.3",
46
46
  "oauth2-mock-server": "^6.0.0",
47
47
  "pkg": "^5.8.1",
@@ -49,9 +49,8 @@
49
49
  "rollup": "^3.26.2",
50
50
  "semantic-release": "^23.0.8",
51
51
  "strip-ansi": "^7.1.0",
52
- "ts-jest": "^29.1.0",
53
- "ts-node": "^10.9.1",
54
- "typescript": "^4.7.4"
52
+ "typescript": "^4.7.4",
53
+ "vitest": "^1.6.0"
55
54
  },
56
55
  "dependencies": {
57
56
  "@neondatabase/api-client": "1.9.0",
@@ -64,6 +63,8 @@
64
63
  "inquirer": "^9.2.6",
65
64
  "open": "^10.1.0",
66
65
  "openid-client": "^5.6.5",
66
+ "prompts": "2.4.2",
67
+ "validate-npm-package-name": "5.0.1",
67
68
  "which": "^3.0.1",
68
69
  "yaml": "^2.1.1",
69
70
  "yargs": "^17.7.2"
@@ -91,12 +92,12 @@
91
92
  "watch": "tsc --watch",
92
93
  "lint": "tsc --noEmit && eslint src --ext .ts && prettier --check .",
93
94
  "lint:fix": "tsc --noEmit && eslint src --ext .ts --fix && prettier --w .",
94
- "build": "npm run generateParams && npm run clean && tsc && cp src/*.html package*.json README.md ./dist",
95
+ "build": "bun generateParams && bun clean && tsc && cp src/*.html package*.json README.md ./dist",
95
96
  "clean": "rm -rf dist",
96
- "generateParams": "node --loader ts-node/esm ./generateOptionsFromSpec.ts",
97
- "start": "node dist/index.js",
98
- "pretest": "npm run build",
99
- "test": "node --experimental-vm-modules node_modules/.bin/jest",
97
+ "generateParams": "bun generateOptionsFromSpec.ts",
98
+ "start": "bun dist/index.js",
99
+ "pretest": "bun run build",
100
+ "test": "vitest run",
100
101
  "prepare": "test -d .git && husky install || true"
101
102
  },
102
103
  "lint-staged": {
@@ -107,5 +108,6 @@
107
108
  "eslint --cache --fix",
108
109
  "prettier --write"
109
110
  ]
110
- }
111
+ },
112
+ "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
111
113
  }
@@ -11,6 +11,6 @@ export const runMockServer = async (mockDir) => new Promise((resolve) => {
11
11
  const server = app.listen(0);
12
12
  server.on('listening', () => {
13
13
  resolve(server);
14
- log.info('Mock server listening at %d', server.address().port);
14
+ log.debug('Mock server listening at %d', server.address().port);
15
15
  });
16
16
  });
@@ -4,6 +4,6 @@ export const startOauthServer = async () => {
4
4
  const server = new OAuth2Server();
5
5
  await server.issuer.keys.generate('RS256');
6
6
  await server.start(0, 'localhost');
7
- log.info('Started OAuth server');
7
+ log.debug('Started OAuth server');
8
8
  return server;
9
9
  };
@@ -1,4 +1,4 @@
1
- import { test, expect, describe, beforeAll, afterAll } from '@jest/globals';
1
+ import { test, expect, describe, beforeAll, afterAll } from 'vitest';
2
2
  import { fork } from 'node:child_process';
3
3
  import { join } from 'node:path';
4
4
  import { log } from '../log.js';
@@ -0,0 +1,28 @@
1
+ export const getComputeUnits = (autoscaling) => {
2
+ const fixedSizeAutoscaling = Number(autoscaling);
3
+ if (!isNaN(fixedSizeAutoscaling)) {
4
+ return {
5
+ autoscaling_limit_min_cu: fixedSizeAutoscaling,
6
+ autoscaling_limit_max_cu: fixedSizeAutoscaling,
7
+ };
8
+ }
9
+ if (!autoscaling.includes('-')) {
10
+ throw new Error('Autoscaling should be either fixed size (e.g. 2) or min and max sizes delimited with a dash (e.g. "0.5-1")');
11
+ }
12
+ const [min, max] = autoscaling.split('-');
13
+ if (!min || !max) {
14
+ throw new Error('Autoscaling should be either fixed size (e.g. 2) or min and max sizes delimited with a dash (e.g. "0.5-1")');
15
+ }
16
+ const minAutoscaling = Number(min);
17
+ const maxAutoscaling = Number(max);
18
+ if (isNaN(minAutoscaling)) {
19
+ throw new Error('Autoscaling min should be a number');
20
+ }
21
+ if (isNaN(maxAutoscaling)) {
22
+ throw new Error('Autoscaling max should be a number');
23
+ }
24
+ return {
25
+ autoscaling_limit_min_cu: minAutoscaling,
26
+ autoscaling_limit_max_cu: maxAutoscaling,
27
+ };
28
+ };
@@ -1,4 +1,4 @@
1
- import { test, describe, expect } from '@jest/globals';
1
+ import { test, describe, expect } from 'vitest';
2
2
  import { looksLikeBranchId, looksLikeLSN, looksLikeTimestamp } from './formats';
3
3
  describe('branch formats', () => {
4
4
  test('branch name', () => {
package/writer.test.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Writable } from 'node:stream';
2
- import { describe, it, expect } from '@jest/globals';
2
+ import { describe, it, expect } from 'vitest';
3
3
  import { writer } from './writer.js';
4
4
  class MockWritable extends Writable {
5
5
  constructor() {