From db168857fd17c72f0aac6e628fad532d34a537ca Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Wed, 13 Mar 2024 19:54:20 +0100 Subject: [PATCH 1/3] Don't pin a specific version of three --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9617146f..d7ae8b54 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "nipplejs": "^0.10.1", - "three": "0.159.0", + "three": "^0.159.0", "three-pathfinding": "^1.1.0" }, "devDependencies": { diff --git a/package.json b/package.json index 787688b7..705e5530 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "dependencies": { "nipplejs": "^0.10.1", - "three": "0.159.0", + "three": "^0.159.0", "three-pathfinding": "^1.1.0" }, "devDependencies": { From a247e57e45938c8c1a33f1bc6bb3f6343b20a186 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Wed, 13 Mar 2024 19:55:01 +0100 Subject: [PATCH 2/3] Expose all components as es modules --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index 705e5530..e2a12d30 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,14 @@ "author": "Don McCurdy ", "license": "MIT", "main": "index.js", + "exports": { + ".": "index.js", + "./controls/*": "./src/controls/*", + "./loaders/*": "./src/loaders/*", + "./misc/*": "./src/misc/*", + "./pathfinding/*": "./src/pathfinding/*", + "./primitives/*": "./src/primitives/*" + }, "repository": { "type": "git", "url": "git+https://github.com/c-frame/aframe-extras.git" From 4d4e36450fab2b6dffccdade7499f22c11d83c2a Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Wed, 13 Mar 2024 19:59:09 +0100 Subject: [PATCH 3/3] Mention importing specific packages in README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 12f766f1..59228312 100644 --- a/README.md +++ b/README.md @@ -71,10 +71,13 @@ npm install --save aframe-extras ```javascript // index.js -require('aframe-extras'); +import 'aframe-extras'; +// or specific packages +import "aframe-extras/controls/index.js"; +import "aframe-extras/pathfinding/index.js"; ``` -Once installed, you'll need to compile your JavaScript using something like [webpack](https://webpack.js.org). +Once installed, you'll need to compile your JavaScript using something like [webpack](https://webpack.js.org) with three defined as external, see webpack.config.js in this repo for an example. ## Examples