Repository navigation
Update Angular deps and shepherd.js 16, support Angular >=18 with CI coverage #3022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
632f825
Update Angular deps to 21.2 in lockstep and shepherd.js to 16
RobbieTheWagner 628ba3f
Widen peer deps to Angular >=14 and group Angular Dependabot updates
RobbieTheWagner 3333b00
Test every supported Angular major in CI and raise the floor to 18
RobbieTheWagner 1d3ed56
Block Dependabot automerge on Angular compatibility
RobbieTheWagner c5b5d57
Address CodeRabbit review feedback
RobbieTheWagner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Angular Compatibility | ||
|
|
||
| # Installs the packed angular-shepherd into a fresh app on every supported | ||
| # Angular major and checks that it builds and renders a tour. Keep the matrix | ||
| # in sync with peerDependencies in projects/shepherd/package.json. | ||
| # | ||
| # PRs and pushes run this through main.yml (workflow_call), so a dependency | ||
| # that breaks compatibility also blocks Dependabot automerge. | ||
|
|
||
| on: | ||
| workflow_call: {} | ||
| schedule: | ||
| # Weekly, so a new Angular major shows up via the `latest` entry. | ||
| - cron: '0 10 * * 1' | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pack: | ||
| name: Pack angular-shepherd | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: volta-cli/action@v4 | ||
| - run: npm ci | ||
| - run: npm run build_lib | ||
| - run: mkdir pack && npm pack ./projects/shepherd --pack-destination pack | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: angular-shepherd-tarball | ||
| path: pack/*.tgz | ||
|
|
||
| compat: | ||
| name: Angular ${{ matrix.angular }} | ||
| needs: pack | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| angular: ['18', '19', '20', '21', '22', 'latest'] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 24 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: angular-shepherd-tarball | ||
| path: pack | ||
| - run: compat/check.sh "${{ matrix.angular }}" pack/*.tgz "$RUNNER_TEMP/compat" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env bash | ||
| # Verifies a packed angular-shepherd tarball works in a fresh Angular app. | ||
| # | ||
| # Usage: compat/check.sh <angular-version> <path-to-angular-shepherd.tgz> [work-dir] | ||
| # e.g. compat/check.sh 18 ./angular-shepherd-22.0.0.tgz | ||
| # | ||
| # Steps: `ng new` on the requested Angular version, install the tarball | ||
| # (without --legacy-peer-deps, so our peerDependencies range is checked too), | ||
| # `ng build`, then load the build in headless Chrome and assert the tour | ||
| # step and modal overlay rendered. | ||
| # | ||
| # Set CHROME to the Chrome binary if it is not `google-chrome` on PATH. | ||
| set -euo pipefail | ||
|
|
||
| VERSION="$1" | ||
| TARBALL="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")" | ||
| WORK_DIR="${3:-$(mktemp -d)}" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| mkdir -p "$WORK_DIR" | ||
| WORK_DIR="$(cd "$WORK_DIR" && pwd)" | ||
| COMPAT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| CHROME="${CHROME:-google-chrome}" | ||
| APP="$WORK_DIR/compat-app" | ||
| export NG_CLI_ANALYTICS=false | ||
|
|
||
| rm -rf "$APP" | ||
| cd "$WORK_DIR" | ||
|
|
||
| echo "::group::ng new (Angular $VERSION)" | ||
| npx -y "@angular/cli@$VERSION" new compat-app \ | ||
| --defaults --skip-git --skip-tests --minimal --skip-install --style=css | ||
| echo "::endgroup::" | ||
|
|
||
| cd "$APP" | ||
| echo "::group::npm install" | ||
| npm install --no-audit --no-fund | ||
| npm install --no-audit --no-fund "$TARBALL" | ||
| echo "::endgroup::" | ||
|
|
||
| cp "$COMPAT_DIR/main.ts" src/main.ts | ||
|
|
||
| echo "Angular $(node -p "require('@angular/core/package.json').version"), TypeScript $(node -p "require('typescript/package.json').version")" | ||
|
|
||
| echo "::group::ng build" | ||
| npx ng build | ||
| echo "::endgroup::" | ||
|
|
||
| DIST="$(dirname "$(find dist -name index.html | head -1)")" | ||
| PORT=$((20000 + RANDOM % 10000)) | ||
| python3 -m http.server "$PORT" --directory "$DIST" > /dev/null 2>&1 & | ||
| SERVER_PID=$! | ||
| trap 'kill $SERVER_PID 2>/dev/null || true' EXIT | ||
| sleep 1 | ||
|
|
||
| DOM="$("$CHROME" --headless=new --disable-gpu --no-sandbox \ | ||
| --user-data-dir="$WORK_DIR/chrome-profile" \ | ||
| --virtual-time-budget=5000 --dump-dom "http://localhost:$PORT/" 2>/dev/null)" | ||
|
|
||
| fail=0 | ||
| for marker in 'shepherd-element' 'shepherd-modal-overlay-container' 'Compat step'; do | ||
| if grep -q "$marker" <<< "$DOM"; then | ||
| echo "✓ found $marker" | ||
| else | ||
| echo "✗ missing $marker" | ||
| fail=1 | ||
| fi | ||
| done | ||
|
|
||
| if [ "$fail" -ne 0 ]; then | ||
| echo "Rendered DOM:" | ||
| echo "$DOM" | ||
| exit 1 | ||
| fi | ||
| echo "Angular $VERSION: angular-shepherd builds and renders a tour." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Entry point copied over src/main.ts of a fresh `ng new` app by check.sh. | ||
| // It starts a one-step tour so the check can assert that Shepherd rendered. | ||
| import { AfterViewInit, Component, inject } from '@angular/core'; | ||
| import { bootstrapApplication } from '@angular/platform-browser'; | ||
| import { ShepherdService } from 'angular-shepherd'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| standalone: true, | ||
| template: '<h1 class="first">angular-shepherd compat</h1>' | ||
| }) | ||
| class AppComponent implements AfterViewInit { | ||
| private shepherdService = inject(ShepherdService); | ||
|
|
||
| ngAfterViewInit() { | ||
| this.shepherdService.modal = true; | ||
| this.shepherdService.addSteps([ | ||
| { | ||
| id: 'compat', | ||
| title: 'Compat step', | ||
| text: 'Rendered by angular-shepherd', | ||
| attachTo: { element: '.first', on: 'bottom' } | ||
| } | ||
| ]); | ||
| this.shepherdService.start(); | ||
| } | ||
| } | ||
|
|
||
| bootstrapApplication(AppComponent).catch((err) => console.error(err)); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.