Skip to content

Commit 08b8ffe

Browse files
Merge pull request #100 from MahdiMajidzadeh/dev
update to 4.6.2
2 parents f24c406 + 3b6f743 commit 08b8ffe

File tree

151 files changed

+29646
-36815
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+29646
-36815
lines changed

.browserslistrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# https://github.com/browserslist/browserslist#readme
2+
3+
>= 1%
4+
last 1 major version
5+
not dead
6+
Chrome >= 45
7+
Firefox >= 38
8+
Edge >= 12
9+
Explorer >= 10
10+
iOS >= 9
11+
Safari >= 9
12+
Android >= 4.4
13+
Opera >= 30

.bundlewatch.config.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"files": [
3+
{
4+
"path": "./dist/css/bootstrap-grid.css",
5+
"maxSize": "7 kB"
6+
},
7+
{
8+
"path": "./dist/css/bootstrap-grid.min.css",
9+
"maxSize": "6.25 kB"
10+
},
11+
{
12+
"path": "./dist/css/bootstrap-reboot.css",
13+
"maxSize": "2 kB"
14+
},
15+
{
16+
"path": "./dist/css/bootstrap-reboot.min.css",
17+
"maxSize": "2 kB"
18+
},
19+
{
20+
"path": "./dist/css/bootstrap.css",
21+
"maxSize": "26 kB"
22+
},
23+
{
24+
"path": "./dist/css/bootstrap.min.css",
25+
"maxSize": "23.75 kB"
26+
},
27+
{
28+
"path": "./dist/js/bootstrap.bundle.js",
29+
"maxSize": "48 kB"
30+
},
31+
{
32+
"path": "./dist/js/bootstrap.bundle.min.js",
33+
"maxSize": "21.75 kB"
34+
},
35+
{
36+
"path": "./dist/js/bootstrap.js",
37+
"maxSize": "25.5 kB"
38+
},
39+
{
40+
"path": "./dist/js/bootstrap.min.js",
41+
"maxSize": "15 kB"
42+
}
43+
],
44+
"ci": {
45+
"trackBranches": [
46+
"main",
47+
"v4-dev"
48+
]
49+
}
50+
}

.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
**/*.min.js
22
**/dist/
33
**/vendor/
4-
/_gh_pages/
4+
/_site/
55
/js/coverage/
66
/site/static/sw.js

.eslintrc.json

