Skip to content

Commit 88264a0

Browse files
committed
Refactor plugin configuration to use defineStack for improved consistency and clarity
1 parent 8aba16c commit 88264a0

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

examples/plugin-advanced-crm/objectstack.config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ObjectStackManifest } from '@objectstack/spec/system';
1+
import { defineStack } from '@objectstack/spec';
22

33
/**
44
* Advanced CRM Plugin Example
@@ -10,7 +10,8 @@ import { ObjectStackManifest } from '@objectstack/spec/system';
1010
* - Defines extension points
1111
* - Uses proper naming conventions
1212
*/
13-
const CRMPlugin: ObjectStackManifest = {
13+
export default defineStack({
14+
manifest: {
1415
// Basic Information
1516
id: 'com.acme.crm.advanced',
1617
name: 'ACME Advanced CRM',
@@ -392,6 +393,4 @@ const CRMPlugin: ObjectStackManifest = {
392393
entry: './src/index.ts',
393394
},
394395
},
395-
};
396-
397-
export default CRMPlugin;
396+
}});

examples/plugin-bi/objectstack.config.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { ObjectStackManifest } from '@objectstack/spec/system';
1+
import { defineStack } from '@objectstack/spec';
22

3-
const BiPlugin: ObjectStackManifest = {
4-
id: 'com.objectstack.bi',
5-
name: 'Business Intelligence Plugin',
6-
version: '1.0.0',
7-
type: 'plugin',
8-
description: 'Provides BI capabilities, dataset definitions, and chart rendering.',
9-
10-
// 1. Configuration (Settings)
11-
configuration: {
3+
export default defineStack({
4+
manifest: {
5+
id: 'com.objectstack.bi',
6+
name: 'Business Intelligence Plugin',
7+
version: '1.0.0',
8+
type: 'plugin',
9+
description: 'Provides BI capabilities, dataset definitions, and chart rendering.',
10+
11+
// 1. Configuration (Settings)
12+
configuration: {
1213
title: 'BI Plugin Configuration',
1314
properties: {
1415
enableCache: {
@@ -53,13 +54,12 @@ const BiPlugin: ObjectStackManifest = {
5354
]
5455
},
5556

56-
// 3. Lifecycle Entry Point
57-
// in a real scenario, this would be a path or module name
58-
extensions: {
59-
runtime: {
60-
entry: './src/index.ts'
57+
// 3. Lifecycle Entry Point
58+
// in a real scenario, this would be a path or module name
59+
extensions: {
60+
runtime: {
61+
entry: './src/index.ts'
62+
}
6163
}
6264
}
63-
};
64-
65-
export default BiPlugin;
65+
});

0 commit comments

Comments
 (0)