Skip to content

Commit

Permalink
Merge branch 'main' into erral-donotremovesrc
Browse files Browse the repository at this point in the history
  • Loading branch information
erral authored Nov 30, 2024
2 parents d368989 + f513c96 commit ee8733d
Show file tree
Hide file tree
Showing 18 changed files with 86 additions and 8 deletions.
4 changes: 4 additions & 0 deletions backend_addon/{{ cookiecutter.__folder_name }}/.mrbob.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[variables]
package.dottedname = {{ cookiecutter.python_package_name }}
package.browserlayer = IBrowserLayer

8 changes: 6 additions & 2 deletions backend_addon/{{ cookiecutter.__folder_name }}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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))
29 changes: 29 additions & 0 deletions backend_addon/{{ cookiecutter.__folder_name }}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (`<!-- extra stuff goes here -->`) 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 <template_name>
```

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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[main]
version = 6.0.13
template = plone_addon
git_init = True
python = python3
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
file="permissions.zcml"
/>


<include file="dependencies.zcml" />
<include file="profiles.zcml" />
<include file="permissions.zcml"/>

<include package=".controlpanel" />
<include package=".indexers" />
Expand All @@ -21,4 +23,6 @@
{%- endif %}
<include package=".vocabularies" />

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
i18n_domain="{{ cookiecutter.python_package_name }}"
>

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

<!-- Indexers/Metadata -->

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="{{ cookiecutter.python_package_name }}"
>

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<object name="portal_controlpanel">

<!-- -*- extra stuff goes here -*- -->

</object>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<registry
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="{{ cookiecutter.python_package_name }}">

<!-- -*- extra stuff goes here -*- -->

</registry>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<rolemap>
<permissions>

<!-- -*- extra stuff goes here -*- -->
</permissions>
</rolemap>
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@
</genericsetup:upgradeSteps>
-->

<!-- -*- extra stuff goes here -*- -->

</configure>
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<configure xmlns="http://namespaces.zope.org/zope">

<!-- -*- extra stuff goes here -*- -->

</configure>
6 changes: 3 additions & 3 deletions backend_addon/{{ cookiecutter.__folder_name }}/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend_addon/cookiecutter.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 📚

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit ee8733d

Please sign in to comment.