Add global jsonrpc ref for umd bundle and fix webpack warning
closes #15 closes #16
@zensh, could you review this PR?
There's a bit trouble: microbundle > rollup-plugin-alias > slash "^3.0.0" that requires node >=8.
@antongolub Could you remove microbundle ?
Oh... build task requires microbundle to produce the all variety of packages: .js, .mjs, .umd.js and its maps. I'll try to separate build and test stages and assign proper runtime versions for each of them.
Travis-ci has ability to cache directories between jobs/stages. But I cannot to make this feature work( This is very similar to issue #9814
Here's the config:
language: node_js
sudo: false
install: skip
before_install: skip
before_script: skip
script: skip
cache:
directories:
- ./target
- target
- node_modules
stages:
- build
- test
jobs:
include:
- stage: build
node_js:
- "12"
install:
- yarn install
- yarn build
script: skip
- stage: test
node_js:
- "6"
- "8"
- "10"
- "12"
- "13"
install: skip
before_install: skip
before_script: skip
script:
- yarn test
build stage adds files to target dir, but store build cache finds that "nothing changed" 604485316. So the next test stage outputs:
/home/travis/build/teambition/jsonrpc-lite/target
/home/travis/build/teambition/jsonrpc-lite/target is not yet cached
Any thoughts?
"There is one cache per branch and language version" #caches-and-build-matrices
@zensh, it seems there's no easy way to share target from nodejs_8 build stage for nodejs_6 test suite.
@zensh And finally it works. I just raise NodeJs version at the build stage and return it back after. So the test validates bundles against v6.
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "6" ] ; then nvm use 8 ; fi ;'
- yarn install
- yarn build
- 'if [ "${TRAVIS_NODE_VERSION}" = "6" ] ; then nvm use "${TRAVIS_NODE_VERSION}" && node --version ; fi ;'
script:
- yarn test
@zensh, any objections?
@antongolub Hi, I don't like microbundle.
Ok... I'll try find another solution, but not right now.
@zensh, I've replaced microbundle with several tsc scripts, amd and global polyfills.
What's the latest here? Anything stopping this PR getting merged?