diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/.mrbob.ini b/backend_addon/{{ cookiecutter.__folder_name }}/.mrbob.ini new file mode 100644 index 0000000..3093bcf --- /dev/null +++ b/backend_addon/{{ cookiecutter.__folder_name }}/.mrbob.ini @@ -0,0 +1,4 @@ +[variables] +package.dottedname = {{ cookiecutter.python_package_name }} +package.browserlayer = IBrowserLayer + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/Makefile b/backend_addon/{{ cookiecutter.__folder_name }}/Makefile index e309401..2ddecb1 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/Makefile +++ b/backend_addon/{{ cookiecutter.__folder_name }}/Makefile @@ -62,7 +62,7 @@ config: instance/etc/zope.ini build-dev: config ## Install Plone packages @echo "$(GREEN)==> Setup Build$(RESET)" $(BIN_FOLDER)/pipx run mxdev -c mx.ini - $(BIN_FOLDER)/uv pip install -r requirements-mxdev.txt + VIRTUAL_ENV=.venv $(BIN_FOLDER)/uv pip install -r requirements-mxdev.txt .PHONY: install install: build-dev ## Install Plone @@ -100,7 +100,7 @@ check: $(BIN_FOLDER)/tox ## Check and fix code base according to Plone standards # i18n $(BIN_FOLDER)/i18ndude: $(BIN_FOLDER)/pip @echo "$(GREEN)==> Install translation tools$(RESET)" - $(BIN_FOLDER)/uv pip install i18ndude + VIRTUAL_ENV=.venv $(BIN_FOLDER)/uv pip install i18ndude .PHONY: i18n i18n: $(BIN_FOLDER)/i18ndude ## Update locales @@ -115,3 +115,7 @@ test: $(BIN_FOLDER)/tox ## run tests .PHONY: test-coverage test-coverage: $(BIN_FOLDER)/tox ## run tests with coverage $(BIN_FOLDER)/tox -e coverage + +## Add bobtemplates features (check bobtemplates.plone's documentation to get the list of available features) +add: $(BIN_FOLDER)/pipx + $(BIN_FOLDER)/pipx run plonecli add -b .mrbob.ini $(filter-out $@,$(MAKECMDGOALS)) diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/README.md b/backend_addon/{{ cookiecutter.__folder_name }}/README.md index 2ef9304..5cb27e9 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/README.md +++ b/backend_addon/{{ cookiecutter.__folder_name }}/README.md @@ -13,12 +13,41 @@ Install {{ cookiecutter.python_package_name }} with `pip`: ```shell pip install {{ cookiecutter.python_package_name }} ``` + And to create the Plone site: ```shell make create_site ``` +## Add features using `plonecli` or `bobtemplates.plone` + +This package provides markers as strings (``) that are compatible with [`plonecli`](https://github.com/plone/plonecli) and [`bobtemplates.plone`](https://github.com/plone/bobtemplates.plone). +These markers act as hooks to add all kinds of subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from `plonecli`. + +To run `plonecli` with configuration to target this package, run the following command. + +```shell +make add +``` + +For example, you can add a content type to your package with the following command. + +```shell +make add content_type +``` + +You can add a behavior with the following command. + +```shell +make add behavior +``` + +```{seealso} +You can check the list of available subtemplates in the [`bobtemplates.plone` `README.md` file](https://github.com/plone/bobtemplates.plone/?tab=readme-ov-file#provided-subtemplates). +See also the documentation of [Mockup and Patternslib](https://6.docs.plone.org/classic-ui/mockup.html) for how to build the UI toolkit for Classic UI. +``` + ## Contribute - [Issue Tracker](https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.python_package_name }}/issues) diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/bobtemplate.cfg b/backend_addon/{{ cookiecutter.__folder_name }}/bobtemplate.cfg new file mode 100644 index 0000000..39fc98c --- /dev/null +++ b/backend_addon/{{ cookiecutter.__folder_name }}/bobtemplate.cfg @@ -0,0 +1,5 @@ +[main] +version = 6.0.13 +template = plone_addon +git_init = True +python = python3 diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/configure.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/configure.zcml index 4db272e..a7940c2 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/configure.zcml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/configure.zcml @@ -11,8 +11,10 @@ file="permissions.zcml" /> + + @@ -21,4 +23,6 @@ {%- endif %} + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/controlpanel/configure.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/controlpanel/configure.zcml index 09a3d2c..21ec3ad 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/controlpanel/configure.zcml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/controlpanel/configure.zcml @@ -5,4 +5,6 @@ i18n_domain="{{ cookiecutter.python_package_name }}" > + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/indexers/configure.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/indexers/configure.zcml index bad8247..ee4ad7c 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/indexers/configure.zcml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/indexers/configure.zcml @@ -2,4 +2,6 @@ + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/permissions.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/permissions.zcml new file mode 100644 index 0000000..faf31d6 --- /dev/null +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/permissions.zcml @@ -0,0 +1,9 @@ + + + + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/controlpanel.xml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/controlpanel.xml index a75d00c..bd728d8 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/controlpanel.xml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/controlpanel.xml @@ -1,4 +1,6 @@ + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/registry/.gitkeep b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/registry/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/registry/main.xml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/registry/main.xml new file mode 100644 index 0000000..fceed9a --- /dev/null +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/registry/main.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/rolemap.xml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/rolemap.xml index 71ca583..a803517 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/rolemap.xml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/profiles/default/rolemap.xml @@ -1,6 +1,6 @@ - + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/upgrades/configure.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/upgrades/configure.zcml index 0a61e0d..a4ee3e4 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/upgrades/configure.zcml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/upgrades/configure.zcml @@ -16,4 +16,6 @@ --> + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/vocabularies/configure.zcml b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/vocabularies/configure.zcml index fb8b793..76db978 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/vocabularies/configure.zcml +++ b/backend_addon/{{ cookiecutter.__folder_name }}/src/packagename/vocabularies/configure.zcml @@ -1,3 +1,5 @@ + + diff --git a/backend_addon/{{ cookiecutter.__folder_name }}/tox.ini b/backend_addon/{{ cookiecutter.__folder_name }}/tox.ini index a01d380..1183577 100644 --- a/backend_addon/{{ cookiecutter.__folder_name }}/tox.ini +++ b/backend_addon/{{ cookiecutter.__folder_name }}/tox.ini @@ -147,7 +147,7 @@ deps = pytest-plone pytest coverage - -c https://dist.plone.org/release/6.0-dev/constraints.txt + -c https://dist.plone.org/release/{{ cookiecutter.plone_version }}/constraints.txt commands = coverage run --source {{ cookiecutter.python_package_name }} -m pytest {posargs} --disable-warnings {toxinidir}/tests @@ -164,7 +164,7 @@ deps = twine build towncrier - -c https://dist.plone.org/release/6.0-dev/constraints.txt + -c https://dist.plone.org/release/{{ cookiecutter.plone_version }}/constraints.txt commands = # fake version to not have to install the package @@ -192,7 +192,7 @@ allowlist_externals = deps = pipdeptree pipforester - -c https://dist.plone.org/release/6.0-dev/constraints.txt + -c https://dist.plone.org/release/{{ cookiecutter.plone_version }}/constraints.txt commands = # Generate the full dependency tree diff --git a/frontend_addon/cookiecutter.json b/frontend_addon/cookiecutter.json index d8b30c4..2975ebd 100644 --- a/frontend_addon/cookiecutter.json +++ b/frontend_addon/cookiecutter.json @@ -1,6 +1,6 @@ { "title": "Volto Add-on", - "frontend_addon_name": "volto-addon", + "frontend_addon_name": "{{ cookiecutter.title | slugify }}", "description": "A new add-on for Volto", "author": "Plone Community", "email": "collective@plone.org", diff --git a/project/{{ cookiecutter.__folder_name }}/devops/README-GHA.md b/project/{{ cookiecutter.__folder_name }}/devops/README-GHA.md index 64e3146..06086ae 100644 --- a/project/{{ cookiecutter.__folder_name }}/devops/README-GHA.md +++ b/project/{{ cookiecutter.__folder_name }}/devops/README-GHA.md @@ -28,7 +28,7 @@ After setting up the environment, it's time to add secrets. These are sensitive | DEPLOY_PORT | 22 | The SSHD Port. | | DEPLOY_USER | plone | The user to connect to the deploy host, with permissions to run Docker commands. | | DEPLOY_SSH | Contents of `devops/etc/keys/plone_prod_deploy_ed25519` | The private SSH key used for connection. The corresponding public key should be in the `~/.ssh/authorized_keys` file of the deployment user. | -| ENV_FILE | Contents of `devops/.env_file_gha` | The file containing environment variables used by the stack file. | +| ENV_FILE | Contents of `devops/.env_gha` | The file containing environment variables used by the stack file. | ### Step 3: Add Repository Variables 📚 diff --git a/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile b/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile index 0732146..05cda60 100644 --- a/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile +++ b/sub/project_settings/{{ cookiecutter.__folder_name }}/backend/Makefile @@ -142,3 +142,8 @@ acceptance-backend-start: ## Start backend acceptance server .PHONY: acceptance-image-build acceptance-image-build: ## Build Docker Images @DOCKER_BUILDKIT=1 docker build . -t $(IMAGE_NAME_PREFIX)-backend-acceptance:$(IMAGE_TAG) -f Dockerfile.acceptance --build-arg PLONE_VERSION=$(PLONE_VERSION) + +## Add bobtemplates features (check bobtemplates.plone's documentation to get the list of available features) +add: $(BIN_FOLDER)/pipx + $(BIN_FOLDER)/pipx run plonecli add -b .mrbob.ini $(filter-out $@,$(MAKECMDGOALS)) +