Skip to content

Commit 74e5eef

Browse files
committed
Merge branch 'master' of https://github.com/TurboWarp/packager
2 parents 6f5867a + 9b2a9b2 commit 74e5eef

File tree

8 files changed

+50
-59
lines changed

8 files changed

+50
-59
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
13+
- uses: actions/checkout@v4
1414
with:
1515
persist-credentials: false
1616
- name: Install Node.js
17-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
17+
uses: actions/setup-node@v4
1818
with:
1919
node-version: 22
2020
cache: 'npm'
@@ -27,7 +27,7 @@ jobs:
2727
- name: Build standalone
2828
run: npm run build-standalone-prod
2929
- name: Upload standalone artifact
30-
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
30+
uses: actions/upload-artifact@v4
3131
with:
3232
name: standalone
3333
path: dist/standalone.html

.github/workflows/deploy.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,13 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
17+
uses: actions/checkout@v4
1818
with:
1919
persist-credentials: false
20-
- name: Setup GitHub Pages
21-
id: pages
22-
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b
2320
- name: Install Node.js
24-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
21+
uses: actions/setup-node@v4
2522
with:
2623
node-version: 22
27-
cache: 'npm'
2824
- name: Install dependencies
2925
run: npm ci
3026
- name: Test
@@ -41,7 +37,7 @@ jobs:
4137
npm run build-standalone-prod
4238
cp dist/standalone.html web
4339
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
40+
uses: actions/upload-pages-artifact@v3
4541
with:
4642
path: ./web/
4743

@@ -57,4 +53,4 @@ jobs:
5753
steps:
5854
- name: Deploy to GitHub Pages
5955
id: deployment
60-
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
56+
uses: actions/deploy-pages@v4

.github/workflows/generate-electron-binaries.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616

1717
steps:
18-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
18+
- uses: actions/checkout@v4
1919
with:
2020
persist-credentials: false
21-
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
21+
- uses: actions/setup-node@v4
2222
with:
2323
node-version: 22
2424
- name: Install dependencies
@@ -33,7 +33,7 @@ jobs:
3333
node generate-macos.js
3434
- name: Upload macOS
3535
if: runner.os == 'macOS'
36-
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
36+
uses: actions/upload-artifact@v4
3737
with:
3838
name: electron-macos
3939
path: electron-bin/temp/macos/*.zip
@@ -48,13 +48,13 @@ jobs:
4848
node generate-windows.js
4949
- name: Upload Windows
5050
if: runner.os == 'Windows'
51-
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
51+
uses: actions/upload-artifact@v4
5252
with:
5353
name: electron-windows
5454
path: electron-bin/temp/windows/*.zip
5555
- name: Upload Windows Crossbuild
5656
if: runner.os == 'Linux'
57-
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b
57+
uses: actions/upload-artifact@v4
5858
with:
5959
name: electron-windows-crossbuild
6060
path: electron-bin/temp/windows/*.zip

.github/workflows/wkwebview-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: macos-latest
1212

1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
14+
- uses: actions/checkout@v4
1515
with:
1616
persist-credentials: false
1717
- name: Build

package-lock.json

Lines changed: 13 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nitrobolt/packager",
3-
"version": "3.4.3",
3+
"version": "3.6.1",
44
"description": "Converts projects into HTML files, zip archives, or executable programs for Windows, macOS, and Linux.",
55
"main": "dist/packager.js",
66
"scripts": {
@@ -43,7 +43,7 @@
4343
"devDependencies": {
4444
"@babel/core": "^7.16.5",
4545
"@babel/preset-env": "^7.16.5",
46-
"@turbowarp/scratch-storage": "^0.0.202502192258",
46+
"@turbowarp/scratch-storage": "^0.0.202505311821",
4747
"@turbowarp/scratch-svg-renderer": "^1.0.0-202401111326-62c0f26",
4848
"babel-jest": "^27.4.5",
4949
"babel-loader": "^8.2.3",

src/common/idb.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const TRANSACTION_TIMEOUT_MS = 10 * 1000;
2+
13
// https://github.com/jakearchibald/safari-14-idb-fix/blob/582bbdc7230891113bfb5743391550cbf29d21f2/src/index.ts
24
const idbReady = () => {
35
const isSafari =
@@ -28,6 +30,9 @@ class Database {
2830
allDatabases.push(this);
2931
}
3032

33+
/**
34+
* @returns {IDBDatabase|Promise<IDBDatabase>}
35+
*/
3136
open () {
3237
if (this.db) {
3338
return this.db;
@@ -110,11 +115,21 @@ class Database {
110115
* @param {function} reject
111116
*/
112117
Database.setTransactionErrorHandler = (transaction, reject) => {
113-
transaction.onerror = () => {
114-
reject(new Error(`Transaction error: ${transaction.error}`))
118+
const timeoutId = setTimeout(() => {
119+
reject(new Error('Transaction timed out'));
120+
transaction.abort();
121+
}, TRANSACTION_TIMEOUT_MS);
122+
123+
transaction.oncomplete = () => {
124+
clearTimeout(timeoutId);
125+
};
126+
transaction.onerror = (e) => {
127+
clearTimeout(timeoutId);
128+
reject(new Error(`Transaction error: ${e.target.error}`))
115129
};
116130
transaction.onabort = () => {
117-
reject(new Error(`Transaction aborted: ${transaction.error}`));
131+
clearTimeout(timeoutId);
132+
reject(new Error('Transaction aborted'));
118133
};
119134
};
120135

src/scaffolding/scratch-parser/lib/unpack.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ module.exports = function (input, isSprite, callback) {
4040

4141
// If not legacy or zip, convert buffer to UTF-8 string and return
4242
if (!isZip && !isLegacy) {
43-
return callback(null, [input.toString('utf-8'), null]);
43+
// In browsers, the native TextDecoder can handle much larger values than the JavaScript polyfill for
44+
// Buffer.toString('utf-8'), particularly in Chrome.
45+
const decoder = new TextDecoder();
46+
return callback(null, [decoder.decode(input), null]);
4447
}
4548

4649
// Return error if legacy encoding detected

0 commit comments

Comments
 (0)