@flowscripter/example-plugin 1.0.7 → 1.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # example-plugin
2
2
 
3
3
  [![version](https://img.shields.io/github/v/release/flowscripter/example-plugin?sort=semver)](https://github.com/flowscripter/example-plugin/releases)
4
- [![build](https://img.shields.io/github/actions/workflow/status/flowscripter/example-plugin/release-bun-library.yml)](https://github.com/flowscripter/example-plugin/actions/workflows/release-bun-library.yml)
4
+ [![build](https://img.shields.io/github/actions/workflow/status/flowscripter/example-plugin/release-bun-bundle.yml)](https://github.com/flowscripter/example-plugin/actions/workflows/release-bun-bundle.yml)
5
5
  [![coverage](https://codecov.io/gh/flowscripter/example-plugin/branch/main/graph/badge.svg?token=EMFT2938ZF)](https://codecov.io/gh/flowscripter/example-plugin)
6
6
  [![docs](https://img.shields.io/badge/docs-API-blue)](https://flowscripter.github.io/example-plugin/index.html)
7
7
  [![license: MIT](https://img.shields.io/github/license/flowscripter/example-plugin)](https://github.com/flowscripter/example-plugin/blob/main/LICENSE)
@@ -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 "@flowscripter/example-plugin";
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": "index.ts",
18
+ "module": "dist/bundle.js",
19
19
  "type": "module",
20
- "version": "1.0.7",
20
+ "version": "1.0.12",
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.5"
31
+ "@types/bun": "^1.2.9"
26
32
  },
27
33
  "peerDependencies": {
28
- "typescript": "^5.8.2"
34
+ "typescript": "^5.8.3"
29
35
  },
30
36
  "dependencies": {
31
- "@flowscripter/dynamic-plugin-framework": "^1.3.15",
32
- "@flowscripter/example-plugin-api": "^1.0.7"
37
+ "@flowscripter/dynamic-plugin-framework": "^1.3.16",
38
+ "@flowscripter/example-plugin-api": "^1.0.8"
33
39
  }
34
40
  }
@@ -1,12 +0,0 @@
1
- name: check-bun-dependencies
2
- on:
3
- workflow_dispatch:
4
- schedule:
5
- - cron: "0 0 * * *"
6
- permissions:
7
- contents: read
8
- pull-requests: write
9
- jobs:
10
- call-check-bun-dependencies:
11
- uses: flowscripter/.github/.github/workflows/check-bun-dependencies.yml@v1
12
- secrets: inherit
@@ -1,13 +0,0 @@
1
- name: lint-pr-message
2
- on:
3
- pull_request_target:
4
- types:
5
- - opened
6
- - edited
7
- - synchronize
8
- permissions:
9
- contents: read
10
- jobs:
11
- call-lint-pr-message:
12
- uses: flowscripter/.github/.github/workflows/lint-pr-message.yml@v1
13
- secrets: inherit
@@ -1,14 +0,0 @@
1
- name: release-bun-library
2
- on:
3
- push:
4
- branches: [main]
5
- permissions:
6
- contents: write
7
- issues: write
8
- pull-requests: write
9
- id-token: write
10
- pages: write
11
- jobs:
12
- call-release-bun-library:
13
- uses: flowscripter/.github/.github/workflows/release-bun-library.yml@v1
14
- secrets: inherit
@@ -1,10 +0,0 @@
1
- name: validate-bun-library-pr
2
- on:
3
- pull_request:
4
- branches: [main]
5
- permissions:
6
- contents: read
7
- jobs:
8
- call-validate-bun-library-pr:
9
- uses: flowscripter/.github/.github/workflows/validate-bun-library-pr.yml@v1
10
- secrets: inherit
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.15",
8
- "@flowscripter/example-plugin-api": "^1.0.7",
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.15", "", { "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-OhFb2IYNajJK3zeXs+BSCqxL7xr4K6AUcUYA67djsZTxDUekJ9Y+BzyfIPXO7qQRAoJpl/5utCJTmFBE5xVz5w=="],
20
-
21
- "@flowscripter/example-plugin-api": ["@flowscripter/example-plugin-api@1.0.7", "", { "peerDependencies": { "typescript": "^5.8.2" } }, "sha512-BPw88SQB35kzN8pU48wi9fHH0NRJfig/jtBaMWw0Orys7HGi4r0lwShJ+DBZ9XlpTKSQcMJsBnPKQE4OQX1DXw=="],
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";
@@ -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
- }