@omercnet/paseo-shared-browser 1.0.1-next.173.1 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omercnet/paseo-shared-browser",
3
- "version": "1.0.1-next.173.1",
3
+ "version": "1.0.1",
4
4
  "description": "One real Chromium session per Paseo workspace, shared live across every connected client.",
5
5
  "keywords": [
6
6
  "browser",
@@ -29,7 +29,6 @@
29
29
  "client",
30
30
  "scripts/prepare-dependencies.mjs",
31
31
  "scripts/prepare-runtime.mjs",
32
- "scripts/replace-runtime.mjs",
33
32
  "server",
34
33
  "shared",
35
34
  "paseo-plugin.json"
@@ -1,13 +1,23 @@
1
1
  import { execFile } from "node:child_process";
2
2
  import { constants } from "node:fs";
3
- import { access, chmod, cp, lstat, mkdir, readdir, rm, symlink, writeFile } from "node:fs/promises";
3
+ import {
4
+ access,
5
+ chmod,
6
+ cp,
7
+ lstat,
8
+ mkdir,
9
+ readdir,
10
+ rename,
11
+ rm,
12
+ symlink,
13
+ writeFile,
14
+ } from "node:fs/promises";
4
15
  import { createRequire } from "node:module";
5
16
  import { arch, homedir, platform, userInfo } from "node:os";
6
17
  import { dirname, join, resolve } from "node:path";
7
18
  import { fileURLToPath } from "node:url";
8
19
  import { promisify } from "node:util";
9
20
  import { build } from "esbuild";
10
- import { replaceRuntime } from "./replace-runtime.mjs";
11
21
 
12
22
  const require = createRequire(import.meta.url);
13
23
 
@@ -247,6 +257,6 @@ await applyPrivatePermissions(stagingRoot);
247
257
  if (hostPlatform !== "win32") {
248
258
  await validateChromium(await requireExecutable(chromiumEntry, "Staged Chromium executable"));
249
259
  }
250
- await replaceRuntime(stagingRoot, runtimeRoot);
260
+ await rename(stagingRoot, runtimeRoot);
251
261
 
252
262
  console.log(`Prepared immutable Shared Browser runtime assets in ${runtimeRoot}`);
@@ -1,25 +0,0 @@
1
- import { rename, rm } from "node:fs/promises";
2
- import { join } from "node:path";
3
-
4
- export async function replaceRuntime(stagingRoot, runtimeRoot) {
5
- const previousRuntimeRoot = join(runtimeRoot, "..", `.runtime-previous-${process.pid}`);
6
- await rm(previousRuntimeRoot, { recursive: true, force: true });
7
- let replacedExistingRuntime = false;
8
- try {
9
- await rename(runtimeRoot, previousRuntimeRoot);
10
- replacedExistingRuntime = true;
11
- } catch (error) {
12
- if (error?.code !== "ENOENT") throw error;
13
- }
14
- try {
15
- await rename(stagingRoot, runtimeRoot);
16
- } catch (error) {
17
- if (replacedExistingRuntime) await rename(previousRuntimeRoot, runtimeRoot);
18
- throw error;
19
- }
20
- if (replacedExistingRuntime) {
21
- await rm(previousRuntimeRoot, { recursive: true, force: true }).catch((error) => {
22
- console.warn(`Could not remove previous Shared Browser runtime: ${error}`);
23
- });
24
- }
25
- }