Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b74aacd
docs: add "personal fork" message to `README.md`
ZaLiTHkA Mar 23, 2025
339e674
chore: allow Prettier to format unit tests
ZaLiTHkA Mar 22, 2025
0e48ddb
chore: refresh source file formatting
ZaLiTHkA Mar 22, 2025
b6a765e
chore: use more open dependency version ranges
ZaLiTHkA Mar 22, 2025
4e7d647
chore: upgrade ESlint from 7 to 8
ZaLiTHkA Mar 22, 2025
051da7c
chore: fix some "Forbidden non-null assertion" lint errors
ZaLiTHkA Mar 22, 2025
da23f98
fix: repair Android Adaptive Icon "inset"
ZaLiTHkA Mar 22, 2025
ce0876c
feat: add support for Android "night mode" icons
ZaLiTHkA Mar 22, 2025
6e5469d
fix: repair `AssetKind` for Android adaptive icons
ZaLiTHkA Mar 22, 2025
791849a
fix: repair Android notification icon generation
ZaLiTHkA Mar 22, 2025
6bb7fe0
update
kklem0 Feb 1, 2026
65bfc05
add build
kklem0 Feb 1, 2026
726b2c2
weekly update
kklem0 Feb 19, 2026
d7ed6ba
Merge pull request #1 from sssf-code/update-2
kklem0 Feb 19, 2026
4fadf93
chore: weekly version bump to v3.0.6 and dependency updates
actions-user Feb 19, 2026
8412388
weekly build
kklem0 Feb 19, 2026
704b76c
node 22
kklem0 Feb 19, 2026
5698f22
chore: weekly version bump to v3.0.7 and dependency updates
actions-user Feb 19, 2026
2c66374
run at 5:30 instead because app builds at 6:00
kklem0 Feb 19, 2026
a8bd98f
chore: weekly version bump to v3.0.8 and dependency updates
actions-user Feb 23, 2026
21e67de
chore: weekly version bump to v3.0.9 and dependency updates
actions-user Mar 2, 2026
85b31ec
chore: weekly version bump to v3.0.10 and dependency updates
actions-user Mar 9, 2026
9bc3d20
chore: weekly version bump to v3.0.11 and dependency updates
actions-user Mar 16, 2026
f6293ca
chore: weekly version bump to v3.0.12 and dependency updates
actions-user Mar 23, 2026
8a4da6d
chore: weekly version bump to v3.0.13 and dependency updates
actions-user Mar 30, 2026
628e28e
chore: weekly version bump to v3.0.14 and dependency updates
actions-user Apr 6, 2026
867f44e
chore: weekly version bump to v3.0.15 and dependency updates
actions-user Apr 13, 2026
a5e1083
chore: weekly version bump to v3.0.16 and dependency updates
actions-user Apr 20, 2026
d5629aa
chore: weekly version bump to v3.0.17 and dependency updates
actions-user Apr 27, 2026
1e1193a
chore: weekly version bump to v3.0.18 and dependency updates
actions-user May 4, 2026
c94c40f
update packages
kklem0 Jul 17, 2026
089f96a
chore: migrate to pnpm and Node 24, fix all security advisories and b…
kklem0 Jul 17, 2026
f3e28cd
errors
kklem0 Jul 17, 2026
210873c
vite, vitest and oxlint
kklem0 Jul 17, 2026
6d132ef
feat!: require Node >=22.12, adopt pnpm 11, unlock ESM-only majors (v…
kklem0 Jul 17, 2026
62efc39
@sssf/capacitor-assets
kklem0 Jul 17, 2026
83668f6
feat: rename package to sssf-capacitor-assets
kklem0 Jul 17, 2026
3c5cd44
review generated formats
kklem0 Jul 17, 2026
ad9f235
feat!: modernize generated assets to 2026 platform standards
kklem0 Jul 17, 2026
1cd6403
ci: add E2E build verification workflow
kklem0 Jul 18, 2026
4b5eb44
ci: run workflows on Node 24 only
kklem0 Jul 18, 2026
c2f48bc
chore: release 4.1.0
kklem0 Jul 18, 2026
8687035
ci: publish releases from CI via npm Trusted Publishing
kklem0 Jul 18, 2026
30627c8
Merge pull request #2 from sssf-code/modernize-asset-standards
kklem0 Jul 18, 2026
c7d6216
docs: document CI-based release flow and missing CLI flags
kklem0 Jul 18, 2026
edffc97
docs: add AGENTS.md with pointers from tool-specific agent files
kklem0 Jul 18, 2026
8d766c8
Merge branch 'modernize-asset-standards'
kklem0 Jul 18, 2026
c66d99f
chore: weekly version bump to v4.1.1 and dependency updates
actions-user Jul 20, 2026
e11272f
chore: weekly version bump to v4.1.2 and dependency updates
actions-user Jul 27, 2026
7acdfb9
chore: weekly version bump to v4.1.3 and dependency updates
actions-user Aug 3, 2026
b365acc
chore: weekly version bump to v4.1.4 and dependency updates
actions-user Aug 10, 2026
68c0c08
chore: weekly version bump to v4.1.5 and dependency updates
actions-user Aug 17, 2026
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
5 changes: 0 additions & 5 deletions .changeset/light-lizards-dress.md

This file was deleted.

28 changes: 28 additions & 0 deletions .changeset/modern-platform-assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
'sssf-capacitor-assets': minor
---

Modernize generated assets to current (2026) platform standards and fix asset wiring bugs.

**iOS**

- Generate iOS 18+ dark and tinted 1024px app icon variants alongside the light icon, registered via `appearances` in the asset catalog (Xcode 16 format). Dark preserves source transparency; tinted is derived as opaque grayscale. Explicit sources supported via `assets/ios/icon-dark.png` and `assets/ios/icon-tinted.png`.

**Android**

- Adaptive icon XML now includes a `<monochrome>` layer (required for Android 13+ themed icons; Android 16 QPR2+ force-themes icons without one) and a full-bleed background layer per spec (previously the background was incorrectly inset).
- Foreground/monochrome inset changed 16.6% → 19.4% to respect the 66dp safe zone.
- Notification icon generation is now actually wired up (`assets/android/notification.png` was previously loaded but silently ignored) and the xxxhdpi size corrected from 144px to 96px (24dp base).
- `assets/android/icon-foreground.png` / `icon-background.png` were loaded with the wrong asset kind and generated legacy icons instead of adaptive layers — fixed.
- Default dark splash was generated at 320×240 instead of 320×480 — fixed.
- Removed obsolete ldpi launcher/adaptive icons; legacy icon padding now scales with density.

**PWA**

- Icons are now genuine PNGs (previously PNG bytes were written into `.webp`-named files) in the modern size set: 192/512/1024 (`purpose: "any"`) plus a separate, safe-zone-padded 512 maskable icon (previously a single non-padded `"any maskable"` entry).
- Generates `apple-touch-icon.png` (180×180, opaque) — iOS Safari requires PNG and prefers this over manifest icons.
- Correct MIME `type` values in the manifest (the extension lookup never matched).
- iOS startup-image device list refreshed through iPhone 17 / iPhone Air / M4 iPad Pro; the broken Apple HIG scraping (which silently produced zero splashes) is removed and `--pwaNoAppleFetch` is now a no-op.
- `assets/pwa/*` platform-specific sources are now loaded (previously declared but ignored).
- Manifest cleanup no longer deletes icon files outside the tool's own `icons/` output directory — previously any user-managed icon referenced in an existing manifest (e.g. an app's own logo) could be deleted during generation.
- `--pwaTags` works again and prints correct `<link>` tags (point-based media queries, web-relative paths).
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Follow the repository guidance in [AGENTS.md](../AGENTS.md) — project architecture, commands, platform asset rules, testing conventions, and release policy.
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js 24
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v4
- name: npm install, build, and test
node-version: 24
cache: pnpm
- name: Install, build, and test
env:
CI: true
run: |
npm install
npm run build
npm test
pnpm install --frozen-lockfile
pnpm run build
pnpm run lint
pnpm test
129 changes: 129 additions & 0 deletions .github/workflows/e2e-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: E2E Build Verification

