@fluidframework/tree-agent 2.80.0 → 2.81.0

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 (73) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/api-report/tree-agent.alpha.api.md +195 -20
  3. package/dist/alpha.d.ts +31 -1
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +5 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/methodBinding.d.ts +54 -10
  9. package/dist/methodBinding.d.ts.map +1 -1
  10. package/dist/methodBinding.js.map +1 -1
  11. package/dist/propertyBinding.d.ts +52 -2
  12. package/dist/propertyBinding.d.ts.map +1 -1
  13. package/dist/propertyBinding.js +28 -3
  14. package/dist/propertyBinding.js.map +1 -1
  15. package/dist/renderSchemaTypeScript.d.ts.map +1 -1
  16. package/dist/renderSchemaTypeScript.js +23 -8
  17. package/dist/renderSchemaTypeScript.js.map +1 -1
  18. package/dist/renderTypeFactoryTypeScript.d.ts +13 -0
  19. package/dist/renderTypeFactoryTypeScript.d.ts.map +1 -0
  20. package/dist/renderTypeFactoryTypeScript.js +290 -0
  21. package/dist/renderTypeFactoryTypeScript.js.map +1 -0
  22. package/dist/subtree.d.ts.map +1 -1
  23. package/dist/subtree.js +4 -4
  24. package/dist/subtree.js.map +1 -1
  25. package/dist/treeAgentTypes.d.ts +430 -0
  26. package/dist/treeAgentTypes.d.ts.map +1 -0
  27. package/dist/treeAgentTypes.js +227 -0
  28. package/dist/treeAgentTypes.js.map +1 -0
  29. package/dist/utils.d.ts +0 -4
  30. package/dist/utils.d.ts.map +1 -1
  31. package/dist/utils.js +2 -9
  32. package/dist/utils.js.map +1 -1
  33. package/eslint.config.mts +4 -4
  34. package/lib/alpha.d.ts +31 -1
  35. package/lib/index.d.ts +3 -1
  36. package/lib/index.d.ts.map +1 -1
  37. package/lib/index.js +1 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/methodBinding.d.ts +54 -10
  40. package/lib/methodBinding.d.ts.map +1 -1
  41. package/lib/methodBinding.js.map +1 -1
  42. package/lib/propertyBinding.d.ts +52 -2
  43. package/lib/propertyBinding.d.ts.map +1 -1
  44. package/lib/propertyBinding.js +28 -3
  45. package/lib/propertyBinding.js.map +1 -1
  46. package/lib/renderSchemaTypeScript.d.ts.map +1 -1
  47. package/lib/renderSchemaTypeScript.js +23 -8
  48. package/lib/renderSchemaTypeScript.js.map +1 -1
  49. package/lib/renderTypeFactoryTypeScript.d.ts +13 -0
  50. package/lib/renderTypeFactoryTypeScript.d.ts.map +1 -0
  51. package/lib/renderTypeFactoryTypeScript.js +285 -0
  52. package/lib/renderTypeFactoryTypeScript.js.map +1 -0
  53. package/lib/subtree.d.ts.map +1 -1
  54. package/lib/subtree.js +4 -4
  55. package/lib/subtree.js.map +1 -1
  56. package/lib/treeAgentTypes.d.ts +430 -0
  57. package/lib/treeAgentTypes.d.ts.map +1 -0
  58. package/lib/treeAgentTypes.js +223 -0
  59. package/lib/treeAgentTypes.js.map +1 -0
  60. package/lib/utils.d.ts +0 -4
  61. package/lib/utils.d.ts.map +1 -1
  62. package/lib/utils.js +2 -8
  63. package/lib/utils.js.map +1 -1
  64. package/package.json +12 -12
  65. package/src/index.ts +36 -0
  66. package/src/methodBinding.ts +93 -15
  67. package/src/propertyBinding.ts +66 -9
  68. package/src/renderSchemaTypeScript.ts +31 -9
  69. package/src/renderTypeFactoryTypeScript.ts +339 -0
  70. package/src/subtree.ts +5 -4
  71. package/src/treeAgentTypes.ts +611 -0
  72. package/src/utils.ts +2 -9
  73. package/.eslintrc.cjs +0 -48
