Skip to content

Commit

Permalink
Merge branch 'v4-dev' into v4-dev-xmr-dependabot
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 9, 2020
2 parents 5e3f93c + ac5685d commit b79614b
Show file tree
Hide file tree
Showing 43 changed files with 4,276 additions and 2,714 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Expand Up @@ -4,8 +4,8 @@
*.js text eol=lf
*.json text eol=lf
*.md text eol=lf
*.rb text eol=lf
*.scss text eol=lf
*.sh text eol=lf
*.svg text eol=lf
*.txt text eol=lf
*.xml text eol=lf
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/test.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [6, 8, 12]
node: [10, 12]
ruby: [2.4.x]

steps:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Set up Ruby 2.4
- name: Set up Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -38,7 +38,6 @@ jobs:
key: ${{ runner.os }}-ruby-v${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('.github/workflows/test.yml') }}
restore-keys: |
${{ runner.os }}-ruby-v${{ matrix.ruby }}-${{ hashFiles('Gemfile') }}-${{ hashFiles('Gemfile.lock') }}-${{ hashFiles('.github/workflows/test.yml') }}
${{ runner.os }}-ruby-v${{ matrix.ruby }}-
- name: Set up npm cache
uses: actions/cache@v1
Expand All @@ -47,11 +46,13 @@ jobs:
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/test.yml') }}
restore-keys: |
${{ runner.OS }}-node-v${{ matrix.node }}-${{ hashFiles('package.json') }}-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.github/workflows/test.yml') }}
${{ runner.OS }}-node-v${{ matrix.node }}-
- name: Set up Bundler
run: gem install bundler -v "~> 1.17"

- name: Update rubygems
run: gem update --system

- run: ruby --version
- run: gem --version
- run: bundle --version
Expand All @@ -60,34 +61,30 @@ jobs:
- run: java -version

- name: Install npm dependencies
run: npm install
run: npm ci

- name: Install bundler dependencies
run: bundle install --deployment --jobs=3 --retry=3 --clean
run: bundle install --deployment --jobs=4 --retry=3 --clean

- name: Run tests
run: npm test

- name: Run bundlesize
run: npm run bundlesize
if: matrix.node == 8
if: matrix.node == 10
env:
BUNDLESIZE_GITHUB_TOKEN: "${{ secrets.BUNDLESIZE_GITHUB_TOKEN }}"

- name: Run BrowserStack tests
run: npm run js-test-cloud
if: matrix.node == 8 && github.repository == 'twbs/bootstrap' && github.event_name == 'push'
if: matrix.node == 10 && github.repository == 'twbs/bootstrap' && github.event_name == 'push'
env:
BROWSER_STACK_ACCESS_KEY: "${{ secrets.BROWSER_STACK_ACCESS_KEY }}"
BROWSER_STACK_USERNAME: "${{ secrets.BROWSER_STACK_USERNAME }}"

- name: Run Link Checker
run: npm run check-broken-links
if: matrix.node == 8

- name: Run Coveralls
uses: coverallsapp/github-action@master
if: matrix.node == 8
if: matrix.node == 10
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
path-to-lcov: "./js/coverage/lcov.info"
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
# Ignore docs files
/_gh_pages/
/site/.jekyll-cache
/site/.jekyll-metadata
/site/docs/**/dist/
# Hugo folders
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
@@ -1,9 +1,9 @@
source 'https://rubygems.org'

group :development, :test do
gem 'jekyll', '~> 3.8.6'
gem 'jekyll-redirect-from', '~> 0.15.0'
gem 'jekyll', '~> 4.0.0'
gem 'jekyll-redirect-from', '~> 0.16.0'
gem 'jekyll-sitemap', '~> 1.4.0'
gem 'jekyll-toc', '~> 0.11.0'
gem 'jekyll-toc', '~> 0.13.1'
gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform?
end
59 changes: 33 additions & 26 deletions Gemfile.lock
Expand Up @@ -4,76 +4,83 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
ffi (1.11.3)
ffi (1.11.3-x64-mingw32)
ffi (1.12.2)
ffi (1.12.2-x64-mingw32)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (0.9.5)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jekyll (3.8.6)
jekyll (4.0.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
i18n (>= 0.9.5, < 2)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
kramdown (~> 2.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
rouge (~> 3.0)
safe_yaml (~> 1.0)
jekyll-redirect-from (0.15.0)
terminal-table (~> 1.8)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-toc (0.11.0)
jekyll-toc (0.13.1)
jekyll (>= 3.7)
nokogiri (~> 1.9)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (1.17.0)
kramdown (2.1.0)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.4.0)
nokogiri (1.10.7)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.7-x64-mingw32)
nokogiri (1.10.9-x64-mingw32)
mini_portile2 (~> 2.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.2)
public_suffix (4.0.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
rouge (3.14.0)
rouge (3.16.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.2.1)
ffi (~> 1.9)
sassc (2.2.1-x64-mingw32)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.6.1)
wdm (0.1.1)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
jekyll (~> 3.8.6)
jekyll-redirect-from (~> 0.15.0)
jekyll (~> 4.0.0)
jekyll-redirect-from (~> 0.16.0)
jekyll-sitemap (~> 1.4.0)
jekyll-toc (~> 0.11.0)
jekyll-toc (~> 0.13.1)
wdm (~> 0.1.1)

BUNDLED WITH
Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Expand Up @@ -24,6 +24,9 @@ plugins:
- jekyll-sitemap
- jekyll-toc

redirect_from:
json: false

