Skip to content

Commit

Permalink
Merge branch 'main' into deprecate-icons
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Mar 25, 2023
2 parents 4ef32e3 + 3f637a5 commit 2f26bf7
Show file tree
Hide file tree
Showing 399 changed files with 4,918 additions and 8,347 deletions.
14 changes: 5 additions & 9 deletions .fantasticonrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const codepoints = require('./font/bootstrap-icons.json')

module.exports = {
inputDir: './icons', // (required)
outputDir: './font', // (required)
inputDir: './icons',
outputDir: './font',
fontTypes: ['woff2', 'woff'],
assetTypes: ['css', 'scss', 'json'],
name: 'bootstrap-icons',
Expand All @@ -17,20 +17,16 @@ module.exports = {
indent: 2
}
},
// Use a custom Handlebars template
// Use our custom Handlebars templates
templates: {
css: './build/font/css.hbs',
scss: './build/font/scss.hbs',
html: './build/font/html.hbs'
scss: './build/font/scss.hbs'
},
pathOptions: {
json: './font/bootstrap-icons.json',
css: './font/bootstrap-icons.css',
scss: './font/bootstrap-icons.scss',
html: './font/index.html',
ttf: './font/fonts/bootstrap-icons.ttf',
woff: './font/fonts/bootstrap-icons.woff',
woff2: './font/fonts/bootstrap-icons.woff2',
eot: './font/fonts/bootstrap-icons.eot'
woff2: './font/fonts/bootstrap-icons.woff2'
}
}
13 changes: 11 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ on:
- main
- "!dependabot/**"
pull_request:
# The branches below must be a subset of the branches above
branches:
- main
- "!dependabot/**"
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:

jobs:
analyze:
Expand All @@ -22,13 +23,21 @@ jobs:
security-events: write

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: "javascript"
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:javascript"
9 changes: 7 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
FORCE_COLOR: 2
NODE: 16
NODE: 18

jobs:
deploy:
Expand All @@ -17,6 +17,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
Expand Down Expand Up @@ -45,7 +47,10 @@ jobs:
needs: deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clone repository
uses: actions/checkout@v3
with:
persist-credentials: false

- uses: actions/setup-node@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
update_release_draft:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
branches-ignore:
- "dependabot/**"
pull_request:
workflow_dispatch:

env:
FORCE_COLOR: 2
NODE: 16
NODE: 18

jobs:
test:
Expand All @@ -17,6 +18,8 @@ jobs:
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@v3
Expand Down
8 changes: 0 additions & 8 deletions .stylelintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"stylelint-config-twbs-bootstrap"
],
"reportInvalidScopeDisables": true,
"reportNeedlessDisables": true,
"overrides": [
{
"files": "**/*.scss",
"rules": {
"scss/selector-no-union-class-name": true
}
}
]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<p align="center">
<a href="https://v5.getbootstrap.com/">
<img src="https://v5.getbootstrap.com/docs/5.0/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap logo" width="200" height="165">
<a href="https://getbootstrap.com/">
<img src="https://getbootstrap.com/docs/5.2/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap logo" width="200" height="165">
</a>
</p>

<h3 align="center">Bootstrap Icons</h3>

<p align="center">
Official open source SVG icon library for Bootstrap with over 1,800 icons.
Official open source SVG icon library for Bootstrap with over 1,900 icons.
<br>
<a href="https://icons.getbootstrap.com/"><strong>Explore Bootstrap Icons »</strong></a>
<br>
Expand Down Expand Up @@ -80,7 +80,7 @@ Here are some key scripts you'll use during development. Be sure to look to our
Icons are typically only added by @mdo, but exceptions can be made. New glyphs are designed in Figma first on a 16x16px grid, then exported as flattened SVGs with `fill` (no stroke). Once a new SVG icon has been added to the `icons` directory, we use an npm script to:

1. Optimize our SVGs with SVGO.
2. Modify the SVGs source HTML, removing all attributes before setting new attributes and values in our preferred order.
2. Modify the SVGs source code, removing all attributes before setting new attributes and values in our preferred order.

Use `npm run icons` to run the script, run `npm run pages` to build permalink pages, complete those pages, and, finally, commit the results in a new branch for updating.

Expand Down
2 changes: 1 addition & 1 deletion bootstrap-icons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions build/build-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

'use strict'

const fs = require('fs').promises
const path = require('path')
const fs = require('node:fs').promises
const path = require('node:path')
const picocolors = require('picocolors')

const iconsDir = path.join(__dirname, '../icons/')
Expand Down Expand Up @@ -53,7 +53,7 @@ tags:

const filesLength = files.length

