Proposed command line interface design for v1.0.0 #76
Replies: 17 comments
-
Thanks! I also would review this and get back to you. |
Beta Was this translation helpful? Give feedback.
-
@JinIgarashi |
Beta Was this translation helpful? Give feedback.
-
Based on the idea of @JinIgarashi , I write a sub-sub command design. What do you think about it? OverviewOverview of command design.
charites initCreate charites project files for create map style. ( Options
charites importcreate charites project files from exist Options
Then we will get the same result of charites serveOptions
charites style
|
Beta Was this translation helpful? Give feedback.
-
in addition to command design in previous comment, I propose the @ubukawa @hfu @JinIgarashi @miya0001 What do you think about this draft design? project-directory/
├── style.yml - root style file
├── config.yml - configuration file to manage all folder paths and necessary settings for producing style.json
├── layers/ - style.yml for layers
├── icons/ - original SVG icons folder for sprite
├── fonts/ - original font files folder for glyphs.
└── build/ - folder for the files that ready to deploy.
├── style.json
├── icons.json
├── icons.png
├── icons@2x.json
├── icons@2x.png
└── glyphs files(.pbf?) - sorry I need research what type of file used for glyphs.
version: version of charites used
serve:
port: 8080
style:
build:
yaml-path: ./style.yml
json-path: ./build/style.json
compact-output: false
sprite:
build:
icons-folder: ./icons
sprite-folder: ./build
name: icons
glyphs:
build:
fonts-folder: ./fonts
glyphs-folder: ./build |
Beta Was this translation helpful? Give feedback.
-
@naogify I think it is a good idea to have glyphs require to create I suggest to use different folder name (eg., So, version: version of charites used
serve:
port: 8080
style:
build:
yaml-path: ./style.yml
- json-path: ./build/style.json
+ json-path: ./public/style.json
compact-output: false
sprite:
build:
icons-folder: ./icons
- sprite-folder: ./build
+ sprite-folder: ./public/sprite
name: icons
glyphs:
build:
fonts-folder: ./fonts
- glyphs-folder: ./build
+ glyphs-folder: ./public/glyphs However, I don't think all users require to build their own glyphs. So it is worth to have another option like |
Beta Was this translation helpful? Give feedback.
-
For creating sprite, it might be useful if multiple icons folders (eg., charites also can have a command to download all maki icons to local folder. It can be helpful. |
Beta Was this translation helpful? Give feedback.
-
Thank you, @JinIgarashi and @naogify for great ideas. LGTM. Regarding sprites, are we using file names of the .svg files as the name of the sprite? We might want to think about airport: https://example.com/somewhere/airport.svg
branch: ./icons/gsi-icon.svg I think |
Beta Was this translation helpful? Give feedback.
-
Thank you @JinIgarashi and @naogify for your great efforts! I have one question.
Or, you would recommend that I should work at the different project directories for different styles. Thank you for your advice and great effort!! |
Beta Was this translation helpful? Give feedback.
-
If I may, can I ask one more thing? I also wonder if it is possible to add "charites --version" command? It would be nice to know the version given that the command line interface design may change. P.S. |
Beta Was this translation helpful? Give feedback.
-
@JinIgarashi I think it's good to use
Also, this idea is looks good me. |
Beta Was this translation helpful? Give feedback.
-
I think charites can use svg file name as icon name in style.yml as default because that can be simpler. But it might be good idea to give different icon name from original. I think UNVT is implementing this feature in @ubukawa If there is no target directory like below, charites import and create new project under current directory.
If project directory is specified as below, charites will import and generate new project under targeted directory.
can it work for you? In addition, adding |
Beta Was this translation helpful? Give feedback.
-
@naogify Could you sort out above ideas from @hfu and @ubukawa to update CLI design? Thank you. |
Beta Was this translation helpful? Give feedback.
-
@JinIgarashi |
Beta Was this translation helpful? Give feedback.
-
Dear @JinIgarashi and @naogify , thank you for your great advice and contribution! |
Beta Was this translation helpful? Give feedback.
-
@JinIgarashi |
Beta Was this translation helpful? Give feedback.
-
@naogify @miya0001 @ubukawa @hfu Let us continue discussing new CLI interface for v1.0.0 here. |
Beta Was this translation helpful? Give feedback.
-
@naogify @miya0001 charites v1.0.0に向けて、developブランチを作成しました。 |
Beta Was this translation helpful? Give feedback.
-
I am thinking how charites can provide better experience of style making to users.
Thus, I thought some idea of new command line interface design.
Currently, there are a lot of options for each commands, I don't think it is user friendly, especially for Mapbox style beginners. I was trying to simplify command line interface by introducing configuration files instead of adding many optional parameters.
I just put them on this issue to discuss for better command line interface design.
@ubukawa @hfu @miya0001 @naogify What do you think about this draft design?
First,
charites init
command will create a charites project under <project_dir> as follows.config.yml
can have following settings.style.json
file from project'sconfig.yaml
You can move to project directory and just run
charites build
orcharites build config.yaml
to convert yaml tostyle.json
and sprite files.When charites build sprite files, it will create them which are used in
style.yaml
files.After entering project directory, just run
charites serve
, it will automatically launch server withhttp://localhost:8080
.If you run command like below with project folder path, it will create
style.yaml
andconfig.yaml
in specified project folder. All of settings can be stored under a folder.Current sprite generate is to make sprite files from all icons under a specific folder. This function can be moved to independent command like below.
This command is useful if all style including icons was already configured. However, user have to edit sprite file path in
config.yml
after making sprite by this commandIn the future, we may create a command to build glyph from font file.
Beta Was this translation helpful? Give feedback.
All reactions