Skip to content

Commit 38deca7

Browse files
committed
chore: release v2.0.4
1 parent cb8ec48 commit 38deca7

File tree

3 files changed

+84
-42
lines changed

3 files changed

+84
-42
lines changed

.suite-cli/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@microservices-suite/cli",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "This is the CLI tool for running the microservices-suite monorepo. It contains functionalities and tools required for automation and managing the repo across supported platforms. Works on Windows,MacOS and Linux as well as support to some extend other variants like SunOS, IBM AIX, FreeBSD, OpenBSD and more",
55
"main": "cli.js",
66
"repository": "https://github.com/microservices-suite/node-microservices-suite.git",
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const fs = require('fs');
2+
const { retrieveWorkSpaceName } = require('./your-module-file');
3+
4+
// Mock the fs module to simulate file reading
5+
jest.mock('fs');
6+
7+
describe('retrieveWorkSpaceName', () => {
8+
test('should retrieve the workspace name from package.json', () => {
9+
// Mock the content of package.json
10+
const packageJsonContent = JSON.stringify({ name: 'your-workspace-name/workspace' });
11+
const packageJsonPath = '/path/to/package.json';
12+
13+
// Mock fs.readFileSync to return package.json content
14+
fs.readFileSync.mockReturnValue(packageJsonContent);
15+
16+
// Call the function with mocked parameters
17+
const result = retrieveWorkSpaceName({ package_json_path: packageJsonPath });
18+
19+
// Assert that the result matches the expected workspace name
20+
expect(result).toEqual({ workspace_name: 'your-workspace-name' });
21+
});
22+
23+
test('should throw an error when parsing package.json fails', () => {
24+
// Mock the content of package.json with invalid JSON
25+
const packageJsonContent = '{ invalid_json }';
26+
const packageJsonPath = '/path/to/package.json';
27+
28+
// Mock fs.readFileSync to return package.json content
29+
fs.readFileSync.mockReturnValue(packageJsonContent);
30+
31+
// Assert that the function throws an error
32+
expect(() => {
33+
retrieveWorkSpaceName({ package_json_path: packageJsonPath });
34+
}).toThrowError('Unexpected token i in JSON at position 2');
35+
// Adjust the error message to match the specific error thrown when parsing fails
36+
});
37+
38+
test('should handle missing package.json file', () => {
39+
// Mock fs.readFileSync to throw an error indicating that the file doesn't exist
40+
fs.readFileSync.mockImplementation(() => {
41+
throw new Error('ENOENT: no such file or directory');
42+
});
43+
44+
// Assert that the function throws an error
45+
expect(() => {
46+
retrieveWorkSpaceName({ package_json_path: '/nonexistent/path/to/package.json' });
47+
}).toThrowError('ENOENT: no such file or directory');
48+
});
49+
});

yarn.lock

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
winston "^3.13.0"
6666

6767
"@mongodb-js/saslprep@^1.1.5":
68-
version "1.1.6"
69-
resolved "https://registry.yarnpkg.com/@mongodb-js/saslprep/-/saslprep-1.1.6.tgz#54da3f794c71a17445740fe2b74882e0c76a3058"
70-
integrity sha512-jqTTXQ46H8cAxmXBu8wm1HTSIMBMrIcoVrsjdQkKdMBj3il/fSCgWyya4P2I1xjPBl69mw+nRphrPlcIqBd20Q==
68+
version "1.1.7"
69+
resolved "https://registry.yarnpkg.com/@mongodb-js/saslprep/-/saslprep-1.1.7.tgz#d1700facfd6916c50c2c88fd6d48d363a56c702f"
70+
integrity sha512-dCHW/oEX0KJ4NjDULBo3JiOaK5+6axtpBbS+ao2ZInoAL9/YRQLhXzSNAFz7hP4nzLkIqsfYAK/PDE3+XHny0Q==
7171
dependencies:
7272
sparse-bitfield "^3.0.3"
7373

@@ -211,11 +211,6 @@
211211
dependencies:
212212
"@types/webidl-conversions" "*"
213213

