@solcreek/cli 0.3.1 → 0.3.2
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/dist/index.js +14 -2
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { defineCommand, runMain } from "citty";
|
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
6
7
|
import { loginCommand } from "./commands/login.js";
|
|
7
8
|
import { whoamiCommand } from "./commands/whoami.js";
|
|
8
9
|
import { initCommand } from "./commands/init.js";
|
|
@@ -14,11 +15,22 @@ import { projectsCommand } from "./commands/projects.js";
|
|
|
14
15
|
import { deploymentsCommand } from "./commands/deployments.js";
|
|
15
16
|
import { statusCommand } from "./commands/status.js";
|
|
16
17
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
-
const
|
|
18
|
+
const cliPkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"));
|
|
19
|
+
// Read version from the "creek" facade package (what users install),
|
|
20
|
+
// falling back to CLI's own version if not available.
|
|
21
|
+
let version = cliPkg.version;
|
|
22
|
+
try {
|
|
23
|
+
const require = createRequire(import.meta.url);
|
|
24
|
+
const facadePkg = require("creek/package.json");
|
|
25
|
+
version = facadePkg.version;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// Running outside facade (e.g. workspace dev) — use CLI version
|
|
29
|
+
}
|
|
18
30
|
const main = defineCommand({
|
|
19
31
|
meta: {
|
|
20
32
|
name: "creek",
|
|
21
|
-
version
|
|
33
|
+
version,
|
|
22
34
|
description: "Deploy full-stack apps to the edge",
|
|
23
35
|
},
|
|
24
36
|
subCommands: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solcreek/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "CLI for the Creek deployment platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"!dist/**/*.map",
|
|
11
11
|
"LICENSE"
|
|
12
12
|
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc",
|
|
15
|
+
"dev": "tsc --watch",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"clean": "rm -rf dist"
|
|
18
|
+
},
|
|
13
19
|
"keywords": [
|
|
14
20
|
"creek",
|
|
15
21
|
"cli",
|
|
@@ -26,11 +32,11 @@
|
|
|
26
32
|
"directory": "packages/cli"
|
|
27
33
|
},
|
|
28
34
|
"dependencies": {
|
|
35
|
+
"@solcreek/sdk": "workspace:*",
|
|
29
36
|
"citty": "^0.1.6",
|
|
30
37
|
"consola": "^3.4.2",
|
|
31
38
|
"esbuild": "^0.25.0",
|
|
32
|
-
"smol-toml": "^1.3.1"
|
|
33
|
-
"@solcreek/sdk": "0.1.0-alpha.3"
|
|
39
|
+
"smol-toml": "^1.3.1"
|
|
34
40
|
},
|
|
35
41
|
"optionalDependencies": {
|
|
36
42
|
"@solcreek/adapter-creek": "*"
|
|
@@ -45,11 +51,5 @@
|
|
|
45
51
|
"react": "^19.2.4",
|
|
46
52
|
"react-dom": "^19.2.4",
|
|
47
53
|
"typescript": "^5.8.2"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsc",
|
|
51
|
-
"dev": "tsc --watch",
|
|
52
|
-
"typecheck": "tsc --noEmit",
|
|
53
|
-
"clean": "rm -rf dist"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|