Skip to content

Commit acb517a

Browse files
authored
Merge branch 'playcanvas:main' into main
2 parents 819041d + 9652b7b commit acb517a

1,614 files changed

Lines changed: 57257 additions & 39552 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/renovate.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"packageRules": [
7+
{
8+
"matchManagers": [
9+
"npm"
10+
],
11+
"groupName": "all npm dependencies",
12+
"schedule": [
13+
"on monday at 10:00am"
14+
]
15+
},
16+
{
17+
"matchDepTypes": ["devDependencies"],
18+
"rangeStrategy": "pin"
19+
},
20+
{
21+
"matchDepTypes": ["dependencies"],
22+
"rangeStrategy": "widen"
23+
}
24+
],
25+
"ignorePaths": [".nvmrc"]
26+
}

.github/workflows/ci.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Node.js 18.x
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: 18.x
29+
node-version: 22.x
3030
cache: 'npm'
3131

3232
- name: Install dependencies
@@ -49,7 +49,7 @@ jobs:
4949
- name: Setup Node.js 18.x
5050
uses: actions/setup-node@v4
5151
with:
52-
node-version: 18.x
52+
node-version: 22.x
5353
cache: 'npm'
5454

5555
- name: Install dependencies
@@ -69,7 +69,7 @@ jobs:
6969
- name: Setup Node.js 18.x
7070
uses: actions/setup-node@v4
7171
with:
72-
node-version: 18.x
72+
node-version: 22.x
7373
cache: 'npm'
7474

7575
- name: Install dependencies
@@ -95,7 +95,7 @@ jobs:
9595
- name: Setup Node.js 18.x
9696
uses: actions/setup-node@v4
9797
with:
98-
node-version: 18.x
98+
node-version: 22.x
9999
cache: 'npm'
100100

101101
- name: Install dependencies
@@ -107,8 +107,8 @@ jobs:
107107
- name: Compile TypeScript declarations
108108
run: npm run test:types
109109

110-
unit-test-node:
111-
name: Unit Test (Node)
110+
unit-test:
111+
name: Unit Test
112112
runs-on: ubuntu-latest
113113
timeout-minutes: 10
114114
steps:
@@ -118,7 +118,7 @@ jobs:
118118
- name: Setup Node.js 18.x
119119
uses: actions/setup-node@v4
120120
with:
121-
node-version: 18.x
121+
node-version: 22.x
122122
cache: 'npm'
123123

124124
- name: Install dependencies
@@ -127,32 +127,6 @@ jobs:
127127
- name: Run unit tests
128128
run: npm test
129129

130-
unit-test-karma:
131-
name: Unit Test (Karma)
132-
runs-on: ubuntu-latest
133-
timeout-minutes: 10
134-
steps:
135-
- name: Checkout code
136-
uses: actions/checkout@v4
137-
138-
- name: Setup Node.js 18.x
139-
uses: actions/setup-node@v4
140-
with:
141-
node-version: 18.x
142-
cache: 'npm'
143-
144-
- name: Install dependencies
145-
run: npm clean-install --progress=false --no-fund
146-
147-
- name: Build PlayCanvas (UMD-only)
148-
run: npm run build:umd
149-
150-
- name: Install X virtual framebuffer
151-
run: sudo apt-get install xvfb
152-
153-
- name: Run unit tests
154-
run: xvfb-run --auto-servernum npm run test:karma
155-
156130
build-examples:
157131
name: Build Examples Browser
158132
runs-on: ubuntu-latest
@@ -164,7 +138,7 @@ jobs:
164138
- name: Setup Node.js 18.x
165139
uses: actions/setup-node@v4
166140
with:
167-
node-version: 18.x
141+
node-version: 22.x
168142
cache: 'npm'
169143

170144
- name: Install dependencies

.github/workflows/publish.yaml

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,28 @@ on:
44
push:
55
tags:
66
- 'v[0-9]+.[0-9]+.[0-9]+'
7-
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
7+
- 'v[0-9]+.[0-9]+.[0-9]+-preview.[0-9]+'
88

99
jobs:
1010
publish-npm:
1111
runs-on: ubuntu-latest
12+
if: github.repository == 'playcanvas/engine'
1213
steps:
1314
- name: Check out code
1415
uses: actions/checkout@v4
1516

1617
- name: Set up Node.js 18.x
1718
uses: actions/setup-node@v4
1819
with:
19-
node-version: 18.x
20+
node-version: 22.x
2021
cache: 'npm'
2122
registry-url: 'https://registry.npmjs.org/'
2223

23-
- name: Determine pre-release tag
24-
id: release-tag
24+
- name: Parse tag name
2525
run: |
2626
TAG_NAME=${GITHUB_REF#refs/tags/}
27-
echo "Detected tag: $TAG_NAME"
28-
if [[ "$TAG_NAME" == *-alpha.* ]]; then
29-
echo "tag=alpha" >> $GITHUB_ENV
30-
npm version --no-git-tag-version $TAG_NAME
31-
else
32-
echo "tag=latest" >> $GITHUB_ENV
33-
fi
27+
echo "TAG=${TAG_NAME}" >> $GITHUB_ENV
28+
echo "VERSION=${TAG_NAME/v/}" >> $GITHUB_ENV
3429
3530
- name: Install Dependencies
3631
run: npm install
@@ -42,6 +37,20 @@ jobs:
4237
run: npm run publint
4338

4439
- name: Publish to npm
45-
run: npm publish --tag ${{ env.tag }}
40+
run: |
41+
if [[ "${{ env.TAG }}" =~ "preview" ]]; then
42+
tag=preview
43+
else
44+
tag=latest
45+
fi
46+
npm publish --tag $tag
4647
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
50+
- name: Publish to code.playcanvas.com
51+
run: |
52+
if ! curl -sS -X POST -H "Content-Type: application/json" \
53+
-d '{ "engineVersion": "${{ env.VERSION }}" }' ${{ secrets.PUBLISH_ENDPOINT }}; then
54+
echo "Failed to publish to code.playcanvas.com"
55+
exit 1
56+
fi

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.idea/
33
.vscode/
44
build
5-
tree*.html
5+
tree*.*.html
66
coverage
77
docs
88
examples/dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# PlayCanvas WebGL Game Engine
66

7-
[API Reference](https://api.playcanvas.com/modules/Engine.html) | [User Manual](https://developer.playcanvas.com) | [Examples](https://playcanvas.github.io) | [Forum](https://forum.playcanvas.com) | [Blog](https://blog.playcanvas.com)
7+
[API Reference](https://api.playcanvas.com/engine/) | [User Manual](https://developer.playcanvas.com) | [Examples](https://playcanvas.github.io) | [Forum](https://forum.playcanvas.com) | [Blog](https://blog.playcanvas.com)
88

99
PlayCanvas is an open-source game engine. It uses HTML5 and WebGL to run games and other interactive 3D content in any mobile or desktop browser.
1010

build.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
* - bundleState (unbundled, bundled)
1010
* Example: target:esm:release:bundled
1111
*
12-
* treemap - Enable treemap build visualization.
13-
* treenet - Enable treenet build visualization.
14-
* treesun - Enable treesun build visualization.
12+
* treemap - Enable treemap build visualization (release only).
13+
* treenet - Enable treenet build visualization (release only).
14+
* treesun - Enable treesun build visualization (release only).
15+
* treeflame - Enable treeflame build visualization (release only).
1516
*/
1617

1718
import { execSync } from 'child_process';
@@ -22,7 +23,8 @@ const ENV_START_MATCHES = [
2223
'target',
2324
'treemap',
2425
'treenet',
25-
'treesun'
26+
'treesun',
27+
'treeflame'
2628
];
2729

2830
const env = [];

eslint.config.mjs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import playcanvasConfig from '@playcanvas/eslint-config';
2-
import babelParser from '@babel/eslint-parser';
32
import globals from 'globals';
43

4+
// Extract or preserve existing JSDoc tags
5+
const jsdocRule = playcanvasConfig.find(
6+
config => config.rules && config.rules['jsdoc/check-tag-names']
7+
);
8+
const existingTags = jsdocRule?.rules['jsdoc/check-tag-names'][1]?.definedTags || [];
9+
510
export default [
611
...playcanvasConfig,
712
{
813
files: ['**/*.js', '**/*.mjs'],
914
languageOptions: {
1015
ecmaVersion: 2022,
1116
sourceType: 'module',
12-
parser: babelParser,
13-
parserOptions: {
14-
requireConfigFile: false
15-
},
1617
globals: {
1718
...globals.browser,
1819
...globals.mocha,
@@ -27,7 +28,14 @@ export default [
2728
}
2829
},
2930
rules: {
30-
'import/order': 'off'
31+
'import/order': 'off',
32+
'jsdoc/check-tag-names': [
33+
'error',
34+
{
35+
// custom mjs script tags to not error on, add them to those from parent config
36+
definedTags: [...new Set([...existingTags, 'range', 'step', 'precision'])]
37+
}
38+
]
3139
}
3240
},
3341
{
@@ -36,16 +44,23 @@ export default [
3644
'no-var': 'off'
3745
}
3846
},
47+
{
48+
files: ['scripts/**/*.mjs'],
49+
rules: {
50+
'jsdoc/no-defaults': 'off', // Attributes use default values
51+
'import/no-unresolved': 'off' // PlayCanvas is not installed for scripts
52+
}
53+
},
3954
{
4055
files: ['test/**/*.mjs'],
4156
rules: {
57+
'import/order': 'error',
4258
'no-unused-expressions': 'off',
4359
'prefer-arrow-callback': 'off' // Mocha uses function callbacks
4460
}
4561
},
4662
{
4763
ignores: [
48-
'tests/**/*',
4964
'examples/lib/*',
5065
'scripts/textmesh/*.min.js',
5166
'src/polyfill/*',
9.86 KB
Loading
40.8 KB
Loading

0 commit comments

Comments
 (0)