浏览代码

feat(Build): Add VexFlow Patch script (#888)

* add prebuild script: copy vexflow patch files (add fse-cli, WIP)

fse-cli and fse copy works on Windows,
though fse-cli comes with a 117MB node_modules subfolder right now.
this should be patched, issue is already created there.

prebuild is executed automatically before build by npm.

* vexflow patch script: replace fse-cli with ncp

ncp node_modules folder is only 48KB compared to 118MB of fse-cli
Simon 4 年之前
父节点
当前提交
5e27ea1fe1
共有 4 个文件被更改,包括 4 次插入3 次删除
  1. 3 1
      package.json
  2. 1 2
      src/VexFlowPatch/readme.txt
  3. 0 0
      src/VexFlowPatch/src/stavevolta.js
  4. 0 0
      src/VexFlowPatch/src/tabnote.js

+ 3 - 1
package.json

@@ -11,6 +11,7 @@
     "lint": "npm-run-all tslint eslint",
     "test": "karma start --single-run --no-auto-watch",
     "test:watch": "karma start --no-single-run --auto-watch --browsers ChromeNoSecurity",
+    "prebuild": "ncp src/VexFlowPatch/src/ node_modules/vexflow/src/",
     "prepare": "npm run build",
     "build": "npm-run-all lint build:webpack",
     "build:doc": "cross-env STATIC_FILES_SUBFOLDER=sheets npm run build",
@@ -97,12 +98,13 @@
     "karma-webpack": "^4.0.2",
     "karma-xml2js-preprocessor": "^0.0.3",
     "mocha": "^7.0.1",
+    "ncp": "^2.0.0",
     "npm-run-all": "^4.1.2",
     "pre-commit": "^1.2.2",
+    "svg2pdf.js": "^1.5.0",
     "ts-loader": "^4.1.0",
     "tslint": "^5.14.0",
     "tslint-loader": "^3.5.4",
-    "svg2pdf.js": "^1.5.0",
     "typedoc": "^0.17.3",
     "typescript": "^3.9.5",
     "webpack": "^4.43.0",

+ 1 - 2
src/VexFlowPatch/readme.txt

@@ -1,6 +1,5 @@
 These files are custom patches for the currently installed vexflow version.
-They should be copied to ../../node_modules/vexflow/src/
-This will be done by a pre-build script soon, but for now has to be done manually.
+They are copied by the npm prebuild script to ../../node_modules/vexflow/src/ before a build.
 
 stavevolta.js:
 Fix the length of voltas for first measures in a system

+ 0 - 0
src/VexFlowPatch/stavevolta.js → src/VexFlowPatch/src/stavevolta.js


+ 0 - 0
src/VexFlowPatch/tabnote.js → src/VexFlowPatch/src/tabnote.js