Skip to content

Commit ff784ce

Browse files
committed
Initial commit
0 parents  commit ff784ce

256 files changed

Lines changed: 834379 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursorrules

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# IFC-Lite Project Rules
2+
3+
## License Headers
4+
5+
All new source files MUST include the Mozilla Public License 2.0 header at the top.
6+
7+
### TypeScript/JavaScript/CSS files (.ts, .tsx, .js, .css):
8+
```
9+
/* This Source Code Form is subject to the terms of the Mozilla Public
10+
* License, v. 2.0. If a copy of the MPL was not distributed with this
11+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
12+
```
13+
14+
### Rust files (.rs):
15+
```
16+
// This Source Code Form is subject to the terms of the Mozilla Public
17+
// License, v. 2.0. If a copy of the MPL was not distributed with this
18+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
19+
```
20+
21+
## Code Style
22+
23+
- Use TypeScript for all frontend/Node.js code
24+
- Use Rust for performance-critical WASM modules
25+
- Follow existing patterns in the codebase
26+
- Keep functions small and focused
27+
- Prefer explicit types over inference for public APIs
28+
29+
## Project Structure
30+
31+
- `rust/` - Rust/WASM core (parsing, geometry)
32+
- `packages/` - TypeScript packages
33+
- `apps/viewer/` - React viewer application
34+
- `docs/` - MkDocs documentation
35+
36+
## Generated Files (Do Not Edit)
37+
38+
- `packages/codegen/generated/`
39+
- `packages/parser/src/generated/`
40+
- `packages/wasm/ifc_lite_wasm.js`
41+
- `packages/wasm/ifc_lite_wasm.d.ts`
42+
- Any `dist/` folders

.gitattributes

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Mark generated files to exclude from language statistics
5+
packages/codegen/generated/** linguist-generated=true
6+
packages/parser/src/generated/** linguist-generated=true
7+
8+
# Mark schema files as vendored (not our code)
9+
packages/codegen/schemas/** linguist-vendored=true
10+
11+
# Exclude dist/build output
12+
**/dist/** linguist-generated=true
13+
14+
# Exclude lock files
15+
pnpm-lock.yaml linguist-generated=true
16+
Cargo.lock linguist-generated=true
17+
18+
# Binary files
19+
*.wasm binary linguist-generated=true

.github/workflows/docs.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- 'mkdocs.yml'
10+
- 'rust/**'
11+
- '.github/workflows/docs.yml'
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: pages
21+
cancel-in-progress: false
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Setup Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.12'
36+
37+
- name: Setup Rust
38+
uses: dtolnay/rust-toolchain@stable
39+
40+
- name: Cache pip dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.cache/pip
44+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-docs.txt') }}
45+
restore-keys: |
46+
${{ runner.os }}-pip-
47+
48+
- name: Cache Cargo
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.cargo/registry
53+
~/.cargo/git
54+
target
55+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
56+
restore-keys: |
57+
${{ runner.os }}-cargo-
58+
59+
- name: Install dependencies
60+
run: pip install -r requirements-docs.txt
61+
62+
- name: Build MkDocs
63+
run: mkdocs build --strict
64+
65+
- name: Build Rustdoc
66+
run: cargo doc --no-deps --workspace
67+
68+
- name: Copy Rustdoc to site
69+
run: |
70+
mkdir -p site/api/rust
71+
cp -r target/doc/* site/api/rust/
72+
73+
- name: Setup Pages
74+
uses: actions/configure-pages@v4
75+
76+
- name: Upload artifact
77+
uses: actions/upload-pages-artifact@v3
78+
with:
79+
path: site
80+
81+
deploy:
82+
environment:
83+
name: github-pages
84+
url: ${{ steps.deployment.outputs.page_url }}
85+
runs-on: ubuntu-latest
86+
needs: build
87+
steps:
88+
- name: Deploy to GitHub Pages
89+
id: deployment
90+
uses: actions/deploy-pages@v4

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Publish Packages
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
dry_run:
9+
description: 'Dry run (no publish)'
10+
type: boolean
11+
default: true
12+
13+
jobs:
14+
publish-npm:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: pnpm/action-setup@v2
19+
with:
20+
version: 8
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
registry-url: 'https://registry.npmjs.org'
25+
- run: pnpm install
26+
- run: pnpm build
27+
- run: pnpm -r publish --access public --no-git-checks
28+
if: ${{ !inputs.dry_run }}
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
32+
publish-crates:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: dtolnay/rust-toolchain@stable
37+
- run: cargo publish -p ifc-lite-core
38+
if: ${{ !inputs.dry_run }}
39+
env:
40+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
41+
- run: cargo publish -p ifc-lite-geometry
42+
if: ${{ !inputs.dry_run }}
43+
env:
44+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
45+
- run: cargo publish -p ifc-lite-wasm
46+
if: ${{ !inputs.dry_run }}
47+
env:
48+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules/
2+
dist/
3+
build/
4+
*.log
5+
.DS_Store
6+
.env
7+
.env.local
8+
*.tsbuildinfo
9+
10+
# Rust
11+
target/
12+
Cargo.lock
13+
**/*.rs.bk
14+
*.pdb

.nojekyll

Whitespace-only changes.

Cargo.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[workspace]
2+
members = [
3+
"rust/core",
4+
"rust/geometry",
5+
"rust/wasm-bindings"
6+
]
7+
resolver = "2"
8+
9+
[workspace.package]
10+
version = "0.1.0"
11+
edition = "2021"
12+
authors = ["IFC-Lite Contributors"]
13+
license = "MPL-2.0"
14+
repository = "https://github.com/louistrue/ifc-lite"
15+
16+
[profile.release]
17+
opt-level = 3 # Optimize for speed
18+
lto = true # Link-time optimization
19+
codegen-units = 1 # Better optimization (slower compile)
20+
strip = true # Strip symbols
21+
panic = 'abort' # Smaller panic handler
22+
overflow-checks = false # Remove overflow checks in release
23+
24+
[profile.release.package."*"]
25+
opt-level = 3
26+
strip = true

0 commit comments

Comments
 (0)