tux-review 0.1.4 → 0.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tux-review",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "TUX - TUX UIX review system: attach structured, machine-readable feedback directly to running web UIs (pages, routes, components, elements, states) with a deterministic CLI, canonical JSON and LLM-friendly skills.",
5
5
  "license": "MIT",
6
6
  "author": {
package/src/cli.js CHANGED
@@ -7,13 +7,20 @@
7
7
  *
8
8
  * @module cli
9
9
  */
10
+ import { readFileSync } from 'node:fs';
11
+ import { dirname, join } from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
10
13
  import { CliError, EXIT } from './errors.js';
11
14
  import { loadConfig } from './config.js';
12
15
  import { opShow, opCreate, opUpdate, opDelete, opClear, opExport, opIncorporate, opValidate } from './feedback.js';
13
16
  import { opDesignInstall, opDesignCreate, opLiveCreate, opDesignStart, opDesignStatus, opDesignStop } from './design.js';
14
17
  import { opLiveInstall, opLiveStart, opLiveStatus, opLiveStop } from './live.js';
15
18
 
16
- export const VERSION = '0.1.0';
19
+ // Single source of truth is package.json — a hardcoded constant here
20
+ // drifted to 0.1.0 after the 0.1.1 release and broke the install test.
21
+ export const VERSION = JSON.parse(
22
+ readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'package.json'), 'utf8'),
23
+ ).version;
17
24
 
18
25
  const VALUE_FLAGS = new Set([
19
26
  'config', 'format', 'type', 'text', 'route', 'page', 'component', 'component-instance', 'instance',
package/src/server.js CHANGED
@@ -303,8 +303,15 @@ function proxy(state, req, res) {
303
303
  const chunks = [];
304
304
  up.on('data', (c) => chunks.push(c));
305
305
  up.on('end', () => {
306
- res.writeHead(up.statusCode, up.headers);
307
- res.end(inject(Buffer.concat(chunks).toString('utf8')));
306
+ // injection lengthens the body — the upstream Content-Length must
307
+ // not be forwarded or clients truncate/wait on the response
308
+ const body = inject(Buffer.concat(chunks).toString('utf8'));
309
+ const headers = { ...up.headers };
310
+ delete headers['transfer-encoding'];
311
+ headers['content-length'] = String(Buffer.byteLength(body));
312
+ headers['cache-control'] = 'no-store';
313
+ res.writeHead(up.statusCode, headers);
314
+ res.end(body);
308
315
  });
309
316
  return;
310
317
  }