flipper-server-companion
Advanced tools
Comparing version 0.172.0 to 0.173.0
@@ -12,7 +12,7 @@ "use strict"; | ||
async requirePluginImpl(pluginDetails) { | ||
const plugin = await (0, flipper_frontend_core_1.getRenderHostInstance)().requirePlugin(pluginDetails.entry); | ||
if (!plugin) { | ||
const requiredPlugin = await (0, flipper_frontend_core_1.getRenderHostInstance)().requirePlugin(pluginDetails.entry); | ||
if (!requiredPlugin || !requiredPlugin.plugin) { | ||
throw new Error(`Failed to obtain plugin source for: ${pluginDetails.name}`); | ||
} | ||
return new flipper_plugin_core_1._SandyPluginDefinition(pluginDetails, plugin); | ||
return new flipper_plugin_core_1._SandyPluginDefinition(pluginDetails, requiredPlugin.plugin); | ||
} | ||
@@ -19,0 +19,0 @@ async filterAllLocalVersions(allLocalVersions) { |
@@ -21,3 +21,3 @@ "use strict"; | ||
}, | ||
openLink(url) { | ||
openLink(_url) { | ||
throw new Error('Not implemented'); | ||
@@ -44,9 +44,10 @@ }, | ||
async requirePlugin(path) { | ||
let source = await flipperServer.exec('plugin-source', path); | ||
source += `\n//# sourceURL=file://${path}`; | ||
source += `\n//# sourceMappingURL=file://${path.replace(/.js$/, '.map')}`; | ||
const cjsLoader = eval('(module) => {' + source + '\n}'); | ||
const source = await flipperServer.exec('plugin-source', path); | ||
let js = source.js; | ||
js += `\n//# sourceURL=file://${path}`; | ||
js += `\n//# sourceMappingURL=file://${path.replace(/.js$/, '.map')}`; | ||
const cjsLoader = eval('(module) => {' + js + '\n}'); | ||
const theModule = { exports: {} }; | ||
cjsLoader(theModule); | ||
return theModule.exports; | ||
return { plugin: theModule.exports }; | ||
}, | ||
@@ -53,0 +54,0 @@ getStaticResourceUrl(path) { |
{ | ||
"name": "flipper-server-companion", | ||
"version": "0.172.0", | ||
"version": "0.173.0", | ||
"description": "Runs Flipper plugins on Flipper Server", | ||
@@ -12,5 +12,5 @@ "repository": "facebook/flipper", | ||
"dependencies": { | ||
"flipper-common": "0.172.0", | ||
"flipper-frontend-core": "0.172.0", | ||
"flipper-plugin-core": "0.172.0", | ||
"flipper-common": "0.173.0", | ||
"flipper-frontend-core": "0.173.0", | ||
"flipper-plugin-core": "0.173.0", | ||
"immer": "^9.0.12" | ||
@@ -17,0 +17,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59661
671
+ Addedflipper-common@0.173.0(transitive)
+ Addedflipper-frontend-core@0.173.0(transitive)
+ Addedflipper-plugin-core@0.173.0(transitive)
- Removedflipper-common@0.172.0(transitive)
- Removedflipper-frontend-core@0.172.0(transitive)
- Removedflipper-plugin-core@0.172.0(transitive)
Updatedflipper-common@0.173.0
Updatedflipper-plugin-core@0.173.0