@krx3d/tizentube 1.15.38
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.
Potentially problematic release.
This version of @krx3d/tizentube might be problematic. Click here for more details.
- package/.gitattributes +2 -0
- package/.github/FUNDING.yml +1 -0
- package/.github/workflows/publish-on-release.yml +167 -0
- package/.github/workflows/unpublish.yml +93 -0
- package/LICENSE +674 -0
- package/README.md +24 -0
- package/dist/service.js +49869 -0
- package/dist/userScript.js +15 -0
- package/package.json +25 -0
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
github: [KrX3D]
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# -----------------------------------------------------------------------------
|
|
2
|
+
# Build and publish TizenTube to npm
|
|
3
|
+
#
|
|
4
|
+
# WHAT THIS WORKFLOW DOES
|
|
5
|
+
# -----------------------
|
|
6
|
+
# - Runs on every push to the `main` branch (build + verification)
|
|
7
|
+
# - Runs again when a GitHub Release is published (build + npm publish)
|
|
8
|
+
# - Builds:
|
|
9
|
+
# - dist/userScript.js (browser userscript, bundled & minified)
|
|
10
|
+
# - dist/service.js (DIAL service, bundled with Rollup)
|
|
11
|
+
# - Publishes the package to https://www.npmjs.com on release only
|
|
12
|
+
# - Purges jsDelivr CDN cache after publishing
|
|
13
|
+
#
|
|
14
|
+
# WHEN IT RUNS
|
|
15
|
+
# ------------
|
|
16
|
+
# push to main:
|
|
17
|
+
# - Builds the project
|
|
18
|
+
# - Does NOT publish to npm
|
|
19
|
+
#
|
|
20
|
+
# release (published):
|
|
21
|
+
# - Builds the project
|
|
22
|
+
# - Publishes to npm
|
|
23
|
+
# - Purges jsDelivr cache
|
|
24
|
+
#
|
|
25
|
+
# PREREQUISITES (REQUIRED)
|
|
26
|
+
# -----------------------
|
|
27
|
+
# 1) Create an npm account:
|
|
28
|
+
# https://www.npmjs.com/signup
|
|
29
|
+
#
|
|
30
|
+
# 2) Create an npm access token:
|
|
31
|
+
# - npm → Profile → Access Tokens
|
|
32
|
+
# - Click "Generate New Token"
|
|
33
|
+
# - Token name: anything you want
|
|
34
|
+
# - CHECK: "Bypass two-factor authentication (2FA)"
|
|
35
|
+
# - Packages and scopes:
|
|
36
|
+
# - Permissions: Read and Write
|
|
37
|
+
# - Scope: All packages
|
|
38
|
+
# - Expiration date: e.g. 90 days
|
|
39
|
+
# - Click "Generate token" and COPY it
|
|
40
|
+
#
|
|
41
|
+
# 3) Add the token to GitHub Secrets:
|
|
42
|
+
# - GitHub repository → Settings
|
|
43
|
+
# - Security → Secrets and variables → Actions
|
|
44
|
+
# - Repository secrets → New repository secret
|
|
45
|
+
# Name: NPM_TOKEN
|
|
46
|
+
# Secret: <paste npm token here>
|
|
47
|
+
#
|
|
48
|
+
# PACKAGE REQUIREMENTS
|
|
49
|
+
# --------------------
|
|
50
|
+
# - package.json must contain a unique name, e.g.:
|
|
51
|
+
# "@krx3d/tizentube"
|
|
52
|
+
# - The version MUST be increased before each release
|
|
53
|
+
# (npm will reject duplicate versions)
|
|
54
|
+
#
|
|
55
|
+
# HOW TO PUBLISH A NEW VERSION
|
|
56
|
+
# ----------------------------
|
|
57
|
+
# 1) Bump "version" in package.json
|
|
58
|
+
# 2) Commit and push to `main`
|
|
59
|
+
# 3) Create a GitHub Release
|
|
60
|
+
# 4) When the release is published:
|
|
61
|
+
# → GitHub Actions builds
|
|
62
|
+
# → npm publish runs automatically
|
|
63
|
+
# → jsDelivr cache is purged
|
|
64
|
+
#
|
|
65
|
+
# -----------------------------------------------------------------------------
|
|
66
|
+
|
|
67
|
+
name: Build and publish on release
|
|
68
|
+
|
|
69
|
+
on:
|
|
70
|
+
push:
|
|
71
|
+
branches:
|
|
72
|
+
- main
|
|
73
|
+
paths-ignore:
|
|
74
|
+
- '.github/**' # ignore any changes inside .github (workflow edits won't trigger this workflow)
|
|
75
|
+
#- 'docs/**'
|
|
76
|
+
#- 'README.md'
|
|
77
|
+
release:
|
|
78
|
+
types: [published]
|
|
79
|
+
|
|
80
|
+
jobs:
|
|
81
|
+
build-and-publish:
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
|
|
84
|
+
steps:
|
|
85
|
+
- name: Checkout repository
|
|
86
|
+
uses: actions/checkout@v4
|
|
87
|
+
|
|
88
|
+
- name: Setup Node.js
|
|
89
|
+
uses: actions/setup-node@v4
|
|
90
|
+
with:
|
|
91
|
+
node-version: 20
|
|
92
|
+
registry-url: https://registry.npmjs.org/
|
|
93
|
+
|
|
94
|
+
# ----------------------------
|
|
95
|
+
# Build mods (userScript.js)
|
|
96
|
+
# ----------------------------
|
|
97
|
+
- name: Install mods dependencies
|
|
98
|
+
run: |
|
|
99
|
+
set -euo pipefail
|
|
100
|
+
cd mods
|
|
101
|
+
npm ci
|
|
102
|
+
|
|
103
|
+
- name: Build mods (rollup)
|
|
104
|
+
run: |
|
|
105
|
+
set -euo pipefail
|
|
106
|
+
cd mods
|
|
107
|
+
npx rollup -c
|
|
108
|
+
|
|
109
|
+
# ----------------------------
|
|
110
|
+
# Build service (service.js)
|
|
111
|
+
# ----------------------------
|
|
112
|
+
- name: Install service dependencies
|
|
113
|
+
run: |
|
|
114
|
+
set -euo pipefail
|
|
115
|
+
cd service
|
|
116
|
+
npm ci
|
|
117
|
+
|
|
118
|
+
- name: Build service (rollup)
|
|
119
|
+
run: |
|
|
120
|
+
set -euo pipefail
|
|
121
|
+
cd service
|
|
122
|
+
npx rollup -c
|
|
123
|
+
|
|
124
|
+
# ----------------------------
|
|
125
|
+
# Verify output
|
|
126
|
+
# ----------------------------
|
|
127
|
+
- name: Verify dist output
|
|
128
|
+
run: |
|
|
129
|
+
set -euo pipefail
|
|
130
|
+
ls -lh dist
|
|
131
|
+
test -f dist/userScript.js
|
|
132
|
+
test -f dist/service.js
|
|
133
|
+
|
|
134
|
+
# ----------------------------
|
|
135
|
+
# Publish to npm (release only)
|
|
136
|
+
# ----------------------------
|
|
137
|
+
- name: Publish package
|
|
138
|
+
#if: github.event_name == 'release'
|
|
139
|
+
run: npm publish --access public
|
|
140
|
+
env:
|
|
141
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
142
|
+
|
|
143
|
+
# ----------------------------
|
|
144
|
+
# Purge jsDelivr cache (release only)
|
|
145
|
+
# ----------------------------
|
|
146
|
+
- name: Wait for npm propagation
|
|
147
|
+
#if: github.event_name == 'release'
|
|
148
|
+
run: sleep 10
|
|
149
|
+
|
|
150
|
+
- name: Purge jsDelivr cache
|
|
151
|
+
#if: github.event_name == 'release'
|
|
152
|
+
run: |
|
|
153
|
+
echo "Purging jsDelivr cache for @krx3d/tizentube..."
|
|
154
|
+
|
|
155
|
+
# Purge latest tag
|
|
156
|
+
curl -i "https://purge.jsdelivr.net/npm/@krx3d/tizentube@latest/package.json" || true
|
|
157
|
+
|
|
158
|
+
# Purge all versions
|
|
159
|
+
curl -i "https://purge.jsdelivr.net/npm/@krx3d/tizentube@*/package.json" || true
|
|
160
|
+
|
|
161
|
+
# Purge default (no version)
|
|
162
|
+
curl -i "https://purge.jsdelivr.net/npm/@krx3d/tizentube/package.json" || true
|
|
163
|
+
|
|
164
|
+
# Purge entire package (all files)
|
|
165
|
+
curl -i "https://purge.jsdelivr.net/npm/@krx3d/tizentube@*" || true
|
|
166
|
+
|
|
167
|
+
echo "✅ jsDelivr cache purge requests sent"
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: Unpublish package from npm (manual)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version:
|
|
7
|
+
description: 'Version to unpublish (e.g. 1.15.19). REQUIRED.'
|
|
8
|
+
required: true
|
|
9
|
+
default: ''
|
|
10
|
+
force:
|
|
11
|
+
description: 'Set to "true" to force-unpublish the entire package (--force). Optional.'
|
|
12
|
+
required: false
|
|
13
|
+
default: 'false'
|
|
14
|
+
|
|
15
|
+
env:
|
|
16
|
+
# Keep the package name fixed here
|
|
17
|
+
PACKAGE_NAME: '@krx3d/tizentube' # <-- edit if needed
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
unpublish:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout (optional)
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Resolve inputs
|
|
27
|
+
id: resolve
|
|
28
|
+
run: |
|
|
29
|
+
set -euo pipefail
|
|
30
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
31
|
+
FORCE_INPUT="${{ github.event.inputs.force }}"
|
|
32
|
+
|
|
33
|
+
if [ -z "$VERSION" ]; then
|
|
34
|
+
echo "::error::'version' input is required."
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
case "${FORCE_INPUT,,}" in
|
|
39
|
+
"true"|"1"|"yes" ) FORCE="true" ;;
|
|
40
|
+
* ) FORCE="false" ;;
|
|
41
|
+
esac
|
|
42
|
+
|
|
43
|
+
echo "package=${PACKAGE_NAME}" >> "$GITHUB_OUTPUT"
|
|
44
|
+
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
|
45
|
+
echo "force=${FORCE}" >> "$GITHUB_OUTPUT"
|
|
46
|
+
|
|
47
|
+
- name: Configure npm auth (write ~/.npmrc)
|
|
48
|
+
env:
|
|
49
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
50
|
+
run: |
|
|
51
|
+
set -euo pipefail
|
|
52
|
+
if [ -z "$NPM_TOKEN" ]; then
|
|
53
|
+
echo "::error::NPM_TOKEN secret is not set"
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
# Write a per-run ~/.npmrc so npm uses the token
|
|
57
|
+
printf "//registry.npmjs.org/:_authToken=%s\n" "$NPM_TOKEN" > ~/.npmrc
|
|
58
|
+
# Ensure always-auth so npm uses token for the registry
|
|
59
|
+
printf "always-auth=true\n" >> ~/.npmrc
|
|
60
|
+
echo "Wrote ~/.npmrc and set auth token."
|
|
61
|
+
|
|
62
|
+
- name: Verify version exists on npm (unless force)
|
|
63
|
+
if: steps.resolve.outputs.force != 'true'
|
|
64
|
+
env:
|
|
65
|
+
NPM_CONFIG_REGISTRY: 'https://registry.npmjs.org/'
|
|
66
|
+
run: |
|
|
67
|
+
set -euo pipefail
|
|
68
|
+
PKG="${{ steps.resolve.outputs.package }}"
|
|
69
|
+
VER="${{ steps.resolve.outputs.version }}"
|
|
70
|
+
echo "Checking npm for ${PKG}@${VER} ..."
|
|
71
|
+
# Show metadata for debugging
|
|
72
|
+
npm view "${PKG}@${VER}" --json || { echo "::error::Version not found on registry"; exit 1; }
|
|
73
|
+
echo "Version exists."
|
|
74
|
+
|
|
75
|
+
- name: Run unpublish
|
|
76
|
+
env:
|
|
77
|
+
NPM_CONFIG_REGISTRY: 'https://registry.npmjs.org/'
|
|
78
|
+
run: |
|
|
79
|
+
set -euo pipefail
|
|
80
|
+
PKG="${{ steps.resolve.outputs.package }}"
|
|
81
|
+
VER="${{ steps.resolve.outputs.version }}"
|
|
82
|
+
FORCE="${{ steps.resolve.outputs.force }}"
|
|
83
|
+
|
|
84
|
+
if [ "$FORCE" = "true" ]; then
|
|
85
|
+
echo "Running: npm unpublish ${PKG} --force"
|
|
86
|
+
npm unpublish "${PKG}" --force
|
|
87
|
+
else
|
|
88
|
+
echo "Running: npm unpublish ${PKG}@${VER}"
|
|
89
|
+
npm unpublish "${PKG}@${VER}"
|
|
90
|
+
fi
|
|
91
|
+
|
|
92
|
+
- name: Done
|
|
93
|
+
run: echo "Unpublish finished."
|