redis-smq-common 8.0.2 → 8.0.3

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.0.3](https://github.com/weyoss/redis-smq/compare/v8.0.2...v8.0.3) (2025-04-14)
7
+
8
+ ### 🚀 Chore
9
+
10
+ - **redis-smq-common:** enhance Redis server management with CLI and scripts ([1fec53e](https://github.com/weyoss/redis-smq/commit/1fec53eb25dd16ea28efaf2a5b31eeab09539ec4))
11
+
6
12
  ## [8.0.2](https://github.com/weyoss/redis-smq/compare/v8.0.1...v8.0.2) (2025-04-14)
7
13
 
8
14
  ### 🚀 Chore
@@ -1,12 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { program } from 'commander';
3
3
  import { buildRedisBinary } from '../src/redis-server/build-redis.js';
4
+ import { RedisServer } from '../src/redis-server/index.js';
4
5
  import { downloadPrebuiltBinary } from '../src/redis-server/redis-binary.js';
5
6
  program
6
7
  .command('redis')
7
8
  .description('Handle Redis server tasks')
8
9
  .option('--download-binary', 'Download Redis binary')
9
10
  .option('--build-from-source', 'Build Redis binary')
11
+ .option('--start-server', 'Start Redis server')
12
+ .option('--port <number>', 'Redis server port', '6379')
10
13
  .action(async (options = {}) => {
11
14
  if (options.downloadBinary) {
12
15
  console.log('Downloading Redis binary...');
@@ -20,7 +23,22 @@ program
20
23
  console.log('Done.');
21
24
  return;
22
25
  }
23
- console.error('No Redis task specified. Use --download-binary or --build-from-source.');
26
+ if (options.startServer) {
27
+ const port = parseInt(options.port || '6379', 10);
28
+ const shutdown = async () => {
29
+ console.log('\nShutting down Redis server...');
30
+ await server.shutdown();
31
+ process.exit(0);
32
+ };
33
+ console.log(`Starting Redis server on ${port}...`);
34
+ const server = new RedisServer();
35
+ process.on('SIGINT', shutdown);
36
+ process.on('SIGTERM', shutdown);
37
+ await server.start(port);
38
+ console.log('Redis server is running. Press Ctrl+C to stop.');
39
+ return;
40
+ }
41
+ console.error('No Redis task specified. Use --download-binary, --build-from-source, or --start-server');
24
42
  });
25
43
  program.parse(process.argv);
26
44
  //# sourceMappingURL=cli.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-smq-common",
3
- "version": "8.0.2",
3
+ "version": "8.0.3",
4
4
  "description": "RedisSMQ Common Library provides many components that are mainly used by RedisSMQ and RedisSMQ Monitor.",
5
5
  "author": "Weyoss <weyoss@protonmail.com>",
6
6
  "license": "MIT",
@@ -87,8 +87,6 @@
87
87
  "scripts": {
88
88
  "test": "../../scripts/test_workspace_esm.sh",
89
89
  "build": "scripts/build.sh",
90
- "document": "scripts/document.sh",
91
- "redis:download": "node ./dist/esm/bin/cli.js redis --download-binary",
92
- "redis:build": "node ./dist/esm/bin/cli.js redis --build-from-source"
90
+ "document": "scripts/document.sh"
93
91
  }
94
92
  }