214-
abbrev@1:
215-
version "1.1.1"
216-
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
217-
integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==
218-
219214
accepts@~1.3.8:
220215
version "1.3.8"
221216
resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e"
@@ -418,7 +413,7 @@ braces@~3.0.2:
418413
dependencies:
419414
fill-range "^7.0.1"
420415

421-
bson@^6.4.0, bson@^6.5.0:
416+
bson@^6.4.0, bson@^6.5.0, bson@^6.7.0:
422417
version "6.7.0"
423418
resolved "https://registry.yarnpkg.com/bson/-/bson-6.7.0.tgz#51973b132cdc424c8372fda3cb43e3e3e2ae2227"
424419
integrity sha512-w2IquM5mYzYZv6rs3uN2DZTOBe2a0zXLj53TGDqwF4l6Sz/XsISrisXOJihArF9+BZ6Cq/GjVht7Sjfmri7ytQ==
@@ -1503,14 +1498,14 @@ module-details-from-path@^1.0.3:
15031498
integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A==
15041499

15051500
mongodb-connection-string-url@^3.0.0:
1506-
version "3.0.0"
1507-
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz#b4f87f92fd8593f3b9365f592515a06d304a1e9c"
1508-
integrity sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ==
1501+
version "3.0.1"
1502+
resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz#c13e6ac284ae401752ebafdb8cd7f16c6723b141"
1503+
integrity sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==
15091504
dependencies:
15101505
"@types/whatwg-url" "^11.0.2"
15111506
whatwg-url "^13.0.0"
15121507

1513-
mongodb@6.5.0, mongodb@^6.5.0:
1508+
mongodb@6.5.0:
15141509
version "6.5.0"
15151510
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.5.0.tgz#3735b4fba085b26ca06f7744e9639bc538e93d87"
15161511
integrity sha512-Fozq68InT+JKABGLqctgtb8P56pRrJFkbhW0ux+x1mdHeyinor8oNzJqwLjV/t5X5nJGfTlluxfyMnOXNggIUA==
@@ -1519,18 +1514,27 @@ mongodb@6.5.0, mongodb@^6.5.0:
15191514
bson "^6.4.0"
15201515
mongodb-connection-string-url "^3.0.0"
15211516

1517+
mongodb@^6.5.0:
1518+
version "6.6.1"
1519+
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.6.1.tgz#0b883be638c5b1ad1f87d8617f1d76ceeeda0bdc"
1520+
integrity sha512-FvA9ocQzRzzvhin1HHLrZDEm0gWvnksbiciYrU/0GmET/t/DdDiMJroA7rfDrHM3AInwGVYw2fwAU2oNYUyUEw==
1521+
dependencies:
1522+
"@mongodb-js/saslprep" "^1.1.5"
1523+
bson "^6.7.0"
1524+
mongodb-connection-string-url "^3.0.0"
1525+
15221526
mongoose@*, mongoose@^8.2.1:
1523-
version "8.3.3"
1524-
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-8.3.3.tgz#3dc1ffe76c6c92e5d5c25b61aed221d11d420632"
1525-
integrity sha512-3kSk0db9DM2tLttCdS6WNRqewPleamFEa4Vz/Qldc0dB4Zow/FiZxb9GExHTJjBZQ9T2xiGleQ3GzRrES3hhsA==
1527+
version "8.3.4"
1528+
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-8.3.4.tgz#67af8b1db41ed3dcef8449a0d1c6643e6f228d92"
1529+
integrity sha512-ckBaBzKgtWgCalW/LPkcBsR3wKCOYEJ9jLFPmYCYV7TLStpETY757ELx8/1stL11+6HxLLVffawBffXzd0Y7YA==
15261530
dependencies:
15271531
bson "^6.5.0"
15281532
kareem "2.6.3"
15291533
mongodb "6.5.0"
15301534
mpath "0.9.0"
15311535
mquery "5.0.0"
15321536
ms "2.1.3"
1533-
sift "16.0.1"
1537+
sift "17.1.3"
15341538

