vue-storefront icon indicating copy to clipboard operation
vue-storefront copied to clipboard

CLI - Changing implementation of generate-template command

Open sync-by-unito[bot] opened this issue 4 years ago • 2 comments
trafficstars

Blockers: vsf-tu should give the ability to export generator function.

Summary: The impact of this problem is probably low. I had one piece of information about described behavior.

Reason: Some integrators are reporting an issue related to generate-template command, that this function fails during vsf-tu command execution via execa.

Why this may happen: The present vsf-tu package is giving the ability to only execute it as a shell command. We are doing that in code via another package - execa. The problem that can occur is related to executing a shell command, some integrators report that vsf-tu command was not found. Probably because this library is not installed globally on the machine and execa can't execute it.

Research:

Somebody who will do that task please check on your machine the hypotenuse of this potential bug.

Theme utilities: If this library will give the ability to export its functionality as a function the benefits will be:

  • less code in the implementation of the generate-template function.
  • safety of code execution.

I’ve done some PoC of this implementation, but it has an issue with async generation. Some files are generated later than code execution. e.g. the await processMagicCommentsInNuxtConfig(generatedTemplatePath); is executed before full files generation and creates an error, because nuxt.config.js does not exist. (link to file https://github.com/vuestorefront/vue-storefront/blob/fix/cli-theme-utilities-config/packages/core/cli/src/scripts/createTemplate/processTemplate.ts#L24 ) Link to branch https://github.com/vuestorefront/vue-storefront/tree/fix/cli-theme-utilities-config Link to a branch of vsf-tu with the ability to use it outside of shell: https://github.com/vuestorefront/theme-utilities/tree/20210608-allow-use-outside-clis

If you will have any questions about this issue please contact me - [~accountid:60657e269bc49b0070f93f9e]

sync-by-unito[bot] avatar Jul 16 '21 07:07 sync-by-unito[bot]

➤ Filip Sobol commented:

Heitor Ramon and Vladyslav Ovsiienko started working on the new CLI that will also fix the generate-template command.

sync-by-unito[bot] avatar Nov 16 '21 12:11 sync-by-unito[bot]

➤ Heitor Ramon commented:

I would like to add this information

Branch: feat/cli-rewrite

https://github.com/vuestorefront/vue-storefront/tree/main/packages/core/cli ( https://github.com/vuestorefront/vue-storefront/tree/main/packages/core/cli|smart-link ) https://github.com/vuestorefront/vue-storefront/tree/feat/cli-rewrite/packages/core/cli ( https://github.com/vuestorefront/vue-storefront/tree/feat/cli-rewrite/packages/core/cli|smart-link ) Using Framework: https://oclif.io/ ( https://oclif.io/|smart-link )

sync-by-unito[bot] avatar Nov 16 '21 12:11 sync-by-unito[bot]

Issue is closed. Reason: Too Old (>6 months)


Sergii Kirianov

Developer Advocate

Vue Storefront

skirianov avatar Jan 18 '23 10:01 skirianov