@fluidframework/fluid-static 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419
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/.eslintrc.js +8 -10
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +225 -53
- package/README.md +38 -0
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/fluid-static.api.md +141 -0
- package/dist/fluid-static-alpha.d.ts +408 -0
- package/dist/fluid-static-beta.d.ts +412 -0
- package/dist/fluid-static-public.d.ts +412 -0
- package/dist/fluid-static-untrimmed.d.ts +452 -0
- package/dist/{fluidContainer.js → fluidContainer.cjs} +39 -12
- package/dist/fluidContainer.cjs.map +1 -0
- package/dist/fluidContainer.d.ts +95 -142
- package/dist/fluidContainer.d.ts.map +1 -1
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/{rootDataObject.js → rootDataObject.cjs} +59 -23
- package/dist/rootDataObject.cjs.map +1 -0
- package/dist/rootDataObject.d.ts +9 -59
- package/dist/rootDataObject.d.ts.map +1 -1
- package/dist/{serviceAudience.js → serviceAudience.cjs} +44 -20
- package/dist/serviceAudience.cjs.map +1 -0
- package/dist/serviceAudience.d.ts +7 -54
- package/dist/serviceAudience.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/dist/{types.js → types.cjs} +1 -1
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +130 -80
- package/dist/types.d.ts.map +1 -1
- package/dist/{utils.js → utils.cjs} +7 -9
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.ts +10 -2
- package/dist/utils.d.ts.map +1 -1
- package/lib/fluid-static-alpha.d.mts +408 -0
- package/lib/fluid-static-beta.d.mts +412 -0
- package/lib/fluid-static-public.d.mts +412 -0
- package/lib/fluid-static-untrimmed.d.mts +452 -0
- package/lib/fluidContainer.d.mts +188 -0
- package/lib/fluidContainer.d.mts.map +1 -0
- package/lib/{fluidContainer.js → fluidContainer.mjs} +36 -13
- package/lib/fluidContainer.mjs.map +1 -0
- package/lib/index.d.mts +9 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +8 -0
- package/lib/index.mjs.map +1 -0
- package/lib/rootDataObject.d.mts +20 -0
- package/lib/rootDataObject.d.mts.map +1 -0
- package/lib/{rootDataObject.js → rootDataObject.mjs} +61 -28
- package/lib/rootDataObject.mjs.map +1 -0
- package/lib/serviceAudience.d.mts +15 -0
- package/lib/serviceAudience.d.mts.map +1 -0
- package/lib/{serviceAudience.js → serviceAudience.mjs} +42 -18
- package/lib/serviceAudience.mjs.map +1 -0
- package/lib/types.d.mts +223 -0
- package/lib/types.d.mts.map +1 -0
- package/lib/{types.js → types.mjs} +1 -1
- package/lib/types.mjs.map +1 -0
- package/lib/{utils.d.ts → utils.d.mts} +11 -3
- package/lib/utils.d.mts.map +1 -0
- package/lib/{utils.js → utils.mjs} +7 -9
- package/lib/utils.mjs.map +1 -0
- package/package.json +130 -61
- package/prettier.config.cjs +8 -0
- package/src/fluidContainer.ts +316 -250
- package/src/index.ts +25 -4
- package/src/rootDataObject.ts +203 -157
- package/src/serviceAudience.ts +152 -124
- package/src/types.ts +190 -132
- package/src/utils.ts +44 -39
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +12 -16
- package/dist/fluidContainer.js.map +0 -1
- package/dist/index.js +0 -26
- package/dist/index.js.map +0 -1
- package/dist/rootDataObject.js.map +0 -1
- package/dist/serviceAudience.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.js.map +0 -1
- package/lib/fluidContainer.d.ts +0 -235
- package/lib/fluidContainer.d.ts.map +0 -1
- package/lib/fluidContainer.js.map +0 -1
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -14
- package/lib/index.js.map +0 -1
- package/lib/rootDataObject.d.ts +0 -70
- package/lib/rootDataObject.d.ts.map +0 -1
- package/lib/rootDataObject.js.map +0 -1
- package/lib/serviceAudience.d.ts +0 -62
- package/lib/serviceAudience.d.ts.map +0 -1
- package/lib/serviceAudience.js.map +0 -1
- package/lib/types.d.ts +0 -173
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/lib/utils.js.map +0 -1
- package/tsconfig.esnext.json +0 -7
package/lib/types.d.mts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { IEvent, IEventProvider, IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
7
|
+
/**
|
|
8
|
+
* A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export type LoadableObjectRecord = Record<string, IFluidLoadable>;
|
|
12
|
+
/**
|
|
13
|
+
* A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`
|
|
14
|
+
* or `SharedObject` in a {@link LoadableObjectRecord}.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;
|
|
18
|
+
/**
|
|
19
|
+
* A class object of `DataObject` or `SharedObject`.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam T - The class of the `DataObject` or `SharedObject`.
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export type LoadableObjectClass<T extends IFluidLoadable> = DataObjectClass<T> | SharedObjectClass<T>;
|
|
25
|
+
/**
|
|
26
|
+
* A class that has a factory that can create a `DataObject` and a
|
|
27
|
+
* constructor that will return the type of the `DataObject`.
|
|
28
|
+
*
|
|
29
|
+
* @typeParam T - The class of the `DataObject`.
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
export type DataObjectClass<T extends IFluidLoadable> = {
|
|
33
|
+
readonly factory: {
|
|
34
|
+
IFluidDataStoreFactory: DataObjectClass<T>["factory"];
|
|
35
|
+
};
|
|
36
|
+
} & LoadableObjectCtor<T>;
|
|
37
|
+
/**
|
|
38
|
+
* A class that has a factory that can create a DDSes (`SharedObject`s) and a
|
|
39
|
+
* constructor that will return the type of the `DataObject`.
|
|
40
|
+
*
|
|
41
|
+
* @typeParam T - The class of the `SharedObject`.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export type SharedObjectClass<T extends IFluidLoadable> = {
|
|
45
|
+
readonly getFactory: () => IChannelFactory;
|
|
46
|
+
} & LoadableObjectCtor<T>;
|
|
47
|
+
/**
|
|
48
|
+
* An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.
|
|
49
|
+
*
|
|
50
|
+
* @typeParam T - The class of the loadable object.
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;
|
|
54
|
+
/**
|
|
55
|
+
* Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
*
|
|
59
|
+
* It includes both the instances of objects that are initially available upon `Container` creation, as well
|
|
60
|
+
* as the types of objects that may be dynamically created throughout the lifetime of the `Container`.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface ContainerSchema {
|
|
64
|
+
/**
|
|
65
|
+
* Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.
|
|
66
|
+
*
|
|
67
|
+
* @remarks It uses the key as the id and the value as the loadable object to create.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
*
|
|
71
|
+
* In the example below two objects will be created when the `Container` is first
|
|
72
|
+
* created. One with id "map1" that will return a `SharedMap` and the other with
|
|
73
|
+
* id "pair1" that will return a `KeyValueDataObject`.
|
|
74
|
+
*
|
|
75
|
+
* ```typescript
|
|
76
|
+
* {
|
|
77
|
+
* map1: SharedMap,
|
|
78
|
+
* pair1: KeyValueDataObject,
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
initialObjects: LoadableObjectClassRecord;
|
|
83
|
+
/**
|
|
84
|
+
* Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
*
|
|
88
|
+
* Types defined in `initialObjects` will always be available and are not required to be provided here.
|
|
89
|
+
*
|
|
90
|
+
* For best practice it's recommended to define all the dynamic types you create even if they are
|
|
91
|
+
* included via initialObjects.
|
|
92
|
+
*/
|
|
93
|
+
dynamicObjectTypes?: LoadableObjectClass<any>[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
export interface IProvideRootDataObject {
|
|
99
|
+
readonly IRootDataObject: IRootDataObject;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Holds the collection of objects that the container was initially created with, as well as provides the ability
|
|
103
|
+
* to dynamically create further objects during usage.
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
export interface IRootDataObject extends IProvideRootDataObject {
|
|
107
|
+
/**
|
|
108
|
+
* Provides a record of the initial objects defined on creation.
|
|
109
|
+
*/
|
|
110
|
+
readonly initialObjects: LoadableObjectRecord;
|
|
111
|
+
/**
|
|
112
|
+
* Dynamically creates a new detached collaborative object (DDS/DataObject).
|
|
113
|
+
*
|
|
114
|
+
* @param objectClass - Type of the collaborative object to be created.
|
|
115
|
+
*
|
|
116
|
+
* @typeParam T - The class of the `DataObject` or `SharedObject`.
|
|
117
|
+
*/
|
|
118
|
+
create<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Signature for {@link IMember} change events.
|
|
122
|
+
*
|
|
123
|
+
* @param clientId - A unique identifier for the client.
|
|
124
|
+
* @param member - The service-specific member object for the client.
|
|
125
|
+
*
|
|
126
|
+
* @see See {@link IServiceAudienceEvents} for usage details.
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Events that trigger when the roster of members in the Fluid session change.
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
*
|
|
135
|
+
* Only changes that would be reflected in the returned map of {@link IServiceAudience}'s
|
|
136
|
+
* {@link IServiceAudience.getMembers} method will emit events.
|
|
137
|
+
*
|
|
138
|
+
* @typeParam M - A service-specific {@link IMember} implementation.
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export interface IServiceAudienceEvents<M extends IMember> extends IEvent {
|
|
142
|
+
/**
|
|
143
|
+
* Emitted when a {@link IMember | member}(s) are either added or removed.
|
|
144
|
+
*
|
|
145
|
+
* @eventProperty
|
|
146
|
+
*/
|
|
147
|
+
(event: "membersChanged", listener: () => void): void;
|
|
148
|
+
/**
|
|
149
|
+
* Emitted when a {@link IMember | member} joins the audience.
|
|
150
|
+
*
|
|
151
|
+
* @eventProperty
|
|
152
|
+
*/
|
|
153
|
+
(event: "memberAdded", listener: MemberChangedListener<M>): void;
|
|
154
|
+
/**
|
|
155
|
+
* Emitted when a {@link IMember | member} leaves the audience.
|
|
156
|
+
*
|
|
157
|
+
* @eventProperty
|
|
158
|
+
*/
|
|
159
|
+
(event: "memberRemoved", listener: MemberChangedListener<M>): void;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Base interface to be implemented to fetch each service's audience.
|
|
163
|
+
*
|
|
164
|
+
* @remarks
|
|
165
|
+
*
|
|
166
|
+
* The type parameter `M` allows consumers to further extend the client object with service-specific
|
|
167
|
+
* details about the connecting client, such as device information, environment, or a username.
|
|
168
|
+
*
|
|
169
|
+
* @typeParam M - A service-specific {@link IMember} type.
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> {
|
|
173
|
+
/**
|
|
174
|
+
* Returns an map of all users currently in the Fluid session where key is the userId and the value is the
|
|
175
|
+
* member object. The implementation may choose to exclude certain connections from the returned map.
|
|
176
|
+
* E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
|
|
177
|
+
*/
|
|
178
|
+
getMembers(): Map<string, M>;
|
|
179
|
+
/**
|
|
180
|
+
* Returns the current active user on this client once they are connected. Otherwise, returns undefined.
|
|
181
|
+
*/
|
|
182
|
+
getMyself(): Myself<M> | undefined;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Base interface for information for each connection made to the Fluid session.
|
|
186
|
+
*
|
|
187
|
+
* @remarks This interface can be extended to provide additional information specific to each service.
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
export interface IConnection {
|
|
191
|
+
/**
|
|
192
|
+
* A unique ID for the connection. A single user may have multiple connections, each with a different ID.
|
|
193
|
+
*/
|
|
194
|
+
id: string;
|
|
195
|
+
/**
|
|
196
|
+
* Whether the connection is in read or read/write mode.
|
|
197
|
+
*/
|
|
198
|
+
mode: "write" | "read";
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Base interface to be implemented to fetch each service's member.
|
|
202
|
+
*
|
|
203
|
+
* @remarks This interface can be extended by each service to provide additional service-specific user metadata.
|
|
204
|
+
* @public
|
|
205
|
+
*/
|
|
206
|
+
export interface IMember {
|
|
207
|
+
/**
|
|
208
|
+
* An ID for the user, unique among each individual user connecting to the session.
|
|
209
|
+
*/
|
|
210
|
+
userId: string;
|
|
211
|
+
/**
|
|
212
|
+
* The set of connections the user has made, e.g. from multiple tabs or devices.
|
|
213
|
+
*/
|
|
214
|
+
connections: IConnection[];
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* An extended member object that includes currentConnection
|
|
218
|
+
* @public
|
|
219
|
+
*/
|
|
220
|
+
export type Myself<M extends IMember = IMember> = M & {
|
|
221
|
+
currentConnection: string;
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider, IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\n\n/**\n * A mapping of string identifiers to instantiated `DataObject`s or `SharedObject`s.\n * @internal\n */\nexport type LoadableObjectRecord = Record<string, IFluidLoadable>;\n\n/**\n * A mapping of string identifiers to classes that will later be used to instantiate a corresponding `DataObject`\n * or `SharedObject` in a {@link LoadableObjectRecord}.\n * @public\n */\nexport type LoadableObjectClassRecord = Record<string, LoadableObjectClass<any>>;\n\n/**\n * A class object of `DataObject` or `SharedObject`.\n *\n * @typeParam T - The class of the `DataObject` or `SharedObject`.\n * @public\n */\nexport type LoadableObjectClass<T extends IFluidLoadable> =\n\t| DataObjectClass<T>\n\t| SharedObjectClass<T>;\n\n/**\n * A class that has a factory that can create a `DataObject` and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `DataObject`.\n * @public\n */\nexport type DataObjectClass<T extends IFluidLoadable> = {\n\treadonly factory: { IFluidDataStoreFactory: DataObjectClass<T>[\"factory\"] };\n} & LoadableObjectCtor<T>;\n\n/**\n * A class that has a factory that can create a DDSes (`SharedObject`s) and a\n * constructor that will return the type of the `DataObject`.\n *\n * @typeParam T - The class of the `SharedObject`.\n * @public\n */\nexport type SharedObjectClass<T extends IFluidLoadable> = {\n\treadonly getFactory: () => IChannelFactory;\n} & LoadableObjectCtor<T>;\n\n/**\n * An object with a constructor that will return an {@link @fluidframework/core-interfaces#IFluidLoadable}.\n *\n * @typeParam T - The class of the loadable object.\n * @public\n */\nexport type LoadableObjectCtor<T extends IFluidLoadable> = new (...args: any[]) => T;\n\n/**\n * Declares the Fluid objects that will be available in the {@link IFluidContainer | Container}.\n *\n * @remarks\n *\n * It includes both the instances of objects that are initially available upon `Container` creation, as well\n * as the types of objects that may be dynamically created throughout the lifetime of the `Container`.\n * @public\n */\nexport interface ContainerSchema {\n\t/**\n\t * Defines loadable objects that will be created when the {@link IFluidContainer | Container} is first created.\n\t *\n\t * @remarks It uses the key as the id and the value as the loadable object to create.\n\t *\n\t * @example\n\t *\n\t * In the example below two objects will be created when the `Container` is first\n\t * created. One with id \"map1\" that will return a `SharedMap` and the other with\n\t * id \"pair1\" that will return a `KeyValueDataObject`.\n\t *\n\t * ```typescript\n\t * {\n\t * map1: SharedMap,\n\t * pair1: KeyValueDataObject,\n\t * }\n\t * ```\n\t */\n\tinitialObjects: LoadableObjectClassRecord;\n\n\t/**\n\t * Loadable objects that can be created after the initial {@link IFluidContainer | Container} creation.\n\t *\n\t * @remarks\n\t *\n\t * Types defined in `initialObjects` will always be available and are not required to be provided here.\n\t *\n\t * For best practice it's recommended to define all the dynamic types you create even if they are\n\t * included via initialObjects.\n\t */\n\tdynamicObjectTypes?: LoadableObjectClass<any>[];\n}\n\n/**\n * @internal\n */\nexport interface IProvideRootDataObject {\n\treadonly IRootDataObject: IRootDataObject;\n}\n\n/**\n * Holds the collection of objects that the container was initially created with, as well as provides the ability\n * to dynamically create further objects during usage.\n * @internal\n */\nexport interface IRootDataObject extends IProvideRootDataObject {\n\t/**\n\t * Provides a record of the initial objects defined on creation.\n\t */\n\treadonly initialObjects: LoadableObjectRecord;\n\n\t/**\n\t * Dynamically creates a new detached collaborative object (DDS/DataObject).\n\t *\n\t * @param objectClass - Type of the collaborative object to be created.\n\t *\n\t * @typeParam T - The class of the `DataObject` or `SharedObject`.\n\t */\n\tcreate<T extends IFluidLoadable>(objectClass: LoadableObjectClass<T>): Promise<T>;\n}\n\n/**\n * Signature for {@link IMember} change events.\n *\n * @param clientId - A unique identifier for the client.\n * @param member - The service-specific member object for the client.\n *\n * @see See {@link IServiceAudienceEvents} for usage details.\n * @public\n */\nexport type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void;\n\n/**\n * Events that trigger when the roster of members in the Fluid session change.\n *\n * @remarks\n *\n * Only changes that would be reflected in the returned map of {@link IServiceAudience}'s\n * {@link IServiceAudience.getMembers} method will emit events.\n *\n * @typeParam M - A service-specific {@link IMember} implementation.\n * @public\n */\nexport interface IServiceAudienceEvents<M extends IMember> extends IEvent {\n\t/**\n\t * Emitted when a {@link IMember | member}(s) are either added or removed.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"membersChanged\", listener: () => void): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} joins the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberAdded\", listener: MemberChangedListener<M>): void;\n\n\t/**\n\t * Emitted when a {@link IMember | member} leaves the audience.\n\t *\n\t * @eventProperty\n\t */\n\t(event: \"memberRemoved\", listener: MemberChangedListener<M>): void;\n}\n\n/**\n * Base interface to be implemented to fetch each service's audience.\n *\n * @remarks\n *\n * The type parameter `M` allows consumers to further extend the client object with service-specific\n * details about the connecting client, such as device information, environment, or a username.\n *\n * @typeParam M - A service-specific {@link IMember} type.\n * @public\n */\nexport interface IServiceAudience<M extends IMember>\n\textends IEventProvider<IServiceAudienceEvents<M>> {\n\t/**\n\t * Returns an map of all users currently in the Fluid session where key is the userId and the value is the\n\t * member object. The implementation may choose to exclude certain connections from the returned map.\n\t * E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.\n\t */\n\tgetMembers(): Map<string, M>;\n\n\t/**\n\t * Returns the current active user on this client once they are connected. Otherwise, returns undefined.\n\t */\n\tgetMyself(): Myself<M> | undefined;\n}\n\n/**\n * Base interface for information for each connection made to the Fluid session.\n *\n * @remarks This interface can be extended to provide additional information specific to each service.\n * @public\n */\nexport interface IConnection {\n\t/**\n\t * A unique ID for the connection. A single user may have multiple connections, each with a different ID.\n\t */\n\tid: string;\n\n\t/**\n\t * Whether the connection is in read or read/write mode.\n\t */\n\tmode: \"write\" | \"read\";\n}\n\n/**\n * Base interface to be implemented to fetch each service's member.\n *\n * @remarks This interface can be extended by each service to provide additional service-specific user metadata.\n * @public\n */\nexport interface IMember {\n\t/**\n\t * An ID for the user, unique among each individual user connecting to the session.\n\t */\n\tuserId: string;\n\n\t/**\n\t * The set of connections the user has made, e.g. from multiple tabs or devices.\n\t */\n\tconnections: IConnection[];\n}\n\n/**\n * An extended member object that includes currentConnection\n * @public\n */\nexport type Myself<M extends IMember = IMember> = M & { currentConnection: string };\n"]}
|
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { IChannelFactory } from "@fluidframework/datastore-definitions";
|
|
6
|
-
import { NamedFluidDataStoreRegistryEntry } from "@fluidframework/runtime-definitions";
|
|
7
|
-
import {
|
|
6
|
+
import { IFluidDataStoreFactory, NamedFluidDataStoreRegistryEntry } from "@fluidframework/runtime-definitions";
|
|
7
|
+
import { IFluidLoadable } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { ContainerSchema, DataObjectClass, SharedObjectClass } from "./types.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* An internal type used by the internal type guard isDataObjectClass to cast a
|
|
11
|
+
* DataObjectClass to a type that is strongly coupled to IFluidDataStoreFactory.
|
|
12
|
+
* Unlike the external and exported type DataObjectClass which is
|
|
13
|
+
* weakly coupled to the IFluidDataStoreFactory to prevent leaking internals.
|
|
14
|
+
*/
|
|
15
|
+
export type InternalDataObjectClass<T extends IFluidLoadable> = DataObjectClass<T> & Record<"factory", IFluidDataStoreFactory>;
|
|
8
16
|
/**
|
|
9
17
|
* Runtime check to determine if a class is a DataObject type
|
|
10
18
|
*/
|
|
11
|
-
export declare const isDataObjectClass: (obj: any) => obj is
|
|
19
|
+
export declare const isDataObjectClass: (obj: any) => obj is InternalDataObjectClass<IFluidLoadable>;
|
|
12
20
|
/**
|
|
13
21
|
* Runtime check to determine if a class is a SharedObject type
|
|
14
22
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,eAAe,EAAE,MAAM,uCAAuC;OAChE,EACN,sBAAsB,EACtB,gCAAgC,EAChC,MAAM,qCAAqC;OACrC,EAAE,cAAc,EAAE,MAAM,iCAAiC;OACzD,EAAE,eAAe,EAAE,eAAe,EAAuB,iBAAiB,EAAE;AAEnF;;;;;GAKG;AACH,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI,eAAe,CAAC,CAAC,CAAC,GACjF,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAS,GAAG,mDAMzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,GAAG,kCAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,WACrC,eAAe,KACrB,CAAC,gCAAgC,EAAE,EAAE,eAAe,EAAE,CA0BxD,CAAC"}
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* Runtime check to determine if a class is a DataObject type
|
|
7
7
|
*/
|
|
8
8
|
export const isDataObjectClass = (obj) => {
|
|
9
|
-
|
|
9
|
+
const maybe = obj;
|
|
10
|
+
return (maybe?.factory?.IFluidDataStoreFactory !== undefined &&
|
|
11
|
+
maybe?.factory?.IFluidDataStoreFactory === maybe?.factory);
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* Runtime check to determine if a class is a SharedObject type
|
|
13
15
|
*/
|
|
14
16
|
export const isSharedObjectClass = (obj) => {
|
|
15
|
-
return
|
|
17
|
+
return obj?.getFactory !== undefined;
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* The ContainerSchema consists of initialObjects and dynamicObjectTypes. These types can be
|
|
@@ -20,7 +22,6 @@ export const isSharedObjectClass = (obj) => {
|
|
|
20
22
|
* of DataObject types and an array of SharedObjects.
|
|
21
23
|
*/
|
|
22
24
|
export const parseDataObjectsFromSharedObjects = (schema) => {
|
|
23
|
-
var _a;
|
|
24
25
|
const registryEntries = new Set();
|
|
25
26
|
const sharedObjects = new Set();
|
|
26
27
|
const tryAddObject = (obj) => {
|
|
@@ -28,10 +29,7 @@ export const parseDataObjectsFromSharedObjects = (schema) => {
|
|
|
28
29
|
sharedObjects.add(obj.getFactory());
|
|
29
30
|
}
|
|
30
31
|
else if (isDataObjectClass(obj)) {
|
|
31
|
-
registryEntries.add([
|
|
32
|
-
obj.factory.type,
|
|
33
|
-
Promise.resolve(obj.factory),
|
|
34
|
-
]);
|
|
32
|
+
registryEntries.add([obj.factory.type, Promise.resolve(obj.factory)]);
|
|
35
33
|
}
|
|
36
34
|
else {
|
|
37
35
|
throw new Error(`Entry is neither a DataObject or a SharedObject`);
|
|
@@ -40,7 +38,7 @@ export const parseDataObjectsFromSharedObjects = (schema) => {
|
|
|
40
38
|
// Add the object types that will be initialized
|
|
41
39
|
const dedupedObjects = new Set([
|
|
42
40
|
...Object.values(schema.initialObjects),
|
|
43
|
-
...(
|
|
41
|
+
...(schema.dynamicObjectTypes ?? []),
|
|
44
42
|
]);
|
|
45
43
|
dedupedObjects.forEach(tryAddObject);
|
|
46
44
|
if (registryEntries.size === 0 && sharedObjects.size === 0) {
|
|
@@ -48,4 +46,4 @@ export const parseDataObjectsFromSharedObjects = (schema) => {
|
|
|
48
46
|
}
|
|
49
47
|
return [Array.from(registryEntries), Array.from(sharedObjects)];
|
|
50
48
|
};
|
|
51
|
-
//# sourceMappingURL=utils.
|
|
49
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAmBH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAQ,EAAkD,EAAE;IAC7F,MAAM,KAAK,GAAiE,GAAG,CAAC;IAChF,OAAO,CACN,KAAK,EAAE,OAAO,EAAE,sBAAsB,KAAK,SAAS;QACpD,KAAK,EAAE,OAAO,EAAE,sBAAsB,KAAK,KAAK,EAAE,OAAO,CACzD,CAAC;AACH,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,GAAQ,EAAiC,EAAE;IAC9E,OAAO,GAAG,EAAE,UAAU,KAAK,SAAS,CAAC;AACtC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAChD,MAAuB,EACmC,EAAE;IAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,EAAoC,CAAC;IACpE,MAAM,aAAa,GAAG,IAAI,GAAG,EAAmB,CAAC;IAEjD,MAAM,YAAY,GAAG,CAAC,GAA6B,EAAE,EAAE;QACtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,EAAE;YAC7B,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;SACpC;aAAM,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE;YAClC,eAAe,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;SACtE;aAAM;YACN,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;SACnE;IACF,CAAC,CAAC;IAEF,gDAAgD;IAChD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;QAC9B,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;QACvC,GAAG,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC;KACpC,CAAC,CAAC;IACH,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAErC,IAAI,eAAe,CAAC,IAAI,KAAK,CAAC,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC,EAAE;QAC3D,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;KACzE;IAED,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelFactory } from \"@fluidframework/datastore-definitions\";\nimport {\n\tIFluidDataStoreFactory,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"@fluidframework/runtime-definitions\";\nimport { IFluidLoadable } from \"@fluidframework/core-interfaces\";\nimport { ContainerSchema, DataObjectClass, LoadableObjectClass, SharedObjectClass } from \"./types\";\n\n/**\n * An internal type used by the internal type guard isDataObjectClass to cast a\n * DataObjectClass to a type that is strongly coupled to IFluidDataStoreFactory.\n * Unlike the external and exported type DataObjectClass which is\n * weakly coupled to the IFluidDataStoreFactory to prevent leaking internals.\n */\nexport type InternalDataObjectClass<T extends IFluidLoadable> = DataObjectClass<T> &\n\tRecord<\"factory\", IFluidDataStoreFactory>;\n\n/**\n * Runtime check to determine if a class is a DataObject type\n */\nexport const isDataObjectClass = (obj: any): obj is InternalDataObjectClass<IFluidLoadable> => {\n\tconst maybe: Partial<InternalDataObjectClass<IFluidLoadable>> | undefined = obj;\n\treturn (\n\t\tmaybe?.factory?.IFluidDataStoreFactory !== undefined &&\n\t\tmaybe?.factory?.IFluidDataStoreFactory === maybe?.factory\n\t);\n};\n\n/**\n * Runtime check to determine if a class is a SharedObject type\n */\nexport const isSharedObjectClass = (obj: any): obj is SharedObjectClass<any> => {\n\treturn obj?.getFactory !== undefined;\n};\n\n/**\n * The ContainerSchema consists of initialObjects and dynamicObjectTypes. These types can be\n * of both SharedObject or DataObject. This function seperates the two and returns a registery\n * of DataObject types and an array of SharedObjects.\n */\nexport const parseDataObjectsFromSharedObjects = (\n\tschema: ContainerSchema,\n): [NamedFluidDataStoreRegistryEntry[], IChannelFactory[]] => {\n\tconst registryEntries = new Set<NamedFluidDataStoreRegistryEntry>();\n\tconst sharedObjects = new Set<IChannelFactory>();\n\n\tconst tryAddObject = (obj: LoadableObjectClass<any>) => {\n\t\tif (isSharedObjectClass(obj)) {\n\t\t\tsharedObjects.add(obj.getFactory());\n\t\t} else if (isDataObjectClass(obj)) {\n\t\t\tregistryEntries.add([obj.factory.type, Promise.resolve(obj.factory)]);\n\t\t} else {\n\t\t\tthrow new Error(`Entry is neither a DataObject or a SharedObject`);\n\t\t}\n\t};\n\n\t// Add the object types that will be initialized\n\tconst dedupedObjects = new Set([\n\t\t...Object.values(schema.initialObjects),\n\t\t...(schema.dynamicObjectTypes ?? []),\n\t]);\n\tdedupedObjects.forEach(tryAddObject);\n\n\tif (registryEntries.size === 0 && sharedObjects.size === 0) {\n\t\tthrow new Error(\"Container cannot be initialized without any DataTypes\");\n\t}\n\n\treturn [Array.from(registryEntries), Array.from(sharedObjects)];\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/fluid-static",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.0.0-dev-rc.1.0.0.224419",
|
|
4
4
|
"description": "A tool to enable consumption of Fluid Data Objects without requiring custom container code.",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -11,72 +11,141 @@
|
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"author": "Microsoft and contributors",
|
|
13
13
|
"sideEffects": false,
|
|
14
|
-
"
|
|
15
|
-
|
|
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
|
+
},
|
|
26
|
+
"main": "dist/index.cjs",
|
|
27
|
+
"module": "lib/index.mjs",
|
|
16
28
|
"types": "dist/index.d.ts",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"tsc": "tsc",
|
|
37
|
-
"typetests:gen": "flub generate typetests --generate --dir . --no-generateInName",
|
|
38
|
-
"typetests:prepare": "flub generate typetests --prepare --dir . --pin"
|
|
29
|
+
"c8": {
|
|
30
|
+
"all": true,
|
|
31
|
+
"cache-dir": "nyc/.cache",
|
|
32
|
+
"exclude": [
|
|
33
|
+
"src/test/**/*.*ts",
|
|
34
|
+
"dist/test/**/*.*js"
|
|
35
|
+
],
|
|
36
|
+
"exclude-after-remap": false,
|
|
37
|
+
"include": [
|
|
38
|
+
"src/**/*.*ts",
|
|
39
|
+
"dist/**/*.*js"
|
|
40
|
+
],
|
|
41
|
+
"report-dir": "nyc/report",
|
|
42
|
+
"reporter": [
|
|
43
|
+
"cobertura",
|
|
44
|
+
"html",
|
|
45
|
+
"text"
|
|
46
|
+
],
|
|
47
|
+
"temp-directory": "nyc/.nyc_output"
|
|
39
48
|
},
|
|
40
49
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@fluidframework/
|
|
43
|
-
"@fluidframework/
|
|
44
|
-
"@fluidframework/container-
|
|
45
|
-
"@fluidframework/container-
|
|
46
|
-
"@fluidframework/container-runtime-definitions": "1.
|
|
47
|
-
"@fluidframework/core-interfaces": "1.
|
|
48
|
-
"@fluidframework/datastore-definitions": "1.
|
|
49
|
-
"@fluidframework/protocol-definitions": "^
|
|
50
|
-
"@fluidframework/request-handler": "1.
|
|
51
|
-
"@fluidframework/runtime-definitions": "1.
|
|
52
|
-
"@fluidframework/runtime-utils": "1.
|
|
50
|
+
"@fluid-internal/client-utils": "2.0.0-dev-rc.1.0.0.224419",
|
|
51
|
+
"@fluidframework/aqueduct": "2.0.0-dev-rc.1.0.0.224419",
|
|
52
|
+
"@fluidframework/container-definitions": "2.0.0-dev-rc.1.0.0.224419",
|
|
53
|
+
"@fluidframework/container-loader": "2.0.0-dev-rc.1.0.0.224419",
|
|
54
|
+
"@fluidframework/container-runtime": "2.0.0-dev-rc.1.0.0.224419",
|
|
55
|
+
"@fluidframework/container-runtime-definitions": "2.0.0-dev-rc.1.0.0.224419",
|
|
56
|
+
"@fluidframework/core-interfaces": "2.0.0-dev-rc.1.0.0.224419",
|
|
57
|
+
"@fluidframework/datastore-definitions": "2.0.0-dev-rc.1.0.0.224419",
|
|
58
|
+
"@fluidframework/protocol-definitions": "^3.1.0-223007",
|
|
59
|
+
"@fluidframework/request-handler": "2.0.0-dev-rc.1.0.0.224419",
|
|
60
|
+
"@fluidframework/runtime-definitions": "2.0.0-dev-rc.1.0.0.224419",
|
|
61
|
+
"@fluidframework/runtime-utils": "2.0.0-dev-rc.1.0.0.224419"
|
|
53
62
|
},
|
|
54
63
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@fluidframework/build-
|
|
58
|
-
"@fluidframework/
|
|
59
|
-
"@fluidframework/
|
|
60
|
-
"@fluidframework/
|
|
61
|
-
"@fluidframework/
|
|
62
|
-
"@fluidframework/
|
|
63
|
-
"@
|
|
64
|
-
"@
|
|
64
|
+
"@arethetypeswrong/cli": "^0.13.3",
|
|
65
|
+
"@fluid-tools/build-cli": "0.29.0-222379",
|
|
66
|
+
"@fluidframework/build-common": "^2.0.3",
|
|
67
|
+
"@fluidframework/build-tools": "0.29.0-222379",
|
|
68
|
+
"@fluidframework/eslint-config-fluid": "^3.1.0",
|
|
69
|
+
"@fluidframework/fluid-static-previous": "npm:@fluidframework/fluid-static@2.0.0-internal.7.2.0",
|
|
70
|
+
"@fluidframework/map": "2.0.0-dev-rc.1.0.0.224419",
|
|
71
|
+
"@fluidframework/mocha-test-setup": "2.0.0-dev-rc.1.0.0.224419",
|
|
72
|
+
"@fluidframework/sequence": "2.0.0-dev-rc.1.0.0.224419",
|
|
73
|
+
"@microsoft/api-extractor": "^7.38.3",
|
|
65
74
|
"@types/mocha": "^9.1.1",
|
|
66
|
-
"@types/node": "^
|
|
67
|
-
"
|
|
68
|
-
"copyfiles": "^2.1
|
|
69
|
-
"cross-env": "^7.0.
|
|
70
|
-
"eslint": "~8.
|
|
71
|
-
"mocha": "^10.
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
+
"@types/node": "^18.19.0",
|
|
76
|
+
"c8": "^7.7.1",
|
|
77
|
+
"copyfiles": "^2.4.1",
|
|
78
|
+
"cross-env": "^7.0.3",
|
|
79
|
+
"eslint": "~8.50.0",
|
|
80
|
+
"mocha": "^10.2.0",
|
|
81
|
+
"mocha-json-output-reporter": "^2.0.1",
|
|
82
|
+
"mocha-multi-reporters": "^1.5.1",
|
|
83
|
+
"moment": "^2.21.0",
|
|
84
|
+
"prettier": "~3.0.3",
|
|
85
|
+
"renamer": "^4.0.0",
|
|
86
|
+
"rimraf": "^4.4.0",
|
|
87
|
+
"tsc-multi": "^1.1.0",
|
|
88
|
+
"typescript": "~5.1.6"
|
|
89
|
+
},
|
|
90
|
+
"fluidBuild": {
|
|
91
|
+
"tasks": {
|
|
92
|
+
"build:docs": {
|
|
93
|
+
"dependsOn": [
|
|
94
|
+
"...",
|
|
95
|
+
"api-extractor:commonjs",
|
|
96
|
+
"api-extractor:esnext"
|
|
97
|
+
],
|
|
98
|
+
"script": false
|
|
99
|
+
}
|
|
100
|
+
}
|
|
75
101
|
},
|
|
76
102
|
"typeValidation": {
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
"broken": {
|
|
104
|
+
"RemovedClassDeclaration_DOProviderContainerRuntimeFactory": {
|
|
105
|
+
"forwardCompat": false,
|
|
106
|
+
"backCompat": false
|
|
107
|
+
},
|
|
108
|
+
"RemovedClassDeclaration_FluidContainer": {
|
|
109
|
+
"forwardCompat": false,
|
|
110
|
+
"backCompat": false
|
|
111
|
+
},
|
|
112
|
+
"RemovedClassDeclaration_ServiceAudience": {
|
|
113
|
+
"forwardCompat": false,
|
|
114
|
+
"backCompat": false
|
|
115
|
+
},
|
|
116
|
+
"InterfaceDeclaration_IRootDataObject": {
|
|
117
|
+
"forwardCompat": false
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"scripts": {
|
|
122
|
+
"api": "fluid-build . --task api",
|
|
123
|
+
"api-extractor:commonjs": "api-extractor run --local",
|
|
124
|
+
"api-extractor:esnext": "copyfiles -u 1 \"dist/**/*-@(alpha|beta|public|untrimmed).d.ts\" lib",
|
|
125
|
+
"build": "fluid-build . --task build",
|
|
126
|
+
"build:commonjs": "fluid-build . --task commonjs",
|
|
127
|
+
"build:compile": "fluid-build . --task compile",
|
|
128
|
+
"build:docs": "fluid-build . --task api",
|
|
129
|
+
"build:esnext": "tsc-multi --config ../../../common/build/build-common/tsc-multi.esm.json",
|
|
130
|
+
"build:rename-types": "renamer \"lib/**\" -f .d.ts -r .d.mts --force",
|
|
131
|
+
"build:test": "tsc-multi --config ./tsc-multi.test.json",
|
|
132
|
+
"check:are-the-types-wrong": "attw --pack",
|
|
133
|
+
"check:release-tags": "api-extractor run --local --config ./api-extractor-lint.json",
|
|
134
|
+
"ci:build:docs": "api-extractor run",
|
|
135
|
+
"clean": "rimraf --glob dist lib \"**/*.tsbuildinfo\" \"**/*.build.log\" _api-extractor-temp nyc",
|
|
136
|
+
"eslint": "eslint --format stylish src",
|
|
137
|
+
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
138
|
+
"format": "npm run prettier:fix",
|
|
139
|
+
"lint": "npm run prettier && npm run check:release-tags && npm run eslint",
|
|
140
|
+
"lint:fix": "npm run prettier:fix && npm run eslint:fix",
|
|
141
|
+
"prettier": "prettier --check . --cache --ignore-path ../../../.prettierignore",
|
|
142
|
+
"prettier:fix": "prettier --write . --cache --ignore-path ../../../.prettierignore",
|
|
143
|
+
"test": "npm run test:mocha",
|
|
144
|
+
"test:coverage": "c8 npm test",
|
|
145
|
+
"test:mocha": "mocha --recursive \"dist/test/**/*.spec.cjs\" -r node_modules/@fluidframework/mocha-test-setup",
|
|
146
|
+
"test:mocha:verbose": "cross-env FLUID_TEST_VERBOSE=1 npm run test:mocha",
|
|
147
|
+
"tsc": "tsc-multi --config ../../../common/build/build-common/tsc-multi.cjs.json",
|
|
148
|
+
"typetests:gen": "fluid-type-test-generator",
|
|
149
|
+
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
|
|
81
150
|
}
|
|
82
|
-
}
|
|
151
|
+
}
|