@flowscripter/example-plugin 1.0.6 → 1.0.11
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/README.md +8 -6
- package/dist/bundle.js +1 -0
- package/package.json +12 -6
- package/.github/workflows/check-bun-dependencies.yml +0 -9
- package/.github/workflows/lint-pr-message.yml +0 -11
- package/.github/workflows/release-bun-library.yml +0 -8
- package/.github/workflows/validate-bun-library-pr.yml +0 -8
- package/bun.lock +0 -35
- package/index.ts +0 -1
- package/src/ExamplePlugin.ts +0 -42
- package/tests/ExamplePlugin_test.ts +0 -26
- package/tsconfig.json +0 -27
package/README.md
CHANGED
|
@@ -9,16 +9,12 @@
|
|
|
9
9
|
> Example plugin for the
|
|
10
10
|
> [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
|
|
11
11
|
|
|
12
|
-
## Bun Module Usage
|
|
13
|
-
|
|
14
|
-
Add the module:
|
|
15
|
-
|
|
16
|
-
`bun add @flowscripter/example-plugin`
|
|
12
|
+
## Bundled Bun Module Usage
|
|
17
13
|
|
|
18
14
|
Use the module:
|
|
19
15
|
|
|
20
16
|
```typescript
|
|
21
|
-
import { ExampleExtension } from "
|
|
17
|
+
import { ExampleExtension } from "https://unpkg.com/@flowscripter/example-plugin/dist/bundle.js";
|
|
22
18
|
|
|
23
19
|
const extension = new ExampleExtension();
|
|
24
20
|
|
|
@@ -35,6 +31,12 @@ Test:
|
|
|
35
31
|
|
|
36
32
|
`bun test`
|
|
37
33
|
|
|
34
|
+
Bundle for usage as a
|
|
35
|
+
[dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
|
|
36
|
+
plugin:
|
|
37
|
+
|
|
38
|
+
`bun build index.ts --outdir ./dist --entry-naming bundle.js --minify`
|
|
39
|
+
|
|
38
40
|
**NOTE**: The following tasks use Deno as it excels at these and Bun does not
|
|
39
41
|
currently provide such functionality:
|
|
40
42
|
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d="foo";var b={sayHello:()=>{console.info("hello world")}},f={create:()=>{return Promise.resolve(b)}},h={extensionPoint:d,factory:f,extensionData:new Map([["extension_foo","extension_bar"]])},j={extensionDescriptors:[h],pluginData:new Map([["plugin_foo","plugin_bar"]])},k=j;export{b as exampleExtension,k as default};
|
package/package.json
CHANGED
|
@@ -15,20 +15,26 @@
|
|
|
15
15
|
"dynamic",
|
|
16
16
|
"import"
|
|
17
17
|
],
|
|
18
|
-
"module": "
|
|
18
|
+
"module": "dist/bundle.js",
|
|
19
19
|
"type": "module",
|
|
20
|
-
"version": "1.0.
|
|
20
|
+
"version": "1.0.11",
|
|
21
|
+
"exports": "./dist/bundle.js",
|
|
22
|
+
"files": [
|
|
23
|
+
"dist/",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
21
27
|
"publishConfig": {
|
|
22
28
|
"access": "public"
|
|
23
29
|
},
|
|
24
30
|
"devDependencies": {
|
|
25
|
-
"@types/bun": "^1.2.
|
|
31
|
+
"@types/bun": "^1.2.9"
|
|
26
32
|
},
|
|
27
33
|
"peerDependencies": {
|
|
28
|
-
"typescript": "^5.8.
|
|
34
|
+
"typescript": "^5.8.3"
|
|
29
35
|
},
|
|
30
36
|
"dependencies": {
|
|
31
|
-
"@flowscripter/dynamic-plugin-framework": "^1.3.
|
|
32
|
-
"@flowscripter/example-plugin-api": "^1.0.
|
|
37
|
+
"@flowscripter/dynamic-plugin-framework": "^1.3.16",
|
|
38
|
+
"@flowscripter/example-plugin-api": "^1.0.8"
|
|
33
39
|
}
|
|
34
40
|
}
|
package/bun.lock
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"lockfileVersion": 1,
|
|
3
|
-
"workspaces": {
|
|
4
|
-
"": {
|
|
5
|
-
"name": "@flowscripter/example-plugin",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@flowscripter/dynamic-plugin-framework": "^1.3.14",
|
|
8
|
-
"@flowscripter/example-plugin-api": "^1.0.6",
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@types/bun": "^1.2.5",
|
|
12
|
-
},
|
|
13
|
-
"peerDependencies": {
|
|
14
|
-
"typescript": "^5.8.2",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
"packages": {
|
|
19
|
-
"@flowscripter/dynamic-plugin-framework": ["@flowscripter/dynamic-plugin-framework@1.3.14", "", { "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-5ap5slnI4CcJSyZjIOu+j7a6qTAh64dYPD0BSRh7qEAlob/O2qhoYsIH72Be38FfI8jJGkC6MxCTw/JOpFYaXA=="],
|
|
20
|
-
|
|
21
|
-
"@flowscripter/example-plugin-api": ["@flowscripter/example-plugin-api@1.0.6", "", { "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-/gXAkdUOFng2iHE6PIvQ+aoF3gL4JisiO3x5MbqneZzyDxXwFuwDsEUjTjDf5MpDMyrwYP6PtCgN61MDL/NGGQ=="],
|
|
22
|
-
|
|
23
|
-
"@types/bun": ["@types/bun@1.2.5", "", { "dependencies": { "bun-types": "1.2.5" } }, "sha512-w2OZTzrZTVtbnJew1pdFmgV99H0/L+Pvw+z1P67HaR18MHOzYnTYOi6qzErhK8HyT+DB782ADVPPE92Xu2/Opg=="],
|
|
24
|
-
|
|
25
|
-
"@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
|
|
26
|
-
|
|
27
|
-
"@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
|
|
28
|
-
|
|
29
|
-
"bun-types": ["bun-types@1.2.5", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-3oO6LVGGRRKI4kHINx5PIdIgnLRb7l/SprhzqXapmoYkFl5m4j6EvALvbDVuuBFaamB46Ap6HCUxIXNLCGy+tg=="],
|
|
30
|
-
|
|
31
|
-
"typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
|
|
32
|
-
|
|
33
|
-
"undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
|
|
34
|
-
}
|
|
35
|
-
}
|
package/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default, exampleExtension } from "./src/ExamplePlugin.ts";
|
package/src/ExamplePlugin.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EXTENSION_POINT_1,
|
|
3
|
-
type ExtensionPoint1,
|
|
4
|
-
} from "@flowscripter/example-plugin-api";
|
|
5
|
-
import type {
|
|
6
|
-
ExtensionDescriptor,
|
|
7
|
-
ExtensionFactory,
|
|
8
|
-
Plugin,
|
|
9
|
-
} from "@flowscripter/dynamic-plugin-framework";
|
|
10
|
-
|
|
11
|
-
export const exampleExtension: ExtensionPoint1 = {
|
|
12
|
-
sayHello: () => {
|
|
13
|
-
console.info("hello world");
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const exampleExtensionFactory: ExtensionFactory = {
|
|
18
|
-
create: () => {
|
|
19
|
-
return Promise.resolve(exampleExtension);
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const exampleExtensionDescriptor: ExtensionDescriptor = {
|
|
24
|
-
extensionPoint: EXTENSION_POINT_1,
|
|
25
|
-
|
|
26
|
-
factory: exampleExtensionFactory,
|
|
27
|
-
|
|
28
|
-
extensionData: new Map<string, string>([[
|
|
29
|
-
"extension_foo",
|
|
30
|
-
"extension_bar",
|
|
31
|
-
]]),
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const examplePlugin: Plugin = {
|
|
35
|
-
extensionDescriptors: [
|
|
36
|
-
exampleExtensionDescriptor,
|
|
37
|
-
],
|
|
38
|
-
|
|
39
|
-
pluginData: new Map<string, string>([["plugin_foo", "plugin_bar"]]),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default examplePlugin;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { default as examplePlugin, exampleExtension } from "../index.ts";
|
|
3
|
-
import type { ExtensionPoint1 } from "@flowscripter/example-plugin-api";
|
|
4
|
-
|
|
5
|
-
describe("ExamplePlugin Tests", () => {
|
|
6
|
-
test("Access extension implementation via plugin", async () => {
|
|
7
|
-
expect(examplePlugin.pluginData?.get("plugin_foo")).toEqual("plugin_bar");
|
|
8
|
-
|
|
9
|
-
const extensionDescriptor = examplePlugin.extensionDescriptors[0];
|
|
10
|
-
|
|
11
|
-
expect(
|
|
12
|
-
extensionDescriptor.extensionData?.get("extension_foo"),
|
|
13
|
-
).toEqual(
|
|
14
|
-
"extension_bar",
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const extension = await extensionDescriptor.factory
|
|
18
|
-
.create() as ExtensionPoint1;
|
|
19
|
-
|
|
20
|
-
extension.sayHello();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("Access extension implementation directly", () => {
|
|
24
|
-
exampleExtension.sayHello();
|
|
25
|
-
});
|
|
26
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Enable latest features
|
|
4
|
-
"lib": ["ESNext", "DOM"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
|
|
22
|
-
// Some stricter flags (disabled by default)
|
|
23
|
-
"noUnusedLocals": false,
|
|
24
|
-
"noUnusedParameters": false,
|
|
25
|
-
"noPropertyAccessFromIndexSignature": false
|
|
26
|
-
}
|
|
27
|
-
}
|