@luna-park/plugin 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/README.md +13 -13
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -18,22 +18,19 @@ The primary way to define a plugin is using the `makePlugin` helper function. Th
18
18
  import { makePlugin, ELogicType } from "@luna-park/plugin";
19
19
  import awesomeIcon from "./awesome-icon.svg"; // Icon URL
20
20
 
21
- // Define your plugin's configuration schema (optional)
22
- const config = LogicType.object({
23
- apiKey: LogicType.string(),
24
- theme: LogicType.string({enum: ["light", "dark"], default: "dark"}),
25
- }) satisfies TSchema;
26
-
27
21
  export default makePlugin({
28
22
  id: "my-awesome-plugin",
29
23
  name: "My Awesome Plugin",
30
24
  icon: awesomeIcon, // Icon URL
31
25
  description: "Adds amazing capabilities to Luna Park.",
32
26
 
33
- // Plugin configuration schema
34
- config: ConfigSchema,
27
+ // Plugin configuration schema (optional)
28
+ config: LogicType.object({
29
+ apiKey: LogicType.string(),
30
+ theme: LogicType.string({enum: ["light", "dark"], default: "dark"}),
31
+ }),
35
32
 
36
- // Lifecycle hooks
33
+ // Lifecycle hooks (optional)
37
34
  lifecycle: {
38
35
  mount: async (env) => {
39
36
  console.log("Plugin mounted", env.config.apiKey);
@@ -48,7 +45,7 @@ export default makePlugin({
48
45
 
49
46
  // Extend the editor
50
47
  editor: {
51
- // Register custom Vue components for the editor
48
+ // Register custom Vue components for the editor (optional)
52
49
  components: [
53
50
  {
54
51
  name: "Element/Avatar",
@@ -63,7 +60,8 @@ export default makePlugin({
63
60
  }
64
61
  // ... component definitions
65
62
  ],
66
- // Register custom logic nodes
63
+
64
+ // Register custom logic nodes (optional)
67
65
  nodes: [
68
66
  makeLogicNode({
69
67
  name: "log/stuff",
@@ -86,10 +84,12 @@ export default makePlugin({
86
84
  })
87
85
  // ... node definitions
88
86
  ],
89
- wrapper : MyWrapperComponent, // Custom wrapper component for the editor
87
+
88
+ // Register wrapper for the editor (optional)
89
+ wrapper : MyWrapperComponent,
90
90
  },
91
91
 
92
- // Code injection options
92
+ // Code injection options (optional)
93
93
  inject: {
94
94
  css: "body { background-color: #000; }",
95
95
  js: "console.log('Hello world!')"
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@luna-park/plugin",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "private": false,
5
5
  "description": "Plugin helper for Luna Park.",
6
6
  "homepage": "https://luna-park.app",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/lunapark"
9
+ "url": "https://github.com/lunapark/lunapark"
10
10
  },
11
11
  "author": {
12
12
  "name": "Luna Park",