gestalt-mobile 0.55.2 → 0.55.3
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.
|
@@ -7,7 +7,6 @@ import { spawn } from 'node:child_process';
|
|
|
7
7
|
import { access } from 'node:fs/promises';
|
|
8
8
|
import { constants } from 'node:fs';
|
|
9
9
|
import { isAbsolute, join } from 'node:path';
|
|
10
|
-
export const managedXerjVersion = '1.0.0-rc.87';
|
|
11
10
|
/** The manager alone owns backend identity, authentication and shared lifetime. */
|
|
12
11
|
export class ManagedXerj {
|
|
13
12
|
environment;
|
|
@@ -69,7 +68,8 @@ export class ManagedXerj {
|
|
|
69
68
|
if (value.status === 'unavailable')
|
|
70
69
|
return settle(unavailable('managed-backend-unavailable'));
|
|
71
70
|
if (value.status !== 'ready' ||
|
|
72
|
-
value.version !==
|
|
71
|
+
typeof value.version !== 'string' ||
|
|
72
|
+
!/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?$/.test(value.version) ||
|
|
73
73
|
typeof value.endpoint !== 'string' ||
|
|
74
74
|
!/^http:\/\/(127\.0\.0\.1|\[::1\])(?::\d{1,5})?$/.test(value.endpoint))
|
|
75
75
|
throw new Error();
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import { createHash, randomUUID } from 'node:crypto';
|
|
7
7
|
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
8
8
|
import { join } from 'node:path';
|
|
9
|
-
|
|
10
|
-
// Content-affecting rc.87 settings. Reused in the command and fingerprint so
|
|
9
|
+
// Content-affecting settings. Reused in the command and fingerprint so
|
|
11
10
|
// changing an operational setting cannot accidentally require a rebuild.
|
|
12
11
|
export const xerjContentArguments = [
|
|
13
12
|
'--no-graph',
|
|
@@ -24,7 +23,6 @@ export function xerjIndexConfig(root, prefix, endpoint) {
|
|
|
24
23
|
root,
|
|
25
24
|
prefix,
|
|
26
25
|
endpoint,
|
|
27
|
-
nativeVersion: managedXerjVersion,
|
|
28
26
|
contentArguments: xerjContentArguments,
|
|
29
27
|
followSymlinks: false,
|
|
30
28
|
label: null,
|
|
@@ -40,8 +38,13 @@ const filename = '.gestalt-index-config.json';
|
|
|
40
38
|
export async function checkXerjIndexConfig(directory, expected) {
|
|
41
39
|
try {
|
|
42
40
|
const saved = JSON.parse(await readFile(join(directory, filename), 'utf8'));
|
|
41
|
+
// Older fingerprints included a pinned version. Validate their integrity
|
|
42
|
+
// before comparing content settings; native XERJ owns index compatibility.
|
|
43
|
+
const settings = { ...saved.settings };
|
|
44
|
+
delete settings.nativeVersion;
|
|
43
45
|
return saved.schemaVersion === expected.schemaVersion &&
|
|
44
|
-
|
|
46
|
+
createHash('sha256').update(JSON.stringify(settings)).digest('hex') ===
|
|
47
|
+
expected.fingerprint &&
|
|
45
48
|
createHash('sha256').update(JSON.stringify(saved.settings)).digest('hex') ===
|
|
46
49
|
saved.fingerprint
|
|
47
50
|
? 'compatible'
|