Skip to content

Commit ed1affe

Browse files
committed
Update deps and examples
1 parent 970f3f6 commit ed1affe

Some content is hidden

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

76 files changed

+1957
-2373
lines changed

.eslintrc.json

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] ___ doesn't work"
5+
labels: bug
6+
assignees: raub
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. ___
16+
2. ___
17+
3. ___
18+
19+
**Expected behavior**
20+
Description of what you expected to happen.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEAT] ____"
5+
labels: new
6+
assignees: raub
7+
8+
---
9+
10+
**Describe the solution you'd like**
11+
Description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
Description of alternative solutions or features you've considered.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Description
2+
<!-- A concise description of what the PR does. -->
3+
4+
5+
## Test Plan
6+
<!-- How can a reviewer test the changes included in this PR? -->
7+
1.
8+
2.
9+
3.
10+
11+
12+
## Checklist
13+
<!-- Ensure that your PR fulfills the following requirements -->
14+
- [ ] I've followed the code style.
15+
- [ ] I've tried running the code with my changes.
16+
- [ ] The docs and TS declarations are in sync with code changes.
17+
- [ ] (optional) I've added unit tests for my changes.

CODE_OF_CONDUCT.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Code of Conduct
2+
3+
We pledge to act and interact in ways that contribute to an open and healthy community.
4+
5+
## Our Standards
6+
7+
Examples of unacceptable behavior:
8+
9+
* The use of sexualized language or imagery
10+
* Trolling, insulting or derogatory comments
11+
* Public or private harassment
12+
* Publishing others' private information
13+
* Other unprofessional conduct
14+
15+
## Enforcement
16+
17+
Community leaders will remove, edit, or reject
18+
contributions that are not aligned to this Code of Conduct.

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contributing
2+
3+
Bugs and enhancements are tracked as GitHub issues.
4+
5+
## Issues
6+
7+
* Use a clear and descriptive title.
8+
* Describe the desired enhancement / problem.
9+
* Provide examples to demonstrate the issue.
10+
* If the problem involves a crash, provide its trace log.
11+
12+
## Pull Requests
13+
14+
* Do not include issue numbers in the PR title.
15+
* Commits use the present tense (`"Add feature"` not `"Added feature"`).
16+
* Commits use the imperative mood (`"Move cursor to..."` not `"Moves cursor to..."`).
17+
* File System
18+
* Prefer kebab-lowercase (`my-dir/example-file-name.js`).
19+
* Place an empty `.keep` file to keep an empty directory.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Luis Blanco
3+
Copyright (c) 2025 Luis Blanco
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Node.js 3D QML
1+
# Node.js 3D QML Helpers
22

