Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/context7-refresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "🔄 - Refresh Context7"

on:
push:
branches:
- main

jobs:
refresh:
name: "🔄 - Trigger Context7 refresh"
if: github.repository == 'mage-os/devdocs'
runs-on: ubuntu-latest

steps:
- name: "🔄 - Request re-index of /mage-os/devdocs"
env:
CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }}
run: |
if [ -z "$CONTEXT7_API_KEY" ]; then
echo "CONTEXT7_API_KEY secret not set; skipping refresh."
exit 0
fi
curl -sS --fail-with-body -X POST https://context7.com/api/v1/refresh \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $CONTEXT7_API_KEY" \
-d '{"libraryName": "/mage-os/devdocs"}'
2 changes: 1 addition & 1 deletion best-practices-for-extension-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provided by Magento to ensure consistency across projects.

Here's a typical directory structure for a Magento 2 extension:

```
```plaintext
├── app
│ └── code
│ └── VendorName
Expand Down
4 changes: 2 additions & 2 deletions brief-explanation-of-each-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ the `VendorName_ModuleName` naming convention.

Example module structure:

```
```plaintext
app
├── code
│ └── VendorName
Expand All @@ -55,7 +55,7 @@ located in the `app/design` directory and allow for customization and branding o

Example of a theme structure:

```
```plaintext
app
├── design
│ └── frontend
Expand Down
36 changes: 36 additions & 0 deletions context7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://context7.com/schema/context7.json",
"url": "https://context7.com/mage-os/devdocs",
"public_key": "pk_HsBSv7f4tLBOYsckJH4BP",
"projectTitle": "Mage-OS",
"description": "Developer documentation for Mage-OS, a community-governed independent distribution of Magento Open Source, compatible with Magento 2 extensions and themes. Covers installation, module development, theming, APIs, testing, and XML configuration file references. Mage-OS 3.x also ships features Magento Open Source lacks, such as built-in Returns Management (RMA).",
"excludeFiles": [
"README.md",
"CODEOWNERS",
"documentation.md",
"acl.md",
"cron_groups.md",
"db_schema.md",
"di.md",
"extension_attributes.md",
"fieldset.md",
"indexer.md",
"menu.md",
"routes.md",
"webapi.md",
"widget.md",
"rest-apis-soap-apis.md",
"the-magento-application-and-service-contracts.md"
],
"rules": [
"Mage-OS is an independent distribution of Magento Open Source. Write the product name as 'Mage-OS' (hyphenated, capital OS).",
"PHP class namespaces in Mage-OS are unchanged from Magento: use Magento\\Framework, Magento\\Catalog, and so on. Never rewrite these to Mage-OS.",
"The CLI entrypoint is bin/magento, not bin/mage-os.",
"Install Mage-OS with: composer create-project --repository-url=https://repo.mage-os.org/ mage-os/project-community-edition .",
"Mage-OS 3.x requires PHP 8.3, 8.4, or 8.5. Do not suggest PHP 8.1 or 8.2.",
"For new modules, declare database schema with db_schema.xml (declarative schema), the recommended approach since Magento 2.3. The older InstallSchema.php / UpgradeSchema.php classes still work and are still @api, but do not generate them for new code.",
"Prefer a plugin (interceptor) or an observer over class preferences in di.xml when extending core behaviour.",
"Returns Management (RMA) ships in core Mage-OS from 3.0.0: the mage-os/product-community-edition metapackage requires mage-os/module-rma. Do not tell Mage-OS 3.x users they need a third-party or Adobe Commerce extension for customer returns.",
"Mage-OS is compatible with existing Magento 2 extensions and themes."
]
}
2 changes: 1 addition & 1 deletion css-preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ preprocessors in these environments, additional setup steps are required.

Example of overriding a LESS file in a Magento 2 custom theme:

```
```plaintext
app/design/frontend/MyVendor/my-theme/web/css/source/_extend.less
```

Expand Down
2 changes: 1 addition & 1 deletion developing-extensions-in-magento-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To get started with extension development, you will need the following:
A Magento 2 extension follows a specific directory structure that Magento recognizes. Below is an example structure for
a basic extension called "MyExtension":

```
```plaintext
MyExtension/
├── etc/
│ ├── module.xml
Expand Down
8 changes: 4 additions & 4 deletions diagrams-to-visually-represent-the-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ represent the architecture of a PHP and Magento 2 application.

**High-Level System Diagram:**

```
```plaintext
+------------------+ +-----------------+ +-----------------+
| Frontend | | Backend | | Database |
| |<------>| |<------>| |
Expand All @@ -97,7 +97,7 @@ represent the architecture of a PHP and Magento 2 application.

**Layered Architecture Diagram:**

```
```plaintext
+------------------+
| Presentation |
| Layer |
Expand All @@ -115,7 +115,7 @@ represent the architecture of a PHP and Magento 2 application.

**Component Diagram:**

```
```plaintext
+-----------------+
| Frontend |
| Component |
Expand All @@ -130,7 +130,7 @@ represent the architecture of a PHP and Magento 2 application.

**Sequence Diagram:**

```
```plaintext
Frontend -> Backend: Request Product Details
Backend -> Database: Retrieve Product Data
Database --> Backend: Return Product Data
Expand Down
2 changes: 1 addition & 1 deletion glossary-of-terms.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ to extend or modify the behavior of the platform.

Example:

```
```plaintext
app/code/Vendor/Module
```

Expand Down
4 changes: 2 additions & 2 deletions graphql-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PHP and Magento 2. You'll also need to have a valid authentication token to acce
To authenticate and obtain an access token, you can use the Magento 2 token-based authentication system. Once you have
the token, you can include it in the headers of your GraphQL requests as follows:

```
```http
Authorization: Bearer <access_token>
```

Expand Down Expand Up @@ -170,7 +170,7 @@ Playground.

To retrieve the GraphQL schema, you can send a request to the following endpoint:

```
```plaintext
https://yourmagentoinstallation.com/graphql/schema?query={__schema{types{name}}}
```

Expand Down
8 changes: 4 additions & 4 deletions how-to-use-and-extend-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ JSON (JavaScript Object Notation) and XML (eXtensible Markup Language).
By default, Magento 2 APIs return JSON responses. However, you can specify the desired response format by setting
the `Accept` header in your requests. For example, to request XML responses, you can include the following header:

```
```http
Accept: application/xml
```

Expand All @@ -65,7 +65,7 @@ Accept: application/xml
Magento 2 provides a wide range of pre-defined API endpoints for different resources. These endpoints follow a
consistent pattern:

```
```plaintext
https://example.com/rest/V1/{resource}/{id}
```

Expand All @@ -77,7 +77,7 @@ Where:

Here are some examples of API endpoints:

```
```http
GET https://example.com/rest/V1/products
GET https://example.com/rest/V1/products/10
POST https://example.com/rest/V1/products
Expand Down Expand Up @@ -141,7 +141,7 @@ class CustomProducts implements HttpGetActionInterface

Now, you can access your custom API endpoint using the following URL:

```
```http
GET https://example.com/rest/V1/custom-products
```

Expand Down
6 changes: 3 additions & 3 deletions magento-2-coding-standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ that is easy to read, understand, and maintain.
A well-organized file structure is crucial for a Magento 2 project. Following a consistent structure helps in easily
locating and managing files. The recommended file structure for a Magento 2 project is as follows:

```
```plaintext
app/
code/
<Vendor>/
Expand Down Expand Up @@ -87,7 +87,7 @@ tools analyze the code against configured rules and highlight any violations.

For example, to check coding standards using PHP_CodeSniffer, run the following command:

```
```bash
vendor/bin/phpcs --standard=PSR12 app/code/Vendor/Module/
```

Expand All @@ -99,7 +99,7 @@ Magento 2 has its own set of coding standards specific to module development. Le

A well-structured module enhances code organization. A typical module follows this structure:

```
```plaintext
app/
code/
<Vendor>/
Expand Down
4 changes: 2 additions & 2 deletions module-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concepts.

A Magento 2 module is organized in the following directory structure:

```
```plaintext
app
└── code
└── Vendor
Expand Down Expand Up @@ -273,7 +273,7 @@ In this example, we're creating a table named `custom_table` with three columns:

3. Run the whitelist generation command:

```
```bash
bin/magento setup:db-declaration:generate-whitelist --module-name=Vendor_Module
```

Expand Down
2 changes: 1 addition & 1 deletion theme-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You can specify a preview image for your theme using the following XML configura

Ensure that the specified image file exists in your theme directory. If it doesn't, running `bin/magento setup:upgrade` will produce an error:

```
```plaintext
File "app/design/frontend/Acme/MyTheme/media/preview.jpg" does not exist.
```

Expand Down
4 changes: 2 additions & 2 deletions troubleshooting-common-installation-issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This ensures the necessary read, write, and execute permissions are set correctl
Magento 2 relies on various PHP extensions to function properly. If you encounter an error indicating a missing
extension, you need to install it. Here's an example:

```
```plaintext
PHP Extension xsl is not loaded.
```

Expand All @@ -83,7 +83,7 @@ file (`php.ini`).

Locate the `memory_limit` directive and adjust its value to a higher limit. For example:

```
```ini
memory_limit = 512M
```

Expand Down
2 changes: 1 addition & 1 deletion web-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ curl -X POST \
Magento's Web API provides a wide range of endpoints to interact with various resources such as customers, products,
orders, and more. Each endpoint follows a consistent URL structure:

```
```plaintext
https://your-magento-installation.com/rest/<version>/<resource>
```

Expand Down
Loading