Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/+catalogSupport.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Catalog support for Volto 19 projects. @sneridagh
3 changes: 3 additions & 0 deletions templates/add-ons/frontend/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def remove_conditional_files(context, output_dir):
else:
(output_dir / "jest-addon.config.js").unlink()

if context["volto_version"] < "19":
(output_dir / ".pnpmfile.cjs").unlink()


def main():
"""Final fixes."""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable */
const fs = require('fs');
const path = require('path');

const catalogPath = path.resolve(__dirname, 'core/catalog.json');
let catalog = {};
if (fs.existsSync(catalogPath)) {
const catalogData = fs.readFileSync(catalogPath, 'utf-8');
catalog = JSON.parse(catalogData);
} else {
console.error('Catalog file does not exist at:', catalogPath);
}

module.exports = {
hooks: {
updateConfig(config) {
if (config.catalogs) {
config.catalogs.default ??= catalog;
}
return config;
},
},
};