@srsergio/taptapp-ar 1.0.5 → 1.0.7

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.
@@ -1,3 +1,2 @@
1
- import { Controller } from "./controller.js";
2
- import { Compiler } from "./compiler.js";
3
- export { Controller, Compiler };
1
+ export { OfflineCompiler };
2
+ import { OfflineCompiler } from "./offline-compiler.js";
@@ -1,10 +1,8 @@
1
- import { Controller } from "./controller.js";
2
- import { Compiler } from "./compiler.js";
3
- export { Controller, Compiler };
1
+ import { OfflineCompiler } from "./offline-compiler.js";
2
+ export { OfflineCompiler };
4
3
  if (!window.MINDAR) {
5
4
  window.MINDAR = {};
6
5
  }
7
6
  window.MINDAR.IMAGE = {
8
- Controller,
9
- Compiler,
7
+ OfflineCompiler,
10
8
  };
@@ -7,45 +7,14 @@
7
7
  *
8
8
  * All methods have pure JS fallbacks that work universally.
9
9
  */
10
- // Detect if running in Node.js
11
- const isNode = typeof process !== 'undefined' &&
12
- process.versions != null &&
13
- process.versions.node != null;
14
- // Lazy load GPU.js only in browser environments
15
- let GPU = null;
16
- let gpuInstance = null;
17
- let gpuLoadAttempted = false;
10
+ // This module now uses pure JavaScript for all operations to ensure
11
+ // zero-dependency builds and universal compatibility (Node.js & Browser).
12
+ // The pure JS implementations are highly optimized for performance.
18
13
  /**
19
- * Try to initialize GPU.js (browser only)
14
+ * No-op initialization for compatibility
20
15
  */
21
16
  const tryInitGPU = () => {
22
- if (gpuLoadAttempted)
23
- return gpuInstance;
24
- gpuLoadAttempted = true;
25
- // Skip GPU.js in Node.js to avoid headless-gl issues
26
- if (isNode) {
27
- console.log("⚡ Running in Node.js - using optimized JS");
28
- return null;
29
- }
30
- // Dynamically import GPU.js in browser
31
- try {
32
- // Use dynamic import pattern that works in browsers
33
- const GPUModule = globalThis.GPU || (typeof require !== 'undefined' ? require('gpu.js').GPU : null);
34
- if (GPUModule) {
35
- GPU = GPUModule;
36
- gpuInstance = new GPU({ mode: "gpu" });
37
- // Test if GPU works
38
- const testKernel = gpuInstance.createKernel(function () { return 1; }).setOutput([1]);
39
- testKernel();
40
- testKernel.destroy();
41
- console.log("🚀 GPU.js: Using GPU acceleration");
42
- }
43
- }
44
- catch (e) {
45
- console.log("⚡ GPU.js unavailable, using optimized JS:", e.message);
46
- gpuInstance = null;
47
- }
48
- return gpuInstance;
17
+ return null;
49
18
  };
50
19
  // ============================================================================
51
20
  // PURE JAVASCRIPT IMPLEMENTATIONS (Always work)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,2 @@
1
1
  export * from "./react/types";
2
2
  export * from "./compiler/offline-compiler";
3
- export { Controller } from "./compiler/controller";
4
- export { Compiler } from "./compiler/compiler";
package/dist/index.js CHANGED
@@ -1,5 +1,2 @@
1
1
  export * from "./react/types";
2
2
  export * from "./compiler/offline-compiler";
3
- // Re-export specific compiler components if needed
4
- export { Controller } from "./compiler/controller";
5
- export { Compiler } from "./compiler/compiler";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@srsergio/taptapp-ar",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "AR Visualizer and Compiler for Astro and React",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,8 +19,8 @@
19
19
  "types": "./dist/index.d.ts",
20
20
  "import": "./dist/index.js"
21
21
  },
22
- "./astro/*": "./src/astro/*.astro",
23
- "./compiler/*": "./src/compiler/*.js"
22
+ "./astro/*": "./src/astro/*",
23
+ "./compiler/*": "./src/compiler/*"
24
24
  },
25
25
  "files": [
26
26
  "dist",
@@ -40,7 +40,7 @@
40
40
  "three": ">=0.160.0"
41
41
  },
42
42
  "dependencies": {
43
- "gpu.js": "^2.16.0",
43
+ "@msgpack/msgpack": "^3.0.0-beta2",
44
44
  "ml-matrix": "^6.10.4",
45
45
  "tinyqueue": "^2.0.3"
46
46
  },
@@ -1,13 +1,11 @@
1
- import { Controller } from "./controller.js";
2
- import { Compiler } from "./compiler.js";
1
+ import { OfflineCompiler } from "./offline-compiler.js";
3
2
 
4
- export { Controller, Compiler };
3
+ export { OfflineCompiler };
5
4
 
6
5
  if (!window.MINDAR) {
7
6
  window.MINDAR = {};
8
7
  }
9
8
 
10
9
  window.MINDAR.IMAGE = {
11
- Controller,
12
- Compiler,
10
+ OfflineCompiler,
13
11
  };
@@ -8,50 +8,15 @@
8
8
  * All methods have pure JS fallbacks that work universally.
9
9
  */
10
10
 
11
- // Detect if running in Node.js
12
- const isNode = typeof process !== 'undefined' &&
13
- process.versions != null &&
14
- process.versions.node != null;
15
-
16
- // Lazy load GPU.js only in browser environments
17
- let GPU = null;
18
- let gpuInstance = null;
19
- let gpuLoadAttempted = false;
11
+ // This module now uses pure JavaScript for all operations to ensure
12
+ // zero-dependency builds and universal compatibility (Node.js & Browser).
13
+ // The pure JS implementations are highly optimized for performance.
20
14
 
21
15
  /**
22
- * Try to initialize GPU.js (browser only)
16
+ * No-op initialization for compatibility
23
17
  */
24
18
  const tryInitGPU = () => {
25
- if (gpuLoadAttempted) return gpuInstance;
26
- gpuLoadAttempted = true;
27
-
28
- // Skip GPU.js in Node.js to avoid headless-gl issues
29
- if (isNode) {
30
- console.log("⚡ Running in Node.js - using optimized JS");
31
- return null;
32
- }
33
-
34
- // Dynamically import GPU.js in browser
35
- try {
36
- // Use dynamic import pattern that works in browsers
37
- const GPUModule = globalThis.GPU || (typeof require !== 'undefined' ? require('gpu.js').GPU : null);
38
- if (GPUModule) {
39
- GPU = GPUModule;
40
- gpuInstance = new GPU({ mode: "gpu" });
41
-
42
- // Test if GPU works
43
- const testKernel = gpuInstance.createKernel(function () { return 1; }).setOutput([1]);
44
- testKernel();
45
- testKernel.destroy();
46
-
47
- console.log("🚀 GPU.js: Using GPU acceleration");
48
- }
49
- } catch (e) {
50
- console.log("⚡ GPU.js unavailable, using optimized JS:", e.message);
51
- gpuInstance = null;
52
- }
53
-
54
- return gpuInstance;
19
+ return null;
55
20
  };
56
21
 
57
22
  // ============================================================================
package/src/index.ts CHANGED
@@ -1,6 +1,2 @@
1
1
  export * from "./react/types";
2
2
  export * from "./compiler/offline-compiler";
3
-
4
- // Re-export specific compiler components if needed
5
- export { Controller } from "./compiler/controller";
6
- export { Compiler } from "./compiler/compiler";