vuestorefront/storefront-ui

[BUG] copy components - no internalData file

justyna-13 opened this issue · 3 comments

Describe the bug
A clear and concise description of what the bug is.

There is a bug in copy components script about missing internalData file

How to reproduce
Steps to reproduce the behavior:

  1. Run copy components script
  2. see error

Expected behavior
no error

┆Issue is synchronized with this Jira Task by Unito

I fixed the bug of the copy-component script. Not sure it's the way VSF team expects, but it works for me. This file, internalData is removed automatically whenever the copy-component script is finished executing, and therefore in the next time script fails as the file doesn't exist. I used existsSync() function to check if the file exists, if it doesn't exist file isn't removed (if file doesn't exist, and if script tries to remove it causes an error that's why), otherwise only the file is removed. I tried the manual copying way VSF team had stated, but it's not recommended as we have to rewrite the paths of so many files as well. This script automatically takes care of the path rewriting.

@jacobfogolyan

copy-components.js

Instructions

  1. Search for internalData in copy-components.js file and enclose it with the following If block.
if (fs.existsSync(`${srcPath}/components/templates/internalData.js`)) {
  fs.unlinkSync(`${srcPath}/components/templates/internalData.js`, (err) => {
    if (err) throw err;
  });
}

Hi @DonDilangaFK, thanks for this solution. Would you like to create a PR? :)

@DonDilangaFK Thank you for the contribution here. It would be nice if you could also take a look at our new version of SFUI. You can contribute there as well.

I'm closing this ticket as it doesn't meet the requirements of LTS policy.. So we won't work on it, but instead, we got the new version which is currently being developed.