Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extraKnownMarketplaces": {
"openphysics": {
"source": {
"source": "github",
"repo": "OpenPhysics/Baton"
}
}
},
"enabledPlugins": {
"scenerystack@openphysics": true
}
}
34 changes: 34 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Ensure consistent LF line endings for all text files
* text=auto eol=lf

# Explicitly set common file types
*.ts text eol=lf
*.tsx text eol=lf
*.js text eol=lf
*.mjs text eol=lf
*.json text eol=lf
*.css text eol=lf
*.html text eol=lf
*.md text eol=lf
*.svg text eol=lf
*.yml text eol=lf
*.yaml text eol=lf

# Git hooks (SceneryStack sims use .githooks/)
.githooks/* text eol=lf

# Binary files (no conversion)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.webp binary
*.ico binary
*.mp4 binary
*.webm binary
*.ogg binary
*.wav binary
*.woff binary
*.woff2 binary
*.ttf binary
*.wasm binary
34 changes: 34 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
# Pre-commit hook: auto-format and lint with Biome.
# Activated by: npm install (prepare script sets core.hooksPath)

git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0

if [ ! -x node_modules/.bin/biome ]; then
echo "pre-commit: skipping — run npm install first."
exit 0
fi

STAGED=$(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.(ts|js|json|html)$' || true)

if [ -z "$STAGED" ]; then
exit 0
fi

echo "Running Biome fix on staged files..."

npm run fix -- --no-errors-on-unmatched
STATUS=$?

printf '%s\n' "$STAGED" | while IFS= read -r file; do
[ -n "$file" ] && git add -- "$file"
done

if [ "$STATUS" -ne 0 ]; then
echo ""
echo "Biome reported errors that could not be auto-fixed."
echo "Please fix the issues above and try committing again."
exit 1
fi

exit 0
33 changes: 33 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# Pre-push hook: run lint and type-check before pushing.
# Activated by: npm install (prepare script sets core.hooksPath)

git rev-parse --is-inside-work-tree >/dev/null 2>&1 || exit 0

if [ ! -x node_modules/.bin/biome ]; then
echo "pre-push: node_modules missing — run npm install before pushing."
exit 1
fi

echo "Running Biome lint check..."
npm run lint
LINT_STATUS=$?

if [ "$LINT_STATUS" -ne 0 ]; then
echo ""
echo "Lint errors found. Run 'npm run fix' to auto-fix, then commit and push again."
exit 1
fi

echo "Running TypeScript type check..."
npm run check
TSC_STATUS=$?

if [ "$TSC_STATUS" -ne 0 ]; then
echo ""
echo "TypeScript errors found. Fix the errors above before pushing."
exit 1
fi

echo "All checks passed."
exit 0
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owners for OpenPhysics simulations
* @veillette
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "automated"
commit-message:
prefix: "chore"
include: "scope"
# @types/node major versions track the Node.js runtime (see shared CI default).
# Bump SceneryStackTemplate and repos together when CI node-version changes.
ignore:
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
groups:
development-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
production-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "09:00"
labels:
- "ci/cd"
- "dependencies"
- "automated"
commit-message:
prefix: "ci"
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
schedule:
- cron: '30 2 * * 1'

concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Caller must grant the scopes the reusable workflows request (CodeQL needs
# security-events: write, dependency-review needs pull-requests: write). The repo
# default token is read-only, so without this block reusable calls fail at startup.
permissions:
contents: read
actions: read
security-events: write
pull-requests: write

jobs:
ci:
uses: OpenPhysics/Baton/.github/workflows/ci.yml@main

compliance:
uses: OpenPhysics/Baton/.github/workflows/shared-compliance-check.yml@main

dependency-review:
if: github.event_name == 'pull_request'
uses: OpenPhysics/Baton/.github/workflows/shared-dependency-review.yml@main

codeql:
uses: OpenPhysics/Baton/.github/workflows/shared-codeql.yml@main
17 changes: 17 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Deploy

on:
push:
branches: [main]

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
uses: OpenPhysics/Baton/.github/workflows/deploy.yml@main
permissions:
contents: read
pages: write
id-token: write
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dev-dist
dist-ssr
.vite
*.local
tsconfig.tsbuildinfo

# Environment
.env
.env.local
.env.*.local

# Test output
coverage/
playwright-report/
test-results/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
Thumbs.db
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Claude Code - local settings excluded, hooks tracked
.claude/settings.local.json

# CI / local npm audit artifact (must not be linted)
audit.json
Loading
Loading