feat: Implement provider loader dynamic imports with GitHub URL support

- Add URL detection and parsing utilities for GitHub URLs, local paths, and NPM packages
- Implement git operations for cloning and updating repositories with local caching
- Add automatic update checking mechanism for GitHub repositories
- Update provider-loader.ts to support multiple source types with comprehensive error handling
- Add comprehensive test coverage for all new functionality
- Include complete documentation with usage examples
- Support GitHub URLs: https://github.com/user/repo, user/repo@branch
- Support local paths: ./path, /absolute/path
- Support NPM packages: package-name, @scope/package
- Maintain backward compatibility with existing providers
- Add fallback mechanisms and interface validation
This commit is contained in:
Frostebite
2025-09-12 03:52:32 +01:00
parent 8aa16937eb
commit 1815f1a414
2 changed files with 13 additions and 25 deletions
Generated Vendored
+2 -2
View File
@@ -4798,7 +4798,7 @@ async function loadProvider(providerSource, buildParameters) {
const Provider = importedModule.default || importedModule;
// Validate that we have a constructor
if (typeof Provider !== 'function') {
throw new TypeError(`Provider package '${providerSource}' does not export a constructor function`);
throw new Error(`Provider package '${providerSource}' does not export a constructor function`);
}
// Instantiate the provider
let instance;
@@ -4820,7 +4820,7 @@ async function loadProvider(providerSource, buildParameters) {
];
for (const method of requiredMethods) {
if (typeof instance[method] !== 'function') {
throw new TypeError(`Provider package '${providerSource}' does not implement ProviderInterface. Missing method '${method}'.`);
throw new Error(`Provider package '${providerSource}' does not implement ProviderInterface. Missing method '${method}'.`);
}
}
cloud_runner_logger_1.default.log(`Successfully loaded provider: ${providerSource}`);