33
This is a part of [Node3D](https://github.com/node-3d) project.
44

@@ -10,7 +10,8 @@ This is a part of [Node3D](https://github.com/node-3d) project.
1010
npm i -s 3d-qml-raub
1111
```
1212

13-
QML-rendering extension for Node.js 3D Core. The QML backend is **Qt 5.13.0**.
13+
[QML](https://doc.qt.io/qt-6/qmlapplications.html)-rendering helpers for Node.js 3D Core.
14+
The QML backend is **Qt 6.8.0**.
1415

1516
![Example](examples/screenshot.png)
1617

@@ -41,7 +42,7 @@ const {
4142
* See [TypeScript declarations](/index.d.ts) for more details.
4243
* See [example](/examples/fps/main.ts) for a complete setup.
4344

44-
It is also possible to run [QtQuick examples](https://doc.qt.io/qt-5.11/qtquick-codesamples.html)
45+
It is also possible to run [QtQuick examples](https://doc.qt.io/qt-6/qtquick-codesamples.html)
4546
on Node.js with this renderer. But it will only work with `QtQuick` components, i.e.
4647
not `QtMultimedia`, `QtNetwork`, etc. - because those libs are not included.
4748
See [Dashboard](https://doc.qt.io/qt-5/qtquickextras-dashboard-example.html)

eslint.config.js

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
'use strict';
2+
3+
const js = require('@eslint/js');
4+
5+
6+
module.exports = [
7+
{
8+
ignores: ['examples/clouds']
9+
},
10+
js.configs.recommended,
11+
{
12+
languageOptions: {
13+
'parserOptions': {
14+
'ecmaVersion': 2022,
15+
sourceType: 'commonjs'
16+
},
17+
globals: {
18+
global: 'readonly',
19+
require: 'readonly',
20+
Buffer: 'readonly',
21+
module: 'readonly',
22+
console: 'readonly',
23+
__dirname: 'readonly',
24+
process: 'readonly',
25+
setTimeout: 'readonly',
26+
setImmediate: 'readonly',
27+
clearImmediate: 'readonly',
28+
URL: 'readonly',
29+
},
30+
},
31+
'rules': {
32+
'arrow-parens': ['error', 'always'],
33+
'no-trailing-spaces': [
34+
'error',
35+
{
36+
'skipBlankLines': true
37+
}
38+
],
39+
'indent': [
40+
'error',
41+
'tab',
42+
{
43+
'SwitchCase': 1
44+
}
45+
],
46+
'operator-linebreak': [
47+
'error',
48+
'after',
49+
{
50+
'overrides': {
51+
'?': 'before',
52+
':': 'before'
53+
}
54+
}
55+
],
56+
'max-len': ['error', 110],
57+
'quotes': [
58+
'error',
59+
'single'
60+
],
61+
'semi': [
62+
'error',
63+
'always'
64+
],
65+
'no-multiple-empty-lines': ['error', { 'max': 3, 'maxEOF': 1, 'maxBOF': 1 }],
66+
'keyword-spacing': ['error', { 'before': true, 'after': true }],
67+
'space-before-blocks': ['error'],
68+
'space-before-function-paren': [
69+
'error', {'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always'}
70+
],
71+
'camelcase': ['error'],
72+
'no-tabs': [0],
73+
'no-unused-vars': [
74+
'error',
75+
{
76+
'argsIgnorePattern': '^_',
77+
'varsIgnorePattern': '^_',
78+
'caughtErrorsIgnorePattern': '^_'
79+
}
80+
],
81+
'global-require': [0],
82+
'no-underscore-dangle': [0],
83+
'no-plusplus': [0],
84+
'no-shadow': [0],
85+
'node/no-unpublished-require': [0],
86+
'no-process-exit': [0],
87+
'linebreak-style': [0],
88+
'node/no-missing-require': [0],
89+
'no-console': [0],
90+
'node/no-unsupported-features/es-builtins': 0,
91+
'node/no-unsupported-features/node-builtins': 0,
92+
'func-names': [
93+
'error',
94+
'never',
95+
{
96+
'generators': 'never'
97+
}
98+
]
99+
}
100+
},
101+
];

examples/fps/main.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
1717
const {
1818
doc, Image: Img, gl, glfw,
1919
} = init({
20-
isGles3: true, isWebGL2: true, mode: 'borderless',
20+
isGles3: true, isWebGL2: true, mode: 'borderless', vsync: true,
2121
});
2222

2323
addThreeHelpers(three, gl);
@@ -109,7 +109,7 @@ gun.layers.disable(LAYER_WORLD);
109109
const scoreView = new View({ file: `${__dirname}/qml/Score.qml` });
110110
const materialScore = new three.SpriteMaterial();
111111
materialScore.map = textureFromId(scoreView.textureId, renderer);
112-
scoreView.on('reset', (textureId) => {
112+
scoreView.on('reset', (textureId: number): void => {
113113
release();
114114
materialScore.map = textureFromId(textureId, renderer);
115115
});
@@ -341,7 +341,8 @@ const leaveGame = () => {
341341
doc.releasePointerCapture();
342342
};
343343

344-
overlay.on('custom-esc', (event) => {
344+
type TEscEvent = Readonly<{ button: string }>;
345+
overlay.on('custom-esc', (event: TEscEvent) => {
345346
release();
346347
if (event.button === 'resume') {
347348
mouseTime = 0;
@@ -747,8 +748,9 @@ const spawnEnemy = (rate: number = 0) => {
747748

748749
randEnemy.ttl = TTL_SEC_ENEMY;
749750
randEnemy.isActive = true;
750-
randEnemy.mesh.visible = true;
751751
enemyMovePatterns[randIdx % enemyMoveCount](randEnemy.collider);
752+
randEnemy.mesh.position.copy(randEnemy.collider.center);
753+
randEnemy.mesh.visible = true;
752754
};
753755

754756
const getForwardVector = () => {

0 commit comments

Comments
 (0)