Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paragon CLI install-theme doesn't reset back to original @edx/brand after usage #2644

Closed
adamstankiewicz opened this issue Sep 22, 2023 · 5 comments
Assignees
Labels
bug Report of or fix for something that isn't working as intended

Comments

@adamstankiewicz
Copy link
Member

Improvements

The Paragon CLI tool's install-theme command works great to override the @edx/brand NPM alias during local development without risking modifying/committing code. Testing the command in the frontend-template-application MFE, it appears that after using paragon install-theme, the provided NPM package (e.g., @edx/brand-edx.org@latest) remains installed even when I revert back to using the default/standard npm start command instead of npm run start:with-theme.

Testing instructions

  1. Install latest @edx/paragon into an MFE.
  2. Add NPM script for start:with-theme, which runs paragon install-theme && npm start.
  3. Execute npm run start:with-theme and provide @edx/brand-edx.org@latest as input.
  4. Observe custom theme is applied in running application within browser.
  5. Stop the dev server and start it again with npm start instead.
  6. Observe the @edx/brand-edx.org@latest theme is still installed even though I would have expected the default Paragon theme to be applicable again.
  7. As is, need to run npm install to reset back to original theme @edx/brand-openedx.
@adamstankiewicz adamstankiewicz added the bug Report of or fix for something that isn't working as intended label Sep 22, 2023
@adamstankiewicz adamstankiewicz moved this from Backlog to To Do in Paragon Working Group Sep 22, 2023
@adamstankiewicz
Copy link
Member Author

Two possible approaches for the fix:

  1. Automatically revert back to @edx/brand-openedx upon killing dev server.
  2. Document (either in README and/or CLI tool itself) that npm install is necessary to reset to default @edx/brand-openedx.

@PKulkoRaccoonGang
Copy link
Contributor

PR: #2768

@PKulkoRaccoonGang PKulkoRaccoonGang moved this from In progress to In review in Paragon Working Group Nov 1, 2023
@adamstankiewicz
Copy link
Member Author

@PKulkoRaccoonGang I'm curious if you explored option 1 (i.e., "Automatically revert back to @edx/brand-openedx upon killing dev server.")?

@PKulkoRaccoonGang
Copy link
Contributor

@adamstankiewicz Yes, I didn’t spend a lot of time researching this problem, but I tried running npm uninstall ${packageName} through child_process to remove the installed theme from node_modules, but it didn’t work.

@PKulkoRaccoonGang PKulkoRaccoonGang moved this from In review to In progress in Paragon Working Group Nov 16, 2023
@PKulkoRaccoonGang
Copy link
Contributor

@viktorrusakov suggested an implementation using the following command:"start:with-theme": "paragon install-theme && npm start && npm install @edx/brand".

@PKulkoRaccoonGang PKulkoRaccoonGang moved this from In progress to Done in Paragon Working Group Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended
Projects
Status: Done
Development

No branches or pull requests

3 participants