Skip to content

Commit 626c966

Browse files
committed
volto19 project
1 parent c77b847 commit 626c966

105 files changed

Lines changed: 28170 additions & 36190 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# Folders
22
.git
33
**/.git
4-
.yarn/cache
54
.storybook
65
build
76
cache
7+
core
88
locales/*.json
99
node_modules
1010
omelette
11+
packages/*
12+
!packages/eea-website-frontend
13+
!packages/eea-website-frontend/**
1114
src/addons
1215

1316
# Files

.eslintignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
src/addons/**/node_modules
2-
src/addons/**/cypress
3-
src/addons/**/build
1+
core
2+
packages/**/node_modules
3+
packages/**/cypress
4+
packages/**/build

.eslintrc.js

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,39 @@
1-
const fs = require('fs');
1+
const path = require('path');
22
const { AddonRegistry } = require('@plone/registry/addon-registry');
33

44
const projectRootPath = __dirname;
5+
const coreLocation = path.join(projectRootPath, 'core');
6+
const voltoLocation = path.join(coreLocation, 'packages', 'volto');
7+
const { registry } = AddonRegistry.init(voltoLocation);
58

6-
let voltoPath = './node_modules/@plone/volto';
7-
8-
let configFile;
9-
if (fs.existsSync(`${projectRootPath}/tsconfig.json`))
10-
configFile = `${projectRootPath}/tsconfig.json`;
11-
else if (fs.existsSync(`${projectRootPath}/jsconfig.json`))
12-
configFile = `${projectRootPath}/jsconfig.json`;
13-
14-
if (configFile) {
15-
const jsConfig = require(configFile).compilerOptions;
16-
const pathsConfig = jsConfig.paths;
17-
if (pathsConfig['@plone/volto'])
18-
voltoPath = `./${jsConfig.baseUrl}/${pathsConfig['@plone/volto'][0]}`;
19-
}
20-
21-
const { registry } = AddonRegistry.init(projectRootPath);
22-
23-
// Extends ESLint configuration for adding aliases to local Volto add-ons.
24-
const addonAliases = Object.keys(registry.packages).map((pkgName) => [
25-
pkgName,
26-
registry.packages[pkgName].modulePath,
9+
const addonAliases = Object.keys(registry.packages).map((packageName) => [
10+
packageName,
11+
registry.packages[packageName].modulePath,
2712
]);
2813

29-
const addonExtenders = registry.getEslintExtenders().map((modulePath) =>
30-
require(modulePath),
31-
);
32-
33-
const defaultConfig = {
34-
extends: `${voltoPath}/.eslintrc`,
35-
ignorePatterns: [
36-
'src/addons/**/node_modules',
37-
'src/addons/**/cypress',
38-
'src/addons/**/build',
39-
],
14+
module.exports = {
15+
extends: path.join(voltoLocation, '.eslintrc'),
4016
settings: {
4117
'import/resolver': {
4218
alias: {
4319
map: [
44-
['@plone/volto', '@plone/volto/src'],
45-
['@plone/volto-slate', '@plone/volto-slate/src'],
20+
['@plone/volto', path.join(voltoLocation, 'src')],
21+
[
22+
'@plone/volto-slate',
23+
path.join(coreLocation, 'packages', 'volto-slate', 'src'),
24+
],
25+
[
26+
'@plone/registry',
27+
path.join(coreLocation, 'packages', 'registry', 'src'),
28+
],
29+
[
30+
'eea-website-frontend',
31+
path.join(projectRootPath, 'packages', 'eea-website-frontend', 'src'),
32+
],
4633
...addonAliases,
47-
['@package', `${projectRootPath}/src`],
48-
['@root', `${projectRootPath}/src`],
49-
['~', `${projectRootPath}/src`],
5034
],
5135
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
5236
},
53-
'babel-plugin-root-import': {
54-
rootPathSuffix: 'src',
55-
},
5637
},
5738
},
5839
};
59-
60-
module.exports = addonExtenders.reduce(
61-
(config, extender) => extender.modify(config),
62-
defaultConfig,
63-
);

.github/workflows/release_arm64.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
with:
3737
context: .
3838
platforms: linux/arm64
39+
build-args: |
40+
VOLTO_VERSION=19.3.0
3941
push: true
4042
tags: |
4143
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.version }}-arm64

.gitignore

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ coverage
99

1010
# Node
1111
node_modules
12+
.pnpm-store
1213
coverage
1314
jsdoc
1415
webpack-assets.json
@@ -69,6 +70,7 @@ selenium-screenshot-*.png
6970
cypress/videos/
7071
cypress/screenshots
7172
cypress/downloads/
73+
cypress/reports/
7274

7375
# Local environment setup
7476
.env
@@ -84,16 +86,14 @@ package.json.backup
8486
data
8587
omelette
8688

89+
# Volto 19 development workspaces fetched by mrs-developer
90+
core/
91+
packages/*
92+
!packages/eea-website-frontend/
93+
94+
# Preserve but ignore legacy local add-on checkouts from the Yarn workspace.
95+
src/addons/*
96+
8797
# build
8898
public/critical.css
89-
src/addons/*
9099
/cache
91-
92-
# yarn 3
93-
.pnp.*
94-
.yarn/*
95-
!.yarn/patches
96-
!.yarn/plugins
97-
!.yarn/releases
98-
!.yarn/sdks
99-
!.yarn/versions

.npmrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
public-hoist-pattern[]=*eslint*
2+
public-hoist-pattern[]=*prettier*
3+
public-hoist-pattern[]=*stylelint*
4+
public-hoist-pattern[]=*cypress*
5+
public-hoist-pattern[]=babel-plugin-react-intl
6+
public-hoist-pattern[]=*babel-preset-razzle
7+
engine-strict=true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

.pnpmfile.cjs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable */
2+
const fs = require('fs');
3+
const path = require('path');
4+
5+
const catalogPath = path.resolve(__dirname, 'core/catalog.json');
6+
let catalog = {};
7+
8+
if (fs.existsSync(catalogPath)) {
9+
catalog = JSON.parse(fs.readFileSync(catalogPath, 'utf-8'));
10+
} else {
11+
console.error('Catalog file does not exist at:', catalogPath);
12+
}
13+
14+
module.exports = {
15+
hooks: {
16+
updateConfig(config) {
17+
if (config.catalogs) {
18+
config.catalogs.default ??= catalog;
19+
}
20+
return config;
21+
},
22+
},
23+
};

.prettierignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
src/**/CHANGELOG.md
2-
src/**/README.md
1+
.storybook
2+
core
3+
packages/**/CHANGELOG.md
4+
packages/**/README.md
5+
node_modules
6+
build

.storybook/main.js

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ const path = require('path');
44

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

9-
const createConfig = require('../node_modules/razzle/config/createConfigAsync.js');
10-
const razzleConfig = require(path.join(projectRootPath, 'razzle.config.js'));
10+
const createConfig = require('@plone/razzle/config/createConfigAsync.js');
11+
const razzleConfig = require('@plone/volto/razzle.config');
1112

1213
const SVGLOADER = {
1314
test: /icons\/.*\.svg$/,
@@ -92,7 +93,10 @@ const defaultRazzleOptions = {
9293
};
9394

9495
module.exports = {
95-
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
96+
stories: [
97+
'../packages/**/*.mdx',
98+
'../packages/**/*.stories.@(js|jsx|ts|tsx)',
99+
],
96100
addons: [
97101
'@storybook/addon-links',
98102
'@storybook/addon-essentials',
@@ -183,6 +187,10 @@ module.exports = {
183187
...config.resolve,
184188
alias: { ...config.resolve.alias, ...baseConfig.resolve.alias },
185189
fallback: { ...config.resolve.fallback, zlib: false },
190+
plugins: [
191+
...(config.resolve.plugins || []),
192+
new RelativeResolverPlugin(registry),
193+
],
186194
},
187195
};
188196

@@ -216,18 +224,4 @@ module.exports = {
216224

217225
return extendedConfig;
218226
},
219-
babel: async (options) => {
220-
return {
221-
...options,
222-
plugins: [
223-
...options.plugins,
224-
[
225-
'./node_modules/babel-plugin-root-import/build/index.js',
226-
{
227-
rootPathSuffix: './src',
228-
},
229-
],
230-
],
231-
};
232-
},
233227
};

0 commit comments

Comments
 (0)