Skip to content

Commit 9a2267c

Browse files
authored
build(client): Omit "internal" APIs from type tests (microsoft#22516)
_This was pulled out of microsoft#22392 so that PR has more discussion._ This change updates the typetest entrypoints for packages to be the lowest-level/broadest available entrypoint other than internal. The intent of this change is to stop type testing internal APIs, but the design is deliberately entrypoint-focused so any entrypoint can be tested. Indeed, as a follow-up to this change, package owners can adjust the entrypoint tested as their requirements change. Towards the goal of no longer testing internal APIs, The typetests have been regenerated with the updated entrypoints. Rough logic: - If the package has a ./legacy export, entrypoint = legacy. - Else if the package has an ./alpha export, entrypoint = alpha. - Else if the package has a ./beta export, entrypoint = beta. - Else if the package has a . export, entrypoint = public. Because of the current API hierarchy, legacy is _usually_ a superset of alpha/beta/public. This may not be true in the future as we refine the legacy API and move them between levels; package configurations will need to be adjusted for such packages. ## Full list of packages and their updated type test entrypoint: ### public packages/common/client-utils packages/common/driver-definitions packages/dds/tree packages/framework/fluid-static ### beta packages/service-clients/tinylicious-client ### alpha packages/tools/devtools/devtools-core packages/tools/devtools/devtools ### legacy azure/packages/azure-service-utils experimental/dds/attributable-map packages/common/container-definitions packages/common/core-interfaces packages/common/core-utils packages/dds/counter packages/dds/map packages/dds/matrix packages/dds/merge-tree packages/dds/ordered-collection packages/dds/register-collection packages/dds/sequence packages/dds/shared-object-base packages/dds/shared-summary-block packages/dds/task-manager packages/drivers/debugger packages/drivers/driver-web-cache packages/drivers/local-driver packages/drivers/odsp-driver-definitions packages/drivers/odsp-driver packages/drivers/routerlicious-driver packages/framework/agent-scheduler packages/framework/aqueduct packages/framework/request-handler packages/framework/synthesize packages/loader/container-loader packages/loader/driver-utils packages/runtime/container-runtime-definitions packages/runtime/container-runtime packages/runtime/datastore-definitions packages/runtime/datastore packages/runtime/id-compressor packages/runtime/runtime-definitions packages/runtime/runtime-utils packages/runtime/test-runtime-utils packages/service-clients/azure-client packages/test/test-utils packages/tools/fluid-runner packages/utils/odsp-doclib-utils packages/utils/telemetry-utils
1 parent 9d41303 commit 9a2267c

File tree

74 files changed

+78
-7180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+78
-7180
lines changed

azure/packages/azure-service-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@
114114
},
115115
"typeValidation": {
116116
"broken": {},
117-
"entrypoint": "internal"
117+
"entrypoint": "legacy"
118118
}
119119
}

experimental/dds/attributable-map/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@
129129
},
130130
"typeValidation": {
131131
"broken": {},
132-
"entrypoint": "internal"
132+
"entrypoint": "legacy"
133133
}
134134
}

packages/common/client-utils/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"test:mocha:cjs": "mocha --recursive \"dist/test/mocha/**/*.spec.*js\" --exit",
9999
"test:mocha:esm": "mocha --recursive \"lib/test/mocha/**/*.spec.*js\" --exit",
100100
"tsc": "fluid-tsc commonjs --project ./tsconfig.cjs.json && copyfiles -f ../../../common/build/build-common/src/cjs/package.json ./dist",
101-
"typetests:gen": "flub generate typetests --dir . -v --level public",
101+
"typetests:gen": "flub generate typetests --dir . -v",
102102
"typetests:prepare": "flub typetests --dir . --reset --previous --normalize"
103103
},
104104
"c8": {
@@ -244,6 +244,6 @@
244244
},
245245
"typeValidation": {
246246
"broken": {},
247-
"entrypoint": "internal"
247+
"entrypoint": "public"
248248
}
249249
}

packages/common/container-definitions/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@
115115
},
116116
"typeValidation": {
117117
"broken": {},
118-
"entrypoint": "internal"
118+
"entrypoint": "legacy"
119119
}
120120
}

packages/common/container-definitions/src/test/types/validateContainerDefinitionsPrevious.generated.ts

-63
Original file line numberDiff line numberDiff line change
@@ -402,24 +402,6 @@ declare type old_as_current_for_Interface_IFluidCodeDetailsConfig = requireAssig
402402
*/
403403
declare type current_as_old_for_Interface_IFluidCodeDetailsConfig = requireAssignableTo<TypeOnly<current.IFluidCodeDetailsConfig>, TypeOnly<old.IFluidCodeDetailsConfig>>
404404

405-
/*
406-
* Validate forward compatibility by using the old type in place of the current type.
407-
* If this test starts failing, it indicates a change that is not forward compatible.
408-
* To acknowledge the breaking change, add the following to package.json under
409-
* typeValidation.broken:
410-
* "Interface_IFluidCodeResolver": {"forwardCompat": false}
411-
*/
412-
declare type old_as_current_for_Interface_IFluidCodeResolver = requireAssignableTo<TypeOnly<old.IFluidCodeResolver>, TypeOnly<current.IFluidCodeResolver>>
413-
414-
/*
415-
* Validate backward compatibility by using the current type in place of the old type.
416-
* If this test starts failing, it indicates a change that is not backward compatible.
417-
* To acknowledge the breaking change, add the following to package.json under
418-
* typeValidation.broken:
419-
* "Interface_IFluidCodeResolver": {"backCompat": false}
420-
*/
421-
declare type current_as_old_for_Interface_IFluidCodeResolver = requireAssignableTo<TypeOnly<current.IFluidCodeResolver>, TypeOnly<old.IFluidCodeResolver>>
422-
423405
/*
424406
* Validate forward compatibility by using the old type in place of the current type.
425407
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -546,24 +528,6 @@ declare type old_as_current_for_Interface_ILoader = requireAssignableTo<TypeOnly
546528
*/
547529
declare type current_as_old_for_Interface_ILoader = requireAssignableTo<TypeOnly<current.ILoader>, TypeOnly<old.ILoader>>
548530

549-
/*
550-
* Validate forward compatibility by using the old type in place of the current type.
551-
* If this test starts failing, it indicates a change that is not forward compatible.
552-
* To acknowledge the breaking change, add the following to package.json under
553-
* typeValidation.broken:
554-
* "Interface_ILoaderHeader": {"forwardCompat": false}
555-
*/
556-
declare type old_as_current_for_Interface_ILoaderHeader = requireAssignableTo<TypeOnly<old.ILoaderHeader>, TypeOnly<current.ILoaderHeader>>
557-
558-
/*
559-
* Validate backward compatibility by using the current type in place of the old type.
560-
* If this test starts failing, it indicates a change that is not backward compatible.
561-
* To acknowledge the breaking change, add the following to package.json under
562-
* typeValidation.broken:
563-
* "Interface_ILoaderHeader": {"backCompat": false}
564-
*/
565-
declare type current_as_old_for_Interface_ILoaderHeader = requireAssignableTo<TypeOnly<current.ILoaderHeader>, TypeOnly<old.ILoaderHeader>>
566-
567531
/*
568532
* Validate forward compatibility by using the old type in place of the current type.
569533
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -618,24 +582,6 @@ declare type old_as_current_for_Interface_IProvideRuntimeFactory = requireAssign
618582
*/
619583
declare type current_as_old_for_Interface_IProvideRuntimeFactory = requireAssignableTo<TypeOnly<current.IProvideRuntimeFactory>, TypeOnly<old.IProvideRuntimeFactory>>
620584

621-
/*
622-
* Validate forward compatibility by using the old type in place of the current type.
623-
* If this test starts failing, it indicates a change that is not forward compatible.
624-
* To acknowledge the breaking change, add the following to package.json under
625-
* typeValidation.broken:
626-
* "Interface_IResolvedFluidCodeDetails": {"forwardCompat": false}
627-
*/
628-
declare type old_as_current_for_Interface_IResolvedFluidCodeDetails = requireAssignableTo<TypeOnly<old.IResolvedFluidCodeDetails>, TypeOnly<current.IResolvedFluidCodeDetails>>
629-
630-
/*
631-
* Validate backward compatibility by using the current type in place of the old type.
632-
* If this test starts failing, it indicates a change that is not backward compatible.
633-
* To acknowledge the breaking change, add the following to package.json under
634-
* typeValidation.broken:
635-
* "Interface_IResolvedFluidCodeDetails": {"backCompat": false}
636-
*/
637-
declare type current_as_old_for_Interface_IResolvedFluidCodeDetails = requireAssignableTo<TypeOnly<current.IResolvedFluidCodeDetails>, TypeOnly<old.IResolvedFluidCodeDetails>>
638-
639585
/*
640586
* Validate forward compatibility by using the old type in place of the current type.
641587
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -852,15 +798,6 @@ declare type current_as_old_for_Variable_IRuntimeFactory = requireAssignableTo<T
852798
*/
853799
declare type current_as_old_for_Variable_isFluidBrowserPackage = requireAssignableTo<TypeOnly<typeof current.isFluidBrowserPackage>, TypeOnly<typeof old.isFluidBrowserPackage>>
854800

