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

Allow customizing CLI colors through .gulprc file #63

Closed
sttk opened this issue Feb 28, 2016 · 10 comments · Fixed by #260
Closed

Allow customizing CLI colors through .gulprc file #63

sttk opened this issue Feb 28, 2016 · 10 comments · Fixed by #260

Comments

@sttk
Copy link
Contributor

sttk commented Feb 28, 2016

I've added customizing mechanism in gulp-cli.
And also I've made colors of a task tree customizable with this.

sttk/gulp-cli#make_customizable

  • You can change the colors by .gulprc files in user home directory or project working directory.
  • You can also change the colors with a file specified by --customize option.
  • You can see a list of customizable settings by --customize option which has no value.
@phated
Copy link
Member

phated commented Mar 3, 2016

@sttk The first thing that I'd like to address is the .gulprc file. I am all for having it, but I think we need it implemented over in Liftoff (which has been discussed before) - Check out the issue at gulpjs/liftoff#8 and maybe you'd be interested in implementing the rc lookup over there before submitting this PR to gulp-cli.

@sttk
Copy link
Contributor Author

sttk commented Mar 4, 2016

@phated OK. I'll see the issue and Liftoff. And I'll try it if I can.

@phated phated changed the title Add customizing mechanism Allow customizing CLI colors through .gulprc file Apr 5, 2016
@phated
Copy link
Member

phated commented Apr 5, 2016

Changed the title here. Also split the .gulprc file to issue #69

@phated
Copy link
Member

phated commented Dec 21, 2017

Random ideas for theming (so they are documented somewhere):

// regexp? HIGHLIGHT: (.*)

log.withTheme()

log('Write some text and {HIGHLIGHT: The Thing}', theme)

log('{ERROR: Failed to load external module} {HLIGHT: {NAME}}', {NAME: name})

log('{ERROR}Failed to load external module{/ERROR} {HIGHLIGHT}' + name + '{/HIGHLIGHT}')

log.info('Using gulpfile {HIGHLIGHT: %s}', tildify(env.configPath));

@sttk
Copy link
Contributor Author

sttk commented Jan 8, 2018

@phated I've created a package theming-log to manage text decoration of logging with themes on the trial basis.

This package is still a prototype and would be needed to add some functions (for example, printf-style variables).

Can you have a look whether it fits your idea?

@phated
Copy link
Member

phated commented Jan 8, 2018

@sttk I didn't review the whole project, but I like what I see in the documentation. It touches on a lot of the ideas I had but I'd want to see how it is used for this project.

When I was working on ideas, I was trying to avoid a factory function because we don't have themes loaded from the config files before we start logging (e.g. gulp --help, etc)

@sttk
Copy link
Contributor Author

sttk commented Jan 9, 2018

@phated Thank you for having a look, and I'm glad you like it.

About the way to using theming-log for this package, most of logs in gulp-cli/index.js, including the help message, would be ok in the normal way because they are outputted after loading the config files, but for adding themes to the help message it may be needed to overide some methods of yargs.

Since logs for require and requireFail events are called before loading the config files, they would be needed to think out.

About logs in other modules, I think it is possible by overriding methods of gulplog (or a similar new
logger which is a singleton) with log functions created by theming-log.

@phated
Copy link
Member

phated commented Jan 9, 2018

Yeah, I was running into color issues on --help and require/requireFail since we don't configure the theme until after.

I thought maybe the config loading would have to be merged into the CLI code but that doesn't work if Liftoff is being used to find the cwd and stuff.

@phated
Copy link
Member

phated commented Apr 20, 2019

We might as well land this in the next major as well. Moving to the 3.0 milestone.

@phated phated modified the milestones: 2.x, 3.0 Apr 20, 2019
@sttk
Copy link
Contributor Author

sttk commented Apr 21, 2019

I'll address this after fixing the issues of flags.cwd (# 109) and initial cwd (# 146 and # 154).

@phated phated removed this from TODO in v4 Apr 28, 2020
@phated phated added this to To do in v5 Apr 28, 2020
v5 automation moved this from To do to Done Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v5
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants