@fluidframework/id-compressor 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488

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.
Files changed (263) hide show
  1. package/.eslintrc.cjs +5 -5
  2. package/{.mocharc.js → .mocharc.cjs} +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
  5. package/api-extractor-lint.json +1 -1
  6. package/api-extractor.json +1 -1
  7. package/api-report/id-compressor.api.md +2 -2
  8. package/dist/finalSpace.d.ts +2 -2
  9. package/dist/finalSpace.d.ts.map +1 -1
  10. package/dist/finalSpace.js +4 -4
  11. package/dist/finalSpace.js.map +1 -1
  12. package/dist/id-compressor-alpha.d.ts +114 -47
  13. package/dist/id-compressor-beta.d.ts +83 -75
  14. package/dist/id-compressor-public.d.ts +83 -75
  15. package/dist/id-compressor-untrimmed.d.ts +114 -47
  16. package/dist/idCompressor.d.ts +9 -3
  17. package/dist/idCompressor.d.ts.map +1 -1
  18. package/dist/idCompressor.js +76 -64
  19. package/dist/idCompressor.js.map +1 -1
  20. package/dist/identifiers.d.ts +1 -1
  21. package/dist/identifiers.d.ts.map +1 -1
  22. package/dist/identifiers.js.map +1 -1
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +8 -8
  26. package/dist/index.js.map +1 -1
  27. package/dist/package.json +3 -0
  28. package/dist/packageVersion.d.ts +1 -1
  29. package/dist/packageVersion.js +1 -1
  30. package/dist/packageVersion.js.map +1 -1
  31. package/dist/persistanceUtilities.d.ts +1 -1
  32. package/dist/persistanceUtilities.d.ts.map +1 -1
  33. package/dist/persistanceUtilities.js.map +1 -1
  34. package/dist/sessionSpaceNormalizer.d.ts +2 -2
  35. package/dist/sessionSpaceNormalizer.d.ts.map +1 -1
  36. package/dist/sessionSpaceNormalizer.js +4 -4
  37. package/dist/sessionSpaceNormalizer.js.map +1 -1
  38. package/dist/sessions.d.ts +2 -2
  39. package/dist/sessions.d.ts.map +1 -1
  40. package/dist/sessions.js +12 -12
  41. package/dist/sessions.js.map +1 -1
  42. package/dist/test/appendOnlySortedMap.perf.spec.d.ts +6 -0
  43. package/dist/test/appendOnlySortedMap.perf.spec.d.ts.map +1 -0
  44. package/dist/test/appendOnlySortedMap.perf.spec.js.map +1 -0
  45. package/dist/test/appendOnlySortedMap.spec.d.ts +6 -0
  46. package/dist/test/appendOnlySortedMap.spec.d.ts.map +1 -0
  47. package/dist/test/appendOnlySortedMap.spec.js.map +1 -0
  48. package/dist/test/idCompressor.perf.spec.d.ts +6 -0
  49. package/dist/test/idCompressor.perf.spec.d.ts.map +1 -0
  50. package/dist/test/idCompressor.perf.spec.js.map +1 -0
  51. package/dist/test/idCompressor.spec.d.ts +6 -0
  52. package/dist/test/idCompressor.spec.d.ts.map +1 -0
  53. package/dist/test/idCompressor.spec.js.map +1 -0
  54. package/dist/test/idCompressorTestUtilities.d.ts +245 -0
  55. package/dist/test/idCompressorTestUtilities.d.ts.map +1 -0
  56. package/dist/test/idCompressorTestUtilities.js +589 -0
  57. package/dist/test/idCompressorTestUtilities.js.map +1 -0
  58. package/dist/test/index.d.ts +9 -0
  59. package/dist/test/index.d.ts.map +1 -0
  60. package/dist/test/index.js +13 -0
  61. package/dist/test/index.js.map +1 -0
  62. package/dist/test/numericUuid.spec.d.ts +6 -0
  63. package/dist/test/numericUuid.spec.d.ts.map +1 -0
  64. package/dist/test/numericUuid.spec.js.map +1 -0
  65. package/dist/test/sessionSpaceNormalizer.spec.d.ts +6 -0
  66. package/dist/test/sessionSpaceNormalizer.spec.d.ts.map +1 -0
  67. package/dist/test/sessionSpaceNormalizer.spec.js.map +1 -0
  68. package/dist/test/snapshots/dirname.cjs +16 -0
  69. package/dist/test/snapshots/dirname.cjs.map +1 -0
  70. package/dist/test/snapshots/dirname.d.cts +6 -0
  71. package/dist/test/snapshots/dirname.d.cts.map +1 -0
  72. package/{lib/types/idCompressor.mjs → dist/test/snapshots/summary.spec.d.ts} +1 -1
  73. package/dist/test/snapshots/summary.spec.d.ts.map +1 -0
  74. package/dist/test/snapshots/summary.spec.js.map +1 -0
  75. package/dist/test/testCommon.d.ts +90 -0
  76. package/dist/test/testCommon.d.ts.map +1 -0
  77. package/dist/test/testCommon.js +90 -0
  78. package/dist/test/testCommon.js.map +1 -0
  79. package/dist/tsdoc-metadata.json +1 -1
  80. package/dist/types/idCompressor.d.ts +134 -67
  81. package/dist/types/idCompressor.d.ts.map +1 -1
  82. package/dist/types/idCompressor.js.map +1 -1
  83. package/dist/types/index.d.ts +3 -3
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/types/index.js.map +1 -1
  86. package/dist/types/persisted-types/0.0.1.d.ts +1 -1
  87. package/dist/types/persisted-types/0.0.1.d.ts.map +1 -1
  88. package/dist/types/persisted-types/0.0.1.js.map +1 -1
  89. package/dist/types/persisted-types/index.d.ts +1 -1
  90. package/dist/types/persisted-types/index.d.ts.map +1 -1
  91. package/dist/types/persisted-types/index.js.map +1 -1
  92. package/dist/utilities.d.ts +2 -2
  93. package/dist/utilities.d.ts.map +1 -1
  94. package/dist/utilities.js.map +1 -1
  95. package/lib/{appendOnlySortedMap.d.mts → appendOnlySortedMap.d.ts} +1 -1
  96. package/lib/appendOnlySortedMap.d.ts.map +1 -0
  97. package/lib/{appendOnlySortedMap.mjs → appendOnlySortedMap.js} +3 -1
  98. package/lib/appendOnlySortedMap.js.map +1 -0
  99. package/lib/{finalSpace.d.mts → finalSpace.d.ts} +3 -3
  100. package/lib/finalSpace.d.ts.map +1 -0
  101. package/lib/{finalSpace.mjs → finalSpace.js} +2 -2
  102. package/lib/finalSpace.js.map +1 -0
  103. package/lib/{id-compressor-alpha.d.mts → id-compressor-alpha.d.ts} +114 -47
  104. package/lib/id-compressor-beta.d.ts +179 -0
  105. package/lib/id-compressor-public.d.ts +179 -0
  106. package/lib/{id-compressor-untrimmed.d.mts → id-compressor-untrimmed.d.ts} +114 -47
  107. package/lib/{idCompressor.d.mts → idCompressor.d.ts} +10 -4
  108. package/lib/idCompressor.d.ts.map +1 -0
  109. package/lib/{idCompressor.mjs → idCompressor.js} +20 -8
  110. package/lib/idCompressor.js.map +1 -0
  111. package/lib/{identifiers.d.mts → identifiers.d.ts} +2 -2
  112. package/lib/identifiers.d.ts.map +1 -0
  113. package/lib/{identifiers.mjs → identifiers.js} +1 -1
  114. package/lib/identifiers.js.map +1 -0
  115. package/lib/{index.d.mts → index.d.ts} +7 -4
  116. package/lib/index.d.ts.map +1 -0
  117. package/lib/{index.mjs → index.js} +6 -3
  118. package/lib/index.js.map +1 -0
  119. package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
  120. package/lib/packageVersion.d.ts.map +1 -0
  121. package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
  122. package/lib/packageVersion.js.map +1 -0
  123. package/lib/{persistanceUtilities.d.mts → persistanceUtilities.d.ts} +2 -2
  124. package/lib/persistanceUtilities.d.ts.map +1 -0
  125. package/lib/{persistanceUtilities.mjs → persistanceUtilities.js} +1 -1
  126. package/lib/persistanceUtilities.js.map +1 -0
  127. package/lib/{sessionSpaceNormalizer.d.mts → sessionSpaceNormalizer.d.ts} +3 -3
  128. package/lib/sessionSpaceNormalizer.d.ts.map +1 -0
  129. package/lib/{sessionSpaceNormalizer.mjs → sessionSpaceNormalizer.js} +3 -3
  130. package/lib/sessionSpaceNormalizer.js.map +1 -0
  131. package/lib/{sessions.d.mts → sessions.d.ts} +3 -3
  132. package/lib/sessions.d.ts.map +1 -0
  133. package/lib/{sessions.mjs → sessions.js} +2 -2
  134. package/lib/sessions.js.map +1 -0
  135. package/lib/test/appendOnlySortedMap.perf.spec.d.ts +6 -0
  136. package/lib/test/appendOnlySortedMap.perf.spec.d.ts.map +1 -0
  137. package/lib/test/appendOnlySortedMap.perf.spec.js +49 -0
  138. package/lib/test/appendOnlySortedMap.perf.spec.js.map +1 -0
  139. package/lib/test/appendOnlySortedMap.spec.d.ts +6 -0
  140. package/lib/test/appendOnlySortedMap.spec.d.ts.map +1 -0
  141. package/lib/test/appendOnlySortedMap.spec.js +166 -0
  142. package/lib/test/appendOnlySortedMap.spec.js.map +1 -0
  143. package/lib/test/idCompressor.perf.spec.d.ts +6 -0
  144. package/lib/test/idCompressor.perf.spec.d.ts.map +1 -0
  145. package/lib/test/idCompressor.perf.spec.js +281 -0
  146. package/lib/test/idCompressor.perf.spec.js.map +1 -0
  147. package/lib/test/idCompressor.spec.d.ts +6 -0
  148. package/lib/test/idCompressor.spec.d.ts.map +1 -0
  149. package/lib/test/idCompressor.spec.js +953 -0
  150. package/lib/test/idCompressor.spec.js.map +1 -0
  151. package/lib/test/idCompressorTestUtilities.d.ts +245 -0
  152. package/lib/test/idCompressorTestUtilities.d.ts.map +1 -0
  153. package/lib/test/idCompressorTestUtilities.js +576 -0
  154. package/lib/test/idCompressorTestUtilities.js.map +1 -0
  155. package/lib/test/index.d.ts +9 -0
  156. package/lib/test/index.d.ts.map +1 -0
  157. package/lib/test/index.js +9 -0
  158. package/lib/test/index.js.map +1 -0
  159. package/lib/test/numericUuid.spec.d.ts +6 -0
  160. package/lib/test/numericUuid.spec.d.ts.map +1 -0
  161. package/lib/test/numericUuid.spec.js +74 -0
  162. package/lib/test/numericUuid.spec.js.map +1 -0
  163. package/lib/test/sessionSpaceNormalizer.spec.d.ts +6 -0
  164. package/lib/test/sessionSpaceNormalizer.spec.d.ts.map +1 -0
  165. package/lib/test/sessionSpaceNormalizer.spec.js +43 -0
  166. package/lib/test/sessionSpaceNormalizer.spec.js.map +1 -0
  167. package/lib/test/snapshots/dirname.cjs +16 -0
  168. package/lib/test/snapshots/dirname.cjs.map +1 -0
  169. package/lib/test/snapshots/dirname.d.cts +6 -0
  170. package/lib/test/snapshots/dirname.d.cts.map +1 -0
  171. package/lib/test/snapshots/summary.spec.d.ts +6 -0
  172. package/lib/test/snapshots/summary.spec.d.ts.map +1 -0
  173. package/lib/test/snapshots/summary.spec.js +127 -0
  174. package/lib/test/snapshots/summary.spec.js.map +1 -0
  175. package/lib/test/testCommon.d.ts +90 -0
  176. package/lib/test/testCommon.d.ts.map +1 -0
  177. package/lib/test/testCommon.js +80 -0
  178. package/lib/test/testCommon.js.map +1 -0
  179. package/lib/types/{idCompressor.d.mts → idCompressor.d.ts} +135 -68
  180. package/lib/types/idCompressor.d.ts.map +1 -0
  181. package/lib/types/{identifiers.mjs → idCompressor.js} +1 -1
  182. package/lib/types/idCompressor.js.map +1 -0
  183. package/lib/types/{identifiers.d.mts → identifiers.d.ts} +1 -1
  184. package/lib/types/identifiers.d.ts.map +1 -0
  185. package/lib/types/identifiers.js +6 -0
  186. package/lib/types/identifiers.js.map +1 -0
  187. package/lib/types/{index.d.mts → index.d.ts} +4 -4
  188. package/lib/types/index.d.ts.map +1 -0
  189. package/lib/types/{persisted-types/0.0.1.mjs → index.js} +1 -1
  190. package/lib/types/index.js.map +1 -0
  191. package/lib/types/persisted-types/{0.0.1.d.mts → 0.0.1.d.ts} +2 -2
  192. package/lib/types/persisted-types/0.0.1.d.ts.map +1 -0
  193. package/lib/types/persisted-types/{index.mjs → 0.0.1.js} +1 -1
  194. package/lib/types/persisted-types/0.0.1.js.map +1 -0
  195. package/lib/types/persisted-types/{index.d.mts → index.d.ts} +2 -2
  196. package/lib/types/persisted-types/index.d.ts.map +1 -0
  197. package/lib/types/{index.mjs → persisted-types/index.js} +1 -1
  198. package/lib/types/persisted-types/index.js.map +1 -0
  199. package/lib/{utilities.d.mts → utilities.d.ts} +3 -3
  200. package/lib/utilities.d.ts.map +1 -0
  201. package/lib/{utilities.mjs → utilities.js} +2 -1
  202. package/lib/utilities.js.map +1 -0
  203. package/package.json +88 -22
  204. package/src/finalSpace.ts +2 -2
  205. package/src/idCompressor.ts +22 -8
  206. package/src/identifiers.ts +1 -1
  207. package/src/index.ts +3 -3
  208. package/src/packageVersion.ts +1 -1
  209. package/src/persistanceUtilities.ts +1 -1
  210. package/src/sessionSpaceNormalizer.ts +3 -3
  211. package/src/sessions.ts +3 -3
  212. package/src/test/idCompressorTestUtilities.ts +921 -0
  213. package/src/test/index.ts +10 -0
  214. package/src/test/snapshots/dirname.cts +13 -0
  215. package/src/test/snapshots/files/compressor-with-finalized-range-from-one-client +1 -0
  216. package/src/test/snapshots/files/compressor-with-finalized-range-from-one-client-client2 +1 -0
  217. package/src/test/snapshots/files/compressors-with-finalized-ranges-from-two-clients +1 -0
  218. package/src/test/snapshots/files/compressors-with-finalized-ranges-from-two-clients-client2 +1 -0
  219. package/src/test/snapshots/files/empty-compressor-summary +1 -0
  220. package/src/test/snapshots/files/expansion-semantics +1 -0
  221. package/src/test/snapshots/files/expansion-semantics-client2 +1 -0
  222. package/src/test/testCommon.ts +143 -0
  223. package/src/test/tsconfig.cjs.json +12 -0
  224. package/src/test/tsconfig.json +20 -0
  225. package/src/types/idCompressor.ts +147 -72
  226. package/src/types/index.ts +8 -3
  227. package/src/types/persisted-types/0.0.1.ts +1 -1
  228. package/src/types/persisted-types/index.ts +1 -1
  229. package/src/utilities.ts +2 -2
  230. package/tsconfig.cjs.json +7 -0
  231. package/tsconfig.json +2 -5
  232. package/lib/appendOnlySortedMap.d.mts.map +0 -1
  233. package/lib/appendOnlySortedMap.mjs.map +0 -1
  234. package/lib/finalSpace.d.mts.map +0 -1
  235. package/lib/finalSpace.mjs.map +0 -1
  236. package/lib/id-compressor-beta.d.mts +0 -171
  237. package/lib/id-compressor-public.d.mts +0 -171
  238. package/lib/idCompressor.d.mts.map +0 -1
  239. package/lib/idCompressor.mjs.map +0 -1
  240. package/lib/identifiers.d.mts.map +0 -1
  241. package/lib/identifiers.mjs.map +0 -1
  242. package/lib/index.d.mts.map +0 -1
  243. package/lib/index.mjs.map +0 -1
  244. package/lib/packageVersion.d.mts.map +0 -1
  245. package/lib/packageVersion.mjs.map +0 -1
  246. package/lib/persistanceUtilities.d.mts.map +0 -1
  247. package/lib/persistanceUtilities.mjs.map +0 -1
  248. package/lib/sessionSpaceNormalizer.d.mts.map +0 -1
  249. package/lib/sessionSpaceNormalizer.mjs.map +0 -1
  250. package/lib/sessions.d.mts.map +0 -1
  251. package/lib/sessions.mjs.map +0 -1
  252. package/lib/types/idCompressor.d.mts.map +0 -1
  253. package/lib/types/idCompressor.mjs.map +0 -1
  254. package/lib/types/identifiers.d.mts.map +0 -1
  255. package/lib/types/identifiers.mjs.map +0 -1
  256. package/lib/types/index.d.mts.map +0 -1
  257. package/lib/types/index.mjs.map +0 -1
  258. package/lib/types/persisted-types/0.0.1.d.mts.map +0 -1
  259. package/lib/types/persisted-types/0.0.1.mjs.map +0 -1
  260. package/lib/types/persisted-types/index.d.mts.map +0 -1
  261. package/lib/types/persisted-types/index.mjs.map +0 -1
  262. package/lib/utilities.d.mts.map +0 -1
  263. package/lib/utilities.mjs.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/id-compressor",
