Skip to content

Commit

Permalink
Merge branch 'main' into main-jd-use-sass-enable-important-utilities-…
Browse files Browse the repository at this point in the history
…for-colored-links
  • Loading branch information
julien-deramond committed Apr 18, 2023
2 parents ec235af + 08cde8d commit 5d7315e
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 45 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/node-sass.yml
Expand Up @@ -35,14 +35,15 @@ jobs:
npx --package node-sass@latest node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 scss/ -o dist-sass/css/
ls -Al dist-sass/css
# Check that there are no Sass variables (`$`)
- name: Check built CSS files
- name: Check built CSS files for Sass variables
shell: bash
run: |
if [[ $(find dist-sass/css/ -name "*.css" | xargs grep -F "\$" | wc -l | bc) -eq 0 ]]; then
echo "All good, no Sass variables found"
SASS_VARS_FOUND=$(find "dist-sass/css/" -type f -name "*.css" -print0 | xargs -0 --no-run-if-empty grep -F "\$" || true)
if [[ -z "$SASS_VARS_FOUND" ]]; then
echo "All good, no Sass variables found!"
exit 0
else
echo "Found Sass variables!"
echo "Found $(echo "$SASS_VARS_FOUND" | wc -l | bc) Sass variables:"
echo "$SASS_VARS_FOUND"
exit 1
fi
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -38,5 +38,6 @@ Thumbs.db
*.komodoproject

# Folders to ignore
/dist-sass/
/js/coverage/
/node_modules/
39 changes: 30 additions & 9 deletions build/change-version.js
Expand Up @@ -35,9 +35,17 @@ function regExpQuoteReplacement(string) {

async function replaceRecursively(file, oldVersion, newVersion) {
const originalString = await fs.readFile(file, 'utf8')
const newString = originalString.replace(
new RegExp(regExpQuote(oldVersion), 'g'), regExpQuoteReplacement(newVersion)
)
const newString = originalString
.replace(
new RegExp(regExpQuote(oldVersion), 'g'),
regExpQuoteReplacement(newVersion)
)
// Also replace the version used by the rubygem,
// which is using periods (`.`) instead of hyphens (`-`)
.replace(
new RegExp(regExpQuote(oldVersion.replace(/-/g, '.')), 'g'),
regExpQuoteReplacement(newVersion.replace(/-/g, '.'))
)

// No need to move any further if the strings are identical
if (originalString === newString) {
Expand All @@ -55,22 +63,35 @@ async function replaceRecursively(file, oldVersion, newVersion) {
await fs.writeFile(file, newString, 'utf8')
}

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) {
console.error('USAGE: change-version old_version new_version [--verbose] [--dry[-run]]')
console.error('Got arguments:', args)
process.exit(1)
showUsage(args)
}

// Strip any leading `v` from arguments because otherwise we will end up with duplicate `v`s
[oldVersion, newVersion] = [oldVersion, newVersion].map(arg => arg.startsWith('v') ? arg.slice(1) : arg)
// 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)
}

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

await Promise.all(files.map(file => replaceRecursively(file, oldVersion, newVersion)))
await Promise.all(
files.map(file => replaceRecursively(file, oldVersion, newVersion))
)
} catch (error) {
console.error(error)
process.exit(1)
Expand Down
58 changes: 31 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -140,15 +140,15 @@
"lockfile-lint": "^4.10.1",
"nodemon": "^2.0.22",
"npm-run-all2": "^6.0.5",
"postcss": "^8.4.21",
"postcss": "^8.4.22",
"postcss-cli": "^10.1.0",
"rollup": "^3.20.2",
"rollup": "^3.20.5",
"rollup-plugin-istanbul": "^4.0.0",
"rtlcss": "^4.1.0",
"sass": "^1.62.0",
"sass-true": "^7.0.0",
"shelljs": "^0.8.5",
"stylelint": "^15.4.0",
"stylelint": "^15.5.0",
"stylelint-config-twbs-bootstrap": "^9.0.1",
"terser": "5.16.0",
"vnu-jar": "23.4.11"
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/5.3/getting-started/download.md
Expand Up @@ -96,7 +96,7 @@ Alternatively, if you're not using Bundler, you can install the gem by running t
gem install bootstrap -v {{< param current_ruby_version >}}
```

[See the gem's README](https://github.com/twbs/bootstrap-rubygem/blob/master/README.md) for further details.
[See the gem's README](https://github.com/twbs/bootstrap-rubygem/blob/main/README.md) for further details.

### Composer

Expand Down

0 comments on commit 5d7315e

Please sign in to comment.