Skip to content

Commit 94a0ba4

Browse files
committed
Merge branch 'v4-dev' of https://github.com/coreui/coreui into v4-dev-sync
# Conflicts: # config.yml # dist/css/coreui-grid.css # dist/css/coreui-grid.css.map # dist/css/coreui-grid.min.css # dist/css/coreui-grid.min.css.map # dist/css/coreui-grid.rtl.css # dist/css/coreui-grid.rtl.css.map # dist/css/coreui-grid.rtl.min.css # dist/css/coreui-grid.rtl.min.css.map # dist/css/coreui-reboot.css # dist/css/coreui-reboot.css.map # dist/css/coreui-reboot.min.css # dist/css/coreui-reboot.min.css.map # dist/css/coreui-reboot.rtl.css # dist/css/coreui-reboot.rtl.css.map # dist/css/coreui-reboot.rtl.min.css # dist/css/coreui-reboot.rtl.min.css.map # dist/css/coreui-utilities.css # dist/css/coreui-utilities.css.map # dist/css/coreui-utilities.min.css # dist/css/coreui-utilities.min.css.map # dist/css/coreui-utilities.rtl.css # dist/css/coreui-utilities.rtl.css.map # dist/css/coreui-utilities.rtl.min.css # dist/css/coreui-utilities.rtl.min.css.map # dist/css/coreui.css # dist/css/coreui.css.map # dist/css/coreui.min.css # dist/css/coreui.min.css.map # dist/css/coreui.rtl.css # dist/css/coreui.rtl.css.map # dist/css/coreui.rtl.min.css # dist/css/coreui.rtl.min.css.map # dist/js/coreui.bundle.js # dist/js/coreui.bundle.js.map # dist/js/coreui.bundle.min.js # dist/js/coreui.bundle.min.js.map # dist/js/coreui.esm.js # dist/js/coreui.esm.js.map # dist/js/coreui.esm.min.js # dist/js/coreui.esm.min.js.map # dist/js/coreui.js # dist/js/coreui.js.map # dist/js/coreui.min.js # dist/js/coreui.min.js.map # package-lock.json # scss/coreui-grid.rtl.scss # scss/coreui-grid.scss # scss/coreui-reboot.rtl.scss # scss/coreui-reboot.scss # scss/coreui-utilities.rtl.scss # scss/coreui-utilities.scss # scss/coreui.rtl.scss # scss/coreui.scss
2 parents 591cd0d + 36d1557 commit 94a0ba4

File tree

210 files changed

+11174
-12069
lines changed

Some content is hidden

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

210 files changed

+11174
-12069
lines changed

.browserslistrc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ last 2 major versions
55
not dead
66
Chrome >= 60
77
Firefox >= 60
8-
# needed since Legacy Edge still has usage; 79 was the first Chromium Edge version
9-
# should be removed in the future when its usage drops or when it's moved to dead browsers
10-
not Edge < 79
118
Firefox ESR
12-
iOS >= 10
13-
Safari >= 10
14-
Android >= 6
9+
iOS >= 12
10+
Safari >= 12
1511
not Explorer <= 11

.bundlewatch.config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
],
6060
"ci": {
6161
"trackBranches": [
62-
"main",
6362
"v4-dev"
6463
]
6564
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@
4141

4242
Several quick start options are available:
4343

44-
- [Download the latest release](https://github.com/coreui/coreui/archive/v4.0.0-alpha.4.zip)
44+
- [Download the latest release](https://github.com/coreui/coreui/archive/v4.0.0-alpha.5.zip)
4545
- Clone the repo: `git clone https://github.com/coreui/coreui.git`
4646
- Install with [npm](https://www.npmjs.com/): `npm install @coreui/coreui@next`
4747
- Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/coreui@next`
48-
- Install with [Composer](https://getcomposer.org/): `composer require coreui/coreui:4.0.0-alpha.4`
48+
- Install with [Composer](https://getcomposer.org/): `composer require coreui/coreui:4.0.0-alpha.5`
4949

5050
Read the [Getting started page](https://coreui.io/docs/4.0/getting-started/introduction/) for information on the framework contents, templates and examples, and more.
5151

build/build-plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const bsPlugins = {
3535
Collapse: path.resolve(__dirname, '../js/src/collapse.js'),
3636
Dropdown: path.resolve(__dirname, '../js/src/dropdown.js'),
3737
Modal: path.resolve(__dirname, '../js/src/modal.js'),
38-
OffCanvas: path.resolve(__dirname, '../js/src/offcanvas.js'),
38+
Offcanvas: path.resolve(__dirname, '../js/src/offcanvas.js'),
3939
Popover: path.resolve(__dirname, '../js/src/popover.js'),
4040
ScrollSpy: path.resolve(__dirname, '../js/src/scrollspy.js'),
4141
Tab: path.resolve(__dirname, '../js/src/tab.js'),
@@ -72,7 +72,7 @@ const getConfigByPluginKey = pluginKey => {
7272
}
7373
}
7474

75-
if (pluginKey === 'Alert' || pluginKey === 'Tab' || pluginKey === 'OffCanvas') {
75+
if (pluginKey === 'Alert' || pluginKey === 'Tab' || pluginKey === 'Offcanvas') {
7676
return defaultPluginConfig
7777
}
7878

build/change-version.js

Lines changed: 48 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@
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+
}
27+
const EXCLUDED_FILES = [
28+
'CHANGELOG.md'
29+
]
1730

1831
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
1932
function regExpQuote(string) {
@@ -24,93 +37,48 @@ function regExpQuoteReplacement(string) {
2437
return string.replace(/\$/g, '$$')
2538
}
2639

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

29-
function walkAsync(directory, excludedDirectories, fileCallback, errback) {
30-
if (excludedDirectories.has(path.parse(directory).base)) {
46+
// No need to move any further if the strings are identical
47+
if (originalString === newString) {
3148
return
3249
}
3350

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-
}
51+
if (VERBOSE) {
52+
console.log(`FILE: ${file}`)
53+
}
5754

58-
// eslint-disable-next-line max-params
59-
function replaceRecursively(directory, excludedDirectories, excludedFiles, allowedExtensions, original, replacement) {
60-
original = new RegExp(regExpQuote(original), 'g')
61-
replacement = regExpQuoteReplacement(replacement)
62-
const updateFile = DRY_RUN ?
63-
filepath => {
64-
if (allowedExtensions.has(path.parse(filepath).ext)) {
65-
console.log(`FILE: ${filepath}`)
66-
} else {
67-
console.log(`EXCLUDED:${filepath}`)
68-
}
69-
} :
70-
filepath => {
71-
if (allowedExtensions.has(path.parse(filepath).ext) && !excludedFiles.has(path.parse(filepath).base)) {
72-
sh.sed('-i', original, replacement, filepath)
73-
}
74-
}
75-
76-
walkAsync(directory, excludedDirectories, updateFile, err => {
77-
console.error('ERROR while traversing directory!:')
78-
console.error(err)
79-
process.exit(1)
80-
})
55+
if (DRY_RUN) {
56+
return
57+
}
58+
59+
await fs.writeFile(file, newString, 'utf8')
8160
}
8261

83-
function main(args) {
84-
if (args.length !== 2) {
85-
console.error('USAGE: change-version old_version new_version')
62+
async function main(args) {
63+
const [oldVersion, newVersion] = args
64+
65+
if (!oldVersion || !newVersion) {
66+
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
8667
console.error('Got arguments:', args)
8768
process.exit(1)
8869
}
8970

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

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

build/rollup.config.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ if (BUNDLE) {
2828
// Remove last entry in external array to bundle Popper
2929
external.pop()
3030
delete globals['@popperjs/core']
31-
plugins.push(replace({ 'process.env.NODE_ENV': '"production"' }), nodeResolve())
31+
plugins.push(
32+
replace({
33+
'process.env.NODE_ENV': '"production"',
34+
preventAssignment: true
35+
}),
36+
nodeResolve()
37+
)
3238
}
3339

3440
const rollupConfig = {

config.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ params:
4646
authors: "Lukasz Holeczek, Andrzej Kopanski"
4747
social_image_path: /4.0/assets/brand/coreui-social.jpg
4848
social_logo_path: /4.0/assets/brand/coreui-social-logo.png
49-
50-
current_version: "4.0.0-alpha.4"
51-
current_ruby_version: "4.0.0-alpha.4"
49+
current_version: "4.0.0-alpha.5"
50+
current_ruby_version: "4.0.0-alpha.5"
5251
docs_version: "4.0"
5352
rfs_version: "9.0.3"
5453
github_org: "https://github.com/coreui"
@@ -59,17 +58,18 @@ params:
5958
icons: "https://icons.coreui.io/"
6059

6160
download:
62-
source: "https://github.com/coreui/coreui/archive/v4.0.0-alpha.4.zip"
63-
dist: "https://github.com/coreui/coreui/releases/download/v4.0.0-alpha.4/coreui-4.0.0-alpha.4-dist.zip"
61+
source: "https://github.com/coreui/coreui/archive/v4.0.0-alpha.5.zip"
62+
dist: "https://github.com/coreui/coreui/releases/download/v4.0.0-alpha.5/coreui-4.0.0-alpha.5-dist.zip"
6463

6564
cdn:
66-
css: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/css/coreui.min.css"
67-
css_hash: "sha384-Cuk9C8m0rzqvRAuSeKrC0v7IZOb6K0SsEQw/2VkgAxSMiTfuN3o+QU8DmXA0z8sc"
68-
css_rtl: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/coreui.rtl.min.css"
69-
css_rtl_hash: "sha384-yuKCtc48GzCRCByKfWCJYoaois+UPGWUAg/2KzaFcQ99QzsQEUfqw0e+NVX0Fb1a"
70-
js: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/js/coreui.min.js"
71-
js_hash: "sha384-JjNO7eIqYvTAoQIV/PF/Pqibxsue8Um47wwQ9xEbbRzsMzedRHlWZeW6qJkAQoXK"
72-
js_bundle: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/js/coreui.bundle.min.js"
73-
js_bundle_hash: "sha384-5262ffIwClekK93HvKLcR75mskXJwxCGETszstBDw+RiVsEWa20d7ws9Z9Kj7Qhs"
65+
# See https://www.srihash.org for info on how to generate the hashes
66+
css: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/css/coreui.min.css"
67+
css_hash: "sha384-nq/FcuyWO6kBZwQBQe8qhEg1ZijKo3hUGxXUPioCrYg3+qzJ5oiOWxgdMbx99Uvn"
68+
css_rtl: "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/coreui.rtl.min.css"
69+
css_rtl_hash: "sha384-aYFu/+a5HgTdKB1OifM22TDa8/olw1MwfLfFKmt3eghKMgvObHs50k1TDMJZKLrN"
70+
js: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/js/coreui.min.js"
71+
js_hash: "sha384-wcl5o76hhofzSFCtu4v3MPp2iasgPXqvmTRH42vlbCSKGQW6fTJfNtXgZoptMh+O"
72+
js_bundle: "https://cdn.jsdelivr.net/npm/@coreui/[email protected]/dist/js/coreui.bundle.min.js"
73+
js_bundle_hash: "sha384-AwyzMIzmGh58Iz7SoiQ2VoGasfZw82kgX0vYAOtapnFtlSv2UXjQ4VkM4BJAo6A4"
7474
popper: "https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js"
75-
popper_hash: "sha384-EOlc5FUOsy7obkrpNXqD9DtrephzQpK7DXijDIKexeJT0qfn4dZ7GDid8suWuQHq"
75+
popper_hash: "sha384-SR1sx49pcuLnqZUnnPwx6FCym0wLsk5JZuNx2bPPENzswTNFaQU1RDvt3wT4gWFG"

dist/css/coreui-grid.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/coreui-grid.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/coreui-grid.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)