Showing
11 changed files
with
63 additions
and
35 deletions
... | @@ -29,3 +29,33 @@ the last one being executed in the local sources repository: | ... | @@ -29,3 +29,33 @@ the last one being executed in the local sources repository: |
29 | In order to build or rebuild the engine, you will have to call webpack. If | 29 | In order to build or rebuild the engine, you will have to call webpack. If |
30 | you prefer, it is included as a command in file *package.json*. | 30 | you prefer, it is included as a command in file *package.json*. |
31 | To generate documentation and prepare components, type `npm run setup` | 31 | To generate documentation and prepare components, type `npm run setup` |
32 | + | ||
33 | + | ||
34 | +Creating an application | ||
35 | +----------------------- | ||
36 | + | ||
37 | +The first thing is to create a directory, then start a repository using npm and | ||
38 | +install arcs. | ||
39 | + | ||
40 | +`mkdir myapp` | ||
41 | + | ||
42 | +`npm init -y` | ||
43 | + | ||
44 | +`npm install arcsjs` | ||
45 | + | ||
46 | +To install components on a per need basis, you should a component repository | ||
47 | +that is setup. You can do it locally by running: | ||
48 | + | ||
49 | +`npx arcsrepos -d path_to_components` | ||
50 | + | ||
51 | +Then you set a repository environment variable or specify it on command line | ||
52 | +each time you install a component: | ||
53 | + | ||
54 | +`export ARCS_REPOSITORY=/path/to/components/repository.json` | ||
55 | + | ||
56 | +`npx arcsm -i library_or_component_name` | ||
57 | + | ||
58 | +Or you can do it like this: | ||
59 | + | ||
60 | +`npx arcsm -i library_or_component_name -r /path/to/components/repository.json` | ||
61 | + | ... | ... |
... | @@ -64,22 +64,22 @@ ARCS.__lib__` | ... | @@ -64,22 +64,22 @@ ARCS.__lib__` |
64 | "ARUCO", | 64 | "ARUCO", |
65 | "marker", | 65 | "marker", |
66 | "detector" | 66 | "detector" |
67 | - ], | 67 | + ] |
68 | } | 68 | } |
69 | }, | 69 | }, |
70 | "dependencies": [ "js-aruco"], | 70 | "dependencies": [ "js-aruco"], |
71 | "recipes": [ | 71 | "recipes": [ |
72 | { | 72 | { |
73 | - "from": 'node_modules/js-aruco/src/aruco.js', | 73 | + "from": "node_modules/js-aruco/src/aruco.js", |
74 | - "to": '../deps/aruco/index.js', | 74 | + "to": "deps/aruco/index.js", |
75 | "replace" : { | 75 | "replace" : { |
76 | "var CV = require('./cv');": "import CV from '../cv/index.js';", | 76 | "var CV = require('./cv');": "import CV from '../cv/index.js';", |
77 | "module.exports = AR;": "export default AR;" | 77 | "module.exports = AR;": "export default AR;" |
78 | } | 78 | } |
79 | }, | 79 | }, |
80 | { | 80 | { |
81 | - "from": 'node_modules/js-aruco/src/cv.js', | 81 | + "from": "node_modules/js-aruco/src/cv.js", |
82 | - to: '../deps/cv/index.js', | 82 | + "to": "../deps/cv/index.js", |
83 | "replace" : { | 83 | "replace" : { |
84 | "module.exports = CV;": "export default CV;" | 84 | "module.exports = CV;": "export default CV;" |
85 | } | 85 | } | ... | ... |
... | @@ -335,7 +335,7 @@ ARCS.__lib__` | ... | @@ -335,7 +335,7 @@ ARCS.__lib__` |
335 | "recipes": [ | 335 | "recipes": [ |
336 | { | 336 | { |
337 | "from": "node_modules/three/build/three.module.js", | 337 | "from": "node_modules/three/build/three.module.js", |
338 | - "to": "../deps/three.js/index.js" | 338 | + "to": "deps/three.js/index.js" |
339 | } | 339 | } |
340 | ] | 340 | ] |
341 | } | 341 | } | ... | ... |
... | @@ -132,12 +132,12 @@ ARCS.__lib__` | ... | @@ -132,12 +132,12 @@ ARCS.__lib__` |
132 | "transformation" | 132 | "transformation" |
133 | ] | 133 | ] |
134 | } | 134 | } |
135 | - } | 135 | + }, |
136 | "dependencies": ["three"], | 136 | "dependencies": ["three"], |
137 | "recipes": [ | 137 | "recipes": [ |
138 | { | 138 | { |
139 | "from": "node_modules/three/build/three.module.js", | 139 | "from": "node_modules/three/build/three.module.js", |
140 | - "to": "../deps/three.js/index.js" | 140 | + "to": "deps/three.js/index.js" |
141 | } | 141 | } |
142 | ] | 142 | ] |
143 | } | 143 | } | ... | ... |
... | @@ -119,24 +119,24 @@ ARCS.__lib__` | ... | @@ -119,24 +119,24 @@ ARCS.__lib__` |
119 | "keywords": ["OBJ", "3D", "model"] | 119 | "keywords": ["OBJ", "3D", "model"] |
120 | } | 120 | } |
121 | }, | 121 | }, |
122 | - "dependencies": [ "three.js"], | 122 | + "dependencies": [ "three"], |
123 | "recipes": [ | 123 | "recipes": [ |
124 | { | 124 | { |
125 | "from": "node_modules/three/build/three.module.js", | 125 | "from": "node_modules/three/build/three.module.js", |
126 | - "to": "../deps/three.js/index.js" | 126 | + "to": "deps/three.js/index.js" |
127 | }, | 127 | }, |
128 | { | 128 | { |
129 | "from": "node_modules/three/examples/jsm/loaders/OBJLoader.js", | 129 | "from": "node_modules/three/examples/jsm/loaders/OBJLoader.js", |
130 | - "to": "../deps/objloader/index.js", | 130 | + "to": "deps/objloader/index.js", |
131 | "replace" : { | 131 | "replace" : { |
132 | - '../../../build/three.module.js': '../three.js/index.js' | 132 | + "../../../build/three.module.js": "../three.js/index.js" |
133 | } | 133 | } |
134 | }, | 134 | }, |
135 | { | 135 | { |
136 | "from": "node_modules/three/examples/jsm/loaders/MTLLoader.js", | 136 | "from": "node_modules/three/examples/jsm/loaders/MTLLoader.js", |
137 | - "to": "../deps/mtlloader/index.js", | 137 | + "to": "deps/mtlloader/index.js", |
138 | "replace" : { | 138 | "replace" : { |
139 | - '../../../build/three.module.js': '../three.js/index.js' | 139 | + "../../../build/three.module.js": "../three.js/index.js" |
140 | } | 140 | } |
141 | } | 141 | } |
142 | ] | 142 | ] | ... | ... |
... | @@ -61,11 +61,11 @@ ARCS.__lib__` | ... | @@ -61,11 +61,11 @@ ARCS.__lib__` |
61 | "transformation" | 61 | "transformation" |
62 | ] | 62 | ] |
63 | } | 63 | } |
64 | - } | 64 | + }, |
65 | "dependencies": ["three"], | 65 | "dependencies": ["three"], |
66 | "recipes": { | 66 | "recipes": { |
67 | - "from": "node_modules/three/build/three.module.js", | 67 | + "from": "node_modules/three/three.module.js", |
68 | - "to": "../deps/three.js/index.js" | 68 | + "to": "deps/three.js/index.js" |
69 | } | 69 | } |
70 | } | 70 | } |
71 | `; | 71 | `; | ... | ... |
... | @@ -84,7 +84,7 @@ ARCS.__lib__` | ... | @@ -84,7 +84,7 @@ ARCS.__lib__` |
84 | }, | 84 | }, |
85 | "dependencies": [ "jsqr"], | 85 | "dependencies": [ "jsqr"], |
86 | "recipes": [ | 86 | "recipes": [ |
87 | - { "from": "node_modules/jsqr/dist/jsQR.js", "to": "../deps/jsqr/jsQR.js"} | 87 | + { "from": "node_modules/jsqr/dist/jsQR.js", "to": "deps/jsqr/jsQR.js"} |
88 | ] | 88 | ] |
89 | }`; | 89 | }`; |
90 | */ | 90 | */ |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -194,7 +194,7 @@ ARCS.__lib__` | ... | @@ -194,7 +194,7 @@ ARCS.__lib__` |
194 | "dependencies": [ "three" ], | 194 | "dependencies": [ "three" ], |
195 | "recipes": { | 195 | "recipes": { |
196 | "from": "node_modules/three/build/three.module.js", | 196 | "from": "node_modules/three/build/three.module.js", |
197 | - "to": "../deps/three.js/index.js" | 197 | + "to": "deps/three.js/index.js" |
198 | } | 198 | } |
199 | } | 199 | } |
200 | `; | 200 | `; | ... | ... |
... | @@ -170,7 +170,7 @@ ARCS.__lib__` | ... | @@ -170,7 +170,7 @@ ARCS.__lib__` |
170 | "dependencies": [ "three" ], | 170 | "dependencies": [ "three" ], |
171 | "recipes": { | 171 | "recipes": { |
172 | "from": "node_modules/three/build/three.module.js", | 172 | "from": "node_modules/three/build/three.module.js", |
173 | - "to": "../deps/three.js/index.js" | 173 | + "to": "deps/three.js/index.js" |
174 | } | 174 | } |
175 | } | 175 | } |
176 | `; | 176 | `; | ... | ... |
... | @@ -216,21 +216,19 @@ ARCS.__lib__` | ... | @@ -216,21 +216,19 @@ ARCS.__lib__` |
216 | } | 216 | } |
217 | }, | 217 | }, |
218 | "dependencies": ["three"], | 218 | "dependencies": ["three"], |
219 | - "recipes": { | 219 | + "recipes": [ |
220 | - "recipes": [ | 220 | + { |
221 | - { | 221 | + "from": "node_modules/three/build/three.module.js", |
222 | - "from": "node_modules/three/build/three.module.js", | 222 | + "to": "deps/three.js/index.js" |
223 | - "to": "../deps/three.js/index.js" | 223 | + }, |
224 | - }, | 224 | + { |
225 | - { | 225 | + "from": "node_modules/three/examples/jsm/webxr/ARButton.js", |
226 | - "from": "node_modules/three/examples/jsm/webxr/ARButton.js", | 226 | + "to": "deps/three.js/ARButton.js", |
227 | - "to": "../deps/three.js/ARButton.js", | 227 | + "replace": { |
228 | - "replace": { | 228 | + "../../../build/three.module.js": "./index.js" |
229 | - "../../../build/three.module.js": "./index.js" | ||
230 | - } | ||
231 | } | 229 | } |
232 | - ] | 230 | + } |
233 | - } | 231 | + ] |
234 | } | 232 | } |
235 | `; | 233 | `; |
236 | */ | 234 | */ |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment