@seeka-labs/cli-apps 1.1.39 → 2.0.7-rc.1
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 +31 -36
- package/dist/index.js.map +4 -4
- package/dist/init-template/.gitlab-ci.yml +47 -0
- package/dist/init-template/.yarnrc.yml +8 -0
- package/dist/init-template/README.md +7 -0
- package/dist/{init-templates → init-template/app}/browser/jest.config.js +11 -11
- package/dist/{init-templates → init-template/app}/browser/package.json +16 -12
- package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/build-browser-plugin.mjs +110 -110
- package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/plugins/importAsGlobals.mjs +38 -38
- package/dist/{init-templates → init-template/app}/browser/src/browser.ts +12 -12
- package/dist/{init-templates → init-template/app}/browser/src/plugin/index.test.ts +6 -6
- package/dist/{init-templates → init-template/app}/browser/src/plugin/index.ts +47 -49
- package/dist/{init-templates → init-template/app}/browser/tsconfig.json +34 -34
- package/dist/{init-templates/netlify-function → init-template/app/server-azure-function}/.eslintrc.cjs +2 -10
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/.funcignore +12 -7
- package/dist/init-template/app/server-azure-function/.nvmrc +1 -0
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/README.md +104 -107
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/host.json +1 -10
- package/dist/init-template/app/server-azure-function/package.json +52 -0
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/seekaAppWebhook.ts +235 -236
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/browser/index.ts +54 -54
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/jobs/index.ts +1 -1
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/logging/index.ts +92 -92
- package/dist/{init-templates/azure-function/src/lib/browser → init-template/app/server-azure-function/src/lib}/models/index.ts +6 -6
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/redis/index.ts +96 -65
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/seeka/installations.ts +64 -66
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/tsconfig.json +1 -1
- package/dist/init-template/package.json +28 -0
- package/dist/init-template/tsconfig.json +25 -0
- package/package.json +5 -4
- package/dist/init-templates/aws-lambda/.env.example +0 -15
- package/dist/init-templates/aws-lambda/.eslintrc.cjs +0 -19
- package/dist/init-templates/aws-lambda/.example.gitignore +0 -49
- package/dist/init-templates/aws-lambda/.gitlab-ci.yml +0 -39
- package/dist/init-templates/aws-lambda/.nvmrc +0 -1
- package/dist/init-templates/aws-lambda/.vscode/extensions.json +0 -5
- package/dist/init-templates/aws-lambda/.vscode/launch.json +0 -20
- package/dist/init-templates/aws-lambda/.vscode/settings.json +0 -3
- package/dist/init-templates/aws-lambda/.vscode/tasks.json +0 -12
- package/dist/init-templates/aws-lambda/README.md +0 -77
- package/dist/init-templates/aws-lambda/jest.config.js +0 -5
- package/dist/init-templates/aws-lambda/package.json +0 -53
- package/dist/init-templates/aws-lambda/scripts/ngrok.js +0 -28
- package/dist/init-templates/aws-lambda/src/index.test.ts +0 -7
- package/dist/init-templates/aws-lambda/src/index.ts +0 -33
- package/dist/init-templates/aws-lambda/src/lib/logging/index.ts +0 -88
- package/dist/init-templates/aws-lambda/src/lib/services/index.ts +0 -41
- package/dist/init-templates/aws-lambda/src/lib/state/redis/index.ts +0 -65
- package/dist/init-templates/aws-lambda/src/lib/state/seeka/installations.ts +0 -67
- package/dist/init-templates/aws-lambda/src/routes/seekaAppWebhook.ts +0 -194
- package/dist/init-templates/aws-lambda/tsconfig.json +0 -31
- package/dist/init-templates/aws-lambda/yarn.lock +0 -4392
- package/dist/init-templates/azure-function/.eslintrc.cjs +0 -19
- package/dist/init-templates/azure-function/.example.gitignore +0 -48
- package/dist/init-templates/azure-function/.gitlab-ci.yml +0 -48
- package/dist/init-templates/azure-function/.nvmrc +0 -1
- package/dist/init-templates/azure-function/.vscode/extensions.json +0 -7
- package/dist/init-templates/azure-function/.vscode/launch.json +0 -13
- package/dist/init-templates/azure-function/.vscode/settings.json +0 -9
- package/dist/init-templates/azure-function/.vscode/tasks.json +0 -39
- package/dist/init-templates/azure-function/jest.config.js +0 -5
- package/dist/init-templates/azure-function/package.json +0 -47
- package/dist/init-templates/azure-function/scripts/dev-queue-setup.js +0 -30
- package/dist/init-templates/azure-function/src/index.test.ts +0 -7
- package/dist/init-templates/azure-function/yarn.lock +0 -3772
- package/dist/init-templates/browser/.editorconfig +0 -14
- package/dist/init-templates/browser/.eslintrc.cjs +0 -1
- package/dist/init-templates/browser/.yarnrc +0 -1
- package/dist/init-templates/browser/yarn.lock +0 -3045
- package/dist/init-templates/netlify-function/.env.example +0 -18
- package/dist/init-templates/netlify-function/.example.gitignore +0 -36
- package/dist/init-templates/netlify-function/.nvmrc +0 -1
- package/dist/init-templates/netlify-function/.vscode/launch.json +0 -45
- package/dist/init-templates/netlify-function/README.md +0 -62
- package/dist/init-templates/netlify-function/jest.config.js +0 -5
- package/dist/init-templates/netlify-function/netlify.toml +0 -7
- package/dist/init-templates/netlify-function/package.json +0 -39
- package/dist/init-templates/netlify-function/src/api/example-job-background/index.ts +0 -52
- package/dist/init-templates/netlify-function/src/api/polling-example-job-scheduled/index.ts +0 -46
- package/dist/init-templates/netlify-function/src/api/seeka-app-webhook/index.ts +0 -217
- package/dist/init-templates/netlify-function/src/index.test.ts +0 -7
- package/dist/init-templates/netlify-function/src/lib/jobs/index.ts +0 -68
- package/dist/init-templates/netlify-function/src/lib/logging/index.ts +0 -91
- package/dist/init-templates/netlify-function/src/lib/services/index.ts +0 -41
- package/dist/init-templates/netlify-function/src/lib/state/redis/index.ts +0 -65
- package/dist/init-templates/netlify-function/src/lib/state/seeka/installations.ts +0 -67
- package/dist/init-templates/netlify-function/tsconfig.json +0 -25
- package/dist/init-templates/netlify-function/yarn.lock +0 -9337
- /package/dist/{init-templates → init-template/app}/browser/README.md +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/local.settings.example.json +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/scripts/ngrok.js +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/healthCheck.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/pollingExample.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/queueExample.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/services/index.ts +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- deploy
|
|
3
|
+
|
|
4
|
+
variables:
|
|
5
|
+
AZURE_FUNC_RESOURCE_NAME: seeka-app-example-name
|
|
6
|
+
CI_DEBUG_TRACE: "true"
|
|
7
|
+
|
|
8
|
+
workflow:
|
|
9
|
+
rules:
|
|
10
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
11
|
+
when: never
|
|
12
|
+
- if: '$CI_COMMIT_BRANCH == "main" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
|
|
13
|
+
variables:
|
|
14
|
+
# AZURE_FUNC_SLOT: ""
|
|
15
|
+
# AZURE_FUNC_SLOT: "production"?????
|
|
16
|
+
HOSTING_REGION_NAME: auea
|
|
17
|
+
HOSTING_ENV_NAME: prod
|
|
18
|
+
when: always
|
|
19
|
+
- if: '$CI_COMMIT_BRANCH == "staging" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
|
|
20
|
+
variables:
|
|
21
|
+
# AZURE_FUNC_SLOT: staging
|
|
22
|
+
HOSTING_REGION_NAME: auea
|
|
23
|
+
HOSTING_ENV_NAME: stag
|
|
24
|
+
when: always
|
|
25
|
+
|
|
26
|
+
deploy:
|
|
27
|
+
stage: deploy
|
|
28
|
+
image: node:20
|
|
29
|
+
environment:
|
|
30
|
+
name: $HOSTING_REGION_NAME/$HOSTING_ENV_NAME/apps
|
|
31
|
+
before_script:
|
|
32
|
+
- echo "installing azure cli"
|
|
33
|
+
- curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
|
34
|
+
- az --version
|
|
35
|
+
- echo "logging in to azure"
|
|
36
|
+
- az login --service-principal --username "$AZURE_SERVICEPRINCIPAL_CLIENTID" --password "$AZURE_SERVICEPRINCIPAL_SECRET" --tenant "$AZURE_TENANT_ID"
|
|
37
|
+
- az account set --subscription "$AZURE_SUBSCRIPTION_ID"
|
|
38
|
+
- corepack enable
|
|
39
|
+
script:
|
|
40
|
+
- echo "deploying azure func $AZURE_FUNC_RESOURCE_NAME to slot $AZURE_FUNC_SLOT from branch $CI_COMMIT_BRANCH"
|
|
41
|
+
- yarn install --immutable
|
|
42
|
+
- yarn clean && yarn build
|
|
43
|
+
- cd app/server-azure-function
|
|
44
|
+
- yarn func azure functionapp publish $AZURE_FUNC_RESOURCE_NAME --no-build --javascript
|
|
45
|
+
only:
|
|
46
|
+
- main
|
|
47
|
+
- staging
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
roots: ['<rootDir>/src'],
|
|
3
|
-
testMatch: [
|
|
4
|
-
"**/*.test.ts"
|
|
5
|
-
],
|
|
6
|
-
transform: {
|
|
7
|
-
"^.+\\.(ts|tsx)$": "ts-jest"
|
|
8
|
-
},
|
|
9
|
-
collectCoverageFrom: ["src/**/*.ts", "!**/node_modules/**"],
|
|
10
|
-
coverageReporters: ["html", "text", "text-summary", "cobertura"],
|
|
11
|
-
}
|
|
1
|
+
export default {
|
|
2
|
+
roots: ['<rootDir>/src'],
|
|
3
|
+
testMatch: [
|
|
4
|
+
"**/*.test.ts"
|
|
5
|
+
],
|
|
6
|
+
transform: {
|
|
7
|
+
"^.+\\.(ts|tsx)$": "ts-jest"
|
|
8
|
+
},
|
|
9
|
+
collectCoverageFrom: ["src/**/*.ts", "!**/node_modules/**"],
|
|
10
|
+
coverageReporters: ["html", "text", "text-summary", "cobertura"],
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "seeka-app-example-name
|
|
3
|
-
"version": "
|
|
2
|
+
"name": "@seeka-app-example-name/browser",
|
|
3
|
+
"version": "2.0.7-rc.1",
|
|
4
4
|
"description": "Seeka browser app seeka-app-example-name-browser",
|
|
5
5
|
"author": "Seeka company <support@seeka.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,20 +17,24 @@
|
|
|
17
17
|
"watch": "yarn clean && node ./scripts/esbuild/build-browser-plugin.mjs seeka-app-example-name SampleAppConvergeSdkPlugin dev watch"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@seeka-labs/converge": "^1.8.
|
|
20
|
+
"@seeka-labs/converge": "^1.8.64"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@
|
|
23
|
+
"@jest/globals": "^29.7.0",
|
|
24
|
+
"@jgoz/esbuild-plugin-typecheck": "^4.0.3",
|
|
24
25
|
"@types/jest": "^29.5.14",
|
|
25
|
-
"@
|
|
26
|
-
"@typescript-eslint/
|
|
27
|
-
"
|
|
28
|
-
"
|
|
26
|
+
"@types/lodash-es": "^4.17.12",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
28
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
29
|
+
"esbuild": "^0.25.5",
|
|
30
|
+
"eslint": "^9",
|
|
29
31
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
30
32
|
"jest": "^29.7.0",
|
|
31
33
|
"jest-junit": "^16.0.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
+
"rimraf": "^6.0.1",
|
|
35
|
+
"ts-jest": "^29.3.4",
|
|
36
|
+
"typescript": "^5.8.3",
|
|
34
37
|
"watch": "^1.0.2"
|
|
35
|
-
}
|
|
36
|
-
|
|
38
|
+
},
|
|
39
|
+
"stableVersion": "2.0.6"
|
|
40
|
+
}
|
package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/build-browser-plugin.mjs
RENAMED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { build,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
console.log('esbuild version:', version);
|
|
9
|
-
|
|
10
|
-
if (process.argv.length < 3) {
|
|
11
|
-
throw new Error('Missing arg');
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const pluginName = process.argv[2];
|
|
15
|
-
|
|
16
|
-
const mode = process.argv.length > 4 ? process.argv[4] : 'prod';
|
|
17
|
-
const watchBuild = process.argv.length > 5 ? process.argv[5] == 'watch' : false;
|
|
18
|
-
|
|
19
|
-
console.log('mode:', mode);
|
|
20
|
-
console.log('watchBuild:', process.argv[4]);
|
|
21
|
-
|
|
22
|
-
const opts = {
|
|
23
|
-
entryPoints: ['src/browser.ts'],
|
|
24
|
-
bundle: true,
|
|
25
|
-
metafile: true,
|
|
26
|
-
minify: mode === 'dev' ? false : true,
|
|
27
|
-
format: 'iife',
|
|
28
|
-
platform: 'browser',
|
|
29
|
-
//sourcemap: 'external',
|
|
30
|
-
sourcemap: mode === 'dev' ? true : false,
|
|
31
|
-
external: ['@seeka-labs/converge'],
|
|
32
|
-
outfile: `dist/${pluginName}.min.js`,
|
|
33
|
-
plugins: [
|
|
34
|
-
importAsGlobals({
|
|
35
|
-
"@seeka-labs/converge": "SeekaConvergeCore"
|
|
36
|
-
}),
|
|
37
|
-
typecheckPlugin()
|
|
38
|
-
]
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const postBuild = () => {
|
|
42
|
-
// Copy outfile to ../dist/src/browser
|
|
43
|
-
if (!existsSync(resolve('
|
|
44
|
-
mkdirSync(resolve('
|
|
45
|
-
recursive: true,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
copyFileSync(resolve(opts.outfile), resolve('
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (watchBuild) {
|
|
52
|
-
const ctx = await context(opts);
|
|
53
|
-
|
|
54
|
-
async function buildWatch() {
|
|
55
|
-
await ctx.rebuild();
|
|
56
|
-
postBuild();
|
|
57
|
-
console.log('build succeeded');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
await buildWatch();
|
|
61
|
-
|
|
62
|
-
// Start watch
|
|
63
|
-
let monitorInstance;
|
|
64
|
-
watch.createMonitor(resolve('./src'), function (monitor) {
|
|
65
|
-
console.log('watching ./src, press any key to exit');
|
|
66
|
-
monitorInstance = monitor;
|
|
67
|
-
|
|
68
|
-
monitor.on("created", async function (f, stat) {
|
|
69
|
-
console.log('rebuilding due to file created', f)
|
|
70
|
-
try {
|
|
71
|
-
await buildWatch();
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
console.error(e);
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
monitor.on("changed", async function (f, curr, prev) {
|
|
78
|
-
console.log('rebuilding due to file changed', f)
|
|
79
|
-
try {
|
|
80
|
-
await buildWatch();
|
|
81
|
-
}
|
|
82
|
-
catch (e) {
|
|
83
|
-
console.error(e);
|
|
84
|
-
}
|
|
85
|
-
})
|
|
86
|
-
monitor.on("removed", async function (f, stat) {
|
|
87
|
-
console.log('rebuilding due to file deleted', f)
|
|
88
|
-
try {
|
|
89
|
-
await buildWatch();
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
console.error(e);
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
})
|
|
96
|
-
|
|
97
|
-
// Support stopping
|
|
98
|
-
var stdin = process.stdin;
|
|
99
|
-
stdin.setRawMode(true);
|
|
100
|
-
stdin.resume();
|
|
101
|
-
stdin.setEncoding('utf8');
|
|
102
|
-
stdin.on('data', function (key) {
|
|
103
|
-
console.log('Stopping watch...');
|
|
104
|
-
monitorInstance.stop();
|
|
105
|
-
process.exit();
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
await build(opts);
|
|
110
|
-
postBuild();
|
|
1
|
+
import { typecheckPlugin } from '@jgoz/esbuild-plugin-typecheck';
|
|
2
|
+
import { build, context, version } from 'esbuild';
|
|
3
|
+
import { copyFileSync, existsSync, mkdirSync } from 'fs';
|
|
4
|
+
import { resolve } from 'path';
|
|
5
|
+
import * as watch from 'watch';
|
|
6
|
+
import { importAsGlobals } from './plugins/importAsGlobals.mjs';
|
|
7
|
+
|
|
8
|
+
console.log('esbuild version:', version);
|
|
9
|
+
|
|
10
|
+
if (process.argv.length < 3) {
|
|
11
|
+
throw new Error('Missing arg');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const pluginName = process.argv[2];
|
|
15
|
+
|
|
16
|
+
const mode = process.argv.length > 4 ? process.argv[4] : 'prod';
|
|
17
|
+
const watchBuild = process.argv.length > 5 ? process.argv[5] == 'watch' : false;
|
|
18
|
+
|
|
19
|
+
console.log('mode:', mode);
|
|
20
|
+
console.log('watchBuild:', process.argv[4]);
|
|
21
|
+
|
|
22
|
+
const opts = {
|
|
23
|
+
entryPoints: ['src/browser.ts'],
|
|
24
|
+
bundle: true,
|
|
25
|
+
metafile: true,
|
|
26
|
+
minify: mode === 'dev' ? false : true,
|
|
27
|
+
format: 'iife',
|
|
28
|
+
platform: 'browser',
|
|
29
|
+
//sourcemap: 'external',
|
|
30
|
+
sourcemap: mode === 'dev' ? true : false,
|
|
31
|
+
external: ['@seeka-labs/converge'],
|
|
32
|
+
outfile: `dist/${pluginName}.min.js`,
|
|
33
|
+
plugins: [
|
|
34
|
+
importAsGlobals({
|
|
35
|
+
"@seeka-labs/converge": "SeekaConvergeCore"
|
|
36
|
+
}),
|
|
37
|
+
typecheckPlugin()
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const postBuild = () => {
|
|
42
|
+
// Copy outfile to ../dist/src/browser
|
|
43
|
+
if (!existsSync(resolve('../server-azure-function/dist/src/browser'))) {
|
|
44
|
+
mkdirSync(resolve('../server-azure-function/dist/src/browser'), {
|
|
45
|
+
recursive: true,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
copyFileSync(resolve(opts.outfile), resolve('../server-azure-function/dist/src/browser', `${pluginName}.min.js`))
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (watchBuild) {
|
|
52
|
+
const ctx = await context(opts);
|
|
53
|
+
|
|
54
|
+
async function buildWatch() {
|
|
55
|
+
await ctx.rebuild();
|
|
56
|
+
postBuild();
|
|
57
|
+
console.log('build succeeded');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
await buildWatch();
|
|
61
|
+
|
|
62
|
+
// Start watch
|
|
63
|
+
let monitorInstance;
|
|
64
|
+
watch.createMonitor(resolve('./src'), function (monitor) {
|
|
65
|
+
console.log('watching ./src, press any key to exit');
|
|
66
|
+
monitorInstance = monitor;
|
|
67
|
+
|
|
68
|
+
monitor.on("created", async function (f, stat) {
|
|
69
|
+
console.log('rebuilding due to file created', f)
|
|
70
|
+
try {
|
|
71
|
+
await buildWatch();
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
console.error(e);
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
monitor.on("changed", async function (f, curr, prev) {
|
|
78
|
+
console.log('rebuilding due to file changed', f)
|
|
79
|
+
try {
|
|
80
|
+
await buildWatch();
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
console.error(e);
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
monitor.on("removed", async function (f, stat) {
|
|
87
|
+
console.log('rebuilding due to file deleted', f)
|
|
88
|
+
try {
|
|
89
|
+
await buildWatch();
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
console.error(e);
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
// Support stopping
|
|
98
|
+
var stdin = process.stdin;
|
|
99
|
+
stdin.setRawMode(true);
|
|
100
|
+
stdin.resume();
|
|
101
|
+
stdin.setEncoding('utf8');
|
|
102
|
+
stdin.on('data', function (key) {
|
|
103
|
+
console.log('Stopping watch...');
|
|
104
|
+
monitorInstance.stop();
|
|
105
|
+
process.exit();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
await build(opts);
|
|
110
|
+
postBuild();
|
|
111
111
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
export function importAsGlobals(mapping) {
|
|
2
|
-
// https://github.com/evanw/esbuild/issues/337
|
|
3
|
-
// https://stackoverflow.com/a/3561711/153718
|
|
4
|
-
const escRe = (s) => s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
5
|
-
const filter = new RegExp(
|
|
6
|
-
Object.keys(mapping)
|
|
7
|
-
.map((mod) => `^${escRe(mod)}$`)
|
|
8
|
-
.join("|"),
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
return {
|
|
12
|
-
name: "global-imports",
|
|
13
|
-
setup(build) {
|
|
14
|
-
build.onResolve({ filter }, (args) => {
|
|
15
|
-
if (!mapping[args.path]) {
|
|
16
|
-
throw new Error("Unknown global: " + args.path);
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
path: args.path,
|
|
20
|
-
namespace: "external-global",
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
build.onLoad(
|
|
25
|
-
{
|
|
26
|
-
filter,
|
|
27
|
-
namespace: "external-global",
|
|
28
|
-
},
|
|
29
|
-
async (args) => {
|
|
30
|
-
const global = mapping[args.path];
|
|
31
|
-
return {
|
|
32
|
-
contents: `module.exports = ${global};`,
|
|
33
|
-
loader: "js",
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
);
|
|
37
|
-
},
|
|
38
|
-
};
|
|
1
|
+
export function importAsGlobals(mapping) {
|
|
2
|
+
// https://github.com/evanw/esbuild/issues/337
|
|
3
|
+
// https://stackoverflow.com/a/3561711/153718
|
|
4
|
+
const escRe = (s) => s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
5
|
+
const filter = new RegExp(
|
|
6
|
+
Object.keys(mapping)
|
|
7
|
+
.map((mod) => `^${escRe(mod)}$`)
|
|
8
|
+
.join("|"),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
name: "global-imports",
|
|
13
|
+
setup(build) {
|
|
14
|
+
build.onResolve({ filter }, (args) => {
|
|
15
|
+
if (!mapping[args.path]) {
|
|
16
|
+
throw new Error("Unknown global: " + args.path);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
path: args.path,
|
|
20
|
+
namespace: "external-global",
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
build.onLoad(
|
|
25
|
+
{
|
|
26
|
+
filter,
|
|
27
|
+
namespace: "external-global",
|
|
28
|
+
},
|
|
29
|
+
async (args) => {
|
|
30
|
+
const global = mapping[args.path];
|
|
31
|
+
return {
|
|
32
|
+
contents: `module.exports = ${global};`,
|
|
33
|
+
loader: "js",
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
39
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
SampleAppConvergeSdkPlugin: (pluginConfig: ISampleAppBrowserSdkPluginConfig) => SampleAppConvergeSdkPlugin;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
(window as Window).SampleAppConvergeSdkPlugin = (pluginConfig: ISampleAppBrowserSdkPluginConfig) => {
|
|
11
|
-
return new SampleAppConvergeSdkPlugin(pluginConfig);
|
|
12
|
-
};
|
|
1
|
+
import type { ISampleAppBrowserSdkPluginConfig } from '../../server-azure-function/src/lib/models';
|
|
2
|
+
import { SampleAppConvergeSdkPlugin } from "./plugin";
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
SampleAppConvergeSdkPlugin: (pluginConfig: ISampleAppBrowserSdkPluginConfig) => SampleAppConvergeSdkPlugin;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
(window as Window).SampleAppConvergeSdkPlugin = (pluginConfig: ISampleAppBrowserSdkPluginConfig) => {
|
|
11
|
+
return new SampleAppConvergeSdkPlugin(pluginConfig);
|
|
12
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
describe("SampleTest", () => {
|
|
3
|
-
test("Sample", () => {
|
|
4
|
-
expect(1).toStrictEqual(1);
|
|
5
|
-
});
|
|
6
|
-
});
|
|
1
|
+
|
|
2
|
+
describe("SampleTest", () => {
|
|
3
|
+
test("Sample", () => {
|
|
4
|
+
expect(1).toStrictEqual(1);
|
|
5
|
+
});
|
|
6
|
+
});
|
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
ConvergeSdk,
|
|
4
|
-
IConvergePlugin
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
ConvergeSdk,
|
|
4
|
+
IConvergePlugin
|
|
5
|
+
} from '@seeka-labs/converge';
|
|
6
|
+
|
|
7
|
+
import type { ISampleAppBrowserSdkPluginConfig } from '../../../server-azure-function/src/lib/models';
|
|
8
|
+
import { version } from '../../package.json';
|
|
9
|
+
|
|
10
|
+
// const checkSdkAndPluginVersion = (expectedVersion: string, sdk: ConvergeSdk, pluginName: string): void => {
|
|
11
|
+
// let runtimeVersion = sdk.config.runtime.ver as string;
|
|
12
|
+
// runtimeVersion = runtimeVersion.replace('^', '');
|
|
13
|
+
// expectedVersion = expectedVersion.replace('^', '');
|
|
14
|
+
|
|
15
|
+
// if (expectedVersion !== runtimeVersion) {
|
|
16
|
+
// sdk.debug.warn(`The expected SDK version of ${expectedVersion} for the ${pluginName} plugin does not match the current installlation runtime of ${runtimeVersion}`);
|
|
17
|
+
// }
|
|
18
|
+
// }
|
|
19
|
+
|
|
20
|
+
export class SampleAppConvergeSdkPlugin implements IConvergePlugin<ISampleAppBrowserSdkPluginConfig> {
|
|
21
|
+
constructor(pluginConfig: ISampleAppBrowserSdkPluginConfig) {
|
|
22
|
+
this.type = "seeka-app-example-name";
|
|
23
|
+
// this.name = this.type + "-" + pluginConfig.siteId;
|
|
24
|
+
this.name = this.type;
|
|
25
|
+
this.version = version;
|
|
26
|
+
this.sdk = {} as ConvergeSdk;
|
|
27
|
+
this.config = pluginConfig || {};
|
|
28
|
+
}
|
|
29
|
+
sdk: ConvergeSdk;
|
|
30
|
+
|
|
31
|
+
privacyConfig = {
|
|
32
|
+
// TODO
|
|
33
|
+
requiresIabPurposes: []
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
name: string;
|
|
37
|
+
type: string;
|
|
38
|
+
version: string;
|
|
39
|
+
config: ISampleAppBrowserSdkPluginConfig;
|
|
40
|
+
|
|
41
|
+
async init(_params: any): Promise<void> {
|
|
42
|
+
// checkSdkAndPluginVersion(dependencies['@seeka-labs/converge'], this.sdk, this.name)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
isLoaded(): boolean {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
50
48
|
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowJs": false,
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"resolveJsonModule": true,
|
|
7
|
-
"moduleResolution": "node",
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"noImplicitAny": false,
|
|
11
|
-
"strictNullChecks": true,
|
|
12
|
-
"strictFunctionTypes": true,
|
|
13
|
-
"noUnusedLocals": false,
|
|
14
|
-
"noUnusedParameters": false,
|
|
15
|
-
"noImplicitReturns": true,
|
|
16
|
-
"noFallthroughCasesInSwitch": true,
|
|
17
|
-
"importHelpers": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"esModuleInterop": true,
|
|
20
|
-
"allowSyntheticDefaultImports": true,
|
|
21
|
-
"experimentalDecorators": true,
|
|
22
|
-
"sourceMap": true,
|
|
23
|
-
"types": [
|
|
24
|
-
"node",
|
|
25
|
-
"jest"
|
|
26
|
-
],
|
|
27
|
-
"lib": [
|
|
28
|
-
"ES6",
|
|
29
|
-
"DOM"
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"include": [
|
|
33
|
-
"src/browser.ts",
|
|
34
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": false,
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"resolveJsonModule": true,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noImplicitAny": false,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"strictFunctionTypes": true,
|
|
13
|
+
"noUnusedLocals": false,
|
|
14
|
+
"noUnusedParameters": false,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"importHelpers": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"allowSyntheticDefaultImports": true,
|
|
21
|
+
"experimentalDecorators": true,
|
|
22
|
+
"sourceMap": true,
|
|
23
|
+
"types": [
|
|
24
|
+
"node",
|
|
25
|
+
"jest"
|
|
26
|
+
],
|
|
27
|
+
"lib": [
|
|
28
|
+
"ES6",
|
|
29
|
+
"DOM"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"include": [
|
|
33
|
+
"src/browser.ts",
|
|
34
|
+
]
|
|
35
35
|
}
|
|
@@ -6,14 +6,6 @@ module.exports = {
|
|
|
6
6
|
root: true,
|
|
7
7
|
rules: {
|
|
8
8
|
"@typescript-eslint/no-unused-vars": "warn",
|
|
9
|
-
"@typescript-eslint/no-
|
|
10
|
-
}
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ["**/*/*.test.ts"],
|
|
14
|
-
env: {
|
|
15
|
-
jest: true
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
9
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
10
|
+
}
|
|
19
11
|
};
|