15351539
morgan@^1.10.0:
15361540
version "1.10.0"
@@ -1623,13 +1627,6 @@ nodemon@3.1.0, nodemon@^3.1.0:
16231627
touch "^3.1.0"
16241628
undefsafe "^2.0.5"
16251629

1626-
nopt@~1.0.10:
1627-
version "1.0.10"
1628-
resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee"
1629-
integrity sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==
1630-
dependencies:
1631-
abbrev "1"
1632-
16331630
normalize-path@^3.0.0, normalize-path@~3.0.0:
16341631
version "3.0.0"
16351632
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
@@ -2077,11 +2074,9 @@ semver@^5.3.0, semver@^5.5.0:
20772074
integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==
20782075

20792076
semver@^7.2, semver@^7.5.3:
2080-
version "7.6.0"
2081-
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d"
2082-
integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==
2083-
dependencies:
2084-
lru-cache "^6.0.0"
2077+
version "7.6.2"
2078+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
2079+
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
20852080

20862081
semver@~7.5.0, semver@~7.5.4:
20872082
version "7.5.4"
@@ -2151,10 +2146,10 @@ side-channel@^1.0.4:
21512146
get-intrinsic "^1.2.4"
21522147
object-inspect "^1.13.1"
21532148

2154-
sift@16.0.1:
2155-
version "16.0.1"
2156-
resolved "https://registry.yarnpkg.com/sift/-/sift-16.0.1.tgz#e9c2ccc72191585008cf3e36fc447b2d2633a053"
2157-
integrity sha512-Wv6BjQ5zbhW7VFefWusVP33T/EM0vYikCaQ2qR8yULbsilAT8/wQaXvuQ3ptGLpoKx+lihJE3y2UTgKDyyNHZQ==
2149+
sift@17.1.3:
2150+
version "17.1.3"
2151+
resolved "https://registry.yarnpkg.com/sift/-/sift-17.1.3.tgz#9d2000d4d41586880b0079b5183d839c7a142bf7"
2152+
integrity sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==
21582153

21592154
signal-exit@^3.0.2, signal-exit@^3.0.3:
21602155
version "3.0.7"
@@ -2307,9 +2302,9 @@ supports-preserve-symlinks-flag@^1.0.0:
23072302
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
23082303

23092304
systeminformation@^5.7:
2310-
version "5.22.7"
2311-
resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.22.7.tgz#9a20810c7eacad4aebe7591cb7c78c0dd96dbd1a"
2312-
integrity sha512-AWxlP05KeHbpGdgvZkcudJpsmChc2Y5Eo/GvxG/iUA/Aws5LZKHAMSeAo+V+nD+nxWZaxrwpWcnx4SH3oxNL3A==
2305+
version "5.22.9"
2306+
resolved "https://registry.yarnpkg.com/systeminformation/-/systeminformation-5.22.9.tgz#68700a895a48cbf96e2cd6a34c5027d1fe58f053"
2307+
integrity sha512-qUWJhQ9JSBhdjzNUQywpvc0icxUAjMY3sZqUoS0GOtaJV9Ijq8s9zEP8Gaqmymn1dOefcICyPXK1L3kgKxlUpg==
23132308

23142309
text-hex@1.0.x:
23152310
version "1.0.0"
@@ -2341,11 +2336,9 @@ toidentifier@1.0.1:
23412336
integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==
23422337

23432338
touch@^3.1.0:
2344-
version "3.1.0"
2345-
resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.0.tgz#fe365f5f75ec9ed4e56825e0bb76d24ab74af83b"
2346-
integrity sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==
2347-
dependencies:
2348-
nopt "~1.0.10"
2339+
version "3.1.1"
2340+
resolved "https://registry.yarnpkg.com/touch/-/touch-3.1.1.tgz#097a23d7b161476435e5c1344a95c0f75b4a5694"
2341+
integrity sha512-r0eojU4bI8MnHr8c5bNo7lJDdI2qXlWWJk6a9EAFG7vbhTjElYhBVS3/miuE0uOuoLdb8Mc/rVfsmm6eo5o9GA==
23492342

23502343
tr46@^4.1.1:
23512344
version "4.1.1"

0 commit comments

Comments
 (0)