balena-settings-client 5.0.4-build-drop-lodash-1eab7d7f4d034e4efb1b0ae553200b857ca25a43-1 → 5.0.4-build-drop-lodash-e1b494191f5710e3bcd7522b2bf7bc943f249b99-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.
@@ -1,6 +1,13 @@
1
1
  - commits:
2
- - subject: test fix
3
- hash: 1eab7d7f4d034e4efb1b0ae553200b857ca25a43
2
+ - subject: Fix empty error
3
+ hash: e1b494191f5710e3bcd7522b2bf7bc943f249b99
4
+ body: ""
5
+ footer:
6
+ Change-type: patch
7
+ change-type: patch
8
+ author: Matthew Yarmolinsky
9
+ - subject: Test without bluebird
10
+ hash: 680f2497a376b73f40dd5953f1b9e539ea001b17
4
11
  body: ""
5
12
  footer:
6
13
  Change-type: patch
@@ -43,7 +50,7 @@
43
50
  author: Matthew Yarmolinsky
44
51
  version: 5.0.4
45
52
  title: ""
46
- date: 2025-12-22T23:22:26.981Z
53
+ date: 2025-12-23T00:11:29.512Z
47
54
  - commits:
48
55
  - subject: Update TypeScript to 5.1.3
49
56
  hash: 9127d3d46c063abbd8a55af1a53492de54fb1154
package/CHANGELOG.md CHANGED
@@ -5,9 +5,10 @@ automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
5
5
  This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
7
  # v5.0.4
8
- ## (2025-12-22)
8
+ ## (2025-12-23)
9
9
 
10
- * test fix [Matthew Yarmolinsky]
10
+ * Fix empty error [Matthew Yarmolinsky]
11
+ * Test without bluebird [Matthew Yarmolinsky]
11
12
  * Replace `lodash` with `es-toolkit` [Matthew Yarmolinsky]
12
13
  * Add dependency `es-toolkit` [Matthew Yarmolinsky]
13
14
  * Drop `lodash` as a dependency [Matthew Yarmolinsky]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balena-settings-client",
3
- "version": "5.0.4-build-drop-lodash-1eab7d7f4d034e4efb1b0ae553200b857ca25a43-1",
3
+ "version": "5.0.4-build-drop-lodash-e1b494191f5710e3bcd7522b2bf7bc943f249b99-1",
4
4
  "description": "Balena client application shared settings",
5
5
  "main": "build/settings.js",
6
6
  "types": "build/settings.d.ts",
@@ -34,13 +34,11 @@
34
34
  "devDependencies": {
35
35
  "@balena/lint": "^6.2.2",
36
36
  "@resin.io/types-wary": "1.1.1",
37
- "@types/bluebird": "^3.5.30",
38
37
  "@types/chai": "^4.2.11",
39
38
  "@types/chai-as-promised": "^7.1.2",
40
39
  "@types/common-tags": "^1.8.0",
41
40
  "@types/mocha": "^5.2.7",
42
41
  "@types/node": "^8.10.60",
43
- "bluebird": "^3.7.2",
44
42
  "chai": "^4.2.0",
45
43
  "chai-as-promised": "^7.1.1",
46
44
  "common-tags": "^1.8.0",
@@ -75,6 +73,6 @@
75
73
  ]
76
74
  },
77
75
  "versionist": {
78
- "publishedAt": "2025-12-22T23:22:27.066Z"
76
+ "publishedAt": "2025-12-23T00:11:29.601Z"
79
77
  }
80
78
  }
package/tests/e2e/test.ts CHANGED
@@ -1,5 +1,3 @@
1
- import * as Promise from 'bluebird';
2
- import * as childProcess from 'child_process';
3
1
  import { stripIndent } from 'common-tags';
4
2
  import * as fs from 'fs';
5
3
  import { expect, use } from 'chai';
@@ -10,116 +8,91 @@ import * as chaiAsPromised from 'chai-as-promised';
10
8
  use(chaiAsPromised);
11
9
 
12
10
  import config = require('../../lib/config');
11
+ import { promisify } from 'util';
12
+ import { exec } from 'child_process';
13
13
 
14
- const execAsync = Promise.promisify<[string, string], string, any>(
15
- childProcess.exec,
16
- { multiArgs: true },
17
- );
14
+ const execAsync = promisify(exec);
18
15
 
