@fluidframework/shared-summary-block 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277

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 (85) hide show
  1. package/.eslintrc.js +5 -7
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +135 -0
  4. package/README.md +22 -1
  5. package/api-extractor-esm.json +4 -0
  6. package/api-extractor-lint.json +4 -0
  7. package/api-extractor.json +2 -2
  8. package/api-report/shared-summary-block.api.md +62 -0
  9. package/dist/index.cjs +12 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.ts +3 -3
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/{interfaces.js → interfaces.cjs} +1 -1
  14. package/dist/interfaces.cjs.map +1 -0
  15. package/dist/interfaces.d.ts +4 -0
  16. package/dist/interfaces.d.ts.map +1 -1
  17. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  18. package/dist/packageVersion.cjs.map +1 -0
  19. package/dist/packageVersion.d.ts +1 -1
  20. package/dist/packageVersion.d.ts.map +1 -1
  21. package/dist/shared-summary-block-alpha.d.ts +100 -0
  22. package/dist/shared-summary-block-beta.d.ts +21 -0
  23. package/dist/shared-summary-block-public.d.ts +21 -0
  24. package/dist/shared-summary-block-untrimmed.d.ts +131 -0
  25. package/dist/{sharedSummaryBlock.js → sharedSummaryBlock.cjs} +18 -17
  26. package/dist/sharedSummaryBlock.cjs.map +1 -0
  27. package/dist/sharedSummaryBlock.d.ts +1 -0
  28. package/dist/sharedSummaryBlock.d.ts.map +1 -1
  29. package/dist/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.cjs} +5 -3
  30. package/dist/sharedSummaryBlockFactory.cjs.map +1 -0
  31. package/dist/sharedSummaryBlockFactory.d.ts +2 -0
  32. package/dist/sharedSummaryBlockFactory.d.ts.map +1 -1
  33. package/dist/tsdoc-metadata.json +11 -0
  34. package/lib/index.d.mts +8 -0
  35. package/lib/index.d.mts.map +1 -0
  36. package/lib/index.mjs +7 -0
  37. package/lib/index.mjs.map +1 -0
  38. package/lib/{interfaces.d.ts → interfaces.d.mts} +5 -1
  39. package/lib/interfaces.d.mts.map +1 -0
  40. package/lib/{interfaces.js → interfaces.mjs} +1 -1
  41. package/lib/interfaces.mjs.map +1 -0
  42. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  43. package/lib/packageVersion.d.mts.map +1 -0
  44. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  45. package/lib/packageVersion.mjs.map +1 -0
  46. package/lib/shared-summary-block-alpha.d.mts +100 -0
  47. package/lib/shared-summary-block-beta.d.mts +21 -0
  48. package/lib/shared-summary-block-public.d.mts +21 -0
  49. package/lib/shared-summary-block-untrimmed.d.mts +131 -0
  50. package/lib/{sharedSummaryBlock.d.ts → sharedSummaryBlock.d.mts} +3 -2
  51. package/lib/sharedSummaryBlock.d.mts.map +1 -0
  52. package/lib/{sharedSummaryBlock.js → sharedSummaryBlock.mjs} +18 -17
  53. package/lib/sharedSummaryBlock.mjs.map +1 -0
  54. package/lib/{sharedSummaryBlockFactory.d.ts → sharedSummaryBlockFactory.d.mts} +3 -1
  55. package/lib/sharedSummaryBlockFactory.d.mts.map +1 -0
  56. package/lib/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.mjs} +5 -3
  57. package/lib/sharedSummaryBlockFactory.mjs.map +1 -0
  58. package/package.json +133 -62
  59. package/prettier.config.cjs +8 -0
  60. package/src/index.ts +3 -3
  61. package/src/interfaces.ts +16 -12
  62. package/src/packageVersion.ts +1 -1
  63. package/src/sharedSummaryBlock.ts +92 -88
  64. package/src/sharedSummaryBlockFactory.ts +56 -51
  65. package/tsc-multi.test.json +4 -0
  66. package/tsconfig.json +11 -13
  67. package/dist/index.js +0 -20
  68. package/dist/index.js.map +0 -1
  69. package/dist/interfaces.js.map +0 -1
  70. package/dist/packageVersion.js.map +0 -1
  71. package/dist/sharedSummaryBlock.js.map +0 -1
  72. package/dist/sharedSummaryBlockFactory.js.map +0 -1
  73. package/lib/index.d.ts +0 -8
  74. package/lib/index.d.ts.map +0 -1
  75. package/lib/index.js +0 -8
  76. package/lib/index.js.map +0 -1
  77. package/lib/interfaces.d.ts.map +0 -1
  78. package/lib/interfaces.js.map +0 -1
  79. package/lib/packageVersion.d.ts.map +0 -1
  80. package/lib/packageVersion.js.map +0 -1
  81. package/lib/sharedSummaryBlock.d.ts.map +0 -1
  82. package/lib/sharedSummaryBlock.js.map +0 -1
  83. package/lib/sharedSummaryBlockFactory.d.ts.map +0 -1
  84. package/lib/sharedSummaryBlockFactory.js.map +0 -1
  85. package/tsconfig.esnext.json +0 -7
@@ -6,7 +6,9 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
6
6
  import { ISharedObject } from "@fluidframework/shared-object-base";
7
7
  /**
8
8
  * The factory that defines the shared summary block.
9
+ *
9
10
  * @sealed
11
+ * @internal
10
12
  */
11
13
  export declare class SharedSummaryBlockFactory implements IChannelFactory {
12
14
  /**
@@ -34,4 +36,4 @@ export declare class SharedSummaryBlockFactory implements IChannelFactory {
34
36
  */
35
37
  create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject;
36
38
  }
37
- //# sourceMappingURL=sharedSummaryBlockFactory.d.ts.map
39
+ //# sourceMappingURL=sharedSummaryBlockFactory.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.mts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
@@ -2,11 +2,13 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { pkgVersion } from "./packageVersion";
6
- import { SharedSummaryBlock } from "./sharedSummaryBlock";
5
+ import { pkgVersion } from "./packageVersion.mjs";
6
+ import { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
7
7
  /**
8
8
  * The factory that defines the shared summary block.
9
+ *
9
10
  * @sealed
11
+ * @internal
10
12
  */
11
13
  export class SharedSummaryBlockFactory {
12
14
  /**
@@ -50,4 +52,4 @@ SharedSummaryBlockFactory.Attributes = {
50
52
  snapshotFormatVersion: "0.1",
51
53
  packageVersion: pkgVersion,
52
54
  };
53
- //# sourceMappingURL=sharedSummaryBlockFactory.js.map
55
+ //# sourceMappingURL=sharedSummaryBlockFactory.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OASI,EAAE,UAAU,EAAE;OACd,EAAE,kBAAkB,EAAE;AAE7B;;;;;GAKG;AACH,MAAM,OAAO,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAvDD;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,UAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @internal\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluidframework/shared-summary-block",
3
- "version": "1.4.0-121020",
3
+ "version": "2.0.0-dev-rc.1.0.0.225277",
4
4
  "description": "A DDS that does not generate ops but is part of summary",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -11,45 +11,72 @@
11
11
  "license": "MIT",
12
12
  "author": "Microsoft and contributors",
13
13
  "sideEffects": false,
14
- "main": "dist/index.js",
15
- "module": "lib/index.js",
16
- "types": "dist/index.d.ts",
17
- "scripts": {
18
- "build": "npm run build:genver && concurrently npm:build:compile npm:lint && npm run build:docs",
19
- "build:commonjs": "npm run tsc && npm run typetests:gen && npm run build:test",
20
- "build:compile": "concurrently npm:build:commonjs npm:build:esnext",
21
- "build:compile:min": "npm run build:compile",
22
- "build:docs": "api-extractor run --local --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/doc-models/* ../../../_api-extractor-temp/",
23
- "build:esnext": "tsc --project ./tsconfig.esnext.json",
24
- "build:full": "npm run build",
25
- "build:full:compile": "npm run build:compile",
26
- "build:genver": "gen-version",
27
- "build:test": "tsc --project ./src/test/tsconfig.json",
28
- "ci:build:docs": "api-extractor run --typescript-compiler-folder ../../../node_modules/typescript && copyfiles -u 1 ./_api-extractor-temp/* ../../../_api-extractor-temp/",
29
- "clean": "rimraf dist lib *.tsbuildinfo *.build.log",
30
- "eslint": "eslint --format stylish src",
31
- "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
32
- "lint": "npm run eslint",
33
- "lint:fix": "npm run eslint:fix",
34
- "test": "npm run test:mocha",
35
- "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
36
- "test:mocha": "mocha --ignore 'dist/test/types/*' --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup --unhandled-rejections=strict",
37
- "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
38
- "tsc": "tsc",
39
- "typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
40
- "typetests:prepare": "flub generate typetests --prepare --dir . --pin"
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./lib/index.d.mts",
18
+ "default": "./lib/index.mjs"
19
+ },
20
+ "require": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.cjs"
23
+ }
24
+ },
25
+ "./alpha": {
26
+ "import": {
27
+ "types": "./lib/shared-summary-block-alpha.d.mts",
28
+ "default": "./lib/index.mjs"
29
+ },
30
+ "require": {
31
+ "types": "./dist/shared-summary-block-alpha.d.ts",
32
+ "default": "./dist/index.cjs"
33
+ }
34
+ },
35
+ "./beta": {
36
+ "import": {
37
+ "types": "./lib/shared-summary-block-beta.d.mts",
38
+ "default": "./lib/index.mjs"
39
+ },
40
+ "require": {
41
+ "types": "./dist/shared-summary-block-beta.d.ts",
42
+ "default": "./dist/index.cjs"
43
+ }
44
+ },
45
+ "./internal": {
46
+ "import": {
47
+ "types": "./lib/index.d.mts",
48
+ "default": "./lib/index.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/index.d.ts",
52
+ "default": "./dist/index.cjs"
53
+ }
54
+ },
55
+ "./public": {
56
+ "import": {
57
+ "types": "./lib/shared-summary-block-public.d.mts",
58
+ "default": "./lib/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./dist/shared-summary-block-public.d.ts",
62
+ "default": "./dist/index.cjs"
63
+ }
64
+ }
41
65
  },
42
- "nyc": {
66
+ "main": "dist/index.cjs",
67
+ "module": "lib/index.mjs",
68
+ "types": "dist/index.d.ts",
69
+ "c8": {
43
70
  "all": true,
44
71
  "cache-dir": "nyc/.cache",
45
72
  "exclude": [
46
- "src/test/**/*.ts",
47
- "dist/test/**/*.js"
73
+ "src/test/**/*.*ts",
74
+ "dist/test/**/*.*js"
48
75
  ],
49
76
  "exclude-after-remap": false,
50
77
  "include": [
51
- "src/**/*.ts",
52
- "dist/**/*.js"
78
+ "src/**/*.*ts",
79
+ "dist/**/*.*js"
53
80
  ],
54
81
  "report-dir": "nyc/report",
55
82
  "reporter": [
@@ -60,41 +87,85 @@
60
87
  "temp-directory": "nyc/.nyc_output"
61
88
  },
62
89
  "dependencies": {
63
- "@fluidframework/common-utils": "^0.32.1",
64
- "@fluidframework/core-interfaces": "1.4.0-121020",
65
- "@fluidframework/datastore-definitions": "1.4.0-121020",
66
- "@fluidframework/driver-utils": "1.4.0-121020",
67
- "@fluidframework/protocol-definitions": "^0.1028.2000",
68
- "@fluidframework/runtime-definitions": "1.4.0-121020",
69
- "@fluidframework/shared-object-base": "1.4.0-121020"
90
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.225277",
91
+ "@fluidframework/datastore-definitions": "2.0.0-dev-rc.1.0.0.225277",
92
+ "@fluidframework/driver-utils": "2.0.0-dev-rc.1.0.0.225277",
93
+ "@fluidframework/protocol-definitions": "^3.1.0-223007",
94
+ "@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.225277",
95
+ "@fluidframework/shared-object-base": "2.0.0-dev-rc.1.0.0.225277"
70
96
  },
71
97
  "devDependencies": {
72
- "@fluidframework/build-common": "^0.24.0",
73
- "@fluidframework/build-tools": "^0.6.0-110101",
74
- "@fluidframework/eslint-config-fluid": "^0.28.2000",
75
- "@fluidframework/mocha-test-setup": "1.4.0-121020",
76
- "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@1.3.1",
77
- "@fluidframework/test-runtime-utils": "1.4.0-121020",
78
- "@microsoft/api-extractor": "^7.22.2",
79
- "@rushstack/eslint-config": "^2.5.1",
98
+ "@arethetypeswrong/cli": "^0.13.3",
99
+ "@fluid-tools/build-cli": "0.29.0-222379",
100
+ "@fluidframework/build-common": "^2.0.3",
101
+ "@fluidframework/build-tools": "0.29.0-222379",
102
+ "@fluidframework/eslint-config-fluid": "^3.1.0",
103
+ "@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.225277",
104
+ "@fluidframework/shared-summary-block-previous": "npm:@fluidframework/shared-summary-block@2.0.0-internal.8.0.0",
105
+ "@fluidframework/test-runtime-utils": "2.0.0-dev-rc.1.0.0.225277",
106
+ "@microsoft/api-extractor": "^7.38.3",
80
107
  "@types/benchmark": "^2.1.0",
81
108
  "@types/mocha": "^9.1.1",
82
- "@types/node": "^14.18.0",
109
+ "@types/node": "^18.19.0",
83
110
  "benchmark": "^2.1.4",
84
- "concurrently": "^6.2.0",
85
- "copyfiles": "^2.1.0",
86
- "cross-env": "^7.0.2",
87
- "eslint": "~8.6.0",
88
- "mocha": "^10.0.0",
89
- "nyc": "^15.0.0",
90
- "rimraf": "^2.6.2",
91
- "typescript": "~4.5.5",
92
- "typescript-formatter": "7.1.0"
111
+ "c8": "^8.0.1",
112
+ "copyfiles": "^2.4.1",
113
+ "cross-env": "^7.0.3",
114
+ "eslint": "~8.50.0",
115
+ "mocha": "^10.2.0",
116
+ "mocha-json-output-reporter": "^2.0.1",
117
+ "mocha-multi-reporters": "^1.5.1",
118
+ "moment": "^2.21.0",
119
+ "prettier": "~3.0.3",
120
+ "replace-in-file": "^6.3.5",
121
+ "rimraf": "^4.4.0",
122
+ "tsc-multi": "^1.1.0",
123
+ "typescript": "~5.1.6"
124
+ },
125
+ "fluidBuild": {
126
+ "tasks": {
127
+ "build:docs": {
128
+ "dependsOn": [
129
+ "...",
130
+ "api-extractor:commonjs",
131
+ "api-extractor:esnext"
132
+ ],
133
+ "script": false
134
+ }
135
+ }
93
136
  },
94
137
  "typeValidation": {
95
- "version": "1.4.0",
96
- "baselineRange": "~1.3.0",
97
- "baselineVersion": "1.3.1",
98
138
  "broken": {}
139
+ },
140
+ "scripts": {
141
+ "api": "fluid-build . --task api",
142
+ "api-extractor:commonjs": "api-extractor run --local",
143
+ "api-extractor:esnext": "api-extractor run --config ./api-extractor-esm.json",
144
+ "build": "fluid-build . --task build",
145
+ "build:commonjs": "fluid-build . --task commonjs",
146
+ "build:compile": "fluid-build . --task compile",
147
+ "build:compile:min": "npm run build:compile",
148
+ "build:docs": "fluid-build . --task api",
149
+ "build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
150
+ "build:genver": "gen-version",
151
+ "build:test": "tsc-multi --config ./tsc-multi.test.json",
152
+ "check:are-the-types-wrong": "attw --pack . --entrypoints .",
153
+ "check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
154
+ "ci:build:docs": "api-extractor run",
155
+ "clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
156
+ "eslint": "eslint --format stylish src",
157
+ "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
158
+ "format": "npm run prettier:fix",
159
+ "lint": "npm run prettier && npm run check:release-tags && npm run eslint",
160
+ "lint:fix": "npm run prettier:fix && npm run eslint:fix",
161
+ "prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
162
+ "prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
163
+ "test": "npm run test:mocha",
164
+ "test:coverage": "c8 npm test",
165
+ "test:mocha": "mocha --ignore \"dist/test/types/*\" --recursive dist/test -r node_modules/@fluidframework/mocha-test-setup",
166
+ "test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
167
+ "tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
168
+ "typetests:gen": "fluid-type-test-generator",
169
+ "typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
99
170
  }
100
- }
171
+ }
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ module.exports = {
7
+ ...require("@fluidframework/build-common/prettier.config.cjs"),
8
+ };
package/src/index.ts CHANGED
@@ -3,6 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- export * from "./interfaces";
7
- export * from "./sharedSummaryBlock";
8
- export * from "./sharedSummaryBlockFactory";
6
+ export { ISharedSummaryBlock } from "./interfaces";
7
+ export { SharedSummaryBlock } from "./sharedSummaryBlock";
8
+ export { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
package/src/interfaces.ts CHANGED
@@ -11,19 +11,23 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
11
11
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
12
12
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
13
13
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
14
+ * @alpha
14
15
  */
15
16
  export interface ISharedSummaryBlock extends ISharedObject {
16
- /**
17
- * Retrieves the given key from the map.
18
- * @param key - Key to retrieve from.
19
- * @returns The stored value, or undefined if the key is not set.
20
- */
21
- get<T>(key: string): Jsonable<T>;
17
+ /**
18
+ * Retrieves the given key from the map.
19
+ * @param key - Key to retrieve from.
20
+ * @returns The stored value, or undefined if the key is not set.
21
+ *
22
+ * @privateRemarks
23
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
24
+ */
25
+ get<T>(key: string): Jsonable<T>;
22
26
 
23
- /**
24
- * Sets the value stored at key to the provided value.
25
- * @param key - Key to set at.
26
- * @param value - Jsonable type value to set.
27
- */
28
- set<T>(key: string, value: Jsonable<T>): void;
27
+ /**
28
+ * Sets the value stored at key to the provided value.
29
+ * @param key - Key to set at.
30
+ * @param value - Jsonable type value to set.
31
+ */
32
+ set<T>(key: string, value: Jsonable<T>): void;
29
33
  }
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/shared-summary-block";
9
- export const pkgVersion = "1.4.0-121020";
9
+ export const pkgVersion = "2.0.0-dev-rc.1.0.0.225277";
@@ -5,18 +5,18 @@
5
5
 
6
6
  import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
7
7
  import {
8
- IChannelAttributes,
9
- IFluidDataStoreRuntime,
10
- IChannelStorageService,
11
- Jsonable,
12
- IChannelFactory,
8
+ IChannelAttributes,
9
+ IFluidDataStoreRuntime,
10
+ IChannelStorageService,
11
+ Jsonable,
12
+ IChannelFactory,
13
13
  } from "@fluidframework/datastore-definitions";
14
14
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
15
15
  import { readAndParse } from "@fluidframework/driver-utils";
16
16
  import {
17
- createSingleBlobSummary,
18
- IFluidSerializer,
19
- SharedObject,
17
+ createSingleBlobSummary,
18
+ IFluidSerializer,
19
+ SharedObject,
20
20
  } from "@fluidframework/shared-object-base";
21
21
  import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
22
22
  import { ISharedSummaryBlock } from "./interfaces";
@@ -28,101 +28,105 @@ const snapshotFileName = "header";
28
28
  * Directly used in JSON.stringify, direct result from JSON.parse.
29
29
  */
30
30
  interface ISharedSummaryBlockDataSerializable {
31
- [key: string]: Jsonable;
31
+ [key: string]: Jsonable<unknown>;
32
32
  }
33
33
 
34
34
  /**
35
35
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
36
36
  * Data should be set in this object in response to a remote op.
37
+ * @alpha
37
38
  */
38
39
  export class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
39
- /**
40
- * Create a new shared summary block
41
- *
42
- * @param runtime - data store runtime the new shared summary block belongs to.
43
- * @param id - optional name of the shared summary block.
44
- * @returns newly created shared summary block (but not attached yet).
45
- */
46
- public static create(runtime: IFluidDataStoreRuntime, id?: string) {
47
- return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;
48
- }
40
+ /**
41
+ * Create a new shared summary block
42
+ *
43
+ * @param runtime - data store runtime the new shared summary block belongs to.
44
+ * @param id - optional name of the shared summary block.
45
+ * @returns newly created shared summary block (but not attached yet).
46
+ */
47
+ public static create(runtime: IFluidDataStoreRuntime, id?: string) {
48
+ return runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;
49
+ }
49
50
 
50
- /**
51
- * Get a factory for SharedSummaryBlock to register with the data store.
52
- *
53
- * @returns a factory that creates and loads SharedSummaryBlock.
54
- */
55
- public static getFactory(): IChannelFactory {
56
- return new SharedSummaryBlockFactory();
57
- }
51
+ /**
52
+ * Get a factory for SharedSummaryBlock to register with the data store.
53
+ *
54
+ * @returns a factory that creates and loads SharedSummaryBlock.
55
+ */
56
+ public static getFactory(): IChannelFactory {
57
+ return new SharedSummaryBlockFactory();
58
+ }
58
59
 
59
- /**
60
- * The data held by this object.
61
- */
62
- private readonly data = new Map<string, Jsonable>();
60
+ /**
61
+ * The data held by this object.
62
+ */
63
+ private readonly data = new Map<string, Jsonable<unknown>>();
63
64
 
64
- /**
65
- * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
66
- * be provided.
67
- *
68
- * @param id - optional name of the shared summary block.
69
- * @param runtime - data store runtime thee object belongs to.
70
- * @param attributes - The attributes for the object.
71
- */
72
- constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
73
- super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
74
- }
65
+ /**
66
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
67
+ * be provided.
68
+ *
69
+ * @param id - optional name of the shared summary block.
70
+ * @param runtime - data store runtime thee object belongs to.
71
+ * @param attributes - The attributes for the object.
72
+ */
73
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {
74
+ super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
75
+ }
75
76
 
76
- /**
77
- * {@inheritDoc ISharedSummaryBlock.get}
78
- */
79
- public get<T>(key: string): Jsonable<T> {
80
- return this.data.get(key) as Jsonable<T>;
81
- }
77
+ /**
78
+ * {@inheritDoc ISharedSummaryBlock.get}
79
+ */
80
+ public get<T>(key: string): Jsonable<T> {
81
+ return this.data.get(key) as Jsonable<T>;
82
+ }
82
83
 
83
- /**
84
- * {@inheritDoc ISharedSummaryBlock.set}
85
- */
86
- public set<T>(key: string, value: Jsonable<T>): void {
87
- this.data.set(key, value);
88
- // Set this object as dirty so that it is part of the next summary.
89
- this.dirty();
90
- }
84
+ /**
85
+ * {@inheritDoc ISharedSummaryBlock.set}
86
+ */
87
+ public set<T>(key: string, value: Jsonable<T>): void {
88
+ this.data.set(key, value);
89
+ // Set this object as dirty so that it is part of the next summary.
90
+ this.dirty();
91
+ }
91
92
 
92
- /**
93
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
94
- */
95
- protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {
96
- const contentsBlob: ISharedSummaryBlockDataSerializable = {};
97
- this.data.forEach((value, key) => {
98
- contentsBlob[key] = value;
99
- });
100
- return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
101
- }
93
+ /**
94
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
95
+ */
96
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {
97
+ const contentsBlob: ISharedSummaryBlockDataSerializable = {};
98
+ this.data.forEach((value, key) => {
99
+ contentsBlob[key] = value;
100
+ });
101
+ return createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));
102
+ }
102
103
 
103
- /**
104
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
105
- */
106
- protected async loadCore(storage: IChannelStorageService): Promise<void> {
107
- const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(storage, snapshotFileName);
108
- for (const [key, value] of Object.entries(contents)) {
109
- this.data.set(key, value);
110
- }
111
- }
104
+ /**
105
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
106
+ */
107
+ protected async loadCore(storage: IChannelStorageService): Promise<void> {
108
+ const contents = await readAndParse<ISharedSummaryBlockDataSerializable>(
109
+ storage,
110
+ snapshotFileName,
111
+ );
112
+ for (const [key, value] of Object.entries(contents)) {
113
+ this.data.set(key, value);
114
+ }
115
+ }
112
116
 
113
- /**
114
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
115
- */
116
- protected onDisconnect() { }
117
+ /**
118
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
119
+ */
120
+ protected onDisconnect() {}
117
121
 
118
- /**
119
- * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
120
- */
121
- protected processCore(message: ISequencedDocumentMessage, local: boolean) {
122
- throw new Error("shared summary block should not generate any ops.");
123
- }
122
+ /**
123
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
124
+ */
125
+ protected processCore(message: ISequencedDocumentMessage, local: boolean) {
126
+ throw new Error("shared summary block should not generate any ops.");
127
+ }
124
128
 
125
- protected applyStashedOp() {
126
- throw new Error("not implemented");
127
- }
129
+ protected applyStashedOp() {
130
+ throw new Error("not implemented");
131
+ }
128
132
  }