Skip to content

Commit

Permalink
Merge branch 'main' into main-xmr-browserstack-sha
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed May 22, 2021
2 parents 57c83eb + b39b665 commit 1239d54
Show file tree
Hide file tree
Showing 293 changed files with 20,451 additions and 14,905 deletions.
8 changes: 2 additions & 6 deletions .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ last 2 major versions
not dead
Chrome >= 60
Firefox >= 60
# needed since Legacy Edge still has usage; 79 was the first Chromium Edge version
# should be removed in the future when its usage drops or when it's moved to dead browsers
not Edge < 79
Firefox ESR
iOS >= 10
Safari >= 10
Android >= 6
iOS >= 12
Safari >= 12
not Explorer <= 11
12 changes: 6 additions & 6 deletions .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,31 @@
},
{
"path": "./dist/css/bootstrap.css",
"maxSize": "24 kB"
"maxSize": "24.25 kB"
},
{
"path": "./dist/css/bootstrap.min.css",
"maxSize": "22 kB"
"maxSize": "22.25 kB"
},
{
"path": "./dist/js/bootstrap.bundle.js",
"maxSize": "42 kB"
"maxSize": "41.5 kB"
},
{
"path": "./dist/js/bootstrap.bundle.min.js",
"maxSize": "21.75 kB"
"maxSize": "22.25 kB"
},
{
"path": "./dist/js/bootstrap.esm.js",
"maxSize": "27 kB"
},
{
"path": "./dist/js/bootstrap.esm.min.js",
"maxSize": "18 kB"
"maxSize": "18.25 kB"
},
{
"path": "./dist/js/bootstrap.js",
"maxSize": "28 kB"
"maxSize": "27.5 kB"
},
{
"path": "./dist/js/bootstrap.min.js",
Expand Down
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/*.min.js
**/dist/
**/vendor/
/_gh_pages/
/_site/
/js/coverage/
/site/static/sw.js
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"plugin:import/errors",
"plugin:import/warnings",
"plugin:unicorn/recommended",
"xo/esnext",
"xo",
"xo/browser"
],
"rules": {
Expand Down Expand Up @@ -51,6 +51,7 @@
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-dataset": "off",
"unicorn/prefer-dom-node-remove": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-spread": "off",
"unicorn/prevent-abbreviations": "off"
Expand Down
5 changes: 4 additions & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ categories:
- 'fix'
- 'bugfix'
- 'bug'
- title: '⚡ Performance Improvements'
- title: '⚡ Performance improvements'
labels:
- 'performance'
- title: '🎨 CSS'
Expand All @@ -29,6 +29,9 @@ categories:
- title: '📖 Docs'
labels:
- 'docs'
- title: '🛠 Examples'
labels:
- 'examples'
- title: '🌎 Accessibility'
labels:
- 'accessibility'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Bundlewatch

on:
push:
branches-ignore:
- "dependabot/**"
pull_request:

env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
branches:
- main
- v4-dev
- "!dependabot/**"
schedule:
- cron: "0 2 * * 5"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12, 14]
node: [12, 14, 16]

steps:
- name: Clone repository
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Ignore docs files
/_gh_pages/
/_site/
# Hugo resources folder
/resources/

Expand Down
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
**/*.min.css
**/dist/
**/vendor/
/_gh_pages/
/_site/
/js/coverage/
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
</p>


## Bootstrap 4
## Bootstrap 5

