Skip to content

Commit

Permalink
Revert "Fix AddonRegistry"
Browse files Browse the repository at this point in the history
This reverts commit db84c5d.
  • Loading branch information
ksuess committed Dec 20, 2024
1 parent 641c980 commit 833a429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
const fs = require('fs');
const projectRootPath = __dirname;
const { AddonRegistry } = require('@plone/registry/addon-registry');
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 } = AddonRegistry.init(`${coreLocation}/packages/volto`);
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) => [
Expand Down
4 changes: 2 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ module.exports = {
[],
defaultRazzleOptions,
);
const { AddonRegistry } = require('@plone/registry/addon-registry');
const AddonConfigurationRegistry = require('@plone/registry/src/addon-registry');

const { registry } = AddonRegistry.init(projectRootPath);
const registry = new AddonConfigurationRegistry(projectRootPath);

config = lessPlugin({ registry }).modifyWebpackConfig({
env: { target: 'web', dev: 'dev' },
Expand Down

0 comments on commit 833a429

Please sign in to comment.