Skip to content

Commit

Permalink
Merge branch 'v4-dev' into v4-dev-xmr-docs-gradients
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Sep 17, 2018
2 parents 3118192 + 928ebd8 commit b65abef
Show file tree
Hide file tree
Showing 33 changed files with 269 additions and 262 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ git:
node_js:
- "6"
- "8"
before_install:
- if [[ `npm -v` != 5* ]]; then npm install -g npm@5; fi
install:
- bundle install --deployment --jobs=3 --retry=3
- npm install
Expand All @@ -26,7 +24,7 @@ jobs:
include:
- stage: browser
node_js: 8
script: if ! git log --format=%B --no-merges -n 1 | grep '\[skip browser\]'; then npm test && npm run js-test-cloud; fi
script: if ! git log --format=%B --no-merges -n 1 | grep '\[skip browser\]'; then npm run js-test-cloud; fi
cache:
directories:
- node_modules
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Read the [Getting started page](https://getbootstrap.com/docs/4.1/getting-starte
[![peerDependencies Status](https://img.shields.io/david/peer/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap?type=peer)
[![devDependency Status](https://img.shields.io/david/dev/twbs/bootstrap.svg)](https://david-dm.org/twbs/bootstrap?type=dev)
[![Coverage Status](https://img.shields.io/coveralls/github/twbs/bootstrap/v4-dev.svg)](https://coveralls.io/github/twbs/bootstrap?branch=v4-dev)
[![CSS gzip size](http://img.badgesize.io/twbs/bootstrap/v4-dev/dist/css/bootstrap.min.css?compression=gzip&label=CSS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
[![JS gzip size](http://img.badgesize.io/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js?compression=gzip&label=JS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
[![CSS gzip size](https://img.badgesize.io/twbs/bootstrap/v4-dev/dist/css/bootstrap.min.css?compression=gzip&label=CSS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/css/bootstrap.min.css)
[![JS gzip size](https://img.badgesize.io/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js?compression=gzip&label=JS+gzip+size)](https://github.com/twbs/bootstrap/tree/v4-dev/dist/js/bootstrap.min.js)
[![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)](https://www.browserstack.com/automate/public-build/SkxZcStBeExEdVJqQ2hWYnlWckpkNmNEY213SFp6WHFETWk2bGFuY3pCbz0tLXhqbHJsVlZhQnRBdEpod3NLSDMzaHc9PQ==--3d0b75245708616eb93113221beece33e680b229)

## What's included
Expand Down Expand Up @@ -120,7 +120,7 @@ Documentation search is powered by [Algolia's DocSearch](https://community.algol
3. Run `npm start` to compile CSS and JavaScript files, generate our docs, and watch for changes.
4. Open `http://localhost:9001` in your browser, and voilà.

Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/home/).
Learn more about using Jekyll by reading its [documentation](https://jekyllrb.com/docs/).

### Documentation for previous releases

Expand Down
4 changes: 2 additions & 2 deletions build/svgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# replace default config

multipass: true
full: true
#full: true

# https://github.com/svg/svgo/blob/master/lib/svgo/js2svg.js#L6 for more config options

Expand Down Expand Up @@ -48,5 +48,5 @@ plugins:
- removeUselessStrokeAndFill: true
- removeViewBox: false
- removeXMLNS: false
- removeXMLProcInst: false
- removeXMLProcInst: true
- sortAttrs: true
9 changes: 3 additions & 6 deletions js/src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,11 @@ const Util = (($) => {
let selector = element.getAttribute('data-target')

if (!selector || selector === '#') {
selector = (element.getAttribute('href') || '').trim()
const hrefAttr = element.getAttribute('href')
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''
}

try {
return document.querySelector(selector) ? selector : null
} catch (err) {
return null
}
return selector && document.querySelector(selector) ? selector : null
},

getTransitionDurationFromElement(element) {
Expand Down
2 changes: 1 addition & 1 deletion js/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## How does Bootstrap's test suite work?

Bootstrap uses [QUnit](https://qunitjs.com/) and [Sinon](http://sinonjs.org/). Each plugin has a file dedicated to its tests in `unit/<plugin-name>.js`.
Bootstrap uses [QUnit](https://qunitjs.com/) and [Sinon](https://sinonjs.org/). Each plugin has a file dedicated to its tests in `unit/<plugin-name>.js`.

* `unit/` contains the unit test files for each Bootstrap plugin.
* `vendor/` contains third-party testing-related code (QUnit, jQuery and Sinon).
Expand Down
51 changes: 0 additions & 51 deletions js/tests/karma-browserstack.conf.js

This file was deleted.

53 changes: 0 additions & 53 deletions js/tests/karma-bundle.conf.js

This file was deleted.

193 changes: 128 additions & 65 deletions js/tests/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,76 +1,139 @@
/* eslint-env node */
/* eslint no-process-env: 0 */
const ip = require('ip')
const {
browsers,
browsersKeys
} = require('./browsers')
const path = require('path')
const jsCoveragePath = path.resolve(__dirname, '../coverage')

module.exports = (config) => {
const jqueryFile = process.env.USE_OLD_JQUERY ? 'https://code.jquery.com/jquery-1.9.1.min.js' : 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js'
const jqueryFile = process.env.USE_OLD_JQUERY ? 'https://code.jquery.com/jquery-1.9.1.min.js' : 'site/docs/4.1/assets/js/vendor/jquery-slim.min.js'
const bundle = process.env.BUNDLE === 'true'
const browserStack = process.env.BROWSER === 'true'

config.set({
basePath: '../..',
frameworks: ['qunit', 'sinon', 'detectBrowsers'],
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-qunit',
'karma-sinon',
'karma-detect-browsers',
'karma-coverage-istanbul-reporter'
],
// list of files / patterns to load in the browser
files: [
jqueryFile,
'site/docs/4.1/assets/js/vendor/popper.min.js',
'js/coverage/dist/util.js',
'js/coverage/dist/tooltip.js',
'js/coverage/dist/!(util|index|tooltip).js', // include all of our js/dist files except util.js, index.js and tooltip.js
'js/tests/unit/*.js'
],
reporters: ['dots', 'coverage-istanbul'],
port: 9876,
colors: true,
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_ERROR || config.LOG_WARN,
autoWatch: false,
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless']
}
},
singleRun: true,
concurrency: Infinity,
detectBrowsers: {
usePhantomJS: false,
postDetection(availableBrowser) {
if (typeof process.env.TRAVIS_JOB_ID !== 'undefined' || availableBrowser.includes('Chrome')) {
return ['ChromeHeadless']
}
const frameworks = [
'qunit',
'sinon'
]

if (availableBrowser.includes('Firefox')) {
return ['FirefoxHeadless']
}
const plugins = [
'karma-qunit',
'karma-sinon'
]

throw new Error('Please install Firefox or Chrome')
}
},
coverageIstanbulReporter: {
dir: jsCoveragePath,
reports: ['lcov', 'text-summary'],
thresholds: {
emitWarning: false,
global: {
statements: 90,
branches: 84,
functions: 87,
lines: 90
}
}
},
client: {
qunit: {
showUI: true
const reporters = ['dots']

const detectBrowsers = {
usePhantomJS: false,
postDetection(availableBrowser) {
if (typeof process.env.TRAVIS_JOB_ID !== 'undefined' || availableBrowser.includes('Chrome')) {
return ['ChromeHeadless']
}

if (availableBrowser.includes('Firefox')) {
return ['FirefoxHeadless']
}

throw new Error('Please install Firefox or Chrome')
}
}

const customLaunchers = {
FirefoxHeadless: {
base: 'Firefox',
flags: ['-headless']
}
}

let files = ['site/docs/4.1/assets/js/vendor/popper.min.js']
const conf = {
basePath: '../..',
port: 9876,
colors: true,
autoWatch: false,
singleRun: true,
concurrency: Infinity,
client: {
qunit: {
showUI: true
}
}
}

if (bundle) {
frameworks.push('detectBrowsers')
plugins.push(
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-detect-browsers'
)
conf.customLaunchers = customLaunchers
conf.detectBrowsers = detectBrowsers
files = files.concat([
jqueryFile,
'dist/js/bootstrap.js'
])
} else if (browserStack) {
conf.hostname = ip.address()
conf.browserStack = {
username: process.env.BROWSER_STACK_USERNAME,
accessKey: process.env.BROWSER_STACK_ACCESS_KEY,
build: `bootstrap-${new Date().toISOString()}`,
project: 'Bootstrap',
retryLimit: 2
}
plugins.push('karma-browserstack-launcher')
conf.customLaunchers = browsers
conf.browsers = browsersKeys
reporters.push('BrowserStack')
files = files.concat([
'site/docs/4.1/assets/js/vendor/jquery-slim.min.js',
'js/dist/util.js',
'js/dist/tooltip.js',
'js/dist/!(util|index|tooltip).js' // include all of our js/dist files except util.js, index.js and tooltip.js
])
} else {
frameworks.push('detectBrowsers')
plugins.push(
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-detect-browsers',
'karma-coverage-istanbul-reporter'
)
files = files.concat([
jqueryFile,
'js/coverage/dist/util.js',
'js/coverage/dist/tooltip.js',
'js/coverage/dist/!(util|index|tooltip).js' // include all of our js/dist files except util.js, index.js and tooltip.js
])
reporters.push('coverage-istanbul')
conf.customLaunchers = customLaunchers
conf.detectBrowsers = detectBrowsers
conf.coverageIstanbulReporter = {
dir: jsCoveragePath,
reports: ['lcov', 'text-summary'],
thresholds: {
emitWarning: false,
global: {
statements: 90,
branches: 84,
functions: 87,
lines: 90
}
}
})
}
}

files.push('js/tests/unit/*.js')

conf.frameworks = frameworks
conf.plugins = plugins
conf.reporters = reporters
conf.files = files

module.exports = (karmaConfig) => {
// possible values: karmaConfig.LOG_DISABLE || karmaConfig.LOG_ERROR || karmaConfig.LOG_WARN || karmaConfig.LOG_INFO || karmaConfig.LOG_DEBUG
conf.logLevel = karmaConfig.LOG_ERROR || karmaConfig.LOG_WARN
karmaConfig.set(conf)
}

0 comments on commit b65abef

Please sign in to comment.