Skip to content

Commit

Permalink
Merge branch 'dojo-webpack-plugin' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuels committed Mar 8, 2018
2 parents 4be101e + d25b513 commit d1e4976
Show file tree
Hide file tree
Showing 156 changed files with 13,615 additions and 2,362 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
package-lock.json binary
16 changes: 1 addition & 15 deletions .gitignore
Expand Up @@ -20,20 +20,6 @@ samtools-master/
samtools-0.1.20
setup.log
MYMETA.*
src/FileSaver/
src/dbind/
src/dgrid/
src/dijit/
src/dojo/
src/dojox/
src/jDataView/
src/json-schema/
src/jszlib/
src/lazyload/
src/put-selector/
src/util/
src/xstyle/
src/dstore/
node_modules
.idea/**
/nbproject/private/
Expand All @@ -42,11 +28,11 @@ _Inline
.DS_Store
blib
pm_to_blib
bower_components
src/dojo-themes
themes/*/css
.sass-cache
.vscode/
*driver.log
JBrowse-*/
JBrowse-*.zip
dist/
3 changes: 2 additions & 1 deletion .jshintrc
Expand Up @@ -8,6 +8,7 @@
"browser": true,
"dojo": true,
"evil": true, // allow eval
"esversion": 6,
"laxbreak": true,
"laxcomma": true,
"loopfunc": true,
Expand All @@ -17,7 +18,7 @@
"shadow": true,
"maxerr": 250,
"sub": true,
"predef": [ "require", "define", "electronRequire" ],
"predef": [ "require", "define", "electronRequire", "cjsRequire", "dojoConfig" ],
"maxcomplexity": 40,
"indent": 2,
"undef": true,
Expand Down
37 changes: 37 additions & 0 deletions .npmignore
@@ -0,0 +1,37 @@
*~
/data/
.#*
\#*\#
*.index
*.pyc
*TODO.txt
Makefile
/sample_data/json
/docs/jsdoc/
/*-debug.html
/extlib*
autom4te.cache
sample_data/raw/tomato
sample_data/raw/yeast_chr1+2/yeast.fa
/.prove
/setup.log
/release-notes.html
samtools-master/
samtools-0.1.20
setup.log
MYMETA.*
node_modules
.idea/**
/nbproject/private/
*.swp
_Inline
.DS_Store
blib
pm_to_blib
src/dojo-themes
themes/*/css
.sass-cache
.vscode/
*driver.log
JBrowse-*/
JBrowse-*.zip
27 changes: 13 additions & 14 deletions .travis.yml
Expand Up @@ -42,25 +42,24 @@ script:
- if [[ "x$TRAVIS_TAG" != "x" ]]; then build/set_package_versions.pl $TRAVIS_TAG src/JBrowse/package.json package.json; fi
- RELEASE_VERSION=`node -e 'require("fs").readFile("src/JBrowse/package.json", (e,d)=>console.log(JSON.parse(d).version))'`
- BUILD_DIR=$PWD
# if we are building for inclusion into the `dev` branch, run the minification and test against that
- ./setup.sh
- prove -Isrc/perl5 -r -j3 tests/perl_tests;
- utils/jb_run.js -p 9000 & sleep 2
- node_modules/.bin/phantomjs tests/js_tests/run-jasmine.js http://localhost:9000/tests/js_tests/index.html
- MOZ_HEADLESS=1 SELENIUM_BROWSER=firefox JBROWSE_URL=http://localhost:9000/index.html tests/selenium_tests/travis_wrapper.sh;
# if we are building for inclusion into the `dev` branch, build the releases and test the minimal one too
- |
if [[ "x$TRAVIS_TAG" != "x" || $TRAVIS_BRANCH = "master" || $TRAVIS_BRANCH = "dev" || $TRAVIS_PULL_REQUEST != "false" ]]; then
make -f build/Makefile release;
if [[ "x$TRAVIS_TAG" != "x" || $TRAVIS_BRANCH = "dojo-webpack-plugin" || $TRAVIS_BRANCH = "dev" || $TRAVIS_PULL_REQUEST != "false" ]]; then
make -f build/Makefile;
rm -rf JBrowse-*/;
unzip -q JBrowse-$RELEASE_VERSION.zip;
cp -r tests/ JBrowse-$RELEASE_VERSION/;
cd JBrowse-$RELEASE_VERSION/;
cp -r ../tests/ .;
./setup.sh;
prove -Isrc/perl5 -r -j3 tests/perl_tests;
cd $BUILD_DIR;
MOZ_HEADLESS=1 SELENIUM_BROWSER=firefox NOSEOPTS="-I jasmine" JBROWSE_URL=http://localhost:9000/JBrowse-$RELEASE_VERSION/index.html tests/selenium_tests/travis_wrapper.sh;
fi
- ./setup.sh legacy;
- prove -Isrc/perl5 -r -j3 tests/perl_tests;
- utils/jb_run.js -p 9000 & sleep 2
- phantomjs tests/js_tests/run-jasmine.js http://localhost:9000/tests/js_tests/index.html
- MOZ_HEADLESS=1 SELENIUM_BROWSER=firefox JBROWSE_URL=http://localhost:9000/index.html tests/selenium_tests/travis_wrapper.sh;
- cd $BUILD_DIR
after_failure:
- cat JBrowse-*/setup.log
- find JBrowse-*/extlib/lib/perl5
- cat JBrowse-*/src/build-report.txt
deploy:
# upload both minified and non-minified builds to GitHub releases
- provider: releases
Expand Down
48 changes: 36 additions & 12 deletions bin/cpanm

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions bower.json

