From 466018eea08620b3f11f7f0dec0efa33b063f35e Mon Sep 17 00:00:00 2001 From: Alfredo Gallardo Date: Thu, 26 Oct 2023 18:48:49 -0300 Subject: [PATCH] - feature: added local dev tooling for android --- apps/shinkai-app/capacitor.config.ts | 4 +++- apps/shinkai-app/package.json | 5 ++++- apps/shinkai-app/project.json | 15 ++++++++++++++- apps/shinkai-app/vite.config.ts | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/apps/shinkai-app/capacitor.config.ts b/apps/shinkai-app/capacitor.config.ts index 0b57c271b..99faaa0b0 100644 --- a/apps/shinkai-app/capacitor.config.ts +++ b/apps/shinkai-app/capacitor.config.ts @@ -5,7 +5,9 @@ const config: CapacitorConfig = { appName: 'Shinkai', webDir: '../../dist/apps/shinkai-app', server: { - androidScheme: 'https' + androidScheme: 'https', + url: process.env.SERVE ? 'http://10.0.2.2:9000' : undefined, + cleartext: process.env.SERVE ? true : false, } }; diff --git a/apps/shinkai-app/package.json b/apps/shinkai-app/package.json index 122aa365c..e262f4878 100644 --- a/apps/shinkai-app/package.json +++ b/apps/shinkai-app/package.json @@ -3,5 +3,8 @@ "private": true, "version": "0.0.1", "type": "module", - "description": "Shinkai Multiplatform App" + "description": "Shinkai Multiplatform App", + "scripts": { + "serve:android": "SERVE=true npx cap run android" + } } diff --git a/apps/shinkai-app/project.json b/apps/shinkai-app/project.json index 53319d1e4..45f9358f8 100644 --- a/apps/shinkai-app/project.json +++ b/apps/shinkai-app/project.json @@ -57,7 +57,8 @@ "executor": "@nx/vite:dev-server", "defaultConfiguration": "development", "options": { - "buildTarget": "shinkai-app:build" + "buildTarget": "shinkai-app:build", + "port": 9000 }, "configurations": { "development": { @@ -70,6 +71,18 @@ } } }, + "serve:android": { + "executor": "nx:run-script", + "defaultConfiguration": "development", + "options": { + "cwd": "apps/shinkai-app", + "script": "serve:android" + }, + "configurations": { + "development": {}, + "production": {} + } + }, "preview": { "executor": "@nx/vite:preview-server", "defaultConfiguration": "development", diff --git a/apps/shinkai-app/vite.config.ts b/apps/shinkai-app/vite.config.ts index 0dc09a047..f78725b0b 100644 --- a/apps/shinkai-app/vite.config.ts +++ b/apps/shinkai-app/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ server: { port: 4200, - host: 'localhost', + host: true, fs: { // Important to server files two levels ahead of the project folder allow: ['../../'],