mirror of https://github.com/twbs/bootstrap.git
Build system overhaul.
This commit is contained in:
parent
9af6bf8f7a
commit
b4ac48fdec
19
.travis.yml
19
.travis.yml
|
@ -9,30 +9,27 @@ node_js:
|
|||
before_install:
|
||||
- if [[ `npm -v` != 4* ]]; then npm install -g npm@4; fi
|
||||
- "export TRAVIS_COMMIT_MSG=\"`git log --format=%B --no-merges -n 1`\""
|
||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip validator\]'; export TWBS_DO_VALIDATOR=$?; true
|
||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip sauce\]'; export TWBS_DO_SAUCE=$?; true
|
||||
- if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then export TWBS_DO_VALIDATOR=0; fi
|
||||
- echo "$TRAVIS_COMMIT_MSG" | grep '\[skip browser\]'; export TWBS_DO_BROWSER=$?; true
|
||||
install:
|
||||
- bundle install --deployment --jobs=3 --retry=3
|
||||
- cp grunt/npm-shrinkwrap.json ./
|
||||
- cp build/npm-shrinkwrap.json ./
|
||||
- npm install
|
||||
script:
|
||||
- npm test
|
||||
- if [ "$TWBS_TEST" = browser -a "$SAUCE_ACCESS_KEY" ]; then npm run js-test-cloud; fi
|
||||
after_success:
|
||||
- if [ "$TWBS_TEST" = sauce-js-unit ]; then grunt/upload-preview.sh; fi
|
||||
- if [ "$TRAVIS_REPO_SLUG" = twbs-savage/bootstrap ]; then npm run docs-upload-preview; fi
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
- vendor/bundle
|
||||
- "$HOME/google-cloud-sdk"
|
||||
env:
|
||||
- TWBS_TEST=core
|
||||
- TWBS_TEST=validate-html
|
||||
- TWBS_TEST=sauce-js-unit
|
||||
- TWBS_TEST=browser
|
||||
matrix:
|
||||
exclude:
|
||||
- node_js: "4"
|
||||
env: TWBS_TEST=validate-html
|
||||
- node_js: "4"
|
||||
env: TWBS_TEST=sauce-js-unit
|
||||
env: TWBS_TEST=browser
|
||||
notifications:
|
||||
slack: heybb:iz4wwosL0N0EdaX1gvgkU0NH
|
||||
webhooks:
|
||||
|
|
6
Gemfile
6
Gemfile
|
@ -1,8 +1,8 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'jekyll', '~> 3.4.2'
|
||||
gem 'jekyll', '~> 3.4.3'
|
||||
gem 'jekyll-redirect-from', '~> 0.12.1'
|
||||
gem 'jekyll-sitemap', '~> 1.0.0'
|
||||
gem 'scss_lint', '~> 0.52.0'
|
||||
gem 'jekyll-sitemap', '~> 1.1.1'
|
||||
gem 'scss_lint', '~> 0.53.0'
|
||||
end
|
||||
|
|
14
Gemfile.lock
14
Gemfile.lock
|
@ -1,12 +1,12 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.5.0)
|
||||
addressable (2.5.1)
|
||||
public_suffix (~> 2.0, >= 2.0.2)
|
||||
colorator (1.1.0)
|
||||
ffi (1.9.18)
|
||||
forwardable-extended (2.6.0)
|
||||
jekyll (3.4.2)
|
||||
jekyll (3.4.3)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
|
@ -21,7 +21,7 @@ GEM
|
|||
jekyll (~> 3.3)
|
||||
jekyll-sass-converter (1.5.0)
|
||||
sass (~> 3.4)
|
||||
jekyll-sitemap (1.0.0)
|
||||
jekyll-sitemap (1.1.1)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-watch (1.5.0)
|
||||
listen (~> 3.0, < 3.1)
|
||||
|
@ -41,7 +41,7 @@ GEM
|
|||
rouge (1.11.1)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.4.23)
|
||||
scss_lint (0.52.0)
|
||||
scss_lint (0.53.0)
|
||||
rake (>= 0.9, < 13)
|
||||
sass (~> 3.4.20)
|
||||
|
||||
|
@ -49,10 +49,10 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
jekyll (~> 3.4.2)
|
||||
jekyll (~> 3.4.3)
|
||||
jekyll-redirect-from (~> 0.12.1)
|
||||
jekyll-sitemap (~> 1.0.0)
|
||||
scss_lint (~> 0.52.0)
|
||||
jekyll-sitemap (~> 1.1.1)
|
||||
scss_lint (~> 0.53.0)
|
||||
|
||||
BUNDLED WITH
|
||||
1.14.6
|
||||
|
|
296
Gruntfile.js
296
Gruntfile.js
|
@ -9,151 +9,8 @@
|
|||
module.exports = function (grunt) {
|
||||
'use strict'
|
||||
|
||||
// Force use of Unix newlines
|
||||
grunt.util.linefeed = '\n'
|
||||
|
||||
RegExp.quote = function (string) {
|
||||
return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
|
||||
}
|
||||
|
||||
var isTravis = require('is-travis')
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
|
||||
// Metadata.
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
banner: '/*!\n' +
|
||||
' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' +
|
||||
' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' +
|
||||
' * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n' +
|
||||
' */\n',
|
||||
jqueryCheck: 'if (typeof jQuery === \'undefined\') {\n' +
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\\'s JavaScript.\')\n' +
|
||||
'}\n',
|
||||
jqueryVersionCheck: '+function ($) {\n' +
|
||||
' var version = $.fn.jquery.split(\' \')[0].split(\'.\')\n' +
|
||||
' if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {\n' +
|
||||
' throw new Error(\'Bootstrap\\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0\')\n' +
|
||||
' }\n' +
|
||||
'}(jQuery);\n\n',
|
||||
|
||||
// Task configuration.
|
||||
clean: {
|
||||
dist: 'dist',
|
||||
docs: 'docs/dist'
|
||||
},
|
||||
|
||||
// JS build configuration
|
||||
babel: {
|
||||
dev: {
|
||||
options: {
|
||||
sourceMap: true
|
||||
},
|
||||
files: {
|
||||
'js/dist/util.js' : 'js/src/util.js',
|
||||
'js/dist/alert.js' : 'js/src/alert.js',
|
||||
'js/dist/button.js' : 'js/src/button.js',
|
||||
'js/dist/carousel.js' : 'js/src/carousel.js',
|
||||
'js/dist/collapse.js' : 'js/src/collapse.js',
|
||||
'js/dist/dropdown.js' : 'js/src/dropdown.js',
|
||||
'js/dist/modal.js' : 'js/src/modal.js',
|
||||
'js/dist/scrollspy.js' : 'js/src/scrollspy.js',
|
||||
'js/dist/tab.js' : 'js/src/tab.js',
|
||||
'js/dist/tooltip.js' : 'js/src/tooltip.js',
|
||||
'js/dist/popover.js' : 'js/src/popover.js'
|
||||
}
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
extends: '../../.babelrc'
|
||||
},
|
||||
files: {
|
||||
'<%= concat.bootstrap.dest %>' : '<%= concat.bootstrap.dest %>'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
stamp: {
|
||||
options: {
|
||||
banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>\n+function () {\n',
|
||||
footer: '\n}();'
|
||||
},
|
||||
bootstrap: {
|
||||
files: {
|
||||
src: '<%= concat.bootstrap.dest %>'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
concat: {
|
||||
options: {
|
||||
// Custom function to remove all export and import statements
|
||||
process: function (src) {
|
||||
return src.replace(/^(export|import).*/gm, '')
|
||||
}
|
||||
},
|
||||
bootstrap: {
|
||||
src: [
|
||||
'js/src/util.js',
|
||||
'js/src/alert.js',
|
||||
'js/src/button.js',
|
||||
'js/src/carousel.js',
|
||||
'js/src/collapse.js',
|
||||
'js/src/dropdown.js',
|
||||
'js/src/modal.js',
|
||||
'js/src/scrollspy.js',
|
||||
'js/src/tab.js',
|
||||
'js/src/tooltip.js',
|
||||
'js/src/popover.js'
|
||||
],
|
||||
dest: 'dist/js/<%= pkg.name %>.js'
|
||||
}
|
||||
},
|
||||
|
||||
qunit: {
|
||||
options: {
|
||||
inject: 'js/tests/unit/phantom.js'
|
||||
},
|
||||
files: 'js/tests/index.html'
|
||||
},
|
||||
|
||||
// CSS build configuration
|
||||
copy: {
|
||||
docs: {
|
||||
expand: true,
|
||||
cwd: 'dist/',
|
||||
src: [
|
||||
'**/*'
|
||||
],
|
||||
dest: 'docs/dist/'
|
||||
}
|
||||
},
|
||||
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 3000,
|
||||
base: '.'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
src: {
|
||||
files: '<%= concat.bootstrap.src %>',
|
||||
tasks: ['babel:dev']
|
||||
},
|
||||
sass: {
|
||||
files: 'scss/**/*.scss',
|
||||
tasks: ['dist-css', 'docs']
|
||||
},
|
||||
docs: {
|
||||
files: 'docs/assets/scss/**/*.scss',
|
||||
tasks: ['dist-css', 'docs']
|
||||
}
|
||||
},
|
||||
|
||||
'saucelabs-qunit': {
|
||||
all: {
|
||||
options: {
|
||||
|
@ -162,160 +19,11 @@ module.exports = function (grunt) {
|
|||
maxRetries: 3,
|
||||
maxPollRetries: 4,
|
||||
urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'],
|
||||
browsers: grunt.file.readYAML('grunt/sauce_browsers.yml')
|
||||
browsers: grunt.file.readYAML('build/sauce_browsers.yml')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
exec: {
|
||||
'clean-css': {
|
||||
command: 'npm run clean-css'
|
||||
},
|
||||
'clean-css-docs': {
|
||||
command: 'npm run clean-css-docs'
|
||||
},
|
||||
postcss: {
|
||||
command: 'npm run postcss'
|
||||
},
|
||||
'postcss-docs': {
|
||||
command: 'npm run postcss-docs'
|
||||
},
|
||||
htmlhint: {
|
||||
command: 'npm run htmlhint'
|
||||
},
|
||||
htmllint: {
|
||||
command: 'npm run htmllint'
|
||||
},
|
||||
jekyll: {
|
||||
command: 'npm run jekyll'
|
||||
},
|
||||
'jekyll-github': {
|
||||
command: 'npm run jekyll-github'
|
||||
},
|
||||
sass: {
|
||||
command: 'npm run sass'
|
||||
},
|
||||
'sass-docs': {
|
||||
command: 'npm run sass-docs'
|
||||
},
|
||||
'scss-lint': {
|
||||
command: 'npm run scss-lint'
|
||||
},
|
||||
'scss-lint-docs': {
|
||||
command: 'npm run scss-lint-docs'
|
||||
},
|
||||
uglify: {
|
||||
command: 'npm run uglify'
|
||||
},
|
||||
'uglify-docs': {
|
||||
command: 'npm run uglify-docs'
|
||||
}
|
||||
},
|
||||
|
||||
buildcontrol: {
|
||||
options: {
|
||||
dir: '_gh_pages',
|
||||
commit: true,
|
||||
push: true,
|
||||
message: 'Built %sourceName% from commit %sourceCommit% on branch %sourceBranch%'
|
||||
},
|
||||
pages: {
|
||||
options: {
|
||||
remote: 'git@github.com:twbs/derpstrap.git',
|
||||
branch: 'gh-pages'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
compress: {
|
||||
main: {
|
||||
options: {
|
||||
archive: 'bootstrap-<%= pkg.version %>-dist.zip',
|
||||
mode: 'zip',
|
||||
level: 9,
|
||||
pretty: true
|
||||
},
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'dist/',
|
||||
src: ['**'],
|
||||
dest: 'bootstrap-<%= pkg.version %>-dist'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
// These plugins provide necessary tasks.
|
||||
require('load-grunt-tasks')(grunt)
|
||||
require('time-grunt')(grunt)
|
||||
|
||||
// Docs HTML validation task
|
||||
grunt.registerTask('validate-html', ['exec:jekyll', 'exec:htmllint', 'exec:htmlhint'])
|
||||
|
||||
var runSubset = function (subset) {
|
||||
return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset
|
||||
}
|
||||
var isUndefOrNonZero = function (val) {
|
||||
return val === undefined || val !== '0'
|
||||
}
|
||||
|
||||
// Test task.
|
||||
var testSubtasks = []
|
||||
// Skip core tests if running a different subset of the test suite
|
||||
if (runSubset('core') &&
|
||||
// Skip core tests if this is a Savage build
|
||||
process.env.TRAVIS_REPO_SLUG !== 'twbs-savage/bootstrap') {
|
||||
testSubtasks = testSubtasks.concat(['dist-css', 'dist-js', 'test-scss', 'qunit', 'docs'])
|
||||
}
|
||||
// Skip HTML validation if running a different subset of the test suite
|
||||
if (runSubset('validate-html') &&
|
||||
isTravis &&
|
||||
// Skip HTML5 validator when [skip validator] is in the commit message
|
||||
isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) {
|
||||
testSubtasks.push('validate-html')
|
||||
}
|
||||
// Only run Sauce Labs tests if there's a Sauce access key
|
||||
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' &&
|
||||
// Skip Sauce if running a different subset of the test suite
|
||||
runSubset('sauce-js-unit')) {
|
||||
testSubtasks = testSubtasks.concat(['dist', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs'])
|
||||
// Skip Sauce on Travis when [skip sauce] is in the commit message
|
||||
if (isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) {
|
||||
testSubtasks.push('connect')
|
||||
testSubtasks.push('saucelabs-qunit')
|
||||
}
|
||||
}
|
||||
grunt.registerTask('test', testSubtasks)
|
||||
|
||||
// JS distribution task.
|
||||
grunt.registerTask('dist-js', ['babel:dev', 'concat', 'babel:dist', 'stamp', 'exec:uglify'])
|
||||
|
||||
grunt.registerTask('test-scss', ['exec:scss-lint'])
|
||||
|
||||
// CSS distribution task.
|
||||
grunt.registerTask('sass-compile', ['exec:sass', 'exec:sass-docs'])
|
||||
|
||||
grunt.registerTask('dist-css', ['sass-compile', 'exec:postcss', 'exec:clean-css', 'exec:clean-css-docs'])
|
||||
|
||||
// Full distribution task.
|
||||
grunt.registerTask('dist', ['clean:dist', 'dist-css', 'dist-js'])
|
||||
|
||||
// Default task.
|
||||
grunt.registerTask('default', ['clean:dist', 'test'])
|
||||
|
||||
// Docs task.
|
||||
grunt.registerTask('docs-css', ['exec:clean-css-docs', 'exec:postcss-docs'])
|
||||
grunt.registerTask('lint-docs-css', ['exec:scss-lint-docs'])
|
||||
grunt.registerTask('docs-js', ['exec:uglify-docs'])
|
||||
grunt.registerTask('docs', ['lint-docs-css', 'docs-css', 'docs-js', 'clean:docs', 'copy:docs'])
|
||||
grunt.registerTask('docs-github', ['exec:jekyll-github'])
|
||||
|
||||
grunt.registerTask('prep-release', ['dist', 'docs', 'docs-github', 'compress'])
|
||||
|
||||
// Publish to GitHub
|
||||
grunt.registerTask('publish', ['buildcontrol:pages'])
|
||||
grunt.loadNpmTasks('grunt-saucelabs')
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,40 @@
|
|||
const fs = require('fs')
|
||||
|
||||
fs.readFile('package.json', (err, data) => {
|
||||
if (err) throw err
|
||||
|
||||
const pkg = JSON.parse(data)
|
||||
const year = new Date().getFullYear()
|
||||
|
||||
const stampTop =
|
||||
`/*!
|
||||
* Bootstrap v${pkg.version} (${pkg.homepage})
|
||||
* Copyright 2011-${year} ${pkg.author}
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
if (typeof jQuery === 'undefined') {
|
||||
throw new Error('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.')
|
||||
}
|
||||
|
||||
(function ($) {
|
||||
var version = $.fn.jquery.split(' ')[0].split('.')
|
||||
if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] >= 4)) {
|
||||
throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0')
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
(function () {
|
||||
`
|
||||
const stampEnd = `
|
||||
})()`
|
||||
|
||||
process.stdout.write(stampTop)
|
||||
|
||||
process.stdin.on('end', () => {
|
||||
process.stdout.write(stampEnd);
|
||||
});
|
||||
|
||||
process.stdin.pipe(process.stdout)
|
||||
})
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
# Upload built docs to preview.twbsapps.com
|
||||
|
||||
# Add build metadata to version
|
||||
sed -i "/^current_version:/ s/\$/+pr.${TRAVIS_COMMIT}/" _config.yml
|
||||
bundle exec jekyll build --destination "$TRAVIS_COMMIT" --baseurl "/c/${TRAVIS_COMMIT}"
|
||||
|
||||
openssl aes-256-cbc -K $encrypted_2b749c8e6327_key -iv $encrypted_2b749c8e6327_iv -in build/gcp-key.json.enc -out build/gcp-key.json -d
|
||||
gcloud auth activate-service-account "$GCP_SERVICE_ACCOUNT" --key-file build/gcp-key.json &> /dev/null || (echo 'GCP login failed!'; exit 1)
|
||||
|
||||
echo "Uploading to http://preview.twbsapps.com/c/${TRAVIS_COMMIT} ..."
|
||||
time gsutil -q -m cp -z html,css,js,svg -r "./${TRAVIS_COMMIT}" gs://preview.twbsapps.com/c/
|
||||
echo 'Done.'
|
|
@ -1,27 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Upload built docs to preview.twbsapps.com
|
||||
|
||||
if [ "$TRAVIS_REPO_SLUG" != twbs-savage/bootstrap ]; then exit 0; fi
|
||||
|
||||
# Add build metadata to version
|
||||
sed -i "/^current_version:/ s/\$/+pr.${TRAVIS_COMMIT}/" _config.yml
|
||||
# Fix URLs since the site's root is now a subdirectory
|
||||
bundle exec jekyll build --destination "$TRAVIS_COMMIT" --baseurl "/c/${TRAVIS_COMMIT}"
|
||||
|
||||
# Install gcloud & gsutil
|
||||
GSUTIL_VERSION=$(gsutil version | cut -d ' ' -f 3)
|
||||
if [ ! -d "${HOME}/google-cloud-sdk" ] || [ "${GSUTIL_VERSION}" != '4.19' ]; then
|
||||
rm -rf "${HOME}/google-cloud-sdk" # Kill Travis' outdated non-updateable preinstalled version
|
||||
echo 'Installing google-cloud-sdk...'
|
||||
export CLOUDSDK_CORE_DISABLE_PROMPTS=1
|
||||
time (curl -S -s https://sdk.cloud.google.com | bash &>/dev/null)
|
||||
echo 'Done.'
|
||||
fi
|
||||
source "${HOME}/google-cloud-sdk/path.bash.inc"
|
||||
|
||||
openssl aes-256-cbc -K $encrypted_2b749c8e6327_key -iv $encrypted_2b749c8e6327_iv -in grunt/gcp-key.json.enc -out grunt/gcp-key.json -d
|
||||
gcloud auth activate-service-account "$GCP_SERVICE_ACCOUNT" --key-file grunt/gcp-key.json &> /dev/null || (echo 'GCP login failed!'; exit 1)
|
||||
|
||||
echo "Uploading to http://preview.twbsapps.com/c/${TRAVIS_COMMIT} ..."
|
||||
time gsutil -q -m cp -z html,css,js,svg -r "./${TRAVIS_COMMIT}" gs://preview.twbsapps.com/c/
|
||||
echo 'Done.'
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* grunt-contrib-qunit
|
||||
* http://gruntjs.com/
|
||||
*
|
||||
* Copyright (c) 2014 "Cowboy" Ben Alman, contributors
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict'
|
||||
|
||||
// Don't re-order tests.
|
||||
QUnit.config.reorder = false
|
||||
// Run tests serially, not in parallel.
|
||||
QUnit.config.autorun = false
|
||||
|
||||
// Send messages to the parent PhantomJS process via alert! Good times!!
|
||||
function sendMessage() {
|
||||
var args = [].slice.call(arguments)
|
||||
alert(JSON.stringify(args))
|
||||
}
|
||||
|
||||
// These methods connect QUnit to PhantomJS.
|
||||
QUnit.log(function (obj) {
|
||||
// What is this I don’t even
|
||||
if (obj.message === '[object Object], undefined:undefined') { return }
|
||||
|
||||
// Parse some stuff before sending it.
|
||||
var actual
|
||||
var expected
|
||||
if (!obj.result) {
|
||||
// Dumping large objects can be very slow, and the dump isn't used for
|
||||
// passing tests, so only dump if the test failed.
|
||||
actual = QUnit.dump.parse(obj.actual)
|
||||
expected = QUnit.dump.parse(obj.expected)
|
||||
}
|
||||
// Send it.
|
||||
sendMessage('qunit.log', obj.result, actual, expected, obj.message, obj.source)
|
||||
})
|
||||
|
||||
QUnit.testStart(function (obj) {
|
||||
sendMessage('qunit.testStart', obj.name)
|
||||
})
|
||||
|
||||
QUnit.testDone(function (obj) {
|
||||
sendMessage('qunit.testDone', obj.name, obj.failed, obj.passed, obj.total, obj.duration)
|
||||
})
|
||||
|
||||
QUnit.moduleStart(function (obj) {
|
||||
sendMessage('qunit.moduleStart', obj.name)
|
||||
})
|
||||
|
||||
QUnit.moduleDone(function (obj) {
|
||||
if (obj.failed === 0) {
|
||||
console.log('\r\u221A All tests passed in "' + obj.name + '" module')
|
||||
} else {
|
||||
console.log('\u00D7 ' + obj.failed + ' tests failed in "' + obj.name + '" module')
|
||||
}
|
||||
sendMessage('qunit.moduleDone', obj.name, obj.failed, obj.passed, obj.total)
|
||||
})
|
||||
|
||||
QUnit.begin(function () {
|
||||
sendMessage('qunit.begin')
|
||||
console.log('\n\nStarting test suite')
|
||||
console.log('================================================\n')
|
||||
})
|
||||
|
||||
QUnit.done(function (obj) {
|
||||
sendMessage('qunit.done', obj.failed, obj.passed, obj.total, obj.runtime)
|
||||
})
|
||||
|
||||
}())
|
95
package.json
95
package.json
|
@ -17,24 +17,40 @@
|
|||
"Twitter, Inc."
|
||||
],
|
||||
"scripts": {
|
||||
"change-version": "node grunt/change-version.js",
|
||||
"clean-css": "cleancss --level 1 --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --level 1 --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --level 1 --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
|
||||
"clean-css-docs": "cleancss --level 1 --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css",
|
||||
"eslint": "eslint --ignore-path .eslintignore js && eslint --config js/tests/.eslintrc.json --env node grunt Gruntfile.js && eslint --config js/tests/.eslintrc.json docs/assets/js/src docs/assets/js/ie-emulation-modes-warning.js docs/assets/js/ie10-viewport-bug-workaround.js",
|
||||
"htmlhint": "htmlhint --config docs/.htmlhintrc _gh_pages/",
|
||||
"htmllint": "htmllint --rc docs/.htmllintrc _gh_pages/**/*.html js/tests/visual/*.html",
|
||||
"jekyll": "bundle exec jekyll build",
|
||||
"jekyll-github": "shx echo 'github: true' > $npm_config_tmp/twbsjekyll.yml && npm run jekyll -- --config _config.yml,$npm_config_tmp/twbsjekyll.yml && shx rm $npm_config_tmp/twbsjekyll.yml",
|
||||
"postcss": "postcss --config grunt/ --replace dist/css/*.css",
|
||||
"postcss-docs": "postcss --config grunt/ --replace docs/assets/css/docs.min.css && postcss --config grunt/ --replace docs/examples/**/*.css",
|
||||
"sass": "node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css",
|
||||
"sass-docs": "node-sass --output-style expanded --source-map true --precision 6 docs/assets/scss/docs.scss docs/assets/css/docs.min.css",
|
||||
"scss-lint": "bundle exec scss-lint --config scss/.scss-lint.yml scss/*.scss",
|
||||
"scss-lint-docs": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude docs/assets/scss/docs.scss docs/assets/scss/*.scss",
|
||||
"uglify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
||||
"uglify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output docs/assets/js/docs.min.js docs/assets/js/vendor/anchor.min.js docs/assets/js/vendor/clipboard.min.js docs/assets/js/vendor/holder.min.js docs/assets/js/src/application.js",
|
||||
"update-shrinkwrap": "npm shrinkwrap --dev && shx mv ./npm-shrinkwrap.json ./grunt/npm-shrinkwrap.json",
|
||||
"test": "npm run eslint && grunt test"
|
||||
"bash": "bash",
|
||||
"css": "npm-run-all css-lint css-compile css-prefix css-minify",
|
||||
"css-docs": "npm-run-all css-lint-docs css-compile-docs css-prefix-docs css-minify-docs",
|
||||
"css-lint": "bundle exec scss-lint --config scss/.scss-lint.yml scss/*.scss",
|
||||
"css-lint-docs": "bundle exec scss-lint --config scss/.scss-lint.yml --exclude docs/assets/scss/docs.scss docs/assets/scss/*.scss",
|
||||
"css-compile": "node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap.scss dist/css/bootstrap.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-grid.scss dist/css/bootstrap-grid.css && node-sass --output-style expanded --source-map true --precision 6 scss/bootstrap-reboot.scss dist/css/bootstrap-reboot.css",
|
||||
"css-compile-docs": "node-sass --output-style expanded --source-map true --precision 6 docs/assets/scss/docs.scss docs/assets/css/docs.min.css",
|
||||
"css-prefix": "postcss --config build/ --replace dist/css/*.css",
|
||||
"css-prefix-docs": "postcss --config build/ --no-map --replace docs/assets/css/docs.min.css docs/examples/**/*.css",
|
||||
"css-minify": "cleancss --level 1 --source-map --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --level 1 --source-map --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --level 1 --source-map --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
|
||||
"css-minify-docs": "cleancss --level 1 --source-map --output docs/assets/css/docs.min.css docs/assets/css/docs.min.css",
|
||||
"js": "npm-run-all js-compile js-minify",
|
||||
"js-docs": "npm-run-all js-lint-docs js-minify-docs",
|
||||
"js-lint": "eslint js/ && eslint --config js/tests/.eslintrc.json --env node build/",
|
||||
"js-lint-docs": "eslint --config js/tests/.eslintrc.json docs/assets/js/",
|
||||
"js-compile": "npm-run-all --parallel js-compile-*",
|
||||
"js-compile-bundle": "shx cat js/src/util.js js/src/alert.js js/src/button.js js/src/carousel.js js/src/collapse.js js/src/dropdown.js js/src/modal.js js/src/scrollspy.js js/src/tab.js js/src/tooltip.js js/src/popover.js | shx sed 's/^(import|export).*//' | babel --filename js/src/bootstrap.js | node build/stamp.js > dist/js/bootstrap.js",
|
||||
"js-compile-plugins": "babel js/src/ --out-dir js/dist/ --source-maps",
|
||||
"js-minify": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
|
||||
"js-minify-docs": "uglifyjs --compress warnings=false --mangle --comments '/^!/' --output docs/assets/js/docs.min.js docs/assets/js/vendor/anchor.min.js docs/assets/js/vendor/clipboard.min.js docs/assets/js/vendor/holder.min.js docs/assets/js/src/application.js",
|
||||
"js-test": "phantomjs ./node_modules/qunit-phantomjs-runner/runner.js js/tests/index.html 60",
|
||||
"js-test-cloud": "ruby -run -ehttpd . -p3000 & grunt saucelabs-qunit",
|
||||
"docs": "npm-run-all docs-compile docs-lint",
|
||||
"docs-lint": "htmlhint --config docs/.htmlhintrc _gh_pages/ js/tests/visual/ && htmllint --rc docs/.htmllintrc _gh_pages/*.html _gh_pages/**/*.html js/tests/visual/*.html",
|
||||
"docs-clean": "shx rm -r docs/dist/* && shx cp -r dist/* docs/dist/",
|
||||
"docs-compile": "npm run docs-clean && bundle exec jekyll build",
|
||||
"docs-serve": "npm run docs-clean && bundle exec jekyll serve",
|
||||
"docs-github": "shx echo 'github: true' > $npm_config_tmp/twbsconfig.yml && npm run docs-compile -- --config _config.yml,$npm_config_tmp/twbsconfig.yml && shx rm $npm_config_tmp/twbsconfig.yml",
|
||||
"docs-upload-preview": "build/upload-preview.sh",
|
||||
"maintenance-dependencies": "ncu -a -x jquery && bundle update && shx echo 'Manually update docs/assets/js/vendor/*, js/tests/vendor/*, bower.json and .travis.yml'",
|
||||
"maintenance-shrinkwrap": "npm shrinkwrap --dev && shx mv npm-shrinkwrap.json build/npm-shrinkwrap.json",
|
||||
"release-version": "node build/change-version.js",
|
||||
"release-zip": "cd dist/ && zip -r9 bootstrap-$npm_package_version-dist.zip * && shx mv bootstrap-$npm_package_version-dist.zip ..",
|
||||
"test": "npm-run-all --parallel css js && npm-run-all docs"
|
||||
},
|
||||
"style": "dist/css/bootstrap.css",
|
||||
"sass": "scss/bootstrap.scss",
|
||||
|
@ -53,42 +69,39 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer": "^6.7.7",
|
||||
"babel-eslint": "^7.1.1",
|
||||
"babel-plugin-transform-es2015-modules-strip": "^0.1.0",
|
||||
"babel-preset-es2015": "^6.24.0",
|
||||
"clean-css-cli": "^4.0.9",
|
||||
"eslint": "^3.18.0",
|
||||
"babel-cli": "^6.24.1",
|
||||
"babel-eslint": "^7.2.2",
|
||||
"babel-plugin-transform-es2015-modules-strip": "^0.1.1",
|
||||
"babel-preset-es2015": "^7.0.0-alpha.7",
|
||||
"clean-css-cli": "^4.0.12",
|
||||
"eslint": "^3.19.0",
|
||||
"grunt": "^1.0.1",
|
||||
"grunt-babel": "^6.0.0",
|
||||
"grunt-build-control": "^0.7.1",
|
||||
"grunt-contrib-clean": "^1.0.0",
|
||||
"grunt-contrib-compress": "^1.4.1",
|
||||
"grunt-contrib-concat": "^1.0.1",
|
||||
"grunt-contrib-connect": "^1.0.2",
|
||||
"grunt-contrib-copy": "^1.0.0",
|
||||
"grunt-contrib-qunit": "^1.3.0",
|
||||
"grunt-contrib-watch": "^1.0.0",
|
||||
"grunt-exec": "^2.0.0",
|
||||
"grunt-saucelabs": "^9.0.0",
|
||||
"grunt-stamp": "^0.3.0",
|
||||
"htmlhint": "^0.9.13",
|
||||
"htmllint-cli": "^0.0.6",
|
||||
"is-travis": "^1.0.0",
|
||||
"load-grunt-tasks": "^3.5.2",
|
||||
"node-sass": "^4.5.0",
|
||||
"postcss-cli": "^3.0.0",
|
||||
"postcss-flexbugs-fixes": "^2.1.0",
|
||||
"node-sass": "^4.5.2",
|
||||
"npm-run-all": "^4.0.2",
|
||||
"phantomjs-prebuilt": "^2.1.14",
|
||||
"postcss-cli": "^3.1.1",
|
||||
"postcss-flexbugs-fixes": "^2.1.1",
|
||||
"qunit-phantomjs-runner": "^2.3.0",
|
||||
"qunitjs": "^2.3.1",
|
||||
"shelljs": "^0.7.7",
|
||||
"shx": "^0.2.2",
|
||||
"time-grunt": "^1.4.0",
|
||||
"uglify-js": "^2.8.14"
|
||||
"uglify-js": "^2.8.22"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
".babelrc",
|
||||
".eslintignore",
|
||||
"Gruntfile.js",
|
||||
"dist",
|
||||
"build",
|
||||
"js/.eslintrc.json",
|
||||
"js/**/*.js",
|
||||
"scss/.scss-lint.yml",
|
||||
"scss/**/*.scss",
|
||||
"LICENSE"
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue