This commit is contained in:
Evert Prants 2024-04-25 17:32:39 +03:00
parent a7c1a6199f
commit d93b1ffaf1
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
6 changed files with 27 additions and 9 deletions

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
inputs/
outputs/
src/
.prettierrc

1
bin/mson-three.js Normal file
View File

@ -0,0 +1 @@
require('../lib/cli');

12
package-lock.json generated
View File

@ -8,6 +8,12 @@
"name": "mson-three", "name": "mson-three",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": {
"three": "^0.161.0"
},
"bin": {
"mson-three": "bin/mson-three.js"
},
"devDependencies": { "devDependencies": {
"@types/node": "^20.11.19", "@types/node": "^20.11.19",
"@types/three": "^0.161.2", "@types/three": "^0.161.2",
@ -17,8 +23,7 @@
"optionalDependencies": { "optionalDependencies": {
"buffer": "^6.0.3", "buffer": "^6.0.3",
"canvas": "^2.11.2", "canvas": "^2.11.2",
"commander": "^12.0.0", "commander": "^12.0.0"
"three": "^0.161.0"
} }
}, },
"node_modules/@mapbox/node-pre-gyp": { "node_modules/@mapbox/node-pre-gyp": {
@ -799,8 +804,7 @@
"node_modules/three": { "node_modules/three": {
"version": "0.161.0", "version": "0.161.0",
"resolved": "https://registry.npmjs.org/three/-/three-0.161.0.tgz", "resolved": "https://registry.npmjs.org/three/-/three-0.161.0.tgz",
"integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw==", "integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw=="
"optional": true
}, },
"node_modules/tr46": { "node_modules/tr46": {
"version": "0.0.3", "version": "0.0.3",

View File

@ -1,12 +1,20 @@
{ {
"name": "mson-three", "name": "mson-three",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "Mson to THREE.js utilities",
"main": "index.js", "main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"bin": {
"mson-three": "./bin/mson-three.js"
},
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc", "build": "tsc",
"watch": "tsc -w" "watch": "tsc -w",
"prepare": "npm run build"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@ -51,7 +51,7 @@ const program = new Command();
program program
.name('mson-three') .name('mson-three')
.description('Convert Mson models to THREE.js models (and others)') .description('Convert Mson models to THREE.js models (and others)')
.version('0.0.1'); .version('1.0.0');
program program
.command('export') .command('export')
@ -67,6 +67,7 @@ program
.option('-t, --target <path>', 'Path to place outputs into', 'outputs') .option('-t, --target <path>', 'Path to place outputs into', 'outputs')
.action(async (models: string[], options: CliOptions) => { .action(async (models: string[], options: CliOptions) => {
console.log(` ... Reading Mson resources`); console.log(` ... Reading Mson resources`);
await fillStoreFromFilesystem( await fillStoreFromFilesystem(
store, store,
resolve(process.cwd(), options.store || 'inputs'), resolve(process.cwd(), options.store || 'inputs'),

View File

@ -44,7 +44,7 @@
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */ /* Emit */
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
// "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */