diff --git a/desktop/scripts/build-release.ts b/desktop/scripts/build-release.ts index 021f8648c..696bd0156 100755 --- a/desktop/scripts/build-release.ts +++ b/desktop/scripts/build-release.ts @@ -262,7 +262,7 @@ function downloadIcons(buildFolder: string) { console.log('Created build directory', dir); await compileMain(); - await generatePluginEntryPoints(); + await generatePluginEntryPoints(argv.channel === 'insiders'); await copyStaticFolder(dir); await downloadIcons(dir); await compileRenderer(dir); diff --git a/desktop/scripts/build-utils.ts b/desktop/scripts/build-utils.ts index 88a189987..fe3107e60 100644 --- a/desktop/scripts/build-utils.ts +++ b/desktop/scripts/build-utils.ts @@ -30,24 +30,58 @@ const {version} = require('../package.json'); const dev = process.env.NODE_ENV !== 'production'; +// For insiders builds we bundle into them all the device plugins, +// plus top 10 "universal" plugins starred by more than 100 users. +const hardcodedPlugins = new Set([ + // Device plugins + 'DeviceLogs', + 'CrashReporter', + 'MobileBuilds', + 'DeviceCPU', + 'Tracery', + 'Hermesdebuggerrn', + 'kaios-big-allocations', + 'kaios-graphs', + 'React', + // Popular client plugins + 'Inspector', + 'Network', + 'AnalyticsLogging', + 'GraphQL', + 'UIPerf', + 'MobileConfig', + 'Databases', + 'FunnelLogger', + 'Navigation', + 'Fresco', + 'Preferences', +]); + export function die(err: Error) { console.error(err.stack); process.exit(1); } -export async function generatePluginEntryPoints() { - console.log('⚙️ Generating plugin entry points...'); - const sourcePlugins = await getSourcePlugins(); - const bundledPlugins = sourcePlugins.map( - (p) => - ({ - ...p, - isBundled: true, - version: p.version === '0.0.0' ? version : p.version, - flipperSDKVersion: - p.flipperSDKVersion === '0.0.0' ? version : p.flipperSDKVersion, - } as BundledPluginDetails), +export async function generatePluginEntryPoints( + isInsidersBuild: boolean = false, +) { + console.log( + `⚙️ Generating plugin entry points (isInsidersBuils=${isInsidersBuild})...`, ); + const sourcePlugins = await getSourcePlugins(); + const bundledPlugins = sourcePlugins + // we only include predefined set of plugins into insiders release + .filter((p) => !isInsidersBuild || hardcodedPlugins.has(p.id)) + .map( + (p) => + ({ + ...p, + isBundled: true, + version: p.version === '0.0.0' ? version : p.version, + flipperSDKVersion: + p.flipperSDKVersion === '0.0.0' ? version : p.flipperSDKVersion, + } as BundledPluginDetails), + ); if (await fs.pathExists(defaultPluginsIndexDir)) { await fs.remove(defaultPluginsIndexDir); } diff --git a/desktop/scripts/start-dev-server.ts b/desktop/scripts/start-dev-server.ts index 6de165085..146ebd9f8 100644 --- a/desktop/scripts/start-dev-server.ts +++ b/desktop/scripts/start-dev-server.ts @@ -381,7 +381,7 @@ function checkDevServer() { (async () => { checkDevServer(); - await generatePluginEntryPoints(); + await generatePluginEntryPoints(argv.channel === 'insiders'); await ensurePluginFoldersWatchable(); const port = await detect(DEFAULT_PORT); const {app, server} = await startAssetServer(port);