This file was deleted.

87 changes: 21 additions & 66 deletions build/Makefile
Expand Up @@ -2,9 +2,9 @@ BASEDIR = $(PWD)

JSDIR = $(BASEDIR)/src/JBrowse
PLUGINDIR = $(BASEDIR)/plugins
JS_SRCFILES = $(shell find $(JSDIR)/ -type f -and -name '*.js')
JS_SRCFILES = $(shell find $(JSDIR) -type f -and -name '*.js')

CSS_SRCFILES = $(shell find $(BASEDIR)/ -type f -and -name '*.css')
CSS_SRCFILES = $(shell find $(BASEDIR) -type f -and -name '*.css')

RELEASE_VERSION = $(shell node -e 'require("fs").readFile("$(JSDIR)/package.json", function(e,d){console.log(JSON.parse(d).version)})')
RELEASE_NAME = JBrowse-$(RELEASE_VERSION)
Expand All @@ -14,31 +14,26 @@ RELEASE_MIN = $(RELEASE_NAME)
RELEASE_MIN_DIR = $(BASEDIR)/$(RELEASE_MIN)/
RELEASE_DESKTOP_OSX = $(RELEASE_NAME)-desktop-osx
RELEASE_DESKTOP_WIN = $(RELEASE_NAME)-desktop-win
#RELEASE_DESKTOP_LINUX = $(RELEASE_NAME)-desktop-linux
RELEASE_DESKTOP_LINUX = $(RELEASE_NAME)-desktop-linux

ZIP=zip -q --symlinks -r
UNZIP=unzip -q
SHASUM=shasum


all: docs
all: clean release-dev release-min

release-version.txt:
echo $(RELEASE_VERSION) > release-version.txt

release: release-version.txt release-normal release-min release-notes.html
release: release-dev release-min release-notes.html
ls -lh *.zip
$(SHASUM) *.zip

release-notest: release

release-electron-darwin: release-notest
release-electron-darwin: release
cd $(RELEASE_MIN)&&./setup.sh legacy&&cd ..
npm install
electron-packager $(RELEASE_MIN) JBrowseDesktop --platform=darwin --arch=x64
$(ZIP) $(RELEASE_DESKTOP_OSX).zip JBrowseDesktop-darwin-x64

release-electron-all: release-notest
release-electron-all: release
echo "Building desktop packages..."
cd $(RELEASE_MIN)&&./setup.sh legacy&&cd ..
npm install
Expand All @@ -60,60 +55,27 @@ release-notes.html: release-notes.txt
node_modules:
npm install

release-normal: superclean $(JS_SRCFILES) node_modules
release-dev: $(JS_SRCFILES) node_modules
rm -rf dist
mkdir $(RELEASE_FULL_DIR);
cp -R `ls -1d * | grep -v $(RELEASE_FULL)` $(RELEASE_FULL_DIR);
rm -rf $(RELEASE_FULL_DIR)/src/*/.git $(RELEASE_FULL_DIR)/$(RELEASE_FULL) $(RELEASE_FULL_DIR)/src/util $(RELEASE_FULL_DIR)/build $(RELEASE_FULL_DIR)/node_modules;
rm -rf $(RELEASE_FULL_DIR)/src/*/.git $(RELEASE_FULL_DIR)/$(RELEASE_FULL) $(RELEASE_FULL_DIR)/src/util $(RELEASE_FULL_DIR)/node_modules $(RELEASE_FULL_DIR)/extlib;

# zip up the dev release
$(ZIP) $(RELEASE_FULL).zip $(RELEASE_FULL)/;

