Prepare npm package.

This commit is contained in:
kovacsv 2022-05-20 22:06:02 +02:00
parent 3b88a6c37e
commit 12c0f7df8d
8 changed files with 34 additions and 35 deletions

21
.github/workflows/npm_publish.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: NPM Publish
on:
push:
tags:
- '*'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run create_dist
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 Arjun Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because one or more lines are too long

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "online-3d-viewer",
"version": "0.8.11",
"version": "0.8.11-beta2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "online-3d-viewer",
"version": "0.8.11",
"version": "0.8.11-beta2",
"license": "MIT",
"dependencies": {
"@simonwep/pickr": "1.8.2",

View File

@ -1,10 +1,16 @@
{
"name": "online-3d-viewer",
"description": "Online 3D Viewer",
"version": "0.8.11",
"version": "0.8.11-beta2",
"repository": "github:kovacsv/Online3DViewer",
"license": "MIT",
"type": "module",
"module": "./build/o3dv.min.esm.js",
"files": [
"build/o3dv.min.js",
"build/o3dv.min.esm.js",
"libs/loaders/*"
],
"scripts": {
"start": "http-server",
"test": "mocha test",
@ -15,11 +21,11 @@
"generate_icon_font": "node tools/run_python.js tools/generate_icon_font.py",
"update_engine_exports": "node tools/run_python.js tools/update_engine_exports.py",
"create_dist": "npm run create_package && npm run lint && npm run test",
"create_package": "npm run build_engine_prod && npm run build_website_prod && npm run build_css_prod && npm run lint && node tools/run_python.js tools/create_package.py",
"build_dev": "npm run build_engine_dev && npm run build_website_dev",
"create_package": "npm run build_engine_prod && npm run build_engine_prod_esm && npm run build_website_prod && npm run build_css_prod && node tools/run_python.js tools/create_package.py",
"build_css_prod": "cleancss -o build/o3dv.website.min.css website/css/*",
"build_engine_dev": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --sourcemap --outfile=build/o3dv.min-dev.js",
"build_engine_prod": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --global-name=OV --outfile=build/o3dv.min.js",
"build_engine_prod_esm": "npm run update_engine_exports && esbuild source/engine/main.js --bundle --minify --format=esm --outfile=build/o3dv.min.esm.js",
"build_website_dev": "esbuild source/website/index.js --bundle --minify --global-name=OV --sourcemap --outfile=build/o3dv.website.min-dev.js",
"build_website_prod": "esbuild source/website/index.js --bundle --minify --global-name=OV --outfile=build/o3dv.website.min.js"
},

View File

@ -1,6 +1,6 @@
import { RunTasksBatch } from '../core/taskrunner.js';
import { IsEqual } from '../geometry/geometry.js';
import { CreateObjectUrl, CreateObjectUrlWithMimeType } from '../main.js';
import { CreateObjectUrl, CreateObjectUrlWithMimeType } from '../io/bufferutils.js';
import { MaterialType } from '../model/material.js';
import { MeshInstanceId } from '../model/meshinstance.js';
import { GetMeshType, MeshType } from '../model/meshutils.js';

View File

@ -1,6 +1,6 @@
import { Direction } from '../geometry/geometry.js';
import { Importer } from '../import/importer.js';
import { RevokeObjectUrl } from '../main.js';
import { RevokeObjectUrl } from '../io/bufferutils.js';
import { ConvertModelToThreeObject, ModelToThreeConversionOutput, ModelToThreeConversionParams } from './threeconverter.js';
import { ConvertColorToThreeColor, HasHighpDriverIssue } from './threeutils.js';

View File

@ -18,11 +18,6 @@ rhino3dmFileMap = [
[os.path.join ('rhino3dm', 'rhino3dm.wasm'), os.path.join ('loaders', 'rhino3dm.wasm')],
]
fflateFileMap = [
[os.path.join ('fflate', 'LICENSE'), os.path.join ('loaders', 'fflate.license.md')],
[os.path.join ('fflate', 'umd', 'index.js'), os.path.join ('loaders', 'fflate.min.js')],
]
webIfcFileMap = [
[os.path.join ('web-ifc', 'web-ifc-api-browser.js'), os.path.join ('loaders', 'web-ifc-api-browser.js')],
[os.path.join ('web-ifc', 'web-ifc.wasm'), os.path.join ('loaders', 'web-ifc.wasm')],
@ -59,7 +54,6 @@ def Main (argv):
UpdateModule (pickrFileMap, nodeModulesDir, libsDir)
UpdateModule (dracoFileMap, nodeModulesDir, libsDir)
UpdateModule (rhino3dmFileMap, nodeModulesDir, libsDir)
UpdateModule (fflateFileMap, nodeModulesDir, libsDir)
UpdateModule (webIfcFileMap, nodeModulesDir, libsDir)
UpdateModule (occtImportJsFileMap, nodeModulesDir, libsDir)