Skip to content

Commit

Permalink
Merge branch 'master' of github.com:BabylonJS/Babylon.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandCsibrei committed Jul 2, 2024
2 parents 884d0f0 + 5ba3edc commit e40be02
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
13 changes: 13 additions & 0 deletions packages/dev/buildTools/src/declarationsEs6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import * as glob from "glob";
export const declarationsEs6 = () => {
const root = checkArgs(["--root", "-r"]) as string;
const appendToFile = checkArgs(["--append-to-file", "-atf"]) as string;
const constEnumToEnum = checkArgs(["--const-enum-to-enum", "-cete"]) as boolean;
// eslint-disable-next-line no-console
console.log(`Declarations ES6: root: ${root}`, appendToFile ? `append to file: ${appendToFile}` : "");

Expand All @@ -24,4 +25,16 @@ declare global{
${mixins}
}`;
fs.writeFileSync(path.join(".", appendToFile), newContent);

if (constEnumToEnum) {
// iterate over all files in the current directory and change const enum to enum
// This can be done since we are exporting the enums to js as well
const files = glob.sync(path.join("./**/*.d.ts"));

files.forEach((file) => {
let content = fs.readFileSync(file, "utf8");
content = content.replace(/const enum/g, "enum");
fs.writeFileSync(file, content);
});
}
};
2 changes: 0 additions & 2 deletions packages/dev/core/src/Cameras/Inputs/flyCameraMouseInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class FlyCameraMouseInput implements ICameraInput<FlyCamera> {
private _rollObserver: Nullable<Observer<Scene>>;
private _previousPosition: Nullable<{ x: number; y: number }> = null;
private _noPreventDefault: boolean | undefined;
private _element: HTMLElement;

/**
* Listen to mouse events to control the camera.
Expand Down Expand Up @@ -166,7 +165,6 @@ export class FlyCameraMouseInput implements ICameraInput<FlyCamera> {

if (!this._noPreventDefault) {
e.preventDefault();
this._element.focus();
}

// This is required to move while pointer button is down
Expand Down
1 change: 1 addition & 0 deletions packages/dev/core/src/Collisions/gpuPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class GPUPicker {
/**
* Set the list of meshes to pick from
* Set that value to null to clear the list (and avoid leaks)
* The module will read and delete from the array provided by reference. Disposing the module or setting the value to null will clear the array.
* @param list defines the list of meshes to pick from
*/
public setPickingList(list: Nullable<Array<AbstractMesh>>) {
Expand Down
2 changes: 1 addition & 1 deletion packages/public/@babylonjs/core/config.tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"commands": [
{
"command": "declarations-es6",
"args": ["-r", "../../../dev/core/src/LibDeclarations", "-atf", "./Engines/engine.d.ts"]
"args": ["-r", "../../../dev/core/src/LibDeclarations", "-atf", "./Engines/engine.d.ts", "-cete"]
},
{
"command": "add-js-to-es6"
Expand Down

0 comments on commit e40be02

Please sign in to comment.