Skip to content

Commit a2af8c0

Browse files
committed
v0.73.4: report extraction progress
1 parent 1588145 commit a2af8c0

File tree

4 files changed

+240
-349
lines changed

4 files changed

+240
-349
lines changed

package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emulators-ui",
3-
"version": "0.73.2",
3+
"version": "0.73.4",
44
"description": "Emulators UI",
55
"main": "dist/emulators-ui.js",
66
"types": "dist/types/emulators-ui.d.ts",
@@ -34,23 +34,22 @@
3434
"@babel/preset-env": "^7.16.4",
3535
"@types/browserify": "^12.0.36",
3636
"@types/gulp": "^4.0.6",
37-
"@types/gulp-rename": "0.0.33",
38-
"@types/gulp-size": "^2.1.1",
39-
"@types/gulp-sourcemaps": "0.0.32",
37+
"@types/gulp-rename": "2.0.1",
38+
"@types/gulp-size": "^4.0.0",
39+
"@types/gulp-sourcemaps": "0.0.35",
4040
"@types/gulp-terser": "^1.2.1",
41-
"@types/md5-file": "^4.0.1",
42-
"@types/node": "^10.17.21",
41+
"@types/node": "^17.0.25",
4342
"@types/vinyl-buffer": "^1.0.0",
4443
"@types/vinyl-source-stream": "0.0.30",
45-
"@typescript-eslint/eslint-plugin": "^4.33.0",
46-
"@typescript-eslint/parser": "^4.33.0",
44+
"@typescript-eslint/eslint-plugin": "^5.20.0",
45+
"@typescript-eslint/parser": "^5.20.0",
4746
"babelify": "^10.0.0",
4847
"browserify": "^17.0.0",
49-
"core-js": "^3.19.1",
50-
"del": "^5.1.0",
48+
"core-js": "^3.22.2",
49+
"del": "^6.0.0",
5150
"element-resize-detector": "^1.2.4",
52-
"emulators": "^0.73.4",
53-
"eslint": "^7.30.0",
51+
"emulators": "^0.73.5",
52+
"eslint": "^8.13.0",
5453
"eslint-config-google": "^0.14.0",
5554
"git-repo-info": "^2.1.1",
5655
"gulp": "^4.0.2",

src/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
export const Build = {
77
short: "0.73.2",
8-
version: "0.73.2 (2e3e846edbcb9a05fcaec03a3a2fcd32)",
9-
buildSeed: 1650002532619,
8+
version: "0.73.2 (40eefa1795cae0673481705edc30f239)",
9+
buildSeed: 1650619479904,
1010
};

src/js-dos.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Emulators, CommandInterface } from "emulators";
1+
import { Emulators, CommandInterface, BackendOptions } from "emulators";
22
import { TransportLayer } from "emulators/dist/types/protocol/protocol";
33
import { EmulatorsUi } from "./emulators-ui";
44
import { Layers, LayersOptions } from "./dom/layers";
@@ -254,6 +254,19 @@ export class DosInstance {
254254
const bundlePromise = emulatorsUi.network.resolveBundle(bundleUrl, {
255255
onprogress: (percent) => this.layers.setLoadingMessage("Downloading bundle " + percent + "%"),
256256
});
257+
const options: BackendOptions = {
258+
onExtractProgress: (index, file, extracted, total) => {
259+
if (index !== 0) {
260+
return;
261+
}
262+
263+
const percent = Math.round(extracted / total * 100);
264+
const lastIndex = file.lastIndexOf("/");
265+
266+
const name = file.substring(lastIndex + 1);
267+
this.layers.setLoadingMessage("Extracting " + percent + "% (" + name + ")");
268+
},
269+
};
257270
try {
258271
let changesBundle: Uint8Array | undefined;
259272
if (optionalChangesUrl !== undefined && optionalChangesUrl !== null && optionalChangesUrl.length > 0) {
@@ -264,17 +277,17 @@ export class DosInstance {
264277
const bundle = await bundlePromise;
265278
if (this.emulatorFunction === "backend") {
266279
this.ciPromise = emulators.backend([bundle, changesBundle],
267-
(this as any).createTransportLayer() as TransportLayer);
280+
(this as any).createTransportLayer() as TransportLayer, options);
268281
} else {
269-
this.ciPromise = emulators[this.emulatorFunction]([bundle, changesBundle]);
282+
this.ciPromise = emulators[this.emulatorFunction]([bundle, changesBundle], options);
270283
}
271284
} catch {
272285
const bundle = await bundlePromise;
273286
if (this.emulatorFunction === "backend") {
274287
this.ciPromise = emulators.backend([bundle],
275-
(this as any).createTransportLayer() as TransportLayer);
288+
(this as any).createTransportLayer() as TransportLayer, options);
276289
} else {
277-
this.ciPromise = emulators[this.emulatorFunction]([bundle]);
290+
this.ciPromise = emulators[this.emulatorFunction]([bundle], options);
278291
}
279292
}
280293
}

0 commit comments

Comments
 (0)