create-ifc-lite 1.11.2 → 1.11.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.
@@ -22,6 +22,7 @@ export function createBasicTemplate(targetDir, projectName) {
22
22
  '@ifc-lite/parser': latestVersion,
23
23
  },
24
24
  devDependencies: {
25
+ '@types/node': '^22.0.0',
25
26
  typescript: '^5.3.0',
26
27
  tsx: '^4.0.0',
27
28
  },
@@ -36,6 +37,7 @@ export function createBasicTemplate(targetDir, projectName) {
36
37
  esModuleInterop: true,
37
38
  skipLibCheck: true,
38
39
  outDir: 'dist',
40
+ types: ['node'],
39
41
  },
40
42
  include: ['src'],
41
43
  }, null, 2));
@@ -55,7 +57,13 @@ if (!ifcPath) {
55
57
  process.exit(1);
56
58
  }
57
59
 
58
- const buffer = readFileSync(ifcPath);
60
+ // readFileSync returns a Node Buffer (Uint8Array subclass); extract the underlying ArrayBuffer
61
+ const nodeBuffer = readFileSync(ifcPath);
62
+ const buffer = nodeBuffer.buffer.slice(
63
+ nodeBuffer.byteOffset,
64
+ nodeBuffer.byteOffset + nodeBuffer.byteLength,
65
+ ) as ArrayBuffer;
66
+
59
67
  const parser = new IfcParser();
60
68
 
61
69
  console.log('Parsing IFC file...');
@@ -128,9 +128,9 @@ import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
128
128
  import { GeometryProcessor } from '@ifc-lite/geometry';
129
129
  import { meshDataToThree } from './ifc-to-threejs.js';
130
130
 
131
- const canvas = document.getElementById('viewer') as HTMLCanvasElement | null;
132
- const fileInput = document.getElementById('file-input') as HTMLInputElement | null;
133
- const status = document.getElementById('status');
131
+ const canvas = document.getElementById('viewer') as HTMLCanvasElement;
132
+ const fileInput = document.getElementById('file-input') as HTMLInputElement;
133
+ const status = document.getElementById('status')!;
134
134
  if (!canvas || !fileInput || !status) {
135
135
  throw new Error('Required DOM elements not found: viewer, file-input, or status');
136
136
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ifc-lite",
3
- "version": "1.11.2",
3
+ "version": "1.11.3",
4
4
  "description": "Create IFC-Lite projects with one command",
5
5
  "type": "module",
6
6
  "bin": {