@seeka-labs/cli-apps 3.4.3 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,20 +5,22 @@
5
5
  ### First run
6
6
  `yarn dev:init`
7
7
 
8
- - server + ui
9
- - `clear && yarn dev`
10
- - separate terminal `clear && yarn dev:server`
11
- - separate terminal `clear && yarn dev:ui`
12
- - separate terminal `clear && yarn watch:server`
13
- - separate terminal `yarn tunnel`
14
- - server only
15
- - `clear && yarn dev`
16
- - separate terminal `clear && yarn dev:server`
17
- - separate terminal `clear && yarn watch:server`
18
- - separate terminal `yarn tunnel`
8
+ 1. `yarn clean`
9
+ 2. Run
10
+ - server + browser plugin + ui
11
+ - `clear && yarn start:all`
12
+ - server + browser plugin
13
+ - `clear && yarn start:server`
19
14
 
20
- # updating all deps
15
+ ### Updating packages
21
16
 
17
+ #### Seeka SDK packages
18
+ ```
19
+ cd repo root
20
+ yarn up "@seeka-labs/*" --mode=update-lockfile
21
+ ```
22
+
23
+ #### All packages
22
24
  ```
23
25
  cd repo root
24
26
  npx npm-check-updates@latest -i --workspaces --target minor && npx npm-check-updates@latest -i --workspaces --target minor --dep peer && npx npm-check-updates@latest -i --workspaces --target latest && npx npm-check-updates@latest -i --workspaces --target latest --dep peer
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@example-org-name/example-app-name-browser",
3
- "version": "3.4.3",
3
+ "version": "3.5.0",
4
4
  "description": "Seeka app browser plugin example-app-name",
5
5
  "author": "Seeka company <support@seeka.co>",
6
6
  "private": true,
@@ -12,9 +12,9 @@
12
12
  "lint": "eslint --fix src/ --ext .ts",
13
13
  "typecheck": "tsc --noEmit",
14
14
  "clean": "rimraf dist build package",
15
- "build": "yarn clean && node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin",
16
- "build:dev": "yarn clean && node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin dev",
17
- "watch": "yarn clean && node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin dev watch"
15
+ "build": "node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin",
16
+ "build:dev": "node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin dev",
17
+ "watch": "node ./scripts/esbuild/build-browser-plugin.mjs seeka-browser-plugin ExampleAppAppConvergeSdkPlugin dev watch"
18
18
  },
19
19
  "dependencies": {
20
20
  "@example-org-name/example-app-name-lib": "workspace:*",
@@ -103,15 +103,26 @@ if (watchBuild) {
103
103
  })
104
104
 
105
105
  // Support stopping
106
- var stdin = process.stdin;
107
- stdin.setRawMode(true);
108
- stdin.resume();
109
- stdin.setEncoding('utf8');
110
- stdin.on('data', function (key) {
106
+ const stopWatch = () => {
111
107
  console.log('Stopping watch...');
112
- monitorInstance.stop();
113
- process.exit();
114
- });
108
+ try {
109
+ monitorInstance?.stop();
110
+ }
111
+ finally {
112
+ process.exit();
113
+ }
114
+ };
115
+
116
+ process.on('SIGINT', stopWatch);
117
+ process.on('SIGTERM', stopWatch);
118
+
119
+ const stdin = process.stdin;
120
+ if (stdin?.isTTY && typeof stdin.setRawMode === 'function') {
121
+ stdin.setRawMode(true);
122
+ stdin.resume();
123
+ stdin.setEncoding('utf8');
124
+ stdin.on('data', stopWatch);
125
+ }
115
126
  }
116
127
  else {
117
128
  await build(opts);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@example-org-name/example-app-name-lib",
3
- "version": "3.4.3",
3
+ "version": "3.5.0",
4
4
  "description": "Seeka app library for example-app-name",
5
5
  "author": "Seeka <administrator@seeka.co>",
6
6
  "license": "MIT",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@example-org-name/example-app-name-server-azurefunc",
3
- "version": "3.4.3",
3
+ "version": "3.5.0",
4
4
  "description": "Seeka Azure Serverless function app example-app-name",
5
5
  "author": "Seeka <administrator@seeka.co>",
6
6
  "license": "MIT",
@@ -13,9 +13,9 @@
13
13
  "lint": "eslint",
14
14
  "typecheck": "tsc --noEmit",
15
15
  "build": "tsc",
16
- "watch": "yarn clean && tsc -w",
16
+ "watch": "tsc -w",
17
17
  "clean": "rimraf dist",
18
- "prestart": "yarn clean && yarn build",
18
+ "prestart": "yarn build",
19
19
  "dev": "func start --port 7072",
20
20
  "tunnel": "ngrok http 7072 --hostname=seeka-app-example-app-name-localdev.au.ngrok.io --region au --log=stdout --log-format=term",
21
21
  "deploy": "func azure functionapp publish example-app-name --no-build --javascript",
@@ -61,7 +61,6 @@
61
61
  "@typescript-eslint/eslint-plugin": "^8",
62
62
  "@typescript-eslint/parser": "^8",
63
63
  "eslint": "^9",
64
- "ngrok": "^5.0.0-beta.2",
65
64
  "rimraf": "^6",
66
65
  "typescript": "^5"
67
66
  }
@@ -1,14 +1,14 @@
1
- import { ExampleAppAppInstallState } from "@example-org-name/example-app-name-lib";
2
- import {getInstallationSettings} from "./routes/getInstallationSettings";
3
- import {setInstallationSettings} from "./routes/setInstallationSettings";
4
- import { SeekaAppInstallContext } from "@seeka-labs/sdk-apps-core";
5
- import { Logger } from "winston";
6
- import { AppUiHttpRequestResponse, HttpMethod } from "@seeka-labs/sdk-apps-server-host";
7
- import {HttpRequest, InvocationContext} from "@azure/functions";
8
-
9
- export const apiRouteHandler = async (req: HttpRequest, context: InvocationContext, requestedPath: string, requestedMethod: HttpMethod, installation: SeekaAppInstallContext<ExampleAppAppInstallState>, logger: Logger ): Promise<AppUiHttpRequestResponse | null> => {
10
- if (requestedPath === '/api/settings' && requestedMethod === 'GET') return await getInstallationSettings(installation, req, context, logger);
11
- if (requestedPath === '/api/settings' && requestedMethod === 'POST') return await setInstallationSettings(installation, req, context, logger);
12
-
13
- return null;
1
+ import {ExampleAppAppInstallContext, ExampleAppAppInstallState} from "@example-org-name/example-app-name-lib";
2
+ import {getInstallationSettings} from "./routes/getInstallationSettings";
3
+ import {setInstallationSettings} from "./routes/setInstallationSettings";
4
+ import { SeekaAppInstallContext } from "@seeka-labs/sdk-apps-core";
5
+ import { Logger } from "winston";
6
+ import { AppUiHttpRequestResponse, HttpMethod } from "@seeka-labs/sdk-apps-server-host";
7
+ import {HttpRequest, InvocationContext} from "@azure/functions";
8
+
9
+ export const apiRouteHandler = async (req: HttpRequest, context: InvocationContext, requestedPath: string, requestedMethod: HttpMethod, installation: ExampleAppAppInstallContext, logger: Logger ): Promise<AppUiHttpRequestResponse | null> => {
10
+ if (requestedPath === '/api/settings' && requestedMethod === 'GET') return await getInstallationSettings(installation, req, context, logger);
11
+ if (requestedPath === '/api/settings' && requestedMethod === 'POST') return await setInstallationSettings(installation, req, context, logger);
12
+
13
+ return null;
14
14
  }
@@ -1,5 +1,9 @@
1
1
  import {app, HttpRequest, HttpResponseInit, InvocationContext} from '@azure/functions';
2
- import { ExampleAppAppInstallState, ExampleAppAppUiClientInitState } from "@example-org-name/example-app-name-lib";
2
+ import {
3
+ ExampleAppAppInstallContext,
4
+ ExampleAppAppInstallState,
5
+ ExampleAppAppUiClientInitState
6
+ } from "@example-org-name/example-app-name-lib";
3
7
  import { SeekaAppInstallContext } from "@seeka-labs/sdk-apps-core";
4
8
 
5
9
  import { generateAppUiHttpRequestResponse, HttpMethod} from '@seeka-labs/sdk-apps-server-host';
@@ -16,7 +20,7 @@ app.http('ui', {
16
20
 
17
21
  // Function to serve the React app under /app
18
22
  export async function ui(req: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
19
- const createBrowserInitState = async (installation: SeekaAppInstallContext<ExampleAppAppInstallState>, logger: Logger ): Promise<ExampleAppAppUiClientInitState> => {
23
+ const createBrowserInitState = async (installation: ExampleAppAppInstallContext, logger: Logger ): Promise<ExampleAppAppUiClientInitState> => {
20
24
  // Under no circumstances should internal or private api keys be exposed to the client/browser via the below object
21
25
  // Below state will be passed in plain text to the UI app, important to be selective (no spread operators on installation state)
22
26
  // and not expose any internal or private api keys to the client/browser
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@example-org-name/example-app-name-ui",
3
- "version": "3.4.3",
3
+ "version": "3.5.0",
4
4
  "description": "Seeka app UI for example-app-name",
5
5
  "author": "Seeka <administrator@seeka.co>",
6
6
  "license": "MIT",
@@ -1,4 +1,10 @@
1
- import {SeekaAppWizardStep, SeekaAppWizardHeading, SeekaAppWizardStepContent, SeekaAppWizardStepActions} from "@seeka-labs/sdk-apps-react";
1
+ import {
2
+ SeekaAppWizardStep,
3
+ SeekaAppWizardHeading,
4
+ SeekaAppWizardStepContent,
5
+ SeekaAppWizardStepActions,
6
+ appApi
7
+ } from "@seeka-labs/sdk-apps-react";
2
8
  import { Button } from "@mui/material"
3
9
  import seekaAppIcon from '../../../../assets/app-icon.svg'
4
10
 
@@ -7,7 +13,10 @@ type Props = {
7
13
  onBack?: () => void
8
14
  }
9
15
 
10
- export const AppSetupSecondStep = ({ onNext, onBack }: Props) => { return (
16
+ export const AppSetupSecondStep = ({ onNext, onBack }: Props) => {
17
+ const convergeConfigQuery = appApi.endpoints.convergeGetDefaultSingleInstanceForBrand.useQuery({ organisationBrandId: window.seekaAppConfig.organisationBrandId })
18
+
19
+ return (
11
20
  <SeekaAppWizardStep>
12
21
  <SeekaAppWizardHeading title="Connect to ExampleApp™" image={seekaAppIcon}>
13
22
  Update app settings
@@ -5,31 +5,38 @@
5
5
  "app/*"
6
6
  ],
7
7
  "scripts": {
8
- "build": "yarn workspace @example-org-name/example-app-name-lib run build && yarn workspace @example-org-name/example-app-name-browser run build && yarn workspace @example-org-name/example-app-name-ui run build && yarn workspace @example-org-name/example-app-name-server run build",
8
+ "start:server": "yarn dev:lib && yarn start:server:parallel",
9
+ "start:server:parallel": "concurrently -k --names \"server,browser,watch-server,tunnel\" \"yarn dev:server\" \"yarn dev:browser\" \"yarn watch:server\" \"yarn tunnel\"",
10
+ "start:all": "yarn dev:lib && yarn start:all:parallel",
11
+ "start:all:parallel": "concurrently -k --names \"ui,server,browser,watch-server,tunnel\" \"yarn dev:ui\" \"yarn dev:server\" \"yarn dev:browser\" \"yarn watch:server\" \"yarn tunnel\"",
12
+ "build": "yarn workspace @example-org-name/example-app-name-lib run build && yarn workspace @example-org-name/example-app-name-browser run build && yarn workspace @example-org-name/example-app-name-ui run build && yarn workspace @example-org-name/example-app-name-server-azurefunc run build",
9
13
  "typecheck": "yarn workspaces foreach -pt --all run typecheck",
10
14
  "lint": "yarn workspaces foreach --all -pt run lint",
11
15
  "build:lib": "yarn workspace @example-org-name/example-app-name-lib run build",
12
16
  "build:browser": "yarn workspace @example-org-name/example-app-name-browser run build",
13
17
  "build:server:azurefunc": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build",
14
18
  "build:ui:test": "VITE_BASE_URL=/app/ yarn workspace @example-org-name/example-app-name-ui run build",
15
- "dev": "yarn workspace @example-org-name/example-app-name-lib run dev && yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-browser run watch",
16
- "dev:init": "yarn workspace @example-org-name/example-app-name-server run dev:queue:create",
19
+ "dev:lib": "yarn workspace @example-org-name/example-app-name-lib run dev",
20
+ "dev:browser": "yarn workspace @example-org-name/example-app-name-browser run watch",
21
+ "dev": "yarn workspace @example-org-name/example-app-name-lib run dev && yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-browser run watch",
22
+ "dev:init": "yarn workspace @example-org-name/example-app-name-server-azurefunc run dev:queue:create",
17
23
  "dev:ui": "yarn workspace @example-org-name/example-app-name-ui run build:dev",
18
- "dev:server": "yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-server run dev",
19
- "watch:server": "yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-server run watch",
20
- "deploy": "yarn clean && VITE_RELEASE_TAG=localdevbuild VITE_BASE_URL=/example-app-name-app/ VITE_URLS_SEEKA_API_CORE=https://api.seeka.services VITE_URLS_SEEKA_APP_CORE_ORIGIN=https://seeka.app yarn build && yarn workspace @example-org-name/example-app-name-server run deploy",
21
- "tunnel": "yarn workspace @example-org-name/example-app-name-server run tunnel",
24
+ "dev:server": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-server-azurefunc run dev",
25
+ "watch:server": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-server-azurefunc run watch",
26
+ "deploy": "VITE_RELEASE_TAG=localdevbuild VITE_BASE_URL=/example-app-name-app/ VITE_URLS_SEEKA_API_CORE=https://api.seeka.services VITE_URLS_SEEKA_APP_CORE_ORIGIN=https://seeka.app yarn build && yarn workspace @example-org-name/example-app-name-server-azurefunc run deploy",
27
+ "tunnel": "yarn workspace @example-org-name/example-app-name-server-azurefunc run tunnel",
22
28
  "bump:patch": "yarn git:isclean && yarn workspaces foreach --all version patch --deferred && yarn bump:apply && yarn git:push",
23
29
  "bump:minor": "yarn git:isclean && yarn workspaces foreach --all version minor --deferred && yarn bump:apply && yarn git:push",
24
30
  "bump:major": "yarn git:isclean && yarn workspaces foreach --all version major --deferred && yarn bump:apply && yarn git:push",
25
31
  "bump:apply": "yarn version apply --all",
26
32
  "git:isclean": "bash -c 'if [ -n \"$(git status --porcelain)\" ]; then echo \"✖ Working directory not clean. Commit or stash your changes first.\"; exit 1; fi'",
27
33
  "git:push": "git add -A && git commit -m \"v$(node -p \"require('./package.json').version\")\" && git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",
28
- "clean": "yarn workspaces foreach --all -pt run clean",
29
- "clean:all": "yarn clean && rimraf ./app/**/node_modules",
34
+ "clean": "yarn workspaces foreach --all -pt --include '@example-org-name/example-app-name-*' run clean",
35
+ "clean:all": "rimraf ./app/**/node_modules",
30
36
  "dev:kill": "taskkill /f /t /im node.exe"
31
37
  },
32
38
  "devDependencies": {
39
+ "concurrently": "^9",
33
40
  "rimraf": "^6"
34
41
  },
35
42
  "packageManager": "yarn@4.11.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeka-labs/cli-apps",
3
- "version": "3.4.3",
3
+ "version": "3.5.0",
4
4
  "description": "Seeka - Apps CLI",
5
5
  "author": "SEEKA <platform@seeka.co>",
6
6
  "license": "MIT",