From 9878ea5827fb99e69f34ffad9253c22eac7cfe21 Mon Sep 17 00:00:00 2001 From: Pavel Jacko Date: Wed, 6 Mar 2024 11:54:46 +0100 Subject: [PATCH] add integration to app-harness --- buildHooks/src/prePublish.ts | 1 + packages/app-harness/package.json | 1 + packages/app-harness/renative.json | 8 +++++++- packages/cli/src/logger/index.ts | 2 +- packages/integration-starter/package.json | 2 +- .../integration-starter/src/tasks/taskStarterHello.ts | 11 +++++------ 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/buildHooks/src/prePublish.ts b/buildHooks/src/prePublish.ts index 6f65a8677a..66a4c1679d 100644 --- a/buildHooks/src/prePublish.ts +++ b/buildHooks/src/prePublish.ts @@ -29,6 +29,7 @@ const VERSIONED_PACKAGES = [ 'sdk-webos', 'sdk-utils', 'renative', + 'integration-docker', ]; type PackageConfig = { diff --git a/packages/app-harness/package.json b/packages/app-harness/package.json index c2d57863f5..97017891fb 100644 --- a/packages/app-harness/package.json +++ b/packages/app-harness/package.json @@ -68,6 +68,7 @@ "@rnv/engine-rn-next": "1.0.0-rc.12", "@rnv/engine-rn-tvos": "1.0.0-rc.12", "@rnv/engine-rn-web": "1.0.0-rc.12", + "@rnv/integration-starter": "1.0.0-rc.12", "@rnv/template-starter": "1.0.0-rc.12", "@types/react": "18.2.52", "@types/react-dom": "18.2.18", diff --git a/packages/app-harness/renative.json b/packages/app-harness/renative.json index f3a80bd476..e16ab72834 100644 --- a/packages/app-harness/renative.json +++ b/packages/app-harness/renative.json @@ -5,6 +5,9 @@ "crypto": { "path": "./secrets/privateConfigs.enc" }, + "integrations": { + "@rnv/integration-starter": {} + }, "plugins": { "react-native-splash-screen": { "android": { @@ -151,7 +154,10 @@ "templateXcode": { "AppDelegate_h": { "appDelegateExtensions": ["UNUserNotificationCenterDelegate"], - "appDelegateImports": ["", ""] + "appDelegateImports": [ + "", + "" + ] }, "AppDelegate_mm": { "appDelegateImports": [""], diff --git a/packages/cli/src/logger/index.ts b/packages/cli/src/logger/index.ts index d92574961e..cc0054a9d9 100644 --- a/packages/cli/src/logger/index.ts +++ b/packages/cli/src/logger/index.ts @@ -525,7 +525,7 @@ export const logSuccess = (msg: string) => { message: stripAnsi(_sanitizePaths(msg)), }); } - logAndSave(currentChalk.magenta(`success:${_getCurrentTask()} ${_sanitizePaths(msg)}`)); + logAndSave(currentChalk.magenta(`success: ${_getCurrentTask()} ${_sanitizePaths(msg)}`)); }; export const logError = (e: Error | string | unknown, isEnd = false, skipAnalytics = false) => { diff --git a/packages/integration-starter/package.json b/packages/integration-starter/package.json index 4cf1f18d1f..2ba5b3881e 100644 --- a/packages/integration-starter/package.json +++ b/packages/integration-starter/package.json @@ -1,6 +1,6 @@ { "name": "@rnv/integration-starter", - "version": "1.0.0-rc.11", + "version": "1.0.0-rc.12", "description": "ReNative Example Integration", "keywords": [ "renative", diff --git a/packages/integration-starter/src/tasks/taskStarterHello.ts b/packages/integration-starter/src/tasks/taskStarterHello.ts index c2471d7331..53848d33b3 100644 --- a/packages/integration-starter/src/tasks/taskStarterHello.ts +++ b/packages/integration-starter/src/tasks/taskStarterHello.ts @@ -1,16 +1,15 @@ -import { RnvContext, logTask, RnvTaskOptionPresets, logSuccess, RnvTask } from '@rnv/core'; +import { RnvContext, RnvTaskOptionPresets, logSuccess, RnvTask, RnvTaskFn } from '@rnv/core'; -const taskStarterHello = async (_c: RnvContext) => { - logTask('taskStarterHello'); - - logSuccess('Hello from Integration Starter!'); +const taskStarterHello: RnvTaskFn = async (c: RnvContext) => { + logSuccess(`Hello from Integration Starter! +--my-opt: "${c.program.myOpt}"`); }; const Task: RnvTask = { description: 'Prints hello message', fn: taskStarterHello, task: 'starter hello', - options: RnvTaskOptionPresets.withBase(), + options: RnvTaskOptionPresets.withBase([{ key: 'my-opt', description: 'Hello', value: 'value' }]), platforms: [], };