@krx3d/tizentubekrx 1.15.15 → 1.15.17
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.
- package/.github/workflows/publish-on-release.yml +78 -131
- package/dist/userScript.js +13 -43777
- package/package.json +1 -1
- package/tmp/bundle.userScript.css +0 -1
- package/tmp/bundle.userScript.js +0 -27
- package/tmp/core-js-bundle.min.js +0 -15
- package/tmp/intl-displaynames.locale-data.en.js +0 -2301
- package/tmp/intl-displaynames.polyfill.iife.js +0 -8031
- package/tmp/intl-getcanonicallocales.polyfill.iife.js +0 -9461
- package/tmp/intl-locale.polyfill.iife.js +0 -23289
- package/tmp/polyfills.js +0 -43753
- package/tmp/userScript.entry.js +0 -18
- package/tmp/userScript.entry.step1.js +0 -18
- package/tmp/whatwg-fetch.umd.js +0 -657
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
name: Build & Publish
|
|
1
|
+
name: Build & Publish (mods + service)
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
7
|
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
packages: write
|
|
11
|
+
|
|
8
12
|
jobs:
|
|
9
13
|
build-and-publish:
|
|
10
14
|
runs-on: ubuntu-latest
|
|
11
|
-
env:
|
|
12
|
-
NODE_OPTIONS: --max_old_space_size=4096
|
|
13
15
|
|
|
14
16
|
steps:
|
|
15
17
|
- name: Checkout repository
|
|
@@ -21,176 +23,121 @@ jobs:
|
|
|
21
23
|
node-version: 20
|
|
22
24
|
registry-url: 'https://registry.npmjs.org/'
|
|
23
25
|
|
|
24
|
-
- name: Show
|
|
26
|
+
- name: Show repository structure
|
|
25
27
|
run: |
|
|
26
|
-
echo "===
|
|
28
|
+
echo "=== ROOT ==="
|
|
27
29
|
ls -la
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
echo "=== mods ==="
|
|
31
|
+
[ -d mods ] && ls -la mods || echo "mods/ not present"
|
|
32
|
+
echo "=== service ==="
|
|
33
|
+
[ -d service ] && ls -la service || echo "service/ not present"
|
|
34
|
+
|
|
35
|
+
# -----------------------------
|
|
36
|
+
# Build MODS (Rollup – upstream)
|
|
37
|
+
# -----------------------------
|
|
38
|
+
- name: Install mods dependencies
|
|
30
39
|
run: |
|
|
31
40
|
set -euo pipefail
|
|
32
41
|
if [ -f mods/package.json ]; then
|
|
33
|
-
echo "Installing mods
|
|
34
|
-
# Prefer npm ci in mods (fast, reproducible). Falls back to npm install if no lockfile.
|
|
42
|
+
echo "Installing mods dependencies"
|
|
35
43
|
if [ -f mods/package-lock.json ]; then
|
|
36
44
|
npm ci --prefix mods
|
|
37
45
|
else
|
|
38
46
|
npm install --prefix mods
|
|
39
47
|
fi
|
|
40
|
-
echo "mods/node_modules installed"
|
|
41
|
-
ls -la mods/node_modules | sed -n '1,200p' || true
|
|
42
48
|
else
|
|
43
|
-
echo "No mods/package.json
|
|
49
|
+
echo "No mods/package.json, skipping mods install"
|
|
44
50
|
fi
|
|
45
51
|
|
|
46
|
-
- name:
|
|
52
|
+
- name: Build mods (rollup)
|
|
47
53
|
run: |
|
|
48
54
|
set -euo pipefail
|
|
49
|
-
if [ -f
|
|
50
|
-
echo "
|
|
51
|
-
|
|
52
|
-
npm ci --prefix service
|
|
53
|
-
else
|
|
54
|
-
npm install --prefix service
|
|
55
|
-
fi
|
|
56
|
-
echo "service/node_modules installed"
|
|
57
|
-
ls -la service/node_modules | sed -n '1,200p' || true
|
|
55
|
+
if [ -f mods/package.json ]; then
|
|
56
|
+
echo "Running mods build"
|
|
57
|
+
npm run build --prefix mods
|
|
58
58
|
else
|
|
59
|
-
echo "
|
|
59
|
+
echo "Skipping mods build"
|
|
60
60
|
fi
|
|
61
61
|
|
|
62
|
-
- name:
|
|
62
|
+
- name: Verify dist/userScript.js
|
|
63
63
|
run: |
|
|
64
64
|
set -euo pipefail
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- name: Dump mods/ file list and show userScript head (debug)
|
|
69
|
-
run: |
|
|
70
|
-
echo "=== mods/ files ==="
|
|
71
|
-
ls -la mods || true
|
|
72
|
-
echo "=== first lines of mods/userScript.js ==="
|
|
73
|
-
if [ -f mods/userScript.js ]; then
|
|
74
|
-
sed -n '1,120p' mods/userScript.js || true
|
|
75
|
-
else
|
|
76
|
-
echo "mods/userScript.js missing"
|
|
65
|
+
if [ ! -f dist/userScript.js ]; then
|
|
66
|
+
echo "::error::dist/userScript.js not generated"
|
|
77
67
|
exit 1
|
|
78
68
|
fi
|
|
69
|
+
echo "dist/userScript.js:"
|
|
70
|
+
ls -lh dist/userScript.js
|
|
79
71
|
|
|
80
|
-
|
|
72
|
+
# -----------------------------
|
|
73
|
+
# Build SERVICE (ncc bundle)
|
|
74
|
+
# -----------------------------
|
|
75
|
+
- name: Install service dependencies
|
|
81
76
|
run: |
|
|
82
77
|
set -euo pipefail
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
curl -fsSL https://unpkg.com/@formatjs/intl-getcanonicallocales@latest/polyfill.iife.js -o tmp/intl-getcanonicallocales.polyfill.iife.js || true
|
|
91
|
-
curl -fsSL https://unpkg.com/@formatjs/intl-locale@latest/polyfill.iife.js -o tmp/intl-locale.polyfill.iife.js || true
|
|
92
|
-
curl -fsSL https://unpkg.com/@formatjs/intl-displaynames@latest/polyfill.iife.js -o tmp/intl-displaynames.polyfill.iife.js || true
|
|
93
|
-
curl -fsSL https://unpkg.com/@formatjs/intl-displaynames@latest/locale-data/en.js -o tmp/intl-displaynames.locale-data.en.js || true
|
|
94
|
-
|
|
95
|
-
# Concatenate what we downloaded (safe even if parts are missing)
|
|
96
|
-
cat tmp/whatwg-fetch.umd.js tmp/core-js-bundle.min.js tmp/intl-getcanonicallocales.polyfill.iife.js tmp/intl-locale.polyfill.iife.js tmp/intl-displaynames.polyfill.iife.js tmp/intl-displaynames.locale-data.en.js > tmp/polyfills.js || true
|
|
97
|
-
echo "Polyfills length bytes:"
|
|
98
|
-
wc -c tmp/polyfills.js || true
|
|
99
|
-
|
|
100
|
-
# Create temporary entry:
|
|
101
|
-
# 1) remove imports that reference the polyfills we fetched above (case-insensitive)
|
|
102
|
-
# 2) rewrite relative imports "./..." to "../mods/..." so esbuild resolves modules from mods/
|
|
103
|
-
sed -E '/import .*whatwg-fetch|import .*core-js|import .*@formatjs\/intl-getcanonicallocales|import .*@formatjs\/intl-locale|import .*@formatjs\/intl-displaynames|@formatjs\/intl-displaynames\/locale-data/Id' mods/userScript.js > tmp/userScript.entry.step1.js
|
|
104
|
-
|
|
105
|
-
# Convert import "./path/..." to import "../mods/path/..." to keep original import graph but resolvable from tmp/
|
|
106
|
-
sed -E "s|import[[:space:]]+\"\\./([^\"]+)\"|import \"../mods/\\1\"|g; s|import[[:space:]]+'\\./([^']+)'|import '../mods/\\1'|g" tmp/userScript.entry.step1.js > tmp/userScript.entry.js
|
|
107
|
-
|
|
108
|
-
echo "tmp/userScript.entry.js head:"
|
|
109
|
-
sed -n '1,120p' tmp/userScript.entry.js || true
|
|
110
|
-
|
|
111
|
-
- name: Bundle userScript (esbuild) and produce dist/userScript.js
|
|
112
|
-
run: |
|
|
113
|
-
set -euo pipefail
|
|
114
|
-
mkdir -p tmp dist
|
|
115
|
-
# bundle using esbuild
|
|
116
|
-
npx esbuild tmp/userScript.entry.js \
|
|
117
|
-
--bundle \
|
|
118
|
-
--platform=browser \
|
|
119
|
-
--format=iife \
|
|
120
|
-
--minify \
|
|
121
|
-
--outfile=tmp/bundle.userScript.js \
|
|
122
|
-
--banner:js="(function(){if(window.__TIZENTUBE_INJECT_LOADED)return;window.__TIZENTUBE_INJECT_LOADED=true;" \
|
|
123
|
-
--footer:js="})();"
|
|
124
|
-
|
|
125
|
-
# prepend polyfills if present
|
|
126
|
-
if [ -s tmp/polyfills.js ]; then
|
|
127
|
-
cat tmp/polyfills.js tmp/bundle.userScript.js > dist/userScript.js
|
|
78
|
+
if [ -f service/package.json ]; then
|
|
79
|
+
echo "Installing service dependencies"
|
|
80
|
+
if [ -f service/package-lock.json ]; then
|
|
81
|
+
npm ci --prefix service
|
|
82
|
+
else
|
|
83
|
+
npm install --prefix service
|
|
84
|
+
fi
|
|
128
85
|
else
|
|
129
|
-
|
|
86
|
+
echo "No service/package.json, skipping service install"
|
|
130
87
|
fi
|
|
131
88
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
head -n 8 dist/userScript.js || true
|
|
135
|
-
|
|
136
|
-
- name: Auto-detect service entry and bundle with ncc
|
|
137
|
-
id: detect_service
|
|
89
|
+
- name: Detect service entry
|
|
90
|
+
id: service_entry
|
|
138
91
|
run: |
|
|
139
92
|
set -euo pipefail
|
|
140
|
-
|
|
93
|
+
|
|
141
94
|
ENTRY=""
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
95
|
+
|
|
96
|
+
if [ -f service/package.json ]; then
|
|
97
|
+
MAIN=$(node -e "console.log(require('./service/package.json').main || '')")
|
|
98
|
+
if [ -n "$MAIN" ]; then
|
|
99
|
+
if [[ "$MAIN" == */* ]]; then
|
|
100
|
+
ENTRY="$MAIN"
|
|
101
|
+
else
|
|
102
|
+
ENTRY="service/$MAIN"
|
|
147
103
|
fi
|
|
148
|
-
done
|
|
149
|
-
if [ -z "$ENTRY" ]; then
|
|
150
|
-
# fallback: first .js file found in service/
|
|
151
|
-
ENTRY=$(find service -maxdepth 1 -type f -name '*.js' | head -n1 || true)
|
|
152
104
|
fi
|
|
153
105
|
fi
|
|
106
|
+
|
|
154
107
|
if [ -z "$ENTRY" ]; then
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
108
|
+
for f in service.js index.js app.js server.js; do
|
|
109
|
+
if [ -f "service/$f" ]; then
|
|
110
|
+
ENTRY="service/$f"
|
|
111
|
+
break
|
|
112
|
+
fi
|
|
113
|
+
done
|
|
158
114
|
fi
|
|
159
|
-
echo "Detected service entry: $ENTRY"
|
|
160
|
-
echo "::set-output name=service_entry::$ENTRY"
|
|
161
115
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
echo "No service entry
|
|
168
|
-
exit 0
|
|
116
|
+
if [ -n "$ENTRY" ]; then
|
|
117
|
+
echo "entry=$ENTRY" >> "$GITHUB_OUTPUT"
|
|
118
|
+
echo "Service entry: $ENTRY"
|
|
119
|
+
else
|
|
120
|
+
echo "entry=" >> "$GITHUB_OUTPUT"
|
|
121
|
+
echo "No service entry found"
|
|
169
122
|
fi
|
|
170
|
-
echo "Bundling service from $SERVICE_ENTRY"
|
|
171
|
-
npx @vercel/ncc build "$SERVICE_ENTRY" -o dist_tmp
|
|
172
|
-
mv dist_tmp/index.js dist/service.js
|
|
173
|
-
rm -rf dist_tmp
|
|
174
|
-
echo "Built dist/service.js (size):"
|
|
175
|
-
ls -lh dist/service.js || true
|
|
176
|
-
head -n 8 dist/service.js || true
|
|
177
123
|
|
|
178
|
-
- name:
|
|
124
|
+
- name: Bundle service with ncc
|
|
125
|
+
if: steps.service_entry.outputs.entry != ''
|
|
179
126
|
run: |
|
|
180
127
|
set -euo pipefail
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
echo "✅ dist ready"
|
|
188
|
-
|
|
189
|
-
- name: Show dist contents
|
|
190
|
-
run: ls -la dist || true
|
|
128
|
+
mkdir -p dist
|
|
129
|
+
npx @vercel/ncc build "${{ steps.service_entry.outputs.entry }}" -o dist_tmp
|
|
130
|
+
mv dist_tmp/index.js dist/service.js
|
|
131
|
+
rm -rf dist_tmp
|
|
132
|
+
echo "dist/service.js:"
|
|
133
|
+
ls -lh dist/service.js
|
|
191
134
|
|
|
135
|
+
# -----------------------------
|
|
136
|
+
# Publish to npm
|
|
137
|
+
# -----------------------------
|
|
192
138
|
- name: Publish to npm
|
|
193
|
-
if: github.ref == 'refs/heads/main'
|
|
194
|
-
run: npm publish --access public
|
|
195
139
|
env:
|
|
196
140
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
141
|
+
run: |
|
|
142
|
+
set -euo pipefail
|
|
143
|
+
npm publish --access public
|