Our default branch is for development of our upcoming Bootstrap 5 release. Head to the [`v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev) to view the readme, documentation, and source code for Bootstrap 4.
Our default branch is for development of our Bootstrap 5 release. Head to the [`v4-dev` branch](https://github.com/twbs/bootstrap/tree/v4-dev) to view the readme, documentation, and source code for Bootstrap 4.


## Table of contents
Expand All @@ -46,11 +46,11 @@ Our default branch is for development of our upcoming Bootstrap 5 release. Head

Several quick start options are available:

- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.0.0-beta2.zip)
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.0.1.zip)
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap@next`
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap@next`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.0.0-beta2`
- Install with [npm](https://www.npmjs.com/): `npm install bootstrap`
- Install with [yarn](https://yarnpkg.com/): `yarn add bootstrap`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.0.1`
- Install with [NuGet](https://www.nuget.org/): CSS: `Install-Package bootstrap` Sass: `Install-Package bootstrap.sass`

Read the [Getting started page](https://getbootstrap.com/docs/5.0/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
Expand All @@ -59,7 +59,7 @@ Read the [Getting started page](https://getbootstrap.com/docs/5.0/getting-starte
## Status

[![Slack](https://bootstrap-slack.herokuapp.com/badge.svg)](https://bootstrap-slack.herokuapp.com/)
[![Build Status](https://github.com/twbs/bootstrap/workflows/JS%20Tests/badge.svg?branch=main)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
[![Build Status](https://img.shields.io/github/workflow/status/twbs/bootstrap/JS%20Tests/main?label=JS%20Tests&logo=github)](https://github.com/twbs/bootstrap/actions?query=workflow%3AJS+Tests+branch%3Amain)
[![npm version](https://img.shields.io/npm/v/bootstrap)](https://www.npmjs.com/package/bootstrap)
[![Gem version](https://img.shields.io/gem/v/bootstrap)](https://rubygems.org/gems/bootstrap)
[![Meteor Atmosphere](https://img.shields.io/badge/meteor-twbs%3Abootstrap-blue)](https://atmospherejs.com/twbs/bootstrap)
Expand Down
9 changes: 6 additions & 3 deletions build/build-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const bsPlugins = {
Collapse: path.resolve(__dirname, '../js/src/collapse.js'),
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
Modal: path.resolve(__dirname, '../js/src/modal.js'),
Offcanvas: path.resolve(__dirname, '../js/src/offcanvas.js'),
Popover: path.resolve(__dirname, '../js/src/popover.js'),
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
Tab: path.resolve(__dirname, '../js/src/tab.js'),
Expand Down Expand Up @@ -64,14 +65,15 @@ const getConfigByPluginKey = pluginKey => {
pluginKey === 'EventHandler' ||
pluginKey === 'SelectorEngine' ||
pluginKey === 'Util' ||
pluginKey === 'Sanitizer'
pluginKey === 'Sanitizer' ||
pluginKey === 'Backdrop'
) {
return {
external: []
}
}

if (pluginKey === 'Alert' || pluginKey === 'Tab') {
if (pluginKey === 'Alert' || pluginKey === 'Tab' || pluginKey === 'Offcanvas') {
return defaultPluginConfig
}

Expand Down Expand Up @@ -132,7 +134,8 @@ const getConfigByPluginKey = pluginKey => {

const utilObjects = new Set([
'Util',
'Sanitizer'
'Sanitizer',
'Backdrop'
])

const domObjects = new Set([
Expand Down
121 changes: 45 additions & 76 deletions build/change-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@

'use strict'

const fs = require('fs')
const fs = require('fs').promises
const path = require('path')
const sh = require('shelljs')

sh.config.fatal = true
const globby = require('globby')

const VERBOSE = process.argv.includes('--verbose')
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')

// These are the filetypes we only care about replacing the version
const GLOB = [
'**/*.{css,html,js,json,md,scss,txt,yml}'
]
const GLOBBY_OPTIONS = {
cwd: path.join(__dirname, '..'),
gitignore: true
}

// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(string) {
Expand All @@ -24,89 +34,48 @@ function regExpQuoteReplacement(string) {
return string.replace(/\$/g, '$$')
}

const DRY_RUN = false
async function replaceRecursively(file, oldVersion, newVersion) {
const originalString = await fs.readFile(file, 'utf8')
const newString = originalString.replace(
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
)

function walkAsync(directory, excludedDirectories, fileCallback, errback) {
if (excludedDirectories.has(path.parse(directory).base)) {
// No need to move any further if the strings are identical
if (originalString === newString) {
return
}

fs.readdir(directory, (err, names) => {
if (err) {
errback(err)
return
}

names.forEach(name => {
const filepath = path.join(directory, name)
fs.lstat(filepath, (err, stats) => {
if (err) {
process.nextTick(errback, err)
return
}

if (stats.isDirectory()) {
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
} else if (stats.isFile()) {
process.nextTick(fileCallback, filepath)
}
})
})
})
}
if (VERBOSE) {
console.log(`FILE: ${file}`)
}

function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
original = new RegExp(regExpQuote(original), 'g')
replacement = regExpQuoteReplacement(replacement)
const updateFile = DRY_RUN ?
filepath => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
console.log(`FILE: ${filepath}`)
} else {
console.log(`EXCLUDED:${filepath}`)
}
} :
filepath => {
if (allowedExtensions.has(path.parse(filepath).ext)) {
sh.sed('-i', original, replacement, filepath)
}
}

walkAsync(directory, excludedDirectories, updateFile, err => {
console.error('ERROR while traversing directory!:')
console.error(err)
process.exit(1)
})
if (DRY_RUN) {
return
}

await fs.writeFile(file, newString, 'utf8')
}

function main(args) {
if (args.length !== 2) {
console.error('USAGE: change-version old_version new_version')
async function main(args) {
const [oldVersion, newVersion] = args

if (!oldVersion || !newVersion) {
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
console.error('Got arguments:', args)
process.exit(1)
}

const oldVersion = args[0]
const newVersion = args[1]
const EXCLUDED_DIRS = new Set([
'.git',
'_gh_pages',
'node_modules',
'resources'
])
const INCLUDED_EXTENSIONS = new Set([
// This extension allowlist is how we avoid modifying binary files
'',
'.css',
'.html',
'.js',
'.json',
'.md',
'.scss',
'.txt',
'.yml'
])
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
[oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)

try {
const files = await globby(GLOB, GLOBBY_OPTIONS)

await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
} catch (error) {
console.error(error)
process.exit(1)
}
}

main(process.argv.slice(2))
8 changes: 7 additions & 1 deletion build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ if (BUNDLE) {
// Remove last entry in external array to bundle Popper
external.pop()
delete globals['@popperjs/core']
plugins.push(replace({ 'process.env.NODE_ENV': '"production"' }), nodeResolve())
plugins.push(
replace({
'process.env.NODE_ENV': '"production"',
preventAssignment: true
}),
nodeResolve()
)
}

const rollupConfig = {
Expand Down

0 comments on commit 1239d54

Please sign in to comment.