@@ -0,0 +1,611 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { UsageError } from "@fluidframework/telemetry-utils/internal";
7
+ import type { TreeNodeSchemaClass } from "@fluidframework/tree/alpha";
8
+ import { ObjectNodeSchema } from "@fluidframework/tree/alpha";
9
+
10
+ /**
11
+ * Type kinds for the type factory type system.
12
+ * @alpha
13
+ */
14
+ export type TypeFactoryTypeKind =
15
+ | "string"
16
+ | "number"
17
+ | "boolean"
18
+ | "void"
19
+ | "undefined"
20
+ | "null"
21
+ | "unknown"
22
+ | "date"
23
+ | "promise"
24
+ | "array"
25
+ | "object"
26
+ | "record"
27
+ | "map"
28
+ | "tuple"
29
+ | "union"
30
+ | "intersection"
31
+ | "literal"
32
+ | "optional"
33
+ | "readonly"
34
+ | "function"
35
+ | "instanceof";
36
+
37
+ /**
38
+ * Base interface for type factory types.
39
+ * @alpha
40
+ */
41
+ export interface TypeFactoryType {
42
+ /**
43
+ * The kind of type this represents.
44
+ */
45
+ readonly _kind: TypeFactoryTypeKind;
46
+ }
47
+
48
+ /**
49
+ * Set of valid type factory type kinds for efficient validation.
50
+ * @internal
51
+ */
52
+ const validTypeKinds: ReadonlySet<TypeFactoryTypeKind> = new Set<TypeFactoryTypeKind>([
53
+ "string",
54
+ "number",
55
+ "boolean",
56
+ "void",
57
+ "undefined",
58
+ "null",
59
+ "unknown",
60
+ "date",
61
+ "promise",
62
+ "array",
63
+ "object",
64
+ "record",
65
+ "map",
66
+ "tuple",
67
+ "union",
68
+ "intersection",
69
+ "literal",
70
+ "optional",
71
+ "readonly",
72
+ "function",
73
+ "instanceof",
74
+ ]);
75
+
76
+ /**
77
+ * Type guard to check if a value is a type factory type.
78
+ * @alpha
79
+ */
80
+ export function isTypeFactoryType(value: unknown): value is TypeFactoryType {
81
+ if (typeof value !== "object" || value === null || !("_kind" in value)) {
82
+ return false;
83
+ }
84
+ const kind = (value as { _kind: unknown })._kind;
85
+ return typeof kind === "string" && validTypeKinds.has(kind as TypeFactoryTypeKind);
86
+ }
87
+
88
+ // Primitive type factories
89
+
90
+ /**
91
+ * Represents a string type in the type factory system.
92
+ * @alpha
93
+ */
94
+ export interface TypeFactoryString extends TypeFactoryType {
95
+ /**
96
+ * {@inheritDoc TypeFactoryType._kind}
97
+ */
98
+ readonly _kind: "string";
99
+ }
100
+
101
+ /**
102
+ * Represents a number type in the type factory system.
103
+ * @alpha
104
+ */
105
+ export interface TypeFactoryNumber extends TypeFactoryType {
106
+ /**
107
+ * {@inheritDoc TypeFactoryType._kind}
108
+ */
109
+ readonly _kind: "number";
110
+ }
111
+
112
+ /**
113
+ * Represents a boolean type in the type factory system.
114
+ * @alpha
115
+ */
116
+ export interface TypeFactoryBoolean extends TypeFactoryType {
117
+ /**
118
+ * {@inheritDoc TypeFactoryType._kind}
119
+ */
120
+ readonly _kind: "boolean";
121
+ }
122
+
123
+ /**
124
+ * Represents a Date type in the type factory system.
125
+ * @alpha
126
+ */
127
+ export interface TypeFactoryDate extends TypeFactoryType {
128
+ /**
129
+ * {@inheritDoc TypeFactoryType._kind}
130
+ */
131
+ readonly _kind: "date";
132
+ }
133
+
134
+ /**
135
+ * Represents a void type in the type factory system.
136
+ * @alpha
137
+ */
138
+ export interface TypeFactoryVoid extends TypeFactoryType {
139
+ /**
140
+ * {@inheritDoc TypeFactoryType._kind}
141
+ */
142
+ readonly _kind: "void";
143
+ }
144
+
145
+ /**
146
+ * Represents an undefined type in the type factory system.
147
+ * @alpha
148
+ */
149
+ export interface TypeFactoryUndefined extends TypeFactoryType {
150
+ /**
151
+ * {@inheritDoc TypeFactoryType._kind}
152
+ */
153
+ readonly _kind: "undefined";
154
+ }
155
+
156
+ /**
157
+ * Represents a null type in the type factory system.
158
+ * @alpha
159
+ */
160
+ export interface TypeFactoryNull extends TypeFactoryType {
161
+ /**
162
+ * {@inheritDoc TypeFactoryType._kind}
163
+ */
164
+ readonly _kind: "null";
165
+ }
166
+
167
+ /**
168
+ * Represents an unknown type in the type factory system.
169
+ * @alpha
170
+ */
171
+ export interface TypeFactoryUnknown extends TypeFactoryType {
172
+ /**
173
+ * {@inheritDoc TypeFactoryType._kind}
174
+ */
175
+ readonly _kind: "unknown";
176
+ }
177
+
178
+ // Complex type interfaces
179
+
180
+ /**
181
+ * Represents an array type in the type factory system.
182
+ * @alpha
183
+ */
184
+ export interface TypeFactoryArray extends TypeFactoryType {
185
+ /**
186
+ * {@inheritDoc TypeFactoryType._kind}
187
+ */
188
+ readonly _kind: "array";
189
+ /**
190
+ * The type of elements in the array.
191
+ */
192
+ readonly element: TypeFactoryType;
193
+ }
194
+
195
+ /**
196
+ * Represents a Promise type in the type factory system.
197
+ * @alpha
198
+ */
199
+ export interface TypeFactoryPromise extends TypeFactoryType {
200
+ /**
201
+ * {@inheritDoc TypeFactoryType._kind}
202
+ */
203
+ readonly _kind: "promise";
204
+ /**
205
+ * The type that the Promise resolves to.
206
+ */
207
+ readonly innerType: TypeFactoryType;
208
+ }
209
+
210
+ /**
211
+ * Represents an object type with a fixed shape in the type factory system.
212
+ * @alpha
213
+ */
214
+ export interface TypeFactoryObject extends TypeFactoryType {
215
+ /**
216
+ * {@inheritDoc TypeFactoryType._kind}
217
+ */
218
+ readonly _kind: "object";
219
+ /**
220
+ * The shape of the object, mapping property names to their types.
221
+ */
222
+ readonly shape: Record<string, TypeFactoryType>;
223
+ }
224
+
225
+ /**
226
+ * Represents a record type (index signature) in the type factory system.
227
+ * @alpha
228
+ */
229
+ export interface TypeFactoryRecord extends TypeFactoryType {
230
+ /**
231
+ * {@inheritDoc TypeFactoryType._kind}
232
+ */
233
+ readonly _kind: "record";
234
+ /**
235
+ * The type of the record's keys.
236
+ */
237
+ readonly keyType: TypeFactoryType;
238
+ /**
239
+ * The type of the record's values.
240
+ */
241
+ readonly valueType: TypeFactoryType;
242
+ }
243
+
244
+ /**
245
+ * Represents a Map type in the type factory system.
246
+ * @alpha
247
+ */
248
+ export interface TypeFactoryMap extends TypeFactoryType {
249
+ /**
250
+ * {@inheritDoc TypeFactoryType._kind}
251
+ */
252
+ readonly _kind: "map";
253
+ /**
254
+ * The type of the map's keys.
255
+ */
256
+ readonly keyType: TypeFactoryType;
257
+ /**
258
+ * The type of the map's values.
259
+ */
260
+ readonly valueType: TypeFactoryType;
261
+ }
262
+
263
+ /**
264
+ * Represents a tuple type with fixed-length items and optional rest elements in the type factory system.
265
+ * @alpha
266
+ */
267
+ export interface TypeFactoryTuple extends TypeFactoryType {
268
+ /**
269
+ * {@inheritDoc TypeFactoryType._kind}
270
+ */
271
+ readonly _kind: "tuple";
272
+ /**
273
+ * The fixed-length items in the tuple.
274
+ */
275
+ readonly items: readonly TypeFactoryType[];
276
+ /**
277
+ * Optional rest element type for variable-length tuples.
278
+ */
279
+ readonly rest?: TypeFactoryType;
280
+ }
281
+
282
+ /**
283
+ * Represents a union type in the type factory system.
284
+ * @alpha
285
+ */
286
+ export interface TypeFactoryUnion extends TypeFactoryType {
287
+ /**
288
+ * {@inheritDoc TypeFactoryType._kind}
289
+ */
290
+ readonly _kind: "union";
291
+ /**
292
+ * The possible types in the union.
293
+ */
294
+ readonly options: readonly TypeFactoryType[];
295
+ }
296
+
297
+ /**
298
+ * Represents an intersection type in the type factory system.
299
+ * @alpha
300
+ */
301
+ export interface TypeFactoryIntersection extends TypeFactoryType {
302
+ /**
303
+ * {@inheritDoc TypeFactoryType._kind}
304
+ */
305
+ readonly _kind: "intersection";
306
+ /**
307
+ * The types to intersect.
308
+ */
309
+ readonly types: readonly TypeFactoryType[];
310
+ }
311
+
312
+ /**
313
+ * Represents a literal type (specific string, number, or boolean value) in the type factory system.
314
+ * @alpha
315
+ */
316
+ export interface TypeFactoryLiteral extends TypeFactoryType {
317
+ /**
318
+ * {@inheritDoc TypeFactoryType._kind}
319
+ */
320
+ readonly _kind: "literal";
321
+ /**
322
+ * The specific literal value.
323
+ */
324
+ readonly value: string | number | boolean;
325
+ }
326
+
327
+ /**
328
+ * Represents an optional type modifier in the type factory system.
329
+ * @alpha
330
+ */
331
+ export interface TypeFactoryOptional extends TypeFactoryType {
332
+ /**
333
+ * {@inheritDoc TypeFactoryType._kind}
334
+ */
335
+ readonly _kind: "optional";
336
+ /**
337
+ * The inner type that is optional.
338
+ */
339
+ readonly innerType: TypeFactoryType;
340
+ }
341
+
342
+ /**
343
+ * Represents a readonly type modifier in the type factory system.
344
+ * @alpha
345
+ */
346
+ export interface TypeFactoryReadonly extends TypeFactoryType {
347
+ /**
348
+ * {@inheritDoc TypeFactoryType._kind}
349
+ */
350
+ readonly _kind: "readonly";
351
+ /**
352
+ * The inner type that is readonly.
353
+ */
354
+ readonly innerType: TypeFactoryType;
355
+ }
356
+
357
+ /**
358
+ * Represents a function parameter as a tuple of [name, type].
359
+ * @alpha
360
+ */
361
+ export type TypeFactoryFunctionParameter = readonly [name: string, type: TypeFactoryType];
362
+
363
+ /**
364
+ * Represents a function type in the type factory system.
365
+ * @alpha
366
+ */
367
+ export interface TypeFactoryFunction extends TypeFactoryType {
368
+ /**
369
+ * {@inheritDoc TypeFactoryType._kind}
370
+ */
371
+ readonly _kind: "function";
372
+ /**
373
+ * The function parameters.
374
+ */
375
+ readonly parameters: readonly TypeFactoryFunctionParameter[];
376
+ /**
377
+ * The function return type.
378
+ */
379
+ readonly returnType: TypeFactoryType;
380
+ /**
381
+ * Optional rest parameter for variable-length argument lists.
382
+ */
383
+ readonly restParameter?: TypeFactoryFunctionParameter;
384
+ }
385
+
386
+ /**
387
+ * Represents an instanceof type that references a SharedTree schema class in the type factory system.
388
+ * @alpha
389
+ */
390
+ export interface TypeFactoryInstanceOf extends TypeFactoryType {
391
+ /**
392
+ * {@inheritDoc TypeFactoryType._kind}
393
+ */
394
+ readonly _kind: "instanceof";
395
+ /**
396
+ * The SharedTree schema class to reference.
397
+ */
398
+ readonly schema: ObjectNodeSchema;
399
+ }
400
+
401
+ /**
402
+ * Namespace containing type factory functions.
403
+ * @alpha
404
+ */
405
+ export const typeFactory = {
406
+ /**
407
+ * Create a string type.
408
+ * @alpha
409
+ */
410
+ string(): TypeFactoryString {
411
+ return { _kind: "string" };
412
+ },
413
+
414
+ /**
415
+ * Create a number type.
416
+ * @alpha
417
+ */
418
+ number(): TypeFactoryNumber {
419
+ return { _kind: "number" };
420
+ },
421
+
422
+ /**
423
+ * Create a boolean type.
424
+ * @alpha
425
+ */
426
+ boolean(): TypeFactoryBoolean {
427
+ return { _kind: "boolean" };
428
+ },
429
+
430
+ /**
431
+ * Create a Date type.
432
+ * @alpha
433
+ */
434
+ date(): TypeFactoryDate {
435
+ return { _kind: "date" };
436
+ },
437
+
438
+ /**
439
+ * Create a void type.
440
+ * @alpha
441
+ */
442
+ void(): TypeFactoryVoid {
443
+ return { _kind: "void" };
444
+ },
445
+
446
+ /**
447
+ * Create an undefined type.
448
+ * @alpha
449
+ */
450
+ undefined(): TypeFactoryUndefined {
451
+ return { _kind: "undefined" };
452
+ },
453
+
454
+ /**
455
+ * Create a null type.
456
+ * @alpha
457
+ */
458
+ null(): TypeFactoryNull {
459
+ return { _kind: "null" };
460
+ },
461
+
462
+ /**
463
+ * Create an unknown type.
464
+ * @alpha
465
+ */
466
+ unknown(): TypeFactoryUnknown {
467
+ return { _kind: "unknown" };
468
+ },
469
+
470
+ /**
471
+ * Create an array type.
472
+ * @alpha
473
+ */
474
+ array(element: TypeFactoryType): TypeFactoryArray {
475
+ return { _kind: "array", element };
476
+ },
477
+
478
+ /**
479
+ * Create a Promise type.
480
+ * @alpha
481
+ */
482
+ promise(innerType: TypeFactoryType): TypeFactoryPromise {
483
+ return { _kind: "promise", innerType };
484
+ },
485
+
486
+ /**
487
+ * Create an object type.
488
+ * @alpha
489
+ */
490
+ object(shape: Record<string, TypeFactoryType>): TypeFactoryObject {
491
+ return { _kind: "object", shape };
492
+ },
493
+
494
+ /**
495
+ * Create a record type.
496
+ * @alpha
497
+ */
498
+ record(keyType: TypeFactoryType, valueType: TypeFactoryType): TypeFactoryRecord {
499
+ return { _kind: "record", keyType, valueType };
500
+ },
501
+
502
+ /**
503
+ * Create a map type.
504
+ * @alpha
505
+ */
506
+ map(keyType: TypeFactoryType, valueType: TypeFactoryType): TypeFactoryMap {
507
+ return { _kind: "map", keyType, valueType };
508
+ },
509
+
510
+ /**
511
+ * Create a tuple type.
512
+ * @alpha
513
+ */
514
+ tuple(items: readonly TypeFactoryType[], rest?: TypeFactoryType): TypeFactoryTuple {
515
+ if (items.length === 0 && rest === undefined) {
516
+ throw new UsageError(
517
+ "typeFactory.tuple requires at least one item or a rest type. Empty tuples are not supported.",
518
+ );
519
+ }
520
+ return rest === undefined ? { _kind: "tuple", items } : { _kind: "tuple", items, rest };
521
+ },
522
+
523
+ /**
524
+ * Create a union type.
525
+ * @alpha
526
+ */
527
+ union(options: readonly TypeFactoryType[]): TypeFactoryUnion {
528
+ if (options.length === 0) {
529
+ throw new UsageError(
530
+ "typeFactory.union requires at least one option. Empty unions are not valid TypeScript types.",
531
+ );
532
+ }
533
+ return { _kind: "union", options };
534
+ },
535
+
536
+ /**
537
+ * Create an intersection type.
538
+ * @alpha
539
+ */
540
+ intersection(types: readonly TypeFactoryType[]): TypeFactoryIntersection {
541
+ if (types.length === 0) {
542
+ throw new UsageError(
543
+ "typeFactory.intersection requires at least one type. Empty intersections are not valid TypeScript types.",
544
+ );
545
+ }
546
+ return { _kind: "intersection", types };
547
+ },
548
+
549
+ /**
550
+ * Create a literal type.
551
+ * @alpha
552
+ */
553
+ literal(value: string | number | boolean): TypeFactoryLiteral {
554
+ return { _kind: "literal", value };
555
+ },
556
+
557
+ /**
558
+ * Create an optional type.
559
+ * @alpha
560
+ */
561
+ optional(innerType: TypeFactoryType): TypeFactoryOptional {
562
+ return { _kind: "optional", innerType };
563
+ },
564
+
565
+ /**
566
+ * Create a readonly type.
567
+ * @alpha
568
+ */
569
+ readonly(innerType: TypeFactoryType): TypeFactoryReadonly {
570
+ return { _kind: "readonly", innerType };
571
+ },
572
+
573
+ /**
574
+ * Create a function type.
575
+ * @alpha
576
+ */
577
+ function(
578
+ parameters: readonly TypeFactoryFunctionParameter[],
579
+ returnType: TypeFactoryType,
580
+ restParameter?: TypeFactoryFunctionParameter,
581
+ ): TypeFactoryFunction {
582
+ return restParameter === undefined
583
+ ? { _kind: "function", parameters, returnType }
584
+ : { _kind: "function", parameters, returnType, restParameter };
585
+ },
586
+
587
+ /**
588
+ * Create an instanceOf type for a SharedTree schema class.
589
+ * @alpha
590
+ */
591
+ instanceOf<T extends TreeNodeSchemaClass>(schema: T): TypeFactoryInstanceOf {
592
+ if (!(schema instanceof ObjectNodeSchema)) {
593
+ throw new UsageError(
594
+ `typeFactory.instanceOf only supports ObjectNodeSchema-based schema classes (created via SchemaFactory.object). ` +
595
+ `Pass a schema class that extends from an object schema (e.g., sf.object(...)), not primitive, array, or map schemas.`,
596
+ );
597
+ }
598
+ const instanceOfType: TypeFactoryInstanceOf = {
599
+ _kind: "instanceof",
600
+ schema,
601
+ };
602
+ instanceOfsTypeFactory.set(instanceOfType, schema);
603
+ return instanceOfType;
604
+ },
605
+ };
606
+
607
+ /**
608
+ * A lookup from type factory instanceOf types to their corresponding ObjectNodeSchema.
609
+ * @alpha
610
+ */
611
+ export const instanceOfsTypeFactory = new WeakMap<TypeFactoryInstanceOf, ObjectNodeSchema>();
package/src/utils.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { assert } from "@fluidframework/core-utils/internal";
6
+ import { assert, fail } from "@fluidframework/core-utils/internal";
7
7
  import { isFluidHandle } from "@fluidframework/runtime-utils";
