@cloak-db/app 0.1.3 → 0.2.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.
Files changed (3) hide show
  1. package/README.md +11 -10
  2. package/dist/cli.js +20 -4
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://raw.githubusercontent.com/cloak-db/cloak-db/main/logo.png" alt="Cloak DB Logo" width="120">
2
+ <img src="https://raw.githubusercontent.com/Cloak-DB/cloak-monolith/refs/heads/main/logo.png" alt="Cloak DB Logo" width="120">
3
3
  </p>
4
4
 
5
5
  <h1 align="center">@cloak-db/app</h1>
@@ -10,17 +10,17 @@
10
10
  <a href="https://www.npmjs.com/package/@cloak-db/app">
11
11
  <img src="https://img.shields.io/npm/v/@cloak-db/app.svg" alt="npm version">
12
12
  </a>
13
- <a href="https://github.com/cloak-db/cloak-db/blob/main/LICENSE">
13
+ <a href="https://github.com/Cloak-DB/cloak-monolith/blob/main/LICENSE">
14
14
  <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License">
15
15
  </a>
16
- <a href="https://cloak-db.com">
16
+ <a href="https://www.cloak-db.com">
17
17
  <img src="https://img.shields.io/badge/website-cloak--db.com-blue" alt="Website">
18
18
  </a>
19
19
  </p>
20
20
 
21
21
  ---
22
22
 
23
- [Cloak DB](https://cloak-db.com) is an open-source, local-first database studio built for development. It helps you iterate faster with features like database snapshots, resource inspection, and data anonymization.
23
+ [Cloak DB](https://www.cloak-db.com) is an open-source, local-first database studio built for development. It helps you iterate faster with features like database snapshots, resource inspection, and data anonymization.
24
24
 
25
25
  ## Requirements
26
26
 
@@ -39,7 +39,8 @@ This pulls and runs the Cloak DB Docker image, making it available at [http://lo
39
39
  | Flag | Description | Default |
40
40
  |------|-------------|---------|
41
41
  | `-p, --port <port>` | Port to run on | `3000` |
42
- | `-v, --version <tag>` | Docker image version | `latest` |
42
+ | `-t, --tag <tag>` | Docker image tag | `latest` |
43
+ | `-v, --version` | Show CLI version | |
43
44
  | `-h, --help` | Show help | |
44
45
 
45
46
  ### Examples
@@ -52,15 +53,15 @@ npx @cloak-db/app
52
53
  npx @cloak-db/app --port 8080
53
54
 
54
55
  # Run specific version
55
- npx @cloak-db/app --version 0.1.2
56
+ npx @cloak-db/app --tag 0.1.2
56
57
  ```
57
58
 
58
59
  ## Links
59
60
 
60
- - [Website](https://cloak-db.com)
61
- - [Documentation](https://cloak-db.com/docs)
62
- - [GitHub](https://github.com/cloak-db/cloak-db)
63
- - [Report Issues](https://github.com/cloak-db/cloak-db/issues)
61
+ - [Website](https://www.cloak-db.com)
62
+ - [Documentation](https://www.cloak-db.com/docs)
63
+ - [GitHub](https://github.com/Cloak-DB/cloak-monolith)
64
+ - [Report Issues](https://github.com/Cloak-DB/cloak-monolith/issues)
64
65
 
65
66
  ## License
66
67
 
package/dist/cli.js CHANGED
@@ -2,9 +2,12 @@
2
2
 
3
3
  // src/cli.ts
4
4
  import { spawn, execSync } from "child_process";
5
+ import { homedir } from "os";
6
+ import { join } from "path";
5
7
  import { parseArgs } from "util";
6
8
  var IMAGE_NAME = "ghcr.io/cloak-db/app";
7
9
  var DEFAULT_PORT = 3e3;
10
+ var CLI_VERSION = "0.2.3";
8
11
  function printHelp() {
9
12
  console.log(`
10
13
  Cloak DB - Local-first database studio
@@ -13,13 +16,14 @@ Usage: cloak-app [options]
13
16
 
14
17
  Options:
15
18
  -p, --port <port> Port to run on (default: ${DEFAULT_PORT})
16
- -v, --version <tag> Docker image version/tag (default: latest)
19
+ -t, --tag <tag> Docker image tag (default: latest)
20
+ -v, --version Show CLI version
17
21
  -h, --help Show this help message
18
22
 
19
23
  Examples:
20
24
  cloak-app # Run on port ${DEFAULT_PORT}
21
25
  cloak-app --port 8080 # Run on port 8080
22
- cloak-app --version v0.2.0 # Run specific version
26
+ cloak-app --tag v0.2.0 # Run specific version
23
27
 
24
28
  Requirements:
25
29
  Docker must be installed and running.
@@ -31,13 +35,15 @@ function parseCliArgs() {
31
35
  const { values } = parseArgs({
32
36
  options: {
33
37
  port: { type: "string", short: "p", default: String(DEFAULT_PORT) },
34
- version: { type: "string", short: "v", default: "latest" },
38
+ tag: { type: "string", short: "t", default: "latest" },
39
+ version: { type: "boolean", short: "v", default: false },
35
40
  help: { type: "boolean", short: "h", default: false }
36
41
  },
37
42
  allowPositionals: false
38
43
  });
39
44
  return {
40
45
  port: parseInt(values.port, 10),
46
+ tag: values.tag,
41
47
  version: values.version,
42
48
  help: values.help
43
49
  };
@@ -63,8 +69,10 @@ function checkDockerRunning() {
63
69
  }
64
70
  }
65
71
  function runContainer(options) {
66
- const image = `${IMAGE_NAME}:${options.version}`;
72
+ const image = `${IMAGE_NAME}:${options.tag}`;
67
73
  const containerName = `cloak-app-${Date.now()}`;
74
+ const hostConfigDir = join(homedir(), ".config", "cloak-db");
75
+ const containerConfigDir = "/home/nextjs/.config/cloak-db";
68
76
  console.log(`
69
77
  \u{1F680} Starting Cloak DB on port ${options.port}...`);
70
78
  console.log(` Image: ${image}
@@ -74,10 +82,14 @@ function runContainer(options) {
74
82
  [
75
83
  "run",
76
84
  "--rm",
85
+ "--pull",
86
+ "always",
77
87
  "--name",
78
88
  containerName,
79
89
  "-p",
80
90
  `${options.port}:3000`,
91
+ "-v",
92
+ `${hostConfigDir}:${containerConfigDir}`,
81
93
  image
82
94
  ],
83
95
  { stdio: "inherit" }
@@ -101,6 +113,10 @@ function runContainer(options) {
101
113
  }
102
114
  function main() {
103
115
  const options = parseCliArgs();
116
+ if (options.version) {
117
+ console.log(CLI_VERSION);
118
+ process.exit(0);
119
+ }
104
120
  if (options.help) {
105
121
  printHelp();
106
122
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloak-db/app",
3
- "version": "0.1.3",
3
+ "version": "0.2.3",
4
4
  "description": "Run Cloak DB locally with Docker",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,12 +20,12 @@
20
20
  "license": "MIT",
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "https://github.com/cloak-db/cloak-db.git",
23
+ "url": "https://github.com/Cloak-DB/cloak-monolith.git",
24
24
  "directory": "packages/cli"
25
25
  },
26
- "homepage": "https://cloak-db.com",
26
+ "homepage": "https://www.cloak-db.com",
27
27
  "engines": {
28
- "node": ">=18"
28
+ "node": ">=22"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^22.0.0",