PLUGINS = $(wildcard $(PLUGINDIR)/*)

plugins-min: release-normal
for pdir in $(PLUGINS); do \
pname=`basename $$pdir`; \
node $(BASEDIR)/src/dojo/dojo.js load=build \
--require "$(JSDIR)/init.js" \
--profile "$$pdir/js/$$pname" \
--releaseDir "$(RELEASE_FULL_DIR)/plugins/$$pname/built" \
2>&1 | grep -v '^warn'; \
rm -rf "$(RELEASE_FULL_DIR)/plugins/$$pname/js"; \
mv "$(RELEASE_FULL_DIR)/plugins/$$pname/built/$$pname" "$(RELEASE_FULL_DIR)/plugins/$$pname/js"; \
rm -rf "$(RELEASE_FULL_DIR)/plugins/$$pname/built"; \
rm -rf "$(RELEASE_FULL_DIR)/plugins/$$pname/.git"; \
done

release-min: release-normal plugins-min

# run the dojo build in the full dir to minify
node src/dojo/dojo.js \
load=build \
--require "$(JSDIR)/init.js" \
--profile "$(JSDIR)/JBrowse.profile.js" \
--releaseDir "$(RELEASE_FULL_DIR)/src" \
2>&1 | grep -v '^warn';

release-min: $(JS_SRCFILES) node_modules
cp -a $(RELEASE_FULL_DIR) $(RELEASE_MIN_DIR);

for P in src docs/jsdoc tests tests_extended build node_modules; do \
for P in src browser css docs/jsdoc tests build node_modules extlib dist; do \
rm -rf $(RELEASE_MIN_DIR)$$P; \
done;
for P in src/dojo/dojo.js \
`find src/ -name nls -and -type d -and -not -wholename '*/tests/*' | grep -v src/dojox/grid` \
src/dojo/resources \
src/dojox/grid \
src/dojox/gfx/vml.js \
src/dojox/form/resources \
src/dojox/gfx/vml_attach.js \
src/dijit/themes/tundra \
src/dijit/form/templates \
src/dijit/icons \
src/dijit/templates \
src/JBrowse \
src/perl5 \
src/dgrid/css \
src/jDataView \

rm -rf dist
JBROWSE_BUILD_MIN=1 npm run build
cp -r dist $(RELEASE_MIN_DIR)

for P in src/perl5 \
; do \
mkdir -p `dirname $(RELEASE_MIN_DIR)$$P`; \
if [ -d $$P ]; then \
Expand All @@ -123,17 +85,10 @@ release-min: release-normal plugins-min
fi;\
done

cp -r $(RELEASE_MIN_DIR)/src/dojo/nls $(RELEASE_MIN_DIR)/src/nls;

find $(RELEASE_MIN_DIR) -name '*.uncompressed.js' -or -name '*.consoleStripped.js' -exec rm {} ';'

# zip it up
# zip it up
$(ZIP) $(RELEASE_MIN).zip $(RELEASE_MIN)/;

superclean: clean
git clean -fdxq --exclude=./plugins

clean:
rm -rf docs/jsdoc *-min.js release-notes.html;
git clean -ffdxq --exclude=/plugins/ --exclude=/node_modules/ --exclude=/extlib/

.PHONY: all clean superclean jbrowse docs doc release release-min release-normal plugins-min
.PHONY: all clean jbrowse docs doc release release-min release-dev plugins-min
65 changes: 65 additions & 0 deletions build/dojo-loader-config.js
@@ -0,0 +1,65 @@
const path = require('path')
const glob = require('glob')

const {getPluginName} = require('./plugin-util')

module.exports = function(env) {

dojoConfig = {
baseUrl: '.',
packages: [
{
name: 'dojo',
location: env.dojoRoot + '/dojo',
},
{
name: 'dijit',
location: env.dojoRoot + '/dijit',
},
{
name: 'dojox',
location: env.dojoRoot + '/dojox',
},
{
name: 'JBrowse',
location: 'src/JBrowse',
lib: '.'
},
{
name: 'dgrid',
location: env.dojoRoot + '/dgrid',
lib: '.'
},
{
name: 'dstore',
location: env.dojoRoot + '/dojo-dstore',
lib: '.'
},
{
name: 'jszlib',
location: env.dojoRoot + '/jszlib',
lib: '.'
},
{
name: 'FileSaver',
location: env.dojoRoot + '/filesaver.js',
lib: '.'
}
]
.concat(
glob.sync('plugins/*/')
.concat(
glob.sync('node_modules/**/*-jbrowse-plugin/')
)
.map( pluginDir => ({
name: getPluginName(pluginDir),
pluginDir,
location: pluginDir+'js'
}))
)
,

async: true
};
return dojoConfig;
};

0 comments on commit d1e4976

Please sign in to comment.