Comparing version 0.22.0 to 1.0.0
@@ -12,2 +12,12 @@ # Changelog | ||
## 1.0.0 - 2023-01-13 | ||
### BREAKING CHANGE | ||
webmscore is now built based on MuseScore 4.0! | ||
### Changed | ||
Although there's no public API change comparing to `v0.22.0`, there might be some unintended internal changes or incompatibilities. | ||
## 0.22.0 - 2022-12-31 | ||
@@ -14,0 +24,0 @@ |
{ | ||
"name": "webmscore", | ||
"version": "0.22.0", | ||
"version": "1.0.0", | ||
"description": "MuseScore's libmscore in WebAssembly! Read mscz data, and generate audio/MIDI/MusicXML/SVG/PNG/PDF sheets right in browsers", | ||
@@ -53,5 +53,5 @@ "type": "module", | ||
"bundle": "rollup -c", | ||
"compile": "cd ../ && make release && cd - && mv webmscore.lib.js.mem webmscore.lib.mem.wasm && mv webmscore.lib.js.symbols webmscore.lib.symbols", | ||
"compile": "cd ../web/ && make release && cd - && mv webmscore.lib.js.mem webmscore.lib.mem.wasm && mv webmscore.lib.js.symbols webmscore.lib.symbols", | ||
"postcompile": "perl -pi -e 's/\\\\([0-9a-f]{2})/chr(hex($1))/eg' webmscore.lib.symbols", | ||
"clean": "npm run clean:d-ts && cd ../ && make clean", | ||
"clean": "npm run clean:d-ts && cd ../web/ && make clean", | ||
"clean:d-ts": "rm -f src/*.d.ts *.d.ts", | ||
@@ -58,0 +58,0 @@ "d-ts": "tsc --emitDeclarationOnly --declaration --allowJs --lib esnext --target esnext src/index.js", |
@@ -122,35 +122,26 @@ | ||
3. Get and compile Qt5 for WebAssembly | ||
3. Get Qt5 for WebAssembly and apply patches | ||
```sh | ||
CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || 8) | ||
AQT_PREFIX=$PWD/build.qt5 | ||
Qt5_VER=5.15.2 | ||
Qt5_DIR=${AQT_PREFIX}/${Qt5_VER}/wasm_32 | ||
# if you change the install directory or Qt version, remember to also change the `PREFIX_PATH` variable in `web/Makefile` file | ||
QT_PATH=/usr/qt515 | ||
# If you want to use other directory, make sure you changed `PREFIX_PATH` to your Qt5WASM installation dir in the Makefile | ||
# Download Qt using aqtinstall (https://github.com/miurahr/aqtinstall) | ||
pip install aqtinstall==2.1.* | ||
aqt install-qt linux desktop ${Qt5_VER} wasm_32 --outputdir ${AQT_PREFIX} --archives qtbase | ||
git clone git://code.qt.io/qt/qt5.git --depth=1 -b 5.15.0 $QT_PATH | ||
# or | ||
# download and extract qt-everywhere 5.15.0 (https://download.qt.io/official_releases/qt/5.15/5.15.0/single/) | ||
# # Compile the `offscreen` platform plugin | ||
# aqt install-src linux desktop ${Qt5_VER} --outputdir ${AQT_PREFIX} --archives qtbase | ||
# cd ${AQT_PREFIX}/${Qt5_VER}/Src/qtbase/src/plugins/platforms/offscreen | ||
# ${Qt5_DIR}/bin/qmake offscreen.pro && make | ||
# cd - && cp -r ${AQT_PREFIX}/${Qt5_VER}/Src/qtbase/plugins build/qt/ | ||
cd $QT_PATH | ||
./configure -opensource -confirm-license \ | ||
-xplatform wasm-emscripten \ | ||
-nomake examples -nomake tools \ | ||
-skip qt3d -skip qtconnectivity -skip qtdeclarative -skip qtgamepad -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialbus -skip serialport -skip qtspeech -skip qttools -skip qtwayland -skip qtwebengine \ | ||
-no-accessibility -no-opengl \ | ||
-no-gif -no-ico -no-tiff -no-webp \ | ||
-prefix $PWD/qtbase -optimize-size -static | ||
make -j$CPUS | ||
# Apply patches, which | ||
# enable the prebuilt `offscreen` QPA platform plugin (https://doc.qt.io/qt-5/qpa.html), and | ||
# exclude other Qt5Gui plugins | ||
cp -r build/qt/* ${Qt5_DIR} | ||
# build `offscreen` QPA platform plugin (https://doc.qt.io/qt-5/qpa.html) | ||
cd $QT_PATH/qtbase/src/plugins/platforms/offscreen | ||
$QT_PATH/qtbase/bin/qmake offscreen.pro && make | ||
cd - | ||
# enable the `offscreen` plugin | ||
sed -i -E "s/(PROPERTY QT_PLUGIN_EXTENDS \").*?(\")/\1\2/" $QT_PATH/qtbase/lib/cmake/Qt5Gui/Qt5Gui_QOffscreenIntegrationPlugin.cmake | ||
# exclude other Qt5Gui plugins | ||
sed -i -E "s/\s(\S+?Qt5Gui_)\*(Plugin)?(.*)\)/ \1QOffscreenIntegrationPlugin\3 \1QJpegPlugin\3)/" $QT_PATH/qtbase/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake | ||
# patch emcc.py to emit separate .mem files regardless of MEM_INIT_METHOD settings (MEM_INIT_METHOD won't work with wasm) | ||
# Patch emcc.py to emit separate .mem files regardless of MEM_INIT_METHOD settings (MEM_INIT_METHOD won't work with wasm) | ||
sed -i -r "s/(shared.Settings.MEM_INIT_IN_WASM = )True/\1False/" "$(which emcc).py" | ||
@@ -169,3 +160,5 @@ ``` | ||
```sh | ||
make release | ||
cd web-public | ||
npm i | ||
npm run build | ||
``` | ||
@@ -172,0 +165,0 @@ |
@@ -110,2 +110,9 @@ | ||
/** | ||
* ``` | ||
* metaTag("source") | ||
* ``` | ||
*/ | ||
previousSource: string; | ||
/** | ||
* @todo explanations | ||
@@ -112,0 +119,0 @@ */ |
@@ -109,11 +109,2 @@ | ||
const mscore = new WebMscore(scoreptr) | ||
// temporary workaround for rendering pdf/images from a midi file | ||
if (format === 'midi' || format === 'kar') { | ||
// reload from a mscx file | ||
const buf = await mscore.saveMsc('mscx') | ||
mscore.destroy(true) | ||
return this.load('mscx', buf, [], doLayout) | ||
} | ||
return mscore | ||
@@ -120,0 +111,0 @@ } |
import { createRequire } from 'module' | ||
import { dirname } from 'path' | ||
import { performance } from 'perf_hooks' | ||
import { fileURLToPath } from 'url' | ||
@@ -19,3 +20,5 @@ import { IS_NODE, shimDom } from './utils.js' | ||
global.performance = performance | ||
shimDom() | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
24282833
12033
0
199
16