Skip to content

Commit

Permalink
fix grid orientation with z axis up (#78)
Browse files Browse the repository at this point in the history
* fix grid orientation with z axis up

* fix formatcheck to use bun

* finish conversion to bun

* formatbot: Automatically format code

---------

Co-authored-by: tscircuitbot <tscircuitbot@users.noreply.github.com>
  • Loading branch information
seveibar and tscircuitbot authored Oct 1, 2024
1 parent e27f911 commit 8a4d244
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 6,218 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/bun-formatcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Format Check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Run format check
run: bun run format:check
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
token: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
bun-version: latest
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: npm install -g pver
- run: npm ci
- run: npm run build:lib
- run: bun install --frozen-lockfile
- run: bun run build
- run: pver release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TSCIRCUIT_BOT_GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Created using @tscircuit/plop (npm install -g @tscircuit/plop)
name: Type Check

on:
Expand All @@ -13,17 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
node-version: "20"
bun-version: latest

- name: Install dependencies
run: npm ci

- name: Run format check
run: npx tsc --noEmit

- name: Run build
run: npm run build:lib
run: bun i

- name: Run type check
run: bunx tsc --noEmit
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
node-version: "20"
- run: npm ci
bun-version: latest
- run: bun install
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/formatcheck.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ dist
.vscode
.aider*
cosmos-export
package-lock.json
2 changes: 1 addition & 1 deletion examples/cuboid.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Cuboid } from "../lib"
import { JsCadFixture } from "../lib/components/jscad-fixture"

export default () => (
<JsCadFixture>
<JsCadFixture zAxisUp showGrid>
<Cuboid color="blue" offset={{ x: 0, y: 0, z: 0 }} size={[15, 10, 10]} />
</JsCadFixture>
)
3 changes: 3 additions & 0 deletions lib/components/jscad-fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export function JsCadFixture({
// Add grid
const gridHelper = new THREE.GridHelper(100, 100)
gridHelper.visible = showGrid
if (zAxisUp) {
gridHelper.rotation.x = -Math.PI / 2
}
scene.add(gridHelper)
gridRef.current = gridHelper

Expand Down
Loading

0 comments on commit 8a4d244

Please sign in to comment.