-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from kamiazya/dybanic-plugin-loader
feat: refactor Dynamic Plugin Loader arcitecture
- Loading branch information
Showing
16 changed files
with
155 additions
and
139 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'urlpattern-polyfill' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'urlpattern-polyfill' |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
import { Storage } from '@pluggable-io/storage' | ||
|
||
/** | ||
* @beta This API is in beta and may change between minor versions. | ||
*/ | ||
export const PLUG_AND_PLAY = Object.freeze({ | ||
STORAGE: Object.freeze({ | ||
'gs:': () => import('@pluggable-io/storage-plugin-gs/pnp'), | ||
}), | ||
Storage.addDynamicPluginLoader('gs:', async () => { | ||
await import('@pluggable-io/storage-plugin-gs/pnp') | ||
}) | ||
|
||
for (const [protocol, plugin] of Object.entries(PLUG_AND_PLAY.STORAGE)) { | ||
Storage.PLUGIN_PLUG_AND_PLAY[protocol] = plugin | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
import { Storage } from '@pluggable-io/storage' | ||
import { Logger } from '@pluggable-io/logger' | ||
|
||
/** | ||
* @beta This API is in beta and may change between minor versions. | ||
*/ | ||
export const PLUG_AND_PLAY = Object.freeze({ | ||
STORAGE: Object.freeze({ | ||
'file:': () => import('@pluggable-io/storage-plugin-file/pnp'), | ||
}), | ||
LOGGER: Object.freeze({ | ||
'console:': () => import('@pluggable-io/logger-plugin-console/pnp'), | ||
}), | ||
Storage.addDynamicPluginLoader('file:', async () => { | ||
await import('@pluggable-io/storage-plugin-file/pnp') | ||
}) | ||
Logger.addDynamicPluginLoader('console:', async () => { | ||
await import('@pluggable-io/logger-plugin-console/pnp') | ||
}) | ||
|
||
for (const [protocol, plugin] of Object.entries(PLUG_AND_PLAY.STORAGE)) { | ||
Storage.PLUGIN_PLUG_AND_PLAY[protocol] = plugin | ||
} | ||
for (const [protocol, plugin] of Object.entries(PLUG_AND_PLAY.LOGGER)) { | ||
Logger.PLUGIN_PLUG_AND_PLAY[protocol] = plugin | ||
} |
Oops, something went wrong.