helixevo 0.2.9 → 0.2.10
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/dashboard/next.config.mjs +19 -3
- package/dist/cli.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import { readFileSync } from 'fs'
|
|
1
|
+
import { readFileSync, existsSync } from 'fs'
|
|
2
2
|
import { join, dirname } from 'path'
|
|
3
3
|
import { fileURLToPath } from 'url'
|
|
4
4
|
|
|
5
5
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
6
6
|
|
|
7
7
|
function getVersion() {
|
|
8
|
+
// 1. Check env var (set by CLI when spawning dashboard)
|
|
9
|
+
if (process.env.HELIXEVO_VERSION && process.env.HELIXEVO_VERSION !== '0.0.0') {
|
|
10
|
+
return process.env.HELIXEVO_VERSION
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 2. Check .helixevo-version marker (written by copyToHelix for npm users)
|
|
14
|
+
const markerFile = join(__dirname, '.helixevo-version')
|
|
15
|
+
if (existsSync(markerFile)) {
|
|
16
|
+
try {
|
|
17
|
+
const v = readFileSync(markerFile, 'utf-8').trim()
|
|
18
|
+
if (v) return v
|
|
19
|
+
} catch {}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 3. Check parent package.json (dev: dashboard/ -> repo root)
|
|
8
23
|
const candidates = [
|
|
9
|
-
join(__dirname, '..', 'package.json'),
|
|
10
|
-
join(__dirname, 'package.json'),
|
|
24
|
+
join(__dirname, '..', 'package.json'),
|
|
25
|
+
join(__dirname, 'package.json'),
|
|
11
26
|
]
|
|
12
27
|
for (const p of candidates) {
|
|
13
28
|
try {
|
|
@@ -15,6 +30,7 @@ function getVersion() {
|
|
|
15
30
|
if (pkg.name === 'helixevo' && pkg.version) return pkg.version
|
|
16
31
|
} catch {}
|
|
17
32
|
}
|
|
33
|
+
|
|
18
34
|
return '0.0.0'
|
|
19
35
|
}
|
|
20
36
|
|
package/dist/cli.js
CHANGED
|
@@ -12378,7 +12378,7 @@ async function dashboardCommand() {
|
|
|
12378
12378
|
const child = spawn2("npx", ["next", "dev", "--port", "3847"], {
|
|
12379
12379
|
cwd: dir,
|
|
12380
12380
|
stdio: "inherit",
|
|
12381
|
-
env: { ...process.env }
|
|
12381
|
+
env: { ...process.env, HELIXEVO_VERSION: VERSION }
|
|
12382
12382
|
});
|
|
12383
12383
|
setTimeout(() => {
|
|
12384
12384
|
try {
|
package/package.json
CHANGED