Explorar o código

chore: updated build infrastructure

Sebastian Haas %!s(int64=7) %!d(string=hai) anos
pai
achega
15510176dd
Modificáronse 4 ficheiros con 17 adicións e 16 borrados
  1. 5 3
      bin/publish_gh_page.sh
  2. 7 11
      package.json
  3. 2 1
      webpack.common.js
  4. 3 1
      webpack.prod.js

+ 5 - 3
bin/publish_gh_page.sh

@@ -1,8 +1,8 @@
 #!/bin/bash
 
 # Prepare files to be published
-npm run docs
 npm run build
+npm run docs
 
 # Clone github page
 git clone git@github.com:opensheetmusicdisplay/opensheetmusicdisplay.github.io.git
@@ -10,10 +10,12 @@ cd opensheetmusicdisplay.github.io
 git status
 
 # Copy class documentation
-rsync -a ../build/docs/* ./classdoc
+rsync -a ../build/docs/* ./classdoc/
 
 # Copy demo application
-rsync -a ../build/demo/* ./demo
+rsync -a ../build/demo.min.js ./demo/
+rm -rf ./demo/sheets
+rsync -a ../test/data/* ./demo/sheets/
 
 # Commit and push changes
 git status

+ 7 - 11
package.json

@@ -2,10 +2,10 @@
   "name": "opensheetmusicdisplay",
   "version": "0.3.0",
   "description": "An open source JavaScript engine for displaying MusicXML based on VexFlow.",
-  "main": "dist/src/OpenSheetMusicDisplay/OpenSheetMusicDisplay.js",
-  "typings": "dist/src/OpenSheetMusicDisplay/OpenSheetMusicDisplay",
+  "main": "build/opensheetmusicdisplay.min.js",
+  "typings": "build/dist/src/OpenSheetMusicDisplay/OpenSheetMusicDisplay",
   "scripts": {
-    "docs": "typedoc --out ./build/docs --name OpenSheetMusicDisplay --module commonjs --target ES5 --mode file ./src/**/*.ts",
+    "docs": "typedoc --out ./build/docs --name OpenSheetMusicDisplay --module commonjs --target ES5 --ignoreCompilerErrors --mode file ./src",
     "eslint": "eslint .",
     "tslint": "tslint --project tsconfig.json \"src/**/*.ts\" \"test/**/*.ts\"",
     "lint": "npm-run-all eslint tslint",
@@ -23,16 +23,12 @@
     "lint"
   ],
   "files": [
-    "dist",
+    "build/dist/src",
+    "build/opensheetmusicdisplay.min.js",
     "AUTHORS",
     "CHANGELOG.md",
     "README.md",
-    "karma.conf.js",
-    "src",
-    "external",
-    "demo",
-    "tsconfig.json",
-    "tslint.json"
+    "external"
   ],
   "repository": {
     "type": "git",
@@ -93,7 +89,7 @@
     "tsify": "^3.0.0",
     "tslint": "^5.8.0",
     "tslint-loader": "^3.5.3",
-    "typedoc": "^0.10.0",
+    "typedoc": "^0.11.1",
     "typescript": "^2.6.1",
     "uglifyjs-webpack-plugin": "^1.2.4",
     "underscore-template-loader": "^1.0.0",

+ 2 - 1
webpack.common.js

@@ -10,7 +10,8 @@ module.exports = {
     output: {
         path: path.resolve(__dirname, 'build'),
         filename: '[name].js',
-        library: 'opensheetmusicdisplay'
+        library: 'opensheetmusicdisplay',
+        libraryTarget: 'umd'
     },
     resolve: {
         // Add '.ts' and '.tsx' as a resolvable extension.

+ 3 - 1
webpack.prod.js

@@ -13,7 +13,9 @@ var pathsToClean = [
 module.exports = merge(common, {
     output: {
         filename: '[name].min.js',
-        path: path.resolve(__dirname, 'build')
+        path: path.resolve(__dirname, 'build'),
+        library: 'opensheetmusicdisplay',
+        libraryTarget: 'umd'
     },
     mode: 'production',
     optimization: {