refactor(file-input): extract storage providers into modular plugin packages#14
Open
OrangeGEProton wants to merge 2 commits intomasterfrom
Open
refactor(file-input): extract storage providers into modular plugin packages#14OrangeGEProton wants to merge 2 commits intomasterfrom
OrangeGEProton wants to merge 2 commits intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor file-input to Support Modular Provider Plugins
Closes #13
Problem
Storage providers (MongoDB, SQLite, Azure, S3) were hardcoded inside
@startupjs-ui/file-inputwithif/elsedynamic imports. SDK dependencies were listed as optional peers with"*"versions — leading to manual installs, version drift, and no extensibility.Solution
Introduced a plugin registry pattern:
providers/registry.js— centralregisterProvider(name, provider)/getProvider(name)API@startupjs-ui/file-input-provider-mongo(mongodb@^6.12.0)@startupjs-ui/file-input-provider-sqlite(built-in)@startupjs-ui/file-input-provider-azure(@azure/storage-blob@^12.26.0)@startupjs-ui/file-input-provider-s3(@aws-sdk/client-s3@^3.600.0)How it works
The core
providers/index.jsresolves providers from the registry at runtime — no hardcoded imports.Changes
packages/file-input/providers/registry.jspackages/file-input/providers/index.jsimport()packages/file-input/package.json@aws-sdk/*,@azure/*,mongodb); added./providers/registryexportpackages/file-input/providers/{awsS3,azureblob,mongo,sqlite}.jspackages/file-input-provider-{mongo,sqlite,azure,s3}/packages/file-input/README.mdxMigration
Checks
yarn install— all packages linked via workspacesyarn eslint— no errorsyarn tsc --noEmit --skipLibCheck— no errors