Skip to content

Commit

Permalink
Merge pull request #1202 from ProjectMirador/2.1.2
Browse files Browse the repository at this point in the history
2.1.2
  • Loading branch information
aeschylus authored Nov 17, 2016
2 parents ef67095 + 5e63102 commit a4a7108
Show file tree
Hide file tree
Showing 40 changed files with 1,228 additions and 483 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ discovery.html
js/discovery
node_modules/
npm-debug.log
reports/
coverage/
data/ecodices
data/BnF
data/Harvard
Expand Down
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
language: node_js
node_js:
- '0.10'
- '5'
before_install:
- npm install
- npm install -g bower
- bower install
# before-script:
# - grunt test cover
script:
Expand Down
10 changes: 4 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Mirador uses [node.js](http://nodejs.org/) and a build system to assemble, test,
2. Install the Grunt command line runner (if you haven't already); on the command line, run `npm install -g grunt-cli`
3. Clone the mirador repository (if you haven't already done so above); `git clone https://github.com/ProjectMirador/mirador.git`
4. On the command line, go into the mirador folder
5. Install all dependencies with `npm install` and `bower install`. Run `grunt`
5. Install all dependencies with `npm install` and `bower install`. Run `npm start`

A good practice is to clone the project into a directory that is being served by a running http server such as apache or nginx. However, if you would like to test and develop without using an external server, you may then run `grunt server`.

Either visit the root folder of the project on your local server, or, if you are using `grunt server`, see the example working at `localhost:8000`.
`npm start` will run a local server that is available at `localhost:8000`.

## How to Contribute
### Making Changes
Expand All @@ -23,15 +21,15 @@ Even small changes should follow the branching strategy outlined above, though t
Mirador currently uses [gitbook](https://github.com/GitbookIO/gitbook) for its documentation. You can find the current documentation in the `docs` folder on any branch. The docs will be re-generated for the website when submitted, and kept up to date with the current master.
Documentation updates are always welcome, and should be included with any fundamentally new changes. For general documentation submission, checkout the master branch and branch from it into a documentation branch. Add to the gitbook files stored in the `docs` directory.
### Updating and Running the Project
Install all dependencies with `npm install` and `bower install`. Run `grunt`. This ensures that any new changes from the remote are picked up in your development build.
Install all dependencies with `npm install` and `bower install`. Run `npm start`. This ensures that any new changes from the remote are picked up in your development build.

Create a branch for your work:
e.g.: `git checkout -b my-feature-branch` or `git checkout -b my-bug-fix`

### Usual Development
Once you have built the necessary files and created a branch for your feature or bug fix work, you are ready to code.

To enable interactive reloading of the browser each time a file is saved, run `grunt watch` in a separate terminal process (the task writes to stdout). Note that this will require middleware or a [livereload browser extension](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions).
Live interactive reloading of the browser each time a file is saved is enabled and used in the `npm start` command. Note that this will require middleware or a [livereload browser extension](http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions).
### Submitting Your Contribution
Since your
### Design Review
Expand Down
156 changes: 17 additions & 139 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-git-describe');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-coveralls');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-githooks');
// grunt.loadNpmTasks('jasmine-jquery');

// ----------
var distribution = 'build/mirador/mirador.js',
Expand All @@ -24,6 +21,7 @@ module.exports = function(grunt) {
// libraries/plugins
vendors = [
'js/lib/jquery.min.js',
'js/lib/jquery-migrate-3.0.0.min.js',
'js/lib/jquery-ui.min.js',
'js/lib/modal.js',
'js/lib/bootbox.js',
Expand All @@ -44,12 +42,6 @@ module.exports = function(grunt) {
'js/lib/modernizr.custom.js'
],

// libraries/plugins for running tests
specJs = [
'bower_components/jasmine-jquery/lib/jasmine-jquery.js',
'bower_components/sinon-server/index.js'
],

// source files
sources = [
'js/src/*.js',
Expand All @@ -59,14 +51,7 @@ module.exports = function(grunt) {
'js/src/workspaces/*.js',
'js/src/widgets/*.js',
'js/src/utils/*.js'
],

specs = ['spec/**/*js'];
exclude = [];

if (!grunt.option('full')) {
exclude.push('spec/mirador.test.js');
}
];

// ----------
// Project configuration.
Expand Down Expand Up @@ -118,10 +103,11 @@ module.exports = function(grunt) {
uglify: {
options: {
preserveComments: 'some',
mangle: false
mangle: false,
sourceMap: true
},
mirador: {
src: [ distribution ],
src: [vendors, sources],
dest: minified
}
},
Expand Down Expand Up @@ -162,7 +148,7 @@ module.exports = function(grunt) {
src: 'js/lib/ZeroClipboard.swf',
dest: 'build/mirador/ZeroClipboard.swf'
}, {
expand: true,
expand: true,
src: 'locales/**',
dest: 'build/mirador'
}]
Expand Down Expand Up @@ -192,7 +178,6 @@ module.exports = function(grunt) {
server: {
options: {
port: 8000,
keepalive: true,
base: '.'
}
}
Expand All @@ -201,7 +186,12 @@ module.exports = function(grunt) {
watch: {
all: {
options: {
livereload: true
livereload: {
// Here we watch the files the sass task will compile to
// These files are sent to the live reload server after sass compiles to them
options: { livereload: true },
files: ['build/**/*']
}
},
files: [
'Gruntfile.js',
Expand All @@ -225,10 +215,9 @@ module.exports = function(grunt) {
jshintrc: '.jshintrc',
globals: {
Mirador: true
},
}
},
beforeconcat: sources

},

'git-describe': {
Expand All @@ -239,13 +228,6 @@ module.exports = function(grunt) {
}
},

githooks: {
all: {
'pre-commit': 'jshint cover'
// 'post-checkout':
}
},

coveralls: {
options: {
src: 'reports/coverage/PhantomJS*/lcov.info',
Expand All @@ -254,96 +236,6 @@ module.exports = function(grunt) {
ci: {
src: 'reports/coverage/PhantomJS*/lcov.info'
}
},

karma : {
options: {
configFile: 'karma.conf.js',
proxies: {
'/spec': 'http://localhost:9876/base/spec'
},
coverageReporter: {
reporters: [
{type: 'lcov'},
{type: 'html'},
{type: 'text-summary'}
],
dir: 'reports/coverage'
},
sauceLabs: {
},
customLaunchers: {
'sl_win7_chrome': {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Windows 7',
version: '39'
},
'sl_win7_firefox': {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Windows 7',
version: '35.0'
},
'sl_win7_ie09': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '9'
},
'sl_win7_ie10': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '10'
},
'sl_win7_ie11': {
base: 'SauceLabs',
browserName: 'internet explorer',
platform: 'Windows 7',
version: '11'
}
}
},
test: {
reporters: ['spec'],
browsers: ['PhantomJS'],
singleRun: true
},
cover: {
preprocessors: {
'js/src/**/*.js': ['coverage']
},
reporters: ['progress', 'coverage'],
browsers: ['PhantomJS'],
singleRun: true
},
server: {
reporters: ['progress'],
browsers: ['Firefox'],
background: true
},
chrome: {
reporters: ['progress'],
browsers: ['Chrome'],
singleRun: true
},
firefox: {
reporters: ['progress'],
browsers: ['Firefox'],
singleRun: true
},
browsers: {
reporters: ['spec', 'saucelabs'],
browsers: [
'sl_win7_chrome',
'sl_win7_firefox',
// 'sl_win7_ie9',
// 'sl_win7_ie10',
'sl_win7_ie11'
],
singleRun: true
}
}
});

Expand All @@ -363,12 +255,12 @@ module.exports = function(grunt) {
// ----------
// Build task.
// Cleans out the build folder and builds the code and images into it, checking lint.
grunt.registerTask('build', [ 'clean:build', 'git-describe', 'jshint', 'concat', 'cssmin', 'copy' ]);
grunt.registerTask('build', [ 'clean:build', 'git-describe', 'jshint', 'concat:css', 'uglify', 'cssmin', 'copy']);

// ----------
// Dev Build task.
// Build, but skip the time-consuming and obscurantist minification and uglification.
grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'jshint', 'concat', 'copy' ]);
grunt.registerTask('dev_build', [ 'clean:build', 'git-describe', 'jshint', 'concat', 'copy']);

// ----------
// Package task.
Expand All @@ -388,25 +280,11 @@ module.exports = function(grunt) {
// ----------
// Connect task.
// Runs server at specified port
grunt.registerTask('server', ['connect']);

// ----------
// Test task.
// Runs Jasmine tests
grunt.registerTask('test', 'karma:test');

// ----------
// Coverage task.
// Runs instanbul coverage
grunt.registerTask('cover', 'karma:cover');
grunt.registerTask('serve', ['dev_build', 'connect:server', 'watch']);

// ----------
// Runs this on travis.
grunt.registerTask('ci', [
'jshint',
'test',
'cover',
'coveralls',
'karma:browsers'
'jshint'
]);
};
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Mirador uses [node.js](http://nodejs.org/) and a build system to assemble, test,
2. Install the Grunt command line runner (if you haven't already); on the command line, run `npm install -g grunt-cli`
3. Clone the mirador repository (if you haven't already done so above)
4. On the command line, go into the mirador folder
5. Install all dependencies with `npm install` and `bower install`. Run `grunt'.
5. Install all dependencies with `npm install` and `bower install`. Run `npm start'.

### Run Tests
`grunt test`
`npm test`

For more information, see the [Docs](http://projectmirador.org/docs/docs/getting-started.html), submit an [issue](https://github.com/projectmirador/mirador/issues), or ask on [slack](http://bit.ly/iiif-slack).

Expand Down
7 changes: 1 addition & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirador",
"version": "2.1.1",
"version": "2.1.2",
"homepage": "https://github.com/ProjectMirador/mirador",
"authors": [
"aeschylus <[email protected]>"
Expand All @@ -27,13 +27,8 @@
"URIjs": "https://github.com/medialize/URI.js.git#~1.13.2",
"paper": "git://github.com/paperjs/paper.js.git#*",
"spectrum": "git://github.com/bgrins/spectrum.git#*",
"jquery-awesome-cursor": "git://github.com/jwarby/jquery-awesome-cursor.git#*",
"qtip2": "~2.2.1"
},
"devDependencies": {
"sinon-server": "http://sinonjs.org/releases/sinon-server-1.12.2.js",
"jasmine-jquery": "~2.0.6"
},
"resolutions": {
"jquery": ">=1.7.2"
}
Expand Down
Loading

0 comments on commit a4a7108

Please sign in to comment.