@krx3d/tizentube2 1.30.40 → 1.30.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,8 +45,9 @@
45
45
  # - Nothing touches the registry until GET /<pkg>/<version> succeeds
46
46
  # - Versions that already carry a deprecation message are skipped entirely
47
47
  # - The current version and every dist-tag target are never touched
48
- # - Unpublishing is off (ALLOW_UNPUBLISH); npm rejects it from a granular token
49
- # that bypasses 2FA, and each rejected attempt was still a document rewrite
48
+ # - Removal is attempted every run; npm rejects it from a granular token that
49
+ # bypasses 2FA, so those versions are deprecated instead and a local script
50
+ # (scripts/npm-cleanup) does the real removal with a 2FA code
50
51
  # - The job fails if `latest` does not end up pointing at what it published
51
52
  #
52
53
  # VERSION BUMP RULE (push to main only)
@@ -154,11 +155,13 @@ env:
154
155
  PACKAGE_NAME_GH: 'KrX3D/TizenTube'
155
156
  NODE_VERSION: '24'
156
157
  UNPUBLISH_WINDOW_HOURS: '72'
157
- # npm refuses `npm unpublish` from a granular access token that bypasses
158
- # two-factor authentication, so every attempt was a 403 and every 403 was
159
- # still a full rewrite of the package document, which is how a freshly
160
- # published version gets erased. Left off until the token can do it.
161
- ALLOW_UNPUBLISH: 'false'
158
+ # Removal is still attempted on every run. npm currently refuses it from a
159
+ # granular access token with bypass-2FA (its only token type since November
160
+ # 2025), so the attempts 403 and the versions are deprecated instead but a
161
+ # refused request writes nothing, and if npm allows this again for
162
+ # automation, removal resumes on the next run with no change here.
163
+ # Set to 'false' only to stop attempting it altogether.
164
+ ALLOW_UNPUBLISH: 'true'
162
165
 
163
166
  jobs:
164
167
  build-publish-clean:
@@ -573,6 +576,28 @@ jobs:
573
576
  # --------------------
574
577
  # UNPUBLISH
575
578
  # --------------------
579
+ # Unpublishing is the only thing that actually removes a version;
580
+ # deprecating just labels it. So this still tries, every run, for every
581
+ # version inside npm's 72-hour window.
582
+ #
583
+ # It cannot currently succeed. npm removed legacy tokens in November 2025,
584
+ # leaving granular access tokens as the only kind, and since August 2026 a
585
+ # granular token with "bypass 2FA" is refused for sensitive actions, with
586
+ # unpublish among them — the 403 says so in as many words. Deprecating
587
+ # still works with the same token.
588
+ #
589
+ # Attempting anyway is deliberate and costs nothing. A refused PUT writes
590
+ # nothing, so those 403s never touched the package document; the version
591
+ # that got erased was erased by a deprecate that SUCCEEDED. And if npm
592
+ # restores this for automation, removal resumes with no change here.
593
+ #
594
+ # What is not repeated is the noise. The 2FA refusal is reported once and
595
+ # the remaining versions go straight to the deprecate fallback, instead of
596
+ # making the same doomed request nineteen more times.
597
+ #
598
+ # To actually remove versions today, run
599
+ # scripts/npm-cleanup/unpublish-old-versions.ps1 locally; it prompts for a
600
+ # 2FA code, which is the only path npm still allows.
576
601
  - name: Unpublish old versions (verified) and fallback to deprecate
577
602
  if: steps.confirm_publish.outputs.confirmed == 'true'
578
603
  env:
@@ -599,6 +624,29 @@ jobs:
599
624
  return 1
600
625
  }
601
626
 
627
+ # Deprecating something that is already deprecated is rejected as 422,
628
+ # and gets there by rewriting the whole package document — the write
629
+ # that erased 1.30.30. So the fallback checks first.
630
+ already_deprecated(){
631
+ node -e '
632
+ const fs = require("fs");
633
+ let list = [];
634
+ try { list = JSON.parse(fs.readFileSync("/tmp/deprecated.json","utf8")); } catch (e) { }
635
+ process.exit(list.indexOf(process.argv[1]) === -1 ? 1 : 0);
636
+ ' "$1"
637
+ }
638
+
639
+ deprecate_fallback(){
640
+ ver="$1"
641
+ if already_deprecated "$ver"; then
642
+ echo "${PKG}@${ver} is already deprecated; leaving it alone."
643
+ return 0
644
+ fi
645
+ npm deprecate "${PKG}@${ver}" "Deprecated — please upgrade to a newer release." 2>&1 | tee /tmp/npm_deprecate_${ver}.log || echo "::warning::deprecate failed for ${ver}"
646
+ }
647
+
648
+ UNPUBLISH_BLOCKED=0
649
+
602
650
  if [ ! -s /tmp/to_unpublish.txt ]; then
603
651
  echo "No versions to unpublish."
604
652
  else
@@ -606,6 +654,11 @@ jobs:
606
654
  ver="$(echo "$ver" | tr -d '\r' | xargs)"
607
655
  [ -z "$ver" ] && continue
608
656
 
657
+ if [ "$UNPUBLISH_BLOCKED" = "1" ]; then
658
+ deprecate_fallback "$ver"
659
+ continue
660
+ fi
661
+
609
662
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
610
663
  echo "Attempting unpublish: ${PKG}@${ver}"
611
664
  echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@@ -616,12 +669,17 @@ jobs:
616
669
  echo "Verified ${PKG}@${ver} removed."
617
670
  else
618
671
  echo "::warning::Still visible after unpublish attempts -> deprecate fallback"
619
- npm deprecate "${PKG}@${ver}" "Deprecated — please upgrade to a newer release." 2>&1 | tee /tmp/npm_deprecate_${ver}.log || echo "::warning::deprecate failed for ${ver}"
672
+ deprecate_fallback "$ver"
620
673
  fi
621
674
  else
622
- echo "::warning::npm unpublish failed or returned non-zero for ${PKG}@${ver}"
623
- echo "Attempting to deprecate as fallback..."
624
- npm deprecate "${PKG}@${ver}" "Deprecated please upgrade to a newer release." 2>&1 | tee /tmp/npm_deprecate_${ver}.log || echo "::warning::deprecate failed for ${ver}"
675
+ if grep -q "bypass two-factor authentication" "/tmp/npm_unpublish_${ver}.log"; then
676
+ UNPUBLISH_BLOCKED=1
677
+ echo "::warning::npm refuses unpublish from this token: a granular access token with bypass-2FA may not perform it (npm policy, August 2026). The remaining versions would fail identically, so they are deprecated instead. To remove versions, run scripts/npm-cleanup/unpublish-old-versions.ps1 locally."
678
+ else
679
+ echo "::warning::npm unpublish failed or returned non-zero for ${PKG}@${ver}"
680
+ fi
681
+ echo "Deprecating instead..."
682
+ deprecate_fallback "$ver"
625
683
  fi
626
684
 
627
685
  done < /tmp/to_unpublish.txt
package/AGENTS.md CHANGED
@@ -102,6 +102,9 @@ standalone/ # standalone installable app — see "Standalone mo
102
102
 
103
103
  scripts/tampermonkey/ # local Chrome-based dev/test loader — see README.md
104
104
  scripts/log-receiver/ # PC-side PS1 receiver for logServer.js's remote logging (see Feature map)
105
+ scripts/npm-cleanup/ # local `npm unpublish` of old versions, with a 2FA code — the publish
106
+ # workflow attempts removal too, but npm refuses it from any token it
107
+ # still issues, so this is the only path that works
105
108
  scripts/pc-installer/ # PC-side install/update script (SDB from the PC, no on-device installer app
106
109
  # needed) — workaround for the Host PC IP 127.0.0.1 conflict with standalone's
107
110
  # proxy path; in progress, see AGENTS.md "Known unresolved issues"