diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 62d637c..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Release - -on: - push: - tags: ['v*'] - -permissions: - contents: read - -concurrency: - group: release-${{ github.ref }} - cancel-in-progress: false - -jobs: - release: - name: Publish widget and GitHub release - runs-on: ubuntu-24.04 - timeout-minutes: 15 - permissions: - contents: write - id-token: write - defaults: - run: - working-directory: widget - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 - with: - node-version: 26 - cache: npm - cache-dependency-path: widget/package-lock.json - registry-url: https://registry.npmjs.org - - - name: Check tag matches package version - run: test "v$(node -p "require('./package.json').version")" = "${GITHUB_REF_NAME}" - - - run: npm ci - - run: npm run check - - # Trusted publishing (OIDC, no token) once the package is linked to this - # workflow on npmjs.com. Only the very first publish needs the NPM_TOKEN - # secret, because a trusted publisher can only be added to an existing - # package. Remove the secret afterwards. Published versions are skipped. - - name: Publish to npm - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - name="$(node -p "require('./package.json').name")" - version="$(node -p "require('./package.json').version")" - if npm view "${name}@${version}" version >/dev/null 2>&1; then - echo "${name}@${version} is already published, skipping." - else - npm publish --access public --provenance - fi - - - name: GitHub release with changelog and SRI hash - env: - GH_TOKEN: ${{ github.token }} - TAG: ${{ github.ref_name }} - run: | - version="${TAG#v}" - notes="$(awk -v v="$version" '$0 ~ "^## \\[" v "\\]" {f=1; next} /^## \[/ {f=0} f' ../CHANGELOG.md)" - sri="$(node -p "require('./dist/sri.json')['feedback.iife.js']")" - fence="$(printf '\140\140\140')" - { - printf '%s\n\n### Script-Tag\n\n%shtml\n' "$notes" "$fence" - printf '\n%s\n' "$sri" "$fence" - } > notes.md - gh release create "$TAG" dist/feedback.iife.js dist/feedback.js dist/sri.json --title "$TAG" --notes-file notes.md diff --git a/.github/workflows/widget.yml b/.github/workflows/widget.yml index 8ea3e9c..176ae94 100644 --- a/.github/workflows/widget.yml +++ b/.github/workflows/widget.yml @@ -41,5 +41,3 @@ jobs: - run: npm run test:coverage - run: npm run build - run: npm run size - - run: npm run publint - - run: npm run attw diff --git a/.gitignore b/.gitignore index ab6dca1..e7338bb 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ Thumbs.db /e2e/test-results /e2e/playwright-report /public/widget +/resources/widget diff --git a/CHANGELOG.md b/CHANGELOG.md index 265b78d..9ac2819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,11 +13,14 @@ All notable changes to the API and the widget are documented here. The format fo ### Changed +- The widget is no longer published to npm: the API serves it at `/widget/v1/feedback.js` (one script tag, no npm, no CDN, updated with every deploy). `npm run build` compiles it into `resources/widget/v1`. The npm package `@codebar-ag/feedback-widget` 1.0.0 stays available but gets no updates. Removed: release workflow, type definitions, SRI file, publint and attw. - The widget only appears on pages the API accepts: it checks the project config first and stays hidden on a `403` (origin or IP not allowed). Refused `GET` requests now carry `Access-Control-Allow-Origin` so the widget can read the `403`; the preflight for sending stays refused. - Dev dependencies: vite 8.3.5, typescript-eslint 8.72.0. ### Fixed +- `