diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..cbe49a1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +inputs/ +outputs/ +src/ +.prettierrc diff --git a/bin/mson-three.js b/bin/mson-three.js new file mode 100644 index 0000000..e28744d --- /dev/null +++ b/bin/mson-three.js @@ -0,0 +1 @@ +require('../lib/cli'); diff --git a/package-lock.json b/package-lock.json index 849b379..51734ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,12 @@ "name": "mson-three", "version": "1.0.0", "license": "ISC", + "dependencies": { + "three": "^0.161.0" + }, + "bin": { + "mson-three": "bin/mson-three.js" + }, "devDependencies": { "@types/node": "^20.11.19", "@types/three": "^0.161.2", @@ -17,8 +23,7 @@ "optionalDependencies": { "buffer": "^6.0.3", "canvas": "^2.11.2", - "commander": "^12.0.0", - "three": "^0.161.0" + "commander": "^12.0.0" } }, "node_modules/@mapbox/node-pre-gyp": { @@ -799,8 +804,7 @@ "node_modules/three": { "version": "0.161.0", "resolved": "https://registry.npmjs.org/three/-/three-0.161.0.tgz", - "integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw==", - "optional": true + "integrity": "sha512-LC28VFtjbOyEu5b93K0bNRLw1rQlMJ85lilKsYj6dgTu+7i17W+JCCEbvrpmNHF1F3NAUqDSWq50UD7w9H2xQw==" }, "node_modules/tr46": { "version": "0.0.3", diff --git a/package.json b/package.json index dae15d4..62c4d59 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,20 @@ { "name": "mson-three", "version": "1.0.0", - "description": "", - "main": "index.js", + "description": "Mson to THREE.js utilities", + "main": "lib/index.js", + "types": "lib/index.d.ts", + "exports": { + ".": "./lib/index.js" + }, + "bin": { + "mson-three": "./bin/mson-three.js" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc", - "watch": "tsc -w" + "watch": "tsc -w", + "prepare": "npm run build" }, "keywords": [], "author": "", diff --git a/src/cli.ts b/src/cli.ts index 0f006f6..ba3c5db 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -51,7 +51,7 @@ const program = new Command(); program .name('mson-three') .description('Convert Mson models to THREE.js models (and others)') - .version('0.0.1'); + .version('1.0.0'); program .command('export') @@ -67,6 +67,7 @@ program .option('-t, --target ', 'Path to place outputs into', 'outputs') .action(async (models: string[], options: CliOptions) => { console.log(` ... Reading Mson resources`); + await fillStoreFromFilesystem( store, resolve(process.cwd(), options.store || 'inputs'), diff --git a/tsconfig.json b/tsconfig.json index 8b79461..88530c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -44,7 +44,7 @@ // "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'. */ /* 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. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */