haxball.js 3.2.0-dev → 3.2.1
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/release.yml +6 -1
- package/package.json +2 -2
- package/scripts/nodeify.js +5 -3
- package/src/index.js +5 -3
|
@@ -24,7 +24,12 @@ jobs:
|
|
|
24
24
|
|
|
25
25
|
- name: 🚀 Publish to NPM
|
|
26
26
|
run: |
|
|
27
|
-
|
|
27
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
28
|
+
echo "📦 Preparing to publish version $VERSION"
|
|
29
|
+
if [[ "$VERSION" == *-* ]]; then
|
|
30
|
+
echo "⛔ Pre-release version detected [$VERSION], skipping publish."
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
28
33
|
npm publish --access public
|
|
29
34
|
env:
|
|
30
35
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haxball.js",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "A powerful library for interacting with the Haxball Headless API",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"author": "mertushka",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@mertushka/node-datachannel": "^0.
|
|
23
|
+
"@mertushka/node-datachannel": "^0.35.0",
|
|
24
24
|
"@peculiar/webcrypto": "^1.5.0",
|
|
25
25
|
"@types/haxball-headless-browser": "^0.4.0",
|
|
26
26
|
"https-proxy-agent": "^7.0.6",
|
package/scripts/nodeify.js
CHANGED
|
@@ -154,15 +154,17 @@ var promiseResolve;
|
|
|
154
154
|
var proxyAgent;
|
|
155
155
|
var debug = false;
|
|
156
156
|
|
|
157
|
+
const HBInit = new Promise(function (resolve, reject) {
|
|
158
|
+
promiseResolve = resolve;
|
|
159
|
+
});
|
|
160
|
+
|
|
157
161
|
const HBLoaded = (config) => {
|
|
158
162
|
if(config?.webrtc) {
|
|
159
163
|
RTCPeerConnection = config.webrtc.RTCPeerConnection;
|
|
160
164
|
RTCIceCandidate = config.webrtc.RTCIceCandidate;
|
|
161
165
|
RTCSessionDescription = config.webrtc.RTCSessionDescription;
|
|
162
166
|
}
|
|
163
|
-
return
|
|
164
|
-
promiseResolve = resolve;
|
|
165
|
-
});
|
|
167
|
+
return HBInit;
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
const onHBLoaded = function (cb) {
|
package/src/index.js
CHANGED
|
@@ -14,15 +14,17 @@ var promiseResolve;
|
|
|
14
14
|
var proxyAgent;
|
|
15
15
|
var debug = false;
|
|
16
16
|
|
|
17
|
+
const HBInit = new Promise(function (resolve, reject) {
|
|
18
|
+
promiseResolve = resolve;
|
|
19
|
+
});
|
|
20
|
+
|
|
17
21
|
const HBLoaded = (config) => {
|
|
18
22
|
if(config?.webrtc) {
|
|
19
23
|
RTCPeerConnection = config.webrtc.RTCPeerConnection;
|
|
20
24
|
RTCIceCandidate = config.webrtc.RTCIceCandidate;
|
|
21
25
|
RTCSessionDescription = config.webrtc.RTCSessionDescription;
|
|
22
26
|
}
|
|
23
|
-
return
|
|
24
|
-
promiseResolve = resolve;
|
|
25
|
-
});
|
|
27
|
+
return HBInit;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
const onHBLoaded = function (cb) {
|