Showing
6 changed files
with
38 additions
and
9 deletions
... | @@ -7,7 +7,8 @@ module.exports = function (grunt) { | ... | @@ -7,7 +7,8 @@ module.exports = function (grunt) { |
7 | copy: { | 7 | copy: { |
8 | dist: { | 8 | dist: { |
9 | files:[ | 9 | files:[ |
10 | - {src: 'src/arcs_browser.js', dest: 'build/arcs_browser.js'} | 10 | + {src: 'src/arcs_browser.js', dest: 'build/arcs_browser.js'}, |
11 | + {src: 'src/arcs_node.mjs', dest: 'build/arcs_node.mjs'} | ||
11 | ] | 12 | ] |
12 | 13 | ||
13 | } | 14 | } | ... | ... |
... | @@ -10,7 +10,6 @@ | ... | @@ -10,7 +10,6 @@ |
10 | "author": "Jean-Yves Didier", | 10 | "author": "Jean-Yves Didier", |
11 | "license": "GPL", | 11 | "license": "GPL", |
12 | "dependencies": { | 12 | "dependencies": { |
13 | - "requirejs": "*", | ||
14 | "tracking.js": "*", | 13 | "tracking.js": "*", |
15 | "three.js": "https://raw.githubusercontent.com/mrdoob/three.js/r68/build/three.min.js", | 14 | "three.js": "https://raw.githubusercontent.com/mrdoob/three.js/r68/build/three.min.js", |
16 | "objloader" : "https://raw.githubusercontent.com/mrdoob/three.js/r68/examples/js/loaders/OBJLoader.js", | 15 | "objloader" : "https://raw.githubusercontent.com/mrdoob/three.js/r68/examples/js/loaders/OBJLoader.js", | ... | ... |
build/package.json
0 → 100644
1 | +{ "type": "module"} |
components/package.json
0 → 100644
1 | +{ "type": "module"} |
src/arcs_node.js
deleted
100644 → 0
src/arcs_node.mjs
0 → 100644
1 | +#!/usr/bin/env -S node --experimental-modules --experimental-json-modules | ||
2 | + | ||
3 | +import ARCS from './arcs.js'; | ||
4 | +import process from 'process'; | ||
5 | +import path from 'path'; | ||
6 | +import fs from 'fs'; | ||
7 | +//import application from './appli.json'; | ||
8 | + | ||
9 | +function usage() { | ||
10 | + let sp = process.argv[1].lastIndexOf(path.delimiter); | ||
11 | + console.log("usage:"); | ||
12 | + console.log("\t", | ||
13 | + process.argv[1], | ||
14 | + "description.json" | ||
15 | + ); | ||
16 | +} | ||
17 | + | ||
18 | +if (process.argv.length < 3) { | ||
19 | + usage(); | ||
20 | + process.exit(1); | ||
21 | +} | ||
22 | + | ||
23 | + | ||
24 | +var appDescription = fs.readFileSync(process.argv[2]); | ||
25 | +if (appDescription === '') { | ||
26 | + console.error("File '"+process.argv[2]+"' is empty."); | ||
27 | + process.exit(2); | ||
28 | +} | ||
29 | + | ||
30 | +var application = JSON.parse(appDescription); | ||
31 | + | ||
32 | +var aap = new ARCS.Application(); | ||
33 | +aap.import(application); | ||
34 | +aap.start(); |
-
Please register or login to post a comment