Handle plugin manifest object as immutable#325
Conversation
66e47ec to
8359813
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@vojtechszocs: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #325 +/- ##
==========================================
+ Coverage 30.70% 30.93% +0.23%
==========================================
Files 75 75
Lines 1964 1972 +8
Branches 349 350 +1
==========================================
+ Hits 603 610 +7
- Misses 1332 1333 +1
Partials 29 29 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add optional peer dependency on
type-festto lib-core and lib-webpackCannot bundle
type-festtypes in generateddist/index.d.tsproperly via API ExtractorbundledPackagesoption due to some types not exported properly, e.g.ReadonlyMapDeepused inReadonlyDeeptriggers theae-forgotten-exportwarning which cannot be avoided.Suppressing the
ae-forgotten-exportwarnings globally is not feasible. Using a customtsdoc.jsonis also not feasible since API Extractor looks fortsdoc.jsonfiles relative to each source file's package and the lookup stops at the package boundary.Handle plugin manifest object as immutable outside
PluginStoreimpl.Calling
PluginStore.add{Pending,Loaded,Failed}Pluginmethods will deep freeze the manifest object.Plugin manifest should be treated as read-only (immutable) by consumers. Attempts to modify parts of the plugin manifest should now fail as per
Object.freezecontract.All objects returned from
PluginStore.getPluginInfomethod now usemanifest: ReadonlyDeep<PluginManifest>.Additional changes
freezeDeeputility in lib-core packageLoadedPlugin['loadedExtensions']type changed toReadonly<Readonly<LoadedExtension>[]>