@ifc-lite/cli 0.22.0 → 0.24.0
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/dist/commands/clash.d.ts.map +1 -1
- package/dist/commands/clash.js +88 -46
- package/dist/commands/clash.js.map +1 -1
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +7 -3
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +65 -18
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/generate-spaces.d.ts.map +1 -1
- package/dist/commands/generate-spaces.js +7 -1
- package/dist/commands/generate-spaces.js.map +1 -1
- package/dist/commands/gym/channels.d.ts.map +1 -1
- package/dist/commands/gym/channels.js +4 -3
- package/dist/commands/gym/channels.js.map +1 -1
- package/dist/commands/gym.d.ts.map +1 -1
- package/dist/commands/gym.js +6 -1
- package/dist/commands/gym.js.map +1 -1
- package/dist/commands/layer-push.d.ts.map +1 -1
- package/dist/commands/layer-push.js +2 -0
- package/dist/commands/layer-push.js.map +1 -1
- package/dist/commands/mutate.d.ts.map +1 -1
- package/dist/commands/mutate.js +11 -1
- package/dist/commands/mutate.js.map +1 -1
- package/dist/commands/query.d.ts +30 -0
- package/dist/commands/query.d.ts.map +1 -1
- package/dist/commands/query.js +32 -17
- package/dist/commands/query.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +23 -2
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +11 -4
- package/dist/commands/validate.js.map +1 -1
- package/dist/energy-export.d.ts +62 -0
- package/dist/energy-export.d.ts.map +1 -0
- package/dist/energy-export.js +74 -0
- package/dist/energy-export.js.map +1 -0
- package/dist/headless-backend.d.ts.map +1 -1
- package/dist/headless-backend.js +46 -7
- package/dist/headless-backend.js.map +1 -1
- package/dist/index.js +4 -14
- package/dist/index.js.map +1 -1
- package/dist/output.d.ts +8 -0
- package/dist/output.d.ts.map +1 -1
- package/dist/output.js +21 -0
- package/dist/output.js.map +1 -1
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +38 -0
- package/dist/version.js.map +1 -0
- package/package.json +20 -19
- package/dist/hbjson-export.d.ts +0 -37
- package/dist/hbjson-export.d.ts.map +0 -1
- package/dist/hbjson-export.js +0 -39
- package/dist/hbjson-export.js.map +0 -1
package/dist/version.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* The CLI's own version, read from its `package.json` at startup.
|
|
6
|
+
*
|
|
7
|
+
* Kept out of `index.ts` so the read can be tested without executing the
|
|
8
|
+
* CLI's top-level `main()`.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
/** Reported when `package.json` can't be read — deliberately not a plausible
|
|
12
|
+
* version number, so a bug report never carries a fabricated one. */
|
|
13
|
+
export const UNKNOWN_VERSION = '0.0.0-unknown';
|
|
14
|
+
/**
|
|
15
|
+
* Read `version` from the package manifest at `pkgPath`.
|
|
16
|
+
*
|
|
17
|
+
* A failure here is a broken install (missing/unreadable/corrupt
|
|
18
|
+
* `package.json`), not a normal condition: it used to fall back to a
|
|
19
|
+
* hard-coded `'0.4.0'`, which by 0.22.0 meant `--version` confidently
|
|
20
|
+
* reported a version the binary had not been for eighteen releases. Report
|
|
21
|
+
* the failure on stderr and return a value that reads as unknown.
|
|
22
|
+
*/
|
|
23
|
+
export function readCliVersion(pkgPath) {
|
|
24
|
+
try {
|
|
25
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
26
|
+
if (typeof pkg.version === 'string' && pkg.version.length > 0)
|
|
27
|
+
return pkg.version;
|
|
28
|
+
process.stderr.write(`Warning: ${pkgPath} declares no "version"; reporting ${UNKNOWN_VERSION}.\n`);
|
|
29
|
+
return UNKNOWN_VERSION;
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
process.stderr.write(`Warning: could not read the CLI version from ${pkgPath} ` +
|
|
33
|
+
`(${err instanceof Error ? err.message : String(err)}); ` +
|
|
34
|
+
`reporting ${UNKNOWN_VERSION}.\n`);
|
|
35
|
+
return UNKNOWN_VERSION;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;qEACqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAyB,CAAC;QAC/E,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC,OAAO,CAAC;QAClF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,YAAY,OAAO,qCAAqC,eAAe,KAAK,CAC7E,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gDAAgD,OAAO,GAAG;YACxD,IAAI,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK;YACzD,aAAa,eAAe,KAAK,CACpC,CAAC;QACF,OAAO,eAAe,CAAC;IACzB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "CLI toolkit for IFC files — query, validate, export, create, and script BIM data",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,25 +20,25 @@
|
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@ifc-lite/bcf": "^1.
|
|
24
|
-
"@ifc-lite/clash": "^1.6.
|
|
25
|
-
"@ifc-lite/create": "^2.0.
|
|
26
|
-
"@ifc-lite/data": "^3.2.
|
|
23
|
+
"@ifc-lite/bcf": "^1.18.0",
|
|
24
|
+
"@ifc-lite/clash": "^1.6.5",
|
|
25
|
+
"@ifc-lite/create": "^2.0.2",
|
|
26
|
+
"@ifc-lite/data": "^3.2.3",
|
|
27
27
|
"@ifc-lite/diff": "^0.6.0",
|
|
28
|
-
"@ifc-lite/export": "^2.8.
|
|
29
|
-
"@ifc-lite/extensions": "^0.4.
|
|
30
|
-
"@ifc-lite/geometry": "^3.
|
|
31
|
-
"@ifc-lite/ids": "^1.15.
|
|
32
|
-
"@ifc-lite/ifcx": "^2.3.
|
|
33
|
-
"@ifc-lite/merge": "^0.4.
|
|
34
|
-
"@ifc-lite/mcp": "^0.
|
|
35
|
-
"@ifc-lite/mutations": "^1.
|
|
36
|
-
"@ifc-lite/parser": "^
|
|
37
|
-
"@ifc-lite/query": "^1.14.
|
|
38
|
-
"@ifc-lite/sandbox": "^2.
|
|
39
|
-
"@ifc-lite/sdk": "^2.
|
|
40
|
-
"@ifc-lite/viewer-core": "^0.2.
|
|
41
|
-
"@ifc-lite/wasm": "^4.
|
|
28
|
+
"@ifc-lite/export": "^2.8.4",
|
|
29
|
+
"@ifc-lite/extensions": "^0.4.1",
|
|
30
|
+
"@ifc-lite/geometry": "^3.8.0",
|
|
31
|
+
"@ifc-lite/ids": "^1.15.43",
|
|
32
|
+
"@ifc-lite/ifcx": "^2.3.4",
|
|
33
|
+
"@ifc-lite/merge": "^0.4.1",
|
|
34
|
+
"@ifc-lite/mcp": "^0.11.1",
|
|
35
|
+
"@ifc-lite/mutations": "^1.25.0",
|
|
36
|
+
"@ifc-lite/parser": "^4.0.1",
|
|
37
|
+
"@ifc-lite/query": "^1.14.16",
|
|
38
|
+
"@ifc-lite/sandbox": "^2.2.0",
|
|
39
|
+
"@ifc-lite/sdk": "^2.1.0",
|
|
40
|
+
"@ifc-lite/viewer-core": "^0.2.12",
|
|
41
|
+
"@ifc-lite/wasm": "^4.4.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^26.1.2",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "pnpm exec tsc",
|
|
74
|
+
"typecheck": "node ../../scripts/typecheck-tests.mjs",
|
|
74
75
|
"dev": "pnpm exec tsc --watch",
|
|
75
76
|
"start": "node dist/index.js",
|
|
76
77
|
"test": "vitest run"
|
package/dist/hbjson-export.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HBJSON export for `HeadlessBackend` (issue #1908).
|
|
3
|
-
*
|
|
4
|
-
* Split out of `headless-backend.ts` (already over the ~400-line module
|
|
5
|
-
* guideline) rather than inlined there. HBJSON is rebuilt analytically from
|
|
6
|
-
* IFC STEP bytes (rooms/openings/shades/constructions/adjacency) via the
|
|
7
|
-
* wasm geometry engine. When the mutation view carries actual edits
|
|
8
|
-
* (`mutationView.hasPendingChanges()` — e.g. `bim.store.addSpace` /
|
|
9
|
-
* `bim.spaces.generate` ran earlier in this session), bytes are regenerated
|
|
10
|
-
* through `StepExporter` first — the same mutation-view application the
|
|
11
|
-
* `ifc:` STEP export adapter already uses in `headless-backend.ts` — so
|
|
12
|
-
* overlay-authored entities (drawn spaces, in particular) are visible to the
|
|
13
|
-
* analytic exporter. A mutation view with no pending changes (the common
|
|
14
|
-
* case — `getOrCreateStoreEditor` can register a view before any edit lands,
|
|
15
|
-
* e.g. `bim.store.removeEntity` on an id that doesn't exist still allocates
|
|
16
|
-
* one) falls straight through to `store.source`, unchanged from before this
|
|
17
|
-
* fix.
|
|
18
|
-
*
|
|
19
|
-
* `hasPendingChanges()`, not `hasChanges()`: the latter reads the
|
|
20
|
-
* append-only `mutationHistory`, which `restoreNewEntity` repopulates
|
|
21
|
-
* `newEntities` WITHOUT pushing to (it's the undo-of-delete path for an
|
|
22
|
-
* overlay-created entity). `hasPendingChanges()` reads the current overlay
|
|
23
|
-
* footprint instead — the same set `StepExporter` actually serializes — so a
|
|
24
|
-
* restored overlay-created space is not silently missed.
|
|
25
|
-
*
|
|
26
|
-
* No IFC5/IFCX guard here (unlike the viewer's `resolveHbjsonMutationSource`,
|
|
27
|
-
* which excludes `schemaVersion === 'IFC5'`): `loader.ts` only ever parses
|
|
28
|
-
* with `IfcParser` (the STEP/columnar parser) and never constructs an
|
|
29
|
-
* IFCX/IFC5 data store, so a CLI-loaded `IfcDataStore` cannot carry IFC5
|
|
30
|
-
* content to regenerate in the first place. The `ifc:` STEP-export adapter
|
|
31
|
-
* directly above this one in `headless-backend.ts` makes the same assumption
|
|
32
|
-
* (it applies `mutationView` unconditionally, with no schema check).
|
|
33
|
-
*/
|
|
34
|
-
import type { IfcDataStore } from '@ifc-lite/parser';
|
|
35
|
-
import type { MutablePropertyView } from '@ifc-lite/mutations';
|
|
36
|
-
export declare function exportHbjson(store: IfcDataStore, mutationView: MutablePropertyView | null, name: string): Promise<string>;
|
|
37
|
-
//# sourceMappingURL=hbjson-export.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hbjson-export.d.ts","sourceRoot":"","sources":["../src/hbjson-export.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,wBAAsB,YAAY,CAChC,KAAK,EAAE,YAAY,EACnB,YAAY,EAAE,mBAAmB,GAAG,IAAI,EACxC,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CA+BjB"}
|
package/dist/hbjson-export.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
-
import { StepExporter } from '@ifc-lite/export';
|
|
5
|
-
import { GeometryProcessor } from '@ifc-lite/geometry';
|
|
6
|
-
export async function exportHbjson(store, mutationView, name) {
|
|
7
|
-
let bytes;
|
|
8
|
-
if (mutationView && mutationView.hasPendingChanges() && store.source && store.source.length > 0) {
|
|
9
|
-
// StepExporter re-serializes un-mutated entities from `store.source` (via
|
|
10
|
-
// EntityExtractor), so only attempt the regeneration when source bytes
|
|
11
|
-
// are actually retained — otherwise fall through to the same clear error
|
|
12
|
-
// below instead of silently emitting a degenerate STEP file.
|
|
13
|
-
const schema = store.schemaVersion ?? 'IFC4';
|
|
14
|
-
const exporter = new StepExporter(store, mutationView);
|
|
15
|
-
bytes = exporter.export({ schema }).content;
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
bytes = store.source;
|
|
19
|
-
}
|
|
20
|
-
if (!bytes || bytes.length === 0) {
|
|
21
|
-
throw new Error('HBJSON export needs the source IFC bytes, which this store did not retain.');
|
|
22
|
-
}
|
|
23
|
-
const processor = new GeometryProcessor();
|
|
24
|
-
try {
|
|
25
|
-
await processor.init();
|
|
26
|
-
const baseName = name.replace(/\.[^.]+$/, '');
|
|
27
|
-
const result = processor.exportHbjson(bytes, baseName);
|
|
28
|
-
if (result === null) {
|
|
29
|
-
throw new Error('Geometry engine unavailable for HBJSON export.');
|
|
30
|
-
}
|
|
31
|
-
// The lens contract carries a string; HBJSON payloads are far below the
|
|
32
|
-
// V8 string ceiling, so decoding here is safe.
|
|
33
|
-
return new TextDecoder().decode(result);
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
processor.dispose();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=hbjson-export.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hbjson-export.js","sourceRoot":"","sources":["../src/hbjson-export.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAmB,EACnB,YAAwC,EACxC,IAAY;IAEZ,IAAI,KAA6B,CAAC;IAClC,IAAI,YAAY,IAAI,YAAY,CAAC,iBAAiB,EAAE,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChG,0EAA0E;QAC1E,uEAAuE;QACvE,yEAAyE;QACzE,6DAA6D;QAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,aAAa,IAAI,MAAM,CAAC;QAC7C,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACvD,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC9C,MAAM,MAAM,GAAG,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QACD,wEAAwE;QACxE,+CAA+C;QAC/C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|