MCPcopy Index your code
hub / github.com/nukeop/nuclear / load

Method load

packages/player/src/services/plugins/PluginLoader.ts:161–180  ·  view source on GitHub ↗
(api?: NuclearPluginAPI)

Source from the content-addressed store, hash-verified

159 }
160
161 async load(api?: NuclearPluginAPI): Promise<LoadedPlugin> {
162 Logger.plugins.debug(`Loading plugin from ${this.path}`);
163 const manifest = this.manifest ?? (await this.readManifest());
164 const metadata = this.buildMetadata(manifest);
165 this.entryPath = await this.resolveEntryPath(manifest);
166 const code = await this.readPluginCode(this.entryPath);
167 const instance = this.evaluatePlugin(code);
168 if (instance.onLoad && api) {
169 Logger.plugins.debug(`Calling onLoad for ${metadata.id}`);
170 await instance.onLoad(api);
171 }
172 Logger.plugins.info(
173 `Plugin ${metadata.id}@${metadata.version} loaded successfully`,
174 );
175 return {
176 metadata,
177 instance,
178 path: this.path,
179 };
180 }
181
182 getWarnings(): string[] {
183 return this.warnings;

Callers 6

loadPluginDataFunction · 0.95
CrossfadeSoundFunction · 0.45
useAudioLoaderFunction · 0.45
useHlsSourceFunction · 0.45

Calls 7

readManifestMethod · 0.95
buildMetadataMethod · 0.95
resolveEntryPathMethod · 0.95
readPluginCodeMethod · 0.95
evaluatePluginMethod · 0.95
debugMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected