Zum Inhalt springen
Skillpedia
Allgemeines Programmieren8.1k · #12616

webiny-project-structure

Was er macht

Erklärt den Ordneraufbau eines Webiny-Projekts und die Rolle seiner zentralen Konfigurationsdatei. Sie ist für Entwickler gedacht, die neu bei Webiny sind und wissen müssen, wo sie ihren Code ablegen.

Wann du ihn nutzt

  • ✓Wenn ein Entwickler fragt, wo eigener Code in einem Webiny-Projekt stehen sollte.
  • ✓Wenn ein Entwickler wissen will, was die Datei webiny.config.tsx macht.
  • ✓Wenn ein Entwickler eine neue Erweiterung in einem Webiny-Projekt registrieren muss.

Link zum Skill

https://github.com/webiny/webiny-js/blob/next/skills/user-skills/project-structure/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/webiny/webiny-js/blob/next/skills/user-skills/project-structure/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Wo soll ich meinen eigenen Code in meinem Webiny-Projekt ablegen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Die Fähigkeit erklärt die wichtigsten Ordner und die Konfigurationsdatei, in der alle Erweiterungen registriert werden. Die KI nutzt das, um neuen Code an der richtigen Stelle abzulegen.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Webiny Project Structure

TL;DR

A Webiny project has a flat structure centered around webiny.config.tsx -- the single configuration file where all extensions are registered. Custom code lives in the extensions/ folder. Extensions are registered as React components (<Api.Extension>, <Admin.Extension>, <Infra.*>, <Cli.Command>) and can be conditionally loaded per environment.

Project Layout

my-webiny-project/
├── extensions/          # All custom code -- API, Admin, Infra, CLI extensions
│   └── README.md
├── public/              # Static assets for the Admin app
│   ├── favicon.ico
│   ├── global.css
│   ├── index.html
│   └── robots.txt
├── package.json         # Single package.json for the whole project
├── tsconfig.json        # Single TypeScript config
├── webiny.config.tsx    # Main configuration -- all extensions registered here
├── webiny-env.d.ts      # TypeScript environment types
└── yarn.lock

Key points:

  • Single package.json -- no monorepo, no workspaces needed.
  • Single tsconfig.json -- straightforward TypeScript setup.
  • webiny.config.tsx -- the entry point for everything. All extensions, infrastructure options, and project settings are declared here.
  • extensions/ -- where all your custom code lives. Organize with subfolders as needed (e.g., extensions/contactSubmission/, extensions/AdminBranding/).

The webiny.config.tsx File

This file exports a single React component called Extensions. It uses JSX to declaratively register all configuration:

// webiny.config.tsx
import React from "react";
import { Admin, Api, Cli, Infra, Project, Security } from "webiny/extensions";
import { Cognito } from "@webiny/cognito";

export const Extensions = () => {
  return (
    <>
      {/* Infrastructure configuration */}
      <Infra.Aws.DefaultRegion name={"us-east-1"} />
      <Infra.Core.OpenSearch enabled={true} />
      <Infra.Aws.Tags tags={{ OWNER: "me", PROJECT: "my-project" }} />

      {/* Identity provider */}
      <Cognito />

      {/* API extensions (backend) */}
      <Api.Extension src={"/extensions/ProductCategoryModel.ts"} />
      <Api.Extension src={"/extensions/ProductModel.ts"} />
      <Api.Extension src={"/extensions/contactSubmission/ContactSubmissionHook.ts"} />

      {/* Security hooks */}
      <Api.Extension src={"/extensions/MyApiKey.ts"} />
      <Security.ApiKey.AfterUpdate src={"/extensions/MyApiKeyAfterUpdate.ts"} />

      {/* Admin extensions (frontend) */}
      <Admin.Extension src={"/extensions/AdminTheme/AdminTheme.tsx"} />
      <Admin.Extension src={"/extensions/AdminTitleLogo/AdminTitleLogo.tsx"} />
      <Admin.Extension src={"/extensions/contactSubmission/EmailEntryListColumn.tsx"} />

      {/* Infrastructure / Pulumi extensions */}
      <Infra.Core.Pulumi src={"/extensions/MyCorePulumiHandler.ts"} />

      {/* CLI extensions */}
      <Cli.Command src={"/extensions/MyCustomCommand.ts"} />

      {/* Project settings */}
      <Project.Telemetry enabled={false} />
    </>
  );
};

Extension Types

JSX Element What It Does File Type
<Api.Extension src="..." /> Registers a backend extension (GraphQL schemas, content models, lifecycle hooks) .ts
<Admin.Extension src="..." /> Registers a frontend Admin UI extension (themes, branding, custom columns, custom forms) .tsx
<Infra.Core.Pulumi src="..." /> Registers a Pulumi infrastructure handler .ts
<Cli.Command src="..." /> Registers a custom CLI command .ts
<Security.ApiKey.AfterUpdate src="..." /> Registers a security lifecycle hook .ts

YOU MUST include the full file path with the .ts or .tsx extension in every src prop. For example, use src={"/extensions/MyModel.ts"}, NOT src={"/extensions/MyModel"}. Omitting the file extension will cause a build failure.

YOU MUST use export default for the createImplementation() call when the file is targeted directly by an Extensio

Häufige Fragen

Wofür ist der Erweiterungsordner da?

Er enthält eigenen Code für die API, den Admin, die Infrastruktur und die Kommandozeile eines Projekts.

Nutzt ein Webiny-Projekt mehrere Paketdateien?

Nein. Laut der Fähigkeit hat ein Projekt eine package.json und eine tsconfig.json, ohne Monorepo-Aufbau.

Welche Arten von Erweiterungen werden registriert?

Die Fähigkeit nennt API-, Admin-, Infrastruktur- und Kommandozeilen-Erweiterungen, die als Komponenten in der Konfigurationsdatei ergänzt werden.

Details

Originalbeschreibung des Autors

Webiny project layout, webiny.config.tsx anatomy, and extension registration. Use this skill when the developer asks about folder structure, where custom code goes, how to register extensions, what webiny.config.tsx does, or how the project is organized. Also use when they need to understand the relationship between extensions/, webiny.config.tsx, and the different extension types (Api, Admin, Infra, CLI).

repo: webiny/webiny-js

Beliebtheit

GitHub-Sterne
8.1k
Platz im Ranking
#12616
Lizenz
—
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills