fix(pkg/techdocs): correct dirtyreload arg for mkdocs

Also correct array-like elements for rest operator

Signed-off-by: hainenber <dotronghai96@gmail.com>
This commit is contained in:
hainenber
2023-11-21 22:37:02 +07:00
parent 69b2f7bf3b
commit 716dd37404
6 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@techdocs/cli': minor
---
support passing additional mkdocs-server CLI parameters when run in containerized mode
support passing additional mkdocs-server CLI parameters (--dirtyreload, --strict and --clean) when run in containerized mode
+1 -1
View File
@@ -92,7 +92,7 @@ Options:
(can be added multiple times).
--no-docker Do not use Docker, use MkDocs executable in current user environment.
--mkdocs-parameter-clean Pass "--clean" parameter to mkdocs server running in containerized environment.
--mkdocs-parameter-dirty Pass "--dirty" parameter to mkdocs server running in containerized environment.
--mkdocs-parameter-dirtyreload Pass "--dirtyreload" parameter to mkdocs server running in containerized environment.
--mkdocs-parameter-strict Pass "--strict" parameter to mkdocs server running in containerized environment.
--mkdocs-port <PORT> Port for MkDocs server to use (default: "8000")
--preview-app-bundle-path <PATH_TO_BUNDLE> Preview documentation using a web app other than the included one.
+1 -1
View File
@@ -108,7 +108,7 @@ Options:
--preview-app-port <PORT>
-c, --mkdocs-config-file-name <FILENAME>
--mkdocs-parameter-clean
--mkdocs-parameter-dirty
--mkdocs-parameter-dirtyreload
--mkdocs-parameter-strict
-h, --help
```
+2 -2
View File
@@ -295,8 +295,8 @@ export function registerCommands(program: Command) {
false,
)
.option(
'--mkdocs-parameter-dirty',
'Pass "--dirty" parameter to mkdocs server running in containerized environment',
'--mkdocs-parameter-dirtyreload',
'Pass "--dirtyreload" parameter to mkdocs server running in containerized environment',
false,
)
.option(
@@ -117,7 +117,7 @@ export default async function serve(opts: OptionValues) {
stderrLogFunc: mkdocsLogFunc,
mkdocsConfigFileName: mkdocsYmlPath,
mkdocsParameterClean: opts.mkdocsParameterClean,
mkdocsParameterDirty: opts.mkdocsParameterDirty,
mkdocsParameterDirtyReload: opts.mkdocsParameterDirtyReload,
mkdocsParameterStrict: opts.mkdocsParameterStrict,
});
@@ -27,7 +27,7 @@ export const runMkdocsServer = async (options: {
stderrLogFunc?: LogFunc;
mkdocsConfigFileName?: string;
mkdocsParameterClean?: boolean;
mkdocsParameterDirty?: boolean;
mkdocsParameterDirtyReload?: boolean;
mkdocsParameterStrict?: boolean;
}): Promise<ChildProcess> => {
const port = options.port ?? '8000';
@@ -58,9 +58,9 @@ export const runMkdocsServer = async (options: {
...(options.mkdocsConfigFileName
? ['--config-file', options.mkdocsConfigFileName]
: []),
...(options.mkdocsParameterClean ? '--clean' : []),
...(options.mkdocsParameterDirty ? '--dirty' : []),
...(options.mkdocsParameterStrict ? '--strict' : []),
...(options.mkdocsParameterClean ? ['--clean'] : []),
...(options.mkdocsParameterDirtyReload ? ['--dirty'] : []),
...(options.mkdocsParameterStrict ? ['--strict'] : []),
],
{
stdoutLogFunc: options.stdoutLogFunc,
@@ -78,9 +78,9 @@ export const runMkdocsServer = async (options: {
...(options.mkdocsConfigFileName
? ['--config-file', options.mkdocsConfigFileName]
: []),
...(options.mkdocsParameterClean ? '--clean' : []),
...(options.mkdocsParameterDirty ? '--dirty' : []),
...(options.mkdocsParameterStrict ? '--strict' : []),
...(options.mkdocsParameterClean ? ['--clean'] : []),
...(options.mkdocsParameterDirtyReload ? ['--dirtyreload'] : []),
...(options.mkdocsParameterStrict ? ['--strict'] : []),
],
{
stdoutLogFunc: options.stdoutLogFunc,