Skip to content

Commit 78ec373

Browse files
wesleyblstevepiercysneridaghAbhishek-17h
authored
Fork razzle into @plone/razzle (#7542)
Co-authored-by: Steve Piercy <[email protected]> Co-authored-by: Víctor Fernández de Alba <[email protected]> Co-authored-by: Bhanudas Hegaje <[email protected]>
1 parent 829f0a6 commit 78ec373

File tree

131 files changed

+5238
-1689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+5238
-1689
lines changed

apps/rr7/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ make backend-docker-start
2727

2828
## About this app
2929

30-
- [Remix Docs](https://remix.run/docs/en/main)
30+
- [Remix Docs](https://reactrouter.com/start/framework/installation)

docs/source/development/add-ons/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ load-add-on-configuration
1919
create-an-add-on-18
2020
create-an-add-on-17
2121
theme-add-on
22+
test-add-ons-19
2223
test-add-ons-18
2324
test-add-ons-17
2425
extend-webpack-add-on

docs/source/development/add-ons/test-add-ons-18.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@ The following code is boilerplate setup for Vitest.
9999

100100
```javascript
101101
import '@testing-library/jest-dom';
102-
import { expect, describe, it, vi } from 'vitest';
103-
104-
// Make Vitest globals available throughout the test suite
105-
global.describe = describe;
106-
global.it = it;
107-
global.expect = expect;
108-
global.vi = vi;
109102

110103
// Stub the global fetch API to prevent actual network requests in tests
111104
vi.stubGlobal('fetch', vi.fn(() =>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
myst:
3+
html_meta:
4+
"description": "Test add-ons in Volto 19"
5+
"property=og:description": "Test add-ons in Volto 19"
6+
"property=og:title": "Test add-ons in Volto 19"
7+
"keywords": "Volto, Plone, testing, test, CI, add-ons, Vitest, Jest"
8+
---
9+
10+
# Test add-ons in Volto 19
11+
12+
In Volto 19, Jest has been completely removed, and add-ons that rely on Jest-based test suites are no longer supported.
13+
You must migrate your add-on tests to Vitest.
14+
15+
See the guide {doc}`test-add-ons-18` for how to migrate your add-on tests from Jest to Vitest.

docs/source/upgrade-guide/index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,38 @@ You should take the following actions for your Volto 19 projects.
4848

4949
If you can't upgrade immediately, you may continue to run Volto 19 on Node.js 20 at your own risk, but be aware that issues specific to Node.js 20 will not be fixed in the Volto core CI or releases.
5050

51+
(replace-razzle-with-volto-razzle)=
52+
53+
### Replace `razzle` with `@volto/razzle` (fork)
54+
```{versionchanged} Volto 19.0.0-alpha.14
55+
```
56+
57+
`@volto/razzle` is a fork of the upstream `razzle` package that contains Volto-specific fixes and patches.
58+
Use `@volto/razzle` in your Volto 19 projects when either you need the Volto-compatible build behavior, or the Volto team provides temporary patches that are not yet merged upstream in Razzle.
59+
60+
For most projects, no action is required.
61+
The fork maintains full compatibility with the original `razzle` package, preserving all CLI entry points such as `razzle start`, `razzle build`, and `razzle test`.
62+
63+
However, if you have customized Volto's internals in your project—for example, by importing internal modules directly from the `razzle` package such as `require('razzle/some/path')`—then you need to update those imports to reference `@volto/razzle` instead.
64+
65+
To verify whether your project requires updates, search for any direct references to internal `razzle` modules:
66+
67+
```shell
68+
grep -R "require.*razzle/" -n --exclude-dir=node_modules || true
69+
grep -R "from.*razzle/" -n --exclude-dir=node_modules || true
70+
```
71+
72+
If you find any matches, check in particular:
73+
74+
- build and Babel configurations, including {file}`babel.config.js`, {file}`.babelrc`, {file}`webpack.config.js`, and {file}`razzle.config.js`
75+
- any presets or plugins sections that import internal `razzle` modules
76+
- custom build scripts that reference `razzle` internals
77+
78+
```{note}
79+
The fork exists so we can ship fixes and compatibility patches required by Volto, since the upstream is no longer maintained.
80+
Our goal is to keep `@volto/razzle` compatible with the `razzle` public API.
81+
```
82+
5183
### `pnpm` has been upgraded to version 10
5284
```{versionchanged} Volto 19.0.0-alpha.7
5385
```

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"start:project": "pnpm --filter plone run start",
2020
"lint": "make build-all-deps && eslint --max-warnings=0 '{apps,packages}/**/*.{js,jsx,ts,tsx}'",
2121
"lint:volto": "pnpm --filter @plone/volto run lint",
22-
"test": "pnpm --filter @plone/volto run vitest",
22+
"test": "pnpm --filter @plone/volto run test",
2323
"test:ci": "pnpm --filter @plone/volto run test:ci",
2424
"i18n": "pnpm --filter @plone/volto run i18n",
2525
"i18n:ci": "pnpm --filter @plone/volto i18n:ci",
@@ -45,12 +45,7 @@
4545
"packageManager": "[email protected]",
4646
"pnpm": {
4747
"overrides": {
48-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
49-
"immer@8": "10.1.3",
50-
"react-refresh": "0.14.0"
51-
},
52-
"patchedDependencies": {
53-
48+
"immer@8": "10.1.3"
5449
},
5550
"ignoredBuiltDependencies": [
5651
"@parcel/watcher"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fork `babel-razzle-preset` from Razzle. Update dependencies. @sneridagh

packages/scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"dependencies": {
4343
"@babel/core": "^7.0.0",
4444
"babel-plugin-react-intl": "5.1.17",
45-
"babel-preset-razzle": "4.2.17",
45+
"@plone/babel-preset-razzle": "workspace:^",
4646
"chalk": "4",
4747
"commander": "8.2.0",
4848
"comment-json": "^4.2.3",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"plugins": {
3+
"../scripts/prepublish.js": {}
4+
},
5+
"hooks": {
6+
"after:bump": [
7+
"pipx run towncrier build --draft --yes --version ${version} > .changelog.draft",
8+
"pipx run towncrier build --yes --version ${version}"
9+
],
10+
"after:release": "rm .changelog.draft"
11+
},
12+
"npm": {
13+
"publish": false
14+
},
15+
"git": {
16+
"commitArgs": ["--no-verify"],
17+
"changelog": "pipx run towncrier build --draft --yes --version 0.0.0",
18+
"requireUpstream": false,
19+
"requireCleanWorkingDir": false,
20+
"commitMessage": "Release @plone/babel-preset-razzle ${version}",
21+
"tagName": "plone-slate-${version}",
22+
"tagAnnotation": "Release @plone/babel-preset-razzle ${version}"
23+
},
24+
"github": {
25+
"release": true,
26+
"releaseName": "@plone/babel-preset-razzle ${version}",
27+
"releaseNotes": "cat .changelog.draft"
28+
}
29+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# @plone/babel-preset-razzle Release Notes
2+
3+
<!-- Do *NOT* add new change log entries to this file.
4+
Instead create a file in the news directory.
5+
For helpful instructions, see:
6+
https://6.docs.plone.org/contributing/index.html#change-log-entry
7+
-->
8+
9+
<!-- towncrier release notes start -->

0 commit comments

Comments
 (0)