super-time-tracker-ui 0.1.2 → 0.1.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 +7 -0
- package/bin/stt-ui.js +33 -7
- package/lib/get_tracker_state.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.3](https://github.com/f3rnox/super-time-tracker-ui/compare/v0.1.2...v0.1.3) (2026-05-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* bin script ([53f1adc](https://github.com/f3rnox/super-time-tracker-ui/commit/53f1adc2a3cd53b07756eaf906c8e6ebeae76771))
|
|
11
|
+
|
|
5
12
|
### [0.1.2](https://github.com/f3rnox/super-time-tracker-ui/compare/v0.1.1...v0.1.2) (2026-05-18)
|
|
6
13
|
|
|
7
14
|
|
package/bin/stt-ui.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict'
|
|
3
3
|
|
|
4
|
-
const { spawn } = require('child_process')
|
|
5
|
-
const { existsSync, cpSync } = require('fs')
|
|
4
|
+
const { spawn, spawnSync } = require('child_process')
|
|
5
|
+
const { existsSync, cpSync, unlinkSync } = require('fs')
|
|
6
6
|
const { join } = require('path')
|
|
7
7
|
|
|
8
8
|
const root = join(__dirname, '..')
|
|
9
9
|
const standalone_dir = join(root, '.next', 'standalone')
|
|
10
10
|
const server_js = join(standalone_dir, 'server.js')
|
|
11
|
+
const build_lock = join(root, '.next', 'lock')
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Copies build artifacts required by the Next.js standalone server.
|
|
@@ -28,13 +29,38 @@ function sync_standalone_assets() {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Runs `next build` when the standalone server bundle is missing.
|
|
34
|
+
*/
|
|
35
|
+
function ensure_standalone_build() {
|
|
36
|
+
if (existsSync(server_js)) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (existsSync(build_lock)) {
|
|
41
|
+
console.error('Removing stale Next.js build lock…')
|
|
42
|
+
unlinkSync(build_lock)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
console.error('Production build not found. Running `next build`…')
|
|
46
|
+
|
|
47
|
+
const next_bin = require.resolve('next/dist/bin/next')
|
|
48
|
+
const result = spawnSync(process.execPath, [next_bin, 'build'], {
|
|
49
|
+
cwd: root,
|
|
50
|
+
stdio: 'inherit',
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
if (result.status !== 0) {
|
|
54
|
+
process.exit(result.status ?? 1)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!existsSync(server_js)) {
|
|
58
|
+
console.error('Build finished but standalone server.js is still missing.')
|
|
59
|
+
process.exit(1)
|
|
60
|
+
}
|
|
36
61
|
}
|
|
37
62
|
|
|
63
|
+
ensure_standalone_build()
|
|
38
64
|
sync_standalone_assets()
|
|
39
65
|
|
|
40
66
|
const port = process.env.PORT ?? '3000'
|
package/lib/get_tracker_state.ts
CHANGED