Skip to content

Commit 654fa04

Browse files
authored
Merge pull request #34 from funbox/improvement-cli-flags
Use full-length definitions for some CLI flags
2 parents 025d2a3 + 7d40939 commit 654fa04

File tree

9 files changed

+98
-28
lines changed

9 files changed

+98
-28
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 6.0.0 (06.06.2023)
4+
5+
Dropped support for Node.js 12.
6+
7+
Also removed one-letter definitions of some CLI flags.
8+
9+
Check the [migration guide](./MIGRATION.md) for details.
10+
311
## 5.4.2 (27.05.2023)
412

513
Restored lost `trim` in stringify function.

CHANGELOG.ru.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# История изменений проекта
22

3+
## 6.0.0 (06.06.2023)
4+
5+
Node.js 12 больше не поддерживается.
6+
7+
Также убраны однобуквенные сокращения для некоторых CLI-флагов.
8+
9+
См. [гайд по миграции](./MIGRATION.ru.md).
10+
11+
312
## 5.4.2 (27.05.2023)
413

514
Вернули обратно применение `trim` в функции stringify.

MIGRATION.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Migration
22

3+
## 5.4.2 → 6.0.0
4+
5+
We've dropped support for Node.js 12.
6+
The project probably still works on it, because we have not changed anything in the code. But be careful.
7+
8+
We removed one-letter definitions for the next CLI flags: `-S (--strict)`, `-c (--css)`, `-f (--favicon)`, `-l (--locale)`.
9+
If you've been using any of the above-mentioned options, you should replace `-S` with `--strict`, `-c` with `--css` and so on.
10+
11+
312
## 4.17.1 → 5.0.0
413

514
Nothing changed. We just moved the package to the new scope — `@funboxteam`.
@@ -9,12 +18,12 @@ Nothing changed. We just moved the package to the new scope — `@funboxteam`.
918

1019
Complete refactoring of imports. If some data structure to be used in a file, you now need to import it explicitly in that file.
1120

12-
Changes in attributes example description. If an example should contain multiple values, don't add backticks (`):
21+
Changes in attributes example description. If an example should contain multiple values, don't add backticks:
1322

1423
```
1524
+ Attributes
16-
+ foo: 1,2,3 (array[number])
17-
+ bar: `single value` (string)
25+
+ foo: 1,2,3 (array[number]) - no bacticks around multiple values
26+
+ bar: `single value` (string) - backticks around single example value
1827
```
1928

2029
## 3.38.0 → 3.39.0

MIGRATION.ru.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Гайд по миграции
2+
3+
## 5.4.2 → 6.0.0
4+
5+
Node.js 12 более не поддерживается.
6+
7+
Тем не менее проект, скорее всего, до сих пор работает на этой версии,
8+
поскольку никаких ломающих поддержку изменений в код не было внесено.
9+
10+
Убраны однобуквенные обозначения для следующих CLI-флагов: `-S (--strict)`, `-c (--css)`, `-f (--favicon)`, `-l (--locale)`.
11+
Если вы используете для запуска один из этих флагов, то нужно заменить `-S` на `--strict`, `-c` на `--css` и так далее.
12+
13+
14+
## 4.17.1 → 5.0.0
15+
16+
Ничего не поменялось, мы просто переехали на новый npm-скоуп — `@funboxteam`.
17+
18+
19+
## 3.53.0 → 4.0.0
20+
21+
Complete refactoring of imports. If some data structure to be used in a file, you now need to import it explicitly in that file.
22+
Полностью переработана система импортов. Если какая-либо структура данных используется в файле, её нужно явно импортировать
23+
в этот файл.
24+
25+
Изменения в описании примеров значения атрибута. Если пример должен содержать несколько значений, не нужно добавлять
26+
бэктики:
27+
28+
```
29+
+ Attributes
30+
+ foo: 1,2,3 (array[number]) - для нескольких значений бэктики не используются
31+
+ bar: `single value` (string) - пример с одним значением, заключенным в бэктики
32+
```
33+
34+
## 3.38.0 → 3.39.0
35+
36+
Секция `+ Parameters` должна быть определена на одном уровне с секцией `+ Request`.
37+
38+
Для секции `+ Attributes` теперь не нужно указывать атрибут `required`.
39+
40+
## 3.34.0 → 3.35.0
41+
42+
Если в документации содержится секция со словом _Default_ в названии (например, default Resource Prototype), её нужно
43+
переименовать, поскольку Crafter теперь использует ключевое слово _Default_ для задания дефолтных значений именованных
44+
типов, начиная с версии 1.65.0.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ Add the next commands in `package.json`:
6666

6767
- `-i, --input <file>` — sets the source APIB file to render.
6868
- `-o, --output <file>` — sets the name of the output HTML file.
69-
- `-S, --strict` — enables parsing "strict" mode in which any warning will cause build error.
7069
- `-s, --server` — activates live server mode.
7170
- `-h, --host <host>` — sets live server host. Default value is `127.0.0.1`.
7271
- `-p, --port <port>` — sets live server port. Default value is `3000`.
73-
- `-c, --css <file>` — allows to specify path to a custom CSS file. Styles from this files will be attached to page.
72+
- `--strict` — enables parsing "strict" mode in which any warning will cause build error.
73+
- `--css <file>` — allows to specify path to a custom CSS file. Styles from this files will be attached to page.
7474
Any possible compatibility issues between relevant Blueprinter version and a custom CSS file remain on the conscience of the file developer.
75-
- `-l, --locale <locale>` — sets a locale to be used as UI language. Default value is `en`. Available locales are `en`, `ru`.
76-
- `-f, --favicon <file>` — allows to specify path to a custom favicon. Applicable only in build mode, not in dev mode. Accepts only PNG files.
75+
- `--locale <locale>` — sets a locale to be used as UI language. Default value is `en`. Available locales are `en`, `ru`.
76+
- `--favicon <file>` — allows to specify path to a custom favicon. Applicable only in build mode, not in dev mode. Accepts only PNG files.
7777

7878
## Run in Docker
7979

README.ru.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ npm install --save @funboxteam/blueprinter
6565

6666
- `-i, --input <file>` — задаёт исходный APIB-файл, который нужно отрендерить.
6767
- `-o, --output <file>` — задаёт название конечного HTML-файла.
68-
- `-S, --strict` — включает «строгий» режим парсинга, в котором любое предупреждение приведёт к ошибке сборки.
6968
- `-s, --server` — активирует режим live-сервера.
7069
- `-h, --host <host>` — задаёт адрес локального live-сервера. По умолчанию `127.0.0.1`.
7170
- `-p, --port <port>` — задаёт порт локального live-сервера. По умолчанию `3000`.
72-
- `-c, --css <file>` — позволяет указать путь к кастомному CSS-файлу, стили из которого будут подключены на странице.
71+
- `--strict` — включает «строгий» режим парсинга, в котором любое предупреждение приведёт к ошибке сборки.
72+
- `--css <file>` — позволяет указать путь к кастомному CSS-файлу, стили из которого будут подключены на странице.
7373
Любые проблемы совместимости актуальной версии Blueprinter и кастомного CSS-файла остаются на совести разработчика файла.
74-
- `-l, --locale <locale>` — задаёт язык интерфейса конечного HTML. По умолчанию `en`. Возможные варианты: `en`, `ru`.
75-
- `-f, --favicon <file>` — позволяет указать путь к кастомной фавиконке. Фавиконка применяется только в режиме сборки и
74+
- `--locale <locale>` — задаёт язык интерфейса конечного HTML. По умолчанию `en`. Возможные варианты: `en`, `ru`.
75+
- `--favicon <file>` — позволяет указать путь к кастомной фавиконке. Фавиконка применяется только в режиме сборки и
7676
не учитывается при запуске dev-сервера. Разрешены только файлы в формате PNG.
7777

7878
## Использование через Docker

bin/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ argsParser
1010
.example('$0 -i example.apib -s', 'Start live server')
1111
.options('i', { alias: 'input', describe: 'Input file' })
1212
.options('o', { alias: 'output', describe: 'Output file' })
13-
.options('S', { alias: 'strict', describe: 'Strict mode' })
1413
.options('s', { alias: 'server', describe: 'Start a local live preview server' })
1514
.options('h', { alias: 'host', describe: 'Address to bind local preview server to', default: '127.0.0.1' })
1615
.options('p', { alias: 'port', describe: 'Port for local preview server', default: 3001 })
17-
.options('c', { alias: 'css', describe: 'Custom CSS file' })
18-
.options('f', { alias: 'favicon', describe: 'Custom favicon' })
19-
.options('l', { alias: 'locale', describe: 'Set locale', default: 'en', choices: ['ru', 'en'] });
16+
.options('strict', { describe: 'Strict mode' })
17+
.options('css', { describe: 'Custom CSS file' })
18+
.options('favicon', { describe: 'Custom favicon' })
19+
.options('locale', { describe: 'Set locale', default: 'en', choices: ['ru', 'en'] });
2020

2121
const argv = argsParser.argv;
2222

@@ -34,15 +34,15 @@ const argvError = () => {
3434
process.exit(1);
3535
};
3636

37-
if (argv.s) {
38-
if (!argv.i) argvError();
37+
if (argv.server) {
38+
if (!argv.input) argvError();
3939

40-
renderAndServe(argv.i, argv.c, argv.p, argv.h, argv.l)
40+
renderAndServe(argv.input, argv.css, argv.port, argv.host, argv.locale)
4141
.catch(error => exit(error));
4242
} else {
43-
if (!argv.i || !argv.o) argvError();
43+
if (!argv.input || !argv.output) argvError();
4444

45-
renderAndBuild(argv.i, argv.c, argv.f, argv.o, argv.l, argv.S)
45+
renderAndBuild(argv.input, argv.css, argv.favicon, argv.output, argv.locale, argv.strict)
4646
.then(() => exit())
4747
.catch(error => exit(error));
4848
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@funboxteam/blueprinter",
3-
"version": "5.4.2",
3+
"version": "6.0.0",
44
"description": "Replacement of Aglio library for rendering generated AST as HTML page.",
55
"repository": {
66
"type": "git",
@@ -36,7 +36,7 @@
3636
"compile": "lingui compile"
3737
},
3838
"dependencies": {
39-
"@funboxteam/crafter": "5.0.1",
39+
"@funboxteam/crafter": "6.0.0",
4040
"@funboxteam/free-port-finder": "3.1.1",
4141
"browser-sync": "2.28.1",
4242
"commonmark": "0.30.0",

0 commit comments

Comments
 (0)