@seeka-labs/cli-apps 3.3.1 → 3.3.2
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.
- package/dist/index.js +37747 -37595
- package/dist/index.js.map +4 -4
- package/dist/init-template/README.md +3 -0
- package/dist/init-template/app/browser/package.json +1 -1
- package/dist/init-template/app/lib/package.json +1 -1
- package/dist/init-template/app/server-azurefunc/package.json +2 -3
- package/dist/init-template/app/server-azurefunc/scripts/dev-queue-setup.js +40 -3
- package/dist/init-template/app/ui/package.json +1 -1
- package/dist/init-template/package.json +2 -1
- package/package.json +3 -1
- package/dist/init-template/app/server-azurefunc/scripts/ngrok.js +0 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@example-org-name/example-app-name-server-azurefunc",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Seeka Azure Serverless function app example-app-name",
|
|
5
5
|
"author": "Seeka <administrator@seeka.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"clean": "rimraf dist",
|
|
18
18
|
"prestart": "yarn clean && yarn build",
|
|
19
19
|
"dev": "func start --port 7072",
|
|
20
|
-
"tunnel": "ngrok http 7072 --hostname=example-app-name-localdev.au.ngrok.io --region au --log=stdout --log-format=term",
|
|
21
|
-
"tunnel:old": "node scripts/ngrok.js example-app-name-localdev",
|
|
20
|
+
"tunnel": "ngrok http 7072 --hostname=seeka-app-example-app-name-localdev.au.ngrok.io --region au --log=stdout --log-format=term",
|
|
22
21
|
"deploy": "func azure functionapp publish example-app-name --no-build --javascript",
|
|
23
22
|
"dev:queue:create": "node scripts/dev-queue-setup.js activity-track-queue && node scripts/dev-queue-setup.js activity-track-queue-poison"
|
|
24
23
|
},
|
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
2
|
/* eslint-disable no-undef */
|
|
3
3
|
const { QueueClient } = require("@azure/storage-queue");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
function getAzureWebJobsStorageConnectionString() {
|
|
8
|
+
// local.settings.json lives one level above this script (../local.settings.json)
|
|
9
|
+
const localSettingsPath = path.join(__dirname, "..", "local.settings.json");
|
|
10
|
+
|
|
11
|
+
let raw;
|
|
12
|
+
try {
|
|
13
|
+
raw = fs.readFileSync(localSettingsPath, "utf8");
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
`Unable to read ${localSettingsPath}. Ensure local.settings.json exists and is readable. Original error: ${e && e.message ? e.message : e}`
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let json;
|
|
22
|
+
try {
|
|
23
|
+
json = JSON.parse(raw);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`Invalid JSON in ${localSettingsPath}. Original error: ${e && e.message ? e.message : e}`
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const connectionString = json?.Values?.AzureWebJobsStorage;
|
|
32
|
+
if (typeof connectionString !== "string" || connectionString.trim() === "") {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`Missing or empty Values.AzureWebJobsStorage in ${localSettingsPath}`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return connectionString;
|
|
39
|
+
}
|
|
4
40
|
|
|
5
41
|
(async function () {
|
|
6
42
|
// https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio%2Cqueue-storage#azure-sdks
|
|
7
43
|
// Dev / emulator / azurite
|
|
44
|
+
const connectionString = getAzureWebJobsStorageConnectionString();
|
|
8
45
|
var client = new QueueClient(
|
|
9
|
-
|
|
46
|
+
connectionString, process.argv[2]
|
|
10
47
|
);
|
|
11
48
|
const res = await client.createIfNotExists();
|
|
12
49
|
if (res.succeeded) {
|
|
13
|
-
console.log("Queue created");
|
|
50
|
+
console.log("Queue created - " + process.argv[2]);
|
|
14
51
|
}
|
|
15
52
|
else {
|
|
16
|
-
console.log("Queue already exists");
|
|
53
|
+
console.log("Queue already exists - " + process.argv[2]);
|
|
17
54
|
}
|
|
18
55
|
})();
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
],
|
|
7
7
|
"scripts": {
|
|
8
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",
|
|
9
|
-
"typecheck": "yarn workspaces foreach -pt --
|
|
9
|
+
"typecheck": "yarn workspaces foreach -pt --all run typecheck",
|
|
10
10
|
"lint": "yarn workspaces foreach --all -pt run lint",
|
|
11
11
|
"build:lib": "yarn workspace @example-org-name/example-app-name-lib run build",
|
|
12
12
|
"build:browser": "yarn workspace @example-org-name/example-app-name-browser run build",
|
|
13
13
|
"build:server:azurefunc": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build",
|
|
14
14
|
"build:ui:test": "VITE_BASE_URL=/app/ yarn workspace @example-org-name/example-app-name-ui run build",
|
|
15
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",
|
|
16
17
|
"dev:ui": "yarn workspace @example-org-name/example-app-name-ui run build:dev",
|
|
17
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",
|
|
18
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",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seeka-labs/cli-apps",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.2",
|
|
4
4
|
"description": "Seeka - Apps CLI",
|
|
5
5
|
"author": "SEEKA <platform@seeka.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"clean": "rimraf dist",
|
|
30
30
|
"dev": "yarn run clean && yarn build && rimraf seeka-app-test1 && node dist/index.js init seeka-app-test1 --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --npmUsername testy --npmPassword passworddd --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
31
31
|
"scaffold:azurefunc": "yarn run clean && yarn build && rimraf test-scaffold/test-azurefunc && node dist/index.js init test-azurefunc test-orgname --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --outDir '../../../../../test-app-scaffold' --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --force --npmUsername internal-seeka-developers-apps --npmPassword 2b999f0e3d774bb180f5a5d2759d1358",
|
|
32
|
+
"scaffold:azurefunc:fromfile": "yarn run clean && yarn build && node dist/index.js init ./configs/azurefunc/testapp.seeka.cli.config.json",
|
|
33
|
+
"scaffold:azurefunc:kim": "yarn run clean && yarn build && node dist/index.js init ./configs/azurefunc/kim-experiment.seeka.cli.config.json",
|
|
32
34
|
"dev:nobrowser": "yarn run clean && yarn build && rimraf seeka-app-test1 && node dist/index.js init seeka-app-test1 --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
33
35
|
"dev:skipSubDir": "yarn run clean && yarn build && rimraf seeka-app-test1 && mkdir seeka-app-test1 && cd seeka-app-test1 && mkdir rootfolder && cd rootfolder && node ../../dist/index.js init seeka-app-test1 --template azure-function --skipSubDir --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
34
36
|
"dev:skipSubDir2": "yarn run clean && yarn build && cd seeka-app-test2 && node ../dist/index.js init seeka-app-test1 --template azure-function --skipSubDir --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-undef */
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
3
|
-
const ngrok = require('ngrok');
|
|
4
|
-
(async function () {
|
|
5
|
-
await ngrok.disconnect(process.argv[2]); // stops all
|
|
6
|
-
await ngrok.kill(); // kills ngrok process
|
|
7
|
-
|
|
8
|
-
const url = await ngrok.connect({
|
|
9
|
-
proto: 'http',
|
|
10
|
-
web_addr: 'localhost:4040',
|
|
11
|
-
addr: 7072,
|
|
12
|
-
subdomain: process.argv[2],
|
|
13
|
-
onLogEvent: (event) => {
|
|
14
|
-
console.log('Ngrok - ', event);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
console.log('')
|
|
19
|
-
console.log('')
|
|
20
|
-
console.log('------------------------------------------')
|
|
21
|
-
console.log('')
|
|
22
|
-
console.info(`Public URL for Seeka app is exposed by Ngrok`)
|
|
23
|
-
console.log('')
|
|
24
|
-
console.info(`${url}/api/webhook/seeka/app`)
|
|
25
|
-
console.log('')
|
|
26
|
-
console.info(`Use this URL in your Seeka app configuration for testing`)
|
|
27
|
-
console.log('')
|
|
28
|
-
console.log('------------------------------------------')
|
|
29
|
-
console.log('http://127.0.0.1:4040/inspect/http')
|
|
30
|
-
console.log('')
|
|
31
|
-
})();
|