+18-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@
44
"plugin:import/errors",
55
"plugin:import/warnings",
66
"plugin:unicorn/recommended",
7-
"xo/esnext",
7+
"xo",
88
"xo/browser"
99
],
1010
"rules": {
11+
"arrow-body-style": "off",
1112
"capitalized-comments": "off",
13+
"comma-dangle": [
14+
"error",
15+
"never"
16+
],
1217
"indent": [
1318
"error",
1419
2,
@@ -34,27 +39,35 @@
3439
"error",
3540
"always"
3641
],
37-
"prefer-named-capture-group": "off",
42+
"operator-linebreak": [
43+
"error",
44+
"after"
45+
],
3846
"semi": [
3947
"error",
4048
"never"
4149
],
4250
"unicorn/consistent-function-scoping": "off",
4351
"unicorn/explicit-length-check": "off",
44-
"unicorn/import-index": "off",
4552
"unicorn/no-array-callback-reference": "off",
53+
"unicorn/no-array-for-each": "off",
54+
"unicorn/no-array-method-this-argument": "off",
4655
"unicorn/no-for-loop": "off",
4756
"unicorn/no-null": "off",
4857
"unicorn/no-unused-properties": "error",
4958
"unicorn/no-useless-undefined": "off",
59+
"unicorn/numeric-separators-style": "off",
5060
"unicorn/prefer-array-find": "off",
61+
"unicorn/prefer-array-flat": "off",
62+
"unicorn/prefer-dom-node-append": "off",
5163
"unicorn/prefer-dom-node-dataset": "off",
64+
"unicorn/prefer-dom-node-remove": "off",
5265
"unicorn/prefer-includes": "off",
5366
"unicorn/prefer-math-trunc": "off",
54-
"unicorn/prefer-dom-node-append": "off",
55-
"unicorn/prefer-dom-node-remove": "off",
67+
"unicorn/prefer-module": "off",
5668
"unicorn/prefer-number-properties": "off",
5769
"unicorn/prefer-optional-catch-binding": "off",
70+
"unicorn/prefer-prototype-methods": "off",
5871
"unicorn/prefer-query-selector": "off",
5972
"unicorn/prefer-reflect-apply": "off",
6073
"unicorn/prefer-set-has": "off",

.gitignore

+9-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# Ignore docs files
2-
_gh_pages
3-
_site
4-
5-
# Ignore ruby files
6-
.ruby-version
7-
.bundle
8-
vendor/cache
9-
vendor/bundle
2+
/_site/
3+
# Hugo files
4+
/resources/
5+
/.hugo_build.lock
106

117
# Numerous always-ignore extensions
128
*.diff
@@ -33,14 +29,14 @@ vendor/bundle
3329
*.sublime-workspace
3430
nbproject
3531
Thumbs.db
32+
/.vscode/
33+
# Local Netlify folder
34+
.netlify
3635

3736
# Komodo
3837
.komodotools
3938
*.komodoproject
4039

41-
# Jekyll metadata and extra config file for `github` script
42-
docs/.jekyll-metadata
43-
twbsconfig.yml
44-
4540
# Folders to ignore
46-
node_modules
41+
/js/coverage/
42+
/node_modules/

.stylelintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
**/*.min.css
22
**/dist/
33
**/vendor/
4-
/_gh_pages/
4+
/_site/
55
/js/coverage/

.stylelintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": [
3-
"stylelint-config-twbs-bootstrap/scss"
3+
"stylelint-config-twbs-bootstrap"
44
],
55
"rules": {
66
"declaration-property-value-disallowed-list": {

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2011-2022 Twitter, Inc.
4+
Copyright (c) 2011-2022 The Bootstrap Authors
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<h3 align="center">Bootstrap RTL</h3>
77
<p align="center">
8-
based on version 4.6.0
8+
based on version 4.6.2
99
</p>
1010
<p align="center">
1111
Sleek, intuitive, and powerful front-end framework for faster and easier web development.
@@ -50,3 +50,5 @@ We provide compiled CSS and JS (`bootstrap.*`), as well as compiled and minified
5050
## Contributors
5151

5252
Mahdi Majidzadeh [twitter](https://twitter.com/mahdimajidzadeh) - [github](https://github.com/mahdimajidzadeh)
53+
Dmitry Polyanovsky [github](https://github.com/danikp)
54+
Morteza Karimi[github](https://github.com/mortezakarimi)

SECURITY.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Reporting Security Issues
2+
3+
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
4+
5+
To report a security issue, email [[email protected]](mailto:[email protected]) and include the word "SECURITY" in the subject line.
6+
7+
We'll endeavor to respond quickly, and will keep you updated throughout the process.

build/build-plugins.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
/*!
44
* Script to build our plugins to use them separately.
5-
* Copyright 2020-2021 The Bootstrap Authors
6-
* Copyright 2020-2021 Twitter, Inc.
5+
* Copyright 2020-2022 The Bootstrap Authors
6+
* Copyright 2020-2022 Twitter, Inc.
77
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
88
*/
99

build/change-version.js

+45-74
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,28 @@
22

33
/*!
44
* Script to update version number references in the project.
5-
* Copyright 2017-2021 The Bootstrap Authors
6-
* Copyright 2017-2021 Twitter, Inc.
5+
* Copyright 2017-2022 The Bootstrap Authors
6+
* Copyright 2017-2022 Twitter, Inc.
77
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
88
*/
99

1010
'use strict'
1111

12-
const fs = require('fs')
12+
const fs = require('fs').promises
1313
const path = require('path')
14-
const sh = require('shelljs')
15-
16-
sh.config.fatal = true
14+
const globby = require('globby')
15+
16+
const VERBOSE = process.argv.includes('--verbose')
17+
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
18+
19+
// These are the filetypes we only care about replacing the version
20+
const GLOB = [
21+
'**/*.{css,html,js,json,md,scss,txt,yml}'
22+
]
23+
const GLOBBY_OPTIONS = {
24+
cwd: path.join(__dirname, '..'),
25+
gitignore: true
26+
}
1727

1828
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
1929
function regExpQuote(string) {
@@ -24,87 +34,48 @@ function regExpQuoteReplacement(string) {
2434
return string.replace(/\$/g, '$$')
2535
}
2636

27-
const DRY_RUN = false
37+
async function replaceRecursively(file, oldVersion, newVersion) {
38+
const originalString = await fs.readFile(file, 'utf8')
39+
const newString = originalString.replace(
40+
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
41+
)
2842

29-
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
30-
if (excludedDirectories.has(path.parse(directory).base)) {
43+
// No need to move any further if the strings are identical
44+
if (originalString === newString) {
3145
return
3246
}
3347

34-
fs.readdir(directory, (err, names) => {
35-
if (err) {
36-
errback(err)
37-
return
38-
}
39-
40-
names.forEach(name => {
41-
const filepath = path.join(directory, name)
42-
fs.lstat(filepath, (err, stats) => {
43-
if (err) {
44-
process.nextTick(errback, err)
45-
return
46-
}
47-
48-
if (stats.isDirectory()) {
49-
process.nextTick(walkAsync, filepath, excludedDirectories, fileCallback, errback)
50-
} else if (stats.isFile()) {
51-
process.nextTick(fileCallback, filepath)
52-
}
53-
})
54-
})
55-
})
56-
}
48+
if (VERBOSE) {
49+
console.log(`FILE: ${file}`)
50+
}
5751

58-
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
59-
original = new RegExp(regExpQuote(original), 'g')
60-
replacement = regExpQuoteReplacement(replacement)
61-
const updateFile = DRY_RUN ? filepath => {
62-
if (allowedExtensions.has(path.parse(filepath).ext)) {
63-
console.log(`FILE: ${filepath}`)
64-
} else {
65-
console.log(`EXCLUDED:${filepath}`)
66-
}
67-
} : filepath => {
68-
if (allowedExtensions.has(path.parse(filepath).ext)) {
69-
sh.sed('-i', original, replacement, filepath)
70-
}
52+
if (DRY_RUN) {
53+
return
7154
}
7255

73-
walkAsync(directory, excludedDirectories, updateFile, err => {
74-
console.error('ERROR while traversing directory!:')
75-
console.error(err)
76-
process.exit(1)
77-
})
56+
await fs.writeFile(file, newString, 'utf8')
7857
}
7958

80-
function main(args) {
81-
if (args.length !== 2) {
82-
console.error('USAGE: change-version old_version new_version')
59+
async function main(args) {
60+
let [oldVersion, newVersion] = args
61+
62+
if (!oldVersion || !newVersion) {
63+
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
8364
console.error('Got arguments:', args)
8465
process.exit(1)
8566
}
8667

87-
const oldVersion = args[0]
88-
const newVersion = args[1]
89-
const EXCLUDED_DIRS = new Set([
90-
'.git',
91-
'_gh_pages',
92-
'node_modules',
93-
'vendor'
94-
])
95-
const INCLUDED_EXTENSIONS = new Set([
96-
// This extension whitelist is how we avoid modifying binary files
97-
'',
98-
'.css',
99-
'.html',
100-
'.js',
101-
'.json',
102-
'.md',
103-
'.scss',
104-
'.txt',
105-
'.yml'
106-
])
107-
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
68+
// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
69+
[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
70+
71+
try {
72+
const files = await globby(GLOB, GLOBBY_OPTIONS)
73+
74+
await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
75+
} catch (error) {
76+
console.error(error)
77+
process.exit(1)
78+
}
10879
}
10980

11081
main(process.argv.slice(2))

0 commit comments

Comments
 (0)