create-ifc-lite 1.14.5 → 1.14.7
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/README.md +36 -20
- package/dist/templates/babylonjs.js +2 -2
- package/dist/templates/basic.js +11 -11
- package/dist/templates/react.js +4 -4
- package/dist/templates/server-native.js +2 -2
- package/dist/templates/server.js +8 -8
- package/dist/templates/threejs.js +3 -3
- package/dist/utils/config-fixers.js +3 -1
- package/dist/utils/download.js +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
# create-ifc-lite
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Scaffolds an IFClite project in seconds. One command, working code.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
-
### Create a new project
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
|
-
npx create-ifc-lite
|
|
8
|
+
npx create-ifc-lite <project-name> [--template <type>]
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
That's it — no install step. The scaffolder picks `basic` if you don't pass a template.
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
## Templates
|
|
16
14
|
|
|
17
15
|
```bash
|
|
16
|
+
# Minimal TypeScript project — parse an IFC file from a script
|
|
18
17
|
npx create-ifc-lite my-app
|
|
19
|
-
cd my-app
|
|
20
|
-
npm install
|
|
21
|
-
npm run parse ./model.ifc
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
**React** - React + Vite project with WebGPU rendering and drag-and-drop loading:
|
|
18
|
+
cd my-app && npm install && npm run parse ./model.ifc
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
# WebGPU 3D viewer (React + Vite + drag-and-drop)
|
|
27
21
|
npx create-ifc-lite my-viewer --template react
|
|
28
|
-
cd my-viewer
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
cd my-viewer && npm install && npm run dev
|
|
23
|
+
|
|
24
|
+
# Three.js (WebGL) viewer
|
|
25
|
+
npx create-ifc-lite my-viewer --template threejs
|
|
26
|
+
|
|
27
|
+
# Babylon.js (WebGL) viewer
|
|
28
|
+
npx create-ifc-lite my-viewer --template babylonjs
|
|
29
|
+
|
|
30
|
+
# Backend server (Rust binary, runs in Docker)
|
|
31
|
+
npx create-ifc-lite my-backend --template server
|
|
32
|
+
|
|
33
|
+
# Backend server (native binary, no Docker)
|
|
34
|
+
npx create-ifc-lite my-backend --template server-native
|
|
31
35
|
```
|
|
32
36
|
|
|
37
|
+
| Template | What you get | Stack |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `basic` (default) | Minimal CLI parser | TypeScript + `@ifc-lite/parser` |
|
|
40
|
+
| `react` | WebGPU 3D viewer with drag-and-drop, hierarchy, properties | React + Vite + WebGPU |
|
|
41
|
+
| `threejs` | Three.js (WebGL) viewer | Three.js + Vite |
|
|
42
|
+
| `babylonjs` | Babylon.js (WebGL) viewer | Babylon.js + Vite |
|
|
43
|
+
| `server` | IFC parsing server (Docker) | Rust + Docker Compose |
|
|
44
|
+
| `server-native` | IFC parsing server (no Docker) | Rust binary via `@ifc-lite/server-bin` |
|
|
45
|
+
|
|
46
|
+
Each template ships with a `README.md` documenting what it does and how to extend it.
|
|
47
|
+
|
|
33
48
|
## Options
|
|
34
49
|
|
|
35
50
|
| Flag | Description |
|
|
36
51
|
|------|-------------|
|
|
37
|
-
| `--template <type>` |
|
|
52
|
+
| `--template <type>` | One of `basic`, `react`, `threejs`, `babylonjs`, `server`, `server-native` |
|
|
38
53
|
| `--help` | Show help |
|
|
39
54
|
|
|
40
|
-
## Learn
|
|
55
|
+
## Learn more
|
|
41
56
|
|
|
42
|
-
- [IFClite
|
|
43
|
-
- [GitHub
|
|
57
|
+
- [IFClite docs](https://ltplus-ag.github.io/ifc-lite/)
|
|
58
|
+
- [GitHub repo](https://github.com/LTplus-AG/ifc-lite)
|
|
59
|
+
- [Quick Start guide](https://github.com/LTplus-AG/ifc-lite/blob/main/https://ltplus-ag.github.io/ifc-lite/guide/quickstart/)
|
|
@@ -250,7 +250,7 @@ fileInput.addEventListener('change', async () => {
|
|
|
250
250
|
// README
|
|
251
251
|
writeFileSync(join(targetDir, 'README.md'), `# ${projectName}
|
|
252
252
|
|
|
253
|
-
Babylon.js IFC viewer using [IFC-Lite](https://github.com/
|
|
253
|
+
Babylon.js IFC viewer using [IFC-Lite](https://github.com/LTplus-AG/ifc-lite).
|
|
254
254
|
|
|
255
255
|
## Quick Start
|
|
256
256
|
|
|
@@ -263,6 +263,6 @@ Open http://localhost:5173 and drop an IFC file.
|
|
|
263
263
|
|
|
264
264
|
## Learn More
|
|
265
265
|
|
|
266
|
-
- [IFC-Lite Documentation](https://
|
|
266
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
267
267
|
`);
|
|
268
268
|
}
|
package/dist/templates/basic.js
CHANGED
|
@@ -67,19 +67,19 @@ const buffer = nodeBuffer.buffer.slice(
|
|
|
67
67
|
const parser = new IfcParser();
|
|
68
68
|
|
|
69
69
|
console.log('Parsing IFC file...');
|
|
70
|
-
parser.
|
|
70
|
+
parser.parseColumnar(buffer).then(store => {
|
|
71
71
|
console.log('\\nFile parsed successfully!');
|
|
72
|
-
console.log(\` Entities: \${
|
|
72
|
+
console.log(\` Entities: \${store.entityCount}\`);
|
|
73
|
+
console.log(\` Schema: \${store.schemaVersion}\`);
|
|
73
74
|
|
|
74
75
|
// Count by type
|
|
75
|
-
const typeCounts =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
const typeCounts = [...store.entityIndex.byType.entries()]
|
|
77
|
+
.map(([type, ids]) => [type, ids.length] as const)
|
|
78
|
+
.sort((a, b) => b[1] - a[1])
|
|
79
|
+
.slice(0, 10);
|
|
79
80
|
|
|
80
81
|
console.log('\\nTop entity types:');
|
|
81
|
-
const
|
|
82
|
-
for (const [type, count] of sorted) {
|
|
82
|
+
for (const [type, count] of typeCounts) {
|
|
83
83
|
console.log(\` \${type}: \${count}\`);
|
|
84
84
|
}
|
|
85
85
|
});
|
|
@@ -87,7 +87,7 @@ parser.parse(buffer).then(result => {
|
|
|
87
87
|
// README
|
|
88
88
|
writeFileSync(join(targetDir, 'README.md'), `# ${projectName}
|
|
89
89
|
|
|
90
|
-
IFC parser project using [IFC-Lite](https://github.com/
|
|
90
|
+
IFC parser project using [IFC-Lite](https://github.com/LTplus-AG/ifc-lite).
|
|
91
91
|
|
|
92
92
|
## Quick Start
|
|
93
93
|
|
|
@@ -98,7 +98,7 @@ npm run parse ./your-model.ifc
|
|
|
98
98
|
|
|
99
99
|
## Learn More
|
|
100
100
|
|
|
101
|
-
- [IFC-Lite Documentation](https://
|
|
102
|
-
- [API Reference](https://
|
|
101
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
102
|
+
- [API Reference](https://ltplus-ag.github.io/ifc-lite/api/)
|
|
103
103
|
`);
|
|
104
104
|
}
|
package/dist/templates/react.js
CHANGED
|
@@ -552,7 +552,7 @@ body {
|
|
|
552
552
|
`);
|
|
553
553
|
writeFileSync(join(targetDir, 'README.md'), `# ${projectName}
|
|
554
554
|
|
|
555
|
-
React + Vite IFC viewer using [IFC-Lite](https://github.com/
|
|
555
|
+
React + Vite IFC viewer using [IFC-Lite](https://github.com/LTplus-AG/ifc-lite).
|
|
556
556
|
|
|
557
557
|
## Quick Start
|
|
558
558
|
|
|
@@ -573,8 +573,8 @@ Open the app in your browser and drop an IFC file onto the viewport.
|
|
|
573
573
|
|
|
574
574
|
## Learn More
|
|
575
575
|
|
|
576
|
-
- [IFC-Lite Documentation](https://
|
|
577
|
-
- [Rendering Guide](https://
|
|
578
|
-
- [Geometry Guide](https://
|
|
576
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
577
|
+
- [Rendering Guide](https://ltplus-ag.github.io/ifc-lite/guide/rendering/)
|
|
578
|
+
- [Geometry Guide](https://ltplus-ag.github.io/ifc-lite/guide/geometry/)
|
|
579
579
|
`);
|
|
580
580
|
}
|
|
@@ -401,8 +401,8 @@ npx create-ifc-lite my-app --template server
|
|
|
401
401
|
|
|
402
402
|
## Learn More
|
|
403
403
|
|
|
404
|
-
- [IFC-Lite Documentation](https://
|
|
405
|
-
- [GitHub Repository](https://github.com/
|
|
404
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
405
|
+
- [GitHub Repository](https://github.com/LTplus-AG/ifc-lite)
|
|
406
406
|
`);
|
|
407
407
|
console.log(' Created package.json');
|
|
408
408
|
console.log(' Created tsconfig.json');
|
package/dist/templates/server.js
CHANGED
|
@@ -15,7 +15,7 @@ export function createServerTemplate(targetDir, projectName) {
|
|
|
15
15
|
|
|
16
16
|
services:
|
|
17
17
|
ifc-server:
|
|
18
|
-
image: ghcr.io/
|
|
18
|
+
image: ghcr.io/LTplus-AG/ifc-lite-server:latest
|
|
19
19
|
container_name: ${projectName}-server
|
|
20
20
|
ports:
|
|
21
21
|
- "\${PORT:-3001}:8080"
|
|
@@ -47,7 +47,7 @@ volumes:
|
|
|
47
47
|
|
|
48
48
|
services:
|
|
49
49
|
ifc-server:
|
|
50
|
-
image: ghcr.io/
|
|
50
|
+
image: ghcr.io/LTplus-AG/ifc-lite-server:latest
|
|
51
51
|
container_name: ${projectName}-server-dev
|
|
52
52
|
ports:
|
|
53
53
|
- "\${PORT:-3001}:8080"
|
|
@@ -474,7 +474,7 @@ export function createLocalClient(options?: { timeout?: number }) {
|
|
|
474
474
|
// README.md
|
|
475
475
|
writeFileSync(join(targetDir, 'README.md'), `# ${projectName}
|
|
476
476
|
|
|
477
|
-
IFC processing server using [IFC-Lite](https://github.com/
|
|
477
|
+
IFC processing server using [IFC-Lite](https://github.com/LTplus-AG/ifc-lite).
|
|
478
478
|
|
|
479
479
|
## Quick Start
|
|
480
480
|
|
|
@@ -585,8 +585,8 @@ The Docker image works on any container platform:
|
|
|
585
585
|
|
|
586
586
|
\`\`\`bash
|
|
587
587
|
# Pull and run
|
|
588
|
-
docker pull ghcr.io/
|
|
589
|
-
docker run -p 8080:8080 -v ifc-cache:/app/cache ghcr.io/
|
|
588
|
+
docker pull ghcr.io/LTplus-AG/ifc-lite-server:latest
|
|
589
|
+
docker run -p 8080:8080 -v ifc-cache:/app/cache ghcr.io/LTplus-AG/ifc-lite-server
|
|
590
590
|
\`\`\`
|
|
591
591
|
|
|
592
592
|
### Environment Variables
|
|
@@ -603,9 +603,9 @@ RUST_LOG=info
|
|
|
603
603
|
|
|
604
604
|
## Learn More
|
|
605
605
|
|
|
606
|
-
- [IFC-Lite Documentation](https://
|
|
607
|
-
- [Server API Reference](https://
|
|
608
|
-
- [GitHub Repository](https://github.com/
|
|
606
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
607
|
+
- [Server API Reference](https://ltplus-ag.github.io/ifc-lite/api/server/)
|
|
608
|
+
- [GitHub Repository](https://github.com/LTplus-AG/ifc-lite)
|
|
609
609
|
`);
|
|
610
610
|
console.log(' Created docker-compose.yml');
|
|
611
611
|
console.log(' Created docker-compose.dev.yml');
|
|
@@ -258,7 +258,7 @@ fileInput.addEventListener('change', async () => {
|
|
|
258
258
|
// README
|
|
259
259
|
writeFileSync(join(targetDir, 'README.md'), `# ${projectName}
|
|
260
260
|
|
|
261
|
-
Three.js IFC viewer using [IFC-Lite](https://github.com/
|
|
261
|
+
Three.js IFC viewer using [IFC-Lite](https://github.com/LTplus-AG/ifc-lite).
|
|
262
262
|
|
|
263
263
|
## Quick Start
|
|
264
264
|
|
|
@@ -271,7 +271,7 @@ Open http://localhost:5173 and drop an IFC file.
|
|
|
271
271
|
|
|
272
272
|
## Learn More
|
|
273
273
|
|
|
274
|
-
- [Three.js Integration Guide](https://
|
|
275
|
-
- [IFC-Lite Documentation](https://
|
|
274
|
+
- [Three.js Integration Guide](https://ltplus-ag.github.io/ifc-lite/tutorials/threejs-integration/)
|
|
275
|
+
- [IFC-Lite Documentation](https://ltplus-ag.github.io/ifc-lite/)
|
|
276
276
|
`);
|
|
277
277
|
}
|
|
@@ -11,7 +11,9 @@ const VALID_PACKAGE_NAME = /^(?:@[\w.-]+\/)?[\w.-]+$/;
|
|
|
11
11
|
const NPM_TIMEOUT_MS = 30000;
|
|
12
12
|
const MAX_VERSION_CANDIDATES = 10;
|
|
13
13
|
function readJsonFromNpm(args) {
|
|
14
|
-
const
|
|
14
|
+
const command = process.platform === 'win32' ? process.env.ComSpec ?? 'cmd.exe' : 'npm';
|
|
15
|
+
const commandArgs = process.platform === 'win32' ? ['/d', '/s', '/c', 'npm', ...args] : args;
|
|
16
|
+
const result = execFileSync(command, commandArgs, {
|
|
15
17
|
stdio: 'pipe',
|
|
16
18
|
timeout: NPM_TIMEOUT_MS,
|
|
17
19
|
}).toString().trim();
|
package/dist/utils/download.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { rmSync } from 'fs';
|
|
5
5
|
import { join, dirname } from 'path';
|
|
6
6
|
import { execSync } from 'child_process';
|
|
7
|
-
const REPO_URL = 'https://github.com/
|
|
7
|
+
const REPO_URL = 'https://github.com/LTplus-AG/ifc-lite';
|
|
8
8
|
const VIEWER_PATH = 'apps/viewer';
|
|
9
9
|
/**
|
|
10
10
|
* Run a shell command silently. Returns true on success, false on failure.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ifc-lite",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.7",
|
|
4
4
|
"description": "Create IFC-Lite projects with one command",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"license": "MPL-2.0",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/
|
|
24
|
+
"url": "https://github.com/LTplus-AG/ifc-lite.git",
|
|
25
25
|
"directory": "packages/create-ifc-lite"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=18.0.0"
|
|
32
32
|
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^25.9.1",
|
|
35
|
+
"typescript": "^5.3.0"
|
|
36
|
+
},
|
|
33
37
|
"scripts": {
|
|
34
38
|
"build": "pnpm exec tsc",
|
|
35
39
|
"dev": "pnpm exec tsc --watch"
|