@fluidframework/file-driver 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.203917

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/file-driver",
3
- "version": "2.0.0-dev.6.4.0.192049",
3
+ "version": "2.0.0-dev.7.2.0.203917",
4
4
  "description": "A driver that reads/write from/to local file storage.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -14,27 +14,26 @@
14
14
  "main": "dist/index.js",
15
15
  "types": "dist/index.d.ts",
16
16
  "dependencies": {
17
- "@fluid-internal/client-utils": "2.0.0-dev.6.4.0.192049",
18
- "@fluidframework/core-interfaces": "2.0.0-dev.6.4.0.192049",
19
- "@fluidframework/core-utils": "2.0.0-dev.6.4.0.192049",
20
- "@fluidframework/driver-definitions": "2.0.0-dev.6.4.0.192049",
21
- "@fluidframework/driver-utils": "2.0.0-dev.6.4.0.192049",
22
- "@fluidframework/protocol-definitions": "^1.1.0",
23
- "@fluidframework/replay-driver": "2.0.0-dev.6.4.0.192049"
17
+ "@fluid-internal/client-utils": "2.0.0-dev.7.2.0.203917",
18
+ "@fluidframework/core-interfaces": "2.0.0-dev.7.2.0.203917",
19
+ "@fluidframework/core-utils": "2.0.0-dev.7.2.0.203917",
20
+ "@fluidframework/driver-definitions": "2.0.0-dev.7.2.0.203917",
21
+ "@fluidframework/driver-utils": "2.0.0-dev.7.2.0.203917",
22
+ "@fluidframework/protocol-definitions": "^3.0.0",
23
+ "@fluidframework/replay-driver": "2.0.0-dev.7.2.0.203917"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-tools/build-cli": "^0.22.0",
27
- "@fluidframework/build-common": "^2.0.0",
28
- "@fluidframework/build-tools": "^0.22.0",
29
- "@fluidframework/eslint-config-fluid": "^2.1.0",
30
- "@fluidframework/file-driver-previous": "npm:@fluidframework/file-driver@2.0.0-internal.6.3.0",
31
- "@microsoft/api-extractor": "^7.34.4",
26
+ "@fluid-tools/build-cli": "0.26.0-203096",
27
+ "@fluidframework/build-common": "^2.0.2",
28
+ "@fluidframework/build-tools": "0.26.0-203096",
29
+ "@fluidframework/eslint-config-fluid": "^3.0.0",
30
+ "@fluidframework/file-driver-previous": "npm:@fluidframework/file-driver@2.0.0-internal.7.1.0",
31
+ "@microsoft/api-extractor": "^7.37.0",
32
32
  "@types/node": "^16.18.38",
33
- "copyfiles": "^2.4.1",
34
- "eslint": "~8.6.0",
35
- "prettier": "~2.6.2",
33
+ "eslint": "~8.50.0",
34
+ "prettier": "~3.0.3",
36
35
  "rimraf": "^4.4.0",
37
- "typescript": "~4.5.5"
36
+ "typescript": "~5.1.6"
38
37
  },
39
38
  "fluidBuild": {
40
39
  "tasks": {
@@ -50,8 +49,8 @@
50
49
  "scripts": {
51
50
  "build": "fluid-build . --task build",
52
51
  "build:compile": "fluid-build . --task compile",
53
- "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
54
- "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
52
+ "build:docs": "api-extractor run --local",
53
+ "ci:build:docs": "api-extractor run",
55
54
  "clean": "rimraf --glob 'dist' 'lib' '*.tsbuildinfo' '*.build.log' '_api-extractor-temp'",
56
55
  "eslint": "eslint --format stylish src",
57
56
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
@@ -27,7 +27,10 @@ export class FluidFetchReader
27
27
  {
28
28
  protected docTree: api.ISnapshotTree | null = null;
29
29
 
30
- constructor(private readonly path: string, private readonly versionName?: string) {
30
+ constructor(
31
+ private readonly path: string,
32
+ private readonly versionName?: string,
33
+ ) {
31
34
  super();
32
35
  }
33
36
 
@@ -35,6 +38,7 @@ export class FluidFetchReader
35
38
  * Read the file and returns the snapshot tree.
36
39
  * @param version - The version contains the path of the file which contains the snapshot tree.
37
40
  */
41
+ // eslint-disable-next-line @rushstack/no-new-null
38
42
  public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {
39
43
  assert(version !== null, 0x092 /* "version input for reading snapshot tree is null!" */);
40
44
  assert(
@@ -74,9 +78,10 @@ export class FluidFetchReader
74
78
  * @param versionId - version ID.
75
79
  * @param count - Number of versions to be returned.
76
80
  */
81
+ // eslint-disable-next-line @rushstack/no-new-null
77
82
  public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {
78
83
  if (versionId === FileStorageDocumentName || versionId === null) {
79
- if (this.docTree || this.versionName !== undefined) {
84
+ if (this.docTree !== null || this.versionName !== undefined) {
80
85
  return [{ id: "latest", treeId: FileStorageVersionTreeId }];
81
86
  }
82
87
  // Started with ops - return empty set.
@@ -136,6 +141,7 @@ export const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(
136
141
  return super.readBlob(sha);
137
142
  }
138
143
 
144
+ // eslint-disable-next-line @rushstack/no-new-null
139
145
  public async getVersions(versionId: string | null, count: number): Promise<api.IVersion[]> {
140
146
  // If we already saved document, that means we are getting here because of snapshot generation.
141
147
  // Not returning tree ensures that ContainerRuntime.snapshot() would regenerate subtrees for
@@ -153,6 +159,7 @@ export const FileSnapshotWriterClassFactory = <TBase extends ReaderConstructor>(
153
159
  return super.getVersions(versionId, count);
154
160
  }
155
161
 
162
+ // eslint-disable-next-line @rushstack/no-new-null
156
163
  public async getSnapshotTree(version?: api.IVersion): Promise<api.ISnapshotTree | null> {
157
164
  if (this.latestWriterTree && (!version || version.id === "latest")) {
158
165
  return this.latestWriterTree;