# Scaffolds a fresh Capacitor app, generates assets with the built CLI,
# and verifies the real platform toolchains accept them: Gradle/AAPT2 for
# Android (adaptive icon XML incl. monochrome layer, notification icons)
# and Xcode's actool for iOS (appearances-based asset catalog).
#
# Uses @capacitor/app@latest deliberately, so this tracks what users get
# today; an upstream Capacitor template change can therefore fail this
# workflow even without changes in this repo.

on:
push:
branches:
- main
pull_request:
workflow_dispatch: {}

jobs:
android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
- name: Build CLI
run: |
pnpm install --frozen-lockfile
pnpm run build
- name: Scaffold Capacitor app
run: |
cd "$RUNNER_TEMP"
npm init -y @capacitor/app@latest capapp -- --name capapp --app-id com.sssf.assetstest
cd capapp
npm install --no-audit --no-fund
npm install --no-audit --no-fund @capacitor/android
npm run build
npx cap add android
- name: Generate assets
run: |
mkdir -p "$RUNNER_TEMP/capapp/assets/android"
cp test/fixtures/app/assets/icon-only.png \
test/fixtures/app/assets/icon-foreground.png \
test/fixtures/app/assets/icon-background.png \
test/fixtures/app/assets/splash.png \
test/fixtures/app/assets/splash-dark.png \
"$RUNNER_TEMP/capapp/assets/"
cp test/fixtures/app/assets/android/notification.png "$RUNNER_TEMP/capapp/assets/android/"
cd "$RUNNER_TEMP/capapp"
node "$GITHUB_WORKSPACE/bin/capacitor-assets" generate --android --iconBackgroundColor '#eeeeee' --iconBackgroundColorDark '#222222'
- name: Build APK
run: |
cd "$RUNNER_TEMP/capapp/android"
./gradlew assembleDebug --console=plain
- name: Verify APK contents
run: |
APK="$RUNNER_TEMP/capapp/android/app/build/outputs/apk/debug/app-debug.apk"
AAPT2=$(ls "$ANDROID_HOME"/build-tools/*/aapt2 | tail -1)
echo "Checking adaptive icon XML in APK..."
"$AAPT2" dump xmltree "$APK" --file res/mipmap-anydpi-v26/ic_launcher.xml | tee /tmp/ic_launcher.txt
grep -q "monochrome" /tmp/ic_launcher.txt
echo "Checking notification icons..."
test "$(unzip -l "$APK" | grep -c ic_stat_notification)" -eq 6
echo "Checking no obsolete ldpi launcher icons..."
! unzip -l "$APK" | grep -q "mipmap-ldpi"
echo "APK verification passed"

ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- name: Build CLI
run: |
pnpm install --frozen-lockfile
pnpm run build
- name: Scaffold Capacitor app
run: |
cd "$RUNNER_TEMP"
npm init -y @capacitor/app@latest capapp -- --name capapp --app-id com.sssf.assetstest
cd capapp
npm install --no-audit --no-fund
npm install --no-audit --no-fund @capacitor/ios
npm run build
npx cap add ios
- name: Generate assets
run: |
mkdir -p "$RUNNER_TEMP/capapp/assets"
cp test/fixtures/app/assets/icon-only.png \
test/fixtures/app/assets/splash.png \
test/fixtures/app/assets/splash-dark.png \
"$RUNNER_TEMP/capapp/assets/"
cd "$RUNNER_TEMP/capapp"
node "$GITHUB_WORKSPACE/bin/capacitor-assets" generate --ios --iconBackgroundColor '#eeeeee'
- name: Compile asset catalog with actool
run: |
OUT="$RUNNER_TEMP/actool-out"
mkdir -p "$OUT"
xcrun actool "$RUNNER_TEMP/capapp/ios/App/App/Assets.xcassets" \
--compile "$OUT" \
--platform iphoneos \
--minimum-deployment-target 14.0 \
--app-icon AppIcon \
--output-partial-info-plist "$OUT/partial.plist" > "$OUT/result.plist"
python3 - "$OUT/result.plist" <<'EOF'
import plistlib, sys
with open(sys.argv[1], 'rb') as f:
result = plistlib.load(f)
errors = result.get('com.apple.actool.errors')
if errors:
print('actool reported errors:', errors)
sys.exit(1)
print('actool compiled the asset catalog with no errors')
EOF
test -f "$OUT/Assets.car"
echo "Asset catalog verification passed"
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

# Publishes to npm via Trusted Publishing (OIDC) — no NPM_TOKEN secret.
# The npm trusted publisher for sssf-capacitor-assets must reference this
# exact workflow filename (release.yml), owner sssf-code, repo
# capacitor-assets, with the Environment field left blank.
#
# Triggers:
# - pushing a tag v* (manual releases: bump version, commit, tag, push)
# - workflow_dispatch on a tag ref (used by weekly-update.yml, whose
# GITHUB_TOKEN tag pushes cannot trigger workflows directly)

on:
push:
tags:
- 'v*'
workflow_dispatch: {}

permissions:
contents: read

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
# Required for npm Trusted Publishing (OIDC) and provenance
id-token: write
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: Install
run: pnpm install --frozen-lockfile
- name: Verify tag matches package.json version
run: |
PKG_VERSION=$(node -p "require('./package.json').version")
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$PKG_VERSION" != "$TAG_VERSION" ]; then
echo "Ref $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
exit 1
fi
- name: Build
run: pnpm run build
- name: Lint
run: pnpm run lint
- name: Test
run: pnpm test
- name: Publish to npm
# --no-git-checks: tag checkouts are detached HEAD, which pnpm's
# default git checks reject
run: pnpm publish --access public --no-git-checks
92 changes: 92 additions & 0 deletions .github/workflows/weekly-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Weekly Version Bump and Updates

permissions:
contents: write
# Needed to dispatch the release workflow after tagging
actions: write

on:
schedule:
# Runs every Monday at 5:30 AM UTC
- cron: '30 5 * * 1'
workflow_dispatch: {}

jobs:
weekly-update:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24'
cache: pnpm

- name: Install from lockfile
run: pnpm install --frozen-lockfile

- name: Update dependencies (within semver ranges)
run: pnpm update

- name: Apply security fixes for unfixable transitive deps
run: |
pnpm audit --fix || true
# audit --fix writes overrides to package.json; sync the lockfile
pnpm install --no-frozen-lockfile

- name: Report remaining vulnerabilities
continue-on-error: true
run: pnpm audit

- name: Build
run: |
pnpm exec rimraf dist
pnpm run build

- name: Test
run: pnpm test

- name: Check for changes
id: changes
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Bump patch version
if: steps.changes.outputs.changed == 'true'
id: bump-version
# npm here is intentional: pnpm has no `version` command; this only edits package.json
run: |
NEW_VERSION=$(npm version patch --no-git-tag-version)
echo "new_version=${NEW_VERSION#v}" >> "$GITHUB_OUTPUT"

- name: Commit, tag, and push changes
if: steps.changes.outputs.changed == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore: weekly version bump to v${{ steps.bump-version.outputs.new_version }} and dependency updates"
git tag "v${{ steps.bump-version.outputs.new_version }}"
git push origin HEAD "refs/tags/v${{ steps.bump-version.outputs.new_version }}"

- name: Trigger release
# Tag pushes made with GITHUB_TOKEN do not trigger workflows
# (recursion guard), so dispatch the release workflow explicitly
# on the new tag ref.
if: steps.changes.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run release.yml --ref "v${{ steps.bump-version.outputs.new_version }}"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dist
node_modules
src-old/
test-old/
.DS_Store
package-lock.json
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
pnpm run lint
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
13 changes: 13 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error",
"suspicious": "warn"
},
"rules": {
"no-underscore-dangle": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/no-array-sort": "off"
},
"ignorePatterns": ["dist", "bin", "node_modules"]
}
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
**/dist
bin
node_modules
test
Loading