Skip to content

Commit f32e9a6

Browse files
Copilothotlong
andcommitted
fix: rename PluginContext to AppPluginContext to avoid duplicate identifier with @objectstack/spec
The @objectstack/spec package already exports a PluginContext type that is re-exported from @object-ui/types. Renamed the ObjectUI-specific plugin context interface to AppPluginContext to avoid TS2300 duplicate identifier. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent b45df71 commit f32e9a6

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

examples/crm/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* import { crmConfig } from '@object-ui/example-crm/plugin';
1919
*/
2020

21-
import type { PluginContext } from '@object-ui/types';
21+
import type { AppPluginContext } from '@object-ui/types';
2222
import config from './objectstack.config';
2323

2424
/** Raw CRM stack configuration for direct merging */
@@ -40,7 +40,7 @@ export class CRMPlugin {
4040
// No initialization needed
4141
}
4242

43-
async start(ctx: PluginContext) {
43+
async start(ctx: AppPluginContext) {
4444
const logger = ctx.logger || console;
4545

4646
try {

examples/kitchen-sink/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* import { kitchenSinkConfig } from '@object-ui/example-kitchen-sink/plugin';
1919
*/
2020

21-
import type { PluginContext } from '@object-ui/types';
21+
import type { AppPluginContext } from '@object-ui/types';
2222
import config from './objectstack.config';
2323

2424
/** Raw Kitchen Sink stack configuration for direct merging */
@@ -40,7 +40,7 @@ export class KitchenSinkPlugin {
4040
// No initialization needed
4141
}
4242

43-
async start(ctx: PluginContext) {
43+
async start(ctx: AppPluginContext) {
4444
const logger = ctx.logger || console;
4545

4646
try {

examples/todo/plugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* import { todoConfig } from '@object-ui/example-todo/plugin';
1919
*/
2020

21-
import type { PluginContext } from '@object-ui/types';
21+
import type { AppPluginContext } from '@object-ui/types';
2222
import config from './objectstack.config';
2323

2424
/** Raw Todo stack configuration for direct merging */
@@ -40,7 +40,7 @@ export class TodoPlugin {
4040
// No initialization needed
4141
}
4242

43-
async start(ctx: PluginContext) {
43+
async start(ctx: AppPluginContext) {
4444
const logger = ctx.logger || console;
4545

4646
try {

packages/core/src/registry/PluginSystem.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import type { Registry } from './Registry.js';
10-
import type { PluginScope, PluginScopeConfig, AppMetadataPlugin, PluginContext } from '@object-ui/types';
10+
import type { PluginScope, PluginScopeConfig, AppMetadataPlugin, AppPluginContext } from '@object-ui/types';
1111
import { PluginScopeImpl } from './PluginScopeImpl.js';
1212

1313
export interface PluginDefinition {
@@ -169,7 +169,7 @@ export class PluginSystem {
169169
* @param registry - The component registry
170170
* @param ctx - Optional context passed to the plugin's start() hook
171171
*/
172-
async install(plugin: AppMetadataPlugin, registry: Registry, ctx?: PluginContext): Promise<void> {
172+
async install(plugin: AppMetadataPlugin, registry: Registry, ctx?: AppPluginContext): Promise<void> {
173173
if (this.loaded.has(plugin.name)) {
174174
console.warn(`Plugin "${plugin.name}" is already installed. Skipping.`);
175175
return;

packages/types/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ export type {
810810
export type {
811811
PluginScope,
812812
PluginScopeConfig,
813-
PluginContext,
813+
AppPluginContext,
814814
AppMetadataPlugin,
815815
ComponentMeta as PluginComponentMeta,
816816
ComponentInput as PluginComponentInput,

packages/types/src/plugin-scope.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export type PluginEventHandler = (data?: any) => void;
187187
/**
188188
* Plugin lifecycle context passed to init/start/stop hooks
189189
*/
190-
export interface PluginContext {
190+
export interface AppPluginContext {
191191
/** Logger instance (falls back to console) */
192192
logger?: { info: (...args: unknown[]) => void; warn: (...args: unknown[]) => void; error: (...args: unknown[]) => void };
193193
/** Kernel/runtime reference for plugin registration */
@@ -236,7 +236,7 @@ export interface AppMetadataPlugin {
236236
* Start the plugin — register metadata with the kernel/runtime.
237237
* @param ctx - Lifecycle context providing logger and kernel references
238238
*/
239-
start(ctx: PluginContext): Promise<void> | void;
239+
start(ctx: AppPluginContext): Promise<void> | void;
240240

241241
/**
242242
* Stop the plugin — tear down resources and deregister.

0 commit comments

Comments
 (0)