From 5ec079f8fa326865c8dc836aba8f595eb7511fef Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 21:28:11 -0400 Subject: [PATCH 01/10] fix/cicd-release --- .github/workflows/release.yaml | 131 +++++++++------------------------ scripts/package.sh | 86 ++++++++++++++-------- 2 files changed, 88 insertions(+), 129 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b12f2ee..ec3822a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,39 +1,21 @@ name: Release on: - push: - branches: - - '**' pull_request: types: [closed] - branches: - - master - - main + branches: [master] + +permissions: + contents: write jobs: release: - if: | - ( - github.event_name == 'pull_request' && - github.event.pull_request.merged && - !contains(github.event.pull_request.title, '[release]') && - !contains(github.event.pull_request.title, '[no-release]') - ) || - ( - github.event_name == 'push' && - contains(join(github.event.commits.*.message), '[release]') && - !contains(join(github.event.commits.*.message), '[no-release]') - ) + if: github.event.pull_request.merged == true runs-on: ubuntu-latest - permissions: - contents: write + steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 - with: - # On pull_request merge, checks out the merge commit. - # On push, this is empty and it checks out the triggering commit. - ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Use Node.js 20 uses: actions/setup-node@v4 @@ -45,89 +27,44 @@ jobs: run: npm ci - name: Build (production) - run: npm run build:prod + run: npm run build - name: Make package script executable run: chmod +x scripts/package.sh - name: Package extension ZIP - run: ./scripts/package.sh production - - - name: Locate ZIP file - id: artifact + id: pkg run: | - ZIP_PATH=$(ls -1 release/*.zip | head -n1) - echo "zip_path=$ZIP_PATH" >> "$GITHUB_OUTPUT" - echo "zip_name=$(basename "$ZIP_PATH")" >> "$GITHUB_OUTPUT" + ./scripts/package.sh production + echo "zip=$(ls -1 release/*.zip | head -n1)" >> "$GITHUB_OUTPUT" + + - name: Read version from manifest + id: ver + run: echo "version=$(jq -r .version manifest.json)" >> "$GITHUB_OUTPUT" - - name: Upload build artifact + - name: Upload ZIP artifact uses: actions/upload-artifact@v4 with: - name: ${{ steps.artifact.outputs.zip_name }} - path: ${{ steps.artifact.outputs.zip_path }} - - - name: Generate Release Info - id: release_info - run: | - if [ "${{ github.event_name }}" == "pull_request" ]; then - TAG="pr-${{ github.event.pull_request.number }}-merge-${{ github.run_number }}" - RELEASE_NAME="Auto release for PR #${{ github.event.pull_request.number }}" - RELEASE_BODY="Automatic release for PR #${{ github.event.pull_request.number }} merged into ${{ github.event.pull_request.base.ref }}.\n- Commit: ${{ github.event.pull_request.merge_commit_sha }}" - else - VERSION=$(node -e "console.log(require('./package.json').version)") - COMMIT_SHA_SHORT=$(echo "${{ github.sha }}" | cut -c1-7) - TAG="v${VERSION}-${COMMIT_SHA_SHORT}-${{ github.run_number }}" - RELEASE_NAME="Release $TAG" - RELEASE_BODY="Manual release triggered from commit [\`${COMMIT_SHA_SHORT}\`](${{ github.event.repository.html_url }}/commit/${{ github.sha }}).\n\n**Commit message:**\n${{ github.event.head_commit.message }}" - fi - echo "TAG=$TAG" >> "$GITHUB_OUTPUT" - echo "RELEASE_NAME=$RELEASE_NAME" >> "$GITHUB_OUTPUT" - # Using heredoc for multiline body - { - echo "RELEASE_BODY<> "$GITHUB_OUTPUT" - - - name: Create and push tag - run: | - git config user.name "${{ github.actor }}" - git config user.email "${{ github.actor }}@users.noreply.github.com" - git tag -a "${{ steps.release_info.outputs.TAG }}" -m "${{ steps.release_info.outputs.RELEASE_NAME }}" - git push origin "${{ steps.release_info.outputs.TAG }}" + name: extension-zip + path: ${{ steps.pkg.outputs.zip }} + if-no-files-found: error + compression-level: 0 - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: - tag_name: ${{ steps.release_info.outputs.TAG }} - name: ${{ steps.release_info.outputs.RELEASE_NAME }} - body: ${{ steps.release_info.outputs.RELEASE_BODY }} - files: ${{ steps.artifact.outputs.zip_path }} + tag_name: v${{ steps.ver.outputs.version }}-${{ github.sha }} + name: v${{ steps.ver.outputs.version }} (PR #${{ github.event.pull_request.number }}) + generate_release_notes: true + files: ${{ steps.pkg.outputs.zip }} - - name: Upload & publish to Chrome Web Store - env: - ZIP_PATH: ${{ steps.artifact.outputs.zip_path }} - EXT_ID: ${{ secrets.CWS_EXTENSION_ID }} - CLIENT_ID: ${{ secrets.CWS_CLIENT_ID }} - CLIENT_SECRET: ${{ secrets.CWS_CLIENT_SECRET }} - REFRESH_TOKEN: ${{ secrets.CWS_REFRESH_TOKEN }} - run: | - set -euo pipefail - ACCESS_TOKEN=$(curl -sS -X POST https://oauth2.googleapis.com/token \ - -d client_id="$CLIENT_ID" \ - -d client_secret="$CLIENT_SECRET" \ - -d refresh_token="$REFRESH_TOKEN" \ - -d grant_type=refresh_token | jq -r .access_token) - - curl -sS -X PUT \ - -H "Authorization: Bearer $ACCESS_TOKEN" \ - -H "x-goog-api-version: 2" \ - -H "Content-Type: application/zip" \ - --data-binary @"$ZIP_PATH" \ - "https://www.googleapis.com/upload/chromewebstore/v1.1/items/$EXT_ID" - - curl -sS -X POST \ - -H "Authorization: Bearer $ACCESS_TOKEN" \ - -H "x-goog-api-version: 2" \ - -H "Content-Length: 0" \ - "https://www.googleapis.com/chromewebstore/v1.1/items/$EXT_ID/publish?publishTarget=default" + - name: Upload to Chrome Web Store (optional) + if: ${{ secrets.CHROME_CLIENT_ID != '' && secrets.CHROME_CLIENT_SECRET != '' && secrets.CHROME_REFRESH_TOKEN != '' && secrets.CHROME_EXTENSION_ID != '' }} + uses: Klemensas/chrome-extension-deploy@v2 + with: + refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }} + client-id: ${{ secrets.CHROME_CLIENT_ID }} + client-secret: ${{ secrets.CHROME_CLIENT_SECRET }} + file-name: ${{ steps.pkg.outputs.zip }} + app-id: ${{ secrets.CHROME_EXTENSION_ID }} + publish: true diff --git a/scripts/package.sh b/scripts/package.sh index 5e2a3c5..246f2bd 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -1,46 +1,68 @@ -#!/bin/bash - +#!/usr/bin/env bash set -euo pipefail -ENVIRONMENT=${1:-production} -ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd) -RELEASE_DIR="$ROOT_DIR/release" -DIST_DIR="$ROOT_DIR/dist" +MODE="${1:-production}" + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$ROOT" + +if ! command -v jq >/dev/null 2>&1; then + echo "jq is required (to read manifest.json)." >&2 + exit 1 +fi -echo "Packaging environment: $ENVIRONMENT" +VERSION="$(jq -r .version manifest.json)" +NAME_RAW="$(jq -r .name manifest.json)" +NAME="$(echo "$NAME_RAW" | tr '[:upper:]' '[:lower:]' | tr -cd 'a-z0-9-_' | sed -E 's/_+/-/g' | sed -E 's/-+/-/g')" +[ -n "$NAME" ] || NAME="extension" -cd "$ROOT_DIR" +DIST="$ROOT/dist" +RELEASE_DIR="$ROOT/release" +ZIP_PATH="$RELEASE_DIR/${NAME}-${VERSION}-${MODE}.zip" -echo "Cleaning dist and release directories..." -rm -rf "$DIST_DIR" "$RELEASE_DIR" +echo "Packaging environment: $MODE" mkdir -p "$RELEASE_DIR" -case "$ENVIRONMENT" in - development|test|production) ;; - *) echo "Unknown environment: $ENVIRONMENT (use development|test|production)"; exit 1;; -esac +# Ensure dist exists (CI should have built already) +if [ ! -d "$DIST" ]; then + echo "dist/ not found; running build once…" + npm run build +fi -echo "Building extension..." -npm run build --silent +echo "Preparing package content…" -NAME=$(node -e "console.log(require('./package.json').name)") -VERSION=$(node -e "console.log(require('./package.json').version)") -ZIP_NAME="$NAME-$VERSION-$ENVIRONMENT.zip" +# Always include manifest.json in dist/ +cp -f "$ROOT/manifest.json" "$DIST/" -echo "Creating zip: $ZIP_NAME" -TEMP_DIR=$(mktemp -d) -trap 'rm -rf "$TEMP_DIR"' EXIT +# Copy icons/ if present (legacy layout) +if [ -d "$ROOT/icons" ]; then + echo "Copying icons/ → dist/icons/" + mkdir -p "$DIST/icons" + cp -R "$ROOT/icons/." "$DIST/icons/" +fi -# Copy required files into temp staging directory -mkdir -p "$TEMP_DIR" -cp -a manifest.json popup.html icons assets "$TEMP_DIR/" -cp -a dist "$TEMP_DIR/" +# Copy assets/ (common layout for icons/images) +if [ -d "$ROOT/assets" ]; then + echo "Copying assets/ → dist/assets/" + mkdir -p "$DIST/assets" + cp -R "$ROOT/assets/." "$DIST/assets/" +fi -# Optional: include README and LICENSE -if [ -f README.md ]; then cp README.md "$TEMP_DIR/"; fi -if [ -f LICENSE ]; then cp LICENSE "$TEMP_DIR/"; fi +# Copy public/ (static html or images) +if [ -d "$ROOT/public" ]; then + echo "Copying public/ → dist/" + cp -R "$ROOT/public/." "$DIST/" +fi -mkdir -p "$RELEASE_DIR" -(cd "$TEMP_DIR" && zip -q -r "$RELEASE_DIR/$ZIP_NAME" .) +# If those HTML files live at repo root, include them too +for f in popup.html options.html background.html; do + if [ -f "$ROOT/$f" ]; then + cp -f "$ROOT/$f" "$DIST/" + fi +done + +echo "Creating zip: $(basename "$ZIP_PATH")" +cd "$DIST" +zip -qr9 "$ZIP_PATH" . -echo "Done: $RELEASE_DIR/$ZIP_NAME" +echo "✅ Created: $ZIP_PATH" From f187852df595d133927eb71696057ff60b1a5848 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 21:35:14 -0400 Subject: [PATCH 02/10] fix/cicd-release --- .github/workflows/version-bump.yml | 116 ++++++++++++++++------------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index e082e82..3767fea 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,70 +1,82 @@ -name: Auto-bump manifest.json version in PR +name: PR — Bump manifest version on: pull_request: - types: [opened, synchronize, reopened, ready_for_review] + types: [opened, synchronize, reopened, labeled] permissions: - contents: write # needed to push back to the PR branch + contents: write + pull-requests: write jobs: bump: - # Only try to push if the PR branch is in this repo (not a fork) + # Skip forks; only bump when PR branch is in this repo if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest - steps: - - name: Checkout PR head branch (not merge commit) + - name: Checkout PR branch uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.ref }} - persist-credentials: false - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - # Optional: if your repo requires "Verified" commits, import a GPG key - # Put your armored private key in repo/org secret GPG_PRIVATE_KEY and passphrase in GPG_PASSPHRASE - - name: Import GPG key (optional, for Verified commits) - if: ${{ secrets.GPG_PRIVATE_KEY && secrets.GPG_PASSPHRASE }} - uses: crazy-max/ghaction-import-gpg@v6 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PASSPHRASE }} - git_user_signingkey: true - git_commit_gpgsign: true + ref: ${{ github.head_ref }} + fetch-depth: 0 - - name: Bump manifest.json (patch) + - name: Bump version in manifest.json (and package.json if present) with Verified commit id: bump + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + BRANCH: ${{ github.head_ref }} + LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }} run: | - test -f manifest.json || { echo "manifest.json not found"; exit 1; } - node - <<'NODE' - const fs = require('fs'); - const p = 'manifest.json'; - const m = JSON.parse(fs.readFileSync(p, 'utf8')); - const parts = (m.version || '0.0.0').split('.').map(n => parseInt(n,10)||0); - while (parts.length < 3) parts.push(0); - parts[2] += 1; // patch++ - m.version = parts.join('.'); - fs.writeFileSync(p, JSON.stringify(m, null, 2) + '\n'); - console.log('NEW_VERSION=' + m.version); - NODE - NEW_VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('manifest.json','utf8')).version)") - echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT" + set -euo pipefail - - name: Commit change - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add manifest.json - git commit -m "chore: bump manifest version to ${{ steps.bump.outputs.new_version }} [skip ci]" || echo "No changes to commit" + # choose bump from labels (default = patch) + bump="patch" + case "$LABELS" in + *release:major*) bump="major" ;; + *release:minor*) bump="minor" ;; + *) bump="patch" ;; + esac - - name: Push back to PR branch - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # push to the contributor's branch in *this* repo - git push "https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git" \ - HEAD:${{ github.event.pull_request.head.ref }} + bump_file () { + local path="$1" + + # Read file from PR branch; if it doesn't exist, skip. + if ! json=$(gh api -H "Accept: application/vnd.github+json" \ + "/repos/$REPO/contents/$path?ref=$BRANCH" 2>/dev/null); then + echo "skip $path (not found)"; return 0 + fi + + local sha=$(echo "$json" | jq -r .sha) + local content=$(echo "$json" | jq -r .content | tr -d '\n' | base64 --decode) + local current=$(echo "$content" | jq -r .version) + + if [[ "$current" == "null" || -z "$current" ]]; then + echo "skip $path (no .version field)"; return 0 + fi + + IFS='.' read -r MA MI PA <<<"$current" + case "$bump" in + major) MA=$((MA+1)); MI=0; PA=0 ;; + minor) MI=$((MI+1)); PA=0 ;; + patch) PA=$((PA+1)) ;; + esac + local next="${MA}.${MI}.${PA}" + + local updated=$(echo "$content" | jq --arg v "$next" '.version=$v') + local b64=$(echo "$updated" | base64 -w 0) + + # Use GitHub Contents API so the commit is GitHub-signed (Verified) + gh api --method PUT -H "Accept: application/vnd.github+json" \ + "/repos/$REPO/contents/$path" \ + -f message="chore: bump $path version to $next" \ + -f content="$b64" \ + -f sha="$sha" \ + -f branch="$BRANCH" >/dev/null + + echo "Bumped $path → $next" + echo "next=$next" >> "$GITHUB_OUTPUT" + } + + bump_file manifest.json + bump_file package.json || true From a35bd4bdac7109e137b52f76704cf1491d967599 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 21:38:33 -0400 Subject: [PATCH 03/10] fix/cicd-release --- .github/workflows/release.yaml | 1 - .github/workflows/version-bump.yml | 127 +++++++++++++++++++---------- 2 files changed, 82 insertions(+), 46 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ec3822a..7d29aff 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,7 +12,6 @@ jobs: release: if: github.event.pull_request.merged == true runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 3767fea..5561dd8 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,4 +1,4 @@ -name: PR — Bump manifest version +name: PR — Bump manifest version via nested PR on: pull_request: @@ -10,73 +10,110 @@ permissions: jobs: bump: - # Skip forks; only bump when PR branch is in this repo + # Only run for PRs whose source branch is in this repo (not forks) if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest + steps: - - name: Checkout PR branch + - name: Checkout PR branch (read-only) uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} fetch-depth: 0 - - name: Bump version in manifest.json (and package.json if present) with Verified commit + - name: Open bump PR (no direct push to protected refs) id: bump env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} - BRANCH: ${{ github.head_ref }} - LABELS: ${{ join(github.event.pull_request.labels.*.name, ',') }} + PR_NUMBER: ${{ github.event.pull_request.number }} + HEAD_REF: ${{ github.head_ref }} run: | set -euo pipefail - # choose bump from labels (default = patch) + # Helpers + api() { gh api -H "Accept: application/vnd.github+json" "$@"; } + + # Decide bump level from PR labels (default patch) + labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | paste -sd, - || true) bump="patch" - case "$LABELS" in + case "$labels" in *release:major*) bump="major" ;; *release:minor*) bump="minor" ;; *) bump="patch" ;; esac + echo "Bump level: $bump" - bump_file () { - local path="$1" + # Get latest HEAD sha of the PR branch + head_json=$(api "/repos/$REPO/git/ref/heads/$HEAD_REF") + head_sha=$(jq -r '.object.sha' <<<"$head_json") - # Read file from PR branch; if it doesn't exist, skip. - if ! json=$(gh api -H "Accept: application/vnd.github+json" \ - "/repos/$REPO/contents/$path?ref=$BRANCH" 2>/dev/null); then - echo "skip $path (not found)"; return 0 - fi + # Read manifest.json from PR branch + manifest_json=$(api "/repos/$REPO/contents/manifest.json?ref=$HEAD_REF") + manifest_sha=$(jq -r .sha <<<"$manifest_json") + manifest_raw=$(jq -r .content <<<"$manifest_json" | tr -d '\n' | base64 --decode) + current=$(jq -r .version <<<"$manifest_raw") + if [[ -z "$current" || "$current" == "null" ]]; then + echo "::notice title=Skip::manifest.json has no .version field"; exit 0 + fi + IFS='.' read -r MA MI PA <<<"$current" + case "$bump" in + major) MA=$((MA+1)); MI=0; PA=0 ;; + minor) MI=$((MI+1)); PA=0 ;; + patch) PA=$((PA+1)) ;; + esac + next="${MA}.${MI}.${PA}" + echo "Current: $current → Next: $next" - local sha=$(echo "$json" | jq -r .sha) - local content=$(echo "$json" | jq -r .content | tr -d '\n' | base64 --decode) - local current=$(echo "$content" | jq -r .version) + # Prepare names + safe_head=$(echo "$HEAD_REF" | tr '/' '-') + bump_branch="bot/bump-${next}-for-${safe_head}-${GITHUB_RUN_ID}" - if [[ "$current" == "null" || -z "$current" ]]; then - echo "skip $path (no .version field)"; return 0 + # Create the bump branch from PR head + api --method POST "/repos/$REPO/git/refs" \ + -f ref="refs/heads/$bump_branch" \ + -f sha="$head_sha" >/dev/null + + # Update manifest.json on the bump branch (Verified commit via Contents API) + updated_manifest=$(jq --arg v "$next" '.version=$v' <<<"$manifest_raw") + updated_manifest_b64=$(printf "%s" "$updated_manifest" | base64 -w 0) + api --method PUT "/repos/$REPO/contents/manifest.json" \ + -f message="chore: bump manifest.json version to $next" \ + -f content="$updated_manifest_b64" \ + -f sha="$manifest_sha" \ + -f branch="$bump_branch" >/dev/null + + # If package.json exists and has version, bump it too on the bump branch + if api "/repos/$REPO/contents/package.json?ref=$HEAD_REF" >/tmp/pj.json 2>/dev/null; then + pj_sha=$(jq -r .sha /dev/null + echo "Bumped package.json too" fi + fi + + # Open PR into the original PR branch + pr_body="Automated version bump for #$PR_NUMBER\n\nBumps manifest.json (and package.json if present) from **$current** → **$next**." + new_pr=$(api --method POST "/repos/$REPO/pulls" \ + -f title="chore: bump version to $next for PR #$PR_NUMBER" \ + -f head="$bump_branch" \ + -f base="$HEAD_REF" \ + -f body="$pr_body") + bump_number=$(jq -r .number <<<"$new_pr") + echo "bump_pr_number=$bump_number" >>"$GITHUB_OUTPUT" + echo "next=$next" >>"$GITHUB_OUTPUT" + + # Try to enable auto-merge (will no-op if disallowed) + gh pr merge "$bump_number" --auto --squash --delete-branch || true - IFS='.' read -r MA MI PA <<<"$current" - case "$bump" in - major) MA=$((MA+1)); MI=0; PA=0 ;; - minor) MI=$((MI+1)); PA=0 ;; - patch) PA=$((PA+1)) ;; - esac - local next="${MA}.${MI}.${PA}" - - local updated=$(echo "$content" | jq --arg v "$next" '.version=$v') - local b64=$(echo "$updated" | base64 -w 0) - - # Use GitHub Contents API so the commit is GitHub-signed (Verified) - gh api --method PUT -H "Accept: application/vnd.github+json" \ - "/repos/$REPO/contents/$path" \ - -f message="chore: bump $path version to $next" \ - -f content="$b64" \ - -f sha="$sha" \ - -f branch="$BRANCH" >/dev/null - - echo "Bumped $path → $next" - echo "next=$next" >> "$GITHUB_OUTPUT" - } - - bump_file manifest.json - bump_file package.json || true + # Comment on the main PR with the link, in case manual action is needed + gh issue comment "$PR_NUMBER" \ + --body="Opened version-bump PR #$bump_number (→ $next). Merge it to update this PR branch." From 360c3e140e7ae0616a7392f80f801c923c837292 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 21:40:47 -0400 Subject: [PATCH 04/10] fix/cicd-release --- scripts/package.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/package.sh b/scripts/package.sh index 246f2bd..580ee0e 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -23,38 +23,33 @@ ZIP_PATH="$RELEASE_DIR/${NAME}-${VERSION}-${MODE}.zip" echo "Packaging environment: $MODE" mkdir -p "$RELEASE_DIR" -# Ensure dist exists (CI should have built already) if [ ! -d "$DIST" ]; then echo "dist/ not found; running build once…" npm run build fi echo "Preparing package content…" - -# Always include manifest.json in dist/ cp -f "$ROOT/manifest.json" "$DIST/" -# Copy icons/ if present (legacy layout) if [ -d "$ROOT/icons" ]; then echo "Copying icons/ → dist/icons/" mkdir -p "$DIST/icons" cp -R "$ROOT/icons/." "$DIST/icons/" +else + echo "No icons/ directory; skipping." fi -# Copy assets/ (common layout for icons/images) if [ -d "$ROOT/assets" ]; then echo "Copying assets/ → dist/assets/" mkdir -p "$DIST/assets" cp -R "$ROOT/assets/." "$DIST/assets/" fi -# Copy public/ (static html or images) if [ -d "$ROOT/public" ]; then echo "Copying public/ → dist/" cp -R "$ROOT/public/." "$DIST/" fi -# If those HTML files live at repo root, include them too for f in popup.html options.html background.html; do if [ -f "$ROOT/$f" ]; then cp -f "$ROOT/$f" "$DIST/" @@ -64,5 +59,4 @@ done echo "Creating zip: $(basename "$ZIP_PATH")" cd "$DIST" zip -qr9 "$ZIP_PATH" . - echo "✅ Created: $ZIP_PATH" From 7358d0477224038b4a63a33dac65e3db6ea1ee19 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 21:57:55 -0400 Subject: [PATCH 05/10] fix/cicd-release --- .github/workflows/version-bump.yml | 126 ++++++++--------------------- 1 file changed, 35 insertions(+), 91 deletions(-) diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 5561dd8..9515dc4 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -1,19 +1,10 @@ -name: PR — Bump manifest version via nested PR - -on: - pull_request: - types: [opened, synchronize, reopened, labeled] - -permissions: - contents: write - pull-requests: write - jobs: bump: - # Only run for PRs whose source branch is in this repo (not forks) if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest - + permissions: + contents: write + pull-requests: write steps: - name: Checkout PR branch (read-only) uses: actions/checkout@v4 @@ -21,41 +12,18 @@ jobs: ref: ${{ github.head_ref }} fetch-depth: 0 - - name: Open bump PR (no direct push to protected refs) - id: bump - env: - GH_TOKEN: ${{ github.token }} - REPO: ${{ github.repository }} - PR_NUMBER: ${{ github.event.pull_request.number }} - HEAD_REF: ${{ github.head_ref }} + - name: Decide bump level & compute next version + id: prep run: | set -euo pipefail - - # Helpers - api() { gh api -H "Accept: application/vnd.github+json" "$@"; } - - # Decide bump level from PR labels (default patch) labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | paste -sd, - || true) - bump="patch" + bump=patch case "$labels" in - *release:major*) bump="major" ;; - *release:minor*) bump="minor" ;; - *) bump="patch" ;; + *release:major*) bump=major ;; + *release:minor*) bump=minor ;; esac - echo "Bump level: $bump" - - # Get latest HEAD sha of the PR branch - head_json=$(api "/repos/$REPO/git/ref/heads/$HEAD_REF") - head_sha=$(jq -r '.object.sha' <<<"$head_json") - # Read manifest.json from PR branch - manifest_json=$(api "/repos/$REPO/contents/manifest.json?ref=$HEAD_REF") - manifest_sha=$(jq -r .sha <<<"$manifest_json") - manifest_raw=$(jq -r .content <<<"$manifest_json" | tr -d '\n' | base64 --decode) - current=$(jq -r .version <<<"$manifest_raw") - if [[ -z "$current" || "$current" == "null" ]]; then - echo "::notice title=Skip::manifest.json has no .version field"; exit 0 - fi + current=$(jq -r .version manifest.json) IFS='.' read -r MA MI PA <<<"$current" case "$bump" in major) MA=$((MA+1)); MI=0; PA=0 ;; @@ -63,57 +31,33 @@ jobs: patch) PA=$((PA+1)) ;; esac next="${MA}.${MI}.${PA}" - echo "Current: $current → Next: $next" - - # Prepare names - safe_head=$(echo "$HEAD_REF" | tr '/' '-') - bump_branch="bot/bump-${next}-for-${safe_head}-${GITHUB_RUN_ID}" - - # Create the bump branch from PR head - api --method POST "/repos/$REPO/git/refs" \ - -f ref="refs/heads/$bump_branch" \ - -f sha="$head_sha" >/dev/null - # Update manifest.json on the bump branch (Verified commit via Contents API) - updated_manifest=$(jq --arg v "$next" '.version=$v' <<<"$manifest_raw") - updated_manifest_b64=$(printf "%s" "$updated_manifest" | base64 -w 0) - api --method PUT "/repos/$REPO/contents/manifest.json" \ - -f message="chore: bump manifest.json version to $next" \ - -f content="$updated_manifest_b64" \ - -f sha="$manifest_sha" \ - -f branch="$bump_branch" >/dev/null + echo "current=$current"; echo "next=$next"; echo "bump=$bump" + echo "next=$next" >> "$GITHUB_OUTPUT" - # If package.json exists and has version, bump it too on the bump branch - if api "/repos/$REPO/contents/package.json?ref=$HEAD_REF" >/tmp/pj.json 2>/dev/null; then - pj_sha=$(jq -r .sha /dev/null - echo "Bumped package.json too" - fi + - name: Apply version bump to files + run: | + jq --arg v "${{ steps.prep.outputs.next }}" '.version=$v' manifest.json > manifest.tmp && mv manifest.tmp manifest.json + if jq -e '.version' package.json >/dev/null 2>&1; then + jq --arg v "${{ steps.prep.outputs.next }}" '.version=$v' package.json > package.tmp && mv package.tmp package.json fi - # Open PR into the original PR branch - pr_body="Automated version bump for #$PR_NUMBER\n\nBumps manifest.json (and package.json if present) from **$current** → **$next**." - new_pr=$(api --method POST "/repos/$REPO/pulls" \ - -f title="chore: bump version to $next for PR #$PR_NUMBER" \ - -f head="$bump_branch" \ - -f base="$HEAD_REF" \ - -f body="$pr_body") - bump_number=$(jq -r .number <<<"$new_pr") - echo "bump_pr_number=$bump_number" >>"$GITHUB_OUTPUT" - echo "next=$next" >>"$GITHUB_OUTPUT" - - # Try to enable auto-merge (will no-op if disallowed) - gh pr merge "$bump_number" --auto --squash --delete-branch || true - - # Comment on the main PR with the link, in case manual action is needed - gh issue comment "$PR_NUMBER" \ - --body="Opened version-bump PR #$bump_number (→ $next). Merge it to update this PR branch." + - name: Open version-bump PR into the PR branch + id: cpr + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ github.token }} + commit-message: chore: bump version to ${{ steps.prep.outputs.next }} + title: chore: bump version to ${{ steps.prep.outputs.next }} for PR #${{ github.event.pull_request.number }} + body: Automated version bump for #${{ github.event.pull_request.number }}. + branch: bot/bump-${{ steps.prep.outputs.next }}-for-${{ github.head_ref }} + base: ${{ github.head_ref }} # open PR into the contributor's PR branch + delete-branch: true + draft: false + labels: automated + + - name: Try to enable auto-merge + if: steps.cpr.outputs.pull-request-number != '' + env: + GH_TOKEN: ${{ github.token }} + run: gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash --delete-branch || true From 931818e1bcf8be5dad6f1f77701602cc9ca73173 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 22:33:23 -0400 Subject: [PATCH 06/10] fix/cicd-release --- .github/workflows/{build.yml => build.yaml} | 0 .github/workflows/{ci.yml => ci.yaml} | 0 .../{version-bump.yml => version-bump.yaml} | 30 +++++++++---------- 3 files changed, 15 insertions(+), 15 deletions(-) rename .github/workflows/{build.yml => build.yaml} (100%) rename .github/workflows/{ci.yml => ci.yaml} (100%) rename .github/workflows/{version-bump.yml => version-bump.yaml} (78%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yaml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/build.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/ci.yaml diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yaml similarity index 78% rename from .github/workflows/version-bump.yml rename to .github/workflows/version-bump.yaml index 9515dc4..0588e69 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yaml @@ -1,12 +1,20 @@ +name: Version bump on PR + +on: + pull_request: + types: [opened, reopened, synchronize, labeled, ready_for_review] + branches: ["**"] + +permissions: + contents: write + pull-requests: write + jobs: bump: - if: github.event.pull_request.head.repo.full_name == github.repository + if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write steps: - - name: Checkout PR branch (read-only) + - name: Checkout PR branch uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} @@ -22,7 +30,6 @@ jobs: *release:major*) bump=major ;; *release:minor*) bump=minor ;; esac - current=$(jq -r .version manifest.json) IFS='.' read -r MA MI PA <<<"$current" case "$bump" in @@ -31,8 +38,6 @@ jobs: patch) PA=$((PA+1)) ;; esac next="${MA}.${MI}.${PA}" - - echo "current=$current"; echo "next=$next"; echo "bump=$bump" echo "next=$next" >> "$GITHUB_OUTPUT" - name: Apply version bump to files @@ -51,13 +56,8 @@ jobs: title: chore: bump version to ${{ steps.prep.outputs.next }} for PR #${{ github.event.pull_request.number }} body: Automated version bump for #${{ github.event.pull_request.number }}. branch: bot/bump-${{ steps.prep.outputs.next }}-for-${{ github.head_ref }} - base: ${{ github.head_ref }} # open PR into the contributor's PR branch + base: ${{ github.head_ref }} delete-branch: true draft: false labels: automated - - - name: Try to enable auto-merge - if: steps.cpr.outputs.pull-request-number != '' - env: - GH_TOKEN: ${{ github.token }} - run: gh pr merge ${{ steps.cpr.outputs.pull-request-number }} --auto --squash --delete-branch || true + signoff: true From 74e51c50ff13090e69da93a559460fcae631bb07 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 22:34:52 -0400 Subject: [PATCH 07/10] fix/cicd-release --- .github/workflows/ci.yaml | 44 --------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index b38945c..0000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: CI - -on: - pull_request: - branches: ["**"] - -jobs: - build-and-check: - name: Build and checks - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Use Node.js 20 - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: TypeScript type check - run: npm run typecheck - - - name: Build (development env) - run: npm run build - - - name: Build (test env) - run: npm run build:test - - - name: Build (production env) - run: npm run build:prod - - - name: Archive production build - if: always() - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist/** - if-no-files-found: ignore - - From bc5837873fc36bf8eab8003b1a00233fe1ec87d6 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Thu, 30 Oct 2025 22:38:51 -0400 Subject: [PATCH 08/10] fix/cicd-release --- .github/workflows/version-bump.yaml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml index 0588e69..9aa98df 100644 --- a/.github/workflows/version-bump.yaml +++ b/.github/workflows/version-bump.yaml @@ -11,6 +11,7 @@ permissions: jobs: bump: + # only for branches in this repo, not forks; and skip drafts if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft runs-on: ubuntu-latest steps: @@ -22,6 +23,7 @@ jobs: - name: Decide bump level & compute next version id: prep + shell: bash run: | set -euo pipefail labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | paste -sd, - || true) @@ -30,6 +32,7 @@ jobs: *release:major*) bump=major ;; *release:minor*) bump=minor ;; esac + current=$(jq -r .version manifest.json) IFS='.' read -r MA MI PA <<<"$current" case "$bump" in @@ -47,17 +50,12 @@ jobs: jq --arg v "${{ steps.prep.outputs.next }}" '.version=$v' package.json > package.tmp && mv package.tmp package.json fi - - name: Open version-bump PR into the PR branch - id: cpr - uses: peter-evans/create-pull-request@v6 - with: - token: ${{ github.token }} - commit-message: chore: bump version to ${{ steps.prep.outputs.next }} - title: chore: bump version to ${{ steps.prep.outputs.next }} for PR #${{ github.event.pull_request.number }} - body: Automated version bump for #${{ github.event.pull_request.number }}. - branch: bot/bump-${{ steps.prep.outputs.next }}-for-${{ github.head_ref }} - base: ${{ github.head_ref }} - delete-branch: true - draft: false - labels: automated - signoff: true + - name: Commit & push back to PR branch + env: + BRANCH: ${{ github.head_ref }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add manifest.json package.json 2>/dev/null || true + git commit -m "chore: bump version to ${{ steps.prep.outputs.next }}" || exit 0 + git push origin HEAD:$BRANCH From 1c0c2a9a01fa8885e56fcbd16ec2d08b2004ba05 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Fri, 31 Oct 2025 19:38:15 -0400 Subject: [PATCH 09/10] fix/cicd-release --- .husky/prepare-commit-msg | 4 +++ package-lock.json | 21 ++++++++++-- package.json | 4 ++- scripts/version-bump.js | 67 ++++++++++++++++++++++++++++----------- 4 files changed, 74 insertions(+), 22 deletions(-) create mode 100755 .husky/prepare-commit-msg diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg new file mode 100755 index 0000000..5111c10 --- /dev/null +++ b/.husky/prepare-commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +node scripts/version-bump.js $1 diff --git a/package-lock.json b/package-lock.json index e07dcfd..e61d01a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "tiktok-downloader-chrome-extension", + "name": "listr", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "tiktok-downloader-chrome-extension", + "name": "listr", "version": "1.0.0", "dependencies": { "lucide-react": "^0.477.0", @@ -19,6 +19,7 @@ "@types/webextension-polyfill": "^0.12.3", "autoprefixer": "^10.4.20", "css-loader": "^7.1.2", + "husky": "^9.1.7", "postcss": "^8.4.49", "postcss-loader": "^8.1.1", "style-loader": "^4.0.0", @@ -1417,6 +1418,22 @@ "node": ">= 0.4" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/icss-utils": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", diff --git a/package.json b/package.json index ed60a91..34be6d5 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "build:prod": "webpack --mode production", "start": "webpack --mode development --watch", "typecheck": "tsc --noEmit", - "package": "./scripts/package.sh" + "package": "./scripts/package.sh", + "prepare": "husky" }, "dependencies": { "lucide-react": "^0.477.0", @@ -22,6 +23,7 @@ "@types/webextension-polyfill": "^0.12.3", "autoprefixer": "^10.4.20", "css-loader": "^7.1.2", + "husky": "^9.1.7", "postcss": "^8.4.49", "postcss-loader": "^8.1.1", "style-loader": "^4.0.0", diff --git a/scripts/version-bump.js b/scripts/version-bump.js index 83ab818..2e487dc 100644 --- a/scripts/version-bump.js +++ b/scripts/version-bump.js @@ -1,26 +1,56 @@ const fs = require('fs'); +const { execSync } = require('child_process'); const manifestPath = './manifest.json'; const packageJsonPath = './package.json'; +const commitMsgPath = process.argv[2]; -const branchName = process.env.BRANCH_NAME; -const commitMessages = process.env.COMMIT_MESSAGES; +if (!commitMsgPath) { + console.log('No commit message path provided. Skipping version bump.'); + process.exit(0); +} -// Read manifest.json to get the current version -const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); -const currentVersion = manifest.version; +// Function to get file content from a specific branch +function getFileFromBranch(branch, path) { + try { + return execSync(`git show ${branch}:${path}`).toString(); + } catch (error) { + console.error(`Error getting ${path} from branch ${branch}:`, error); + return null; + } +} -console.log(`Current version: ${currentVersion}`); +// 1. Get versions and compare +const masterManifestContent = getFileFromBranch('master', manifestPath) || getFileFromBranch('main', manifestPath); +if (!masterManifestContent) { + console.log('Could not retrieve manifest from master/main branch. Skipping version bump.'); + process.exit(0); +} -let [major, minor, patch] = currentVersion.split('.').map(Number); +const masterVersion = JSON.parse(masterManifestContent).version; +const currentManifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8')); +const currentVersion = currentManifest.version; + +console.log(`Version on master/main: ${masterVersion}`); +console.log(`Version on current branch: ${currentVersion}`); -let bumpType = 'patch'; // Default bump type +if (masterVersion !== currentVersion) { + console.log('Version already bumped in this branch. Skipping.'); + process.exit(0); +} + +// 2. Bump version based on commit message and branch name +const commitMessage = fs.readFileSync(commitMsgPath, 'utf8'); +const branchName = execSync('git rev-parse --abbrev-ref HEAD').toString().trim(); -if (branchName && branchName.startsWith('feature/')) { +let [major, minor, patch] = currentVersion.split('.').map(Number); +let bumpType = 'patch'; // Default + +if (branchName.startsWith('feature/')) { bumpType = 'minor'; } -if (commitMessages && commitMessages.includes('[major]')) { +if (commitMessage.includes('[major]')) { bumpType = 'major'; } @@ -38,18 +68,17 @@ if (bumpType === 'major') { } const newVersion = `${major}.${minor}.${patch}`; -console.log(`New version: ${newVersion}`); +console.log(`Bumping version to: ${newVersion}`); -// Update manifest.json -manifest.version = newVersion; -fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n'); -console.log(`Updated ${manifestPath} to version ${newVersion}`); +// 3. Update manifest.json and package.json +currentManifest.version = newVersion; +fs.writeFileSync(manifestPath, JSON.stringify(currentManifest, null, 2) + '\n'); -// Update package.json const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); packageJson.version = newVersion; fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n'); -console.log(`Updated ${packageJsonPath} to version ${newVersion}`); -// Set output for the GitHub Action -console.log(`::set-output name=new_version::${newVersion}`); +// 4. Add updated files to the commit +execSync(`git add ${manifestPath} ${packageJsonPath}`); + +console.log('Version bumped and files staged successfully.'); From 577f706e7d6fd7315f70a628c25809ffdd90ddc1 Mon Sep 17 00:00:00 2001 From: hjoncour Date: Fri, 31 Oct 2025 19:39:22 -0400 Subject: [PATCH 10/10] fix/cicd-release --- .github/workflows/version-bump.yaml | 61 ----------------------------- manifest.json | 16 ++++++-- package.json | 2 +- 3 files changed, 13 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/version-bump.yaml diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml deleted file mode 100644 index 9aa98df..0000000 --- a/.github/workflows/version-bump.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Version bump on PR - -on: - pull_request: - types: [opened, reopened, synchronize, labeled, ready_for_review] - branches: ["**"] - -permissions: - contents: write - pull-requests: write - -jobs: - bump: - # only for branches in this repo, not forks; and skip drafts - if: github.event.pull_request.head.repo.full_name == github.repository && !github.event.pull_request.draft - runs-on: ubuntu-latest - steps: - - name: Checkout PR branch - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - fetch-depth: 0 - - - name: Decide bump level & compute next version - id: prep - shell: bash - run: | - set -euo pipefail - labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH" | paste -sd, - || true) - bump=patch - case "$labels" in - *release:major*) bump=major ;; - *release:minor*) bump=minor ;; - esac - - current=$(jq -r .version manifest.json) - IFS='.' read -r MA MI PA <<<"$current" - case "$bump" in - major) MA=$((MA+1)); MI=0; PA=0 ;; - minor) MI=$((MI+1)); PA=0 ;; - patch) PA=$((PA+1)) ;; - esac - next="${MA}.${MI}.${PA}" - echo "next=$next" >> "$GITHUB_OUTPUT" - - - name: Apply version bump to files - run: | - jq --arg v "${{ steps.prep.outputs.next }}" '.version=$v' manifest.json > manifest.tmp && mv manifest.tmp manifest.json - if jq -e '.version' package.json >/dev/null 2>&1; then - jq --arg v "${{ steps.prep.outputs.next }}" '.version=$v' package.json > package.tmp && mv package.tmp package.json - fi - - - name: Commit & push back to PR branch - env: - BRANCH: ${{ github.head_ref }} - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add manifest.json package.json 2>/dev/null || true - git commit -m "chore: bump version to ${{ steps.prep.outputs.next }}" || exit 0 - git push origin HEAD:$BRANCH diff --git a/manifest.json b/manifest.json index ae00220..985b342 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "listr", - "version": "1.0.1", + "version": "1.0.2", "description": "Displays a popup with bookmarks and more.", "icons": { "16": "assets/icons/icon-16.png", @@ -12,8 +12,14 @@ "action": { "default_popup": "popup.html" }, - "permissions": ["tabs", "storage", "downloads"], - "host_permissions": [""], + "permissions": [ + "tabs", + "storage", + "downloads" + ], + "host_permissions": [ + "" + ], "content_scripts": [ { "matches": [ @@ -22,7 +28,9 @@ "https://*.youtube.com/*", "https://*.pinterest.com/*" ], - "js": ["dist/content.js"], + "js": [ + "dist/content.js" + ], "run_at": "document_end" } ] diff --git a/package.json b/package.json index 34be6d5..0f57552 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "listr", - "version": "1.0.0", + "version": "1.0.2", "description": "Get bookmarks and favorites from your favorite social media platforms.", "scripts": { "build": "webpack --mode production",