@flowscripter/example-host-application 1.0.1 → 1.1.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/.github/workflows/release-bun-executable.yml +1 -0
- package/README.md +2 -5
- package/bun.lock +10 -9
- package/package.json +18 -18
- package/src/ExampleHostApplication.ts +7 -18
- package/tsconfig.json +4 -1
package/README.md
CHANGED
|
@@ -59,16 +59,13 @@ Compile binary:
|
|
|
59
59
|
|
|
60
60
|
`bun build index.ts --compile --outfile /tmp/example-host-application`
|
|
61
61
|
|
|
62
|
-
**NOTE**: The following tasks use Deno as it excels at these and Bun does not
|
|
63
|
-
currently provide such functionality:
|
|
64
|
-
|
|
65
62
|
Format:
|
|
66
63
|
|
|
67
|
-
`
|
|
64
|
+
`bunx oxfmt`
|
|
68
65
|
|
|
69
66
|
Lint:
|
|
70
67
|
|
|
71
|
-
`
|
|
68
|
+
`bunx oxlint index.ts src/ tests/`
|
|
72
69
|
|
|
73
70
|
## Documentation
|
|
74
71
|
|
package/bun.lock
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 0,
|
|
3
4
|
"workspaces": {
|
|
4
5
|
"": {
|
|
5
6
|
"name": "@flowscripter/example-host-application",
|
|
6
7
|
"dependencies": {
|
|
7
|
-
"@flowscripter/dynamic-plugin-framework": "^1.
|
|
8
|
-
"@flowscripter/example-plugin-api": "^1.0
|
|
8
|
+
"@flowscripter/dynamic-plugin-framework": "^1.4.0",
|
|
9
|
+
"@flowscripter/example-plugin-api": "^1.1.0",
|
|
9
10
|
},
|
|
10
11
|
"devDependencies": {
|
|
11
|
-
"@types/bun": "^1.
|
|
12
|
+
"@types/bun": "^1.3.14",
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {
|
|
14
|
-
"typescript": "^
|
|
15
|
+
"typescript": "^6.0.3",
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
},
|
|
18
19
|
"packages": {
|
|
19
|
-
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@1.
|
|
20
|
+
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@1.4.0", "", { "peerDependencies": { "typescript": "^6.0.3" } }, "sha512-/FKU8dDiVSDODYgo7Cwp7w4aa+n4Fn0+LIqWg0WyU0q3Kxqn5Rss1MNmPprEcGuakMSnjX02xYw2GDL+yk7QHw=="],
|
|
20
21
|
|
|
21
|
-
"@flowscripter/example-plugin-api": ["@flowscripter/example-plugin-api@1.0
|
|
22
|
+
"@flowscripter/example-plugin-api": ["@flowscripter/example-plugin-api@1.1.0", "", { "peerDependencies": { "typescript": "^6.0.3" } }, "sha512-GGpBFBC91VlA/ODZlBnroceM1zVSOX6oUIRWh67+iR6s7FACeqcq3zAs3tSR0t7zWW/mPds7NlKtzAKNn2ZeBw=="],
|
|
22
23
|
|
|
23
|
-
"@types/bun": ["@types/bun@1.
|
|
24
|
+
"@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
|
|
24
25
|
|
|
25
26
|
"@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
|
|
26
27
|
|
|
27
|
-
"bun-types": ["bun-types@1.
|
|
28
|
+
"bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
|
|
28
29
|
|
|
29
|
-
"typescript": ["typescript@
|
|
30
|
+
"typescript": ["typescript@6.0.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw=="],
|
|
30
31
|
|
|
31
32
|
"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
|
|
32
33
|
}
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowscripter/example-host-application",
|
|
3
|
-
"
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Example host application for the https://github.com/flowscripter/dynamic-plugin-framework",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/flowscripter/example-host-application.git"
|
|
8
|
-
},
|
|
9
|
-
"license": "MIT",
|
|
10
5
|
"keywords": [
|
|
11
6
|
"bun",
|
|
7
|
+
"cli",
|
|
8
|
+
"dynamic",
|
|
12
9
|
"example",
|
|
13
|
-
"
|
|
10
|
+
"executable",
|
|
14
11
|
"framework",
|
|
15
|
-
"dynamic",
|
|
16
12
|
"import",
|
|
17
|
-
"
|
|
18
|
-
"cli"
|
|
13
|
+
"plugin"
|
|
19
14
|
],
|
|
20
|
-
"
|
|
15
|
+
"homepage": "https://github.com/flowscripter/example-host-application#readme",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/flowscripter/example-host-application.git"
|
|
20
|
+
},
|
|
21
21
|
"type": "module",
|
|
22
|
-
"
|
|
22
|
+
"module": "index.ts",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@flowscripter/dynamic-plugin-framework": "^1.4.0",
|
|
28
|
+
"@flowscripter/example-plugin-api": "^1.1.0"
|
|
29
|
+
},
|
|
26
30
|
"devDependencies": {
|
|
27
|
-
"@types/bun": "^1.
|
|
31
|
+
"@types/bun": "^1.3.14"
|
|
28
32
|
},
|
|
29
33
|
"peerDependencies": {
|
|
30
|
-
"typescript": "^
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@flowscripter/dynamic-plugin-framework": "^1.3.18",
|
|
34
|
-
"@flowscripter/example-plugin-api": "^1.0.8"
|
|
34
|
+
"typescript": "^6.0.3"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EXTENSION_POINT_1,
|
|
3
|
-
type ExtensionPoint1,
|
|
4
|
-
} from "@flowscripter/example-plugin-api";
|
|
1
|
+
import { EXTENSION_POINT_1, type ExtensionPoint1 } from "@flowscripter/example-plugin-api";
|
|
5
2
|
import {
|
|
6
3
|
DefaultPluginManager,
|
|
7
4
|
type ExtensionInfo,
|
|
@@ -23,21 +20,16 @@ export async function exampleHostApplication(): Promise<void> {
|
|
|
23
20
|
|
|
24
21
|
const pluginManager = new DefaultPluginManager([pluginRepository]);
|
|
25
22
|
|
|
26
|
-
console.info(
|
|
27
|
-
`Registering extensions for ${EXTENSION_POINT_1} extension point`,
|
|
28
|
-
);
|
|
23
|
+
console.info(`Registering extensions for ${EXTENSION_POINT_1} extension point`);
|
|
29
24
|
|
|
30
25
|
await pluginManager.registerExtensions(EXTENSION_POINT_1);
|
|
31
26
|
|
|
32
27
|
console.info("Registered extensions:");
|
|
33
28
|
|
|
34
|
-
const extensionInfos = await pluginManager.getRegisteredExtensions(
|
|
35
|
-
EXTENSION_POINT_1,
|
|
36
|
-
);
|
|
29
|
+
const extensionInfos = await pluginManager.getRegisteredExtensions(EXTENSION_POINT_1);
|
|
37
30
|
|
|
38
31
|
extensionInfos.forEach((extensionInfo: ExtensionInfo) => {
|
|
39
|
-
let extensionInfoString =
|
|
40
|
-
`extensionHandle: ${extensionInfo.extensionHandle}\n`;
|
|
32
|
+
let extensionInfoString = `extensionHandle: ${extensionInfo.extensionHandle}\n`;
|
|
41
33
|
|
|
42
34
|
if (extensionInfo.extensionData) {
|
|
43
35
|
extensionInfoString += `extensionData:\n`;
|
|
@@ -58,13 +50,10 @@ export async function exampleHostApplication(): Promise<void> {
|
|
|
58
50
|
if (extensionInfos.length > 0) {
|
|
59
51
|
console.info("Instantiating first extension");
|
|
60
52
|
|
|
61
|
-
const extension = await pluginManager.instantiate(
|
|
53
|
+
const extension = (await pluginManager.instantiate(
|
|
62
54
|
extensionInfos[0].extensionHandle,
|
|
63
|
-
new Map([[
|
|
64
|
-
|
|
65
|
-
"host_bar",
|
|
66
|
-
]]),
|
|
67
|
-
) as ExtensionPoint1;
|
|
55
|
+
new Map([["host_foo", "host_bar"]]),
|
|
56
|
+
)) as ExtensionPoint1;
|
|
68
57
|
|
|
69
58
|
console.info("Invoking extension");
|
|
70
59
|
|
package/tsconfig.json
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
// Some stricter flags (disabled by default)
|
|
23
23
|
"noUnusedLocals": false,
|
|
24
24
|
"noUnusedParameters": false,
|
|
25
|
-
"noPropertyAccessFromIndexSignature": false
|
|
25
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
26
|
+
|
|
27
|
+
// Type definitions
|
|
28
|
+
"types": ["bun", "node"]
|
|
26
29
|
}
|
|
27
30
|
}
|