Skip to content

Commit 7274f85

Browse files
committed
You've got cookieplone'd
1 parent 58fcd5b commit 7274f85

23 files changed

+20215
-20578
lines changed

.eslintrc.js

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
1+
const fs = require('fs');
2+
const projectRootPath = __dirname;
3+
const { AddonRegistry } = require('@plone/registry/addon-registry');
4+
5+
let coreLocation;
6+
if (fs.existsSync(`${projectRootPath}/core`))
7+
coreLocation = `${projectRootPath}/core`;
8+
else if (fs.existsSync(`${projectRootPath}/../../core`))
9+
coreLocation = `${projectRootPath}/../../core`;
10+
11+
const { registry } = AddonRegistry.init(`${coreLocation}/packages/volto`);
12+
13+
// Extends ESlint configuration for adding the aliases to `src` directories in Volto addons
14+
const addonAliases = Object.keys(registry.packages).map((o) => [
15+
o,
16+
registry.packages[o].modulePath,
17+
]);
18+
119
module.exports = {
2-
extends: './core/packages/volto/.eslintrc',
20+
extends: `${coreLocation}/packages/volto/.eslintrc`,
321
rules: {
422
'import/no-unresolved': 1,
523
},
624
settings: {
725
'import/resolver': {
826
alias: {
927
map: [
10-
['@plone/volto', './core/packages/volto/src'],
11-
['@plone/volto-slate', './core/packages/volto-slate/src'],
12-
['@plone/registry', './core/packages/registry/src'],
28+
['@plone/volto', `${coreLocation}/packages/volto/src`],
29+
['@plone/volto-slate', `${coreLocation}/packages/volto-slate/src`],
30+
['@plone/registry', `${coreLocation}/packages/registry/src`],
1331
[
1432
'@plonegovbr/volto-code-block',
1533
'./packages/volto-code-block/src',
1634
],
35+
...addonAliases,
1736
],
1837
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
1938
},

.github/workflows/acceptance.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ on:
77
- "*.yaml"
88
- "cypress/**"
99
- "packages/**"
10+
- ".github/workflows/acceptance.yml"
1011

1112
env:
12-
NODE_VERSION: 20.x
13+
NODE_VERSION: 24
1314
CYPRESS_RETRIES: 2
1415

1516
jobs:
@@ -19,18 +20,13 @@ jobs:
1920
steps:
2021
- uses: actions/checkout@v4
2122

22-
- name: Use Node.js
23+
- name: Use Node.js ${{ env.NODE_VERSION }}
2324
uses: actions/setup-node@v4
2425
with:
2526
node-version: ${{ env.NODE_VERSION }}
2627

27-
- uses: pnpm/action-setup@v3
28-
name: Install pnpm
29-
with:
30-
version: 8
31-
# We don't want to install until later,
32-
# when the cache and Cypress are in place
33-
run_install: false
28+
- name: Enable corepack
29+
run: npm i -g corepack@latest && corepack enable
3430

3531
- name: Get pnpm store directory
3632
shell: bash
@@ -64,8 +60,8 @@ jobs:
6460
name: Start Servers
6561
with:
6662
run: |
67-
make start-test-acceptance-server-ci &
68-
make start-test-acceptance-frontend &
63+
make ci-acceptance-backend-start &
64+
make acceptance-frontend-prod-start &
6965
# your step-level and job-level environment variables are available to your commands as-is
7066
# npm install will count towards the wait-for timeout
7167
# whenever possible, move unrelated scripts to a different step
@@ -89,7 +85,7 @@ jobs:
8985

9086
log-output-if: failure
9187

92-
- run: make test-acceptance-headless
88+
- run: make ci-acceptance-test
9389

9490
# Upload Cypress screenshots
9591
- uses: actions/upload-artifact@v4

.github/workflows/changelog.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
env:
9-
NODE_VERSION: 20.x
9+
NODE_VERSION: 24
1010
ADDON_NAME: volto-code-block
1111

1212
jobs:
@@ -26,13 +26,8 @@ jobs:
2626
with:
2727
node-version: ${{ env.NODE_VERSION }}
2828

29-
- uses: pnpm/action-setup@v3
30-
name: Install pnpm
31-
with:
32-
version: 8
33-
# We don't want to install until later,
34-
# when the cache and Cypress are in place
35-
run_install: false
29+
- name: Enable corepack
30+
run: npm i -g corepack@latest && corepack enable
3631

3732
- name: Get pnpm store directory
3833
shell: bash

.github/workflows/code.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- "*.json"
77
- "*.yaml"
88
- "packages/**"
9+
- ".github/workflows/code.yml"
910

1011
env:
11-
NODE_VERSION: 20.x
12+
NODE_VERSION: 24
1213

1314
jobs:
1415
codeanalysis:
@@ -23,13 +24,8 @@ jobs:
2324
with:
2425
node-version: ${{ env.NODE_VERSION }}
2526

26-
- uses: pnpm/action-setup@v3
27-
name: Install pnpm
28-
with:
29-
version: 8
30-
# We don't want to install until later,
31-
# when the cache is in place
32-
run_install: false
27+
- name: Enable corepack
28+
run: npm i -g corepack@latest && corepack enable
3329

3430
- name: Get pnpm store directory
3531
shell: bash

.github/workflows/i18n.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- "*.json"
77
- "*.yaml"
88
- "packages/**"
9+
- ".github/workflows/i18n.yml"
910

1011
env:
11-
NODE_VERSION: 20.x
12+
NODE_VERSION: 24
1213

1314
jobs:
1415
unit:
@@ -23,13 +24,8 @@ jobs:
2324
with:
2425
node-version: ${{ env.NODE_VERSION }}
2526

26-
- uses: pnpm/action-setup@v3
27-
name: Install pnpm
28-
with:
29-
version: 8
30-
# We don't want to install until later,
31-
# when the cache and Cypress are in place
32-
run_install: false
27+
- name: Enable corepack
28+
run: npm i -g corepack@latest && corepack enable
3329

3430
- name: Get pnpm store directory
3531
shell: bash

.github/workflows/storybook.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99
- ".github/workflows/storybook.yml"
1010

1111
env:
12-
NODE_VERSION: 20.x
12+
NODE_VERSION: 24
13+
14+
permissions:
15+
contents: write
1316

1417
jobs:
1518
build-and-deploy:
@@ -23,13 +26,8 @@ jobs:
2326
with:
2427
node-version: ${{ env.NODE_VERSION }}
2528

26-
- uses: pnpm/action-setup@v3
27-
name: Install pnpm
28-
with:
29-
version: 8
30-
# We don't want to install until later,
31-
# when the cache and Cypress are in place
32-
run_install: false
29+
- name: Enable corepack
30+
run: npm i -g corepack@latest && corepack enable
3331

3432
- name: Get pnpm store directory
3533
shell: bash

.github/workflows/unit.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ on:
66
- "*.json"
77
- "*.yaml"
88
- "packages/**"
9+
- ".github/workflows/unit.yml"
910

1011
env:
11-
NODE_VERSION: 20.x
12+
NODE_VERSION: 24
1213

1314
jobs:
1415
unit:
@@ -23,13 +24,8 @@ jobs:
2324
with:
2425
node-version: ${{ env.NODE_VERSION }}
2526

26-
- uses: pnpm/action-setup@v3
27-
name: Install pnpm
28-
with:
29-
version: 8
30-
# We don't want to install until later,
31-
# when the cache and Cypress are in place
32-
run_install: false
27+
- name: Enable corepack
28+
run: npm i -g corepack@latest && corepack enable
3329

3430
- name: Get pnpm store directory
3531
shell: bash
@@ -48,4 +44,4 @@ jobs:
4844
run: make install
4945

5046
- name: Unit tests
51-
run: make test-ci
47+
run: make ci-test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ acceptance/cypress/videos/
66
acceptance/node_modules
77
.storybook-build
88
build
9-
core
9+
/core
1010
node_modules
1111
results
1212
yarn.lock
13+
/public

.npmrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ public-hoist-pattern[]=*eslint*
22
public-hoist-pattern[]=*prettier*
33
public-hoist-pattern[]=*stylelint*
44
public-hoist-pattern[]=*cypress*
5-
public-hoist-pattern[]=*process*
6-
public-hoist-pattern[]=*parcel*
5+
public-hoist-pattern[]=babel-plugin-react-intl
6+
public-hoist-pattern[]=babel-preset-razzle

.storybook/main.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const path = require('path');
44

55
const projectRootPath = path.resolve('.');
66
const lessPlugin = require('@plone/volto/webpack-plugins/webpack-less-plugin');
7+
const RelativeResolverPlugin = require('@plone/volto/webpack-plugins/webpack-relative-resolver');
78
const scssPlugin = require('razzle-plugin-scss');
89

910
const createConfig = require('razzle/config/createConfigAsync.js');
@@ -107,9 +108,9 @@ module.exports = {
107108
[],
108109
defaultRazzleOptions,
109110
);
110-
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');
111+
const { AddonRegistry } = require('@plone/registry/addon-registry');
111112

112-
const registry = new AddonConfigurationRegistry(projectRootPath);
113+
const { registry } = AddonRegistry.init(projectRootPath);
113114

114115
config = lessPlugin({ registry }).modifyWebpackConfig({
115116
env: { target: 'web', dev: 'dev' },
@@ -147,6 +148,10 @@ module.exports = {
147148
...config.resolve,
148149
alias: { ...config.resolve.alias, ...baseConfig.resolve.alias },
149150
fallback: { ...config.resolve.fallback, zlib: false },
151+
plugins: [
152+
...(config.resolve.plugins || []),
153+
new RelativeResolverPlugin(registry),
154+
],
150155
},
151156
};
152157

0 commit comments

Comments
 (0)