8
8
  import { UsageError } from "@fluidframework/telemetry-utils/internal";
9
9
  import type { ImplicitFieldSchema } from "@fluidframework/tree";
@@ -31,13 +31,6 @@ export interface MapGetSet<K, V> {
31
31
  set(key: K, value: V): void;
32
32
  }
33
33
 
34
- /**
35
- * TBD
36
- */
37
- export function fail(message: string): never {
38
- throw new Error(message);
39
- }
40
-
41
34
  /**
42
35
  * Map one iterable to another by transforming each element one at a time
43
36
  * @param iterable - the iterable to transform
@@ -156,7 +149,7 @@ export function getFriendlyName(schema: TreeNodeSchema): string {
156
149
  ? `Record<string, (${childNames.join(" | ")})>`
157
150
  : `Record<string, ${childNames[0]}>`;
158
151
  }
159
- fail("Unexpected node schema");
152
+ fail(0xcb7 /* Unexpected node schema */);
160
153
  }
161
154
 
162
155
  /**
package/.eslintrc.cjs DELETED
@@ -1,48 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- extends: [require.resolve("@fluidframework/eslint-config-fluid/strict"), "prettier"],
8
- parserOptions: {
9
- project: ["./tsconfig.json"],
10
- },
11
- rules: {
12
- // Allow reaching into FluidFramework package paths that end with alpha, beta, legacy, or internal
13
- "import-x/no-internal-modules": [
14
- "error",
15
- {
16
- allow: [
17
- "@fluidframework/*/alpha",
18
- "@fluidframework/*/beta",
19
- "@fluidframework/*/legacy",
20
- "@fluidframework/*/internal",
21
- ],
22
- },
23
- ],
24
- },
25
- overrides: [
26
- {
27
- files: ["src/test/**/*"],
28
- parserOptions: {
29
- project: ["./src/test/tsconfig.json"],
30
- },
31
- rules: {
32
- // Test files can import from submodules for testing purposes
33
- "import-x/no-internal-modules": [
34
- "error",
35
- {
36
- allow: [
37
- "*/index.js",
38
- "@fluidframework/*/alpha",
39
- "@fluidframework/*/beta",
40
- "@fluidframework/*/legacy",
41
- "@fluidframework/*/internal",
42
- ],
43
- },
44
- ],
45
- },
46
- },
47
- ],
48
- };