diff options
Diffstat (limited to 'vendor/twbs/bootstrap/build')
-rw-r--r-- | vendor/twbs/bootstrap/build/build-plugins.js | 8 | ||||
-rwxr-xr-x[-rw-r--r--] | vendor/twbs/bootstrap/build/change-version.js | 4 | ||||
-rw-r--r-- | vendor/twbs/bootstrap/build/generate-sri.js | 12 | ||||
-rw-r--r-- | vendor/twbs/bootstrap/build/postcss.config.js | 24 | ||||
-rw-r--r-- | vendor/twbs/bootstrap/build/rollup.config.js | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | vendor/twbs/bootstrap/build/ship.sh | 0 | ||||
-rw-r--r-- | vendor/twbs/bootstrap/build/vnu-jar.js | 4 | ||||
-rw-r--r-- | vendor/twbs/bootstrap/build/zip-examples.js | 75 |
8 files changed, 79 insertions, 50 deletions
diff --git a/vendor/twbs/bootstrap/build/build-plugins.js b/vendor/twbs/bootstrap/build/build-plugins.js index 521450f85..ffdf0d1e9 100644 --- a/vendor/twbs/bootstrap/build/build-plugins.js +++ b/vendor/twbs/bootstrap/build/build-plugins.js @@ -2,8 +2,8 @@ /*! * Script to build our plugins to use them separately. - * Copyright 2020 The Bootstrap Authors - * Copyright 2020 Twitter, Inc. + * Copyright 2020-2021 The Bootstrap Authors + * Copyright 2020-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ @@ -19,8 +19,8 @@ const plugins = [ babel({ // Only transpile our source code exclude: 'node_modules/**', - // Inline the required helpers in each file - babelHelpers: 'inline' + // Include the helpers in each file, at most one copy of each + babelHelpers: 'bundled' }) ] const bsPlugins = { diff --git a/vendor/twbs/bootstrap/build/change-version.js b/vendor/twbs/bootstrap/build/change-version.js index e2de874d7..78bc8464b 100644..100755 --- a/vendor/twbs/bootstrap/build/change-version.js +++ b/vendor/twbs/bootstrap/build/change-version.js @@ -2,8 +2,8 @@ /*! * Script to update version number references in the project. - * Copyright 2017-2020 The Bootstrap Authors - * Copyright 2017-2020 Twitter, Inc. + * Copyright 2017-2021 The Bootstrap Authors + * Copyright 2017-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ diff --git a/vendor/twbs/bootstrap/build/generate-sri.js b/vendor/twbs/bootstrap/build/generate-sri.js index 972f8622e..f0aa7340b 100644 --- a/vendor/twbs/bootstrap/build/generate-sri.js +++ b/vendor/twbs/bootstrap/build/generate-sri.js @@ -5,8 +5,8 @@ * Remember to use the same vendor files as the CDN ones, * otherwise the hashes won't match! * - * Copyright 2017-2020 The Bootstrap Authors - * Copyright 2017-2020 Twitter, Inc. + * Copyright 2017-2021 The Bootstrap Authors + * Copyright 2017-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ @@ -21,11 +21,11 @@ const pkg = require('../package.json') sh.config.fatal = true -const configFile = path.join(__dirname, '../_config.yml') +const configFile = path.join(__dirname, '../config.yml') // Array of objects which holds the files to generate SRI hashes for. // `file` is the path from the root folder -// `configPropertyName` is the _config.yml variable's name of the file +// `configPropertyName` is the config.yml variable's name of the file const files = [ { file: 'dist/css/bootstrap.min.css', @@ -40,7 +40,7 @@ const files = [ configPropertyName: 'js_bundle_hash' }, { - file: `site/docs/${pkg.version_short}/assets/js/vendor/jquery.slim.min.js`, + file: `site/static/docs/${pkg.config.version_short}/assets/js/vendor/jquery.slim.min.js`, configPropertyName: 'jquery_hash' }, { @@ -61,6 +61,6 @@ files.forEach(file => { console.log(`${file.configPropertyName}: ${integrity}`) - sh.sed('-i', new RegExp(`(\\s${file.configPropertyName}:\\s+"|')(\\S+)("|')`), `$1${integrity}$3`, configFile) + sh.sed('-i', new RegExp(`^(\\s+${file.configPropertyName}:\\s+["'])\\S*(["'])`), `$1${integrity}$2`, configFile) }) }) diff --git a/vendor/twbs/bootstrap/build/postcss.config.js b/vendor/twbs/bootstrap/build/postcss.config.js index bd307fa35..ef416258f 100644 --- a/vendor/twbs/bootstrap/build/postcss.config.js +++ b/vendor/twbs/bootstrap/build/postcss.config.js @@ -1,14 +1,18 @@ 'use strict' -module.exports = ctx => ({ - map: ctx.file.dirname.includes('examples') ? false : { - inline: false, - annotation: true, - sourcesContent: true - }, - plugins: { - autoprefixer: { - cascade: false +module.exports = ctx => { + return { + map: ctx.file.dirname.includes('examples') ? + false : + { + inline: false, + annotation: true, + sourcesContent: true + }, + plugins: { + autoprefixer: { + cascade: false + } } } -}) +} diff --git a/vendor/twbs/bootstrap/build/rollup.config.js b/vendor/twbs/bootstrap/build/rollup.config.js index 6294204cd..e2d2b125e 100644 --- a/vendor/twbs/bootstrap/build/rollup.config.js +++ b/vendor/twbs/bootstrap/build/rollup.config.js @@ -31,7 +31,7 @@ if (BUNDLE) { } module.exports = { - input: path.resolve(__dirname, '../js/src/index.js'), + input: path.resolve(__dirname, '../js/index.js'), output: { banner, file: path.resolve(__dirname, `../dist/js/${fileDest}`), diff --git a/vendor/twbs/bootstrap/build/ship.sh b/vendor/twbs/bootstrap/build/ship.sh index f1c5e38e3..f1c5e38e3 100644..100755 --- a/vendor/twbs/bootstrap/build/ship.sh +++ b/vendor/twbs/bootstrap/build/ship.sh diff --git a/vendor/twbs/bootstrap/build/vnu-jar.js b/vendor/twbs/bootstrap/build/vnu-jar.js index f4a4141c1..d211ce577 100644 --- a/vendor/twbs/bootstrap/build/vnu-jar.js +++ b/vendor/twbs/bootstrap/build/vnu-jar.js @@ -2,8 +2,8 @@ /*! * Script to run vnu-jar if Java is available. - * Copyright 2017-2020 The Bootstrap Authors - * Copyright 2017-2020 Twitter, Inc. + * Copyright 2017-2021 The Bootstrap Authors + * Copyright 2017-2021 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ diff --git a/vendor/twbs/bootstrap/build/zip-examples.js b/vendor/twbs/bootstrap/build/zip-examples.js index 778d75f05..f976c3bc5 100644 --- a/vendor/twbs/bootstrap/build/zip-examples.js +++ b/vendor/twbs/bootstrap/build/zip-examples.js @@ -3,7 +3,7 @@ /*! * Script to create the built examples zip archive; * requires the `zip` command to be present! - * Copyright 2020 The Bootstrap Authors + * Copyright 2020-2021 The Bootstrap Authors * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ @@ -12,38 +12,65 @@ const path = require('path') const sh = require('shelljs') -const { - version, version_short: versionShort -} = require('../package.json') +const pkg = require('../package.json') -const folderName = `bootstrap-${version}-examples` +const versionShort = pkg.config.version_short +const distFolder = `bootstrap-${pkg.version}-examples` +const rootDocsDir = '_gh_pages' +const docsDir = `${rootDocsDir}/docs/${versionShort}/` + +// these are the files we need in the examples +const cssFiles = [ + 'bootstrap.min.css', + 'bootstrap.min.css.map' +] +const jsFiles = [ + 'bootstrap.bundle.min.js', + 'bootstrap.bundle.min.js.map' +] +const imgFiles = [ + 'bootstrap-outline.svg', + 'bootstrap-solid.svg' +] sh.config.fatal = true -if (!sh.test('-d', '_gh_pages')) { - throw new Error('The "_gh_pages" folder does not exist, did you forget building the docs?') +if (!sh.test('-d', rootDocsDir)) { + throw new Error(`The "${rootDocsDir}" folder does not exist, did you forget building the docs?`) } // switch to the root dir sh.cd(path.join(__dirname, '..')) -// remove any previously created folder with the same name -sh.rm('-rf', folderName) +// remove any previously created folder/zip with the same name +sh.rm('-rf', [distFolder, `${distFolder}.zip`]) + // create any folders so that `cp` works -sh.mkdir('-p', folderName) -sh.mkdir('-p', `${folderName}/assets/brand/`) - -sh.cp('-Rf', `_gh_pages/docs/${versionShort}/examples/*`, folderName) -sh.cp('-Rf', `_gh_pages/docs/${versionShort}/dist/`, `${folderName}/assets/`) -// also copy the two brand images we use in the examples -sh.cp('-f', [ - `_gh_pages/docs/${versionShort}/assets/brand/bootstrap-outline.svg`, - `_gh_pages/docs/${versionShort}/assets/brand/bootstrap-solid.svg` -], `${folderName}/assets/brand/`) -sh.rm(`${folderName}/index.html`) +sh.mkdir('-p', [ + distFolder, + `${distFolder}/assets/brand/`, + `${distFolder}/assets/dist/css/`, + `${distFolder}/assets/dist/js/` +]) + +sh.cp('-Rf', `${docsDir}/examples/*`, distFolder) + +cssFiles.forEach(file => { + sh.cp('-f', `${docsDir}/dist/css/${file}`, `${distFolder}/assets/dist/css/`) +}) + +jsFiles.forEach(file => { + sh.cp('-f', `${docsDir}/dist/js/${file}`, `${distFolder}/assets/dist/js/`) +}) + +imgFiles.forEach(file => { + sh.cp('-f', `${docsDir}/assets/brand/${file}`, `${distFolder}/assets/brand/`) +}) + +sh.rm(`${distFolder}/index.html`) // get all examples' HTML files -sh.find(`${folderName}/**/*.html`).forEach(file => { +sh.find(`${distFolder}/**/*.html`).forEach(file => { const fileContents = sh.cat(file) .toString() .replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../') @@ -55,9 +82,7 @@ sh.find(`${folderName}/**/*.html`).forEach(file => { }) // create the zip file -sh.exec(`zip -r9 "${folderName}.zip" "${folderName}"`, { - fatal: true -}) +sh.exec(`zip -r9 "${distFolder}.zip" "${distFolder}"`) // remove the folder we created -sh.rm('-rf', folderName) +sh.rm('-rf', distFolder) |