Skip to content

Commit

Permalink
Merge pull request #550 from amplication/docs/plugins-cleanup
Browse files Browse the repository at this point in the history
Docs: Plugins section cleanup
  • Loading branch information
yuval-hazaz authored Dec 5, 2024
2 parents 31c1e6d + 43113c3 commit 5a55629
Show file tree
Hide file tree
Showing 16 changed files with 61 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/concepts/event-driven-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ For a step-by-step guide on building an event-driven application with Amplicatio

## Step 1: Create a Message Broker

In your Amplication project, navigate to "Add Resource" and select "[Message Broker](/how-to/create-message-broker)". This will lead you to the Message Broker Creation Wizard.
In your Amplication project, navigate to "Add Resource" and select "[Message Broker](/guides/message-broker)". This will lead you to the Message Broker Creation Wizard.

After creating the message broker, you'll be able to configure the settings by installing and configuring the appropriate [message broker plugin](#supported-message-brokers).

Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ pagination_prev: getting-started/community-plugins

Amplication uses _Plugins_ to extend the functionality of your generated service. These software additions allow developers to customize the default behavior of [Amplication's code generation process](/plugins/plugin-architecture/), providing hooks into various stages of service creation.

Amplication offers a wide range of community-created plugins that are open-source and available on GitHub. You also have the flexibility to develop your own [custom plugins](/plugins/overview/) so you can tailor your generated service to meet your exact requirements.
Amplication offers a wide range of community plugins that are open-source and available on GitHub.
You can also [develop your own private plugins](/private-plugins/) and [community plugins](/plugins/overview/) to extend Amplication's functionality and have it meet your exact requirements.

You can enable certain plugins when you first create your service.
For example, if you choose MySQL as your database, the _MySQL DB_ plugin will be enabled.
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/authentication-plugin-examples.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Authentication Plugin Guide
sidebar_label: Authentication Plugin Guide
slug: /plugins/guides/authentication
slug: /guides/authentication
pagination_next: getting-started/authentication
---

Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/choose-configure-update-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: choose-configure-update-database
title: How To Choose, Configure, and Update Your Database
description: Learn how to choose, configure, and update your Amplication database using plugins.
sidebar_label: Database Plugin Guide
slug: /plugins/guides/database
slug: /guides/database
---

# How To Choose, Configure, and Update Your Database
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/create-message-broker.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: create-message-broker
title: How to create a message broker
sidebar_label: Create a Message Broker
slug: /how-to/create-message-broker
slug: /guides/message-broker
---

# Create a message broker
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Whether you are a beginner just starting with Amplication or an experienced deve
- [Entity Relations](/relations/)
- [Base Directories](/how-to/base-directories)
- [Configure selective code generation](/how-to/api-admin-ui-settings/)
- [Create a message broker](/how-to/create-message-broker)
- [Create a message broker](/guides/message-broker)

Browse through the available tutorials and start building your web app with Amplication.
2 changes: 1 addition & 1 deletion docs/plugins/define-plugin-settings.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: define-plugin-settings
title: How To Define Plugin Settings
sidebar_label: How To Define Plugin Settings
sidebar_label: Define Plugin Settings
slug: /plugins/define-plugin-settings
---

Expand Down
9 changes: 4 additions & 5 deletions docs/plugins/developing-a-plugin.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
---
id: how-to-create-plugin
title: How to Create a Custom Plugin
sidebar_label: How to Create a Custom Plugin
title: How to Develop a Plugin
sidebar_label: Develop a Plugin
slug: /plugins/how-to-create-plugin
---

Amplication includes several plugins - some allow you to choose an authentication strategy, some allow you to choose which database you want to integrate with and one allows you to connect your service to a message broker.
### Pre-requisites

### Planning and POC:
Before any development of a plugin, we take the following steps:
Before the development of a plugin, take the following steps:

1. Generate a service with Amplication
2. Apply the changes that we need:
Expand Down
6 changes: 3 additions & 3 deletions docs/plugins/event-hierarchy.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
id: event-hierarchy
title: Event Hierarchy
sidebar_label: Event Hierarchy
title: Plugin Event Hierarchy
sidebar_label: Plugin Event Hierarchy
slug: /plugins/event-hierarchy
---

# Event Hierarchy
# Plugin Event Hierarchy

We have two main event hierarchies in our Data Service Generator (DSG) service: one for Node.js services and one for .NET services. Each of these hierarchies includes events to create the server's files and, in the case of Node.js, the admin-ui files.

Expand Down
15 changes: 12 additions & 3 deletions docs/plugins/plugin-architecture.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: plugin-architecture
title: Plugin Architecture Overview
sidebar_label: Custom Plugin Architecture
title: Plugin Architecture
sidebar_label: Plugin Architecture
slug: /plugins/plugin-architecture
---

Expand All @@ -15,7 +15,16 @@ The `pluginWrapper` function is invoked with the following arguments:
- **event** - the name of event we want to capture, and change something in the triggered process.
- **args** - the original parameters of the DSG function. These are likely to be used as the parameters of the event, for the plugin developer to have access to these params and manipulate the returned value of the function.

For the purpose of this architecture overview, remember that every event has before and after property (which is a function), representing the event's lifecycle in which you can intervene (before the emission of the event and after the emission of the event). For more information about `before` and `after` event see [Before and After Lifecycle Functions](docs\plugins\before-after.md)
## Event Lifecycle

Each plugin event supports two execution points:

- `before`: Executes before the main event processing
- `after`: Executes after the main event processing

These lifecycle hooks allow precise control over the code generation process.

For more information about `before` and `after` event see [Before and After Lifecycle Functions](docs\plugins\before-after.md)

When the `pluginWrapper` function is invoked, it checks whether the event argument that was passed has a `before` or `after` property. If so, it invokes other functions that are responsible for calculating the final behavior when this event is emitted, or in other words, the outcome of the function that this event is responsible to execute.

Expand Down
3 changes: 2 additions & 1 deletion docs/plugins/plugindev-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ pagination_prev: plugins/event-hierarchy

# Plugin Development Overview

A plugin is a custom code that extends Amplication developer platform with new features. The features incorporated can be generic, useful to a wide variety of users, or can be very specific to deal with specialized requirements.
A plugin is code that extends the Amplication developer platform by adding new features or modifying existing functionality.
The features incorporated can be generic, useful to a wide variety of users, or can be very specific to deal with specialized requirements.

If you or your organization have a specific workflow, install an existing plugin or write one to customize the platform to perform your required tasks.

Expand Down
3 changes: 2 additions & 1 deletion docs/plugins/private-plugins.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
id: private-plugins
sidebar_label: Private Plugins
slug: /private-plugins
toc_max_heading_level: 2
---

# Creating and Using Private Plugins
# Private Plugins

Private Plugins enable you to create plugins exclusively for your organization's use.
These plugins let you build secure, proprietary integrations and define your organization's standards. You can use them to protect sensitive business logic and enforce development best practices across your services.
Expand Down
8 changes: 6 additions & 2 deletions docs/plugins/publish-your-plugin.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
id: publish-plugin
title: How To Publish a Custom Plugin
sidebar_label: How To Publish a Custom Plugin
title: How To Publish a Plugin
sidebar_label: Publish a Plugin
description: Learn how to publish your Amplication plugin.
slug: /plugins/publish-plugin
---

:::info
These steps are for publishing a publicly available [community plugin](/getting-started/plugins/). For information on releasing private plugins, see the [Private Plugins](/private-plugins/) page.
:::

Step 1. Create the Plugin

Step 2. Publish the Plugin in NPM. For details, see [NPM documentation](https://docs.npmjs.com/cli/v6/commands/npm-publish)
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins/testing-a-plugin.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
id: how-to-test-plugin
title: How to Test a Custom Plugin
sidebar_label: How to Test a Custom Plugin
title: How to Test a Plugin
sidebar_label: Test a Plugin
slug: /plugins/how-to-test-plugin
---

Expand Down
10 changes: 9 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,15 @@ module.exports = {
{
redirects: [
{
to: "/plugins/guides/authentication",
to: "/guides/database",
from: ["/plugins/guides/database/"]
},
{
to: "/guides/message-broker",
from: ["/how-to/create-message-broker"]
},
{
to: "/guides/authentication",
from: ["/authentication-plugin-examples"]
},
{
Expand Down
27 changes: 13 additions & 14 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,33 +184,23 @@ const sidebars = {
"getting-started/plugins",
"getting-started/community-plugins",
"plugins/dotnet-plugins",
{
type: "category",
label: "Plugin Guides",
items: [
"how-to/choose-configure-update-database",
"how-to/authentication-plugin-examples",
"how-to/create-message-broker",
]
},
{
type: "category",
label: "Custom Plugins",
label: "Plugin Development",
link: {
type:"doc",
id: "plugins/overview"
},
items: [
"plugins/overview",
"plugins/plugin-architecture",
"plugins/event-hierarchy",
"plugins/plugin-events-before-after",
"plugins/context-skip-default",
"plugins/how-to-create-plugin",
"plugins/define-plugin-settings",
"plugins/how-to-test-plugin",
"plugins/publish-plugin",
"plugins/private-plugins",
"plugins/plugin-events-before-after",
"plugins/context-skip-default",
"plugins/event-hierarchy",
{
type: "category",
label: ".NET Plugin Events - Reference",
Expand Down Expand Up @@ -281,6 +271,15 @@ const sidebars = {
items: [
"tutorials/index",
"tutorials/community-tutorials",
{
type: "category",
label: "Guides",
items: [
"how-to/choose-configure-update-database",
"how-to/authentication-plugin-examples",
"how-to/create-message-broker",
]
},
{
type: "link",
label: "Developer Tutorials",
Expand Down

0 comments on commit 5a55629

Please sign in to comment.