console.log(picocolors.green('\nSuccess, %s page%s prepared!'), filesLength, filesLength !== 1 ? 's' : '')
console.log(picocolors.green('\nSuccess, %s page%s prepared!'), filesLength, filesLength === 1 ? '' : 's')
console.timeEnd(timeLabel)
} catch (error) {
console.error(error)
Expand Down
8 changes: 4 additions & 4 deletions build/build-svgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

'use strict'

const fs = require('fs').promises
const path = require('path')
const process = require('process')
const fs = require('node:fs').promises
const path = require('node:path')
const process = require('node:process')
const picocolors = require('picocolors')
const { loadConfig, optimize } = require('svgo')

Expand Down Expand Up @@ -46,7 +46,7 @@ async function processFile(file, config) {

const filesLength = files.length

console.log(picocolors.green('\nSuccess, prepared %s icon%s!'), filesLength, filesLength !== 1 ? 's' : '')
console.log(picocolors.green('\nSuccess, prepared %s icon%s!'), filesLength, filesLength === 1 ? '' : 's')
console.timeEnd(timeLabel)
} catch (error) {
console.error(error)
Expand Down
6 changes: 3 additions & 3 deletions build/font/css.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
src: {{{ fontSrc }}};
}

.{{prefix}}::before,
[class^="{{prefix}}-"]::before,
[class*=" {{prefix}}-"]::before {
.{{ prefix }}::before,
[class^="{{ prefix }}-"]::before,
[class*=" {{ prefix }}-"]::before {
display: inline-block;
font-family: {{ name }} !important;
font-style: normal;
Expand Down
11 changes: 6 additions & 5 deletions build/font/scss.hbs
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
${{ name }}-font: "{{ name }}" !default;
${{ name }}-font-dir: "{{ fontsUrl }}" !default;
${{ name }}-font-file: #{${{ name }}-font-dir}/#{${{ name }}-font} !default;
${{ name }}-font-hash: "56c0f95873eb8a64dba9b6190f3e25c4" !default;
${{ name }}-font-src: url("#{${{ name }}-font-file}.woff2?#{${{ name }}-font-hash}") format("woff2"), url("#{${{ name }}-font-file}.woff?#{${{ name }}-font-hash}") format("woff") !default;
${{ name }}-font-hash: "24e3eb84d0bcaf83d77f904c78ac1f47" !default;
${{ name }}-font-src: url("#{${{ name }}-font-file}.woff2?#{${{ name }}-font-hash}") format("woff2"),
url("#{${{ name }}-font-file}.woff?#{${{ name }}-font-hash}") format("woff") !default;

@font-face {
font-display: block;
font-family: ${{ name }}-font;
src: ${{ name }}-font-src;
}

.{{prefix}}::before,
[class^="{{prefix}}-"]::before,
[class*=" {{prefix}}-"]::before {
.{{ prefix }}::before,
[class^="{{ prefix }}-"]::before,
[class*=" {{ prefix }}-"]::before {
display: inline-block;
font-family: ${{ name }}-font !important;
font-style: normal;
Expand Down
12 changes: 8 additions & 4 deletions build/vnu-jar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

/*!
* Script to run vnu-jar if Java is available.
* Copyright 2017-2022 The Bootstrap Authors
* Copyright 2017-2022 Twitter, Inc.
* Copyright 2017-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'

const { execFile, spawn } = require('child_process')
const { execFile, spawn } = require('node:child_process')
const vnu = require('vnu-jar')

execFile('java', ['-version'], (error, stdout, stderr) => {
if (error) {
console.error('Skipping vnu-jar test; Java is missing.')
console.error('Skipping vnu-jar test; Java is probably missing.')
console.error(error)
return
}

console.log('Running vnu-jar validation...')

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

// vnu-jar accepts multiple ignores joined with a `|`.
Expand All @@ -40,6 +42,8 @@ execFile('java', ['-version'], (error, stdout, stderr) => {
args.splice(0, 0, '-Xss512k')
}

console.log(`command used: java ${args.join(' ')}`)

return spawn('java', args, {
shell: true,
stdio: 'inherit'
Expand Down
23 changes: 14 additions & 9 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,28 @@ module:
target: static/assets/font
- source: node_modules/bootstrap/scss
target: assets/scss/bootstrap
- source: node_modules/bootstrap/dist/js/bootstrap.min.js
target: assets/js/bootstrap.min.js
- source: node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
target: assets/js/vendor/bootstrap.bundle.min.js
- source: node_modules/clipboard/dist/clipboard.min.js
target: assets/js/vendor/clipboard.min.js
- source: node_modules/list.js/dist/list.min.js
target: assets/js/vendor/list.min.js

params:
description: "Official open source SVG icon library for Bootstrap"
social_image_path: /assets/img/bootstrap-icons-social.png

version: "1.9.1"
docs_version: "5.2"
version: "1.10.3"
docs_version: "5.3"

main: "https://getbootstrap.com"
github_org: "https://github.com/twbs"
repo: "https://github.com/twbs/icons"
icons_repo: "https://github.com/twbs/icons"
repo: "https://github.com/twbs/bootstrap"
twitter: "getbootstrap"
slack: "https://bootstrap-slack.herokuapp.com"
blog: "https://blog.getbootstrap.com"
expo: "https://expo.getbootstrap.com"
themes: "https://themes.getbootstrap.com"
opencollective: "https://opencollective.com/bootstrap"
blog: "https://blog.getbootstrap.com/"
themes: "https://themes.getbootstrap.com/"
icons: "https://icons.getbootstrap.com/"
swag: "https://cottonbureau.com/people/bootstrap"
icons_figma: "https://www.figma.com/community/file/1042482994486402696/Bootstrap-Icons"
2 changes: 1 addition & 1 deletion docs/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"node": false
},
"parserOptions": {
"ecmaVersion": 5,
"ecmaVersion": 6,
"sourceType": "script"
},
"extends": [
Expand Down
Loading

0 comments on commit 2f26bf7

Please sign in to comment.