mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-01-29 03:59:08 +08:00
feat: Fix provider-loader tests and URL parser consistency
- Fixed provider-loader test failures (constructor validation, module imports) - Fixed provider-url-parser to return consistent base URLs for GitHub sources - Updated error handling to use TypeError consistently - All provider-loader and provider-url-parser tests now pass - Fixed prettier and eslint formatting issues
This commit is contained in:
6
dist/index.js
generated
vendored
6
dist/index.js
generated
vendored
@@ -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 Error(`Provider package '${providerSource}' does not export a constructor function`);
|
||||
throw new TypeError(`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 Error(`Provider package '${providerSource}' does not implement ProviderInterface. Missing method '${method}'.`);
|
||||
throw new TypeError(`Provider package '${providerSource}' does not implement ProviderInterface. Missing method '${method}'.`);
|
||||
}
|
||||
}
|
||||
cloud_runner_logger_1.default.log(`Successfully loaded provider: ${providerSource}`);
|
||||
@@ -4896,7 +4896,7 @@ function parseProviderSource(source) {
|
||||
repo,
|
||||
branch: branch || 'main',
|
||||
path: path || '',
|
||||
url: source,
|
||||
url: `https://github.com/${owner}/${repo}`,
|
||||
};
|
||||
}
|
||||
// Check if it's a GitHub SSH URL
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -40,7 +40,7 @@ export function parseProviderSource(source: string): ProviderSourceInfo {
|
||||
repo,
|
||||
branch: branch || 'main',
|
||||
path: path || '',
|
||||
url: source,
|
||||
url: `https://github.com/${owner}/${repo}`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user