Skip to content

Commit 1972d22

Browse files
authored
Tests (#3)
* feat: add vitest * feat: add tests * fix: examples docs * fix: md's * fix: test * feat: gitlab ci * fix: solid * fix: tests * fix: tests * release: docs
1 parent 71290ea commit 1972d22

24 files changed

Lines changed: 4928 additions & 95 deletions

.github/workflows/ci.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Pipeline
2+
3+
on:
4+
- push
5+
6+
jobs:
7+
check:
8+
name: Source Revision
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [24.x, 22.x]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
cache: 'npm'
21+
22+
- name: Install Dependencies
23+
run: npm ci
24+
25+
- name: Run Format Check
26+
run: npm run format:check
27+
28+
- name: Run Lint Check
29+
run: npm run lint:check
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Run Tests
35+
run: npm run test

.vscode/settings.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"files.exclude": {
3-
".github": true,
43
"node_modules": true
54
},
65
"search.exclude": {

CLAUDE.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ npm run export --silent -- Box > box.stl
118118

119119
## Primitives API
120120

121-
### Angle Constants
122-
123-
`Solid.DEG_45`, `Solid.DEG_90`, `Solid.DEG_180`, `Solid.DEG_270`, `Solid.DEG_360`
124-
125121
### Basic Shapes
126122

127123
```typescript

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ const hexNut = Solid.SUBTRACT(
154154
Solid.cylinder(4, 6, { color: 'gray' })
155155
).center();
156156

157-
// Partial geometries with angle parameter
158-
const pieSlice = Solid.cylinder(10, 2, { color: 'red', angle: Solid.DEG_90 });
159-
const hemisphere = Solid.sphere(8, { color: 'cyan', angle: Solid.DEG_180 });
157+
// Partial geometries with angle parameter (in degrees)
158+
const pieSlice = Solid.cylinder(10, 2, { color: 'red', angle: 90 });
159+
const hemisphere = Solid.sphere(8, { color: 'cyan', angle: 180 });
160160
```
161161

162162
### Example: Custom Profile Prisms
@@ -281,7 +281,7 @@ const quarterVase = Solid.revolutionSolidFromPoints(
281281
[4, 10],
282282
[0, 10]
283283
],
284-
{ angle: Solid.DEG_90, color: 'purple' }
284+
{ angle: 90, color: 'purple' }
285285
);
286286
```
287287

@@ -325,7 +325,6 @@ const w3 = Wall(30); // Different params, new computation
325325
**Profiles:** `profilePrism(h,builder,opts)`, `profilePrismFromPoints(h,points,opts)`, `profilePrismFromPath(h,segments,opts)`
326326
**Revolution:** `revolutionSolid(builder,opts)`, `revolutionSolidFromPoints(points,opts)`, `revolutionSolidFromPath(segments,opts)`
327327
**Path Factories:** `straight(length)`, `curve(radius,angle)` - positive=right, negative=left, 0=sharp
328-
**Angle Constants:** `DEG_45`, `DEG_90`, `DEG_180`, `DEG_270`, `DEG_360`
329328

330329
**Transforms (chainable):** `at(x,y,z)` absolute, `move({x?,y?,z?})` relative, `rotate({x?,y?,z?})` degrees, `scale({all?,x?,y?,z?})` multiplicative
331330

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>CSG Builder</title>
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<meta name="theme-color" content="#f3f4f6" />
9-
<script type="module" crossorigin src="/csg-builder/assets/index-C1WGooGK.js"></script>
9+
<script type="module" crossorigin src="/csg-builder/assets/index-DeaveSRz.js"></script>
1010
<link rel="stylesheet" crossorigin href="/csg-builder/assets/index-ByUqiuvw.css">
1111
</head>
1212

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default [
2424
'build',
2525
'docs',
2626
'.svelte-kit',
27+
'vitest.config.*',
2728
'package',
2829
'**/.env',
2930
'**/.env.*',

0 commit comments

Comments
 (0)