Skip to content

Commit

Permalink
Merge branch 'main' into ree-visual-acceptance-tests
Browse files Browse the repository at this point in the history
* main:
  Update to V18a46 (#419)
  Fix deploy
  Get rid of all barrel imports, ESlint rule to enforce it. (#418)
  Release 5.0.1
  Changelog
  Changelog
  Added lint rule
  Updates from Oct24 (#417)
  Update versions to latest volto-highlight-block, volto-button-block (#408)
  Fix eslint config (#407)
  Release 5.0.0
  Better changelog
  • Loading branch information
sneridagh committed Oct 21, 2024
2 parents c7cc7dd + d39ce99 commit 53b2487
Show file tree
Hide file tree
Showing 42 changed files with 2,653 additions and 1,552 deletions.
50 changes: 46 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,58 @@
const fs = require('fs');
const projectRootPath = __dirname;
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');

let coreLocation;
if (fs.existsSync(`${projectRootPath}/core`))
coreLocation = `${projectRootPath}/core`;
else if (fs.existsSync(`${projectRootPath}/../../core`))
coreLocation = `${projectRootPath}/../../core`;

const registry = new AddonConfigurationRegistry(
`${coreLocation}/packages/volto`,
);

// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
const addonAliases = Object.keys(registry.packages).map((o) => [
o,
registry.packages[o].modulePath,
]);

module.exports = {
extends: './core/packages/volto/.eslintrc',
extends: `${coreLocation}/packages/volto/.eslintrc`,
rules: {
'import/no-unresolved': 1,
'import/named': 'error',
'react/jsx-filename-extension': 'error',
'no-restricted-imports': [
'error',
{
name: '@plone/volto/components',
message:
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
},
{
name: '@plone/volto/helpers',
message:
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
},
{
name: '@plone/volto/actions',
message:
'Importing from barrel files is not allowed. Please use direct imports of the modules instead.',
},
],
'react/jsx-key': [2, { checkFragmentShorthand: true }],
},
settings: {
'import/resolver': {
alias: {
map: [
['@plone/volto', './core/packages/volto/src'],
['@plone/volto-slate', './core/packages/volto-slate/src'],
['@plone/registry', './core/packages/registry/src'],
['@plone/volto', `${coreLocation}/packages/volto/src`],
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
['@plone/registry', `${coreLocation}/packages/registry/src`],
['@kitconcept/volto-light-theme', './packages/volto-light-theme/src'],
...addonAliases,
],
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
},
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@

<!-- towncrier release notes start -->

## 5.0.1 (2024-10-09)

### Bugfix

- Fixed missing key in header @sneridagh [#417](https://github.com/kitconcept/volto-light-theme/pull/417)

### Internal

- Update versions to latest volto-highlight-block, volto-button-block @sneridagh [#408](https://github.com/kitconcept/volto-light-theme/pull/408)
- Bump `volto-button-block` version @sneridagh
Bump to Volto 18.0.0-alpha.45 [#417](https://github.com/kitconcept/volto-light-theme/pull/417)

## 5.0.0 (2024-07-02)

### Breaking

- Upgrade to a39, enable new image widget @sneridagh

Breaking:
The new Image widget component is used in the VLT shadowed image component.
The minimum Volto version requirements have changed for this reason.
The new image widget is present in core from these versions on:
- Volto 17.18.0
- Volto 18.0.0-alpha.36

For more information, please take a look at the upgrade guide:
https://github.com/kitconcept/volto-light-theme/blob/main/UPGRADE-GUIDE.md [#405](https://github.com/kitconcept/volto-light-theme/pull/405)

## 4.0.1 (2024-06-28)

### Bugfix
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# syntax=docker/dockerfile:1
ARG VOLTO_VERSION
# TODO: Replace with
# FROM plone/frontend-builder:${VOLTO_VERSION}
# when the main image is ready
FROM ghcr.io/kitconcept/frontend-builder:${VOLTO_VERSION} as builder
FROM plone/frontend-builder:${VOLTO_VERSION} as builder

COPY --chown=node packages/volto-light-theme /app/packages/volto-light-theme
COPY --chown=node volto.config.js /app/
Expand All @@ -17,10 +14,7 @@ RUN --mount=type=cache,id=pnpm,target=/app/.pnpm-store,uid=1000 <<EOT
pnpm install --prod
EOT

# TODO: Replace with
# FROM plone/frontend-prod-config:${VOLTO_VERSION}
# when the main image is ready
FROM ghcr.io/kitconcept/frontend-prod-config:${VOLTO_VERSION}
FROM plone/frontend-prod-config:${VOLTO_VERSION}

LABEL maintainer="Plone Foundation <[email protected]>" \
org.label-schema.name="adfsdf-frontend" \
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ help: ## Show this help
install: ## Installs the add-on in a development environment
pnpm dlx mrs-developer missdev --no-config --fetch-https
pnpm i
pnpm pnpm build:deps
make build-deps

.PHONY: start
start: ## Starts Volto, allowing reloading of the add-on during development
Expand All @@ -48,14 +48,14 @@ start: ## Starts Volto, allowing reloading of the add-on during development
build: ## Build a production bundle for distribution of the project with the add-on
pnpm build

packages/registry/dist: packages/registry/src
pnpm build:registry
core/packages/registry/dist: $(shell find core/packages/registry/src -type f)
pnpm --filter @plone/registry build

packages/components/dist: packages/components/src
pnpm build:components
core/packages/components/dist: $(shell find core/packages/components/src -type f)
pnpm --filter @plone/components build

.PHONY: build-deps
build-deps: packages/registry/dist packages/components/dist ## Build dependencies
build-deps: core/packages/registry/dist core/packages/components/dist ## Build dependencies

.PHONY: i18n
i18n: ## Sync i18n
Expand Down
2 changes: 1 addition & 1 deletion mrs.developer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"package": "@plone/volto",
"url": "[email protected]:plone/volto.git",
"https": "https://github.com/plone/volto.git",
"tag": "18.0.0-alpha.39"
"tag": "18.0.0-alpha.46"
},
"volto-button-block": {
"develop": false,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kitconcept/volto-light-theme-dev",
"version": "4.0.1",
"version": "5.0.1",
"description": "Volto Light Theme by kitconcept",
"main": "src/index.js",
"types": "src/types/index.d.ts",
Expand Down Expand Up @@ -55,4 +55,4 @@
"@kitconcept/volto-light-theme": "workspace:*"
},
"packageManager": "[email protected]"
}
}
28 changes: 28 additions & 0 deletions packages/volto-light-theme/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@

<!-- towncrier release notes start -->

## 5.0.1 (2024-10-09)

### Bugfix

- Fixed missing key in header @sneridagh [#417](https://github.com/kitconcept/volto-light-theme/pull/417)

### Internal

- Update versions to latest volto-highlight-block, volto-button-block @sneridagh [#408](https://github.com/kitconcept/volto-light-theme/pull/408)
- Bump `volto-button-block` version @sneridagh
Bump to Volto 18.0.0-alpha.45 [#417](https://github.com/kitconcept/volto-light-theme/pull/417)

## 5.0.0 (2024-07-02)

### Breaking

- Upgrade to a39, enable new image widget @sneridagh

Breaking:
The new Image widget component is used in the VLT shadowed image component.
The minimum Volto version requirements have changed for this reason.
The new image widget is present in core from these versions on:
- Volto 17.18.0
- Volto 18.0.0-alpha.36

For more information, please take a look at the upgrade guide:
https://github.com/kitconcept/volto-light-theme/blob/main/UPGRADE-GUIDE.md [#405](https://github.com/kitconcept/volto-light-theme/pull/405)

## 4.0.1 (2024-06-28)

### Bugfix
Expand Down
56 changes: 38 additions & 18 deletions packages/volto-light-theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,24 @@ They will be noted properly in the changelog.

See a detailed upgrade guide in: https://github.com/kitconcept/volto-light-theme/blob/main/UPGRADE-GUIDE.md

## Development
## Compatibility

| VLT version | Volto version |
|-------------|---------------|
| 3.x.x | >= Volto 17.0.0-alpha.16 |
| 4.x.x | < Volto 17.18.0 |
| 5.x.x | >= Volto 17.18.0 or >=Volto 18.0.0-alpha.36 |

This theme works under Volto 17 alpha 16 onwards.
Compatibility with Volto 16 might be achieved, but it has to be at customization level in the
specific project add-on.
Compatibility with Volto 16 might be achieved, but it has to be at customization level in the specific project add-on.
This is mainly due to the `RenderBlocks` customization that is based in the one in 17 because of the Grid block in core and the autogrouping feature.
See more information about the other dependencies in `peerDependencies` in `package.json`.

## Development

The development of this add-on is done in isolation using a new approach using pnpm workspaces and latest `mrs-developer` and other Volto core improvements.
For this reason, it only works with pnpm and Volto 18 (currently in alpha) but it does not mean that the add-on will only work in 18.

### Requisites
### Development requisites

- Volto 18 (2024-03-21: currently in alpha)
- pnpm as package manager
Expand All @@ -252,19 +259,32 @@ For this reason, it only works with pnpm and Volto 18 (currently in alpha) but i
Run `make help` to list the available commands.

```text
help Show this help
install Installs the dev environment using mrs-developer
i18n Sync i18n
format Format codebase
lint Lint Codebase
test Run unit tests
test-ci Run unit tests in CI
start-backend-docker Starts a Docker-based backend for developing
start-test-acceptance-frontend-dev Start acceptance frontend in dev mode
start-test-acceptance-frontend Start acceptance frontend in prod mode
start-test-acceptance-server Start acceptance server
test-acceptance Start Cypress in interactive mode
test-acceptance-headless Run cypress tests in headless mode for CI
help Show this help
install Installs the add-on in a development environment
start Starts Volto, allowing reloading of the add-on during development
build Build a production bundle for distribution of the project with the add-on
build-deps Build dependencies
i18n Sync i18n
ci-i18n Check if i18n is not synced
format Format codebase
lint Lint, or catch and remove problems, in code base
release Release the add-on on npmjs.org
release-dry-run Dry-run the release of the add-on on npmjs.org
test Run unit tests
ci-test Run unit tests in CI
backend-docker-start Starts a Docker-based backend for development
storybook-start Start Storybook server on port 6006
storybook-build Build Storybook
acceptance-frontend-dev-start Start acceptance frontend in development mode
acceptance-frontend-prod-start Start acceptance frontend in production mode
acceptance-backend-start Start backend acceptance server
ci-acceptance-backend-start Start backend acceptance server in headless mode for CI
acceptance-test Start Cypress in interactive mode
ci-acceptance-test Run cypress tests in headless mode for CI
acceptance-a11y-frontend-prod-start Start a11y acceptance frontend in prod mode
ci-acceptance-a11y-backend-start Start acceptance a11y server in CI mode (no terminal attached)
acceptance-a11y-test Start a11y Cypress in interactive mode
ci-acceptance-a11y-test Run a11y cypress tests in headless mode for CI
```

### Development Environment Setup
Expand Down
1 change: 0 additions & 1 deletion packages/volto-light-theme/news/405.breaking

This file was deleted.

2 changes: 2 additions & 0 deletions packages/volto-light-theme/news/418.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Get rid of all imports from Volto barrel files.
Added a rule to enforce not to import from `@plone/volto/components`, `@plone/volto/helpers` or `@plone/volto/actions`. @sneridagh
1 change: 1 addition & 0 deletions packages/volto-light-theme/news/419.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update to Volto 18a46 @sneridagh
24 changes: 16 additions & 8 deletions packages/volto-light-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@kitconcept/volto-light-theme",
"version": "4.0.1",
"version": "5.0.1",
"description": "Volto Light Theme by kitconcept",
"main": "src/index.js",
"main": "src/index.jsx",
"types": "src/types/index.d.ts",
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,20 +34,28 @@
"release-rc": "release-it --preRelease=rc"
},
"devDependencies": {
"@plone/scripts": "^3.6.1",
"release-it": "^17.1.1"
"@plone/scripts": "^3.6.2",
"react-redux": "8.1.2",
"react-router-dom": "5.2.0",
"release-it": "^17.7.0"
},
"dependencies": {
"@plone/components": "workspace:*"
},
"peerDependencies": {
"@eeacms/volto-accordion-block": "^10.4.6",
"@kitconcept/volto-button-block": "^2.3.1",
"@kitconcept/volto-button-block": "^3.0.2",
"@kitconcept/volto-dsgvo-banner": "^2.3.2",
"@kitconcept/volto-heading-block": "^2.4.0",
"@kitconcept/volto-highlight-block": "^3.0.1",
"@kitconcept/volto-highlight-block": "^4.0.0",
"@kitconcept/volto-introduction-block": "^1.0.0",
"@kitconcept/volto-separator-block": "^4.1.1",
"@kitconcept/volto-slider-block": "^6.3.1"
"@kitconcept/volto-separator-block": "^4.1.2",
"@kitconcept/volto-slider-block": "^6.3.1",
"classnames": "^2.2.6",
"lodash": "4.17.21",
"react": "18.2.0",
"react-intl": "^3.12.1",
"react-redux": "8.1.2",
"react-router-dom": "5.2.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';
import { FormattedMessage } from 'react-intl';
import { flattenToAppURL } from '@plone/volto/helpers';
import { flattenToAppURL } from '@plone/volto/helpers/Url/Url';
import config from '@plone/volto/registry';
import { useSelector, shallowEqual } from 'react-redux';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { FormattedDate } from '@plone/volto/components';
import { UniversalLink } from '@plone/volto/components';
import { expandToBackendURL } from '@plone/volto/helpers';
import FormattedDate from '@plone/volto/components/theme/FormattedDate/FormattedDate';
import UniversalLink from '@plone/volto/components/manage/UniversalLink/UniversalLink';
import { expandToBackendURL } from '@plone/volto/helpers/Url/Url';
import { Container } from '@plone/components';

const EventMetadataView = (props) => {
Expand Down
10 changes: 4 additions & 6 deletions packages/volto-light-theme/src/components/Blocks/Image/Edit.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import cx from 'classnames';
import { ImageSidebar, SidebarPortal } from '@plone/volto/components';
import ImageSidebar from '@plone/volto/components/manage/Blocks/Image/ImageSidebar';
import SidebarPortal from '@plone/volto/components/manage/Sidebar/SidebarPortal';

import {
flattenToAppURL,
isInternalURL,
withBlockExtensions,
} from '@plone/volto/helpers';
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url';
import { withBlockExtensions } from '@plone/volto/helpers/Extensions';
import config from '@plone/volto/registry';

import { ImageInput } from '@plone/volto/components/manage/Widgets/ImageWidget';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Segment, Button } from 'semantic-ui-react';
import { useIntl, FormattedMessage, defineMessages } from 'react-intl';
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers';
import { BlockDataForm, Icon, Image } from '@plone/volto/components';
import { flattenToAppURL, isInternalURL } from '@plone/volto/helpers/Url/Url';
import Icon from '@plone/volto/components/theme/Icon/Icon';
import { BlockDataForm } from '@plone/volto/components/manage/Form';
import Image from '@plone/volto/components/theme/Image/Image';
import { ImageSchema } from '@plone/volto/components/manage/Blocks/Image/schema';
import imageSVG from '@plone/volto/icons/image.svg';
import trashSVG from '@plone/volto/icons/delete.svg';
Expand Down
Loading

0 comments on commit 53b2487

Please sign in to comment.