super-time-tracker-ui 0.1.2 → 0.1.4

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
@@ -2,6 +2,20 @@
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.4](https://github.com/f3rnox/super-time-tracker-ui/compare/v0.1.3...v0.1.4) (2026-05-19)
6
+
7
+
8
+ ### Features
9
+
10
+ * add --version output to bin script ([12a91ae](https://github.com/f3rnox/super-time-tracker-ui/commit/12a91ae3ae468bf9f0e46e0304bdf8e7ee01ba8b))
11
+
12
+ ### [0.1.3](https://github.com/f3rnox/super-time-tracker-ui/compare/v0.1.2...v0.1.3) (2026-05-18)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * bin script ([53f1adc](https://github.com/f3rnox/super-time-tracker-ui/commit/53f1adc2a3cd53b07756eaf906c8e6ebeae76771))
18
+
5
19
  ### [0.1.2](https://github.com/f3rnox/super-time-tracker-ui/compare/v0.1.1...v0.1.2) (2026-05-18)
6
20
 
7
21
 
package/bin/stt-ui.js CHANGED
@@ -1,13 +1,21 @@
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
+ const { version } = require('../package.json')
10
+
11
+ if (process.argv.includes('--version') || process.argv.includes('-V')) {
12
+ process.stdout.write(`${version}\n`)
13
+ process.exit(0)
14
+ }
15
+
9
16
  const standalone_dir = join(root, '.next', 'standalone')
10
17
  const server_js = join(standalone_dir, 'server.js')
18
+ const build_lock = join(root, '.next', 'lock')
11
19
 
12
20
  /**
13
21
  * Copies build artifacts required by the Next.js standalone server.
@@ -28,13 +36,38 @@ function sync_standalone_assets() {
28
36
  }
29
37
  }
30
38
 
31
- if (!existsSync(server_js)) {
32
- console.error(
33
- 'Standalone build not found. Run `pnpm build` first, then `stt-ui`.',
34
- )
35
- process.exit(1)
39
+ /**
40
+ * Runs `next build` when the standalone server bundle is missing.
41
+ */
42
+ function ensure_standalone_build() {
43
+ if (existsSync(server_js)) {
44
+ return
45
+ }
46
+
47
+ if (existsSync(build_lock)) {
48
+ console.error('Removing stale Next.js build lock…')
49
+ unlinkSync(build_lock)
50
+ }
51
+
52
+ console.error('Production build not found. Running `next build`…')
53
+
54
+ const next_bin = require.resolve('next/dist/bin/next')
55
+ const result = spawnSync(process.execPath, [next_bin, 'build'], {
56
+ cwd: root,
57
+ stdio: 'inherit',
58
+ })
59
+
60
+ if (result.status !== 0) {
61
+ process.exit(result.status ?? 1)
62
+ }
63
+
64
+ if (!existsSync(server_js)) {
65
+ console.error('Build finished but standalone server.js is still missing.')
66
+ process.exit(1)
67
+ }
36
68
  }
37
69
 
70
+ ensure_standalone_build()
38
71
  sync_standalone_assets()
39
72
 
40
73
  const port = process.env.PORT ?? '3000'
@@ -37,6 +37,7 @@ export async function get_tracker_state(
37
37
 
38
38
  active_sheet_entries = sort_serialized_entries(
39
39
  serialize_sheet_entries(sheet),
40
+ 'newest',
40
41
  )
41
42
  }
42
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-time-tracker-ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Web UI for the super-time-tracker CLI time sheets",
5
5
  "keywords": [
6
6
  "nextjs",