Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 47 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,54 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- run: npm ci
- run: npm test

template-parser-compatibility:
name: Template parser ${{ matrix.template-parser }} compatibility
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- template-parser: "21.4.0"
eslint: "8.57.1"
- template-parser: "22.1.0"
eslint: "9.39.2"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
- run: npm ci
- run: npm run build
- name: Pack the published files
id: pack
run: |
filename=$(npm pack --pack-destination "$RUNNER_TEMP" --json | node -e "let input=''; process.stdin.on('data', chunk => input += chunk); process.stdin.on('end', () => console.log(JSON.parse(input)[0].filename));")
echo "filename=$filename" >> "$GITHUB_OUTPUT"
- name: Install in a clean consumer project
working-directory: ${{ runner.temp }}
run: |
mkdir consumer
cd consumer
npm init --yes
npm install \
eslint@${{ matrix.eslint }} \
@angular-eslint/template-parser@${{ matrix.template-parser }} \
"$RUNNER_TEMP/${{ steps.pack.outputs.filename }}"
- name: Run the packaged CLI
working-directory: ${{ runner.temp }}/consumer
run: |
mkdir -p node_modules/@ionic/angular src
printf '{"version":"9.0.0"}\n' > node_modules/@ionic/angular/package.json
printf '{"compilerOptions":{}}\n' > tsconfig.json
printf '<ion-icon name="close-outline"></ion-icon>\n' > src/app.component.html
npx --no-install ionic-angular-collect-icons
grep -q 'closeOutline' src/use-icons.ts
6 changes: 3 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- name: Install dependencies
run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
cache: "npm"
- run: npm ci
- run: npm run lint
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ This project is based [ionic-team/ionic-angular-standalone-codemods](https://git

## Requirements

- Node.js >= 20
- Node.js >= 22
- Ionic Angular >= 9.0.0
- Angular >= 18.0.0
- TypeScript >= 5.4.0
- ionicons >= 8.0.0
- @angular-eslint/template-parser 21 or 22

## Quick start

Expand Down Expand Up @@ -52,9 +53,15 @@ After it finishes, update this package and follow the
## Installation

```bash
npm install @rdlabo/ionic-angular-collect-icons --save-dev
npm install --save-dev \
@rdlabo/ionic-angular-collect-icons \
@angular-eslint/template-parser@^21
```

Use `@angular-eslint/template-parser@^22` instead when the consuming project
uses Angular ESLint 22. The parser is a peer dependency so the collector uses
the same Angular template parser major as the consuming project.

## Documentation

Start with [Installation](#installation), then [Initialize](./docs/initialize.md) and [Usage](./docs/usage.md).
Expand Down
Loading
Loading