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
50 changes: 25 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: CI

on:
push:
branches-ignore:
- 'main' # main is protected
- 'gh-pages'
push:
branches-ignore:
- 'main' # main is protected
- 'gh-pages'

permissions:
contents: read
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [22.x]
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [22.x]

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci
if: hashFiles('package-lock.json') != ''
- name: Install dependencies
run: npm ci
if: hashFiles('package-lock.json') != ''

- name: Run tests
run: npm test
- name: Run build, lint, and test
run: npm run validate
110 changes: 55 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: Publish release

on:
push:
branches:
- main
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 0 # important for lerna to detect tags
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
registry-url: 'https://registry.npmjs.org/'
always-auth: true

- name: Install dependencies
run: npm ci

- name: Create versions & changelogs
run: npx lerna version --no-private --create-release github --yes
env:
GH_TOKEN: ${{ secrets.GH_PAT }}

- name: Build
run: npm run www

- name: Publish to NPMJS
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/three-particles

- name: Deploy JS to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: www
clean: true
single-commit: true
commit-message: 'ci: update www'
release:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
fetch-depth: 0 # important for lerna to detect tags
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
registry-url: 'https://registry.npmjs.org/'
always-auth: true

- name: Install dependencies
run: npm ci

- name: Create versions & changelogs
run: npx lerna version --no-private --create-release github --yes
env:
GH_TOKEN: ${{ secrets.GH_PAT }}

- name: Build
run: npm run www

- name: Publish to NPMJS
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: ./packages/three-particles

- name: Deploy JS to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: www
clean: true
single-commit: true
commit-message: 'ci: update www'
6 changes: 3 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"semi": false,
"singleQuote": true,
"tabWidth": 4
"semi": false,
"singleQuote": true,
"tabWidth": 4
}
20 changes: 17 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
"vite": "^7.0.6"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.52.0"
"@rollup/rollup-linux-x64-gnu": "^4.52.0",
"@rollup/rollup-win32-x64-msvc": "^4.52.0"
},
"scripts": {
"clean": "rimraf www && lerna run clean",
"@eslint/js": "^9.22.0",
"lint": "lerna run lint",
"lint:write": "lerna run lint:write",
"lint": "npm run prettier:check && eslint .",
"lint:write": "npm run prettier:write && eslint . --fix",
"prettier:check": "prettier . --check",
"prettier:write": "prettier . --write",
"build": "lerna run build",
"watch": "lerna run watch --parallel",
"prewww": "lerna run build",
"www": "tsx ./buildSrc/build.ts",
"test": "lerna run test",
"validate": "lerna run build && lerna run lint && lerna run test",
"serve": "npm run www && http-server www"
},
"repository": {
Expand Down
4 changes: 0 additions & 4 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"private": true,
"scripts": {
"clean": "rimraf dist",
"lint": "npm run prettier:check && eslint .",
"lint:write": "npm run prettier:write && eslint . --fix",
"prettier:check": "prettier . --ignore-path ../../.prettierignore --cache --check",
"prettier:write": "prettier . --ignore-path ../../.prettierignore --cache --write",
"build": "vite build",
"dev": "vite"
},
Expand Down
1 change: 0 additions & 1 deletion packages/example/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
PerspectiveCamera,
PlaneGeometry,
Scene,
TextureLoader,
Vector3,
WebGLRenderer,
} from 'three'
Expand Down
6 changes: 1 addition & 5 deletions packages/three-particles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
"access": "public"
},
"scripts": {
"lint": "npm run prettier:check && eslint .",
"lint:write": "npm run prettier:write && eslint . --fix",
"prettier:check": "prettier . --ignore-path ../../.prettierignore --cache --check",
"prettier:write": "prettier . --ignore-path ../../.prettierignore --cache --write",
"test": "jest",
"build": "tsx buildSrc/build.ts && tsc && npm run lint",
"build": "tsx buildSrc/build.ts",
"watch": "tsx buildSrc/build.ts -w"
},
"files": [
Expand Down
8 changes: 8 additions & 0 deletions resources/example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Title</title>
</head>
<body></body>
</html>