@krx3d/tizentubekrx 1.15.7 → 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.
@@ -1,30 +1,143 @@
1
- name: Publish to NPM
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
- publish:
13
+ build-and-publish:
10
14
  runs-on: ubuntu-latest
15
+
11
16
  steps:
12
- - uses: actions/checkout@v3
17
+ - name: Checkout repository
18
+ uses: actions/checkout@v4
13
19
 
14
- - name: Use Node.js
15
- uses: actions/setup-node@v3
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
16
22
  with:
17
- node-version: '20'
23
+ node-version: 20
18
24
  registry-url: 'https://registry.npmjs.org/'
19
- scope: '@krx3d'
20
25
 
21
- - name: Install dependencies
22
- run: npm install
26
+ - name: Show repository structure
27
+ run: |
28
+ echo "=== ROOT ==="
29
+ ls -la
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
39
+ run: |
40
+ set -euo pipefail
41
+ if [ -f mods/package.json ]; then
42
+ echo "Installing mods dependencies"
43
+ if [ -f mods/package-lock.json ]; then
44
+ npm ci --prefix mods
45
+ else
46
+ npm install --prefix mods
47
+ fi
48
+ else
49
+ echo "No mods/package.json, skipping mods install"
50
+ fi
51
+
52
+ - name: Build mods (rollup)
53
+ run: |
54
+ set -euo pipefail
55
+ if [ -f mods/package.json ]; then
56
+ echo "Running mods build"
57
+ npm run build --prefix mods
58
+ else
59
+ echo "Skipping mods build"
60
+ fi
61
+
62
+ - name: Verify dist/userScript.js
63
+ run: |
64
+ set -euo pipefail
65
+ if [ ! -f dist/userScript.js ]; then
66
+ echo "::error::dist/userScript.js not generated"
67
+ exit 1
68
+ fi
69
+ echo "dist/userScript.js:"
70
+ ls -lh dist/userScript.js
71
+
72
+ # -----------------------------
73
+ # Build SERVICE (ncc bundle)
74
+ # -----------------------------
75
+ - name: Install service dependencies
76
+ run: |
77
+ set -euo pipefail
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
85
+ else
86
+ echo "No service/package.json, skipping service install"
87
+ fi
88
+
89
+ - name: Detect service entry
90
+ id: service_entry
91
+ run: |
92
+ set -euo pipefail
93
+
94
+ ENTRY=""
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"
103
+ fi
104
+ fi
105
+ fi
106
+
107
+ if [ -z "$ENTRY" ]; then
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
114
+ fi
115
+
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"
122
+ fi
23
123
 
24
- - name: Build dist folder
25
- run: npm run build
124
+ - name: Bundle service with ncc
125
+ if: steps.service_entry.outputs.entry != ''
126
+ run: |
127
+ set -euo pipefail
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
26
134
 
27
- - name: Publish package
28
- run: npm publish --access public
135
+ # -----------------------------
136
+ # Publish to npm
137
+ # -----------------------------
138
+ - name: Publish to npm
29
139
  env:
30
140
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
141
+ run: |
142
+ set -euo pipefail
143
+ npm publish --access public
package/dist/service.js CHANGED
@@ -1,50 +1,10 @@
1
- import resolve from '@rollup/plugin-node-resolve';
2
- import commonjs from '@rollup/plugin-commonjs';
3
- import babel from '@rollup/plugin-babel';
4
- import replace from '@rollup/plugin-replace';
5
- import json from '@rollup/plugin-json';
6
- import fs from 'fs';
7
-
8
- // Custom Rollup plugin to inject XML content
9
- function injectXmlContent() {
10
- return {
11
- name: 'inject-xml-content',
12
- renderChunk(code) {
13
-
14
- const pattern = /var\s+(\w+)_TEMPLATE\s+=\s+fs\$3\.readFileSync\(__dirname\s+\+\s+'\/\.\.\/xml\/([^']+)'\s*,\s*'utf8'\);/g;
15
-
16
- const modifiedCode = code.replace(pattern, (match, varName, fileName) => {
17
- const xmlContent = fs.readFileSync(`node_modules/@patrickkfkan/peer-dial/xml/${fileName}`, 'utf8');
18
- return `var ${varName}_TEMPLATE = ${JSON.stringify(xmlContent)};`;
19
- });
20
-
21
- return { code: modifiedCode, map: null };
22
- }
23
- };
24
- }
25
-
26
- export default {
27
- input: 'service.js',
28
- output: {
29
- file: '../dist/service.js',
30
- format: 'cjs'
31
- },
32
- plugins: [
33
- injectXmlContent(),
34
- replace({
35
- 'Gate.prototype.await = function await(callback)': 'Gate.prototype.await = function(callback)',
36
- 'Async.prototype.await = function await(callback)': 'Async.prototype.await = function (callback)',
37
- delimiters: ['', ''],
38
- }),
39
- resolve(),
40
- json(),
41
- commonjs(),
42
- babel({
43
- babelHelpers: 'bundled',
44
- presets: ['@babel/preset-env']
45
- })
46
- ]
47
- };const dial = require("@patrickkfkan/peer-dial");
1
+ /******/ /* webpack/runtime/compat */
2
+ /******/
3
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/";
4
+ /******/
5
+ /************************************************************************/
6
+ var __webpack_exports__ = {};
7
+ const dial = require("@patrickkfkan/peer-dial");
48
8
  const express = require('express');
49
9
  const cors = require('cors');
50
10
  const app = express();
@@ -159,4 +119,4 @@ setInterval(() => {
159
119
 
160
120
  app.listen(PORT, () => {
161
121
  dialServer.start();
162
- });
122
+ });