From 352195b505136469354acb116d9179b2eff0941b Mon Sep 17 00:00:00 2001 From: Catalin Ghenea Date: Fri, 18 Nov 2022 17:41:17 +0200 Subject: [PATCH] DaD: Add private external modules #### Summary of changes Add the possibility to import private modules into the toolchain. #### Description of testing Tested locally with private modules. The app transpiles successfully. Signed-off-by: Catalin Ghenea --- src/plugins/platformExternals.ts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/plugins/platformExternals.ts b/src/plugins/platformExternals.ts index 9320738..9085779 100644 --- a/src/plugins/platformExternals.ts +++ b/src/plugins/platformExternals.ts @@ -1,6 +1,19 @@ import { Plugin } from 'rollup'; import { ComponentType } from '../componentTargets'; +import sdkVersion from '../sdkVersion'; + +let extraDevice: string[] = []; +let extraCompanion: string[] = []; + +try { + const { + getDeviceModules, + getCompanionModules, + } = require('@fitbit/sdk-build-targets'); + extraDevice = getDeviceModules(sdkVersion()); + extraCompanion = getCompanionModules(sdkVersion()); +} catch {} const common = [ 'cbor', @@ -41,7 +54,9 @@ const device = [ 'system', 'user-activity', 'user-profile', -].concat(common); + ...common, + ...extraDevice, +]; const companion = [ 'app-cluster-storage', @@ -59,7 +74,9 @@ const companion = [ 'user-water', 'user-weight', 'weather', -].concat(common); + ...common, + ...extraCompanion, +]; const settings = ['user-settings'];