From e263059fa76f764e435743cb8581fbd83f5f50c6 Mon Sep 17 00:00:00 2001 From: Karan Yadav Date: Sun, 6 Apr 2025 12:21:54 +0000 Subject: [PATCH] fix(build): add new make rule to build docs Add the rule to avoid hitting shell limits. Fixes: #6583 Private-ref: https://github.com/stdlib-js/stdlib/issues/6583 --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .gitignore | 1 + tools/make/README.md | 8 +++++++- tools/make/lib/docs/jsdoc.mk | 12 ++++++++++++ tools/make/lib/docs/src.mk | 17 +++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 16b03f7702dd..87b60fb960bb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ ######### package.json.copy .stdlibrc +sources.txt # Directories # ############### diff --git a/tools/make/README.md b/tools/make/README.md index a2b918d0eeea..3bc1b1ab63f1 100644 --- a/tools/make/README.md +++ b/tools/make/README.md @@ -22,7 +22,7 @@ limitations under the License. > Development utility. -This project uses [`make`][make] as its development utility. For an overview of `make`, see the `make` [manual][make]. +This project uses [`make`][make] as its development utility. For an overview of `make`, see the `make` [manual][make]. ## Usage @@ -405,6 +405,12 @@ To generate documentation from [JSDoc][jsdoc] source code comments, $ make docs-src ``` +sometimes you might get an error `Argument listing too long` then use, + +```bash +$ make src-docs-out +``` + To view the documentation in a local web browser, ```bash diff --git a/tools/make/lib/docs/jsdoc.mk b/tools/make/lib/docs/jsdoc.mk index 3e5374302944..71bbb730cc7d 100644 --- a/tools/make/lib/docs/jsdoc.mk +++ b/tools/make/lib/docs/jsdoc.mk @@ -85,6 +85,18 @@ jsdoc-html: $(NODE_MODULES) .PHONY: jsdoc-html +# Generate JSDoc HTML documentation. +# +# See issue #6583 + +jsdoc-html-out: $(NODE_MODULES) + $(QUIET) $(DELETE) $(DELETE_FLAGS) $(JSDOC_HTML_OUT) + $(QUIET) $(MKDIR_RECURSIVE) $(JSDOC_HTML_OUT) + $(QUIET) find . -type f -name "$(SOURCES_PATTERN)" > sources.txt + $(QUIET) cat sources.txt | xargs $(JSDOC) $(JSDOC_HTML_FLAGS) $(JSDOC_TYPEDEF) + +.PHONY: jsdoc-html-out + # Generate JSDoc JSON. # diff --git a/tools/make/lib/docs/src.mk b/tools/make/lib/docs/src.mk index 84e5ba20f65d..f50cb92d96b0 100644 --- a/tools/make/lib/docs/src.mk +++ b/tools/make/lib/docs/src.mk @@ -47,6 +47,23 @@ endif .PHONY: src-docs +# Generate source documentation. +# +# use this if you get error +# "Argument Listing too long" +# +# ```bash +# make src-docs-out +# ``` + +src-docs-out: +ifeq ($(SRC_DOC_GENERATOR), jsdoc) + $(QUIET) $(MAKE) -f $(this_file) jsdoc-html-out +endif + +.PHONY: src-docs-out + + # View HTML documentation. # # This target opens source HTML documentation in a local web browser.