Skip to content

Commit a64f7d7

Browse files
committed
Add default example actions
1 parent 0fb1722 commit a64f7d7

File tree

4 files changed

+28
-12
lines changed

4 files changed

+28
-12
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"@module-federation/enhanced": "^0.19.1",
2121
"@module-federation/node": "^2.7.17",
2222
"@module-federation/runtime": "^0.19.1",
23-
"@pulse-editor/react-api": "^0.1.1-alpha.40",
24-
"@pulse-editor/shared-utils": "^0.1.1-alpha.40",
23+
"@pulse-editor/react-api": "^0.1.1-alpha.42",
24+
"@pulse-editor/shared-utils": "^0.1.1-alpha.42",
2525
"cors": "^2.8.5",
2626
"dotenv": "^17.2.2",
2727
"express": "^5.1.0",

pregistered-actions.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Action } from "@pulse-editor/shared-utils";
2+
3+
export const preRegisteredActions: Record<string, Action> = {
4+
"example-action": {
5+
name: "Example action",
6+
description: "This is an example action.",
7+
parameters: {},
8+
returns: {
9+
response: {
10+
type: "string",
11+
description: "The result of the example action.",
12+
},
13+
},
14+
},
15+
};

pulse.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { AppConfig, AppTypeEnum } from "@pulse-editor/shared-utils";
22
import packageJson from "./package.json" with { type: "json" };
3+
import { preRegisteredActions } from "./pregistered-actions";
34

45
/**
56
* Pulse Editor Extension Config
@@ -18,7 +19,7 @@ const config: AppConfig = {
1819
recommendedHeight: 640,
1920
recommendedWidth: 360,
2021
thumbnail: "assets/thumbnail.png",
21-
preRegisteredActions: [],
22+
preRegisteredActions: Object.values(preRegisteredActions),
2223
};
2324

2425
export default config;

0 commit comments

Comments
 (0)