Skip to content

Commit

Permalink
Clean up front-end add-on volto-demo README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepiercy committed Apr 24, 2024
1 parent f64d2cc commit 6c42f1f
Showing 1 changed file with 29 additions and 45 deletions.
74 changes: 29 additions & 45 deletions frontend-volto/src/addons/volto-demo/README.md
Original file line number Diff line number Diff line change
@@ -1,149 +1,133 @@
# volto-demo

## Introduction

## Development

You can develop an add-on in isolation using the boilerplate already provided by the add-on generator.
The project is configured to have the current add-on installed and ready to work with.
This is useful to bootstrap an isolated environment that can be used to quickly develop the add-on or for demo purposes.
It's also useful when testing an add-on in a CI environment.

```{note}
It's quite similar when you develop a Plone backend add-on in the Python side, and embed a ready to use Plone build (using buildout or pip) in order to develop and test the package.
```
Note: It's quite similar when you develop a Plone backend add-on in the Python side, and embed a ready-to-use Plone build (using buildout or pip), to develop and test the package.

## Development

The dockerized approach performs all these actions in a custom built docker environment:
The Dockerized approach performs all these actions in a custom built Docker environment:

1. Generates a vanilla project using the official Volto Yo Generator (@plone/generator-volto)
2. Configures it to use the add-on with the name stated in the `package.json`
1. Generates a vanilla project using the official Volto Yeoman generator (@plone/generator-volto)
2. Configures the project to use the add-on with the name stated in the `package.json`
3. Links the root of the add-on inside the created project

After that you can use the inner dockerized project, and run any standard Volto command for linting, acceptance test or unit tests using Makefile commands provided for your convenience.
After that, you can use the inner Dockerized project, and run any standard Volto command for linting, acceptance tests, or unit tests using Makefile commands, provided for your convenience.

### Setup the environment
## Set up the environment

Run once
Run the following command only once.

```shell
make dev
```

which will build and launch the backend and frontend containers.
There's no need to build them again after doing it the first time unless something has changed from the container setup.
This command builds and launches the backend and frontend containers.
There's no need to build them again after doing it the first time, unless something has changed from the container setup.

In order to make the local IDE play well with this setup, is it required to run once `yarn` to install locally the required packages (ESlint, Prettier, Stylelint).

Run
To make your local IDE play well with this setup, you must run `yarn` once to install the required packages.

```shell
yarn
```

### Build the containers manually
## Build the containers manually

Run
Run the following commands to build the containers.

```shell
make build-backend
make build-addon
```

### Run the containers
## Run the containers

Run
Run the following command to start both the frontend and backend containers.

```shell
make start-dev
```

This will start both the frontend and backend containers.

### Stop Backend (Docker)

After developing, in order to stop the running backend, don't forget to run:
## Stop backend (Docker)

Run
After developing, to stop the running backend, run the following command.

```shell
make stop-backend
```

### Linting

Run
Run the following command to lint your code.

```shell
make lint
```

### Formatting

Run
Run the following command to format your code.

```shell
make format
```

### i18n

Run
Run the following command to update internationalized language strings.

```shell
make i18n
```

### Unit tests

Run
Run the following command to run unit tests.

```shell
make test
```

### Acceptance tests

Run once
Run the following command only once to install the acceptance test environment.

```shell
make install-acceptance
```

For starting the servers

Run
To start the servers, run the following command.

```shell
make start-test-acceptance-server
```

The frontend is run in dev mode, so development while writing tests is possible.
The frontend runs in development mode, so you can develop while writing tests.

Run
Then run the following command to run Cypress tests.

```shell
make test-acceptance
```

To run Cypress tests afterwards.

When finished, don't forget to shutdown the backend server.
When finished, shutdown the backend server with the following command.

```shell
make stop-test-acceptance-server
```

### Release

Run
To make a release, run the following command.

```shell
make release
```

For releasing a RC version

Run
To release a release candidate version, run the following command.

```shell
make release-rc
Expand Down

0 comments on commit 6c42f1f

Please sign in to comment.