# Social
title: Bootstrap
description: "The most popular HTML, CSS, and JS library in the world."
Expand Down
1 change: 0 additions & 1 deletion build/change-version.js
Expand Up @@ -95,7 +95,6 @@ function main(args) {
'.js',
'.json',
'.md',
'.nuspec',
'.scss',
'.txt',
'.yml'
Expand Down
2 changes: 1 addition & 1 deletion build/rollup.config.js
Expand Up @@ -2,7 +2,7 @@

const path = require('path')
const babel = require('rollup-plugin-babel')
const resolve = require('rollup-plugin-node-resolve')
const resolve = require('@rollup/plugin-node-resolve')
const banner = require('./banner.js')

const BUNDLE = process.env.BUNDLE === 'true'
Expand Down
35 changes: 19 additions & 16 deletions build/ship.sh
@@ -1,4 +1,7 @@
#!/usr/bin/env bash

set -e

#
# Usage
# ---------------
Expand All @@ -18,35 +21,35 @@ end=$'\e[0m'
current_version=$(node -p "require('./package.json').version")

if [[ $# -lt 1 ]]; then
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" $red $end
printf "\n%s⚠️ Shipping aborted. You must specify a version.\n%s" "$red" "$end"
exit 1
fi

# Pulling latest changes, just to be sure
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sPulling latest changes...%s" $magenta $end
printf "\n%s=======================================================\n\n%s" $magenta $end
printf "\n%s=======================================================%s" "$magenta" "$end"
printf "\n%sPulling latest changes...%s" "$magenta" "$end"
printf "\n%s=======================================================\n\n%s" "$magenta" "$end"
git pull origin v4-dev

# Update version number
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sUpdating version number...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
printf "\n%s=======================================================%s" "$magenta" "$end"
printf "\n%sUpdating version number...%s" "$magenta" "$end"
printf "\n%s=======================================================\n%s" "$magenta" "$end"
npm run release-version "$current_version" "$1"

# Build release
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sBuilding release...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
printf "\n%s=======================================================%s" "$magenta" "$end"
printf "\n%sBuilding release...%s" "$magenta" "$end"
printf "\n%s=======================================================\n%s" "$magenta" "$end"
npm run release

# Copy the contents of the built docs site over to `bs-docs` repo
printf "\n%s=======================================================%s" $magenta $end
printf "\n%sCopy it over...%s" $magenta $end
printf "\n%s=======================================================\n%s" $magenta $end
printf "\n%s=======================================================%s" "$magenta" "$end"
printf "\n%sCopy it over...%s" "$magenta" "$end"
printf "\n%s=======================================================\n%s" "$magenta" "$end"
cp -rf _gh_pages/. ../bs-docs/
printf "\nDone!\n"

printf "\n%s=======================================================%s" $green $end
printf "\n%sSuccess, $1 is ready to review and publish.%s" $green $end
printf "\n%s=======================================================\n\n%s" $green $end
printf "\n%s=======================================================%s" "$green" "$end"
printf "\n%sSuccess, $1 is ready to review and publish.%s" "$green" "$end"
printf "\n%s=======================================================\n\n%s" "$green" "$end"
2 changes: 1 addition & 1 deletion build/vnu-jar.js
Expand Up @@ -18,7 +18,7 @@ childProcess.exec('java -version', (error, stdout, stderr) => {
return
}

const is32bitJava = !stderr.match(/64-Bit/)
const is32bitJava = !/64-Bit/.test(stderr)

// vnu-jar accepts multiple ignores joined with a `|`.
// Also note that the ignores are regular expressions.
Expand Down
2 changes: 1 addition & 1 deletion bundlesize.config.json
Expand Up @@ -38,7 +38,7 @@
},
{
"path": "./dist/js/bootstrap.min.js",
"maxSize": "15.5 kB"
"maxSize": "15.75 kB"
}
]
}
7 changes: 5 additions & 2 deletions js/src/modal.js
Expand Up @@ -325,9 +325,12 @@ class Modal {
}

_setEscapeEvent() {
if (this._isShown && this._config.keyboard) {
if (this._isShown) {
$(this._element).on(Event.KEYDOWN_DISMISS, (event) => {
if (event.which === ESCAPE_KEYCODE) {
if (this._config.keyboard && event.which === ESCAPE_KEYCODE) {
event.preventDefault()
this.hide()
} else if (!this._config.keyboard && event.which === ESCAPE_KEYCODE) {
this._triggerBackdropTransition()
}
})
Expand Down
8 changes: 4 additions & 4 deletions js/src/tools/sanitizer.js
Expand Up @@ -37,7 +37,7 @@ export const DefaultWhitelist = {
h5: [],
h6: [],
i: [],
img: ['src', 'alt', 'title', 'width', 'height'],
img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
li: [],
ol: [],
p: [],
Expand Down Expand Up @@ -71,7 +71,7 @@ function allowedAttribute(attr, allowedAttributeList) {

if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
return SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)
}

return true
Expand All @@ -80,8 +80,8 @@ function allowedAttribute(attr, allowedAttributeList) {
const regExp = allowedAttributeList.filter((attrRegex) => attrRegex instanceof RegExp)

// Check if a regular expression validates the attribute.
for (let i = 0, l = regExp.length; i < l; i++) {
if (attrName.match(regExp[i])) {
for (let i = 0, len = regExp.length; i < len; i++) {
if (regExp[i].test(attrName)) {
return true
}
}
Expand Down
4 changes: 2 additions & 2 deletions js/tests/integration/rollup.bundle.js
@@ -1,7 +1,7 @@
/* eslint-env node */

const resolve = require('rollup-plugin-node-resolve')
const commonjs = require('rollup-plugin-commonjs')
const resolve = require('@rollup/plugin-node-resolve')
const commonjs = require('@rollup/plugin-commonjs')
const babel = require('rollup-plugin-babel')

module.exports = {
Expand Down

0 comments on commit b79614b

Please sign in to comment.