@bldrs-ai/conway 1.469.1386 → 1.470.1390
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/compiled/examples/browser-bundled.cjs +1 -1
- package/compiled/examples/cli-bundled.cjs +1 -1
- package/compiled/examples/cli-step-bundled.cjs +1 -1
- package/compiled/examples/validator-bundled.cjs +1 -1
- package/compiled/src/scripts/render_glb_paths.test.d.ts +2 -0
- package/compiled/src/scripts/render_glb_paths.test.d.ts.map +1 -0
- package/compiled/src/scripts/render_glb_paths.test.js +115 -0
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ var import_node_process = require("node:process");
|
|
|
30
30
|
var readline = __toESM(require("node:readline"), 1);
|
|
31
31
|
|
|
32
32
|
// compiled/src/version/version.js
|
|
33
|
-
var versionString = "Conway v1.
|
|
33
|
+
var versionString = "Conway v1.470.1390";
|
|
34
34
|
|
|
35
35
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
36
36
|
var wasmType = "";
|
|
@@ -14965,7 +14965,7 @@ ${t5.join("\n")}` : "";
|
|
|
14965
14965
|
var import_process = require("process");
|
|
14966
14966
|
|
|
14967
14967
|
// compiled/src/version/version.js
|
|
14968
|
-
var versionString = "Conway v1.
|
|
14968
|
+
var versionString = "Conway v1.470.1390";
|
|
14969
14969
|
|
|
14970
14970
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
14971
14971
|
function pThreadsAllowed() {
|
|
@@ -15943,7 +15943,7 @@ var ParsingBuffer = class {
|
|
|
15943
15943
|
};
|
|
15944
15944
|
|
|
15945
15945
|
// compiled/src/version/version.js
|
|
15946
|
-
var versionString = "Conway v1.
|
|
15946
|
+
var versionString = "Conway v1.470.1390";
|
|
15947
15947
|
|
|
15948
15948
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
15949
15949
|
function pThreadsAllowed() {
|
|
@@ -944,7 +944,7 @@ var EntityTypesIfcCount = 909;
|
|
|
944
944
|
var entity_types_ifc_gen_default = EntityTypesIfc;
|
|
945
945
|
|
|
946
946
|
// compiled/src/version/version.js
|
|
947
|
-
var versionString = "Conway v1.
|
|
947
|
+
var versionString = "Conway v1.470.1390";
|
|
948
948
|
|
|
949
949
|
// compiled/dependencies/conway-geom/interface/conway_geometry.js
|
|
950
950
|
var wasmType = "";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render_glb_paths.test.d.ts","sourceRoot":"","sources":["../../../src/scripts/render_glb_paths.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { execFileSync } from 'child_process';
|
|
5
|
+
import { describe, expect, test, beforeAll, afterAll } from '@jest/globals';
|
|
6
|
+
import { createRequire } from 'module';
|
|
7
|
+
/* eslint-disable @typescript-eslint/no-explicit-any -- render_glb.cjs is an
|
|
8
|
+
untyped CommonJS CLI script, loaded here through createRequire. */
|
|
9
|
+
/**
|
|
10
|
+
* Path resolution in scripts/render_glb.cjs (conway#457).
|
|
11
|
+
*
|
|
12
|
+
* The script accepts a comma-joined chunk list, and used to split on comma
|
|
13
|
+
* unconditionally — which tore a real path containing a comma into fragments
|
|
14
|
+
* and reported the first fragment as missing. Several models we ship are
|
|
15
|
+
* named that way, and `-g` keeps the source basename, so following
|
|
16
|
+
* scripts/debug/README.md on one of them failed.
|
|
17
|
+
*/
|
|
18
|
+
const require_ = createRequire(import.meta.url);
|
|
19
|
+
// Resolved from the repo root rather than relative to this file: the test
|
|
20
|
+
// runs from compiled/src/scripts, where a relative hop would land in
|
|
21
|
+
// compiled/scripts, which does not exist (scripts/ is not part of the tsc
|
|
22
|
+
// build). Jest's rootDir is the repo root.
|
|
23
|
+
const { resolveGlbPaths } = require_(path.resolve(process.cwd(), 'scripts/render_glb.cjs'));
|
|
24
|
+
let workDir;
|
|
25
|
+
/** A name in the shape that broke: a comma inside a single real filename. */
|
|
26
|
+
const COMMA_NAME = 'Wiesenplatz 7, 4057 Basel_test0.glb';
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'render-glb-paths-'));
|
|
29
|
+
fs.writeFileSync(path.join(workDir, COMMA_NAME), 'not-a-real-glb');
|
|
30
|
+
fs.writeFileSync(path.join(workDir, 'chunk0.glb'), 'not-a-real-glb');
|
|
31
|
+
fs.writeFileSync(path.join(workDir, 'chunk1.glb'), 'not-a-real-glb');
|
|
32
|
+
});
|
|
33
|
+
afterAll(() => {
|
|
34
|
+
fs.rmSync(workDir, { recursive: true, force: true });
|
|
35
|
+
});
|
|
36
|
+
describe('render_glb path resolution', () => {
|
|
37
|
+
test('a real path containing a comma resolves to itself (issue #457)', () => {
|
|
38
|
+
const target = path.join(workDir, COMMA_NAME);
|
|
39
|
+
// The regression: this used to come back as ['<dir>/Wiesenplatz 7',
|
|
40
|
+
// ' 4057 Basel_test0.glb'] and fail on the first, which reads as a
|
|
41
|
+
// missing file rather than as a parsing decision.
|
|
42
|
+
expect(resolveGlbPaths(target)).toEqual([target]);
|
|
43
|
+
});
|
|
44
|
+
test('a genuine chunk list still splits', () => {
|
|
45
|
+
const chunks = [
|
|
46
|
+
path.join(workDir, 'chunk0.glb'),
|
|
47
|
+
path.join(workDir, 'chunk1.glb'),
|
|
48
|
+
];
|
|
49
|
+
expect(resolveGlbPaths(chunks.join(','))).toEqual(chunks);
|
|
50
|
+
});
|
|
51
|
+
test('a JSON array resolves chunks whose names contain commas', () => {
|
|
52
|
+
// The case the literal-path rule alone cannot reach: a comma-named model
|
|
53
|
+
// large enough that the CLI splits it, so no single file bears the name.
|
|
54
|
+
// visual_diff_report.cjs passes this form.
|
|
55
|
+
const chunks = [
|
|
56
|
+
path.join(workDir, COMMA_NAME),
|
|
57
|
+
path.join(workDir, 'chunk0.glb'),
|
|
58
|
+
];
|
|
59
|
+
expect(resolveGlbPaths(JSON.stringify(chunks))).toEqual(chunks);
|
|
60
|
+
});
|
|
61
|
+
test('a JSON array with a missing member fails rather than rendering part', () => {
|
|
62
|
+
const chunks = [path.join(workDir, 'chunk0.glb'), path.join(workDir, 'gone.glb')];
|
|
63
|
+
expect(() => resolveGlbPaths(JSON.stringify(chunks))).toThrow(/gone\.glb/);
|
|
64
|
+
});
|
|
65
|
+
test('a trailing comma from a shell-built list still resolves', () => {
|
|
66
|
+
const target = path.join(workDir, 'chunk0.glb');
|
|
67
|
+
expect(resolveGlbPaths(`${target},`)).toEqual([target]);
|
|
68
|
+
});
|
|
69
|
+
test('a missing path names both readings rather than one fragment', () => {
|
|
70
|
+
const missing = path.join(workDir, 'Nowhere 1, 2345 Somewhere.glb');
|
|
71
|
+
// What the error says is the whole point of the issue: the old failure
|
|
72
|
+
// surfaced as ENOENT on "Nowhere 1", a string the caller never typed.
|
|
73
|
+
expect(() => resolveGlbPaths(missing)).toThrow(/No such GLB/);
|
|
74
|
+
expect(() => resolveGlbPaths(missing)).toThrow(/2-chunk list/);
|
|
75
|
+
});
|
|
76
|
+
test('a CLI failure surfaces its own message to visual_diff_report', () => {
|
|
77
|
+
// This contract spans two files and has no other guard. render_glb.cjs
|
|
78
|
+
// prints "Error: <message>"; visual_diff_report.cjs's
|
|
79
|
+
// childFailureDiagnostic picks the FIRST stderr line matching its regex
|
|
80
|
+
// and puts it in the PR comment's table cell. Letting Node throw
|
|
81
|
+
// uncaught instead degrades every render-failure cell to a source code
|
|
82
|
+
// frame, with the whole suite otherwise green.
|
|
83
|
+
//
|
|
84
|
+
// Scope, honestly: this pins the END-TO-END result, not each mechanism.
|
|
85
|
+
// Removing the "Error:" prefix alone keeps it passing, because the stack
|
|
86
|
+
// printed after the message opens with an "Error:" line that matches the
|
|
87
|
+
// same regex. Both are kept because a non-Error throw has no stack.
|
|
88
|
+
const script = path.resolve(process.cwd(), 'scripts/render_glb.cjs');
|
|
89
|
+
const missing = path.join(workDir, 'Nowhere 1, 2345 Somewhere.glb');
|
|
90
|
+
let stderr = '';
|
|
91
|
+
try {
|
|
92
|
+
execFileSync(process.execPath, [script, missing, path.join(workDir, 'out.png')], { stdio: 'pipe' });
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
stderr = (err.stderr ?? '').toString();
|
|
96
|
+
}
|
|
97
|
+
// The regex is copied from visual_diff_report.cjs:138 deliberately — the
|
|
98
|
+
// point is to fail here if either side drifts.
|
|
99
|
+
const picked = stderr.split('\n').filter(Boolean).find((line) => /error|cannot|not found|bad option|unexpected/i.test(line));
|
|
100
|
+
expect(picked).toMatch(/No such GLB/);
|
|
101
|
+
expect(picked).toContain('Nowhere 1, 2345 Somewhere.glb');
|
|
102
|
+
// And the stack still reaches the job log, which is a separate consumer.
|
|
103
|
+
expect(stderr).toMatch(/at resolveGlbPaths/);
|
|
104
|
+
});
|
|
105
|
+
test('a chunk list with one missing member does not silently render the rest', () => {
|
|
106
|
+
const spec = [
|
|
107
|
+
path.join(workDir, 'chunk0.glb'),
|
|
108
|
+
path.join(workDir, 'absent.glb'),
|
|
109
|
+
].join(',');
|
|
110
|
+
// Rendering the surviving chunk would drop part of the model and look
|
|
111
|
+
// like a geometry regression in the visual diff, which is worse than
|
|
112
|
+
// failing.
|
|
113
|
+
expect(() => resolveGlbPaths(spec)).toThrow(/absent\.glb/);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
// only the first segment (major) is meaningful and is the one CI carries forward.
|
|
6
6
|
// Must stay in `vN.N.N` shape: the CI stamp regex, scripts/updateVersion.mjs, and
|
|
7
7
|
// statistics.ts all match `v\d+\.\d+\.\d+`.
|
|
8
|
-
const versionString = 'Conway v1.
|
|
8
|
+
const versionString = 'Conway v1.470.1390';
|
|
9
9
|
export { versionString };
|