adobe / aem-site-template-builder

MIT License
23 stars 7 forks source link

Site template builder relies on Site Template being a git repo #11

Closed bartoszglow closed 3 years ago

bartoszglow commented 3 years ago

Problem is in the way that template-builder builds the aem-site-template-basic-x.x.x.zip file. It relies on the fact that Site Template should be a git repository so it can create theme-sources folder by filtering only necessary files from the theme folder based on its .gitignore. To do that it has to be a proper git project (with .git folder).

Expected Behaviour

theme-sources.zip file is part of aem-site-template-basic-4.0.1.zip file created by running npx aem-site-template-builder therefore theme sources can be downloaded from AEM.

Actual Behaviour

theme-sources.zip file is missing in aem-site-template-basic-4.0.1.zip file created by running npx aem-site-template-builder therefore theme sources can not be downloaded from AEM.

Reproduce Steps

  1. Download a source-code from Site Template Basic 4.0.1.
  2. Unzip aem-site-template-basic-4.0.1.zip.
  3. Go to folder aem-site-template-basic-4.0.1.
  4. Run npx aem-site-template-builder.
  5. Go to AEM and upload your newly created aem-site-template-basic-4.0.1.zip. (make sure to not upload source code but generated package)
  6. Try to download theme sources.

Further Explanation

aem-site-template-basic-x.x.x.zip file created by running Reproduce Steps does not contain theme-sources.zip file in the package. Due to that you can’t download theme sources in AEM.

Proposed Solution

Workarounds

For now there are 2 workarounds:

reusr1 commented 3 years ago

@bartoszglow it may be a good idea to switch to a solution like https://www.npmjs.com/package/ignore or https://www.npmjs.com/package/ignore-walk - this allows you to consume the .gitignore file without a git init

this issue is currently blocking the test suite of https://github.com/adobe/aem-project-archetype/pull/747 (integration of a site template into the aem archetype)

bartoszglow commented 3 years ago

Issue fixed with #17 and released in version 2.2.0