Skip to content
Merged

V2 #1

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2e02a6b
feat: modernize npm package structure and add TypeScript support
NewKrok Oct 15, 2025
16ca565
feat: add webpack build configuration and generate dist files
NewKrok Oct 15, 2025
0b501e4
feat: add ESLint and Prettier configuration with code formatting
NewKrok Oct 15, 2025
44a72b3
feat: add Jest testing framework with comprehensive test setup
NewKrok Oct 15, 2025
341e201
feat: complete CI/CD setup with Husky hooks and GitHub Actions
NewKrok Oct 15, 2025
d5a60dc
refactor: remove coverage and bundle reports from git tracking
NewKrok Oct 15, 2025
376a834
fix: update Husky hooks to remove deprecated configuration
NewKrok Oct 15, 2025
2aea09f
feat: finalize v2.0.0 release with documentation and publish config
NewKrok Oct 15, 2025
6f97fe8
fix: clean up npm package by moving bundle report outside dist
NewKrok Oct 15, 2025
594c344
feat: add comprehensive GitHub Actions workflows for CI/CD
NewKrok Oct 15, 2025
0c3b335
fix: resolve GitHub Pages deployment permissions issue
NewKrok Oct 16, 2025
4dff0fd
fix: optimize TypeDoc workflow for push events only
NewKrok Oct 16, 2025
1a272fd
docs: enhance README with comprehensive structure and examples
NewKrok Oct 16, 2025
4fbabdf
feat: convert audio system to typescript and integrate with assets
NewKrok Oct 16, 2025
74322a0
feat: convert complete assets system to typescript
NewKrok Oct 16, 2025
49e645c
docs: add GitHub Copilot instructions for TypeScript conventions and …
NewKrok Oct 16, 2025
d00275c
chore: remove dist folder from git tracking and update .gitignore
NewKrok Oct 16, 2025
de0f5c8
chore: remove old JavaScript files after TypeScript migration
NewKrok Oct 16, 2025
c0a8dfe
feat: add comprehensive test suite with 100% coverage
NewKrok Oct 16, 2025
a38231b
style: improve test file formatting and import consistency
NewKrok Oct 16, 2025
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
38 changes: 38 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# GitHub Copilot Instructions for THREE Utils

This file contains coding conventions and guidelines for the THREE Utils project to help GitHub Copilot generate consistent and appropriate code suggestions.

## TypeScript Conventions

- Use `type` instead of `interface` for object type definitions
- Import types with `import type { ... }` syntax
- Place complex type definitions in `src/types/` directory
- Export types with descriptive names

## Code Style Guidelines

- Follow existing project patterns and naming conventions
- Ensure all exported functions have JSDoc documentation
- Use strict TypeScript settings and explicit return types
- Prefer functional programming patterns where appropriate

## Three.js Specific Guidelines

- Always clone Three.js objects (Vector3, Matrix4, Quaternion) before modification
- Implement proper dispose patterns for Three.js resources (geometries, materials, textures)
- Use namespace-based exports for utility modules (e.g., `CallbackUtils`, `GeomUtils`)
- Maintain performance considerations for animation loops and real-time rendering

## Testing Requirements

- Write unit tests for all new functionality using Jest
- Place test files in `src/__tests__/` directory
- Aim for minimum 80% code coverage
- Include both positive and negative test cases

## Module Organization

- Keep utilities in separate files by functionality
- Use modular exports to support tree-shaking
- Maintain separate entry points for `assets` and `audio` modules
- Follow the existing file naming pattern (kebab-case)
43 changes: 43 additions & 0 deletions .github/workflows/bundle-size-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Bundle Size Check

on:
pull_request:
branches:
- master
- v2

jobs:
analyze-bundle:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Generate bundle report
run: |
cat bundle-report.json

- name: Post bundle size comment
uses: marocchino/sticky-pull-request-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
header: bundle-size
message: |
## Bundle Size Report

```json
$(cat bundle-report.json)
```
28 changes: 28 additions & 0 deletions .github/workflows/circular-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Circular Dependencies Testing

on:
pull_request:
branches:
- master
- v2

jobs:
check-circular:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check circular dependencies
run: npx madge --circular src
39 changes: 39 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CodeQL Analysis

on:
pull_request:
branches:
- master
- v2
push:
branches:
- master
- v2

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
matrix:
language: [ 'javascript' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Lint Testing

on:
pull_request:
branches:
- master
- v2

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint
run: npm run lint
35 changes: 35 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Package to npm

on:
release:
types: [published] # Trigger only when a release is published

jobs:
build-and-publish:
runs-on: ubuntu-latest # Use the latest Ubuntu runner
permissions:
contents: read # Allow reading repository content
steps:
- name: Checkout code
uses: actions/checkout@v4 # Action to check out the repository code

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20' # Updated Node.js version
registry-url: 'https://registry.npmjs.org/' # Point to the npm registry
cache: 'npm'

- name: Install dependencies
run: npm ci # Use 'ci' for clean installs in CI

- name: Run tests
run: npm test # Ensure tests pass before publishing

- name: Build package
run: npm run build # Run your build script

- name: Publish to npm
run: npm publish --access public # Publish with public access for scoped packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Use the secret token for authentication
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run Tests

on:
push:
branches:
- master
- v2
pull_request:
branches:
- master
- v2

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run build
41 changes: 41 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate and Deploy Typedoc

on:
push:
branches:
- master
- v2

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Generate Typedoc documentation
run: npm run docs

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v2'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
enable_jekyll: false
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,59 @@
# Dependencies
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Build outputs
dist/
build/
*.tsbuildinfo

# Documentation (generated)
docs/

# Testing
coverage/
.nyc_output

# Environment
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Webpack bundle analyzer
bundle-report.json
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit ${1}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint && npm run test
Loading
Loading