3
- "version": "2.0.0-dev-rc.1.0.0.232845",
3
+ "version": "2.0.0-dev-rc.2.0.0.246488",
4
4
  "description": "ID compressor",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,8 +11,70 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
+ "type": "module",
15
+ "exports": {
16
+ ".": {
17
+ "import": {
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "require": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "./public": {
27
+ "import": {
28
+ "types": "./lib/id-compressor-public.d.ts",
29
+ "default": "./lib/index.js"
30
+ },
31
+ "require": {
32
+ "types": "./dist/id-compressor-public.d.ts",
33
+ "default": "./dist/index.js"
34
+ }
35
+ },
36
+ "./alpha": {
37
+ "import": {
38
+ "types": "./lib/id-compressor-alpha.d.ts",
39
+ "default": "./lib/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./dist/id-compressor-alpha.d.ts",
43
+ "default": "./dist/index.js"
44
+ }
45
+ },
46
+ "./internal": {
47
+ "import": {
48
+ "types": "./lib/index.d.ts",
49
+ "default": "./lib/index.js"
50
+ },
51
+ "require": {
52
+ "types": "./dist/index.d.ts",
53
+ "default": "./dist/index.js"
54
+ }
55
+ },
56
+ "./test": {
57
+ "import": {
58
+ "types": "./lib/test/index.d.ts",
59
+ "default": "./lib/test/index.js"
60
+ },
61
+ "require": {
62
+ "types": "./dist/test/index.d.ts",
63
+ "default": "./dist/test/index.js"
64
+ }
65
+ },
66
+ "./test/idCompressorTestUtilities": {
67
+ "import": {
68
+ "types": "./lib/test/idCompressorTestUtilities.d.ts",
69
+ "default": "./lib/test/idCompressorTestUtilities.js"
70
+ },
71
+ "require": {
72
+ "types": "./dist/test/idCompressorTestUtilities.d.ts",
73
+ "default": "./dist/test/idCompressorTestUtilities.js"
74
+ }
75
+ }
76
+ },
14
77
  "main": "dist/index.js",
15
- "module": "lib/index.mjs",
16
78
  "types": "dist/index.d.ts",
17
79
  "c8": {
18
80
  "all": true,
@@ -35,37 +97,37 @@
35
97
  "temp-directory": "nyc/.nyc_output"
36
98
  },
37
99
  "dependencies": {
38
- "@fluid-internal/client-utils": "2.0.0-dev-rc.1.0.0.232845",
39
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.232845",
40
- "@fluidframework/core-utils": "2.0.0-dev-rc.1.0.0.232845",
41
- "@fluidframework/telemetry-utils": "2.0.0-dev-rc.1.0.0.232845",
100
+ "@fluid-internal/client-utils": "2.0.0-dev-rc.2.0.0.246488",
101
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.2.0.0.246488",
102
+ "@fluidframework/core-utils": "2.0.0-dev-rc.2.0.0.246488",
103
+ "@fluidframework/telemetry-utils": "2.0.0-dev-rc.2.0.0.246488",
42
104
  "@tylerbu/sorted-btree-es6": "^1.8.0",
43
105
  "uuid": "^9.0.0"
44
106
  },
45
107
  "devDependencies": {
46
108
  "@arethetypeswrong/cli": "^0.13.3",
47
- "@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.1.0.0.232845",
109
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.2.0.0.246488",
110
+ "@fluid-private/stochastic-test-utils": "2.0.0-dev-rc.2.0.0.246488",
48
111
  "@fluid-tools/benchmark": "^0.48.0",
49
- "@fluid-tools/build-cli": "^0.29.0",
112
+ "@fluid-tools/build-cli": "^0.34.0",
50
113
  "@fluidframework/build-common": "^2.0.3",
51
- "@fluidframework/build-tools": "^0.29.0",
52
- "@fluidframework/eslint-config-fluid": "^3.3.0",
114
+ "@fluidframework/build-tools": "^0.34.0",
115
+ "@fluidframework/eslint-config-fluid": "^5.1.0",
53
116
  "@fluidframework/id-compressor-previous": "npm:@fluidframework/id-compressor@2.0.0-internal.8.0.0",
54
- "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.232845",
55
- "@microsoft/api-extractor": "^7.39.1",
117
+ "@microsoft/api-extractor": "^7.42.3",
56
118
  "@types/mocha": "^9.1.1",
119
+ "@types/node": "^18.19.0",
57
120
  "@types/uuid": "^9.0.2",
58
121
  "c8": "^8.0.1",
59
122
  "copyfiles": "^2.4.1",
60
123
  "cross-env": "^7.0.3",
61
- "eslint": "~8.50.0",
124
+ "eslint": "~8.55.0",
62
125
  "mocha": "^10.2.0",
63
126
  "mocha-json-output-reporter": "^2.0.1",
64
127
  "mocha-multi-reporters": "^1.5.1",
65
128
  "moment": "^2.21.0",
66
129
  "prettier": "~3.0.3",
67
130
  "rimraf": "^4.4.0",
68
- "tsc-multi": "^1.1.0",
69
131
  "typescript": "~5.1.6"
70
132
  },
71
133
  "fluidBuild": {
@@ -85,16 +147,18 @@
85
147
  },
86
148
  "scripts": {
87
149
  "api": "fluid-build . --task api",
88
- "api-extractor:commonjs": "api-extractor run --local",
89
- "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
150
+ "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
151
+ "api-extractor:esnext": "api-extractor run --local",
90
152
  "build": "fluid-build . --task build",
91
153
  "build:commonjs": "fluid-build . --task commonjs",
92
154
  "build:compile": "fluid-build . --task compile",
93
155
  "build:docs": "fluid-build . --task api",
94
- "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
156
+ "build:esnext": "tsc --project ./tsconfig.json",
95
157
  "build:genver": "gen-version",
96
- "build:test": "tsc --project ./src/test/tsconfig.json",
97
- "check:are-the-types-wrong": "attw --pack",
158
+ "build:test": "npm run build:test:esm && npm run build:test:cjs",
159
+ "build:test:cjs": "fluid-tsc commonjs --project ./src/test/tsconfig.cjs.json",
160
+ "build:test:esm": "tsc --project ./src/test/tsconfig.json",
161
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
98
162
  "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
99
163
  "ci:build:docs": "api-extractor run",
100
164
  "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
@@ -108,10 +172,12 @@
108
172
  "test": "npm run test:mocha",
109
173
  "test:benchmark:report": "mocha --timeout 999999 --perfMode --parentProcess --fgrep @Benchmark --reporter @fluid-tools/benchmark/dist/MochaReporter.js \"./dist/**/*.perf.spec.*js\"",
110
174
  "test:coverage": "c8 npm test",
111
- "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
175
+ "test:mocha": "npm run test:mocha:esm && echo skipping cjs to avoid overhead - npm run test:mocha:cjs",
176
+ "test:mocha:cjs": "mocha --recursive \"dist/test/**/*.spec.*js\" --exit",
177
+ "test:mocha:esm": "mocha --recursive \"lib/test/**/*.spec.*js\" --exit",
112
178
  "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
113
- "test:snapshots:regen": "npm run test:mocha -- --snapshot",
114
- "tsc": "tsc",
179
+ "test:snapshots:regen": "npm run test:mocha:esm -- --snapshot",
180
+ "tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
115
181
  "tsc:watch": "tsc --watch"
116
182
  }
117
183
  }
package/src/finalSpace.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import { assert } from "@fluidframework/core-utils";
7
- import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions";
8
- import { FinalCompressedId } from "./identifiers";
7
+ import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions.js";
8
+ import { FinalCompressedId } from "./identifiers.js";
9
9
 
10
10
  /**
11
11
  * All IDs that have been finalized (acked), grouped into clusters sorted by their base final IDs.
@@ -18,8 +18,8 @@ import {
18
18
  SessionId,
19
19
  SessionSpaceCompressedId,
20
20
  StableId,
21
- } from "./types";
22
- import { FinalCompressedId, isFinalId, LocalCompressedId, NumericUuid } from "./identifiers";
21
+ } from "./types/index.js";
22
+ import { FinalCompressedId, isFinalId, LocalCompressedId, NumericUuid } from "./identifiers.js";
23
23
  import {
24
24
  createSessionId,
25
25
  localIdFromGenCount,
@@ -28,7 +28,7 @@ import {
28
28
  offsetNumericUuid,
29
29
  stableIdFromNumericUuid,
30
30
  subtractNumericUuids,
31
- } from "./utilities";
31
+ } from "./utilities.js";
32
32
  import {
33
33
  Index,
34
34
  readBoolean,
@@ -37,7 +37,7 @@ import {
37
37
  writeBoolean,
38
38
  writeNumber,
39
39
  writeNumericUuid,
40
- } from "./persistanceUtilities";
40
+ } from "./persistanceUtilities.js";
41
41
  import {
42
42
  getAlignedLocal,
43
43
  getAlignedFinal,
@@ -46,9 +46,9 @@ import {
46
46
  Session,
47
47
  Sessions,
48
48
  lastFinalizedFinal,
49
- } from "./sessions";
50
- import { SessionSpaceNormalizer } from "./sessionSpaceNormalizer";
51
- import { FinalSpace } from "./finalSpace";
49
+ } from "./sessions.js";
50
+ import { SessionSpaceNormalizer } from "./sessionSpaceNormalizer.js";
51
+ import { FinalSpace } from "./finalSpace.js";
52
52
 
53
53
  /**
54
54
  * The version of IdCompressor that is currently persisted.
@@ -166,11 +166,25 @@ export class IdCompressor implements IIdCompressor, IIdCompressorCore {
166
166
  }
167
167
  }
168
168
 
169
+ public generateDocumentUniqueId(): (SessionSpaceCompressedId & OpSpaceCompressedId) | StableId {
170
+ const id = this.generateCompressedId();
171
+ return isFinalId(id) ? id : this.decompress(id);
172
+ }
173
+
174
+ /**
175
+ * Starts a ghost session. Only exposed for test purposes (this class is not exported from the package).
176
+ * @param ghostSessionId - The session ID to start the ghost session with.
177
+ */
178
+ public startGhostSession(ghostSessionId: SessionId): void {
179
+ assert(!this.ongoingGhostSession, 0x8fe /* Ghost session already in progress. */);
180
+ this.ongoingGhostSession = { ghostSessionId };
181
+ }
182
+
169
183
  /**
170
184
  * {@inheritdoc IIdCompressorCore.beginGhostSession}
171
185
  */
172
186
  public beginGhostSession(ghostSessionId: SessionId, ghostSessionCallback: () => void) {
173
- this.ongoingGhostSession = { ghostSessionId };
187
+ this.startGhostSession(ghostSessionId);
174
188
  try {
175
189
  ghostSessionCallback();
176
190
  } finally {
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { OpSpaceCompressedId, SessionSpaceCompressedId } from "./types";
6
+ import { OpSpaceCompressedId, SessionSpaceCompressedId } from "./types/index.js";
7
7
 
8
8
  /**
9
9
  * A compressed ID that is stable and unique within the scope of network of compressors (i.e. a document).
package/src/index.ts CHANGED
@@ -7,8 +7,8 @@
7
7
  * Exports for `id-compressor`
8
8
  */
9
9
 
10
- export { createIdCompressor, deserializeIdCompressor } from "./idCompressor";
11
- export { createSessionId, assertIsStableId, generateStableId, isStableId } from "./utilities";
10
+ export { createIdCompressor, deserializeIdCompressor } from "./idCompressor.js";
11
+ export { createSessionId, assertIsStableId, generateStableId, isStableId } from "./utilities.js";
12
12
  export {
13
13
  IIdCompressorCore,
14
14
  IIdCompressor,
@@ -20,4 +20,4 @@ export {
20
20
  SessionId,
21
21
  StableId,
22
22
  IdCreationRange,
23
- } from "./types";
23
+ } from "./types/index.js";
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/id-compressor";
9
- export const pkgVersion = "2.0.0-dev-rc.1.0.0.232845";
9
+ export const pkgVersion = "2.0.0-dev-rc.2.0.0.246488";
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  /* eslint-disable no-bitwise */
7
- import { NumericUuid } from "./identifiers";
7
+ import { NumericUuid } from "./identifiers.js";
8
8
 
9
9
  const halfNumeric = BigInt("0xFFFFFFFFFFFFFFFF");
10
10
  const sixtyFour = BigInt(64);
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { AppendOnlySortedMap } from "./appendOnlySortedMap";
7
- import { LocalCompressedId } from "./identifiers";
8
- import { compareFiniteNumbers, genCountFromLocalId } from "./utilities";
6
+ import { AppendOnlySortedMap } from "./appendOnlySortedMap.js";
7
+ import { LocalCompressedId } from "./identifiers.js";
8
+ import { compareFiniteNumbers, genCountFromLocalId } from "./utilities.js";
9
9
 
10
10
  /**
11
11
  * The `SessionSpaceNormalizer` tracks the form of the IDs created by the local session.
package/src/sessions.ts CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { BTree } from "@tylerbu/sorted-btree-es6";
7
7
  import { assert } from "@fluidframework/core-utils";
8
- import { SessionId, StableId } from "./types";
8
+ import { SessionId, StableId } from "./types/index.js";
9
9
  import {
10
10
  compareBigints,
11
11
  localIdFromGenCount,
@@ -14,8 +14,8 @@ import {
14
14
  stableIdFromNumericUuid,
15
15
  subtractNumericUuids,
16
16
  offsetNumericUuid,
17
- } from "./utilities";
18
- import { FinalCompressedId, LocalCompressedId, NumericUuid } from "./identifiers";
17
+ } from "./utilities.js";
18
+ import { FinalCompressedId, LocalCompressedId, NumericUuid } from "./identifiers.js";
19
19
 
20
20
  /**
21
21
  * A collection of all sessions known to the compressor (i.e. all finalized/acked allocated UUIDs and their corresponding local and final forms).