diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ef85b0f5..01887149 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -92,23 +92,6 @@ updates: dependency-type: "production" development-dependencies: dependency-type: "development" - - package-ecosystem: npm - directory: "/react-nextjs" - labels: - - dependencies - schedule: - interval: monthly - day: 'monday' - time: '05:00' - timezone: 'Europe/Paris' - cooldown: - default-days: 7 - versioning-strategy: increase - groups: - production-dependencies: - dependency-type: "production" - development-dependencies: - dependency-type: "development" - package-ecosystem: npm directory: "/sass-js" labels: diff --git a/.github/scripts/changed-examples.mjs b/.github/scripts/changed-examples.mjs new file mode 100644 index 00000000..22dee3b8 --- /dev/null +++ b/.github/scripts/changed-examples.mjs @@ -0,0 +1,49 @@ +import { execFileSync } from 'node:child_process' + +const projects = [ + 'color-modes', + 'icons-font', + 'parcel', + 'sass-js', + 'sass-js-esm', + 'starter', + 'vite', + 'vue', + 'webpack' +] + +const [eventName, baseSha, headSha] = process.argv.slice(2) +const allProjects = JSON.stringify(projects) + +if ( + eventName === 'workflow_dispatch' || + !baseSha || + !headSha || + /^0+$/.test(baseSha) +) { + process.stdout.write(allProjects) + process.exit() +} + +const files = execFileSync( + 'git', + ['diff', '--name-only', baseSha, headSha], + { encoding: 'utf8' } +) + .trim() + .split('\n') + .filter(Boolean) + +const runAll = files.some(file => [ + '.github/scripts/changed-examples.mjs', + '.github/workflows/ci.yml', + 'package.json' +].includes(file)) + +const changedProjects = runAll + ? projects + : projects.filter(project => + files.some(file => file === project || file.startsWith(`${project}/`)) + ) + +process.stdout.write(JSON.stringify(changedProjects)) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ae40f09..56ae32f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,33 @@ permissions: contents: read jobs: + changes: + name: Detect changed examples + runs-on: ubuntu-latest + outputs: + projects: ${{ steps.detect.outputs.projects }} + + steps: + - name: Clone repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Detect changed examples + id: detect + env: + BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} + EVENT_NAME: ${{ github.event_name }} + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + projects="$(node .github/scripts/changed-examples.mjs "$EVENT_NAME" "$BASE_SHA" "$HEAD_SHA")" + echo "projects=$projects" >> "$GITHUB_OUTPUT" + ci: name: ${{ matrix.project }} + needs: changes + if: needs.changes.outputs.projects != '[]' runs-on: ubuntu-latest defaults: run: @@ -25,17 +50,7 @@ jobs: strategy: fail-fast: false matrix: - project: - - "color-modes" - - "icons-font" - - "parcel" - - "react-nextjs" - - "sass-js" - - "sass-js-esm" - - "starter" - - "vite" - - "vue" - - "webpack" + project: ${{ fromJSON(needs.changes.outputs.projects) }} steps: - name: Clone repository diff --git a/.gitignore b/.gitignore index 02e4a411..7fe0098b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,6 @@ Thumbs.db *.komodoproject # Folders to ignore +/_site/ dist node_modules diff --git a/README.md b/README.md index ebb4cb4f..6c317c04 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
@@ -9,9 +9,14 @@
Functional examples for building with Bootstrap using popular tools and frameworks.
- Explore Bootstrap docs »
+ Explore Bootstrap docs »
You've successfully loaded up the Bootstrap Color Modes example! It's loaded up with Bootstrap 5, Sass, and ES Modules Shims for our JavaScript plugins, and our documentation's color mode picker.
+You've successfully loaded up the Bootstrap Color Modes example! It's loaded up with Bootstrap 6, Sass, and ES Modules Shims for our JavaScript plugins, and our documentation's color mode picker.
If this button appears blue and the link appears purple, everything is working. Check out the Toggle theme button at the top of the page to switch between color modes.