@needle-tools/engine 3.9.0-alpha → 3.9.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,11 @@ All notable changes to this package will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [3.9.0-alpha.1] - 2023-07-12
8
+ - Add: vite plugin to clamp version to `<= 4.3.9` since 4.4 and above currently cause issues with typescript decorators, [vite#13736](https://github.com/vitejs/vite/issues/13736)
9
+
7
10
  ## [3.9.0-alpha] - 2023-07-12
8
- - Add: `<needle-engine>` web component slot support, AR DOM overlay can now be added by simple adding HTML elements inside the `<needle-engine></needle-engine>` web component. Fixing [165](https://github.com/needle-tools/needle-engine-support/issues/164)
11
+ - Add: `<needle-engine>` web component slot support, AR DOM overlay can now be added by simple adding HTML elements inside the `<needle-engine></needle-engine>` web component. Fixing [164](https://github.com/needle-tools/needle-engine-support/issues/164)
9
12
  - Add: Basic USDZ exporting of UI shadow hierarchies as mesh hierarchies for UI in Quicklook AR support
10
13
  - Fix: WebXR Rig not being rotated as expected when setting up in Unity [129](https://github.com/needle-tools/needle-engine-support/issues/129)
11
14
  - Fix: WebXR VR button click, hover is still not working
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needle-tools/engine",
3
- "version": "3.9.0-alpha",
3
+ "version": "3.9.0-alpha.1",
4
4
  "description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in",
5
5
  "main": "dist/needle-engine.umd.cjs",
6
6
  "type": "module",
@@ -7,33 +7,26 @@ import { execSync } from 'child_process';
7
7
  * @param {import('../types').userSettings} userSettings
8
8
  */
9
9
  export const vite_4_4_hack = (command, config, userSettings) => {
10
- // if (userSettings.vite44Hack !== true) return;
10
+ if (userSettings.vite44Hack === false) return;
11
11
  return {
12
12
  name: "needle-vite-4.4-hack",
13
13
  async configureServer(server) {
14
- // Check if this plugin should run
15
14
  const dir = process.cwd();
16
- const needleEngineDirectory = path.join(dir, "node_modules", "@needle-tools", "engine");
17
- const resolveSymlink = realpathSync(needleEngineDirectory);
18
- // this issue only arises when the engine is installed locally
19
- const isSymlink = resolveSymlink !== needleEngineDirectory;
20
-
21
- if (userSettings.vite44Hack === true || isSymlink) {
22
- const packageJsonPath = path.join(dir, "package.json");
23
- const currentPackageJson = readFileSync(packageJsonPath, "utf8");
24
- if (currentPackageJson.includes('"vite": "^4.3.4"')) {
25
- // see https://github.com/vitejs/vite/issues/13736
26
- console.log("Detected problematic vite version: Vite 4.4.x does currently have problems with typescript decorators. Switching to 4.3.9...")
27
- const newPackageJson = currentPackageJson.replace('"vite": "^4.3.4"', '"vite": "<= 4.3.9"');
28
- writeFileSync(packageJsonPath, newPackageJson, "utf8");
29
- // stop current server
30
- await server.close();
31
- // re-install with the limited package version
32
- execSync("npm install", { stdio: "inherit", cwd: dir });
33
- // start again
34
- execSync("npm start", { stdio: "inherit", cwd: dir });
35
- }
15
+ const packageJsonPath = path.join(dir, "package.json");
16
+ const currentPackageJson = readFileSync(packageJsonPath, "utf8");
17
+ if (currentPackageJson.includes('"vite": "^4.3.4"')) {
18
+ // see https://github.com/vitejs/vite/issues/13736
19
+ console.log("Detected problematic vite version: Vite 4.4.x does currently have problems with typescript decorators. Switching to 4.3.9...")
20
+ const newPackageJson = currentPackageJson.replace('"vite": "^4.3.4"', '"vite": "<= 4.3.9"');
21
+ writeFileSync(packageJsonPath, newPackageJson, "utf8");
22
+ // stop current server
23
+ await server.close();
24
+ // re-install with the limited package version
25
+ execSync("npm install", { stdio: "inherit", cwd: dir });
26
+ // start again
27
+ execSync("npm start", { stdio: "inherit", cwd: dir });
36
28
  }
29
+
37
30
  },
38
31
  }
39
32
  }