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

Re-apply fix for chalk template #411

Open
ben-eb opened this issue Oct 3, 2022 · 0 comments
Open

Re-apply fix for chalk template #411

ben-eb opened this issue Oct 3, 2022 · 0 comments

Comments

@ben-eb
Copy link

ben-eb commented Oct 3, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

#335 introduced a fix for chalk.template that I think was overwritten in error by 6c43f26. Applying the below patch will restore the template support but a better solution would be to modify the TypeScript source code so future regressions are prevented.

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/hygen/dist/logger.js b/node_modules/hygen/dist/logger.js
index 312f112..036c45d 100644
--- a/node_modules/hygen/dist/logger.js
+++ b/node_modules/hygen/dist/logger.js
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
 Object.defineProperty(exports, "__esModule", { value: true });
 const chalk_1 = __importDefault(require("chalk"));
 // chalk 4.1.2 doesn't type template property
-const { yellow, red, green, magenta, template } = chalk_1.default;
+const { yellow, red, green, magenta } = chalk_1.default;
+const template = require('chalk/source/templates');
 class Logger {
     constructor(log) {
         this.log = log;

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant