Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix(cli): plugins pages clearing on the runtime (#1598)
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick authored Jul 15, 2021
1 parent 6acd63e commit 9c5bd13
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 17 deletions.
15 changes: 0 additions & 15 deletions packages/cli/__tests__/buildPluginsTrace.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,6 @@ describe("CLI extensions - plugins - buildPluginsTrace", () => {
});

describe("custom pages and layouts", () => {
it("should clear plugins layouts and pages cache", async () => {
const pluginsConfig = {
"first-plugin": false,
};
await toolbox.buildPluginsTrace({
pluginsConfig,
});
expect(toolbox.filesystem.removeAsync).toBeCalledWith(
".shopware-pwa/sw-plugins/pages"
);
expect(toolbox.filesystem.removeAsync).toBeCalledWith(
".shopware-pwa/sw-plugins/layouts"
);
});

it("should add plugin layouts to cache and runtime directory", async () => {
toolbox.filesystem.exists.mockReturnValueOnce("dir");
toolbox.filesystem.exists.mockReturnValueOnce(false);
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/commands/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ module.exports = {
props: {},
});

await toolbox.filesystem.removeAsync(".shopware-pwa/sw-plugins/pages");
await toolbox.filesystem.removeAsync(".shopware-pwa/sw-plugins/layouts");

const pluginsConfig = await toolbox.plugins.getPluginsConfig();
const shopwarePluginsTrace = await toolbox.buildPluginsTrace({
pluginsConfig,
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/extensions/plugins-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ module.exports = (toolbox: GluegunToolbox) => {
const pluginsMap = Object.assign({}, pluginsTrace);
if (pluginsConfig) {
const pluginNames = Object.keys(pluginsConfig);
await toolbox.filesystem.removeAsync(".shopware-pwa/sw-plugins/pages");
await toolbox.filesystem.removeAsync(".shopware-pwa/sw-plugins/layouts");
pluginNames.forEach((pluginName) => {
if (!pluginsConfig[pluginName]) return;
const pluginDirectory = `${pluginsRootDirectory}/${pluginName}`;
Expand Down

0 comments on commit 9c5bd13

Please sign in to comment.