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
57 changes: 3 additions & 54 deletions docs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,63 +34,16 @@ const linkWhitelist: string[] = [...redirects.map(r => r.source), "/forms/produc
*/
const whitelistedVersions: string[] = [];

/**
* Only build versions at or above this version (e.g., "5.40.x").
* Set via MIN_VERSION environment variable or modify here.
* Set to empty string to build all versions.
*/
const minVersionToBuild = process.env.MIN_VERSION || "";

const filterByEnvironment = (version: Version) => {
// In `preview`, if there are specific versions whitelisted for deployment, those are the only ones we'll output.
if (preview && whitelistedVersions.length > 0) {
return whitelistedVersions.includes(version.getValue());
}

// If minVersionToBuild is set, only build versions >= minVersion or `latest`.
if (minVersionToBuild) {
if (minVersionToBuild === "latest") {
return version.isLatest();
}
const versionNum = parseFloat(version.getValue().replace(/[^\d.]/g, ""));
const minVersionNum = parseFloat(minVersionToBuild.replace(/[^\d.]/g, ""));
return versionNum >= minVersionNum;
}

// Build everything.
return true;
};

const filterFilePathByVersion = (filePath: string): boolean => {
// Extract version from file path (e.g., /docs/developer-docs/5.40.x/... or /docs/user-guides/5.40.x/...)
const versionMatch = filePath.match(/\/(\d+\.\d+\.x)\//);

if (!versionMatch) {
// If no version in path, include the file (e.g., non-versioned docs)
return true;
}

const versionString = versionMatch[1];

// Use the same filtering logic as filterByEnvironment
if (preview && whitelistedVersions.length > 0) {
return whitelistedVersions.includes(versionString);
}

if (minVersionToBuild) {
if (minVersionToBuild === "latest") {
// For file paths, we can't determine if it's "latest" without more context
// So we'll include all versioned files when minVersionToBuild is "latest"
return true;
}
const versionNum = parseFloat(versionString.replace(/[^\d.]/g, ""));
const minVersionNum = parseFloat(minVersionToBuild.replace(/[^\d.]/g, ""));
return versionNum >= minVersionNum;
}

return true;
};

const existsInDocs = (link: string) => {
return fs.pathExists(path.join(__dirname, `src/pages/${link}.js`));
};
Expand All @@ -99,13 +52,9 @@ export default {
projectRootDir: __dirname,
cleanOutputDir: path.resolve("src/pages/docs"),
sitemapOutputPath: path.resolve("public/algolia/sitemap.xml"),
linkValidator: new LinkValidator(
linkWhitelist,
link => {
return existsInDocs(link);
},
filterFilePathByVersion
),
linkValidator: new LinkValidator(linkWhitelist, link => {
return existsInDocs(link);
}),
documentRoots: [
/* Developer Docs */
new VersionedDocumentRootConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ import { createWatchApp, createBuildApp } from "@webiny/project-utils";

// Exports fundamental watch and build commands.
// Need to inject environment variables or link your application with an existing GraphQL API?
// See https://www.webiny.com/docs/{version}/core-development-concepts/scaffolding/full-stack-application/webiny-config.
// See https://www.webiny.com/docs/core-development-concepts/scaffolding/full-stack-application/webiny-config.
export default {
commands: {
async watch(options, context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import Cloudfront from "./cloudfront";
const DEBUG = String(process.env.DEBUG);

// Enables logs forwarding.
// https://www.webiny.com/docs/{version}/core-development-concepts/basics/watch-command#enabling-logs-forwarding
// https://www.webiny.com/docs/core-development-concepts/basics/watch-command#enabling-logs-forwarding
const WEBINY_LOGS_FORWARD_URL = String(process.env.WEBINY_LOGS_FORWARD_URL);

export default () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ import Cognito from "./cognito";
import S3 from "./s3";

// Among other things, this determines the amount of information we reveal on runtime errors.
// https://www.webiny.com/docs/{version}/core-development-concepts/environment-variables/#debug-environment-variable
// https://www.webiny.com/docs/core-development-concepts/environment-variables/#debug-environment-variable
const DEBUG = String(process.env.DEBUG);

// Enables logs forwarding.
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-docs/5.28.x/get-started/install-webiny.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Before proceeding, make sure you have the following:
- Webiny works with both yarn versions [1 (classic)](https://yarnpkg.com/en/docs/install) and [>=2 (berry)](https://yarnpkg.com/)
- for version 1 - **1.22.0** or later is required
3. **AWS account and user credentials**
- in order to deploy Webiny, you must have a valid [AWS account and user credentials](/docs/{version}/infrastructure/aws/configure-aws-credentials) set up on your system
- in order to deploy Webiny, you must have a valid [AWS account and user credentials](/docs/infrastructure/aws/configure-aws-credentials) set up on your system

## Project Setup

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ In certain cases, this might be reasonable. For example, you can reduce developm

<Alert type="info">

Depending on the environment, the **API** project application is deployed as two different sets of cloud infrastructure resources - development and production. Visit the [API Overview - Default VPC](/docs/{version}/architecture/deployment-modes/development) key topic to learn more.
Depending on the environment, the **API** project application is deployed as two different sets of cloud infrastructure resources - development and production. Visit the [API Overview - Default VPC](/docs/architecture/deployment-modes/development) key topic to learn more.

</Alert>
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Currently, Webiny is not using the [Automation API](https://www.pulumi.com/blog/
Switching to a different infrastructure-as-code (IaC) solution would require a significant amount of work as it would involve rewriting almost all of the Webiny IaC code from scratch for a different IaC solution. **Therefore, we do not recommend it.**

However, if you want to experiment with it, you would need to create a custom CLI plugin similar to the [Webiny CLI plugin for Pulumi](https://github.com/webiny/webiny-js/tree/next/packages/cli-plugin-deploy-pulumi). This plugin is responsible for creating the deploy, destroy, watch, and other commands.
To use your custom plugin, you would then need to import it into the `webiny.project.ts` file and remove the Pulumi plugin. The most challenging part would be transforming all of the Pulumi code into respective IaC code (i.e. transforming all Pulumi code to [CloudFormation](https://aws.amazon.com/cloudformation/), [Terraform](https://www.terraform.io/), or other IaC). You can refer to the Pulumi code to see the resources Webiny deploys and the [Cloud Infrastructure documentation](https://www.webiny.com/docs/{version}/architecture/introduction) for more information.
To use your custom plugin, you would then need to import it into the `webiny.project.ts` file and remove the Pulumi plugin. The most challenging part would be transforming all of the Pulumi code into respective IaC code (i.e. transforming all Pulumi code to [CloudFormation](https://aws.amazon.com/cloudformation/), [Terraform](https://www.terraform.io/), or other IaC). You can refer to the Pulumi code to see the resources Webiny deploys and the [Cloud Infrastructure documentation](https://www.webiny.com/docs/architecture/introduction) for more information.

**Please keep in mind that this process will require a significant amount of effort, and it's recommended to stick with Pulumi unless your organization has strict policies that require using a different IaC solution.**

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Note that, when we say GraphQL HTTP API, by default, we're referring to the one

<Alert type="info">

Learn more about the **API** project application on the cloud infrastructure level in the [Cloud Infrastructure](/docs/{version}/architecture/introduction) key topics section.
Learn more about the **API** project application on the cloud infrastructure level in the [Cloud Infrastructure](/docs/architecture/introduction) key topics section.

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ You are free to create new tests in the similar fashion, or amend the existing o

Please note that, by default, the authentication and authorization logic isn't included in the generated code. In other words, all of the generated GraphQL query and mutation operations can be performed by anonymous (not logged-in) users, which is in most cases not the desired behavior.

Luckily, with a couple of built-in utilities, this can be relatively easily added. Please check out the [existing tutorials](/docs/{version}/admin-area/new-app-tutorial/security) to learn how to implement these on your own.
Luckily, with a couple of built-in utilities, this can be relatively easily added. Please check out the [existing tutorials](/docs/admin-area/new-app-tutorial/security) to learn how to implement these on your own.

### I need more flexibility when it comes to data querying. Can I bring in a different database, for example ElasticSearch?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default createCoreApp({

### Defining Multiple Production Environments

Upon running the [`webiny deploy`](/docs/{version}/core-development-concepts/basics/project-deployment) command, when `prod` is passed as the environment name, a Webiny project is deployed in the so-called [production deployment mode](https://www.webiny.com/docs/{version}/architecture/deployment-modes/production).
Upon running the [`webiny deploy`](/docs/{version}/core-development-concepts/basics/project-deployment) command, when `prod` is passed as the environment name, a Webiny project is deployed in the so-called [production deployment mode](https://www.webiny.com/docs/architecture/deployment-modes/production).

On order to use the production deployment mode for environments other than `prod`, we can use the `productionEnvironments` parameter. The following example shows how we can use the production mode for the `staging` environment:

Expand Down
2 changes: 1 addition & 1 deletion docs/developer-docs/5.30.x/wcp/link-a-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ And all it's left to do is to select a project from the list. **Note**: if you h

![WCP - Link project inside personal development environment - Step 4](./assets/link-a-project/link-personal-step4.png)

Once you select your project, you are pretty much done, all you need to do, is to [deploy it](/docs/{version}/core-development-concepts/basics/project-deployment).
Once you select your project, you are pretty much done, all you need to do, is to [deploy it](/docs/core-development-concepts/basics/project-deployment).

<Alert type="info" title="Project already defined">

Expand Down
4 changes: 2 additions & 2 deletions docs/developer-docs/5.30.x/wcp/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ A WCP user with an access to a specific WCP project can retrieve the license for

<Alert type="info" title="Learn more">

To learn how to retrieve a license inside your own personal development environment, [check this guide](/docs/{version}/wcp/link-a-project#personal-development-environment).
To learn how to retrieve a license inside your own personal development environment, [check this guide](/docs/wcp/link-a-project#personal-development-environment).

</Alert>

Expand All @@ -86,7 +86,7 @@ Every WCP project you create will have a CI/CD environment called `production` b

<Alert type="info" title="Learn more">

To learn how to retrieve a license inside CI/CD environment, [check this guide](/docs/{version}/wcp/link-a-project#ci-cd-environment).
To learn how to retrieve a license inside CI/CD environment, [check this guide](/docs/wcp/link-a-project#ci-cd-environment).

</Alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In the following sections, we cover a couple of examples that show how to define

Note that we **NEVER** set the `storageId` property value as it is created automatically out of the field `id` and `type` property values.

To find out more about the `storageId` property, and understand why it exists, please read [this](/docs/{version}/headless-cms/extending/content-models-via-code-storage-id) article.
To find out more about the `storageId` property, and understand why it exists, please read [this](/docs/headless-cms/extending/content-models-via-code-storage-id) article.

</Alert>

Expand Down Expand Up @@ -151,7 +151,7 @@ Once plugins are registered successfully, we should be able to see the following

<Alert type="success">

With the [`webiny watch`](/docs/{version}/core-development-concepts/basics/watch-command) command up and running, the performed application code changes should be automatically rebuilt and redeployed into the cloud.
With the [`webiny watch`](/docs/core-development-concepts/basics/watch-command) command up and running, the performed application code changes should be automatically rebuilt and redeployed into the cloud.

</Alert>

Expand Down Expand Up @@ -263,7 +263,7 @@ export default [
]
```

With the [`webiny watch`](/docs/{version}/core-development-concepts/basics/watch-command) command up and running,
With the [`webiny watch`](/docs/core-development-concepts/basics/watch-command) command up and running,
the performed application code changes should be automatically rebuilt and redeployed into the cloud.
And you should be able to see the following Product model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To do local development in Webiny, the API or any infrastructure changes must be
In summary, changes made to API and infrastructure must be deployed to the cloud during local development. However, for changes made to only UI, deploying to the cloud is not necessary. Once the UI changes are finalised, these changes can be pushed to the cloud.

If you're wondering how to push changes to the cloud during development, don't worry. As previously mentioned, we have developed various CLI tools, such as the `watch` command, to make deploying changes to the cloud during development easy. The `watch` command allows you to continuously rebuild and redeploy your code, making the development process seamless.
For detailed information, please refer to the [`watch command`](/docs/{version}/core-development-concepts/basics/watch-command) documentation.
For detailed information, please refer to the [`watch command`](/docs/core-development-concepts/basics/watch-command) documentation.

Now let's learn more about local development with the frequently asked questions related to Webiny development.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Alert } from "@/components/Alert";

## Introduction

In the `5.34.0` version we added a possibility for users to modify our `Fastify` handler instance, via the `ModifyFastifyPlugin`. To find our more on how and why we use `Fastify`, please read this [article](/docs/{version}/core-development-concepts/basics/routes-and-events).
In the `5.34.0` version we added a possibility for users to modify our `Fastify` handler instance, via the `ModifyFastifyPlugin`. To find our more on how and why we use `Fastify`, please read this [article](/docs/core-development-concepts/basics/routes-and-events).

With the given plugin user can change and add anything to the `Fastify` instance, including the error handler.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ Note that, if the Webiny project is being deployed into the production environme

<Alert type={"info"}>

Production deployment means deploying your Webiny project into `prod` environment, via the [`webiny deploy`](https://www.webiny.com/docs/{version}/core-development-concepts/basics/project-deployment) command: `yarn webiny deploy --env prod`.
Production deployment means deploying your Webiny project into `prod` environment, via the [`webiny deploy`](https://www.webiny.com/docs/core-development-concepts/basics/project-deployment) command: `yarn webiny deploy --env prod`.

More on the development and production modes can be found here:
[https://www.webiny.com/docs/{version}/architecture/deployment-modes/introduction](https://www.webiny.com/docs/{version}/architecture/deployment-modes/introduction)
[https://www.webiny.com/docs/architecture/deployment-modes/introduction](https://www.webiny.com/docs/architecture/deployment-modes/introduction)

</Alert>

Expand Down Expand Up @@ -196,7 +196,7 @@ Note that for a Webiny project to work as expected, an Amazon VPC must have an [

1. **Amazon Cognito** - Webiny's application code interacts with Amazon Cognito via AWS SDK. May not be needed if the organization doesn't plan to rely on Amazon Cognito as their identity provider.
2. **Amazon CloudFront** - Webiny's application code interacts with Amazon CloudFront via AWS SDK
3. **Webiny Control Panel (WCP)** - [Webiny Control Panel (WCP)](/docs/{version}/wcpoverview)-linked Webiny projects also frequently interact with app's public HTTP API (`api.webiny.com`)
3. **Webiny Control Panel (WCP)** - [Webiny Control Panel (WCP)](/docs/wcp/overview)-linked Webiny projects also frequently interact with app's public HTTP API (`api.webiny.com`)
4. **Webiny's Prerendering Service** - for website performance reasons, whenever a user publishes a page created with Webiny’s Page Builder application, behind the scenes, an AWS Lambda function is triggered, which issues HTTP requests to published page’s URL (a public CloudFront URL). May not be needed if the organization doesn't plan to use the Page Builder application.

### VPC Endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ query {

## Conditional Filtering

The article [`Using the GraphQL API Advanced Filtering`](/docs/{version}/headless-cms/basics/using-graphql-api-advanced-filtering) will cover the conditional (advanced) filtering, where we will show you how to use the `AND` and `OR` conditionals.
The article [`Using the GraphQL API Advanced Filtering`](/docs/headless-cms/basics/using-graphql-api-advanced-filtering) will cover the conditional (advanced) filtering, where we will show you how to use the `AND` and `OR` conditionals.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Alert } from "@/components/Alert";

## Introduction

In the `5.34.0` version we added a possibility for users to modify our `Fastify` handler instance, via the `ModifyFastifyPlugin`. To find our more on how and why we use `Fastify`, please read this [article](/docs/{version}/core-development-concepts/basics/routes-and-events).
In the `5.34.0` version we added a possibility for users to modify our `Fastify` handler instance, via the `ModifyFastifyPlugin`. To find our more on how and why we use `Fastify`, please read this [article](/docs/core-development-concepts/basics/routes-and-events).

With the given plugin user can change and add anything to the `Fastify` instance, including the error handler.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ query {

## Conditional Filtering

The article [`Using the GraphQL API Advanced Filtering`](/docs/{version}/headless-cms/basics/using-graphql-api-advanced-filtering) will cover the conditional (advanced) filtering, where we will show you how to use the `AND` and `OR` conditionals.
The article [`Using the GraphQL API Advanced Filtering`](/docs/headless-cms/basics/using-graphql-api-advanced-filtering) will cover the conditional (advanced) filtering, where we will show you how to use the `AND` and `OR` conditionals.
Loading