1
0
Fork 0

Merging upstream version 1.10.5+dfsg.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-17 07:15:14 +01:00
parent b34f263e6c
commit eb7be08aac
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
20 changed files with 494 additions and 1175 deletions

View file

@ -5,7 +5,8 @@
"node": true "node": true
}, },
"parserOptions": { "parserOptions": {
"ecmaVersion": 2019 "ecmaVersion": 2020,
"sourceType": "module"
}, },
"extends": "eslint:recommended", "extends": "eslint:recommended",
"rules": { "rules": {
@ -29,7 +30,7 @@
"node": false "node": false
}, },
"parserOptions": { "parserOptions": {
"sourceType": "script" "sourceType": "module"
} }
} }
] ]

View file

@ -4,15 +4,16 @@ on:
release: release:
types: types:
- published - published
workflow_dispatch:
env: env:
FORCE_COLOR: 2 FORCE_COLOR: 2
NODE: 18 NODE: 18
jobs: jobs:
deploy: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'twbs/icons' if: github.repository == 'twbs/icons' && startsWith(github.ref, 'refs/tags/v')
steps: steps:
- name: Clone repository - name: Clone repository
@ -29,11 +30,8 @@ jobs:
- name: Install npm dependencies - name: Install npm dependencies
run: npm ci run: npm ci
- name: Build the icons - name: Prepare release
run: npm run icons run: npm run release
- name: Build the docs
run: npm run docs-build
- name: Deploy docs - name: Deploy docs
uses: peaceiris/actions-gh-pages@v3 uses: peaceiris/actions-gh-pages@v3
@ -44,9 +42,9 @@ jobs:
publish_dir: ./_site/ publish_dir: ./_site/
publish: publish:
needs: deploy needs: build
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'twbs/icons' if: github.repository == 'twbs/icons' && startsWith(github.ref, 'refs/tags/v')
steps: steps:
- name: Clone repository - name: Clone repository

37
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Lint
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
FORCE_COLOR: 2
NODE: 18
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ env.NODE }}"
cache: npm
- name: Install npm dependencies
run: npm ci
- name: Lint
run: npm run test

View file

@ -39,8 +39,8 @@ jobs:
- name: Build the icons - name: Build the icons
run: npm run icons run: npm run icons
- name: Run tests - name: Build and test docs
run: npm test run: npm run docs-test
- name: Run linkinator - name: Run linkinator
uses: JustinBeckwith/linkinator-action@v1 uses: JustinBeckwith/linkinator-action@v1

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.DS_Store .DS_Store
/.hugo_build.lock /.hugo_build.lock
/.cache/
/_site/ /_site/
/node_modules/ /node_modules/
/resources/ /resources/

View file

View file

@ -1,10 +1,12 @@
#!/usr/bin/env node #!/usr/bin/env node
'use strict' import fs from 'node:fs/promises'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import picocolors from 'picocolors'
const fs = require('node:fs').promises const __filename = fileURLToPath(import.meta.url)
const path = require('node:path') const __dirname = path.dirname(fileURLToPath(import.meta.url))
const picocolors = require('picocolors')
const iconsDir = path.join(__dirname, '../icons/') const iconsDir = path.join(__dirname, '../icons/')
const pagesDir = path.join(__dirname, '../docs/content/icons/') const pagesDir = path.join(__dirname, '../docs/content/icons/')

View file

