Skip to content

Commit

Permalink
Merge branch 'main' into accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-deramond authored Nov 17, 2023
2 parents 3257584 + 55952bf commit 5bcdd55
Show file tree
Hide file tree
Showing 181 changed files with 2,874 additions and 2,358 deletions.
2 changes: 1 addition & 1 deletion .bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
{
"path": "./dist/js/bootstrap.bundle.min.js",
"maxSize": "23.15 kB"
"maxSize": "23.25 kB"
},
{
"path": "./dist/js/bootstrap.esm.js",
Expand Down
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"dropright",
"dropstart",
"dropup",
"dgst",
"errorf",
"favicon",
"favicons",
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"node": true
},
"parserOptions": {
"sourceType": "script"
"sourceType": "module"
},
"rules": {
"no-console": "off",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/browserstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bundlewatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/calibreapp-image-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@ on:
- '**.png'
- '**.webp'

permissions:
contents: read

jobs:
build:
# Only run on Pull Requests within the same repository, and not from forks.
if: github.event.pull_request.head.repo.full_name == github.repository
name: calibreapp/image-actions
runs-on: ubuntu-latest
permissions:
# allow calibreapp/image-actions to update PRs
pull-requests: write
steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Run cspell
uses: streetsidesoftware/cspell-action@v2
uses: streetsidesoftware/cspell-action@v4
with:
config: ".cspell.json"
files: "**/*.md"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/css.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE }}
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"
cache: npm
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-sass.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "${{ env.NODE }}"

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ Our default branch is for development of our Bootstrap 5 release. Head to the [`

Several quick start options are available:

- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.3.0.zip)
- [Download the latest release](https://github.com/twbs/bootstrap/archive/v5.3.2.zip)
- Clone the repo: `git clone https://github.com/twbs/bootstrap.git`
- Install with [npm](https://www.npmjs.com/): `npm install [email protected].0`
- Install with [yarn](https://yarnpkg.com/): `yarn add [email protected].0`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.3.0`
- Install with [npm](https://www.npmjs.com/): `npm install [email protected].2`
- Install with [yarn](https://yarnpkg.com/): `yarn add [email protected].2`
- Install with [Composer](https://getcomposer.org/): `composer require twbs/bootstrap:5.3.2`
- 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.3/getting-started/introduction/) for information on the framework contents, templates, examples, and more.
Expand All @@ -69,7 +69,6 @@ Read the [Getting started page](https://getbootstrap.com/docs/5.3/getting-starte
[![CSS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/css/bootstrap.min.css?compression=brotli&label=CSS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/dist/css/bootstrap.min.css)
[![JS gzip size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=gzip&label=JS%20gzip%20size)](https://github.com/twbs/bootstrap/blob/main/dist/js/bootstrap.min.js)
[![JS Brotli size](https://img.badgesize.io/twbs/bootstrap/main/dist/js/bootstrap.min.js?compression=brotli&label=JS%20Brotli%20size)](https://github.com/twbs/bootstrap/blob/main/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)
[![Backers on Open Collective](https://img.shields.io/opencollective/backers/bootstrap?logo=opencollective&logoColor=fff)](#backers)
[![Sponsors on Open Collective](https://img.shields.io/opencollective/sponsors/bootstrap?logo=opencollective&logoColor=fff)](#sponsors)

Expand Down Expand Up @@ -177,7 +176,8 @@ Get updates on Bootstrap's development and chat with the project maintainers and

- Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
- Read and subscribe to [The Official Bootstrap Blog](https://blog.getbootstrap.com/).
- Ask and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions).
- Ask questions and explore [our GitHub Discussions](https://github.com/twbs/bootstrap/discussions).
- Discuss, ask questions, and more on [the community Discord](https://discord.gg/bZUvakRU3M) or [Bootstrap subreddit](https://reddit.com/r/bootstrap).
- Chat with fellow Bootstrappers in IRC. On the `irc.libera.chat` server, in the `#bootstrap` channel.
- Implementation help may be found at Stack Overflow (tagged [`bootstrap-5`](https://stackoverflow.com/questions/tagged/bootstrap-5)).
- Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
Expand Down
11 changes: 8 additions & 3 deletions build/banner.js → build/banner.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict'
import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const pkg = require('../package.json')
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const pkgJson = path.join(__dirname, '../package.json')
const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))

const year = new Date().getFullYear()

Expand All @@ -12,4 +17,4 @@ function getBanner(pluginFilename) {
*/`
}

module.exports = getBanner
export default getBanner
16 changes: 9 additions & 7 deletions build/build-plugins.js → build/build-plugins.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { babel } from '@rollup/plugin-babel'
import globby from 'globby'
import { rollup } from 'rollup'
import banner from './banner.mjs'

const path = require('node:path')
const rollup = require('rollup')
const globby = require('globby')
const { babel } = require('@rollup/plugin-babel')
const banner = require('./banner.js')
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(fileURLToPath(import.meta.url))

const sourcePath = path.resolve(__dirname, '../js/src/').replace(/\\/g, '/')
const jsFiles = globby.sync(`${sourcePath}/**/*.js`)
Expand All @@ -37,7 +39,7 @@ for (const file of jsFiles) {
const build = async plugin => {
const globals = {}

const bundle = await rollup.rollup({
const bundle = await rollup({
input: plugin.src,
plugins: [
babel({
Expand Down
44 changes: 28 additions & 16 deletions build/change-version.js → build/change-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'

const fs = require('node:fs').promises
const path = require('node:path')
const globby = require('globby')
import { execFile } from 'node:child_process'
import fs from 'node:fs/promises'
import process from 'node:process'

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}'
// These are the files we only care about replacing the version
const FILES = [
'README.md',
'hugo.yml',
'js/src/base-component.js',
'package.js',
'scss/mixins/_banner.scss',
'site/data/docs-versions.yml'
]
const GLOBBY_OPTIONS = {
cwd: path.join(__dirname, '..'),
gitignore: true
}

// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(string) {
Expand Down Expand Up @@ -53,7 +52,7 @@ async function replaceRecursively(file, oldVersion, newVersion) {
}

if (VERBOSE) {
console.log(`FILE: ${file}`)
console.log(`Found ${oldVersion} in ${file}`)
}

if (DRY_RUN) {
Expand All @@ -63,6 +62,19 @@ async function replaceRecursively(file, oldVersion, newVersion) {
await fs.writeFile(file, newString, 'utf8')
}

function bumpNpmVersion(newVersion) {
if (DRY_RUN) {
return
}

execFile('npm', ['version', newVersion, '--no-git-tag'], { shell: true }, error => {
if (error) {
console.error(error)
process.exit(1)
}
})
}

function showUsage(args) {
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
console.error('Got arguments:', args)
Expand All @@ -86,11 +98,11 @@ async function main(args) {
showUsage(args)
}

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

try {
await Promise.all(
files.map(file => replaceRecursively(file, oldVersion, newVersion))
FILES.map(file => replaceRecursively(file, oldVersion, newVersion))
)
} catch (error) {
console.error(error)
Expand Down
17 changes: 9 additions & 8 deletions build/generate-sri.js → build/generate-sri.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'
import crypto from 'node:crypto'
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import sh from 'shelljs'

const crypto = require('node:crypto')
const fs = require('node:fs')
const path = require('node:path')
const sh = require('shelljs')
const __dirname = path.dirname(fileURLToPath(import.meta.url))

sh.config.fatal = true

Expand Down Expand Up @@ -52,9 +53,9 @@ for (const { file, configPropertyName } of files) {
throw error
}

const algo = 'sha384'
const hash = crypto.createHash(algo).update(data, 'utf8').digest('base64')
const integrity = `${algo}-${hash}`
const algorithm = 'sha384'
const hash = crypto.createHash(algorithm).update(data, 'utf8').digest('base64')
const integrity = `${algorithm}-${hash}`

console.log(`${configPropertyName}: ${integrity}`)

Expand Down
4 changes: 1 addition & 3 deletions build/postcss.config.js → build/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use strict'

const mapConfig = {
inline: false,
annotation: true,
sourcesContent: true
}

module.exports = context => {
export default context => {
return {
map: context.file.dirname.includes('examples') ? false : mapConfig,
plugins: {
Expand Down
Loading

0 comments on commit 5bcdd55

Please sign in to comment.