Skip to content

Commit 9659e6b

Browse files
authored
Merge branch 'main' into issue-66
2 parents cdcd2a6 + 9bd8c7f commit 9659e6b

File tree

11 files changed

+269
-3
lines changed

11 files changed

+269
-3
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
steps:
5555
- name: Download packages built by build-and-inspect-python-package
56-
uses: actions/download-artifact@v7
56+
uses: actions/download-artifact@v8
5757
with:
5858
name: Packages
5959
path: dist
@@ -76,7 +76,7 @@
7676

7777
steps:
7878
- name: Download packages built by build-and-inspect-python-package
79-
uses: actions/download-artifact@v7
79+
uses: actions/download-artifact@v8
8080
with:
8181
name: Packages
8282
path: dist

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ qa = "mxmake.topics:qa"
7676
system = "mxmake.topics:system"
7777
applications = "mxmake.topics:applications"
7878
i18n = "mxmake.topics:i18n"
79+
volto = "mxmake.topics:volto"
7980

8081
[build-system]
8182
requires = ["hatchling", "hatch-vcs", "hatch-fancy-pypi-readme"]

src/mxmake/templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def template_variables(self) -> dict[str, typing.Any]:
282282
fqns = sorted([domain.fqn for domain in self.domains])
283283
additional_targets = {}
284284
topics = {domain.topic for domain in self.domains}
285-
additional_targets["qa"] = "qa" in topics
285+
additional_targets["qa"] = bool(topics & {"qa", "volto"})
286286
# return template variables
287287
return {
288288
"settings": settings,

src/mxmake/topics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,4 @@ def set_domain_runtime_depends(domains: list[Domain]) -> None:
303303
system = Topic(name="system", directory=topics_dir / "system")
304304
applications = Topic(name="applications", directory=topics_dir / "applications")
305305
i18n = Topic(name="i18n", directory=topics_dir / "i18n")
306+
volto = Topic(name="volto", directory=topics_dir / "volto")
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#:[acceptance]
2+
#:title = Volto Acceptance
3+
#:description = Acceptance testing for Volto projects using Cypress.
4+
#:depends = volto.core
5+
#:
6+
#:[target.volto-acceptance-backend-start]
7+
#:description = Start Docker-based Plone acceptance backend.
8+
#:
9+
#:[target.volto-acceptance-frontend-dev-start]
10+
#:description = Start acceptance frontend in development mode.
11+
#:
12+
#:[target.volto-acceptance-test]
13+
#:description = Run Cypress acceptance tests in interactive mode.
14+
#:
15+
#:[target.volto-ci-acceptance-test]
16+
#:description = Run Cypress acceptance tests in headless CI mode.
17+
#:
18+
#:[setting.VOLTO_ACCEPTANCE_BACKEND_IMAGE]
19+
#:description = Docker image for Plone acceptance backend.
20+
#:default = plone/server-acceptance:6
21+
#:
22+
#:[setting.VOLTO_CYPRESS_CONFIG]
23+
#:description = Path to Cypress configuration file.
24+
#:default = cypress.config.js
25+
#:
26+
#:[setting.VOLTO_CYPRESS_SPEC_PATTERN]
27+
#:description = Glob pattern for Cypress test specs.
28+
#:default = cypress/tests/**/*.{js,jsx,ts,tsx}
29+
30+
##############################################################################
31+
# volto acceptance
32+
##############################################################################
33+
34+
.PHONY: volto-acceptance-backend-start
35+
volto-acceptance-backend-start:
36+
@echo "Start Plone acceptance backend"
37+
@docker run -it --rm -p 55001:55001 $(VOLTO_ACCEPTANCE_BACKEND_IMAGE)
38+
39+
.PHONY: volto-acceptance-frontend-dev-start
40+
volto-acceptance-frontend-dev-start: $(VOLTO_TARGET)
41+
@echo "Start acceptance frontend in development mode"
42+
@RAZZLE_API_PATH=http://127.0.0.1:55001/plone pnpm start
43+
44+
.PHONY: volto-acceptance-test
45+
volto-acceptance-test: $(VOLTO_TARGET)
46+
@echo "Run Cypress acceptance tests"
47+
@pnpm --filter @plone/volto exec cypress open \
48+
--config-file $(CURRENT_DIR)/$(VOLTO_CYPRESS_CONFIG) \
49+
--config specPattern=$(CURRENT_DIR)'/$(VOLTO_CYPRESS_SPEC_PATTERN)'
50+
51+
.PHONY: volto-ci-acceptance-test
52+
volto-ci-acceptance-test: $(VOLTO_TARGET)
53+
@echo "Run Cypress CI acceptance tests"
54+
@pnpm --filter @plone/volto exec cypress run \
55+
--config-file $(CURRENT_DIR)/$(VOLTO_CYPRESS_CONFIG) \
56+
--config specPattern=$(CURRENT_DIR)'/$(VOLTO_CYPRESS_SPEC_PATTERN)'

src/mxmake/topics/volto/core.mk

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#:[core]
2+
#:title = Volto Core
3+
#:description = Plone Volto frontend project setup. Provides targets for
4+
#: installing, starting, building, and cleaning a Volto project using pnpm
5+
#: workspaces and mrs-developer.
6+
#:depends = core.base
7+
#:
8+
#:[target.volto-install]
9+
#:description = Install Volto frontend packages using pnpm and mrs-developer.
10+
#:
11+
#:[target.volto-build-deps]
12+
#:description = Build Volto workspace dependencies (@plone/registry,
13+
#: @plone/components).
14+
#:
15+
#:[target.volto-start]
16+
#:description = Start Volto development server with hot reload.
17+
#:
18+
#:[target.volto-build]
19+
#:description = Build production bundle.
20+
#:
21+
#:[target.volto-dirty]
22+
#:description = Build :ref:`volto-install` target on next make run.
23+
#:
24+
#:[target.volto-clean]
25+
#:description = Remove installed packages and cloned Volto core.
26+
#:
27+
#:[setting.VOLTO_ADDON_NAME]
28+
#:description = The pnpm package name of the Volto addon in this project.
29+
#: Used for ``pnpm --filter`` commands.
30+
#:default =
31+
#:
32+
#:[setting.VOLTO_MRS_DEVELOPER_PARAMS]
33+
#:description = Additional parameters for ``mrs-developer missdev``.
34+
#:default = --no-config --fetch-https
35+
36+
##############################################################################
37+
# volto core
38+
##############################################################################
39+
40+
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
41+
42+
VOLTO_TARGET:=$(SENTINEL_FOLDER)/volto.sentinel
43+
$(VOLTO_TARGET): $(SENTINEL) package.json mrs.developer.json
44+
@echo "Install Volto frontend packages"
45+
@pnpm dlx mrs-developer missdev $(VOLTO_MRS_DEVELOPER_PARAMS)
46+
@pnpm install
47+
@touch $(VOLTO_TARGET)
48+
49+
.PHONY: volto-install
50+
volto-install: $(VOLTO_TARGET)
51+
52+
.PHONY: volto-build-deps
53+
volto-build-deps: $(VOLTO_TARGET)
54+
@echo "Build Volto workspace dependencies"
55+
@pnpm --filter @plone/registry build
56+
@pnpm --filter @plone/components build
57+
58+
.PHONY: volto-start
59+
volto-start: $(VOLTO_TARGET)
60+
@echo "Start Volto development server"
61+
@pnpm start
62+
63+
.PHONY: volto-build
64+
volto-build: $(VOLTO_TARGET) volto-build-deps
65+
@echo "Build Volto production bundle"
66+
@pnpm build
67+
68+
.PHONY: volto-dirty
69+
volto-dirty:
70+
@rm -f $(VOLTO_TARGET)
71+
72+
.PHONY: volto-clean
73+
volto-clean: volto-dirty
74+
@rm -rf core node_modules
75+
76+
INSTALL_TARGETS+=volto-install
77+
RUN_TARGET?=volto-start
78+
DIRTY_TARGETS+=volto-dirty
79+
CLEAN_TARGETS+=volto-clean

src/mxmake/topics/volto/i18n.mk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#:[i18n]
2+
#:title = Volto i18n
3+
#:description = Translation management for Volto frontend projects.
4+
#:depends = volto.core
5+
#:
6+
#:[target.volto-i18n]
7+
#:description = Sync i18n translations for the Volto addon.
8+
#:
9+
#:[target.volto-ci-i18n]
10+
#:description = Check that i18n translations are in sync (fails if not).
11+
12+
##############################################################################
13+
# volto i18n
14+
##############################################################################
15+
16+
.PHONY: volto-i18n
17+
volto-i18n: $(VOLTO_TARGET)
18+
@echo "Sync Volto i18n"
19+
@pnpm --filter $(VOLTO_ADDON_NAME) i18n
20+
21+
.PHONY: volto-ci-i18n
22+
volto-ci-i18n: $(VOLTO_TARGET)
23+
@echo "Check Volto i18n sync"
24+
@pnpm --filter $(VOLTO_ADDON_NAME) i18n && \
25+
git diff -G'^[^"POT]' --exit-code
26+
27+
.PHONY: i18n
28+
i18n: volto-i18n

src/mxmake/topics/volto/lint.mk

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#:[lint]
2+
#:title = Volto Lint
3+
#:description = Code linting and formatting for Volto frontend projects.
4+
#: Runs ESLint, Prettier, and Stylelint via pnpm scripts.
5+
#:depends = volto.core
6+
#:
7+
#:[target.volto-lint]
8+
#:description = Run ESLint, Prettier, and Stylelint checks.
9+
#:
10+
#:[target.volto-format]
11+
#:description = Run ESLint, Prettier, and Stylelint with auto-fix.
12+
13+
##############################################################################
14+
# volto lint
15+
##############################################################################
16+
17+
.PHONY: volto-lint
18+
volto-lint: $(VOLTO_TARGET)
19+
@echo "Run Volto lint checks"
20+
@pnpm lint
21+
@pnpm prettier
22+
@pnpm stylelint --allow-empty-input
23+
24+
.PHONY: volto-format
25+
volto-format: $(VOLTO_TARGET)
26+
@echo "Run Volto format"
27+
@pnpm lint:fix
28+
@pnpm prettier:fix
29+
@pnpm stylelint:fix
30+
31+
CHECK_TARGETS+=volto-lint
32+
FORMAT_TARGETS+=volto-format
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[metadata]
2+
title = Volto
3+
description = Plone Volto (React) frontend domains.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#:[storybook]
2+
#:title = Volto Storybook
3+
#:description = Storybook integration for Volto component development.
4+
#:depends = volto.core
5+
#:
6+
#:[target.volto-storybook-start]
7+
#:description = Start Storybook development server on port 6006.
8+
#:
9+
#:[target.volto-storybook-build]
10+
#:description = Build static Storybook site.
11+
#:
12+
#:[setting.VOLTO_STORYBOOK_PORT]
13+
#:description = Port for Storybook development server.
14+
#:default = 6006
15+
16+
##############################################################################
17+
# volto storybook
18+
##############################################################################
19+
20+
VOLTO_STORYBOOK_BUILD_DIR?=$(CURRENT_DIR)/.storybook-build
21+
22+
.PHONY: volto-storybook-start
23+
volto-storybook-start: $(VOLTO_TARGET)
24+
@echo "Start Volto Storybook"
25+
@pnpm run storybook
26+
27+
.PHONY: volto-storybook-build
28+
volto-storybook-build: $(VOLTO_TARGET)
29+
@echo "Build Volto Storybook"
30+
@mkdir -p $(VOLTO_STORYBOOK_BUILD_DIR)
31+
@pnpm run storybook-build -o $(VOLTO_STORYBOOK_BUILD_DIR)

0 commit comments

Comments
 (0)