@fluidframework/container-runtime 0.59.4000-71128 → 0.59.4001

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": "@fluidframework/container-runtime",
3
- "version": "0.59.4000-71128",
3
+ "version": "0.59.4001",
4
4
  "description": "Fluid container runtime",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -63,30 +63,29 @@
63
63
  "dependencies": {
64
64
  "@fluidframework/common-definitions": "^0.20.1",
65
65
  "@fluidframework/common-utils": "^0.32.1",
66
- "@fluidframework/container-definitions": "^0.48.2000-0",
67
- "@fluidframework/container-runtime-definitions": "0.59.4000-71128",
68
- "@fluidframework/container-utils": "0.59.4000-71128",
66
+ "@fluidframework/container-definitions": "^0.48.2000",
67
+ "@fluidframework/container-runtime-definitions": "^0.59.4001",
68
+ "@fluidframework/container-utils": "^0.59.4001",
69
69
  "@fluidframework/core-interfaces": "^0.43.1000",
70
- "@fluidframework/datastore": "0.59.4000-71128",
71
- "@fluidframework/driver-definitions": "^0.46.2000-0",
72
- "@fluidframework/driver-utils": "0.59.4000-71128",
73
- "@fluidframework/garbage-collector": "0.59.4000-71128",
74
- "@fluidframework/protocol-base": "^0.1036.4000-0",
75
- "@fluidframework/protocol-definitions": "^0.1028.2000-0",
76
- "@fluidframework/runtime-definitions": "0.59.4000-71128",
77
- "@fluidframework/runtime-utils": "0.59.4000-71128",
78
- "@fluidframework/telemetry-utils": "0.59.4000-71128",
70
+ "@fluidframework/datastore": "^0.59.4001",
71
+ "@fluidframework/driver-definitions": "^0.46.2000",
72
+ "@fluidframework/driver-utils": "^0.59.4001",
73
+ "@fluidframework/garbage-collector": "^0.59.4001",
74
+ "@fluidframework/protocol-base": "^0.1036.4000",
75
+ "@fluidframework/protocol-definitions": "^0.1028.2000",
76
+ "@fluidframework/runtime-definitions": "^0.59.4001",
77
+ "@fluidframework/runtime-utils": "^0.59.4001",
78
+ "@fluidframework/telemetry-utils": "^0.59.4001",
79
79
  "double-ended-queue": "^2.1.0-0",
80
- "semver": "^7.3.4",
81
80
  "uuid": "^8.3.1"
82
81
  },
83
82
  "devDependencies": {
84
83
  "@fluidframework/build-common": "^0.23.0",
85
84
  "@fluidframework/build-tools": "^0.2.70857",
86
- "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@0.59.3000",
85
+ "@fluidframework/container-runtime-previous": "npm:@fluidframework/container-runtime@0.59.4000",
87
86
  "@fluidframework/eslint-config-fluid": "^0.28.2000",
88
- "@fluidframework/mocha-test-setup": "0.59.4000-71128",
89
- "@fluidframework/test-runtime-utils": "0.59.4000-71128",
87
+ "@fluidframework/mocha-test-setup": "^0.59.4001",
88
+ "@fluidframework/test-runtime-utils": "^0.59.4001",
90
89
  "@microsoft/api-extractor": "^7.22.2",
91
90
  "@rushstack/eslint-config": "^2.5.1",
92
91
  "@types/double-ended-queue": "^2.1.0",
@@ -119,7 +118,7 @@
119
118
  "typescript-formatter": "7.1.0"
120
119
  },
121
120
  "typeValidation": {
122
- "version": "0.59.4000",
121
+ "version": "0.59.4001",
123
122
  "broken": {}
124
123
  }
125
124
  }
@@ -39,7 +39,6 @@ import {
39
39
  TelemetryDataTag,
40
40
  } from "@fluidframework/telemetry-utils";
41
41
 
42
- import * as semver from "semver";
43
42
  import { IGCRuntimeOptions, RuntimeHeaders } from "./containerRuntime";
44
43
  import { getSummaryForDatastores } from "./dataStores";
45
44
  import { pkgVersion } from "./packageVersion";
@@ -1324,5 +1323,56 @@ function setLongTimeout(
1324
1323
  * @param minimumVersion - the function to execute when the timer ends
1325
1324
  */
1326
1325
  function meetsMinimumVersionRequirement(currentVersion: string, minimumVersion: string | undefined) {
1327
- return minimumVersion === undefined || semver.compare(currentVersion, minimumVersion) >= 0;
1326
+ return minimumVersion === undefined || semverCompare(currentVersion, minimumVersion) >= 0;
1327
+ }
1328
+
1329
+ /**
1330
+ * Compare semver versions.
1331
+ * @param currentVersion - assumed to be any valid semver version
1332
+ * @param minimumVersion - must be [major].[minor].[patch], where major, minor, and patch are all numbers
1333
+ * as it complicates the algorithm if we allow comparisons against minimum pre-release versions.
1334
+ * @returns
1335
+ * 0 if the currentVersion equals the minimumVersion
1336
+ * 1 if the currentVersion is greater than the minimumVersion
1337
+ * -1 if the minimumVersion is greater than the currentVersion
1338
+ */
1339
+ export function semverCompare(currentVersion: string, minimumVersion: string): number {
1340
+ const minimumValues = minimumVersion.split(".").map((value): number => {
1341
+ assert(isNaN(+value) === false, 0x2fa /* Expected real numbers in minimum version! */);
1342
+ return Number.parseInt(value, 10);
1343
+ });
1344
+ assert(minimumValues.length === 3, 0x2fb /* Expected minimumVersion to be [major].[minor].[patch] */);
1345
+ const [minMajor, minMinor, minPatch] = minimumValues;
1346
+
1347
+ const currentValuesString = currentVersion.split(/\W/);
1348
+ assert(currentValuesString.length >= 3, 0x2fc /* Expected version to match semver rules! */);
1349
+ const currentValues = currentValuesString.slice(0, 3).map((value) => {
1350
+ assert(isNaN(+value) === false, 0x2fd /* Expected real numbers in minimum version! */);
1351
+ return Number.parseInt(value, 10);
1352
+ });
1353
+ const [cMajor, cMinor, cPatch] = currentValues;
1354
+
1355
+ if (cMajor > minMajor) {
1356
+ return 1;
1357
+ } else if (minMajor > cMajor) {
1358
+ return -1;
1359
+ }
1360
+
1361
+ if (cMinor > minMinor) {
1362
+ return 1;
1363
+ } else if (minMinor > cMinor) {
1364
+ return -1;
1365
+ }
1366
+
1367
+ if (cPatch > minPatch) {
1368
+ return 1;
1369
+ } else if (minPatch > cPatch) {
1370
+ return -1;
1371
+ }
1372
+
1373
+ if (currentValuesString.length === 3) {
1374
+ return 0;
1375
+ }
1376
+
1377
+ return -1;
1328
1378
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "0.59.4000-71128";
9
+ export const pkgVersion = "0.59.4001";