본문으로 건너뛰기
Skillpedia
일반 코딩8.1k · #12591

webiny-v5-to-v6-migration

하는 일

이 스킬은 Webiny의 오래된 플러그인 방식에서 현재의 기능 기반 설계로 코드를 옮기는 방법을 AI에게 보여 줍니다. v5 프로젝트를 v6으로 업그레이드하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓v5 플러그인을 v6 기능으로 옮기는 중일 때.
  • ✓오래된 컨텍스트 플러그인을 주입된 서비스로 바꿔야 할 때.
  • ✓v5 이벤트 구독을 v6 이벤트 핸들러로 바꿔야 하는 경우.

스킬 링크

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/v5-to-v6-migration/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/api/v5-to-v6-migration/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 v5 컨텍스트 플러그인을 번역 서비스를 제공하는 v6 주입 서비스로 바꿔 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 v5와 v6의 나란한 패턴을 보여 줍니다. 예를 들어 컨텍스트 플러그인을 구현체가 있는 추상화로 바꾸고, 이벤트 구독을 이벤트 핸들러로 바꾸는 방식입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

v5 → v6 Migration Patterns

Overview

v6 replaces v5's plugin-based architecture with feature-based DI. The key shifts:

v5 Concept v6 Equivalent
ContextPlugin createAbstraction + createImplementation (Service)
Plugin array createFeature + container.register()
context.myService DI injection via constructor
onEntryAfterCreate.subscribe() EventHandler feature
new GraphQLSchemaPlugin() GraphQLSchemaFactory.createImplementation()

Pattern 1: Context Plugin → DI Service

v5

new ContextPlugin(async context => {
  context.lingotekService = {
    translate: async (docId, locale) => {
      /* ... */
    },
    getStatus: async docId => {
      /* ... */
    },
    deleteProject: async projectId => {
      /* ... */
    }
  };
});

v6

// features/lingotekService/abstractions.ts
import { createAbstraction } from "webiny/api";

export interface ILingotekService {
  translate(docId: string, locale: string): Promise<Result<void, Error>>;
  getStatus(docId: string): Promise<Result<TranslationStatus, Error>>;
  deleteProject(projectId: string): Promise<Result<void, Error>>;
}

export const LingotekService = createAbstraction<ILingotekService>("MyExt/LingotekService");

export namespace LingotekService {
  export type Interface = ILingotekService;
}

// features/lingotekService/LingotekService.ts
class LingotekServiceImpl implements LingotekService.Interface {
  constructor(private buildParams: BuildParams.Interface) {}

  async translate(docId: string, locale: string) {
    /* ... */
  }
  async getStatus(docId: string) {
    /* ... */
  }
  async deleteProject(projectId: string) {
    /* ... */
  }
}

export default LingotekService.createImplementation({
  implementation: LingotekServiceImpl,
  dependencies: [BuildParams]
});

// features/lingotekService/feature.ts
export const LingotekServiceFeature = createFeature({
  name: "LingotekService",
  register(container) {
    container.register(LingotekServiceImpl).inSingletonScope();
  }
});

Key difference: v5 attaches to context object. v6 uses DI — consumers declare the service as a constructor dependency.


Pattern 2: Event Subscription → EventHandler Feature

v5

context.cms.onEntryAfterCreate.subscribe(async params => {
  if (params.model.modelId !== "myModel") return;
  await doSomething(params.entry);
});

v6

// features/syncOnCreate/EntryAfterCreateHandler.ts
import { EntryAfterCreateEventHandler } from "webiny/api/cms/entry";
import { LingotekService } from "../lingotekService/abstractions.js";
import { MY_MODEL_ID } from "~/shared/constants.js";

class SyncOnCreateHandler implements EntryAfterCreateEventHandler.Interface {
  constructor(private lingotekService: LingotekService.Interface) {}

  async handle(event: EntryAfterCreateEventHandler.Event) {
    const { entry, model } = event.payload;
    if (model.modelId !== MY_MODEL_ID) return;
    await this.lingotekService.translate(entry.entryId, "en");
  }
}

export default EntryAfterCreateEventHandler.createImplementation({
  implementation: SyncOnCreateHandler,
  dependencies: [LingotekService]
});

// features/syncOnCreate/feature.ts
export const SyncOnCreateFeature = createFeature({
  name: "SyncOnCreate",
  register(container) {
    container.register(SyncOnCreateHandler);
  }
});

Key differences:

  • Feature directory is named by business capability (syncOnCreate), not by event name
  • Handler is a thin orchestrator — business logic lives in the injected service
  • Must filter by model.modelId — handler fires for ALL models

Pattern 3: Plugin Array → Feature Registration

v5

export default () => [
    new GraphQLSchemaPlugin({ ... }),
    new ContextPlugin(async ctx => { ... }),
    myModelPlugin,
    eventSubscriptionPlugin
];

v6

// api/Extension.ts
import { createFeature } from "webiny/api";

export const Extension = createFeature({
  name: "MyExtension",
  register(container) {
    container.register(MyModel);
    container.register(MyGraphQLSchema);
    SyncOnCreateFeature.register(container);
 
자주 묻는 질문

컨텍스트 플러그인은 무엇으로 바뀌나요?

구현체와 함께 의존성 주입을 통해 주입되는 추상화입니다.

GraphQL 스키마 플러그인은 무엇으로 바뀌나요?

스킬의 표에 따르면 GraphQL 스키마 팩토리 구현입니다.

AI 에이전트만을 위한 스킬인가요?

이 스킬은 마이그레이션을 하는 AI 에이전트를 위해 쓰였지만, 사람도 같은 패턴을 따를 수 있습니다.

상세 정보

작성자의 원본 설명

Migration patterns for converting v5 Webiny code to v6 architecture. Use this skill when migrating existing v5 plugins to v6 features, converting context plugins to DI services, adapting v5 event subscriptions to v6 EventHandlers, or understanding how v5 patterns translate to v6. Targeted at AI agents performing migrations.

repo: webiny/webiny-js

인기도

GitHub 스타
8.1k
순위
#12591
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