855-
/*
856-
* Validate backward compatibility by using the current type in place of the old type.
857-
* If this test starts failing, it indicates a change that is not backward compatible.
858-
* To acknowledge the breaking change, add the following to package.json under
859-
* typeValidation.broken:
860-
* "Variable_isFluidCodeDetails": {"backCompat": false}
861-
*/
862-
declare type current_as_old_for_Variable_isFluidCodeDetails = requireAssignableTo<TypeOnly<typeof current.isFluidCodeDetails>, TypeOnly<typeof old.isFluidCodeDetails>>
863-
864801
/*
865802
* Validate backward compatibility by using the current type in place of the old type.
866803
* If this test starts failing, it indicates a change that is not backward compatible.

packages/common/core-interfaces/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@
111111
},
112112
"typeValidation": {
113113
"broken": {},
114-
"entrypoint": "internal"
114+
"entrypoint": "legacy"
115115
}
116116
}

packages/common/core-interfaces/src/test/types/validateCoreInterfacesPrevious.generated.ts

-99
Original file line numberDiff line numberDiff line change
@@ -186,42 +186,6 @@ declare type current_as_old_for_Interface_IFluidHandleInternal = requireAssignab
186186
*/
187187
declare type current_as_old_for_Interface_IFluidLoadable = requireAssignableTo<TypeOnly<current.IFluidLoadable>, TypeOnly<old.IFluidLoadable>>
188188

189-
/*
190-
* Validate forward compatibility by using the old type in place of the current type.
191-
* If this test starts failing, it indicates a change that is not forward compatible.
192-
* To acknowledge the breaking change, add the following to package.json under
193-
* typeValidation.broken:
194-
* "Interface_IFluidRunnable": {"forwardCompat": false}
195-
*/
196-
declare type old_as_current_for_Interface_IFluidRunnable = requireAssignableTo<TypeOnly<old.IFluidRunnable>, TypeOnly<current.IFluidRunnable>>
197-
198-
/*
199-
* Validate backward compatibility by using the current type in place of the old type.
200-
* If this test starts failing, it indicates a change that is not backward compatible.
201-
* To acknowledge the breaking change, add the following to package.json under
202-
* typeValidation.broken:
203-
* "Interface_IFluidRunnable": {"backCompat": false}
204-
*/
205-
declare type current_as_old_for_Interface_IFluidRunnable = requireAssignableTo<TypeOnly<current.IFluidRunnable>, TypeOnly<old.IFluidRunnable>>
206-
207-
/*
208-
* Validate forward compatibility by using the old type in place of the current type.
209-
* If this test starts failing, it indicates a change that is not forward compatible.
210-
* To acknowledge the breaking change, add the following to package.json under
211-
* typeValidation.broken:
212-
* "Interface_IGenericError": {"forwardCompat": false}
213-
*/
214-
declare type old_as_current_for_Interface_IGenericError = requireAssignableTo<TypeOnly<old.IGenericError>, TypeOnly<current.IGenericError>>
215-
216-
/*
217-
* Validate backward compatibility by using the current type in place of the old type.
218-
* If this test starts failing, it indicates a change that is not backward compatible.
219-
* To acknowledge the breaking change, add the following to package.json under
220-
* typeValidation.broken:
221-
* "Interface_IGenericError": {"backCompat": false}
222-
*/
223-
declare type current_as_old_for_Interface_IGenericError = requireAssignableTo<TypeOnly<current.IGenericError>, TypeOnly<old.IGenericError>>
224-
225189
/*
226190
* Validate forward compatibility by using the old type in place of the current type.
227191
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -294,24 +258,6 @@ declare type old_as_current_for_Interface_IProvideFluidLoadable = requireAssigna
294258
*/
295259
declare type current_as_old_for_Interface_IProvideFluidLoadable = requireAssignableTo<TypeOnly<current.IProvideFluidLoadable>, TypeOnly<old.IProvideFluidLoadable>>
296260

297-
/*
298-
* Validate forward compatibility by using the old type in place of the current type.
299-
* If this test starts failing, it indicates a change that is not forward compatible.
300-
* To acknowledge the breaking change, add the following to package.json under
301-
* typeValidation.broken:
302-
* "Interface_IProvideFluidRunnable": {"forwardCompat": false}
303-
*/
304-
declare type old_as_current_for_Interface_IProvideFluidRunnable = requireAssignableTo<TypeOnly<old.IProvideFluidRunnable>, TypeOnly<current.IProvideFluidRunnable>>
305-
306-
/*
307-
* Validate backward compatibility by using the current type in place of the old type.
308-
* If this test starts failing, it indicates a change that is not backward compatible.
309-
* To acknowledge the breaking change, add the following to package.json under
310-
* typeValidation.broken:
311-
* "Interface_IProvideFluidRunnable": {"backCompat": false}
312-
*/
313-
declare type current_as_old_for_Interface_IProvideFluidRunnable = requireAssignableTo<TypeOnly<current.IProvideFluidRunnable>, TypeOnly<old.IProvideFluidRunnable>>
314-
315261
/*
316262
* Validate forward compatibility by using the old type in place of the current type.
317263
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -366,24 +312,6 @@ declare type old_as_current_for_Interface_IResponse = requireAssignableTo<TypeOn
366312
*/
367313
declare type current_as_old_for_Interface_IResponse = requireAssignableTo<TypeOnly<current.IResponse>, TypeOnly<old.IResponse>>
368314

369-
/*
370-
* Validate forward compatibility by using the old type in place of the current type.
371-
* If this test starts failing, it indicates a change that is not forward compatible.
372-
* To acknowledge the breaking change, add the following to package.json under
373-
* typeValidation.broken:
374-
* "Interface_ISignalEnvelope": {"forwardCompat": false}
375-
*/
376-
declare type old_as_current_for_Interface_ISignalEnvelope = requireAssignableTo<TypeOnly<old.ISignalEnvelope>, TypeOnly<current.ISignalEnvelope>>
377-
378-
/*
379-
* Validate backward compatibility by using the current type in place of the old type.
380-
* If this test starts failing, it indicates a change that is not backward compatible.
381-
* To acknowledge the breaking change, add the following to package.json under
382-
* typeValidation.broken:
383-
* "Interface_ISignalEnvelope": {"backCompat": false}
384-
*/
385-
declare type current_as_old_for_Interface_ISignalEnvelope = requireAssignableTo<TypeOnly<current.ISignalEnvelope>, TypeOnly<old.ISignalEnvelope>>
386-
387315
/*
388316
* Validate forward compatibility by using the old type in place of the current type.
389317
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -456,24 +384,6 @@ declare type old_as_current_for_Interface_IThrottlingWarning = requireAssignable
456384
*/
457385
declare type current_as_old_for_Interface_IThrottlingWarning = requireAssignableTo<TypeOnly<current.IThrottlingWarning>, TypeOnly<old.IThrottlingWarning>>
458386

459-
/*
460-
* Validate forward compatibility by using the old type in place of the current type.
461-
* If this test starts failing, it indicates a change that is not forward compatible.
462-
* To acknowledge the breaking change, add the following to package.json under
463-
* typeValidation.broken:
464-
* "Interface_IUsageError": {"forwardCompat": false}
465-
*/
466-
declare type old_as_current_for_Interface_IUsageError = requireAssignableTo<TypeOnly<old.IUsageError>, TypeOnly<current.IUsageError>>
467-
468-
/*
469-
* Validate backward compatibility by using the current type in place of the old type.
470-
* If this test starts failing, it indicates a change that is not backward compatible.
471-
* To acknowledge the breaking change, add the following to package.json under
472-
* typeValidation.broken:
473-
* "Interface_IUsageError": {"backCompat": false}
474-
*/
475-
declare type current_as_old_for_Interface_IUsageError = requireAssignableTo<TypeOnly<current.IUsageError>, TypeOnly<old.IUsageError>>
476-
477387
/*
478388
* Validate forward compatibility by using the old type in place of the current type.
479389
* If this test starts failing, it indicates a change that is not forward compatible.
@@ -753,15 +663,6 @@ declare type current_as_old_for_Variable_IFluidHandleContext = requireAssignable
753663
*/
754664
declare type current_as_old_for_Variable_IFluidLoadable = requireAssignableTo<TypeOnly<typeof current.IFluidLoadable>, TypeOnly<typeof old.IFluidLoadable>>
755665

756-
/*
757-
* Validate backward compatibility by using the current type in place of the old type.
758-
* If this test starts failing, it indicates a change that is not backward compatible.
759-
* To acknowledge the breaking change, add the following to package.json under
760-
* typeValidation.broken:
761-
* "Variable_IFluidRunnable": {"backCompat": false}
762-
*/
763-
declare type current_as_old_for_Variable_IFluidRunnable = requireAssignableTo<TypeOnly<typeof current.IFluidRunnable>, TypeOnly<typeof old.IFluidRunnable>>
764-
765666
/*
766667
* Validate backward compatibility by using the current type in place of the old type.
767668
* If this test starts failing, it indicates a change that is not backward compatible.

packages/common/core-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,6 @@
147147
},
148148
"typeValidation": {
149149
"broken": {},
150-
"entrypoint": "internal"
150+
"entrypoint": "legacy"
151151
}
152152
}

0 commit comments

Comments
 (0)