opencb / jsorolla

JSorolla is a JavaScript Library for biological and genomic data visualization
http://docs.opencb.org/display/jsorolla
Apache License 2.0
42 stars 29 forks source link

Unable to build #157

Open mattjvincent opened 3 years ago

mattjvincent commented 3 years ago

Describe the bug

Unable to build jsorolla master branch

To Reproduce

Steps to reproduce the behavior:

git clone -b master https://github.com/opencb/jsorolla.git cd jsorolla npm install npm run build

jsorolla@2.0.1 build npm run build-clean && npm run dist && npm run build-genome-browser

jsorolla@2.0.1 build-clean rm -rf build

jsorolla@2.0.1 dist npm run clean && mkdir -p dist/js && npm install && npm run core && npm run genome-browser && npm run styles

jsorolla@2.0.1 clean rm -rf dist

npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'bootstrap-3-typeahead@4.0.2', npm WARN EBADENGINE required: { node: '~0.10.1' }, npm WARN EBADENGINE current: { node: 'v12.16.2', npm: '7.16.0' } npm WARN EBADENGINE }

jsorolla@2.0.1 prepare pika-web

✔ @pika/web installed: lit-element. [0.18s]

up to date, audited 1896 packages in 4s

53 vulnerabilities (9 low, 19 moderate, 25 high)

To address issues that do not require attention, run: npm audit fix

To address all issues possible (including breaking changes), run: npm audit fix --force

Some issues need review, and may require choosing a different dependency.

Run npm audit for details.

jsorolla@2.0.1 core mkdir -p dist/js/core && cd src/core && cat .js cache/.js webcomponents/.js webcomponents/opencga/.js webcomponents/opencga/commons/.js webcomponents/opencga/variant/.js clients/.js data-source/.js visualisation/.js data-adapter/feature-adapter.js data-adapter/cellbase-adapter.js data-adapter/opencga-adapter.js data-adapter/feature-template-adapter.js widgets/.js > ../../dist/js/core/core.js && cd ../.. && node_modules/uglify-es/bin/uglifyjs dist/js/core/core.js -o dist/js/core/core.min.js && npm run webcomponents

cat: webcomponents/opencga/commons/.js: No such file or directory cat: webcomponents/opencga/variant/.js: No such file or directory`

Expected behavior A clean build

Desktop (please complete the following information):

Additional context Even when removing the following directories:

cat: webcomponents/opencga/commons/.js: No such file or directory cat: webcomponents/opencga/variant/.js: No such file or directory

from the build, the following error occurs:

jsorolla@2.0.1 core mkdir -p dist/js/core && cd src/core && cat .js cache/.js webcomponents/.js clients/.js data-source/.js visualisation/.js data-adapter/feature-adapter.js data-adapter/cellbase-adapter.js data-adapter/opencga-adapter.js data-adapter/feature-template-adapter.js widgets/*.js > ../../dist/js/core/core.js && cd ../.. && node_modules/uglify-es/bin/uglifyjs dist/js/core/core.js -o dist/js/core/core.min.js && npm run webcomponents

Parse error at dist/js/core/core.js:3329,88 value = subfields.slice(0, i + 1).reduce((res, prop) => res?.[prop], o ^ ERROR: Unexpected token: punc (.) at JS_Parse_Error.get (eval at (/Users/mvincent/work/GENOMEBROWSERS/jsorolla/node_modules/uglify-es/tools/node.js:21:1), :77:23) at fatal (/Users/mvincent/work/GENOMEBROWSERS/jsorolla/node_modules/uglify-es/bin/uglifyjs:273:53) at run (/Users/mvincent/work/GENOMEBROWSERS/jsorolla/node_modules/uglify-es/bin/uglifyjs:230:9) at Object. (/Users/mvincent/work/GENOMEBROWSERS/jsorolla/node_modules/uglify-es/bin/uglifyjs:160:5) at Module._compile (internal/modules/cjs/loader.js:1156:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10) at Module.load (internal/modules/cjs/loader.js:1000:32) at Function.Module._load (internal/modules/cjs/loader.js:899:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)

antonioaltamura commented 3 years ago

Hello Matt, thanks for using Opencb products. At the moment it is not possible to build a standalone version of Jsorolla, mostly because we use Webpack in our build pipeline and it doesn't support ES module output for libraries yet (https://github.com/webpack/webpack/issues/2933). If you could provide more details on what your final aim is I would be able to provide more support. Are you trying to use Opencga JS Client or some visualisation component?