19
16
  const handleExecResult = (stdout: string, stderr: string) => {
20
- // Inside handleExecResult(error, stdout, stderr)
21
-
22
- if (stderr) {
23
- console.log('============= DEBUG CRASH REPORT =============');
24
-
25
- // 1. Log stdout (sometimes errors end up here)
26
- if (stdout) {
27
- console.log('--- STDOUT ---');
28
- console.log(stdout.toString()); // Ensure Buffer is converted
29
- }
30
-
31
- // 2. Log stderr
32
- if (stderr) {
33
- console.log('--- STDERR ---');
34
- console.log(stderr.toString());
35
- }
36
-
37
- console.log('==============================================');
38
-
39
- // Throw a descriptive error
40
- const message = (stderr || stdout || 'Unknown CLI Error').toString();
41
- throw new Error(`CLI Failed: ${message}`);
17
+ if (stderr.length > 0) {
18
+ throw new Error(stderr);
42
19
  }
43
20
  return stdout.replace(/\n$/, '');
44
21
  };
45
22
 
46
23
  const getSetting = (setting: string) => {
47
24
  const script = path.join(__dirname, 'get.ts');
48
- return execAsync(`ts-node ${script} ${setting}`, { encoding: 'utf8' }).spread(
49
- handleExecResult,
25
+ return execAsync(`ts-node ${script} ${setting}`, { encoding: 'utf8' }).then(
26
+ ({ stdout, stderr }) => {
27
+ return handleExecResult(stdout, stderr);
28
+ },
50
29
  );
51
30
  };
52
31
 
53
32
  const getAll = () => {
54
33
  const script = path.join(__dirname, 'get-all.ts');
55
34
  return execAsync(`ts-node ${script}`, { encoding: 'utf8' })
56
- .spread(handleExecResult)
35
+ .then(({ stdout, stderr }) => {
36
+ return handleExecResult(stdout, stderr);
37
+ })
57
38
  .then(JSON.parse);
58
39
  };
59
40
 
60
41
  wary.it(
61
42
  'should override defaults given a legacy resin configuration',
62
43
  {},
63
- () => {
44
+ async () => {
64
45
  fs.writeFileSync(
65
46
  config.paths.user.replace('balenarc.yml', 'resinrc.yml'),
66
47
  stripIndent`
67
48
  resinUrl: resin.io
68
49
  `,
69
50
  );
70
- return Promise.props({
71
- balenaUrl: getSetting('balenaUrl'),
72
- apiUrl: getSetting('apiUrl'),
73
- dashboardUrl: getSetting('dashboardUrl'),
74
- vpnUrl: getSetting('vpnUrl'),
75
- registryUrl: getSetting('registryUrl'),
76
- registry2Url: getSetting('registry2Url'),
77
- proxyUrl: getSetting('proxyUrl'),
78
- }).then((settings) => {
79
- expect(settings.balenaUrl).to.equal('resin.io');
80
- expect(settings.apiUrl).to.equal('https://api.resin.io');
81
- expect(settings.dashboardUrl).to.equal('https://dashboard.resin.io');
82
- expect(settings.vpnUrl).to.equal('vpn.resin.io');
83
- expect(settings.registryUrl).to.equal('registry.resin.io');
84
- expect(settings.registry2Url).to.equal('registry2.resin.io');
85
- expect(settings.proxyUrl).to.equal('resindevice.io');
86
- });
51
+ const balenaUrl = await getSetting('balenaUrl');
52
+ expect(balenaUrl).to.equal('resin.io');
53
+ const apiUrl = await getSetting('apiUrl');
54
+ expect(apiUrl).to.equal('https://api.resin.io');
55
+ const dashboardUrl = await getSetting('dashboardUrl');
56
+ expect(dashboardUrl).to.equal('https://dashboard.resin.io');
57
+ const vpnUrl = await getSetting('vpnUrl');
58
+ expect(vpnUrl).to.equal('vpn.resin.io');
59
+ const registryUrl = await getSetting('registryUrl');
60
+ expect(registryUrl).to.equal('registry.resin.io');
61
+ const registry2Url = await getSetting('registry2Url');
62
+ expect(registry2Url).to.equal('registry2.resin.io');
63
+ const proxyUrl = await getSetting('proxyUrl');
64
+ expect(proxyUrl).to.equal('resindevice.io');
87
65
  },
88
66
  );
89
67
 
90
68
  wary.it(
91
69
  'should override defaults and resin configuration given a user balena configuration that points to staging',
92
70
  {},
93
- () => {
71
+ async () => {
94
72
  fs.writeFileSync(
95
73
  config.paths.user,
96
74
  stripIndent`
97
75
  balenaUrl: balena-staging.com
98
76
  `,
99
77
  );
100
- return Promise.props({
101
- balenaUrl: getSetting('balenaUrl'),
102
- apiUrl: getSetting('apiUrl'),
103
- dashboardUrl: getSetting('dashboardUrl'),
104
- vpnUrl: getSetting('vpnUrl'),
105
- registryUrl: getSetting('registryUrl'),
106
- registry2Url: getSetting('registry2Url'),
107
- proxyUrl: getSetting('proxyUrl'),
108
- }).then((settings) => {
109
- expect(settings.balenaUrl).to.equal('balena-staging.com');
110
- expect(settings.apiUrl).to.equal('https://api.balena-staging.com');
111
- expect(settings.dashboardUrl).to.equal(
112
- 'https://dashboard.balena-staging.com',
113
- );
114
- expect(settings.vpnUrl).to.equal('vpn.balena-staging.com');
115
- expect(settings.registryUrl).to.equal('registry.balena-staging.com');
116
- expect(settings.registry2Url).to.equal('registry2.balena-staging.com');
117
- expect(settings.proxyUrl).to.equal('balena-staging-devices.com');
118
- });
78
+ const balenaUrl = await getSetting('balenaUrl');
79
+ expect(balenaUrl).to.equal('balena-staging.com');
80
+ const apiUrl = await getSetting('apiUrl');
81
+ expect(apiUrl).to.equal('https://api.balena-staging.com');
82
+ const dashboardUrl = await getSetting('dashboardUrl');
83
+ expect(dashboardUrl).to.equal('https://dashboard.balena-staging.com');
84
+ const vpnUrl = await getSetting('vpnUrl');
85
+ expect(vpnUrl).to.equal('vpn.balena-staging.com');
86
+ const registryUrl = await getSetting('registryUrl');
87
+ expect(registryUrl).to.equal('registry.balena-staging.com');
88
+ const registry2Url = await getSetting('registry2Url');
89
+ expect(registry2Url).to.equal('registry2.balena-staging.com');
90
+ const proxyUrl = await getSetting('proxyUrl');
91
+ expect(proxyUrl).to.equal('balena-staging-devices.com');
119
92
  },
120
93
  );
121
94
 
122
- wary.it('should give precedence to project configuration', {}, () => {
95
+ wary.it('should give precedence to project configuration', {}, async () => {
123
96
  fs.writeFileSync(
124
97
  config.paths.user,
125
98
  stripIndent`
@@ -132,25 +105,20 @@ wary.it('should give precedence to project configuration', {}, () => {
132
105
  balenaUrl: balena.custom.com/
133
106
  `,
134
107
  );
135
- return Promise.props({
136
- balenaUrl: getSetting('balenaUrl'),
137
- apiUrl: getSetting('apiUrl'),
138
- dashboardUrl: getSetting('dashboardUrl'),
139
- vpnUrl: getSetting('vpnUrl'),
140
- registryUrl: getSetting('registryUrl'),
141
- registry2Url: getSetting('registry2Url'),
142
- proxyUrl: getSetting('proxyUrl'),
143
- }).then((settings) => {
144
- expect(settings.balenaUrl).to.equal('balena.custom.com/');
145
- expect(settings.apiUrl).to.equal('https://api.balena.custom.com/');
146
- expect(settings.dashboardUrl).to.equal(
147
- 'https://dashboard.balena.custom.com/',
148
- );
149
- expect(settings.vpnUrl).to.equal('vpn.balena.custom.com/');
150
- expect(settings.registryUrl).to.equal('registry.balena.custom.com/');
151
- expect(settings.registry2Url).to.equal('registry2.balena.custom.com/');
152
- expect(settings.proxyUrl).to.equal('devices.balena.custom.com/');
153
- });
108
+ const balenaUrl = await getSetting('balenaUrl');
109
+ expect(balenaUrl).to.equal('balena.custom.com/');
110
+ const apiUrl = await getSetting('apiUrl');
111
+ expect(apiUrl).to.equal('https://api.balena.custom.com/');
112
+ const dashboardUrl = await getSetting('dashboardUrl');
113
+ expect(dashboardUrl).to.equal('https://dashboard.balena.custom.com/');
114
+ const vpnUrl = await getSetting('vpnUrl');
115
+ expect(vpnUrl).to.equal('vpn.balena.custom.com/');
116
+ const registryUrl = await getSetting('registryUrl');
117
+ expect(registryUrl).to.equal('registry.balena.custom.com/');
118
+ const registry2Url = await getSetting('registry2Url');
119
+ expect(registry2Url).to.equal('registry2.balena.custom.com/');
120
+ const proxyUrl = await getSetting('proxyUrl');
121
+ expect(proxyUrl).to.equal('devices.balena.custom.com/');
154
122
  });
155
123
 
156
124
  wary.it(