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

Config for shower #10

Closed
nikolay-govorov opened this issue Aug 24, 2018 · 9 comments
Closed

Config for shower #10

nikolay-govorov opened this issue Aug 24, 2018 · 9 comments
Assignees
Labels
feature New feature or request

Comments

@nikolay-govorov
Copy link

Since version 2.0 the main functions are implemented: create, archive, prepare, save, publish and pdf. Each of these functions can be configured, for example, for prepare, you can specify the folder in which the project will be built and for pdf file name. Now these parameters are set by default and can be overridden by flags. But it's not flexible enough. What if I want a pdf file always called best_press.pdf or rename index.html in presentation.html?

The second problem is that some functionality is not needed by everyone, but would be useful in the form of plugins, such as code highlighting

I propose to look at the solution from webpack@4 and implement a configuration file for presentations, as shower.config.js. In order not to overcomplicate projects, if the config is not set, the default settings will be used, but if additional features are required, the user can flexibly configure the project.

@nikolay-govorov nikolay-govorov added the feature New feature or request label Aug 24, 2018
@nikolay-govorov
Copy link
Author

By the way, if we want to implement the creation of themes, the config will help to determine what we are working with

@nikolay-govorov nikolay-govorov assigned avdeev and unassigned avdeev Aug 25, 2018
@pepelsbey
Copy link
Member

pepelsbey commented Aug 25, 2018

I always thought that configs are not the best UI. Especially for Shower where the number of options is pretty limited. Theme and ratio? That’s just not worth it. Have you tried np package? I use it for publishing npm packages. I’d rather use something like this where utility asks you some questions instead of flags or configs.

shower create
theme: ribbon, material
ratio: 16:9, 4:3
done

It looks so much easier than having (another) extra file in your folder or specifying flags.

@nikolay-govorov
Copy link
Author

Yes, I agree that it is not necessary to complicate infrastructure. Talking about the stages of build, like publish, prepare, archive. These tasks have parameters that can be configured, but they hardly change.

I have an example. Now you are ready to remove the build from the main repository and completely replace it with the CLI. The problem is that I don't know how to specify the list of files that should be in the prepare folder. Now I look in the files field in the package.json, but in the current version of the list of files sewn into gulpfile.js and different from what is in the package.json.

I see an optional build configuration file not as a replacement for the current infrastructure, but as an extension of the build capabilities. In my example I would add in a shower.config.js the files field where you would specify a list of these files

@nikolay-govorov
Copy link
Author

Why not make it a flag? Because parameters like files are also needed in other parts of the application, for example 'files' can be used to define what dev server should do

@pepelsbey
Copy link
Member

Instead of configs, I’d rather focus on smart defaults or prompts. It’s always better to follow the user’s needs, not abstract configurability. Let’s follow use cases ;)

BTW, have you seen prompts package?

@nikolay-govorov
Copy link
Author

Now I offer a list of settings as in np, and tried to put down the most convenient default settings. But it's still not always convenient. For example, now for each run of prepare/archive/publish, you must specify a list of files with a flag. I don't think it's very convenient.

prompts is an interesting package, but how can it help?

@avdeev
Copy link
Member

avdeev commented Aug 28, 2018

I think it's too early to think about the config. Config is needed when there are too many settings.

We can try to collect all possible settings and then think about the config. :)

@pepelsbey
Copy link
Member

pepelsbey commented Aug 28, 2018

By smart defaults, I mean relying on the existing folder structure: in shower/shower case and prepare/archive tasks it’s everything, but [config files]. It should cover 90% of cases, for the rest 8% flags will work better, 2% of cases might be better with config. But I’d cover and test 98% first, instead of focusing on 2%.

@nikolay-govorov
Copy link
Author

Decided what to do the config is overkill

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

No branches or pull requests

3 participants