mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-17 13:36:48 -07:00
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:
+2
-2
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user