@flowscripter/example-plugin-api 1.0.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.
@@ -0,0 +1,9 @@
1
+ name: check-bun-dependencies
2
+ on:
3
+ workflow_dispatch:
4
+ schedule:
5
+ - cron: "0 0 * * *"
6
+ jobs:
7
+ call-check-bun-dependencies:
8
+ uses: flowscripter/.github/.github/workflows/check-bun-dependencies.yml@v1
9
+ secrets: inherit
@@ -0,0 +1,11 @@
1
+ name: lint-pr-message
2
+ on:
3
+ pull_request_target:
4
+ types:
5
+ - opened
6
+ - edited
7
+ - synchronize
8
+ jobs:
9
+ call-lint-pr-message:
10
+ uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
11
+ secrets: inherit
@@ -0,0 +1,8 @@
1
+ name: release-bun-library
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ jobs:
6
+ call-release-bun-library:
7
+ uses: flowscripter/.github/.github/workflows/release-bun-library.yml@v1
8
+ secrets: inherit
@@ -0,0 +1,8 @@
1
+ name: validate-bun-library-pr
2
+ on:
3
+ pull_request:
4
+ branches: [main]
5
+ jobs:
6
+ call-validate-bun-library-pr:
7
+ uses: flowscripter/.github/.github/workflows/validate-bun-library-pr.yml@v1
8
+ secrets: inherit
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Flowscripter
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # example-plugin-api
2
+
3
+ [![version](https://img.shields.io/github/v/release/flowscripter/example-plugin-api?sort=semver)](https://github.com/flowscripter/example-plugin-api/releases)
4
+ [![build](https://img.shields.io/github/actions/workflow/status/flowscripter/example-plugin-api/release-bun-library.yml)](https://github.com/flowscripter/example-plugin-api/actions/workflows/release-bun-library.yml)
5
+ [![coverage](https://codecov.io/gh/flowscripter/example-plugin-api/branch/main/graph/badge.svg?token=EMFT2938ZF)](https://codecov.io/gh/flowscripter/example-plugin-api)
6
+ [![docs](https://img.shields.io/badge/docs-API-blue)](https://flowscripter.github.io/example-plugin-api/index.html)
7
+ [![license: MIT](https://img.shields.io/github/license/flowscripter/example-plugin-api)](https://github.com/flowscripter/example-plugin-api/blob/main/LICENSE)
8
+
9
+ > Example plugin API for the
10
+ > [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
11
+
12
+ ## Bun Module Usage
13
+
14
+ Add the module:
15
+
16
+ `bun add @flowscripter/example-plugin-api`
17
+
18
+ Use the module:
19
+
20
+ ```typescript
21
+ import {
22
+ EXTENSION_POINT_1,
23
+ ExtensionPoint1,
24
+ } from "@flowscripter/example-plugin-api";
25
+
26
+ // ExtensionPoint1 is identified by EXTENSION_POINT_1 identifier
27
+
28
+ class MyExtensionPointImplementation implements ExtensionPoint1 {
29
+ public sayHello(): void {
30
+ // greetings...
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## Development
36
+
37
+ Test:
38
+
39
+ `bun test`
40
+
41
+ **NOTE**: The following tasks use Deno as it excels at these and Bun does not
42
+ currently provide such functionality:
43
+
44
+ Format:
45
+
46
+ `deno fmt`
47
+
48
+ Lint:
49
+
50
+ `deno lint index.ts`
51
+
52
+ Generate HTML API Documentation:
53
+
54
+ `deno doc --html --name=example-plugin-api index.ts`
55
+
56
+ ## Documentation
57
+
58
+ ### Overview
59
+
60
+ ```mermaid
61
+ classDiagram
62
+
63
+ class ExtensionPoint1 {
64
+ <<interface>>
65
+ sayHello()
66
+ }
67
+ ```
68
+
69
+ ### Framework API
70
+
71
+ Refer to the
72
+ [dynamic-plugin-framework](https://github.com/flowscripter/dynamic-plugin-framework)
73
+ for an overview of what this example is demonstrating.
74
+
75
+ ### API
76
+
77
+ Link to auto-generated API docs:
78
+
79
+ [API Documentation](https://flowscripter.github.io/example-plugin-api/index.html)
80
+
81
+ ## License
82
+
83
+ MIT © Flowscripter
package/bun.lock ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "lockfileVersion": 1,
3
+ "workspaces": {
4
+ "": {
5
+ "name": "@flowscripter/example-plugin-api",
6
+ "devDependencies": {
7
+ "@types/bun": "^1.2.4",
8
+ },
9
+ "peerDependencies": {
10
+ "typescript": "^5.8.2",
11
+ },
12
+ },
13
+ },
14
+ "packages": {
15
+ "@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
16
+
17
+ "@types/node": ["@types/node@22.13.9", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw=="],
18
+
19
+ "@types/ws": ["@types/ws@8.5.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
20
+
21
+ "bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
22
+
23
+ "typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
24
+
25
+ "undici-types": ["undici-types@6.20.0", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
26
+ }
27
+ }
package/index.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Identifier for the {@link ExtensionPoint1} interface.
3
+ */
4
+ export const EXTENSION_POINT_1 = "foo";
5
+
6
+ /**
7
+ * An example extension interface to be implemented by a plugin.
8
+ */
9
+ export interface ExtensionPoint1 {
10
+ /**
11
+ * Performs a greeting.
12
+ */
13
+ sayHello(): void;
14
+ }
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@flowscripter/example-plugin-api",
3
+ "module": "index.ts",
4
+ "type": "module",
5
+ "version": "1.0.0",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "devDependencies": {
10
+ "@types/bun": "^1.2.4"
11
+ },
12
+ "peerDependencies": {
13
+ "typescript": "^5.8.2"
14
+ }
15
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,27 @@
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
+ }