Skip to content

Latest commit

 

History

History
113 lines (76 loc) · 3.96 KB

File metadata and controls

113 lines (76 loc) · 3.96 KB
myst
html_meta
description property=og:description property=og:title keywords
How to create a package with only a frontend add-on using Cookieplone
How to create a package with only a frontend add-on using Cookieplone
How to create a package with only a frontend add-on using Cookieplone
Plone, Plone 6, Seven, create, project, install, Cookieplone

(create-package-label)=

Create a package: frontend add-on only

This chapter describes how you can create a package with only a frontend add-on using {term}Cookieplone. Cookieplone is the recommended way to create a package as an add-on for Plone that uses the Seven frontend. It also includes tools for development and deployment.

(seven-create-project-cookieplone-generate-the-package-label)=

Generate the add-on package

After satisfying the {doc}system-requirements and having {ref}activated an LTS version of Node.js <seven-prerequisites-nodejs-label>, generate the add-on package.

uvx cookieplone seven_addon --no-input

Install the add-on package

Cookieplone creates a folder with the name of the add-on, in this example, {file}seven-add-on.

Change your current working directory to {file}seven-add-on.

cd seven-add-on

To install the add-on, use the following command.

make install

This command is the development-mode alias for make install-dev. When you want to validate the generated deployment app, use make install-deploy. Use make clean-deploy to remove the generated deployment app and force a fresh deploy-mode install.

This will take a few minutes. ☕️ When the process completes successfully, it will exit with no message.

Start Plone

Plone has two servers: one for the frontend, and one for the backend. As such, we need to maintain two active shell sessions, one for each server, to start your Plone site.

Start Plone backend

In the currently open session, issue the following command.

make backend-docker-start

The Plone backend server starts up and emits messages to the console.

2024-09-25 16:47:15,699 INFO    [chameleon.config:39][MainThread] directory cache: /<path-to-project>/backend/instance/var/cache.
2024-09-25 16:47:16,387 WARNING [ZODB.FileStorage:412][MainThread] Ignoring index for /<path-to-project>/backend/instance/var/filestorage/Data.fs
2024-09-25 16:47:16,508 INFO    [plone.restapi.patches:16][MainThread] PATCH: Disabled ZPublisher.HTTPRequest.ZopeFieldStorage.VALUE_LIMIT. This enables file uploads larger than 1MB.
2024-09-25 16:47:17,018 INFO    [plone.volto:23][MainThread] Aliasing collective.folderish classes to plone.volto classes.
2024-09-25 16:47:17,760 INFO    [Zope:42][MainThread] Ready to handle requests
Starting server in PID 20912.
2024-09-25 16:47:17,772 INFO    [waitress:486][MainThread] Serving on http://[::1]:8080
2024-09-25 16:47:17,772 INFO    [waitress:486][MainThread] Serving on http://127.0.0.1:8080

This will start a clean Plone server for development purposes so you can start developing your add-on.

Start Plone frontend

Create a second shell session in a new window. Change your current working directory to {file}seven-add-on. Start the Plone frontend with the following command.

make start

This command is the development-mode alias for make start-dev. To start the generated deployment app instead, use make start-deploy. To smoke test the deployment app in production mode, use make start-prod-deploy.

The Plone frontend server starts up and emits messages to the console, and should end with the following.

  ➜  Local:   http://localhost:3000/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help

Open a browser at the following URL to visit your Plone site.

http://localhost:3000

Your newly created add-on will be installed with vanilla Seven. You can start developing it in the add-on package located in {file}packages/seven-add-on.

You can stop the site with {kbd}ctrl-c.