@ -1,12 +1,14 @@
#!/usr/bin/env node #!/usr/bin/env node
'use strict' import fs from 'node:fs/promises'
import path from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import picocolors from 'picocolors'
import { loadConfig, optimize } from 'svgo'
const fs = require('node:fs').promises const __filename = fileURLToPath(import.meta.url)
const path = require('node:path') const __dirname = path.dirname(fileURLToPath(import.meta.url))
const process = require('node:process')
const picocolors = require('picocolors')
const { loadConfig, optimize } = require('svgo')
const iconsDir = path.join(__dirname, '../icons/') const iconsDir = path.join(__dirname, '../icons/')
@ -40,7 +42,7 @@ async function processFile(file, config) {
console.time(timeLabel) console.time(timeLabel)
const files = await fs.readdir(iconsDir) const files = await fs.readdir(iconsDir)
const config = await loadConfig(path.join(__dirname, '../svgo.config.js')) const config = await loadConfig(path.join(__dirname, '../svgo.config.mjs'))
await Promise.all(files.map(file => processFile(file, config))) await Promise.all(files.map(file => processFile(file, config)))

100
build/bump-version.mjs Normal file
View file

@ -0,0 +1,100 @@
#!/usr/bin/env node
/*!
* Script to update version number references in the project.
* Copyright 2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)
*/
const { execFile } = require('node:child_process')
const fs = require('node:fs').promises
const VERBOSE = process.argv.includes('--verbose')
const DRY_RUN = process.argv.includes('--dry') || process.argv.includes('--dry-run')
// These are the files we only care about replacing the version
const FILES = [
'build/font/css.hbs',
'build/font/scss.hbs',
'config.yml'
]
// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
function regExpQuote(string) {
return string.replace(/[$()*+-.?[\\\]^{|}]/g, '\\$&')
}
function regExpQuoteReplacement(string) {
return string.replace(/\$/g, '$$')
}
async function replaceRecursively(file, oldVersion, newVersion) {
const originalString = await fs.readFile(file, 'utf8')
const newString = originalString.replace(
new RegExp(regExpQuote(oldVersion), 'g'),
regExpQuoteReplacement(newVersion)
)
// No need to move any further if the strings are identical
if (originalString === newString) {
return
}
if (VERBOSE) {
console.log(`Found ${oldVersion} in ${file}`)
}
if (DRY_RUN) {
return
}
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)
process.exit(1)
}
async function main(args) {
let [oldVersion, newVersion] = args
if (!oldVersion || !newVersion) {
showUsage(args)
}
// Strip any leading `v` from arguments because
// otherwise we will end up with duplicate `v`s
[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => {
return arg.startsWith('v') ? arg.slice(1) : arg
})
if (oldVersion === newVersion) {
showUsage(args)
}
bumpNpmVersion(newVersion)
try {
await Promise.all(FILES.map(file => replaceRecursively(file, oldVersion, newVersion)))
} catch (error) {
console.error(error)
process.exit(1)
}
}
main(process.argv.slice(2))

14
build/check-icons.js → build/check-icons.mjs Executable file → Normal file
View file

@ -1,11 +1,13 @@
#!/usr/bin/env node #!/usr/bin/env node
'use strict' import fs from 'node:fs/promises'
import path from 'node:path'
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import picocolors from 'picocolors'
const fs = require('node:fs').promises const __filename = fileURLToPath(import.meta.url)
const path = require('node:path') const __dirname = path.dirname(fileURLToPath(import.meta.url))
const process = require('node:process')
const picocolors = require('picocolors')
const fontJsonPath = path.join(__dirname, '../font/bootstrap-icons.json') const fontJsonPath = path.join(__dirname, '../font/bootstrap-icons.json')
const iconsDir = path.join(__dirname, '../icons/') const iconsDir = path.join(__dirname, '../icons/')
@ -23,7 +25,7 @@ const iconsDir = path.join(__dirname, '../icons/')
const svgFiles = await fs.readdir(iconsDir) const svgFiles = await fs.readdir(iconsDir)
const jsonIconList = Object.keys(fontJson) const jsonIconList = Object.keys(fontJson)
const svgIconList = svgFiles.map(svg => path.basename(svg, path.extname(svg))) const svgIconList = svgFiles.map(svg => path.basename(svg, '.svg'))
const onlyInJson = jsonIconList.filter(icon => !svgIconList.includes(icon)) const onlyInJson = jsonIconList.filter(icon => !svgIconList.includes(icon))
const onlyInSvg = svgIconList.filter(icon => !jsonIconList.includes(icon)) const onlyInSvg = svgIconList.filter(icon => !jsonIconList.includes(icon))

View file

@ -1,7 +1,7 @@
/*! /*!
* Bootstrap Icons (https://icons.getbootstrap.com/) * Bootstrap Icons v1.10.5 (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors * Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md) * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)
*/ */
@font-face { @font-face {

View file

@ -1,7 +1,7 @@
/*! /*!
* Bootstrap Icons (https://icons.getbootstrap.com/) * Bootstrap Icons v1.10.5 (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors * Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md) * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)
*/ */
${{ name }}-font: "{{ name }}" !default; ${{ name }}-font: "{{ name }}" !default;

View file

@ -6,10 +6,8 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/ */
'use strict' import { execFile, spawn } from 'node:child_process'
import vnu from 'vnu-jar'
const { execFile, spawn } = require('node:child_process')
const vnu = require('vnu-jar')
execFile('java', ['-version'], (error, stdout, stderr) => { execFile('java', ['-version'], (error, stdout, stderr) => {
if (error) { if (error) {

View file

@ -48,16 +48,12 @@ module:
target: assets/scss/bootstrap target: assets/scss/bootstrap
- source: node_modules/bootstrap/dist/js/bootstrap.bundle.min.js - source: node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
target: static/assets/js/vendor/bootstrap.bundle.min.js target: static/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/fuse.js/dist/fuse.min.js
target: assets/js/vendor/fuse.min.js
params: params:
description: "Official open source SVG icon library for Bootstrap" description: "Official open source SVG icon library for Bootstrap"
social_image_path: /assets/img/bootstrap-icons-social.png social_image_path: /assets/img/bootstrap-icons-social.png
version: "1.10.4" version: "1.10.5"
docs_version: "5.3" docs_version: "5.3"
main: "https://getbootstrap.com" main: "https://getbootstrap.com"

View file

@ -1,7 +1,7 @@
/*! /*!
* Bootstrap Icons (https://icons.getbootstrap.com/) * Bootstrap Icons v1.10.5 (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors * Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md) * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)
*/ */
@font-face { @font-face {

5
font/bootstrap-icons.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
/*! /*!
* Bootstrap Icons (https://icons.getbootstrap.com/) * Bootstrap Icons v1.10.5 (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors * Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md) * Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE)
*/ */
$bootstrap-icons-font: "bootstrap-icons" !default; $bootstrap-icons-font: "bootstrap-icons" !default;

1392
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "bootstrap-icons", "name": "bootstrap-icons",
"version": "1.10.4", "version": "1.10.5",
"description": "Official open source SVG icon library for Bootstrap", "description": "Official open source SVG icon library for Bootstrap",
"author": "mdo", "author": "mdo",
"license": "MIT", "license": "MIT",
@ -12,6 +12,16 @@
"bugs": { "bugs": {
"url": "https://github.com/twbs/icons/issues" "url": "https://github.com/twbs/icons/issues"
}, },
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/twbs"
},
{
"type": "opencollective",
"url": "https://opencollective.com/bootstrap"
}
],
"keywords": [ "keywords": [
"bootstrap", "bootstrap",
"icons", "icons",
@ -20,7 +30,6 @@
"sprite", "sprite",
"woff", "woff",
"woff2" "woff2"
], ],
"style": "font/bootstrap-icons.css", "style": "font/bootstrap-icons.css",
"sass": "font/bootstrap-icons.scss", "sass": "font/bootstrap-icons.scss",
@ -37,41 +46,46 @@
"start": "npm run docs-serve", "start": "npm run docs-serve",
"docs-serve": "hugo server --port 4000 --disableFastRender", "docs-serve": "hugo server --port 4000 --disableFastRender",
"docs-build": "hugo --cleanDestinationDir --printUnusedTemplates", "docs-build": "hugo --cleanDestinationDir --printUnusedTemplates",
"pages": "node build/build-pages.js", "docs-test": "npm-run-all docs-build docs-test:vnu",
"docs-test:vnu": "node build/vnu-jar.mjs",
"pages": "node build/build-pages.mjs",
"icons": "npm-run-all icons-main --aggregate-output --parallel icons-sprite icons-font", "icons": "npm-run-all icons-main --aggregate-output --parallel icons-sprite icons-font",
"icons-main": "node build/build-svgs.js", "icons-main": "node build/build-svgs.mjs",
"icons-zip": "cross-env-shell \"rm -rf bootstrap-icons-$npm_package_version bootstrap-icons-$npm_package_version.zip && cp -r icons/ bootstrap-icons-$npm_package_version && cp bootstrap-icons.svg bootstrap-icons-$npm_package_version && cp -r font/ bootstrap-icons-$npm_package_version && zip -qr9 bootstrap-icons-$npm_package_version.zip bootstrap-icons-$npm_package_version && rm -rf bootstrap-icons-$npm_package_version\"", "icons-zip": "cross-env-shell \"rm -rf bootstrap-icons-$npm_package_version bootstrap-icons-$npm_package_version.zip && cp -r icons/ bootstrap-icons-$npm_package_version && cp bootstrap-icons.svg bootstrap-icons-$npm_package_version && cp -r font/ bootstrap-icons-$npm_package_version && zip -qr9 bootstrap-icons-$npm_package_version.zip bootstrap-icons-$npm_package_version && rm -rf bootstrap-icons-$npm_package_version\"",
"icons-sprite": "svg-sprite --config svg-sprite.json --log=info icons/*.svg", "icons-sprite": "svg-sprite --config svg-sprite.json --log=info \"icons/*.svg\"",
"icons-font": "fantasticon", "icons-font": "npm-run-all icons-font-*",
"icons-font-main": "fantasticon",
"icons-font-min": "cleancss -O1 --format breakWith=lf --with-rebase --output font/bootstrap-icons.min.css font/bootstrap-icons.css",
"release": "npm-run-all icons docs-build icons-zip", "release": "npm-run-all icons docs-build icons-zip",
"release-version": "node build/bump-version.js",
"netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm-run-all icons docs-build", "netlify": "cross-env-shell HUGO_BASEURL=$DEPLOY_PRIME_URL npm-run-all icons docs-build",
"test:fusv": "fusv docs/assets/scss/", "test:fusv": "fusv docs/assets/scss/",
"test:eslint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives .", "test:eslint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives --ext .js,.mjs .",
"test:stylelint": "stylelint docs/assets/scss/ --cache --cache-location node_modules/.cache/.stylelintcache", "test:stylelint": "stylelint docs/assets/scss/ --cache --cache-location .cache/.stylelintcache",
"test:lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json", "test:lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
"test:vnu": "node build/vnu-jar.js", "test:check-icons": "node build/check-icons.mjs",
"test:check-icons": "node build/check-icons.js", "test": "npm-run-all --parallel --aggregate-output --continue-on-error test:*"
"test": "npm-run-all docs-build --parallel --aggregate-output --continue-on-error test:*"
}, },
"devDependencies": { "devDependencies": {
"@twbs/fantasticon": "^2.6.0", "@twbs/fantasticon": "^2.7.1",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"bootstrap": "^5.3.0-alpha3", "bootstrap": "^5.3.0-alpha3",
"clean-css-cli": "^5.6.2",
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^8.37.0", "eslint": "^8.39.0",
"find-unused-sass-variables": "^4.0.8", "find-unused-sass-variables": "^4.0.8",
"fuse.js": "^6.6.2", "fuse.js": "^6.6.2",
"hugo-bin": "^0.102.0", "hugo-bin": "^0.102.0",
"lockfile-lint": "^4.10.1", "lockfile-lint": "^4.10.1",
"npm-run-all": "^4.1.5", "npm-run-all2": "^6.0.5",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"postcss": "^8.4.21", "postcss": "^8.4.23",
"postcss-cli": "^10.1.0", "postcss-cli": "^10.1.0",
"stylelint": "^15.4.0", "stylelint": "^15.6.0",
"stylelint-config-twbs-bootstrap": "^8.0.0", "stylelint-config-twbs-bootstrap": "^9.0.1",
"svg-sprite": "^3.0.0-beta1", "svg-sprite": "^3.0.0-beta1",
"svgo": "^3.0.2", "svgo": "^3.0.2",
"vnu-jar": "22.9.29" "vnu-jar": "23.4.11"
} }
} }

View file

@ -1,8 +1,6 @@
'use strict' import path from 'node:path'
const path = require('node:path') export default {
module.exports = {
multipass: true, multipass: true,
js2svg: { js2svg: {
pretty: true, pretty: true,