From 489a9122267d96d44143fa416054e6b7c6b3ca11 Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Sat, 8 Feb 2025 09:20:07 +0000 Subject: [PATCH 01/26] refactor!: move presentation into the `cli` namespace Signed-off-by: Snehil Shah --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: passed - 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 --- --- .../@stdlib/repl/{ => cli}/presentation/README.md | 2 +- .../@stdlib/repl/{ => cli}/presentation/bin/cli | 0 .../@stdlib/repl/{ => cli}/presentation/data/example.csv | 0 .../@stdlib/repl/{ => cli}/presentation/data/example.json | 0 .../@stdlib/repl/{ => cli}/presentation/data/help.csv | 0 .../@stdlib/repl/{ => cli}/presentation/data/help.json | 0 .../@stdlib/repl/{ => cli}/presentation/data/info.csv | 0 .../@stdlib/repl/{ => cli}/presentation/data/info.json | 0 .../repl/{ => cli}/presentation/docs/commands/blank.txt | 0 .../{ => cli}/presentation/docs/commands/current_slide.txt | 0 .../repl/{ => cli}/presentation/docs/commands/end.txt | 0 .../repl/{ => cli}/presentation/docs/commands/first.txt | 0 .../{ => cli}/presentation/docs/commands/first_fragment.txt | 0 .../repl/{ => cli}/presentation/docs/commands/jump.txt | 0 .../repl/{ => cli}/presentation/docs/commands/jump_to.txt | 0 .../repl/{ => cli}/presentation/docs/commands/last.txt | 0 .../{ => cli}/presentation/docs/commands/last_fragment.txt | 0 .../presentation/docs/commands/load_presentation.txt | 0 .../repl/{ => cli}/presentation/docs/commands/next.txt | 0 .../{ => cli}/presentation/docs/commands/next_slide.txt | 0 .../{ => cli}/presentation/docs/commands/num_slides.txt | 0 .../repl/{ => cli}/presentation/docs/commands/pres.txt | 0 .../repl/{ => cli}/presentation/docs/commands/prev.txt | 0 .../{ => cli}/presentation/docs/commands/prev_slide.txt | 0 .../repl/{ => cli}/presentation/docs/commands/redraw.txt | 0 .../presentation/docs/commands/reload_presentation.txt | 0 .../{ => cli}/presentation/docs/commands/render_slide.txt | 0 .../repl/{ => cli}/presentation/docs/commands/run_slide.txt | 0 .../repl/{ => cli}/presentation/docs/commands/unwatch.txt | 0 .../repl/{ => cli}/presentation/docs/commands/watch.txt | 0 .../@stdlib/repl/{ => cli}/presentation/docs/usage.txt | 0 .../@stdlib/repl/{ => cli}/presentation/etc/cli_opts.json | 0 .../repl/{ => cli}/presentation/examples/presentation.txt | 0 .../@stdlib/repl/{ => cli}/presentation/lib/align_center.js | 0 .../repl/{ => cli}/presentation/lib/align_flush_left.js | 0 .../repl/{ => cli}/presentation/lib/align_flush_right.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/align_left.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/align_line.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/align_right.js | 0 .../repl/{ => cli}/presentation/lib/ansi_escape_code.js | 0 .../repl/{ => cli}/presentation/lib/ansi_escape_codes.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/blank_line.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/commands.js | 0 .../repl/{ => cli}/presentation/lib/commands/blank.js | 0 .../{ => cli}/presentation/lib/commands/current_slide.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/commands/end.js | 0 .../repl/{ => cli}/presentation/lib/commands/first.js | 0 .../{ => cli}/presentation/lib/commands/first_fragment.js | 0 .../repl/{ => cli}/presentation/lib/commands/jump.js | 0 .../repl/{ => cli}/presentation/lib/commands/jump_to.js | 0 .../repl/{ => cli}/presentation/lib/commands/last.js | 0 .../{ => cli}/presentation/lib/commands/last_fragment.js | 0 .../presentation/lib/commands/load_presentation.js | 0 .../repl/{ => cli}/presentation/lib/commands/next.js | 0 .../repl/{ => cli}/presentation/lib/commands/next_slide.js | 0 .../repl/{ => cli}/presentation/lib/commands/num_slides.js | 0 .../repl/{ => cli}/presentation/lib/commands/pres.js | 0 .../repl/{ => cli}/presentation/lib/commands/prev.js | 0 .../repl/{ => cli}/presentation/lib/commands/prev_slide.js | 0 .../repl/{ => cli}/presentation/lib/commands/redraw.js | 0 .../presentation/lib/commands/reload_presentation.js | 0 .../{ => cli}/presentation/lib/commands/render_slide.js | 0 .../repl/{ => cli}/presentation/lib/commands/run_slide.js | 0 .../repl/{ => cli}/presentation/lib/commands/unwatch.js | 0 .../repl/{ => cli}/presentation/lib/commands/watch.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/defaults.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/docs.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/emoji.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/fill_line.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/footer.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/format.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/help_text.js | 0 .../repl/{ => cli}/presentation/lib/horizontal_rule.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/index.js | 6 +++--- .../@stdlib/repl/{ => cli}/presentation/lib/main.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/parse.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/parse_slide.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/set_commands.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/style_line.js | 0 .../repl/{ => cli}/presentation/lib/style_to_ansi.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/styles.js | 0 .../@stdlib/repl/{ => cli}/presentation/lib/validate.js | 0 .../@stdlib/repl/{ => cli}/presentation/package.json | 2 +- .../@stdlib/repl/{ => cli}/presentation/scripts/build.js | 0 84 files changed, 5 insertions(+), 5 deletions(-) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/README.md (99%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/bin/cli (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/example.csv (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/example.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/help.csv (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/help.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/info.csv (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/data/info.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/blank.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/current_slide.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/end.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/first.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/first_fragment.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/jump.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/jump_to.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/last.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/last_fragment.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/load_presentation.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/next.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/next_slide.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/num_slides.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/pres.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/prev.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/prev_slide.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/redraw.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/reload_presentation.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/render_slide.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/run_slide.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/unwatch.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/commands/watch.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/docs/usage.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/etc/cli_opts.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/examples/presentation.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_center.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_flush_left.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_flush_right.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_left.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_line.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/align_right.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/ansi_escape_code.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/ansi_escape_codes.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/blank_line.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/blank.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/current_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/end.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/first.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/first_fragment.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/jump.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/jump_to.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/last.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/last_fragment.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/load_presentation.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/next.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/next_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/num_slides.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/pres.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/prev.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/prev_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/redraw.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/reload_presentation.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/render_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/run_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/unwatch.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/commands/watch.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/defaults.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/docs.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/emoji.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/fill_line.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/footer.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/format.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/help_text.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/horizontal_rule.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/index.js (88%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/main.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/parse.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/parse_slide.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/set_commands.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/style_line.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/style_to_ansi.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/styles.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/lib/validate.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/package.json (97%) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/scripts/build.js (100%) diff --git a/lib/node_modules/@stdlib/repl/presentation/README.md b/lib/node_modules/@stdlib/repl/cli/presentation/README.md similarity index 99% rename from lib/node_modules/@stdlib/repl/presentation/README.md rename to lib/node_modules/@stdlib/repl/cli/presentation/README.md index d89fb3627258..d27fc703d301 100644 --- a/lib/node_modules/@stdlib/repl/presentation/README.md +++ b/lib/node_modules/@stdlib/repl/cli/presentation/README.md @@ -46,7 +46,7 @@ This package allows building presentations using only a [REPL][@stdlib/repl] env ### Authoring -A [REPL][@stdlib/repl] presentation source file is a text file which includes minimal markup for delineating slides, slide fragments, speaker notes, code, text alignment, and styling. +A [REPL][@stdlib/repl] presentation source file is a text file which includes minimal markup for delineating slides, slide fragments, speaker notes, code, text alignment, and styling. #### Slides diff --git a/lib/node_modules/@stdlib/repl/presentation/bin/cli b/lib/node_modules/@stdlib/repl/cli/presentation/bin/cli similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/bin/cli rename to lib/node_modules/@stdlib/repl/cli/presentation/bin/cli diff --git a/lib/node_modules/@stdlib/repl/presentation/data/example.csv b/lib/node_modules/@stdlib/repl/cli/presentation/data/example.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/example.csv rename to lib/node_modules/@stdlib/repl/cli/presentation/data/example.csv diff --git a/lib/node_modules/@stdlib/repl/presentation/data/example.json b/lib/node_modules/@stdlib/repl/cli/presentation/data/example.json similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/example.json rename to lib/node_modules/@stdlib/repl/cli/presentation/data/example.json diff --git a/lib/node_modules/@stdlib/repl/presentation/data/help.csv b/lib/node_modules/@stdlib/repl/cli/presentation/data/help.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/help.csv rename to lib/node_modules/@stdlib/repl/cli/presentation/data/help.csv diff --git a/lib/node_modules/@stdlib/repl/presentation/data/help.json b/lib/node_modules/@stdlib/repl/cli/presentation/data/help.json similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/help.json rename to lib/node_modules/@stdlib/repl/cli/presentation/data/help.json diff --git a/lib/node_modules/@stdlib/repl/presentation/data/info.csv b/lib/node_modules/@stdlib/repl/cli/presentation/data/info.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/info.csv rename to lib/node_modules/@stdlib/repl/cli/presentation/data/info.csv diff --git a/lib/node_modules/@stdlib/repl/presentation/data/info.json b/lib/node_modules/@stdlib/repl/cli/presentation/data/info.json similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/data/info.json rename to lib/node_modules/@stdlib/repl/cli/presentation/data/info.json diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/blank.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/blank.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/blank.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/blank.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/current_slide.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/current_slide.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/current_slide.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/current_slide.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/end.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/end.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/end.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/end.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/first.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/first.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/first.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/first.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/first_fragment.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/first_fragment.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/first_fragment.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/first_fragment.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/jump.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/jump.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/jump.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/jump.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/jump_to.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/jump_to.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/jump_to.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/jump_to.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/last.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/last.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/last.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/last.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/last_fragment.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/last_fragment.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/last_fragment.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/last_fragment.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/load_presentation.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/load_presentation.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/load_presentation.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/load_presentation.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/next.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/next.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/next.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/next.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/next_slide.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/next_slide.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/next_slide.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/next_slide.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/num_slides.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/num_slides.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/num_slides.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/num_slides.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/pres.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/pres.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/pres.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/pres.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/prev.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/prev.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/prev.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/prev.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/prev_slide.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/prev_slide.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/prev_slide.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/prev_slide.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/redraw.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/redraw.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/redraw.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/redraw.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/reload_presentation.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/reload_presentation.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/reload_presentation.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/reload_presentation.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/render_slide.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/render_slide.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/render_slide.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/render_slide.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/run_slide.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/run_slide.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/run_slide.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/run_slide.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/unwatch.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/unwatch.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/unwatch.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/unwatch.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/commands/watch.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/watch.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/commands/watch.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/commands/watch.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/docs/usage.txt b/lib/node_modules/@stdlib/repl/cli/presentation/docs/usage.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/docs/usage.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/docs/usage.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/etc/cli_opts.json b/lib/node_modules/@stdlib/repl/cli/presentation/etc/cli_opts.json similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/etc/cli_opts.json rename to lib/node_modules/@stdlib/repl/cli/presentation/etc/cli_opts.json diff --git a/lib/node_modules/@stdlib/repl/presentation/examples/presentation.txt b/lib/node_modules/@stdlib/repl/cli/presentation/examples/presentation.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/examples/presentation.txt rename to lib/node_modules/@stdlib/repl/cli/presentation/examples/presentation.txt diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_center.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_center.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_center.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_center.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_flush_left.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_flush_left.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_flush_left.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_flush_left.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_flush_right.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_flush_right.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_flush_right.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_flush_right.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_left.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_left.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_left.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_left.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_line.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_line.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_line.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_line.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/align_right.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/align_right.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/align_right.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/align_right.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/ansi_escape_code.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/ansi_escape_code.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/ansi_escape_code.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/ansi_escape_code.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/ansi_escape_codes.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/ansi_escape_codes.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/ansi_escape_codes.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/ansi_escape_codes.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/blank_line.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/blank_line.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/blank_line.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/blank_line.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/blank.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/blank.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/blank.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/blank.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/current_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/current_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/current_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/current_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/end.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/end.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/end.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/end.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/first.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/first.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/first.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/first.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/first_fragment.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/first_fragment.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/first_fragment.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/first_fragment.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/jump.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/jump.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/jump.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/jump.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/jump_to.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/jump_to.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/jump_to.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/jump_to.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/last.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/last.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/last.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/last.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/last_fragment.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/last_fragment.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/last_fragment.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/last_fragment.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/load_presentation.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/load_presentation.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/load_presentation.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/load_presentation.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/next.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/next.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/next.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/next.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/next_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/next_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/next_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/next_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/num_slides.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/num_slides.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/num_slides.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/num_slides.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/pres.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/pres.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/pres.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/pres.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/prev.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/prev.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/prev.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/prev.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/prev_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/prev_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/prev_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/prev_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/redraw.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/redraw.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/redraw.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/redraw.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/reload_presentation.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/reload_presentation.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/reload_presentation.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/reload_presentation.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/render_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/render_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/render_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/render_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/run_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/run_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/run_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/run_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/unwatch.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/unwatch.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/unwatch.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/unwatch.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/commands/watch.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/watch.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/commands/watch.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/commands/watch.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/defaults.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/defaults.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/defaults.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/defaults.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/docs.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/docs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/docs.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/docs.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/emoji.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/emoji.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/emoji.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/emoji.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/fill_line.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/fill_line.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/fill_line.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/fill_line.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/footer.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/footer.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/footer.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/footer.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/format.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/format.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/format.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/format.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/help_text.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/help_text.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/help_text.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/help_text.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/horizontal_rule.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/horizontal_rule.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/horizontal_rule.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/horizontal_rule.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/index.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/index.js similarity index 88% rename from lib/node_modules/@stdlib/repl/presentation/lib/index.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/index.js index 73364031e9fb..00c58c9544eb 100644 --- a/lib/node_modules/@stdlib/repl/presentation/lib/index.js +++ b/lib/node_modules/@stdlib/repl/cli/presentation/lib/index.js @@ -21,12 +21,12 @@ /** * REPL presentation. * -* @module @stdlib/repl/presentation +* @module @stdlib/repl/cli/presentation * * @example * var debug = require( '@stdlib/streams/node/debug-sink' ); -* var REPL = require( '@stdlib/repl' ); -* var Presentation = require( '@stdlib/repl/presentation' ); +* var REPL = require( '@stdlib/repl/cli' ); +* var Presentation = require( '@stdlib/repl/cli/presentation' ); * * function onExit() { * console.log( 'REPL closed.' ); diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/main.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/main.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/main.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/main.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/parse.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/parse.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/parse.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/parse.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/parse_slide.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/parse_slide.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/parse_slide.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/parse_slide.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/set_commands.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/set_commands.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/set_commands.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/set_commands.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/style_line.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/style_line.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/style_line.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/style_line.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/style_to_ansi.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/style_to_ansi.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/style_to_ansi.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/style_to_ansi.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/styles.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/styles.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/styles.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/styles.js diff --git a/lib/node_modules/@stdlib/repl/presentation/lib/validate.js b/lib/node_modules/@stdlib/repl/cli/presentation/lib/validate.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/lib/validate.js rename to lib/node_modules/@stdlib/repl/cli/presentation/lib/validate.js diff --git a/lib/node_modules/@stdlib/repl/presentation/package.json b/lib/node_modules/@stdlib/repl/cli/presentation/package.json similarity index 97% rename from lib/node_modules/@stdlib/repl/presentation/package.json rename to lib/node_modules/@stdlib/repl/cli/presentation/package.json index 6f31caed483e..f3166178e52b 100644 --- a/lib/node_modules/@stdlib/repl/presentation/package.json +++ b/lib/node_modules/@stdlib/repl/cli/presentation/package.json @@ -1,5 +1,5 @@ { - "name": "@stdlib/repl/presentation", + "name": "@stdlib/repl/cli/presentation", "version": "0.0.0", "description": "REPL presentation.", "license": "Apache-2.0", diff --git a/lib/node_modules/@stdlib/repl/presentation/scripts/build.js b/lib/node_modules/@stdlib/repl/cli/presentation/scripts/build.js similarity index 100% rename from lib/node_modules/@stdlib/repl/presentation/scripts/build.js rename to lib/node_modules/@stdlib/repl/cli/presentation/scripts/build.js From e4e0c686f976615441625c6477d21aae9f3ee92b Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Sat, 8 Feb 2025 11:48:55 +0000 Subject: [PATCH 02/26] refactor!: abstract part of REPL into a base implementation Signed-off-by: Snehil Shah --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: passed - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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 --- --- .../repl/{ => base}/data/contributor.json | 0 .../@stdlib/repl/{ => base}/data/example.csv | 0 .../@stdlib/repl/{ => base}/data/example.json | 0 .../@stdlib/repl/{ => base}/data/help.csv | 0 .../@stdlib/repl/{ => base}/data/help.json | 0 .../@stdlib/repl/{ => base}/data/info.csv | 0 .../@stdlib/repl/{ => base}/data/info.json | 0 .../repl/{ => base}/data/license_text.json | 0 .../@stdlib/repl/{ => base}/data/tutorial.csv | 0 .../repl/{ => base}/data/tutorial.json | 0 .../{ => base}/docs/commands/__done__.txt | 0 .../{ => base}/docs/commands/_require.txt | 0 .../{ => base}/docs/commands/alias2pkg.txt | 0 .../docs/commands/alias2related.txt | 0 .../repl/{ => base}/docs/commands/ans.txt | 0 .../{ => base}/docs/commands/assignfrom.txt | 0 .../{ => base}/docs/commands/assignin.txt | 0 .../{ => base}/docs/commands/citation.txt | 0 .../docs/commands/clear_history.txt | 0 .../docs/commands/clear_user_docs.txt | 0 .../{ => base}/docs/commands/clear_vars.txt | 0 .../docs/commands/clear_workspace.txt | 0 .../{ => base}/docs/commands/contributor.txt | 0 .../{ => base}/docs/commands/copyright.txt | 0 .../repl/{ => base}/docs/commands/credits.txt | 0 .../docs/commands/current_workspace.txt | 0 .../docs/commands/deeprerequire.txt | 0 .../docs/commands/delete_workspace.txt | 0 .../repl/{ => base}/docs/commands/donate.txt | 0 .../repl/{ => base}/docs/commands/evalin.txt | 0 .../repl/{ => base}/docs/commands/example.txt | 0 .../repl/{ => base}/docs/commands/global.txt | 0 .../repl/{ => base}/docs/commands/help.txt | 0 .../repl/{ => base}/docs/commands/info.txt | 0 .../{ => base}/docs/commands/is_keyword.txt | 0 .../{ => base}/docs/commands/is_workspace.txt | 0 .../{ => base}/docs/commands/license_text.txt | 0 .../repl/{ => base}/docs/commands/load.txt | 0 .../docs/commands/load_workspace.txt | 0 .../{ => base}/docs/commands/log_start.txt | 0 .../{ => base}/docs/commands/log_stop.txt | 0 .../repl/{ => base}/docs/commands/quit.txt | 0 .../docs/commands/rename_workspace.txt | 0 .../{ => base}/docs/commands/rerequire.txt | 0 .../repl/{ => base}/docs/commands/rerun.txt | 0 .../repl/{ => base}/docs/commands/reset.txt | 0 .../repl/{ => base}/docs/commands/save.txt | 0 .../{ => base}/docs/commands/save_start.txt | 0 .../{ => base}/docs/commands/save_stop.txt | 0 .../{ => base}/docs/commands/tutorial.txt | 0 .../{ => base}/docs/commands/user_doc.txt | 0 .../repl/{ => base}/docs/commands/vars.txt | 0 .../docs/commands/vars_workspace.txt | 0 .../{ => base}/docs/commands/workspace.txt | 0 .../{ => base}/docs/commands/workspaces.txt | 0 .../lib/acorn_detect_multiline_input.js | 0 .../repl/{ => base}/lib/alias_overrides.js | 0 .../repl/{ => base}/lib/alias_to_string.js | 0 .../@stdlib/repl/{ => base}/lib/aliases.js | 0 .../repl/{ => base}/lib/append_unique.js | 0 .../@stdlib/repl/{ => base}/lib/commands.js | 26 - .../repl/{ => base}/lib/commands/__done__.js | 0 .../repl/{ => base}/lib/commands/alias2pkg.js | 0 .../{ => base}/lib/commands/alias2related.js | 0 .../repl/{ => base}/lib/commands/ans.js | 0 .../{ => base}/lib/commands/assignfrom.js | 0 .../repl/{ => base}/lib/commands/assignin.js | 0 .../repl/{ => base}/lib/commands/citation.js | 0 .../{ => base}/lib/commands/clear_history.js | 0 .../lib/commands/clear_user_docs.js | 0 .../{ => base}/lib/commands/clear_vars.js | 0 .../lib/commands/clear_workspace.js | 0 .../{ => base}/lib/commands/contributor.js | 0 .../repl/{ => base}/lib/commands/copyright.js | 0 .../repl/{ => base}/lib/commands/credits.js | 0 .../lib/commands/current_workspace.js | 0 .../{ => base}/lib/commands/deeprerequire.js | 0 .../lib/commands/delete_workspace.js | 0 .../repl/{ => base}/lib/commands/donate.js | 0 .../repl/{ => base}/lib/commands/evalin.js | 0 .../repl/{ => base}/lib/commands/example.js | 0 .../repl/{ => base}/lib/commands/help.js | 3 +- .../repl/{ => base}/lib/commands/info.js | 0 .../{ => base}/lib/commands/is_keyword.js | 0 .../{ => base}/lib/commands/is_workspace.js | 0 .../{ => base}/lib/commands/license_text.js | 0 .../repl/{ => base}/lib/commands/load.js | 0 .../{ => base}/lib/commands/load_workspace.js | 0 .../repl/{ => base}/lib/commands/quit.js | 0 .../lib/commands/rename_workspace.js | 0 .../repl/{ => base}/lib/commands/rerequire.js | 0 .../repl/{ => base}/lib/commands/reset.js | 0 .../repl/{ => base}/lib/commands/tutorial.js | 0 .../repl/{ => base}/lib/commands/user_doc.js | 0 .../repl/{ => base}/lib/commands/vars.js | 0 .../{ => base}/lib/commands/vars_workspace.js | 0 .../repl/{ => base}/lib/commands/workspace.js | 0 .../{ => base}/lib/commands/workspaces.js | 0 .../repl/{ => base}/lib/compile_code.js | 0 .../repl/{ => base}/lib/compile_command.js | 0 .../{ => base}/lib/complete_expression.js | 0 .../repl/{ => base}/lib/complete_fs.js | 0 .../repl/{ => base}/lib/complete_require.js | 2 +- .../repl/{ => base}/lib/complete_tutorial.js | 0 .../{ => base}/lib/complete_walk_find_last.js | 0 .../repl/{ => base}/lib/complete_workspace.js | 0 .../@stdlib/repl/{ => base}/lib/completer.js | 17 - .../@stdlib/repl/{ => base}/lib/contains.js | 0 .../repl/{ => base}/lib/create_accessor.js | 0 .../lib/create_evaluation_context.js | 5 +- .../repl/{ => base}/lib/create_require.js | 0 .../@stdlib/repl/base/lib/defaults.js | 74 ++ .../@stdlib/repl/{ => base}/lib/drain.js | 36 +- .../repl/{ => base}/lib/filter_by_prefix.js | 0 .../repl/{ => base}/lib/find_unique_entry.js | 0 .../repl/{ => base}/lib/fs_alias_args.js | 0 .../@stdlib/repl/{ => base}/lib/fs_aliases.js | 0 .../@stdlib/repl/{ => base}/lib/globals.js | 0 .../{ => base}/lib/has_async_directive.js | 0 .../@stdlib/repl/{ => base}/lib/index.js | 6 +- .../@stdlib/repl/{ => base}/lib/index_of.js | 0 .../repl/{ => base}/lib/is_block_scope.js | 0 .../repl/base/lib/is_multiline_input.js | 95 +++ .../@stdlib/repl/{ => base}/lib/is_scope.js | 0 .../repl/{ => base}/lib/is_silent_command.js | 0 .../@stdlib/repl/{ => base}/lib/log.js | 0 .../{ => base}/lib/longest_common_prefix.js | 0 .../@stdlib/repl/base/lib/main.js | 719 ++++++++++++++++++ .../repl/{ => base}/lib/process_command.js | 0 .../@stdlib/repl/base/lib/process_input.js | 89 +++ .../{ => base}/lib/process_top_level_await.js | 0 .../{ => base}/lib/property_comparator.js | 0 .../repl/{ => base}/lib/regexp_fs_aliases.js | 0 .../repl/{ => base}/lib/regexp_index.js | 0 .../repl/{ => base}/lib/regexp_path.js | 0 .../lib/regexp_relative_require_path.js | 0 .../repl/{ => base}/lib/regexp_require.js | 0 .../lib/regexp_reserved_syntax_characters.js | 0 .../repl/{ => base}/lib/regexp_tutorial.js | 0 .../repl/{ => base}/lib/regexp_workspace.js | 0 .../@stdlib/repl/{ => base}/lib/repl_docs.js | 0 .../repl/{ => base}/lib/reserved_keywords.js | 0 .../lib/reserved_keywords_common.js | 0 ...reserved_keywords_empty_block_statement.js | 0 .../repl/{ => base}/lib/resolve_globals.js | 0 .../{ => base}/lib/resolve_local_scope.js | 0 .../{ => base}/lib/resolve_local_scopes.js | 0 .../{ => base}/lib/restore_regexp_matches.js | 0 .../repl/{ => base}/lib/set_aliases.js | 0 .../repl/{ => base}/lib/set_aliases_global.js | 0 .../repl/{ => base}/lib/set_commands.js | 0 .../{ => base}/lib/set_commands_global.js | 0 .../@stdlib/repl/{ => base}/lib/setdiff.js | 0 .../@stdlib/repl/base/lib/settings.js | 68 ++ .../repl/{ => base}/lib/settings_names.js | 0 .../{ => base}/lib/settings_validators.js | 0 .../@stdlib/repl/{ => base}/lib/tokenizer.js | 17 - .../{ => base}/lib/tutorial_alias_args.js | 0 .../repl/{ => base}/lib/tutorial_aliases.js | 0 .../{ => base}/lib/update_regexp_cache.js | 0 .../@stdlib/repl/base/lib/validate.js | 131 ++++ .../repl/{ => base}/lib/validate_settings.js | 0 .../{ => base}/lib/workspace_alias_args.js | 0 .../repl/{ => base}/lib/workspace_aliases.js | 0 .../@stdlib/repl/base/package.json | 78 ++ .../@stdlib/repl/{ => base}/scripts/build.js | 0 .../{ => base}/scripts/build_contributors.js | 0 .../repl/{ => base}/scripts/build_help.js | 0 .../repl/{ => base}/scripts/build_license.js | 0 .../{ => base}/scripts/build_tutorials.js | 0 .../@stdlib/repl/{ => cli}/README.md | 0 .../repl/{ => cli}/benchmark/benchmark.js | 0 .../@stdlib/repl/{ => cli}/bin/cli | 4 +- .../repl/{ => cli}/docs/commands/clear.txt | 0 .../docs/commands/presentation_start.txt | 0 .../docs/commands/presentation_stop.txt | 0 .../{ => cli}/docs/migration-guides/README.md | 0 .../docs/migration-guides/ipython/README.md | 0 .../migration-guides/ipython/data/data.csv | 0 .../docs/migration-guides/matlab/README.md | 0 .../migration-guides/matlab/data/data.csv | 0 .../docs/tutorials/read_eval_print_loop.txt | 0 .../@stdlib/repl/{ => cli}/docs/usage.txt | 0 .../@stdlib/repl/{ => cli}/etc/cli_opts.json | 0 .../repl/{ => cli}/examples/history.txt | 0 .../{ => cli}/examples/http/client.js.txt | 0 .../{ => cli}/examples/http/server.js.txt | 0 .../@stdlib/repl/{ => cli}/examples/index.js | 0 .../examples/net-socket-2/client.js.txt | 0 .../examples/net-socket-2/server.js.txt | 0 .../examples/net-socket/client.js.txt | 0 .../examples/net-socket/server.js.txt | 0 .../@stdlib/repl/{ => cli}/lib/actions.js | 0 .../@stdlib/repl/{ => cli}/lib/ansi_colors.js | 0 .../repl/{ => cli}/lib/auto_close_pairs.js | 0 .../lib/auto_close_pairs_close_symbols.js | 0 .../lib/auto_close_pairs_open_symbols.js | 0 .../{ => cli}/lib/auto_close_pairs_walk.js | 0 .../repl/{ => cli}/lib/browser/index.js | 0 .../@stdlib/repl/cli/lib/commands.js | 82 ++ .../repl/{ => cli}/lib/commands/add_theme.js | 0 .../repl/{ => cli}/lib/commands/clear.js | 0 .../{ => cli}/lib/commands/delete_theme.js | 0 .../repl/{ => cli}/lib/commands/get_theme.js | 0 .../{ => cli}/lib/commands/keybindings.js | 0 .../repl/{ => cli}/lib/commands/pager.js | 0 .../lib/commands/presentation_start.js | 2 +- .../lib/commands/presentation_stop.js | 0 .../{ => cli}/lib/commands/rename_theme.js | 0 .../repl/{ => cli}/lib/commands/rerun.js | 0 .../{ => cli}/lib/commands/set_keybinding.js | 0 .../repl/{ => cli}/lib/commands/settings.js | 0 .../repl/{ => cli}/lib/commands/themes.js | 0 .../repl/{ => cli}/lib/completer_engine.js | 0 .../repl/{ => cli}/lib/completer_preview.js | 0 .../repl/{ => cli}/lib/default_keybindings.js | 0 .../@stdlib/repl/{ => cli}/lib/defaults.js | 0 .../repl/{ => cli}/lib/display_prompt.js | 0 .../repl/{ => cli}/lib/eager_evaluator.js | 6 +- .../repl/{ => cli}/lib/editor_actions.js | 0 .../@stdlib/repl/{ => cli}/lib/help_text.js | 0 .../@stdlib/repl/cli/lib/index.js | 53 ++ .../repl/{ => cli}/lib/input_prompt.js | 0 .../repl/{ => cli}/lib/is_setting_name.js | 0 .../@stdlib/repl/{ => cli}/lib/keybindings.js | 0 lib/node_modules/@stdlib/repl/cli/lib/log.js | 45 ++ .../repl/cli/lib/longest_common_prefix.js | 101 +++ .../@stdlib/repl/{ => cli}/lib/main.js | 448 ++--------- .../repl/{ => cli}/lib/multiline_handler.js | 114 +-- .../repl/{ => cli}/lib/output_stream.js | 0 .../@stdlib/repl/{ => cli}/lib/parse_key.js | 0 .../repl/cli/lib/property_comparator.js | 63 ++ .../lib/regexp_leading_whitespace.js | 0 .../lib/regexp_reserved_syntax_characters.js | 42 + .../@stdlib/repl/cli/lib/set_commands.js | 64 ++ .../repl/cli/lib/set_commands_global.js | 72 ++ .../@stdlib/repl/cli/lib/setdiff.js | 193 +++++ .../@stdlib/repl/{ => cli}/lib/settings.js | 8 +- .../lib/settings_names.js} | 21 +- .../repl/cli/lib/settings_validators.js | 112 +++ .../repl/{ => cli}/lib/syntax_highlighter.js | 3 +- .../@stdlib/repl/{ => cli}/lib/themes.js | 0 .../@stdlib/repl/{ => cli}/lib/validate.js | 0 .../{ => cli}/lib/validate_keybindings.js | 0 .../@stdlib/repl/cli/lib/validate_settings.js | 78 ++ .../repl/{ => cli}/lib/welcome_text.js | 0 .../@stdlib/repl/cli/package.json | 78 ++ .../array_expression_right_bracket.json | 0 .../object_expression_right_brace.json | 0 .../negative/right_backtick.json | 0 .../negative/right_double_quote.json | 0 .../negative/right_parenthesis.json | 0 .../negative/right_single_quote.json | 0 .../negative/template_literal.json | 0 .../template_literal_with_expression.json | 0 .../positive/arrow_function_body.json | 0 ...binary_left_member_expression_literal.json | 0 .../positive/call_expression.json | 0 ...pression_string_argument_single_quote.json | 0 ...ssion_template_argument_left_backtick.json | 0 .../positive/do_while_body.json | 0 .../positive/do_while_test.json | 0 .../positive/do_while_test_left_bracket.json | 0 .../auto-close-pairs/positive/for_body.json | 0 .../auto-close-pairs/positive/for_init.json | 0 .../auto-close-pairs/positive/for_test.json | 0 .../positive/for_test_member_expression.json | 0 .../auto-close-pairs/positive/for_update.json | 0 .../for_update_member_expression.json | 0 .../positive/function_declaration_body.json | 0 .../function_declaration_signature.json | 0 .../positive/left_backtick.json | 0 .../auto-close-pairs/positive/left_brace.json | 0 .../positive/left_bracket.json | 0 .../positive/left_double_quote.json | 0 .../positive/left_parenthesis.json | 0 .../positive/left_single_quote.json | 0 ...ogical_left_member_expression_literal.json | 0 .../logical_with_left_member_expression.json | 0 ...al_with_left_nested_member_expression.json | 0 .../logical_with_right_member_expression.json | 0 .../member_assignment_expression.json | 0 .../member_assignment_expression_literal.json | 0 .../positive/member_expression.json | 0 .../member_expression_call_expression.json | 0 .../object_expression_left_single_quote.json | 0 .../positive/regexp_body_single_quote.json | 0 .../positive/regexp_literal_left_bracket.json | 0 .../positive/regexp_single_quote.json | 0 .../positive/tagged_template.json | 0 .../tagged_template_left_backtick.json | 0 ...te_literal_expression_with_left_brace.json | 0 ..._literal_expression_with_left_bracket.json | 0 ...ral_expression_with_left_double_quote.json | 0 ...eral_expression_with_left_parenthesis.json | 0 .../positive/three_backticks.json | 0 .../positive/variable_declaration_string.json | 0 .../auto-close-pairs/positive/while_body.json | 0 .../auto-close-pairs/positive/while_test.json | 0 .../fixtures/auto-close-pairs/script.js | 0 ...expression_left_bracket_within_string.json | 0 .../negative/left_backtick_within_string.json | 0 .../left_double_quote_within_string.json | 0 .../left_parenthesis_within_string.json | 0 .../left_single_quote_within_string.json | 0 ...t_expression_left_brace_within_string.json | 0 .../array_expression_left_bracket.json | 0 .../positive/left_backtick.json | 0 .../positive/left_double_quote.json | 0 .../positive/left_parenthesis.json | 0 .../positive/left_single_quote.json | 0 .../object_expression_left_brace.json | 0 .../fixtures/auto-delete-pairs/script.js | 0 .../test/integration/fixtures/repl.js | 0 .../syntax-highlighting/comments.json | 0 .../syntax-highlighting/control_keywords.json | 0 .../declaration_names.json | 0 .../syntax-highlighting/functions.json | 0 .../syntax-highlighting/keywords.json | 0 .../syntax-highlighting/local_scopes.json | 0 .../member_expressions.json | 0 .../syntax-highlighting/numeric_literals.json | 0 .../fixtures/syntax-highlighting/objects.json | 0 .../syntax-highlighting/operators.json | 0 .../syntax-highlighting/punctuation.json | 0 .../fixtures/syntax-highlighting/regexp.json | 0 .../reserved_literals.json | 0 .../special_identifiers.json | 0 .../syntax-highlighting/string_literals.json | 0 .../syntax-highlighting/variables.json | 0 .../test/integration/test.auto_close_pairs.js | 1 - .../integration/test.auto_delete_pairs.js | 0 .../test/integration/test.auto_page.js | 0 .../test/integration/test.completer_engine.js | 4 +- .../integration/test.completion_previews.js | 32 +- .../integration/test.syntax_highlighting.js | 0 .../@stdlib/repl/{ => cli}/test/test.cli.js | 0 .../@stdlib/repl/{ => cli}/test/test.js | 0 .../@stdlib/repl/lib/complete_settings.js | 91 --- .../@stdlib/repl/lib/regexp_settings.js | 106 --- .../@stdlib/repl/lib/settings_aliases.js | 46 -- 341 files changed, 2343 insertions(+), 892 deletions(-) rename lib/node_modules/@stdlib/repl/{ => base}/data/contributor.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/example.csv (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/example.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/help.csv (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/help.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/info.csv (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/info.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/license_text.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/tutorial.csv (100%) rename lib/node_modules/@stdlib/repl/{ => base}/data/tutorial.json (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/__done__.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/_require.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/alias2pkg.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/alias2related.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/ans.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/assignfrom.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/assignin.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/citation.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/clear_history.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/clear_user_docs.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/clear_vars.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/clear_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/contributor.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/copyright.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/credits.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/current_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/deeprerequire.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/delete_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/donate.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/evalin.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/example.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/global.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/help.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/info.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/is_keyword.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/is_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/license_text.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/load.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/load_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/log_start.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/log_stop.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/quit.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/rename_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/rerequire.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/rerun.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/reset.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/save.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/save_start.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/save_stop.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/tutorial.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/user_doc.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/vars.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/vars_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/docs/commands/workspaces.txt (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/acorn_detect_multiline_input.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/alias_overrides.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/alias_to_string.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/aliases.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/append_unique.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands.js (78%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/__done__.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/alias2pkg.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/alias2related.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/ans.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/assignfrom.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/assignin.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/citation.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/clear_history.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/clear_user_docs.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/clear_vars.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/clear_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/contributor.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/copyright.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/credits.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/current_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/deeprerequire.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/delete_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/donate.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/evalin.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/example.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/help.js (98%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/info.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/is_keyword.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/is_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/license_text.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/load.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/load_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/quit.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/rename_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/rerequire.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/reset.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/tutorial.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/user_doc.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/vars.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/vars_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/commands/workspaces.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/compile_code.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/compile_command.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_expression.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_fs.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_require.js (98%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_tutorial.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_walk_find_last.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/complete_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/completer.js (88%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/contains.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/create_accessor.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/create_evaluation_context.js (94%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/create_require.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/defaults.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/drain.js (73%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/filter_by_prefix.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/find_unique_entry.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/fs_alias_args.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/fs_aliases.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/globals.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/has_async_directive.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/index.js (92%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/index_of.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/is_block_scope.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/is_multiline_input.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/is_scope.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/is_silent_command.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/log.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/longest_common_prefix.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/main.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/process_command.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/process_input.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/process_top_level_await.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/property_comparator.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_fs_aliases.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_index.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_path.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_relative_require_path.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_require.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_reserved_syntax_characters.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_tutorial.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/regexp_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/repl_docs.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/reserved_keywords.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/reserved_keywords_common.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/reserved_keywords_empty_block_statement.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/resolve_globals.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/resolve_local_scope.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/resolve_local_scopes.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/restore_regexp_matches.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/set_aliases.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/set_aliases_global.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/set_commands.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/set_commands_global.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/setdiff.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/settings.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/settings_names.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/settings_validators.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/tokenizer.js (96%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/tutorial_alias_args.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/tutorial_aliases.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/update_regexp_cache.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/lib/validate.js rename lib/node_modules/@stdlib/repl/{ => base}/lib/validate_settings.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/workspace_alias_args.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/lib/workspace_aliases.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/package.json rename lib/node_modules/@stdlib/repl/{ => base}/scripts/build.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/scripts/build_contributors.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/scripts/build_help.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/scripts/build_license.js (100%) rename lib/node_modules/@stdlib/repl/{ => base}/scripts/build_tutorials.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/README.md (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/benchmark/benchmark.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/bin/cli (96%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/commands/clear.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/commands/presentation_start.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/commands/presentation_stop.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/migration-guides/README.md (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/migration-guides/ipython/README.md (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/migration-guides/ipython/data/data.csv (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/migration-guides/matlab/README.md (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/migration-guides/matlab/data/data.csv (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/tutorials/read_eval_print_loop.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/docs/usage.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/etc/cli_opts.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/history.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/http/client.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/http/server.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/index.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/net-socket-2/client.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/net-socket-2/server.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/net-socket/client.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/examples/net-socket/server.js.txt (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/actions.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/ansi_colors.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/auto_close_pairs.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/auto_close_pairs_close_symbols.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/auto_close_pairs_open_symbols.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/auto_close_pairs_walk.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/browser/index.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/commands.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/add_theme.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/clear.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/delete_theme.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/get_theme.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/keybindings.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/pager.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/presentation_start.js (98%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/presentation_stop.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/rename_theme.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/rerun.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/set_keybinding.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/settings.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/commands/themes.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/completer_engine.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/completer_preview.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/default_keybindings.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/defaults.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/display_prompt.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/eager_evaluator.js (98%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/editor_actions.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/help_text.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/index.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/input_prompt.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/is_setting_name.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/keybindings.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/log.js create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/longest_common_prefix.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/main.js (72%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/multiline_handler.js (84%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/output_stream.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/parse_key.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/property_comparator.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/regexp_leading_whitespace.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/regexp_reserved_syntax_characters.js create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/set_commands.js create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/set_commands_global.js create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/setdiff.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/settings.js (100%) rename lib/node_modules/@stdlib/repl/{lib/settings_alias_args.js => cli/lib/settings_names.js} (60%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/settings_validators.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/syntax_highlighter.js (99%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/themes.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/validate.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/lib/validate_keybindings.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/validate_settings.js rename lib/node_modules/@stdlib/repl/{ => cli}/lib/welcome_text.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/package.json rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/array_expression_right_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/object_expression_right_brace.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/right_backtick.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/right_double_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/right_parenthesis.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/right_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/template_literal.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/negative/template_literal_with_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/arrow_function_body.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/binary_left_member_expression_literal.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/call_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/call_expression_string_argument_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/call_expression_template_argument_left_backtick.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/do_while_body.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/do_while_test.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/do_while_test_left_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_body.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_init.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_test.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_test_member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_update.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/for_update_member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/function_declaration_body.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/function_declaration_signature.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_backtick.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_brace.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_double_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_parenthesis.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/left_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/logical_left_member_expression_literal.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_nested_member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/logical_with_right_member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression_literal.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/member_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/member_expression_call_expression.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/object_expression_left_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/regexp_body_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/regexp_literal_left_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/regexp_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/tagged_template.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/tagged_template_left_backtick.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_brace.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_double_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_parenthesis.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/three_backticks.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/variable_declaration_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/while_body.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/positive/while_test.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-close-pairs/script.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/array_expression_left_bracket_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/left_backtick_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/left_double_quote_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/left_parenthesis_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/left_single_quote_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/negative/object_expression_left_brace_within_string.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/array_expression_left_bracket.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/left_backtick.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/left_double_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/left_parenthesis.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/left_single_quote.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/positive/object_expression_left_brace.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/auto-delete-pairs/script.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/repl.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/comments.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/control_keywords.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/declaration_names.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/functions.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/keywords.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/local_scopes.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/member_expressions.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/numeric_literals.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/objects.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/operators.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/punctuation.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/regexp.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/reserved_literals.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/special_identifiers.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/string_literals.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/fixtures/syntax-highlighting/variables.json (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.auto_close_pairs.js (99%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.auto_delete_pairs.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.auto_page.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.completer_engine.js (99%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.completion_previews.js (95%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/integration/test.syntax_highlighting.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/test.cli.js (100%) rename lib/node_modules/@stdlib/repl/{ => cli}/test/test.js (100%) delete mode 100644 lib/node_modules/@stdlib/repl/lib/complete_settings.js delete mode 100644 lib/node_modules/@stdlib/repl/lib/regexp_settings.js delete mode 100644 lib/node_modules/@stdlib/repl/lib/settings_aliases.js diff --git a/lib/node_modules/@stdlib/repl/data/contributor.json b/lib/node_modules/@stdlib/repl/base/data/contributor.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/contributor.json rename to lib/node_modules/@stdlib/repl/base/data/contributor.json diff --git a/lib/node_modules/@stdlib/repl/data/example.csv b/lib/node_modules/@stdlib/repl/base/data/example.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/data/example.csv rename to lib/node_modules/@stdlib/repl/base/data/example.csv diff --git a/lib/node_modules/@stdlib/repl/data/example.json b/lib/node_modules/@stdlib/repl/base/data/example.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/example.json rename to lib/node_modules/@stdlib/repl/base/data/example.json diff --git a/lib/node_modules/@stdlib/repl/data/help.csv b/lib/node_modules/@stdlib/repl/base/data/help.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/data/help.csv rename to lib/node_modules/@stdlib/repl/base/data/help.csv diff --git a/lib/node_modules/@stdlib/repl/data/help.json b/lib/node_modules/@stdlib/repl/base/data/help.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/help.json rename to lib/node_modules/@stdlib/repl/base/data/help.json diff --git a/lib/node_modules/@stdlib/repl/data/info.csv b/lib/node_modules/@stdlib/repl/base/data/info.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/data/info.csv rename to lib/node_modules/@stdlib/repl/base/data/info.csv diff --git a/lib/node_modules/@stdlib/repl/data/info.json b/lib/node_modules/@stdlib/repl/base/data/info.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/info.json rename to lib/node_modules/@stdlib/repl/base/data/info.json diff --git a/lib/node_modules/@stdlib/repl/data/license_text.json b/lib/node_modules/@stdlib/repl/base/data/license_text.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/license_text.json rename to lib/node_modules/@stdlib/repl/base/data/license_text.json diff --git a/lib/node_modules/@stdlib/repl/data/tutorial.csv b/lib/node_modules/@stdlib/repl/base/data/tutorial.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/data/tutorial.csv rename to lib/node_modules/@stdlib/repl/base/data/tutorial.csv diff --git a/lib/node_modules/@stdlib/repl/data/tutorial.json b/lib/node_modules/@stdlib/repl/base/data/tutorial.json similarity index 100% rename from lib/node_modules/@stdlib/repl/data/tutorial.json rename to lib/node_modules/@stdlib/repl/base/data/tutorial.json diff --git a/lib/node_modules/@stdlib/repl/docs/commands/__done__.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/__done__.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/__done__.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/__done__.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/_require.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/_require.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/_require.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/_require.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/alias2pkg.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/alias2pkg.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/alias2pkg.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/alias2pkg.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/alias2related.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/alias2related.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/alias2related.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/alias2related.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/ans.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/ans.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/ans.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/ans.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/assignfrom.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/assignfrom.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/assignfrom.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/assignfrom.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/assignin.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/assignin.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/assignin.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/assignin.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/citation.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/citation.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/citation.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/citation.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/clear_history.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/clear_history.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/clear_history.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/clear_history.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/clear_user_docs.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/clear_user_docs.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/clear_user_docs.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/clear_user_docs.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/clear_vars.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/clear_vars.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/clear_vars.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/clear_vars.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/clear_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/clear_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/clear_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/clear_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/contributor.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/contributor.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/contributor.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/contributor.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/copyright.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/copyright.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/copyright.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/copyright.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/credits.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/credits.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/credits.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/credits.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/current_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/current_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/current_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/current_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/deeprerequire.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/deeprerequire.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/deeprerequire.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/deeprerequire.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/delete_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/delete_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/delete_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/delete_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/donate.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/donate.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/donate.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/donate.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/evalin.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/evalin.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/evalin.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/evalin.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/example.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/example.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/example.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/example.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/global.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/global.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/global.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/global.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/help.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/help.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/help.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/help.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/info.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/info.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/info.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/info.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/is_keyword.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/is_keyword.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/is_keyword.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/is_keyword.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/is_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/is_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/is_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/is_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/license_text.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/license_text.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/license_text.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/license_text.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/load.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/load.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/load.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/load.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/load_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/load_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/load_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/load_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/log_start.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/log_start.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/log_start.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/log_start.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/log_stop.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/log_stop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/log_stop.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/log_stop.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/quit.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/quit.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/quit.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/quit.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/rename_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/rename_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/rename_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/rename_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/rerequire.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/rerequire.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/rerequire.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/rerequire.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/rerun.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/rerun.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/rerun.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/rerun.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/reset.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/reset.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/reset.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/reset.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/save.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/save.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/save.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/save.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/save_start.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/save_start.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/save_start.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/save_start.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/save_stop.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/save_stop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/save_stop.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/save_stop.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/tutorial.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/tutorial.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/tutorial.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/tutorial.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/user_doc.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/user_doc.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/user_doc.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/user_doc.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/vars.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/vars.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/vars.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/vars.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/vars_workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/vars_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/vars_workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/vars_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/workspace.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/workspace.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/workspace.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/workspaces.txt b/lib/node_modules/@stdlib/repl/base/docs/commands/workspaces.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/workspaces.txt rename to lib/node_modules/@stdlib/repl/base/docs/commands/workspaces.txt diff --git a/lib/node_modules/@stdlib/repl/lib/acorn_detect_multiline_input.js b/lib/node_modules/@stdlib/repl/base/lib/acorn_detect_multiline_input.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/acorn_detect_multiline_input.js rename to lib/node_modules/@stdlib/repl/base/lib/acorn_detect_multiline_input.js diff --git a/lib/node_modules/@stdlib/repl/lib/alias_overrides.js b/lib/node_modules/@stdlib/repl/base/lib/alias_overrides.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/alias_overrides.js rename to lib/node_modules/@stdlib/repl/base/lib/alias_overrides.js diff --git a/lib/node_modules/@stdlib/repl/lib/alias_to_string.js b/lib/node_modules/@stdlib/repl/base/lib/alias_to_string.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/alias_to_string.js rename to lib/node_modules/@stdlib/repl/base/lib/alias_to_string.js diff --git a/lib/node_modules/@stdlib/repl/lib/aliases.js b/lib/node_modules/@stdlib/repl/base/lib/aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/aliases.js diff --git a/lib/node_modules/@stdlib/repl/lib/append_unique.js b/lib/node_modules/@stdlib/repl/base/lib/append_unique.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/append_unique.js rename to lib/node_modules/@stdlib/repl/base/lib/append_unique.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands.js b/lib/node_modules/@stdlib/repl/base/lib/commands.js similarity index 78% rename from lib/node_modules/@stdlib/repl/lib/commands.js rename to lib/node_modules/@stdlib/repl/base/lib/commands.js index 88c4a5a63ea9..252afaf8d3d6 100644 --- a/lib/node_modules/@stdlib/repl/lib/commands.js +++ b/lib/node_modules/@stdlib/repl/base/lib/commands.js @@ -20,14 +20,12 @@ // MODULES // -var onAddTheme = require( './commands/add_theme.js' ); var onAlias2Pkg = require( './commands/alias2pkg.js' ); var onAlias2Related = require( './commands/alias2related.js' ); var onAns = require( './commands/ans.js' ); var onAssignin = require( './commands/assignin.js' ); var onAssignfrom = require( './commands/assignfrom.js' ); var onCitation = require( './commands/citation.js' ); -var onClear = require( './commands/clear.js' ); var onClearHistory = require( './commands/clear_history.js' ); var onClearUserDocs = require( './commands/clear_user_docs.js' ); var onClearVars = require( './commands/clear_vars.js' ); @@ -36,34 +34,23 @@ var onContributors = require( './commands/contributor.js' ); var onCopyright = require( './commands/copyright.js' ); var onCredits = require( './commands/credits.js' ); var onCurrentWorkspace = require( './commands/current_workspace.js' ); -var onDeleteTheme = require( './commands/delete_theme.js' ); var onDeleteWorkspace = require( './commands/delete_workspace.js' ); var onDeeprerequire = require( './commands/deeprerequire.js' ); var onDonate = require( './commands/donate.js' ); var onDone = require( './commands/__done__.js' ); var onEvalin = require( './commands/evalin.js' ); var onExample = require( './commands/example.js' ); -var onGetTheme = require( './commands/get_theme.js' ); var onHelp = require( './commands/help.js' ); var onInfo = require( './commands/info.js' ); var isWorkspace = require( './commands/is_workspace.js' ); var isKeyword = require( './commands/is_keyword.js' ); -var onKeybindings = require( './commands/keybindings.js' ); var onLicense = require( './commands/license_text.js' ); var onLoad = require( './commands/load.js' ); var onLoadWorkspace = require( './commands/load_workspace.js' ); -var onPager = require( './commands/pager.js' ); -var onPresentationStart = require( './commands/presentation_start.js' ); -var onPresentationStop = require( './commands/presentation_stop.js' ); var onQuit = require( './commands/quit.js' ); -var onRenameTheme = require( './commands/rename_theme.js' ); var onRenameWorkspace = require( './commands/rename_workspace.js' ); var onRerequire = require( './commands/rerequire.js' ); -var onRerun = require( './commands/rerun.js' ); var onReset = require( './commands/reset.js' ); -var onSetKeybinding = require( './commands/set_keybinding.js' ); -var onSettings = require( './commands/settings.js' ); -var onThemes = require( './commands/themes.js' ); var onTutorial = require( './commands/tutorial.js' ); var onUserDoc = require( './commands/user_doc.js' ); var onVars = require( './commands/vars.js' ); @@ -97,14 +84,12 @@ function commands( repl ) { // Define a list of REPL-specific commands (NOTE: keep in alphabetical order): cmds = []; cmds.push( [ '__done__', onDone( repl ), false ] ); - cmds.push( [ 'addTheme', onAddTheme( repl ), false ] ); cmds.push( [ 'alias2pkg', onAlias2Pkg( repl ), false ] ); cmds.push( [ 'alias2related', onAlias2Related( repl, cmds ), false ] ); cmds.push( [ 'ans', onAns( repl ), true ] ); cmds.push( [ 'assignfrom', onAssignfrom( repl ), false ] ); cmds.push( [ 'assignin', onAssignin( repl ), false ] ); cmds.push( [ 'citation', onCitation( repl ), false ] ); - cmds.push( [ 'clear', onClear( repl ), false ] ); cmds.push( [ 'clearHistory', onClearHistory( repl ), false ] ); cmds.push( [ 'clearUserDocs', onClearUserDocs( repl ), false ] ); cmds.push( [ 'clearVars', onClearVars( repl ), false ] ); @@ -113,33 +98,22 @@ function commands( repl ) { cmds.push( [ 'copyright', onCopyright( repl ), false ] ); cmds.push( [ 'credits', onCredits( repl ), false ] ); cmds.push( [ 'currentWorkspace', onCurrentWorkspace( repl ), true ] ); - cmds.push( [ 'deleteTheme', onDeleteTheme( repl ), false ] ); cmds.push( [ 'deleteWorkspace', onDeleteWorkspace( repl ), false ] ); cmds.push( [ 'deeprerequire', onDeeprerequire( repl ), false ] ); cmds.push( [ 'donate', onDonate( repl ), false ] ); cmds.push( [ 'evalin', onEvalin( repl, cmds ), false ] ); cmds.push( [ 'example', onExample( repl, cmds ), false ] ); - cmds.push( [ 'getTheme', onGetTheme( repl ), false ] ); cmds.push( [ 'help', onHelp( repl, cmds ), false ] ); cmds.push( [ 'info', onInfo( repl, cmds ), false ] ); cmds.push( [ 'isKeyword', isKeyword( repl ), false ] ); cmds.push( [ 'isWorkspace', isWorkspace( repl ), false ] ); - cmds.push( [ 'keybindings', onKeybindings( repl ), false ] ); cmds.push( [ 'license', onLicense( repl ), false ] ); cmds.push( [ 'load', onLoad( repl ), false ] ); cmds.push( [ 'loadWorkspace', onLoadWorkspace( repl ), false ] ); - cmds.push( [ 'pager', onPager( repl ), false ] ); - cmds.push( [ 'presentationStart', onPresentationStart( repl ), false ] ); - cmds.push( [ 'presentationStop', onPresentationStop( repl ), false ] ); cmds.push( [ 'quit', onQuit( repl ), false ] ); - cmds.push( [ 'renameTheme', onRenameTheme( repl ), false ] ); cmds.push( [ 'renameWorkspace', onRenameWorkspace( repl ), false ] ); cmds.push( [ 'rerequire', onRerequire( repl ), false ] ); - cmds.push( [ 'rerun', onRerun( repl ), false ] ); cmds.push( [ 'reset', onReset( repl ), false ] ); - cmds.push( [ 'setKeybinding', onSetKeybinding( repl ), false ] ); - cmds.push( [ 'settings', onSettings( repl ), false ] ); - cmds.push( [ 'themes', onThemes( repl ), false ] ); cmds.push( [ 'tutorial', onTutorial( repl ), false ] ); cmds.push( [ 'userDoc', onUserDoc( repl ), false ] ); cmds.push( [ 'vars', onVars( repl ), false ] ); diff --git a/lib/node_modules/@stdlib/repl/lib/commands/__done__.js b/lib/node_modules/@stdlib/repl/base/lib/commands/__done__.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/__done__.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/__done__.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/alias2pkg.js b/lib/node_modules/@stdlib/repl/base/lib/commands/alias2pkg.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/alias2pkg.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/alias2pkg.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/alias2related.js b/lib/node_modules/@stdlib/repl/base/lib/commands/alias2related.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/alias2related.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/alias2related.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/ans.js b/lib/node_modules/@stdlib/repl/base/lib/commands/ans.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/ans.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/ans.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/assignfrom.js b/lib/node_modules/@stdlib/repl/base/lib/commands/assignfrom.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/assignfrom.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/assignfrom.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/assignin.js b/lib/node_modules/@stdlib/repl/base/lib/commands/assignin.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/assignin.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/assignin.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/citation.js b/lib/node_modules/@stdlib/repl/base/lib/commands/citation.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/citation.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/citation.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/clear_history.js b/lib/node_modules/@stdlib/repl/base/lib/commands/clear_history.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/clear_history.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/clear_history.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/clear_user_docs.js b/lib/node_modules/@stdlib/repl/base/lib/commands/clear_user_docs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/clear_user_docs.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/clear_user_docs.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/clear_vars.js b/lib/node_modules/@stdlib/repl/base/lib/commands/clear_vars.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/clear_vars.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/clear_vars.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/clear_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/clear_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/clear_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/clear_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/contributor.js b/lib/node_modules/@stdlib/repl/base/lib/commands/contributor.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/contributor.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/contributor.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/copyright.js b/lib/node_modules/@stdlib/repl/base/lib/commands/copyright.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/copyright.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/copyright.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/credits.js b/lib/node_modules/@stdlib/repl/base/lib/commands/credits.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/credits.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/credits.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/current_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/current_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/current_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/current_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/deeprerequire.js b/lib/node_modules/@stdlib/repl/base/lib/commands/deeprerequire.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/deeprerequire.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/deeprerequire.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/delete_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/delete_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/delete_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/delete_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/donate.js b/lib/node_modules/@stdlib/repl/base/lib/commands/donate.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/donate.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/donate.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/evalin.js b/lib/node_modules/@stdlib/repl/base/lib/commands/evalin.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/evalin.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/evalin.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/example.js b/lib/node_modules/@stdlib/repl/base/lib/commands/example.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/example.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/example.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/help.js b/lib/node_modules/@stdlib/repl/base/lib/commands/help.js similarity index 98% rename from lib/node_modules/@stdlib/repl/lib/commands/help.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/help.js index cf849a33b582..c1aa57b58da1 100644 --- a/lib/node_modules/@stdlib/repl/lib/commands/help.js +++ b/lib/node_modules/@stdlib/repl/base/lib/commands/help.js @@ -29,7 +29,6 @@ var alias2help = require( '@stdlib/repl/help' ); var indexOf = require( './../index_of.js' ); var findUniqueEntry = require( './../find_unique_entry.js' ); var alias2string = require( './../alias_to_string.js' ); -var HELP_TEXT = require( './../help_text.js' ); var DOCS = require( './../repl_docs.js' ); @@ -60,7 +59,7 @@ function command( repl, cmds ) { var N; var i; if ( arguments.length === 0 ) { - repl._ostream.write( HELP_TEXT ); + repl._ostream.write( repl._helpText ); return; } aliases = repl._aliases; diff --git a/lib/node_modules/@stdlib/repl/lib/commands/info.js b/lib/node_modules/@stdlib/repl/base/lib/commands/info.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/info.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/info.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/is_keyword.js b/lib/node_modules/@stdlib/repl/base/lib/commands/is_keyword.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/is_keyword.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/is_keyword.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/is_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/is_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/is_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/is_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/license_text.js b/lib/node_modules/@stdlib/repl/base/lib/commands/license_text.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/license_text.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/license_text.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/load.js b/lib/node_modules/@stdlib/repl/base/lib/commands/load.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/load.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/load.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/load_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/load_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/load_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/load_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/quit.js b/lib/node_modules/@stdlib/repl/base/lib/commands/quit.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/quit.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/quit.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/rename_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/rename_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/rename_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/rename_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/rerequire.js b/lib/node_modules/@stdlib/repl/base/lib/commands/rerequire.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/rerequire.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/rerequire.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/reset.js b/lib/node_modules/@stdlib/repl/base/lib/commands/reset.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/reset.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/reset.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/tutorial.js b/lib/node_modules/@stdlib/repl/base/lib/commands/tutorial.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/tutorial.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/tutorial.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/user_doc.js b/lib/node_modules/@stdlib/repl/base/lib/commands/user_doc.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/user_doc.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/user_doc.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/vars.js b/lib/node_modules/@stdlib/repl/base/lib/commands/vars.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/vars.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/vars.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/vars_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/vars_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/vars_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/vars_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/workspace.js b/lib/node_modules/@stdlib/repl/base/lib/commands/workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/workspaces.js b/lib/node_modules/@stdlib/repl/base/lib/commands/workspaces.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/workspaces.js rename to lib/node_modules/@stdlib/repl/base/lib/commands/workspaces.js diff --git a/lib/node_modules/@stdlib/repl/lib/compile_code.js b/lib/node_modules/@stdlib/repl/base/lib/compile_code.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/compile_code.js rename to lib/node_modules/@stdlib/repl/base/lib/compile_code.js diff --git a/lib/node_modules/@stdlib/repl/lib/compile_command.js b/lib/node_modules/@stdlib/repl/base/lib/compile_command.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/compile_command.js rename to lib/node_modules/@stdlib/repl/base/lib/compile_command.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_expression.js b/lib/node_modules/@stdlib/repl/base/lib/complete_expression.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/complete_expression.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_expression.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_fs.js b/lib/node_modules/@stdlib/repl/base/lib/complete_fs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/complete_fs.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_fs.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_require.js b/lib/node_modules/@stdlib/repl/base/lib/complete_require.js similarity index 98% rename from lib/node_modules/@stdlib/repl/lib/complete_require.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_require.js index 03888ac53a42..6f367dbb2b87 100644 --- a/lib/node_modules/@stdlib/repl/lib/complete_require.js +++ b/lib/node_modules/@stdlib/repl/base/lib/complete_require.js @@ -27,7 +27,7 @@ var readDir = require( '@stdlib/fs/read-dir' ).sync; var startsWith = require( '@stdlib/string/starts-with' ); var extname = require( '@stdlib/utils/extname' ); var cwd = require( '@stdlib/process/cwd' ); -var indexRegExp = require( './regexp_index.js' ); // eslint-disable-line stdlib/no-require-index +var indexRegExp = require( './regexp_index.js' ); var relativePathRegExp = require( './regexp_relative_require_path.js' ); var pathRegExp = require( './regexp_path.js' ); var contains = require( './contains.js' ); diff --git a/lib/node_modules/@stdlib/repl/lib/complete_tutorial.js b/lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/complete_tutorial.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_walk_find_last.js b/lib/node_modules/@stdlib/repl/base/lib/complete_walk_find_last.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/complete_walk_find_last.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_walk_find_last.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/complete_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/complete_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/complete_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/completer.js b/lib/node_modules/@stdlib/repl/base/lib/completer.js similarity index 88% rename from lib/node_modules/@stdlib/repl/lib/completer.js rename to lib/node_modules/@stdlib/repl/base/lib/completer.js index ce393c6e5b43..d859c4a6a92c 100644 --- a/lib/node_modules/@stdlib/repl/lib/completer.js +++ b/lib/node_modules/@stdlib/repl/base/lib/completer.js @@ -29,13 +29,11 @@ var fsRegExp = require( './regexp_fs_aliases.js' ); var requireRegExp = require( './regexp_require.js' ); var workspaceRegExp = require( './regexp_workspace.js' ); var tutorialRegExp = require( './regexp_tutorial.js' ); -var settingsRegExp = require( './regexp_settings.js' ); var reservedCharsRegExp = require( './regexp_reserved_syntax_characters.js' ); var completeRequire = require( './complete_require.js' ); var completeFS = require( './complete_fs.js' ); var completeWorkspace = require( './complete_workspace.js' ); var completeTutorial = require( './complete_tutorial.js' ); -var completeSettings = require( './complete_settings.js' ); var completeExpression = require( './complete_expression.js' ); @@ -165,21 +163,6 @@ function completer( repl ) { debug( 'Results: %s', res.join( ', ' ) ); return clbk( null, [ res, line ] ); } - // Test if the line has an incomplete settings expression: - match = line.match( settingsRegExp() ); - if ( match ) { - debug( 'Detected incomplete settings expression.' ); - - debug( 'Expression: %s', match[ 0 ] ); - debug( 'Settings API: %s', match[ 1 ] ); - debug( 'Value to complete: %s', match[ 3 ] ); - line = completeSettings( res, repl, match[ 0 ], match[ 1 ], match[ 3 ] ); // eslint-disable-line max-len - res = normalize( res ); - - debug( 'Completion filter: %s', line ); - debug( 'Results: %s', res.join( ', ' ) ); - return clbk( null, [ res, line ] ); - } // Sanity check that we are attempting to complete something which is completable: if ( reservedCharsRegExp().test( line[ repl._rli.cursor-1 ] ) ) { debug( 'Detected attempt to trigger completion after a special character.' ); diff --git a/lib/node_modules/@stdlib/repl/lib/contains.js b/lib/node_modules/@stdlib/repl/base/lib/contains.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/contains.js rename to lib/node_modules/@stdlib/repl/base/lib/contains.js diff --git a/lib/node_modules/@stdlib/repl/lib/create_accessor.js b/lib/node_modules/@stdlib/repl/base/lib/create_accessor.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/create_accessor.js rename to lib/node_modules/@stdlib/repl/base/lib/create_accessor.js diff --git a/lib/node_modules/@stdlib/repl/lib/create_evaluation_context.js b/lib/node_modules/@stdlib/repl/base/lib/create_evaluation_context.js similarity index 94% rename from lib/node_modules/@stdlib/repl/lib/create_evaluation_context.js rename to lib/node_modules/@stdlib/repl/base/lib/create_evaluation_context.js index 1850354df078..7020e14162ed 100644 --- a/lib/node_modules/@stdlib/repl/lib/create_evaluation_context.js +++ b/lib/node_modules/@stdlib/repl/base/lib/create_evaluation_context.js @@ -45,10 +45,11 @@ var resolveLookupPaths = Module._resolveLookupPaths; // eslint-disable-line no-u * @private * @param {Array} out - strided output array for storing variables added to the evaluation context * @param {Stream} ostream - output stream +* @param {Stream} estream - error stream * @param {boolean} sandbox - boolean indicating whether the evaluation context should be "sandboxed" * @returns {Object} context */ -function createContext( out, ostream, sandbox ) { +function createContext( out, ostream, estream, sandbox ) { var context; var keys; var i; @@ -67,7 +68,7 @@ function createContext( out, ostream, sandbox ) { setReadOnly( context, 'global', context ); // Create a new `console` interface: - setReadOnly( context, 'console', new Console( ostream ) ); + setReadOnly( context, 'console', new Console( ostream, estream ) ); // Create a new `module` object: setReadOnly( context, 'module', new Module( '' ) ); diff --git a/lib/node_modules/@stdlib/repl/lib/create_require.js b/lib/node_modules/@stdlib/repl/base/lib/create_require.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/create_require.js rename to lib/node_modules/@stdlib/repl/base/lib/create_require.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/defaults.js b/lib/node_modules/@stdlib/repl/base/lib/defaults.js new file mode 100644 index 000000000000..02b42792e96b --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/defaults.js @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var stdin = require( '@stdlib/streams/node/stdin' ); +var stdout = require( '@stdlib/streams/node/stdout' ); +var stderr = require( '@stdlib/streams/node/stderr' ); + + +// MAIN // + +/** +* Returns default options. +* +* @private +* @returns {Object} default options +* +* @example +* var opts = defaults(); +* // returns {...} +*/ +function defaults() { + return { + // Default input stream: + 'input': stdin, + + // Default output stream: + 'output': stdout, + + // Default error stream: + 'error': stderr, + + // Number of milliseconds to execute a command before terminating execution: + 'timeout': 4294967295, + + // Flag indicating whether to run a REPL in a sandboxed context: + 'sandbox': true, + + // File path specifying where to save REPL command history: + 'save': '', + + // File path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file): + 'load': '', + + // File path specifying where to save REPL commands and printed output: + 'log': '', + + // Flag indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced: + 'quiet': false + }; +} + + +// EXPORTS // + +module.exports = defaults; diff --git a/lib/node_modules/@stdlib/repl/lib/drain.js b/lib/node_modules/@stdlib/repl/base/lib/drain.js similarity index 73% rename from lib/node_modules/@stdlib/repl/lib/drain.js rename to lib/node_modules/@stdlib/repl/base/lib/drain.js index 84187842c4c5..78aab49df7ce 100644 --- a/lib/node_modules/@stdlib/repl/lib/drain.js +++ b/lib/node_modules/@stdlib/repl/base/lib/drain.js @@ -22,13 +22,9 @@ // MODULES // -var inspect = require( 'util' ).inspect; var logger = require( 'debug' ); -var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); -var replace = require( '@stdlib/string/replace' ); var noop = require( '@stdlib/utils/noop' ); var nextTick = require( '@stdlib/utils/next-tick' ); -var displayPrompt = require( './display_prompt.js' ); var updateRegExpCache = require( './update_regexp_cache.js' ); var restoreRegExpMatches = require( './restore_regexp_matches.js' ); @@ -53,8 +49,6 @@ function drain( repl ) { var opts; var code; var res; - var pre; - var tmp; if ( repl._busy ) { debug( 'Waiting on a command to finish...' ); @@ -62,9 +56,6 @@ function drain( repl ) { } if ( repl._queue.length === 0 ) { debug( 'Command queue is empty.' ); - if ( !repl._closed ) { - displayPrompt( repl, false ); - } repl.emit( 'drain' ); return; } @@ -100,12 +91,10 @@ function drain( repl ) { } } catch ( error ) { debug( 'Error: %s', error.message ); - repl._ostream.write( 'Error: '+error.message+'\n' ); - repl.emit( 'command', code.raw, false ); // command failed + repl.emit( 'command', code.raw, false, error, false ); // command failed updateRegExpCache( repl._regexp ); repl._busy = false; - displayPrompt( repl, false ); // Clear the command queue, as an error may cause downstream "dependencies" to not be fulfilled, etc: repl._queue.clear(); @@ -125,17 +114,6 @@ function drain( repl ) { // Cache the result: repl._ans = res; - if ( code.silent === false && res !== void 0 ) { - pre = replace( repl._outputPrompt, '%d', (repl._count+1).toString() ); - - // TODO: pretty printing (can defer to `util.inspect` for now, but will invariably want more control over this later, possibly including default configuration, etc, either at startup, during runtime, or according to an external configuration file) - if ( isndarrayLike( res ) ) { - tmp = res.toString(); // FIXME: this is a hack in order to avoid printing private ndarray properties in the REPL, as done by the built-in `util.inspect`. Ideally, we'd roll our own inspector which specifically accommodates stdlib's ndarray and other specialized classes. - } else { - tmp = repl._ans; - } - repl._ostream.write( pre+inspect( tmp )+'\n' ); - } // Finish processing: return beforeNextTick(); @@ -178,9 +156,7 @@ function drain( repl ) { if ( error ) { debug( 'Error: %s', error.message ); - repl._ostream.write( 'Error: '+error.message+'\n' ); - repl.emit( 'command', code.raw, false ); // command failed - displayPrompt( repl, false ); + repl.emit( 'command', code.raw, false, error, false ); // command failed // Indicate that command execution has completed: repl._busy = false; @@ -193,12 +169,6 @@ function drain( repl ) { // Cache the result: repl._ans = [ res, results ]; - if ( code.silent === false && ( res !== void 0 || results !== void 0 ) ) { // eslint-disable-line max-len - pre = replace( repl._outputPrompt, '%d', (repl._count+1).toString() ); - - // TODO: pretty printing (can defer to `util.inspect` for now, but will invariably want more control over this later, possibly including default configuration, etc, either at startup, during runtime, or according to an external configuration file) - repl._ostream.write( pre+inspect( repl._ans )+'\n' ); - } // Finish processing: beforeNextTick(); @@ -220,7 +190,7 @@ function drain( repl ) { function beforeNextTick() { // Announce that the command succeeded: debug( 'Finished evaluating command.' ); - repl.emit( 'command', code.raw, true ); + repl.emit( 'command', code.raw, true, repl._ans, code.silent ); nextTick( onTick ); } diff --git a/lib/node_modules/@stdlib/repl/lib/filter_by_prefix.js b/lib/node_modules/@stdlib/repl/base/lib/filter_by_prefix.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/filter_by_prefix.js rename to lib/node_modules/@stdlib/repl/base/lib/filter_by_prefix.js diff --git a/lib/node_modules/@stdlib/repl/lib/find_unique_entry.js b/lib/node_modules/@stdlib/repl/base/lib/find_unique_entry.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/find_unique_entry.js rename to lib/node_modules/@stdlib/repl/base/lib/find_unique_entry.js diff --git a/lib/node_modules/@stdlib/repl/lib/fs_alias_args.js b/lib/node_modules/@stdlib/repl/base/lib/fs_alias_args.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/fs_alias_args.js rename to lib/node_modules/@stdlib/repl/base/lib/fs_alias_args.js diff --git a/lib/node_modules/@stdlib/repl/lib/fs_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/fs_aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/fs_aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/fs_aliases.js diff --git a/lib/node_modules/@stdlib/repl/lib/globals.js b/lib/node_modules/@stdlib/repl/base/lib/globals.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/globals.js rename to lib/node_modules/@stdlib/repl/base/lib/globals.js diff --git a/lib/node_modules/@stdlib/repl/lib/has_async_directive.js b/lib/node_modules/@stdlib/repl/base/lib/has_async_directive.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/has_async_directive.js rename to lib/node_modules/@stdlib/repl/base/lib/has_async_directive.js diff --git a/lib/node_modules/@stdlib/repl/lib/index.js b/lib/node_modules/@stdlib/repl/base/lib/index.js similarity index 92% rename from lib/node_modules/@stdlib/repl/lib/index.js rename to lib/node_modules/@stdlib/repl/base/lib/index.js index 063fd52f6aa5..80fec5e90aaf 100644 --- a/lib/node_modules/@stdlib/repl/lib/index.js +++ b/lib/node_modules/@stdlib/repl/base/lib/index.js @@ -19,13 +19,13 @@ 'use strict'; /** -* REPL environment. +* REPL. * -* @module @stdlib/repl +* @module @stdlib/repl/base * * @example * var debug = require( '@stdlib/streams/node/debug-sink' ); -* var REPL = require( '@stdlib/repl' ); +* var REPL = require( '@stdlib/repl/base' ); * * function onExit() { * console.log( 'REPL closed.' ); diff --git a/lib/node_modules/@stdlib/repl/lib/index_of.js b/lib/node_modules/@stdlib/repl/base/lib/index_of.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/index_of.js rename to lib/node_modules/@stdlib/repl/base/lib/index_of.js diff --git a/lib/node_modules/@stdlib/repl/lib/is_block_scope.js b/lib/node_modules/@stdlib/repl/base/lib/is_block_scope.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/is_block_scope.js rename to lib/node_modules/@stdlib/repl/base/lib/is_block_scope.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/is_multiline_input.js b/lib/node_modules/@stdlib/repl/base/lib/is_multiline_input.js new file mode 100644 index 000000000000..c768485bde47 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/is_multiline_input.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-invalid-this */ + +'use strict'; + +// MODULES // + +var Parser = require( 'acorn' ).Parser; +var parseLoose = require( 'acorn-loose' ).parse; +var logger = require( 'debug' ); +var multilinePlugin = require( './acorn_detect_multiline_input.js' ); + + +// VARIABLES // + +var debug = logger( 'repl:is-multiline-input' ); +var hasMultilineError = Parser.extend( multilinePlugin ).hasMultilineError; +var RE_WHITESPACE = /^\s*$/; +var RE_SINGLE_LINE_COMMENT = /^\s*\/\//; +var RE_MULTI_LINE_COMMENT = /^\s*\/\*.*\*\/$/; +var AOPTS = { + 'ecmaVersion': 'latest' +}; + + +// MAIN // + +/** +* Checks if the given input is a possible multi-line command. +* +* @private +* @param {string} input - input command +* @returns {boolean} boolean indicating whether the given input is a possible multi-line command +*/ +function isMultilineInput( input ) { + var node; + var tmp; + var ast; + + debug( 'Attempting to detect multi-line input...' ); + if ( RE_WHITESPACE.test( input ) ) { + debug( 'Multi-line input not detected.' ); + return false; + } + if ( RE_SINGLE_LINE_COMMENT.test( input ) || RE_MULTI_LINE_COMMENT.test( input ) ) { // eslint-disable-line max-len + debug( 'Multi-line input not detected.' ); + return false; + } + // Check if the command has valid syntax... + tmp = this._processCommand( input ); + if ( !( tmp instanceof Error ) ) { + debug( 'Multi-line input not detected.' ); + return false; + } + if ( hasMultilineError( input, AOPTS ) ) { + debug( 'Detected multi-line input. Triggering multi-line mode...' ); + return true; + } + // Still possible that a user is attempting to enter an object literal across multiple lines... + ast = parseLoose( input, AOPTS ); + + // Check for a trailing node which is being interpreted as a block statement, as this could be an object literal... + node = ast.body[ ast.body.length-1 ]; + if ( node.type === 'BlockStatement' && node.end === ast.end ) { + tmp = input.slice( node.start, node.end ); + if ( hasMultilineError( tmp, AOPTS ) ) { + debug( 'Detected multi-line input. Triggering multi-line mode...' ); + return true; + } + } + debug( 'Multi-line input not detected.' ); + return false; +} + + +// EXPORTS // + +module.exports = isMultilineInput; diff --git a/lib/node_modules/@stdlib/repl/lib/is_scope.js b/lib/node_modules/@stdlib/repl/base/lib/is_scope.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/is_scope.js rename to lib/node_modules/@stdlib/repl/base/lib/is_scope.js diff --git a/lib/node_modules/@stdlib/repl/lib/is_silent_command.js b/lib/node_modules/@stdlib/repl/base/lib/is_silent_command.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/is_silent_command.js rename to lib/node_modules/@stdlib/repl/base/lib/is_silent_command.js diff --git a/lib/node_modules/@stdlib/repl/lib/log.js b/lib/node_modules/@stdlib/repl/base/lib/log.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/log.js rename to lib/node_modules/@stdlib/repl/base/lib/log.js diff --git a/lib/node_modules/@stdlib/repl/lib/longest_common_prefix.js b/lib/node_modules/@stdlib/repl/base/lib/longest_common_prefix.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/longest_common_prefix.js rename to lib/node_modules/@stdlib/repl/base/lib/longest_common_prefix.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/main.js b/lib/node_modules/@stdlib/repl/base/lib/main.js new file mode 100644 index 000000000000..4816c427590c --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/main.js @@ -0,0 +1,719 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-restricted-syntax, no-invalid-this, no-underscore-dangle */ + +'use strict'; + +// MODULES // + +var EventEmitter = require( 'events' ).EventEmitter; +var resolve = require( 'path' ).resolve; +var logger = require( 'debug' ); +var inherit = require( '@stdlib/utils/inherit' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isFunction = require( '@stdlib/assert/is-function' ); +var isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' ); +var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +var format = require( '@stdlib/string/format' ); +var cwd = require( '@stdlib/process/cwd' ); +var readFileSync = require( '@stdlib/fs/read-file' ).sync; +var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; +var fifo = require( '@stdlib/utils/fifo' ); +var nextTick = require( '@stdlib/utils/next-tick' ); +var validate = require( './validate.js' ); +var defaults = require( './defaults.js' ); +var setAliases = require( './set_aliases.js' ); +var setAliasesGlobal = require( './set_aliases_global.js' ); +var setCommands = require( './set_commands.js' ); +var setCommandsGlobal = require( './set_commands_global.js' ); +var createEvalContext = require( './create_evaluation_context.js' ); +var commands = require( './commands.js' ); +var completerFactory = require( './completer.js' ); +var tokenizer = require( './tokenizer.js' ); +var processCommand = require( './process_command.js' ); +var compileCommand = require( './compile_command.js' ); +var processInput = require( './process_input.js' ); +var isMultilineInput = require( './is_multiline_input.js' ); +var ALIAS_OVERRIDES = require( './alias_overrides.js' ); + + +// VARIABLES // + +var debug = logger( 'repl' ); + + +// MAIN // + +/** +* REPL base constructor. +* +* @constructor +* @param {Options} options - constructor options +* @param {ReadableStream} [options.input=process.stdin] - input stream +* @param {WritableStream} [options.output=process.stdout] - output stream +* @param {WritableStream} [options.error=process.stderr] - error stream +* @param {boolean} [options.sandbox=true] - boolean indicating whether to run a REPL in a sandboxed context +* @param {PositiveInteger} [options.timeout=4294967295] - number of milliseconds to execute a command before terminating execution +* @param {string} [options.load] - file path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file) +* @param {string} [options.save] - file path specifying where to save REPL command history +* @param {string} [options.log] - file path specifying where to save REPL commands and printed output +* @param {string} [options.quiet=false] - boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced +* @throws {Error} must provide valid options +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* function onExit() { +* console.log( 'REPL closed.' ); +* } +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* repl.on( 'exit', onExit ); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +function REPL( options ) { + var opts; + var self; + var err; + + if ( !( this instanceof REPL ) ) { + if ( arguments.length ) { + return new REPL( options ); + } + return new REPL(); + } + self = this; + + opts = defaults(); + if ( arguments.length ) { + err = validate( opts, options ); + if ( err ) { + throw err; + } + } + + debug( 'Options: %s', JSON.stringify({ + 'input': '', + 'output': '', + 'sandbox': opts.sandbox, + 'timeout': opts.timeout, + 'isTTY': opts.isTTY, + 'padding': opts.padding, + 'load': opts.load, + 'save': opts.save, + 'log': opts.log, + 'quiet': opts.quiet + })); + + // Call the parent constructor: + EventEmitter.call( this ); + + // Cache references to the input and output streams: + setNonEnumerableReadOnly( this, '_istream', opts.input ); + setNonEnumerableReadOnly( this, '_ostream', opts.output ); + setNonEnumerableReadOnly( this, '_estream', opts.error ); + + // Cache options: + setNonEnumerableReadOnly( this, '_timeout', opts.timeout ); + setNonEnumerableReadOnly( this, '_sandbox', opts.sandbox ); + setNonEnumerable( this, '_quiet', opts.quiet ); // allow this to be internally toggled + + // Initialize an internal data store: + setNonEnumerableReadOnly( this, '_internal', {} ); + setNonEnumerableReadOnly( this._internal, 'presentation', {} ); + setNonEnumerableReadOnly( this._internal.presentation, 'cache', {} ); + setNonEnumerable( this._internal.presentation, 'counter', 0 ); + + // Initialize an internal command queue: + setNonEnumerableReadOnly( this, '_queue', fifo() ); + + // Initialize a strided internal buffer for storing the command history: + setNonEnumerableReadOnly( this, '_history', [] ); + + // Initialize an internal buffer for storing the current command: + setNonEnumerableReadOnly( this, '_cmd', [] ); + + // Initialize a executed command counter: + setNonEnumerable( this, '_count', -1 ); + + // Initialize an internal buffer for saving regular expression matches between command evaluations: + setNonEnumerableReadOnly( this, '_regexp', [ '', '', '', '', '', '', '', '', '', '' ] ); + + // Initialize a strided internal cache of context globals: + setNonEnumerableReadOnly( this, '_contextVars', [] ); + + // For non-sandboxed REPLs, initialize an internal buffer for storing a (unique) sorted list of "built-in" REPL global variables/properties which need to be deleted upon closing a REPL in order to allow garbage collection and prevent memory leaks: + setNonEnumerableReadOnly( this, '_globalVars', ( this._sandbox ) ? null : [] ); + + // Initialize a strided internal cache of resolved global variables/properties in order to allow, e.g., help text look-up based on object reference, not just alias name (note: members alternate between `''` and ``): + setNonEnumerableReadOnly( this, '_aliases', [] ); + + // Initialize a strided internal buffer for storing user-defined documentation: + setNonEnumerableReadOnly( this, '_userdocs', [] ); + + // Initialize an internal buffer for storing a (unique) sorted list of workspace global variables/properties which were *initially* introduced during a REPL session (note: this overlaps with `_globalVars`, but more accurately represents a snapshot of the `global` state *before* a user begins entering commands, which is useful when wanting determine what variables/identifiers a user has introduced during a REPL session): + setNonEnumerableReadOnly( this, '_workspace', [] ); + + // Initialize a strided internal buffer for caching "base" workspace variables: + setNonEnumerableReadOnly( this, '_workspaces', {} ); + setReadOnly( this._workspaces, 'base', [] ); + + // Define the current workspace: + setNonEnumerable( this, '_currentWorkspace', 'base' ); + + // Initialize an internal flag indicating whether the REPL has been closed: + setNonEnumerable( this, '_closed', false ); + + // Initialize an internal flag indicating whether the REPL is currently busy with asynchronous processing: + setNonEnumerable( this, '_busy', false ); + + // Initialize an internal variable for caching the result of the last successfully evaluated command: + setNonEnumerable( this, '_ans', void 0 ); + + // Initialize an internal variable for setting a command callback: + setNonEnumerable( this, '_done', void 0 ); + + // Create a REPL execution context: + setNonEnumerable( this, '_context', this.createContext() ); + + // Create a new TAB completer: + setNonEnumerableReadOnly( this, '_completer', completerFactory( this ) ); + + // Create a new tokenizer: + setNonEnumerableReadOnly( this, '_tokenizer', tokenizer ); + + // Add listener for "command" events: + this.on( 'command', onCommand ); + this.on( 'input', onInput ); + this.on( 'interrupt', onInterrupt ); + + // TODO: check whether to synchronously initialize a REPL history file + + // TODO: check whether to synchronously initialize a REPL log file + + // Check whether to load and execute a JavaScript file (e.g., prior REPL history) upon startup... + if ( opts.load ) { + this.load( opts.load ); + } else { + this._count += 1; + } + return this; + + /** + * Callback invoked upon encountering a command input. + * + * @private + * @param {string} input - input command + */ + function onInput( input ) { + debug( 'Received an input: %s', input ); + if ( self._closed === false ) { + processInput( self, input ); + } + } + + /** + * Callback invoked upon receiving an interrupt. + * + * @private + * @returns {void} + */ + function onInterrupt() { + debug( 'Received an interrupt.' ); + + // If the REPL is currently busy executing a command, stop waiting for it to finish: + if ( self._busy ) { + self._done( new Error( 'unexpected error. Command execution terminated.' ) ); + return; + } + + // Reset the command queue: + self._queue.clear(); + } + + /** + * Callback invoked upon executing a command. + * + * @private + * @param {string} cmd - command + * @param {boolean} success - boolean indicating whether the command successfully executed + * @param {*} res - result + * @param {boolean} silent - boolean indicating whether the command output should be silenced + */ + function onCommand( cmd, success ) { + self._count += 1; + debug( 'Command count: %d', self._count ); + + // Update the internal command history buffer: [..., , , , ...] + self._history.push( self._count, cmd, success ); + + // TODO: if successful and if necessary, (asynchronously?) write the command to a history file (question: do we only want to write successful commands to the history file? maybe we need to option for limiting to successful commands?) + + // TODO: if necessary, (asynchronously?) write the command and result to a log file (JSON serialization?) + } +} + +/* +* Inherit from the `EventEmitter` prototype. +*/ +inherit( REPL, EventEmitter ); + +/** +* Checks if the given input is a possible multi-line command. +* +* @private +* @name _isMultilineInput +* @memberof REPL.prototype +* @type {Function} +* @param {string} input - input command +* @returns {boolean} boolean indicating whether the given input is a possible multi-line command +*/ +setNonEnumerableReadOnly( REPL.prototype, '_isMultilineInput', isMultilineInput ); + +/** +* Processes a "raw" input command.. +* +* @private +* @name _processCommand +* @memberof REPL.prototype +* @type {Function} +* @param {string} code - unevaluated command +* @returns {(string|Error)} processed command or an error +*/ +setNonEnumerableReadOnly( REPL.prototype, '_processCommand', processCommand ); + +/** +* Compiles a command. +* +* @private +* @name _compileCommand +* @memberof REPL.prototype +* @type {Function} +* @param {string} cmd - command string +* @returns {(Object|Error)} compiled command or an error +*/ +setNonEnumerableReadOnly( REPL.prototype, '_compileCommand', compileCommand ); + +/** +* Creates a REPL context. +* +* @name createContext +* @memberof REPL.prototype +* @type {Function} +* @returns {Object} REPL context +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // Return a new REPL context: +* var ctx = repl.createContext(); +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContext() { + var context; + var cmds; + + debug( 'Creating REPL execution context...' ); + + // Create an evaluation context: + context = createEvalContext( this._contextVars, this._ostream, this._estream, this._sandbox ); // eslint-disable-line max-len + + // Add project APIs... + if ( this._sandbox ) { + setAliases( this._aliases, context, ALIAS_OVERRIDES ); + } else { + setAliasesGlobal( this._globalVars, this._aliases, context, ALIAS_OVERRIDES ); // eslint-disable-line max-len + } + + // Get the list of REPL-specific commands: + cmds = commands( this ); + + // Add commands requiring privileged access to internal instance variables... + if ( this._sandbox ) { + setCommands( context, cmds ); + } else { + setCommandsGlobal( this._globalVars, context, cmds ); + } + + return context; +}); + +/** +* Resets a REPL's context. +* +* @name resetContext +* @memberof REPL.prototype +* @type {Function} +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // ... +* +* // Reset the REPL context: +* repl.resetContext(); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'resetContext', function resetContext() { + var tmp; + var key; + var o; + var i; + var j; + + debug( 'Resetting REPL execution context...' ); + + // Before creating a new execution context in a non-sandboxed environment, remove current workspace variables in order to allow garbage collection and avoid memory leaks (e.g., variables/functions declared during a REPL session which might remain bound to the environment `global` after clearing a REPL): + if ( this._sandbox === false ) { + // WARNING: in a non-sandboxed environment, if a global variable is externally introduced during a REPL session (i.e., introduced via a mechanism outside of the REPL environment), we will delete that global variable, which means the following logic may introduce unintended side-effects for this particular edge case (e.g., application code may expect the presence of the subsequently deleted global variable). While not ideal, (a) user applications should not be introducing globals to begin with and (b) the probability of a user running a REPL session, a user clearing that REPL session, AND a global variable being introduced between starting a REPL and clearing the REPL should be negligible. + tmp = this._context.vars(); + for ( i = 0; i < tmp.length; i++ ) { + if ( isConfigurableProperty( this._context, tmp[ i ] ) ) { + delete this._context[ tmp[ i ] ]; + } + } + + // Remove REPL globals: + for ( i = 0; i < this._globalVars.length; i++ ) { + o = this._context; + key = this._globalVars[ i ].split( '.' ); // Note: this addresses nested key paths (e.g., `a.b.c`) + for ( j = 0; j < key.length-1; j++ ) { + if ( !hasOwnProp( o, key[ j ] ) ) { + o = null; + break; + } + o = o[ key[ j ] ]; + } + if ( o && isConfigurableProperty( o, key[ j ] ) ) { + delete o[ key[ j ] ]; + } + } + } + // Reset internal buffers for storing context data: + if ( this._sandbox === false ) { + this._globalVars.length = 0; + } + this._aliases.length = 0; + this._workspace.length = 0; + this._contextVars.length = 0; + + // Create a new execution context... + this._context = this.createContext(); + this.emit( 'reset', this._context ); // note: emitting the context allows REPL wrappers to extend the newly created context + + return this; +}); + +/** +* Clears a REPL's history. +* +* @name clearHistory +* @memberof REPL.prototype +* @type {Function} +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // ... +* +* // Clear the REPL history: +* repl.clearHistory(); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'clearHistory', function clearHistory() { + debug( 'Resetting REPL history...' ); + this._history.length = 0; + return this; +}); + +/** +* Clears user-defined documentation. +* +* @name clearUserDocs +* @memberof REPL.prototype +* @type {Function} +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // ... +* +* // Clear the user defined documentation: +* repl.clearUserDocs(); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'clearUserDocs', function clearUserDocs() { + debug( 'Resetting REPL user-defined documentation...' ); + this._userdocs.length = 0; + return this; +}); + +/** +* Loads and evaluates a JavaScript file line-by-line. +* +* @name load +* @memberof REPL.prototype +* @type {Function} +* @param {string} fpath - file path +* @param {Function} clbk - callback +* @throws {Error} cannot load a file into a closed REPL +* @throws {TypeError} first argument must be a string +* @throws {TypeError} second argument must be a function +* @returns {void} +* +* @example +* // TODO +*/ +setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { + var self; + var file; + var len; + var i; + if ( this._closed ) { + throw new Error( 'invalid operation. Cannot load a file into a REPL which has already closed.' ); + } + if ( !isString( fpath ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', fpath ) ); + } + if ( !isFunction( clbk ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) ); + } + // Resolve the provided path to an absolute file path: + fpath = resolve( cwd(), fpath ); + debug( 'Loading filepath: %s', fpath ); + + // Attempt to synchronously read the file: + file = readFileSync( fpath, 'utf8' ); + if ( file instanceof Error ) { + debug( 'Error: %s', file.message ); + clbk( file ); + return; + } + self = this; + + // Split the file content into individual lines: + file = file.split( RE_EOL ); + + // Forward each line to the REPL readline interface in order to mimic user input... + len = file.length; + i = -1; + + nextTick( next ); + + /** + * Callback invoked after draining the command queue. + * + * @private + * @param {string} cmd - command + * @param {boolean} success - boolean indicating whether the command successfully executed + */ + function next() { + i += 1; + if ( i < len ) { + if ( file[ i ] ) { + self._rli.write( file[ i ]+'\n' ); + self.once( 'drain', next ); + } else { + nextTick( next ); + } + } else { + nextTick( clbk ); + } + } +}); + +/** +* Resets a REPL. +* +* @name reset +* @memberof REPL.prototype +* @type {Function} +* @throws {Error} cannot reset a closed REPL +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // ... +* +* // Reset the REPL: +* repl.reset(); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'reset', function onReset() { + if ( this._closed ) { + throw new Error( 'invalid operation. Cannot reset a REPL which has already closed.' ); + } + debug( 'Resetting REPL...' ); + + // Reset the command queue: + this._queue.clear(); + + // Clear the command history: + this.clearHistory(); + + // Reset the execution context: + this.resetContext(); + + return this; +}); + +/** +* Closes a REPL. +* +* @name close +* @memberof REPL.prototype +* @type {Function} +* @returns {REPL} REPL instance +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ +setNonEnumerableReadOnly( REPL.prototype, 'close', function close() { + var self; + if ( this._closed ) { + debug( 'Attempted to close an already closed REPL.' ); + return this; + } + self = this; + this._closed = true; + + // Clear the command queue: + this._queue.clear(); + + // TODO: ensure REPL history is saved (flushed) to file before closing the REPL (see https://github.com/nodejs/node/blob/b21e7c7bcf23a2715951e4cd96180e4dbf1dcd4d/lib/repl.js#L805) + + // TODO: ensure REPL log is saved (flushed) to file before closing the REPL + + nextTick( onTick ); + + return this; + + /** + * Callback invoked upon the next tick of the event loop. + * + * @private + */ + function onTick() { + var tmp; + var key; + var o; + var i; + var j; + + // If this is a non-sandboxed REPL, remove global variables/properties which were introduced during context creation and by a user during a REPL session... + if ( self._sandbox === false ) { + // WARNING: in a non-sandboxed environment, if a global variable is externally introduced during a REPL session (i.e., introduced via a mechanism outside of the REPL environment), we will delete that global variable, which means the following logic may introduce unintended side-effects for this particular edge case (e.g., application code may expect the presence of the subsequently deleted global variable). While not ideal, (a) user applications should not be introducing globals to begin with and (b) the probability of a user running a REPL session, a user closing that REPL session, AND a global variable being introduced between starting a REPL and closing the REPL should be negligible. + tmp = self._context.vars(); // current workspace variables + for ( i = 0; i < tmp.length; i++ ) { + if ( isConfigurableProperty( self._context, tmp[ i ] ) ) { + delete self._context[ tmp[ i ] ]; + } + } + + // Remove REPL globals: + for ( i = 0; i < self._globalVars.length; i++ ) { + o = self._context; + key = self._globalVars[ i ].split( '.' ); // Note: this addresses nested key paths (e.g., `a.b.c`) + for ( j = 0; j < key.length-1; j++ ) { + if ( !hasOwnProp( o, key[ j ] ) ) { + o = null; + break; + } + o = o[ key[ j ] ]; + } + if ( o && isConfigurableProperty( o, key[ j ] ) ) { + delete o[ key[ j ] ]; + } + } + } + } +}); + + +// EXPORTS // + +module.exports = REPL; diff --git a/lib/node_modules/@stdlib/repl/lib/process_command.js b/lib/node_modules/@stdlib/repl/base/lib/process_command.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/process_command.js rename to lib/node_modules/@stdlib/repl/base/lib/process_command.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/process_input.js b/lib/node_modules/@stdlib/repl/base/lib/process_input.js new file mode 100644 index 000000000000..891d6a0af56c --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/process_input.js @@ -0,0 +1,89 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-underscore-dangle */ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var drain = require( './drain.js' ); + + +// VARIABLES // + +var debug = logger( 'repl:process-command' ); +var RE_WHITESPACE = /^\s*$/; +var RE_SINGLE_LINE_COMMENT = /^\s*\/\//; +var RE_MULTI_LINE_COMMENT = /^\s*\/\*.*\*\/$/; + + +// MAIN // + +/** +* Processes input command. +* +* @private +* @param {REPL} repl - REPL instance +* @param {string} input - input command +* @returns {void} +*/ +function processInput( repl, input ) { + var code; + var tmp; + + if ( RE_WHITESPACE.test( input ) ) { + return; + } + if ( RE_SINGLE_LINE_COMMENT.test( input ) || RE_MULTI_LINE_COMMENT.test( input ) ) { // eslint-disable-line max-len + debug( 'Detected single-line comment.' ); + tmp = input; + } else { + // Check if the command has valid syntax... + debug( 'Processing command...' ); + tmp = repl._processCommand( input ); + if ( tmp instanceof Error ) { + repl.emit( 'command', input, false, tmp, false ); // command failed + return; + } + } + debug( 'Successfully processed command.' ); + + // Attempt to compile the command: + debug( 'Attempting to compile command...' ); + code = repl._compileCommand( tmp ); + if ( code instanceof Error ) { + debug( 'Error: %s', code.message ); + repl.emit( 'command', input, false, code, false ); // command failed + return; + } + debug( 'Successfully compiled command.' ); + code.raw = input; + + // Add the command to the command queue: + repl._queue.push( code ); + + // Request to run the command: + drain( repl ); +} + + +// EXPORTS // + +module.exports = processInput; diff --git a/lib/node_modules/@stdlib/repl/lib/process_top_level_await.js b/lib/node_modules/@stdlib/repl/base/lib/process_top_level_await.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/process_top_level_await.js rename to lib/node_modules/@stdlib/repl/base/lib/process_top_level_await.js diff --git a/lib/node_modules/@stdlib/repl/lib/property_comparator.js b/lib/node_modules/@stdlib/repl/base/lib/property_comparator.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/property_comparator.js rename to lib/node_modules/@stdlib/repl/base/lib/property_comparator.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_fs_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_fs_aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_fs_aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_fs_aliases.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_index.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_index.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_index.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_index.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_path.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_path.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_path.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_path.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_relative_require_path.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_relative_require_path.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_relative_require_path.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_relative_require_path.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_require.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_require.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_require.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_require.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_reserved_syntax_characters.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_reserved_syntax_characters.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_reserved_syntax_characters.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_reserved_syntax_characters.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_tutorial.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_tutorial.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_workspace.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_workspace.js rename to lib/node_modules/@stdlib/repl/base/lib/regexp_workspace.js diff --git a/lib/node_modules/@stdlib/repl/lib/repl_docs.js b/lib/node_modules/@stdlib/repl/base/lib/repl_docs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/repl_docs.js rename to lib/node_modules/@stdlib/repl/base/lib/repl_docs.js diff --git a/lib/node_modules/@stdlib/repl/lib/reserved_keywords.js b/lib/node_modules/@stdlib/repl/base/lib/reserved_keywords.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/reserved_keywords.js rename to lib/node_modules/@stdlib/repl/base/lib/reserved_keywords.js diff --git a/lib/node_modules/@stdlib/repl/lib/reserved_keywords_common.js b/lib/node_modules/@stdlib/repl/base/lib/reserved_keywords_common.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/reserved_keywords_common.js rename to lib/node_modules/@stdlib/repl/base/lib/reserved_keywords_common.js diff --git a/lib/node_modules/@stdlib/repl/lib/reserved_keywords_empty_block_statement.js b/lib/node_modules/@stdlib/repl/base/lib/reserved_keywords_empty_block_statement.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/reserved_keywords_empty_block_statement.js rename to lib/node_modules/@stdlib/repl/base/lib/reserved_keywords_empty_block_statement.js diff --git a/lib/node_modules/@stdlib/repl/lib/resolve_globals.js b/lib/node_modules/@stdlib/repl/base/lib/resolve_globals.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/resolve_globals.js rename to lib/node_modules/@stdlib/repl/base/lib/resolve_globals.js diff --git a/lib/node_modules/@stdlib/repl/lib/resolve_local_scope.js b/lib/node_modules/@stdlib/repl/base/lib/resolve_local_scope.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/resolve_local_scope.js rename to lib/node_modules/@stdlib/repl/base/lib/resolve_local_scope.js diff --git a/lib/node_modules/@stdlib/repl/lib/resolve_local_scopes.js b/lib/node_modules/@stdlib/repl/base/lib/resolve_local_scopes.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/resolve_local_scopes.js rename to lib/node_modules/@stdlib/repl/base/lib/resolve_local_scopes.js diff --git a/lib/node_modules/@stdlib/repl/lib/restore_regexp_matches.js b/lib/node_modules/@stdlib/repl/base/lib/restore_regexp_matches.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/restore_regexp_matches.js rename to lib/node_modules/@stdlib/repl/base/lib/restore_regexp_matches.js diff --git a/lib/node_modules/@stdlib/repl/lib/set_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/set_aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/set_aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/set_aliases.js diff --git a/lib/node_modules/@stdlib/repl/lib/set_aliases_global.js b/lib/node_modules/@stdlib/repl/base/lib/set_aliases_global.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/set_aliases_global.js rename to lib/node_modules/@stdlib/repl/base/lib/set_aliases_global.js diff --git a/lib/node_modules/@stdlib/repl/lib/set_commands.js b/lib/node_modules/@stdlib/repl/base/lib/set_commands.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/set_commands.js rename to lib/node_modules/@stdlib/repl/base/lib/set_commands.js diff --git a/lib/node_modules/@stdlib/repl/lib/set_commands_global.js b/lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/set_commands_global.js rename to lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js diff --git a/lib/node_modules/@stdlib/repl/lib/setdiff.js b/lib/node_modules/@stdlib/repl/base/lib/setdiff.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/setdiff.js rename to lib/node_modules/@stdlib/repl/base/lib/setdiff.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/settings.js b/lib/node_modules/@stdlib/repl/base/lib/settings.js new file mode 100644 index 000000000000..53a38eaffc00 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/settings.js @@ -0,0 +1,68 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* REPL settings. +* +* @private +* @name SETTINGS +* @type {Object} +*/ +var SETTINGS = { + 'autoClosePairs': { + 'desc': 'Automatically insert matching brackets, parentheses, and quotes.', + 'type': 'boolean' + }, + 'autoDeletePairs': { + 'desc': 'Automatically delete adjacent matching brackets, parentheses, and quotes.', + 'type': 'boolean' + }, + 'autoPage': { + 'desc': 'Automatically page return values whose display size exceeds the visible screen.', + 'type': 'boolean' + }, + 'bracketedPaste': { + 'desc': 'Enable bracketed-paste mode.', + 'type': 'boolean' + }, + 'completionPreviews': { + 'desc': 'Enable the display of completion previews for auto-completion.', + 'type': 'boolean' + }, + 'autoDisableBracketedPasteOnExit': { + 'desc': 'Automatically disable bracketed-paste upon exiting the REPL.', + 'type': 'boolean' + }, + 'syntaxHighlighting': { + 'desc': 'Enable syntax highlighting.', + 'type': 'boolean' + }, + 'theme': { + 'desc': 'Set the syntax highlighting theme.', + 'type': 'string' + } +}; + + +// EXPORTS // + +module.exports = SETTINGS; diff --git a/lib/node_modules/@stdlib/repl/lib/settings_names.js b/lib/node_modules/@stdlib/repl/base/lib/settings_names.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/settings_names.js rename to lib/node_modules/@stdlib/repl/base/lib/settings_names.js diff --git a/lib/node_modules/@stdlib/repl/lib/settings_validators.js b/lib/node_modules/@stdlib/repl/base/lib/settings_validators.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/settings_validators.js rename to lib/node_modules/@stdlib/repl/base/lib/settings_validators.js diff --git a/lib/node_modules/@stdlib/repl/lib/tokenizer.js b/lib/node_modules/@stdlib/repl/base/lib/tokenizer.js similarity index 96% rename from lib/node_modules/@stdlib/repl/lib/tokenizer.js rename to lib/node_modules/@stdlib/repl/base/lib/tokenizer.js index fe0d9d8482b5..5a4ff1c8807a 100644 --- a/lib/node_modules/@stdlib/repl/lib/tokenizer.js +++ b/lib/node_modules/@stdlib/repl/base/lib/tokenizer.js @@ -29,12 +29,10 @@ var linkedList = require( '@stdlib/dstructs/linked-list' ); var contains = require( '@stdlib/array/base/assert/contains' ); var resolveLocalScopes = require( './resolve_local_scopes.js' ); var resolveLocalScope = require( './resolve_local_scope.js' ); -var commands = require( './commands.js' ); // VARIABLES // -var COMMANDS = commands(); var isUnrecognizedKeyword = contains.factory( [ 'async', 'let' ] ); var isControlKeyword = contains.factory( [ 'if', 'else', 'switch', 'case', 'catch', 'finally', 'try', 'return', 'break', 'continue' ] ); var isUnrecognizedControlKeyword = contains.factory( [ 'await' ] ); @@ -197,8 +195,6 @@ function tokenizer( line, context ) { */ function resolveIdentifier( node ) { var identifier; - var command; - var i; // Ignore placeholder nodes: if ( node.start >= node.end ) { @@ -228,19 +224,6 @@ function tokenizer( line, context ) { }); return true; } - // If identifier is a REPL command, push it as a token... - for ( i = 0; i < COMMANDS.length; i++ ) { - command = COMMANDS[ i ]; - if ( node.name === command[ 0 ] ) { - tokens.push({ - 'value': node.name, - 'type': 'command', - 'start': node.start, - 'end': node.end - }); - return true; - } - } // If identifier is in global context, push it as a token... identifier = context[ node.name ]; if ( identifier ) { diff --git a/lib/node_modules/@stdlib/repl/lib/tutorial_alias_args.js b/lib/node_modules/@stdlib/repl/base/lib/tutorial_alias_args.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/tutorial_alias_args.js rename to lib/node_modules/@stdlib/repl/base/lib/tutorial_alias_args.js diff --git a/lib/node_modules/@stdlib/repl/lib/tutorial_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/tutorial_aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js diff --git a/lib/node_modules/@stdlib/repl/lib/update_regexp_cache.js b/lib/node_modules/@stdlib/repl/base/lib/update_regexp_cache.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/update_regexp_cache.js rename to lib/node_modules/@stdlib/repl/base/lib/update_regexp_cache.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/validate.js b/lib/node_modules/@stdlib/repl/base/lib/validate.js new file mode 100644 index 000000000000..98ee9d76a257 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/lib/validate.js @@ -0,0 +1,131 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var isReadableStreamLike = require( '@stdlib/assert/is-node-readable-stream-like' ); +var isWritableStreamLike = require( '@stdlib/assert/is-node-writable-stream-like' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); + + +// MAIN // + +/** +* Validates function options. +* +* @private +* @param {Object} opts - destination object +* @param {Options} options - function options +* @param {string} [options.inputPrompt] - input prompt +* @param {string} [options.outputPrompt] - output prompt +* @param {ReadableStream} [options.input=] - input stream +* @param {WritableStream} [options.output] - output stream +* @param {boolean} [options.sandbox] - boolean indicating whether to run a REPL in a sandboxed context +* @param {PositiveInteger} [options.timeout] - number of milliseconds to execute a command before terminating execution +* @param {boolean} [options.isTTY] - boolean indicating whether the input and output streams should be treated like a TTY (terminal) and whether the REPL should use ANSI/VT100 escape codes when writing to the output stream +* @param {string} [options.welcome] - welcome message +* @param {NonNegativeInteger} [options.padding] - number of empty lines between successive commands +* @param {string} [options.load] - file path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file) +* @param {string} [options.save] - file path specifying where to save REPL command history +* @param {string} [options.log] - file path specifying where to save REPL commands and printed output +* @param {string} [options.quiet] - boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced +* @param {Object} [options.settings] - REPL settings +* @returns {(Error|null)} error or null +* +* @example +* var options = { +* 'sandbox': true +* }; +* var opts = {}; +* var err = validate( opts, options ); +* if ( err ) { +* throw err; +* } +*/ +function validate( opts, options ) { + if ( !isPlainObject( options ) ) { + return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + if ( hasOwnProp( options, 'input' ) ) { + opts.input = options.input; + if ( !isReadableStreamLike( options.input ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a readable stream. Option: `%s`.', 'input', options.input ) ); + } + } + if ( hasOwnProp( options, 'output' ) ) { + opts.output = options.output; + if ( !isWritableStreamLike( options.output ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a writable stream. Option: `%s`.', 'output', options.output ) ); + } + } + if ( hasOwnProp( options, 'error' ) ) { + opts.output = options.error; + if ( !isWritableStreamLike( options.error ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a writable stream. Option: `%s`.', 'error', options.error ) ); + } + } + if ( hasOwnProp( options, 'save' ) ) { + opts.save = options.save; + if ( !isString( options.save ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'save', options.save ) ); + } + } + if ( hasOwnProp( options, 'load' ) ) { + opts.load = options.load; + if ( !isString( options.load ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'load', options.load ) ); + } + } + if ( hasOwnProp( options, 'log' ) ) { + opts.log = options.log; + if ( !isString( options.log ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'log', options.log ) ); + } + } + if ( hasOwnProp( options, 'timeout' ) ) { + opts.timeout = options.timeout; + if ( !isPositiveInteger( options.timeout ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a positive integer. Option: `%s`.', 'timeout', options.timeout ) ); + } + } + if ( hasOwnProp( options, 'sandbox' ) ) { + opts.sandbox = options.sandbox; + if ( !isBoolean( options.sandbox ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'sandbox', options.sandbox ) ); + } + } + if ( hasOwnProp( options, 'quiet' ) ) { + opts.quiet = options.quiet; + if ( !isBoolean( options.quiet ) ) { + return new TypeError( format( 'invalid option. `%s` option must be a boolean. Option: `%s`.', 'quiet', options.quiet ) ); + } + } + return null; +} + + +// EXPORTS // + +module.exports = validate; diff --git a/lib/node_modules/@stdlib/repl/lib/validate_settings.js b/lib/node_modules/@stdlib/repl/base/lib/validate_settings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/validate_settings.js rename to lib/node_modules/@stdlib/repl/base/lib/validate_settings.js diff --git a/lib/node_modules/@stdlib/repl/lib/workspace_alias_args.js b/lib/node_modules/@stdlib/repl/base/lib/workspace_alias_args.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/workspace_alias_args.js rename to lib/node_modules/@stdlib/repl/base/lib/workspace_alias_args.js diff --git a/lib/node_modules/@stdlib/repl/lib/workspace_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/workspace_aliases.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/workspace_aliases.js rename to lib/node_modules/@stdlib/repl/base/lib/workspace_aliases.js diff --git a/lib/node_modules/@stdlib/repl/base/package.json b/lib/node_modules/@stdlib/repl/base/package.json new file mode 100644 index 000000000000..99f01f492489 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/repl/base", + "version": "0.0.0", + "description": "REPL environment.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "bin": { + "stdlib-repl": "./bin/cli" + }, + "main": "./lib", + "browser": { + "./lib": "./lib/browser/index.js", + "process": "process/" + }, + "directories": { + "benchmark": "./benchmark", + "data": "./data", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "scripts": "./scripts", + "test": "./test" + }, + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "repl", + "read-eval-print-loop", + "eval", + "evaluate", + "interact", + "interactive", + "console", + "terminal", + "shell", + "server", + "toplevel" + ], + "__stdlib__": { + "envs": { + "browser": false + } + } +} diff --git a/lib/node_modules/@stdlib/repl/scripts/build.js b/lib/node_modules/@stdlib/repl/base/scripts/build.js similarity index 100% rename from lib/node_modules/@stdlib/repl/scripts/build.js rename to lib/node_modules/@stdlib/repl/base/scripts/build.js diff --git a/lib/node_modules/@stdlib/repl/scripts/build_contributors.js b/lib/node_modules/@stdlib/repl/base/scripts/build_contributors.js similarity index 100% rename from lib/node_modules/@stdlib/repl/scripts/build_contributors.js rename to lib/node_modules/@stdlib/repl/base/scripts/build_contributors.js diff --git a/lib/node_modules/@stdlib/repl/scripts/build_help.js b/lib/node_modules/@stdlib/repl/base/scripts/build_help.js similarity index 100% rename from lib/node_modules/@stdlib/repl/scripts/build_help.js rename to lib/node_modules/@stdlib/repl/base/scripts/build_help.js diff --git a/lib/node_modules/@stdlib/repl/scripts/build_license.js b/lib/node_modules/@stdlib/repl/base/scripts/build_license.js similarity index 100% rename from lib/node_modules/@stdlib/repl/scripts/build_license.js rename to lib/node_modules/@stdlib/repl/base/scripts/build_license.js diff --git a/lib/node_modules/@stdlib/repl/scripts/build_tutorials.js b/lib/node_modules/@stdlib/repl/base/scripts/build_tutorials.js similarity index 100% rename from lib/node_modules/@stdlib/repl/scripts/build_tutorials.js rename to lib/node_modules/@stdlib/repl/base/scripts/build_tutorials.js diff --git a/lib/node_modules/@stdlib/repl/README.md b/lib/node_modules/@stdlib/repl/cli/README.md similarity index 100% rename from lib/node_modules/@stdlib/repl/README.md rename to lib/node_modules/@stdlib/repl/cli/README.md diff --git a/lib/node_modules/@stdlib/repl/benchmark/benchmark.js b/lib/node_modules/@stdlib/repl/cli/benchmark/benchmark.js similarity index 100% rename from lib/node_modules/@stdlib/repl/benchmark/benchmark.js rename to lib/node_modules/@stdlib/repl/cli/benchmark/benchmark.js diff --git a/lib/node_modules/@stdlib/repl/bin/cli b/lib/node_modules/@stdlib/repl/cli/bin/cli similarity index 96% rename from lib/node_modules/@stdlib/repl/bin/cli rename to lib/node_modules/@stdlib/repl/cli/bin/cli index 2a0199695efc..ca58c9c807ff 100755 --- a/lib/node_modules/@stdlib/repl/bin/cli +++ b/lib/node_modules/@stdlib/repl/cli/bin/cli @@ -37,7 +37,7 @@ var REPL = require( './../lib' ); */ function main() { var flags; - var repl; // eslint-disable-line no-unused-vars + var repl; var opts; var cli; @@ -86,7 +86,7 @@ function main() { } // Create a new REPL instance: - repl = new REPL( opts ); + repl = new REPL( opts ); // eslint-disable-line no-unused-vars } main(); diff --git a/lib/node_modules/@stdlib/repl/docs/commands/clear.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/clear.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/clear.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/clear.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/presentation_start.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/presentation_start.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/presentation_start.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/presentation_start.txt diff --git a/lib/node_modules/@stdlib/repl/docs/commands/presentation_stop.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/presentation_stop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/commands/presentation_stop.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/presentation_stop.txt diff --git a/lib/node_modules/@stdlib/repl/docs/migration-guides/README.md b/lib/node_modules/@stdlib/repl/cli/docs/migration-guides/README.md similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/migration-guides/README.md rename to lib/node_modules/@stdlib/repl/cli/docs/migration-guides/README.md diff --git a/lib/node_modules/@stdlib/repl/docs/migration-guides/ipython/README.md b/lib/node_modules/@stdlib/repl/cli/docs/migration-guides/ipython/README.md similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/migration-guides/ipython/README.md rename to lib/node_modules/@stdlib/repl/cli/docs/migration-guides/ipython/README.md diff --git a/lib/node_modules/@stdlib/repl/docs/migration-guides/ipython/data/data.csv b/lib/node_modules/@stdlib/repl/cli/docs/migration-guides/ipython/data/data.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/migration-guides/ipython/data/data.csv rename to lib/node_modules/@stdlib/repl/cli/docs/migration-guides/ipython/data/data.csv diff --git a/lib/node_modules/@stdlib/repl/docs/migration-guides/matlab/README.md b/lib/node_modules/@stdlib/repl/cli/docs/migration-guides/matlab/README.md similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/migration-guides/matlab/README.md rename to lib/node_modules/@stdlib/repl/cli/docs/migration-guides/matlab/README.md diff --git a/lib/node_modules/@stdlib/repl/docs/migration-guides/matlab/data/data.csv b/lib/node_modules/@stdlib/repl/cli/docs/migration-guides/matlab/data/data.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/migration-guides/matlab/data/data.csv rename to lib/node_modules/@stdlib/repl/cli/docs/migration-guides/matlab/data/data.csv diff --git a/lib/node_modules/@stdlib/repl/docs/tutorials/read_eval_print_loop.txt b/lib/node_modules/@stdlib/repl/cli/docs/tutorials/read_eval_print_loop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/tutorials/read_eval_print_loop.txt rename to lib/node_modules/@stdlib/repl/cli/docs/tutorials/read_eval_print_loop.txt diff --git a/lib/node_modules/@stdlib/repl/docs/usage.txt b/lib/node_modules/@stdlib/repl/cli/docs/usage.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/docs/usage.txt rename to lib/node_modules/@stdlib/repl/cli/docs/usage.txt diff --git a/lib/node_modules/@stdlib/repl/etc/cli_opts.json b/lib/node_modules/@stdlib/repl/cli/etc/cli_opts.json similarity index 100% rename from lib/node_modules/@stdlib/repl/etc/cli_opts.json rename to lib/node_modules/@stdlib/repl/cli/etc/cli_opts.json diff --git a/lib/node_modules/@stdlib/repl/examples/history.txt b/lib/node_modules/@stdlib/repl/cli/examples/history.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/history.txt rename to lib/node_modules/@stdlib/repl/cli/examples/history.txt diff --git a/lib/node_modules/@stdlib/repl/examples/http/client.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/http/client.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/http/client.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/http/client.js.txt diff --git a/lib/node_modules/@stdlib/repl/examples/http/server.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/http/server.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/http/server.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/http/server.js.txt diff --git a/lib/node_modules/@stdlib/repl/examples/index.js b/lib/node_modules/@stdlib/repl/cli/examples/index.js similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/index.js rename to lib/node_modules/@stdlib/repl/cli/examples/index.js diff --git a/lib/node_modules/@stdlib/repl/examples/net-socket-2/client.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/net-socket-2/client.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/net-socket-2/client.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/net-socket-2/client.js.txt diff --git a/lib/node_modules/@stdlib/repl/examples/net-socket-2/server.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/net-socket-2/server.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/net-socket-2/server.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/net-socket-2/server.js.txt diff --git a/lib/node_modules/@stdlib/repl/examples/net-socket/client.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/net-socket/client.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/net-socket/client.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/net-socket/client.js.txt diff --git a/lib/node_modules/@stdlib/repl/examples/net-socket/server.js.txt b/lib/node_modules/@stdlib/repl/cli/examples/net-socket/server.js.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/examples/net-socket/server.js.txt rename to lib/node_modules/@stdlib/repl/cli/examples/net-socket/server.js.txt diff --git a/lib/node_modules/@stdlib/repl/lib/actions.js b/lib/node_modules/@stdlib/repl/cli/lib/actions.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/actions.js rename to lib/node_modules/@stdlib/repl/cli/lib/actions.js diff --git a/lib/node_modules/@stdlib/repl/lib/ansi_colors.js b/lib/node_modules/@stdlib/repl/cli/lib/ansi_colors.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/ansi_colors.js rename to lib/node_modules/@stdlib/repl/cli/lib/ansi_colors.js diff --git a/lib/node_modules/@stdlib/repl/lib/auto_close_pairs.js b/lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/auto_close_pairs.js rename to lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs.js diff --git a/lib/node_modules/@stdlib/repl/lib/auto_close_pairs_close_symbols.js b/lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_close_symbols.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/auto_close_pairs_close_symbols.js rename to lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_close_symbols.js diff --git a/lib/node_modules/@stdlib/repl/lib/auto_close_pairs_open_symbols.js b/lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_open_symbols.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/auto_close_pairs_open_symbols.js rename to lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_open_symbols.js diff --git a/lib/node_modules/@stdlib/repl/lib/auto_close_pairs_walk.js b/lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_walk.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/auto_close_pairs_walk.js rename to lib/node_modules/@stdlib/repl/cli/lib/auto_close_pairs_walk.js diff --git a/lib/node_modules/@stdlib/repl/lib/browser/index.js b/lib/node_modules/@stdlib/repl/cli/lib/browser/index.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/browser/index.js rename to lib/node_modules/@stdlib/repl/cli/lib/browser/index.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/commands.js b/lib/node_modules/@stdlib/repl/cli/lib/commands.js new file mode 100644 index 000000000000..9d7c5d124895 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/commands.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var onAddTheme = require( './commands/add_theme.js' ); +var onClear = require( './commands/clear.js' ); +var onDeleteTheme = require( './commands/delete_theme.js' ); +var onGetTheme = require( './commands/get_theme.js' ); +var onKeybindings = require( './commands/keybindings.js' ); +var onPager = require( './commands/pager.js' ); +var onPresentationStart = require( './commands/presentation_start.js' ); +var onPresentationStop = require( './commands/presentation_stop.js' ); +var onRenameTheme = require( './commands/rename_theme.js' ); +var onRerun = require( './commands/rerun.js' ); +var onSetKeybinding = require( './commands/set_keybinding.js' ); +var onSettings = require( './commands/settings.js' ); +var onThemes = require( './commands/themes.js' ); + + +// MAIN // + +/** +* Returns a list of REPL-specific commands. +* +* ## Notes +* +* - Each array element is comprised as follows: +* +* ```text +* [ , , ] +* ``` +* +* where the first element is the command alias, the second element the command callback, and the third element a boolean indicating whether the callback is an accessor (getter; i.e., the command refers to a property rather than a function to be explicitly invoked). +* +* @private +* @param {REPL} repl - REPL instance +* @returns {ArrayArray} commands +*/ +function commands( repl ) { + var cmds; + + // Define a list of REPL-specific commands (NOTE: keep in alphabetical order): + cmds = []; + cmds.push( [ 'addTheme', onAddTheme( repl ), false ] ); + cmds.push( [ 'clear', onClear( repl ), false ] ); + cmds.push( [ 'deleteTheme', onDeleteTheme( repl ), false ] ); + cmds.push( [ 'getTheme', onGetTheme( repl ), false ] ); + cmds.push( [ 'keybindings', onKeybindings( repl ), false ] ); + cmds.push( [ 'pager', onPager( repl ), false ] ); + cmds.push( [ 'presentationStart', onPresentationStart( repl ), false ] ); + cmds.push( [ 'presentationStop', onPresentationStop( repl ), false ] ); + cmds.push( [ 'renameTheme', onRenameTheme( repl ), false ] ); + cmds.push( [ 'rerun', onRerun( repl ), false ] ); + cmds.push( [ 'setKeybinding', onSetKeybinding( repl ), false ] ); + cmds.push( [ 'settings', onSettings( repl ), false ] ); + cmds.push( [ 'themes', onThemes( repl ), false ] ); + + return cmds; +} + + +// EXPORTS // + +module.exports = commands; diff --git a/lib/node_modules/@stdlib/repl/lib/commands/add_theme.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/add_theme.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/add_theme.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/add_theme.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/clear.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/clear.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/clear.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/clear.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/delete_theme.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/delete_theme.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/delete_theme.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/delete_theme.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/get_theme.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/get_theme.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/get_theme.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/get_theme.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/keybindings.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/keybindings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/keybindings.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/keybindings.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/pager.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/pager.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/pager.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/pager.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/presentation_start.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/presentation_start.js similarity index 98% rename from lib/node_modules/@stdlib/repl/lib/commands/presentation_start.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/presentation_start.js index 949a23831efd..127ad2a6f584 100644 --- a/lib/node_modules/@stdlib/repl/lib/commands/presentation_start.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/commands/presentation_start.js @@ -29,7 +29,7 @@ var isPlainObject = require( '@stdlib/assert/is-plain-object' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); var propertyDescriptor = require( '@stdlib/utils/property-descriptor' ); var properties = require( '@stdlib/utils/properties' ); -var Presentation = require( '@stdlib/repl/presentation' ); // eslint-disable-line stdlib/no-redeclare +var Presentation = require( '@stdlib/repl/cli/presentation' ); // eslint-disable-line stdlib/no-redeclare var format = require( '@stdlib/string/format' ); var setdiff = require( './../setdiff.js' ); var propertyComparator = require( './../property_comparator.js' ); diff --git a/lib/node_modules/@stdlib/repl/lib/commands/presentation_stop.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/presentation_stop.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/presentation_stop.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/presentation_stop.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/rename_theme.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/rename_theme.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/rename_theme.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/rename_theme.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/rerun.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/rerun.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/rerun.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/rerun.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/set_keybinding.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/set_keybinding.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/set_keybinding.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/set_keybinding.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/settings.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/settings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/settings.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/settings.js diff --git a/lib/node_modules/@stdlib/repl/lib/commands/themes.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/themes.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/commands/themes.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/themes.js diff --git a/lib/node_modules/@stdlib/repl/lib/completer_engine.js b/lib/node_modules/@stdlib/repl/cli/lib/completer_engine.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/completer_engine.js rename to lib/node_modules/@stdlib/repl/cli/lib/completer_engine.js diff --git a/lib/node_modules/@stdlib/repl/lib/completer_preview.js b/lib/node_modules/@stdlib/repl/cli/lib/completer_preview.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/completer_preview.js rename to lib/node_modules/@stdlib/repl/cli/lib/completer_preview.js diff --git a/lib/node_modules/@stdlib/repl/lib/default_keybindings.js b/lib/node_modules/@stdlib/repl/cli/lib/default_keybindings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/default_keybindings.js rename to lib/node_modules/@stdlib/repl/cli/lib/default_keybindings.js diff --git a/lib/node_modules/@stdlib/repl/lib/defaults.js b/lib/node_modules/@stdlib/repl/cli/lib/defaults.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/defaults.js rename to lib/node_modules/@stdlib/repl/cli/lib/defaults.js diff --git a/lib/node_modules/@stdlib/repl/lib/display_prompt.js b/lib/node_modules/@stdlib/repl/cli/lib/display_prompt.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/display_prompt.js rename to lib/node_modules/@stdlib/repl/cli/lib/display_prompt.js diff --git a/lib/node_modules/@stdlib/repl/lib/eager_evaluator.js b/lib/node_modules/@stdlib/repl/cli/lib/eager_evaluator.js similarity index 98% rename from lib/node_modules/@stdlib/repl/lib/eager_evaluator.js rename to lib/node_modules/@stdlib/repl/cli/lib/eager_evaluator.js index c8cd708df713..5ace79a1d910 100644 --- a/lib/node_modules/@stdlib/repl/lib/eager_evaluator.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/eager_evaluator.js @@ -30,8 +30,6 @@ var replace = require( '@stdlib/string/replace' ); var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); var copy = require( '@stdlib/array/base/copy' ); var max = require( '@stdlib/math/base/special/max' ); -var processCommand = require( './process_command.js' ); -var compileCommand = require( './compile_command.js' ); var ANSI_COLORS = require( './ansi_colors.js' ); @@ -301,13 +299,13 @@ setNonEnumerableReadOnly( EagerEvaluator.prototype, 'onKeypress', function onKey return; } debug( 'Processing command...' ); - tmp = processCommand( code ); + tmp = this._repl._processCommand( code ); if ( tmp instanceof Error ) { debug( 'Error encountered when processing command: %s', tmp.message ); return; } debug( 'Compiling command...' ); - executable = compileCommand( tmp ); + executable = this._repl._compileCommand( tmp ); if ( executable instanceof Error ) { debug( 'Error encountered when compiling command: %s', executable.message ); return; diff --git a/lib/node_modules/@stdlib/repl/lib/editor_actions.js b/lib/node_modules/@stdlib/repl/cli/lib/editor_actions.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/editor_actions.js rename to lib/node_modules/@stdlib/repl/cli/lib/editor_actions.js diff --git a/lib/node_modules/@stdlib/repl/lib/help_text.js b/lib/node_modules/@stdlib/repl/cli/lib/help_text.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/help_text.js rename to lib/node_modules/@stdlib/repl/cli/lib/help_text.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/index.js b/lib/node_modules/@stdlib/repl/cli/lib/index.js new file mode 100644 index 000000000000..54ac5fec5412 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/index.js @@ -0,0 +1,53 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* REPL. +* +* @module @stdlib/repl/cli +* +* @example +* var debug = require( '@stdlib/streams/node/debug-sink' ); +* var REPL = require( '@stdlib/repl/cli' ); +* +* function onExit() { +* console.log( 'REPL closed.' ); +* } +* +* // Create a new REPL: +* var repl = new REPL({ +* 'output': debug() +* }); +* repl.on( 'exit', onExit ); +* +* // ... +* +* // Close the REPL: +* repl.close(); +*/ + +// MODULES // + +var main = require( './main.js' ); + + +// EXPORTS // + +module.exports = main; diff --git a/lib/node_modules/@stdlib/repl/lib/input_prompt.js b/lib/node_modules/@stdlib/repl/cli/lib/input_prompt.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/input_prompt.js rename to lib/node_modules/@stdlib/repl/cli/lib/input_prompt.js diff --git a/lib/node_modules/@stdlib/repl/lib/is_setting_name.js b/lib/node_modules/@stdlib/repl/cli/lib/is_setting_name.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/is_setting_name.js rename to lib/node_modules/@stdlib/repl/cli/lib/is_setting_name.js diff --git a/lib/node_modules/@stdlib/repl/lib/keybindings.js b/lib/node_modules/@stdlib/repl/cli/lib/keybindings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/keybindings.js rename to lib/node_modules/@stdlib/repl/cli/lib/keybindings.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/log.js b/lib/node_modules/@stdlib/repl/cli/lib/log.js new file mode 100644 index 000000000000..1ae2f532f99b --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/log.js @@ -0,0 +1,45 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable no-underscore-dangle */ + +'use strict'; + +// MAIN // + +/** +* Writes a message to the REPL output stream. +* +* ## Notes +* +* - Automatically appends a newline character to a provide message. +* +* @private +* @param {REPL} repl - REPL instance +* @param {string} msg - message +*/ +function log( repl, msg ) { + if ( repl._quiet === false ) { + repl._ostream.write( msg+'\n' ); + } +} + + +// EXPORTS // + +module.exports = log; diff --git a/lib/node_modules/@stdlib/repl/cli/lib/longest_common_prefix.js b/lib/node_modules/@stdlib/repl/cli/lib/longest_common_prefix.js new file mode 100644 index 000000000000..08812654674a --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/longest_common_prefix.js @@ -0,0 +1,101 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TODO: move implementation to package: @stdlib/string/longest-common-prefix + +'use strict'; + +// MODULES // + +var isArrayLikeObject = require( '@stdlib/assert/is-array-like-object' ); +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var format = require( '@stdlib/string/format' ); + + +// MAIN // + +/** +* Returns the longest common prefix. +* +* ## Notes +* +* - The algorithmic complexity is `O(M*N)` where `M` is the number of strings and `N` is the length of the first string. +* +* @private +* @param {(string|StringArray)} arg - a string or list of strings +* @param {string} [...str] - strings +* @throws {TypeError} must provide strings +* @returns {string} longest common prefix +* +* @example +* var prefix = longestCommonPrefix( 'beep', 'bebop' ); +* // returns 'be' +* +* @example +* var prefix = longestCommonPrefix( [ 'beep', 'bebop' ] ); +* // returns 'be' +*/ +function longestCommonPrefix() { + var prefix; + var list; + var str; + var ch; + var M; + var N; + var i; + var j; + + if ( arguments.length === 1 && isArrayLikeObject( arguments[ 0 ] ) ) { + list = arguments[ 0 ]; + } else { + list = []; + for ( i = 0; i < arguments.length; i++ ) { + list.push( arguments[ i ] ); + } + } + M = list.length; + if ( M === 0 ) { + return ''; + } + prefix = list[ 0 ]; + if ( !isString( prefix ) ) { + throw new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', prefix ) ); + } + if ( M === 1 ) { + return prefix; + } + N = prefix.length; + for ( i = 0; i < N; i++ ) { + ch = prefix[ i ]; + for ( j = 1; j < M; j++ ) { + str = list[ j ]; + if ( !isString( str ) ) { + throw new TypeError( format( 'invalid argument. Must provide a string. Value: `%s`.', str ) ); + } + if ( i >= str.length || str[ i ] !== ch ) { + return prefix.substring( 0, i ); + } + } + } + return prefix; +} + + +// EXPORTS // + +module.exports = longestCommonPrefix; diff --git a/lib/node_modules/@stdlib/repl/lib/main.js b/lib/node_modules/@stdlib/repl/cli/lib/main.js similarity index 72% rename from lib/node_modules/@stdlib/repl/lib/main.js rename to lib/node_modules/@stdlib/repl/cli/lib/main.js index 8bb1b56fec8b..56f48dc872b1 100644 --- a/lib/node_modules/@stdlib/repl/lib/main.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/main.js @@ -16,53 +16,42 @@ * limitations under the License. */ -/* eslint-disable no-restricted-syntax, no-invalid-this, no-underscore-dangle, max-lines, max-lines-per-function, max-statements */ +/* eslint-disable no-restricted-syntax, no-invalid-this, no-underscore-dangle, max-lines, max-lines-per-function */ 'use strict'; // MODULES // -var EventEmitter = require( 'events' ).EventEmitter; var readline = require( 'readline' ); var proc = require( 'process' ); -var resolve = require( 'path' ).resolve; +var inspect = require( 'util' ).inspect; var logger = require( 'debug' ); var inherit = require( '@stdlib/utils/inherit' ); +var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); +var replace = require( '@stdlib/string/replace' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; var isPlainObject = require( '@stdlib/assert/is-plain-object' ); -var isFunction = require( '@stdlib/assert/is-function' ); -var isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); var objectKeys = require( '@stdlib/utils/keys' ); var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' ); var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); var properties = require( '@stdlib/utils/properties' ); var append = require( '@stdlib/utils/append' ); var format = require( '@stdlib/string/format' ); var Boolean = require( '@stdlib/boolean/ctor' ); -var cwd = require( '@stdlib/process/cwd' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; -var fifo = require( '@stdlib/dstructs/fifo' ); -var nextTick = require( '@stdlib/utils/next-tick' ); var assign = require( '@stdlib/object/assign' ); +var BaseREPL = require( '@stdlib/repl/base' ); var validate = require( './validate.js' ); var parseKey = require( './parse_key.js' ); var defaults = require( './defaults.js' ); var isSettingName = require( './is_setting_name.js' ); -var setAliases = require( './set_aliases.js' ); -var setAliasesGlobal = require( './set_aliases_global.js' ); var setCommands = require( './set_commands.js' ); var setCommandsGlobal = require( './set_commands_global.js' ); var propertyComparator = require( './property_comparator.js' ); -var createEvalContext = require( './create_evaluation_context.js' ); var commands = require( './commands.js' ); var displayPrompt = require( './display_prompt.js' ); var inputPrompt = require( './input_prompt.js' ); var OutputStream = require( './output_stream.js' ); -var completerFactory = require( './completer.js' ); var MultilineHandler = require( './multiline_handler.js' ); var Keybindings = require( './keybindings.js' ); var EditorActions = require( './editor_actions.js' ); @@ -71,9 +60,9 @@ var PreviewCompleter = require( './completer_preview.js' ); var AutoCloser = require( './auto_close_pairs.js' ); var SyntaxHighlighter = require( './syntax_highlighter.js' ); var EagerEvaluator = require( './eager_evaluator.js' ); -var ALIAS_OVERRIDES = require( './alias_overrides.js' ); var SETTINGS = require( './settings.js' ); var SETTINGS_VALIDATORS = require( './settings_validators.js' ); +var HELP_TEXT = require( './help_text.js' ); // VARIABLES // @@ -111,8 +100,8 @@ var debug = logger( 'repl' ); * @param {boolean} [options.settings.completionPreviews] - boolean indicating whether to enable completion previews for auto-completion * @param {boolean} [options.settings.autoDisableBracketedPasteOnExit] - boolean indicating whether to automatically disable bracketed-paste upon exiting the REPL * @param {boolean} [options.settings.syntaxHighlighting] - boolean indicating whether to enable syntax highlighting -* @param {boolean} [options.settings.eagerEvaluation] - boolean indicating whether to enable eager evaluation * @param {string} [options.settings.theme] - initial color theme for syntax highlighting +* @param {boolean} [options.settings.eagerEvaluation] - boolean indicating whether to enable eager evaluation * @throws {Error} must provide valid options * @returns {REPL} REPL instance * @@ -182,98 +171,45 @@ function REPL( options ) { 'settings': opts.settings })); - // Call the parent constructor: - EventEmitter.call( this ); - // Create an internal output stream: ostream = new OutputStream( this, opts.settings.autoPage ); // Setup the output stream pipeline: ostream.pipe( opts.output ); - // Cache references to the input and output streams: - setNonEnumerableReadOnly( this, '_istream', opts.input ); - setNonEnumerableReadOnly( this, '_ostream', ostream ); + // Call the parent constructor: + BaseREPL.call( this, { + 'input': opts.input, + 'output': ostream, + 'error': ostream, + 'sandbox': opts.sandbox, + 'timeout': opts.timeout, + 'load': opts.load, + 'save': opts.save, + 'log': opts.log, + 'quiet': opts.quiet + }); + + // Cache reference to the output stream: setNonEnumerableReadOnly( this, '_wstream', opts.output ); + // Define help text: + setNonEnumerableReadOnly( this, '_helpText', HELP_TEXT ); + // Cache options: setNonEnumerableReadOnly( this, '_inputPrompt', opts.inputPrompt ); setNonEnumerableReadOnly( this, '_outputPrompt', opts.outputPrompt ); setNonEnumerableReadOnly( this, '_padding', opts.padding ); - setNonEnumerableReadOnly( this, '_timeout', opts.timeout ); setNonEnumerableReadOnly( this, '_isTTY', opts.isTTY ); - setNonEnumerableReadOnly( this, '_sandbox', opts.sandbox ); setNonEnumerableReadOnly( this, '_settings', opts.settings ); - setNonEnumerable( this, '_quiet', opts.quiet ); // allow this to be internally toggled - - // Initialize an internal data store: - setNonEnumerableReadOnly( this, '_internal', {} ); - setNonEnumerableReadOnly( this._internal, 'presentation', {} ); - setNonEnumerableReadOnly( this._internal.presentation, 'cache', {} ); - setNonEnumerable( this._internal.presentation, 'counter', 0 ); - - // Initialize an internal command queue: - setNonEnumerableReadOnly( this, '_queue', fifo() ); - - // Initialize a strided internal buffer for storing the command history: - setNonEnumerableReadOnly( this, '_history', [] ); - - // Initialize an internal buffer for storing the current command: - setNonEnumerableReadOnly( this, '_cmd', [] ); - - // Initialize a executed command counter: - setNonEnumerable( this, '_count', -1 ); - - // Initialize an internal buffer for saving regular expression matches between command evaluations: - setNonEnumerableReadOnly( this, '_regexp', [ '', '', '', '', '', '', '', '', '', '' ] ); - - // Initialize a strided internal cache of context globals: - setNonEnumerableReadOnly( this, '_contextVars', [] ); - - // For non-sandboxed REPLs, initialize an internal buffer for storing a (unique) sorted list of "built-in" REPL global variables/properties which need to be deleted upon closing a REPL in order to allow garbage collection and prevent memory leaks: - setNonEnumerableReadOnly( this, '_globalVars', ( this._sandbox ) ? null : [] ); - - // Initialize a strided internal cache of resolved global variables/properties in order to allow, e.g., help text look-up based on object reference, not just alias name (note: members alternate between `''` and ``): - setNonEnumerableReadOnly( this, '_aliases', [] ); - - // Initialize a strided internal buffer for storing user-defined documentation: - setNonEnumerableReadOnly( this, '_userdocs', [] ); - - // Initialize an internal buffer for storing a (unique) sorted list of workspace global variables/properties which were *initially* introduced during a REPL session (note: this overlaps with `_globalVars`, but more accurately represents a snapshot of the `global` state *before* a user begins entering commands, which is useful when wanting determine what variables/identifiers a user has introduced during a REPL session): - setNonEnumerableReadOnly( this, '_workspace', [] ); - - // Initialize a strided internal buffer for caching "base" workspace variables: - setNonEnumerableReadOnly( this, '_workspaces', {} ); - setReadOnly( this._workspaces, 'base', [] ); - - // Define the current workspace: - setNonEnumerable( this, '_currentWorkspace', 'base' ); - - // Initialize an internal flag indicating whether the REPL has been closed: - setNonEnumerable( this, '_closed', false ); - - // Initialize an internal flag indicating whether the REPL is currently busy with asynchronous processing: - setNonEnumerable( this, '_busy', false ); // Initialize an internal flag indicating whether we've received a `SIGINT` signal: setNonEnumerable( this, '_SIGINT', false ); - // Initialize an internal variable for caching the result of the last successfully evaluated command: - setNonEnumerable( this, '_ans', void 0 ); - - // Initialize an internal variable for setting a command callback: - setNonEnumerable( this, '_done', void 0 ); - // Initialize internal variables for setting a keybinding: setNonEnumerable( this, '_isCapturingKeybinding', false ); setNonEnumerable( this, '_targetAction', '' ); - // Create a REPL execution context: - setNonEnumerable( this, '_context', this.createContext() ); - - // Create a new TAB completer: - setNonEnumerableReadOnly( this, '_completer', completerFactory( this ) ); - // Create an internal readline interface: debug( 'Creating readline interface...' ); setNonEnumerableReadOnly( this, '_rli', readline.createInterface({ @@ -354,7 +290,6 @@ function REPL( options ) { this.load( opts.load ); } else { displayPrompt( this, false ); - this._count += 1; } return this; @@ -481,11 +416,9 @@ function REPL( options ) { debug( 'Received a SIGINT event.' ); - // If the REPL is currently busy executing a command, stop waiting for it to finish: - if ( self._busy ) { - self._done( new Error( 'unexpected error. Command execution terminated.' ) ); - return; - } + // Emit an interrupt: + self.emit( 'interrupt' ); + // Check whether the user has entered any characters: isEmpty = ( self._rli.line.length === 0 ); @@ -507,9 +440,6 @@ function REPL( options ) { } else { self._SIGINT = false; } - // Reset the command queue: - self._queue.clear(); - // Clear any command which has been buffered but not yet executed: self.clearCommand(); @@ -523,13 +453,28 @@ function REPL( options ) { * @private * @param {string} cmd - command * @param {boolean} success - boolean indicating whether the command successfully executed + * @param {*} res - result + * @param {boolean} silent - boolean indicating whether the command output should be silenced */ - function onCommand( cmd, success ) { - self._count += 1; - debug( 'Command count: %d', self._count ); + function onCommand( cmd, success, res, silent ) { + var pre; + var tmp; - // Update the internal command history buffer: [..., , , , ...] - self._history.push( self._count, cmd, success ); + if ( success === false ) { + self._ostream.write( 'Error: '+res.message+'\n' ); + } else if ( !silent && res !== void 0 ) { + pre = replace( self._outputPrompt, '%d', (self._count).toString() ); + + if ( isndarrayLike( res ) ) { + tmp = res.toString(); // FIXME: this is a hack in order to avoid printing private ndarray properties in the REPL, as done by the built-in `util.inspect`. Ideally, we'd roll our own inspector which specifically accommodates stdlib's ndarray and other specialized classes. + } else { + tmp = res; + } + self._ostream.write( pre+inspect( tmp )+'\n' ); + } + if ( !self._closed ) { + displayPrompt( self, false ); + } // TODO: if successful and if necessary, (asynchronously?) write the command to a history file (question: do we only want to write successful commands to the history file? maybe we need to option for limiting to successful commands?) @@ -540,7 +485,7 @@ function REPL( options ) { /* * Inherit from the `EventEmitter` prototype. */ -inherit( REPL, EventEmitter ); +inherit( REPL, BaseREPL ); /** * Displays a command prompt. @@ -729,17 +674,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContex var context; var cmds; - debug( 'Creating REPL execution context...' ); - - // Create an evaluation context: - context = createEvalContext( this._contextVars, this._ostream, this._sandbox ); // eslint-disable-line max-len - - // Add project APIs... - if ( this._sandbox ) { - setAliases( this._aliases, context, ALIAS_OVERRIDES ); - } else { - setAliasesGlobal( this._globalVars, this._aliases, context, ALIAS_OVERRIDES ); // eslint-disable-line max-len - } + // TODO: Call parent method + context = BaseREPL.prototype.createContext.call( this ); // Get the list of REPL-specific commands: cmds = commands( this ); @@ -763,146 +699,6 @@ setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContex return context; }); -/** -* Resets a REPL's context. -* -* @name resetContext -* @memberof REPL.prototype -* @type {Function} -* @returns {REPL} REPL instance -* -* @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* -* // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); -* -* // ... -* -* // Reset the REPL context: -* repl.resetContext(); -* -* // ... -* -* // Close the REPL: -* repl.close(); -*/ -setNonEnumerableReadOnly( REPL.prototype, 'resetContext', function resetContext() { - var tmp; - var key; - var o; - var i; - var j; - - debug( 'Resetting REPL execution context...' ); - - // Before creating a new execution context in a non-sandboxed environment, remove current workspace variables in order to allow garbage collection and avoid memory leaks (e.g., variables/functions declared during a REPL session which might remain bound to the environment `global` after clearing a REPL): - if ( this._sandbox === false ) { - // WARNING: in a non-sandboxed environment, if a global variable is externally introduced during a REPL session (i.e., introduced via a mechanism outside of the REPL environment), we will delete that global variable, which means the following logic may introduce unintended side-effects for this particular edge case (e.g., application code may expect the presence of the subsequently deleted global variable). While not ideal, (a) user applications should not be introducing globals to begin with and (b) the probability of a user running a REPL session, a user clearing that REPL session, AND a global variable being introduced between starting a REPL and clearing the REPL should be negligible. - tmp = this._context.vars(); - for ( i = 0; i < tmp.length; i++ ) { - if ( isConfigurableProperty( this._context, tmp[ i ] ) ) { - delete this._context[ tmp[ i ] ]; - } - } - - // Remove REPL globals: - for ( i = 0; i < this._globalVars.length; i++ ) { - o = this._context; - key = this._globalVars[ i ].split( '.' ); // Note: this addresses nested key paths (e.g., `a.b.c`) - for ( j = 0; j < key.length-1; j++ ) { - if ( !hasOwnProp( o, key[ j ] ) ) { - o = null; - break; - } - o = o[ key[ j ] ]; - } - if ( o && isConfigurableProperty( o, key[ j ] ) ) { - delete o[ key[ j ] ]; - } - } - } - // Reset internal buffers for storing context data: - if ( this._sandbox === false ) { - this._globalVars.length = 0; - } - this._aliases.length = 0; - this._workspace.length = 0; - this._contextVars.length = 0; - - // Create a new execution context... - this._context = this.createContext(); - this.emit( 'reset', this._context ); // note: emitting the context allows REPL wrappers to extend the newly created context - - return this; -}); - -/** -* Clears a REPL's history. -* -* @name clearHistory -* @memberof REPL.prototype -* @type {Function} -* @returns {REPL} REPL instance -* -* @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* -* // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); -* -* // ... -* -* // Clear the REPL history: -* repl.clearHistory(); -* -* // ... -* -* // Close the REPL: -* repl.close(); -*/ -setNonEnumerableReadOnly( REPL.prototype, 'clearHistory', function clearHistory() { - debug( 'Resetting REPL history...' ); - this._history.length = 0; - return this; -}); - -/** -* Clears user-defined documentation. -* -* @name clearUserDocs -* @memberof REPL.prototype -* @type {Function} -* @returns {REPL} REPL instance -* -* @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* -* // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); -* -* // ... -* -* // Clear the user defined documentation: -* repl.clearUserDocs(); -* -* // ... -* -* // Close the REPL: -* repl.close(); -*/ -setNonEnumerableReadOnly( REPL.prototype, 'clearUserDocs', function clearUserDocs() { - debug( 'Resetting REPL user-defined documentation...' ); - this._userdocs.length = 0; - return this; -}); - /** * Returns a list of all available themes for syntax highlighting. * @@ -1188,80 +984,6 @@ setNonEnumerableReadOnly( REPL.prototype, 'setKeybinding', function setKeybindin this._keybindings.set( action, keys ); }); -/** -* Loads and evaluates a JavaScript file line-by-line. -* -* @name load -* @memberof REPL.prototype -* @type {Function} -* @param {string} fpath - file path -* @param {Function} clbk - callback -* @throws {Error} cannot load a file into a closed REPL -* @throws {TypeError} first argument must be a string -* @throws {TypeError} second argument must be a function -* @returns {void} -* -* @example -* // TODO -*/ -setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { - var self; - var file; - var len; - var i; - if ( this._closed ) { - throw new Error( 'invalid operation. Cannot load a file into a REPL which has already closed.' ); - } - if ( !isString( fpath ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', fpath ) ); - } - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) ); - } - // Resolve the provided path to an absolute file path: - fpath = resolve( cwd(), fpath ); - debug( 'Loading filepath: %s', fpath ); - - // Attempt to synchronously read the file: - file = readFileSync( fpath, 'utf8' ); - if ( file instanceof Error ) { - debug( 'Error: %s', file.message ); - clbk( file ); - return; - } - self = this; - - // Split the file content into individual lines: - file = file.split( RE_EOL ); - - // Forward each line to the REPL readline interface in order to mimic user input... - len = file.length; - i = -1; - - nextTick( next ); - - /** - * Callback invoked after draining the command queue. - * - * @private - * @param {string} cmd - command - * @param {boolean} success - boolean indicating whether the command successfully executed - */ - function next() { - i += 1; - if ( i < len ) { - if ( file[ i ] ) { - self._rli.write( file[ i ]+'\n' ); - self.once( 'drain', next ); - } else { - nextTick( next ); - } - } else { - nextTick( clbk ); - } - } -}); - /** * Resets a REPL. * @@ -1290,23 +1012,17 @@ setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { * repl.close(); */ setNonEnumerableReadOnly( REPL.prototype, 'reset', function onReset() { + // Call the parent method: + BaseREPL.prototype.reset( this ); + if ( this._closed ) { throw new Error( 'invalid operation. Cannot reset a REPL which has already closed.' ); } debug( 'Resetting REPL...' ); - // Reset the command queue: - this._queue.clear(); - // Clear any command which has been buffered but not yet executed: this.clearCommand(); - // Clear the command history: - this.clearHistory(); - - // Reset the execution context: - this.resetContext(); - // Clear an output TTY stream of any previous commands and output: this.clear(); @@ -1467,67 +1183,17 @@ setNonEnumerableReadOnly( REPL.prototype, 'clearCommand', function onClearComman * repl.close(); */ setNonEnumerableReadOnly( REPL.prototype, 'close', function close() { - var self; if ( this._closed ) { debug( 'Attempted to close an already closed REPL.' ); return this; } - self = this; - this._closed = true; - - // Clear the command queue: - this._queue.clear(); - - // TODO: ensure REPL history is saved (flushed) to file before closing the REPL (see https://github.com/nodejs/node/blob/b21e7c7bcf23a2715951e4cd96180e4dbf1dcd4d/lib/repl.js#L805) - - // TODO: ensure REPL log is saved (flushed) to file before closing the REPL + // Call the parent method: + BaseREPL.prototype.close.call( this ); - nextTick( onTick ); + debug( 'Closing readline interface...' ); + this._rli.close(); return this; - - /** - * Callback invoked upon the next tick of the event loop. - * - * @private - */ - function onTick() { - var tmp; - var key; - var o; - var i; - var j; - - debug( 'Closing readline interface...' ); - self._rli.close(); - - // If this is a non-sandboxed REPL, remove global variables/properties which were introduced during context creation and by a user during a REPL session... - if ( self._sandbox === false ) { - // WARNING: in a non-sandboxed environment, if a global variable is externally introduced during a REPL session (i.e., introduced via a mechanism outside of the REPL environment), we will delete that global variable, which means the following logic may introduce unintended side-effects for this particular edge case (e.g., application code may expect the presence of the subsequently deleted global variable). While not ideal, (a) user applications should not be introducing globals to begin with and (b) the probability of a user running a REPL session, a user closing that REPL session, AND a global variable being introduced between starting a REPL and closing the REPL should be negligible. - tmp = self._context.vars(); // current workspace variables - for ( i = 0; i < tmp.length; i++ ) { - if ( isConfigurableProperty( self._context, tmp[ i ] ) ) { - delete self._context[ tmp[ i ] ]; - } - } - - // Remove REPL globals: - for ( i = 0; i < self._globalVars.length; i++ ) { - o = self._context; - key = self._globalVars[ i ].split( '.' ); // Note: this addresses nested key paths (e.g., `a.b.c`) - for ( j = 0; j < key.length-1; j++ ) { - if ( !hasOwnProp( o, key[ j ] ) ) { - o = null; - break; - } - o = o[ key[ j ] ]; - } - if ( o && isConfigurableProperty( o, key[ j ] ) ) { - delete o[ key[ j ] ]; - } - } - } - } }); /** diff --git a/lib/node_modules/@stdlib/repl/lib/multiline_handler.js b/lib/node_modules/@stdlib/repl/cli/lib/multiline_handler.js similarity index 84% rename from lib/node_modules/@stdlib/repl/lib/multiline_handler.js rename to lib/node_modules/@stdlib/repl/cli/lib/multiline_handler.js index d78009de4959..2d95dc21112b 100644 --- a/lib/node_modules/@stdlib/repl/lib/multiline_handler.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/multiline_handler.js @@ -24,30 +24,17 @@ var readline = require( 'readline' ); var logger = require( 'debug' ); -var Parser = require( 'acorn' ).Parser; -var parseLoose = require( 'acorn-loose' ).parse; var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); var startsWith = require( '@stdlib/string/starts-with' ); var copy = require( '@stdlib/array/base/copy' ); var min = require( '@stdlib/math/base/special/min' ); var max = require( '@stdlib/math/base/special/max' ); var displayPrompt = require( './display_prompt.js' ); -var drain = require( './drain.js' ); -var multilinePlugin = require( './acorn_detect_multiline_input.js' ); -var processCommand = require( './process_command.js' ); -var compileCommand = require( './compile_command.js' ); // VARIABLES // var debug = logger( 'repl:line' ); -var hasMultilineError = Parser.extend( multilinePlugin ).hasMultilineError; -var RE_WHITESPACE = /^\s*$/; -var RE_SINGLE_LINE_COMMENT = /^\s*\/\//; -var RE_MULTI_LINE_COMMENT = /^\s*\/\*.*\*\/$/; -var AOPTS = { - 'ecmaVersion': 'latest' -}; // MAIN // @@ -531,55 +518,6 @@ setNonEnumerableReadOnly( MultilineHandler.prototype, 'isPasting', function isPa return this._multiline.pasteMode; }); -/** -* Checks if the command is incomplete and a multi-line input. -* -* @name isMultilineInput -* @memberof MultilineHandler.prototype -* @type {Function} -* @param {string} cmd - command -* @returns {boolean} boolean indicating whether the command is a multi-line input -*/ -setNonEnumerableReadOnly( MultilineHandler.prototype, 'isMultilineInput', function isMultilineInput( cmd ) { - var node; - var tmp; - var ast; - - debug( 'Attempting to detect multi-line input...' ); - if ( RE_WHITESPACE.test( cmd ) ) { - debug( 'Multi-line input not detected.' ); - return false; - } - if ( RE_SINGLE_LINE_COMMENT.test( cmd ) || RE_MULTI_LINE_COMMENT.test( cmd ) ) { // eslint-disable-line max-len - debug( 'Multi-line input not detected.' ); - return false; - } - // Check if the command has valid syntax... - tmp = processCommand( cmd ); - if ( !( tmp instanceof Error ) ) { - debug( 'Multi-line input not detected.' ); - return false; - } - if ( hasMultilineError( cmd, AOPTS ) ) { - debug( 'Detected multi-line input. Triggering multi-line mode...' ); - return true; - } - // Still possible that a user is attempting to enter an object literal across multiple lines... - ast = parseLoose( cmd, AOPTS ); - - // Check for a trailing node which is being interpreted as a block statement, as this could be an object literal... - node = ast.body[ ast.body.length-1 ]; - if ( node.type === 'BlockStatement' && node.end === ast.end ) { - tmp = cmd.slice( node.start, node.end ); - if ( hasMultilineError( tmp, AOPTS ) ) { - debug( 'Detected multi-line input. Triggering multi-line mode...' ); - return true; - } - } - debug( 'Multi-line input not detected.' ); - return false; -}); - /** * Processes input line data. * @@ -590,9 +528,7 @@ setNonEnumerableReadOnly( MultilineHandler.prototype, 'isMultilineInput', functi * @returns {void} */ setNonEnumerableReadOnly( MultilineHandler.prototype, 'processLine', function processLine( line ) { - var code; var cmd; - var tmp; var dy; // Save line: @@ -622,34 +558,6 @@ setNonEnumerableReadOnly( MultilineHandler.prototype, 'processLine', function pr } this._multiline.active = false; // false until proven otherwise cmd = this._cmd.join( '\n' ); - if ( RE_WHITESPACE.test( cmd ) ) { - this.resetInput(); - displayPrompt( this._repl, false ); - return; - } - if ( RE_SINGLE_LINE_COMMENT.test( cmd ) || RE_MULTI_LINE_COMMENT.test( cmd ) ) { // eslint-disable-line max-len - debug( 'Detected single-line comment.' ); - tmp = cmd; - } else { - // Check if the command has valid syntax... - debug( 'Processing command...' ); - tmp = processCommand( cmd ); - if ( tmp instanceof Error ) { - // Move cursor to the output row: - dy = this._lines.length - this._lineIndex - 1; - readline.moveCursor( this._ostream, 0, dy ); - - // Reset the input buffers: - this.resetInput(); - - // Write error message and display next prompt: - this._ostream.write( 'Error: '+tmp.message+'\n' ); - this._repl.emit( 'command', cmd, false ); // command failed - displayPrompt( this._repl, false ); - return; - } - } - debug( 'Successfully processed command.' ); // Move cursor to the output row: dy = this._lines.length - this._lineIndex - 1; @@ -658,24 +566,8 @@ setNonEnumerableReadOnly( MultilineHandler.prototype, 'processLine', function pr // Reset the input buffers: this.resetInput(); - // Attempt to compile the command: - debug( 'Attempting to compile command...' ); - code = compileCommand( tmp ); - if ( code instanceof Error ) { - debug( 'Error: %s', code.message ); - this._ostream.write( 'Error: '+code.message+'\n' ); - this._repl.emit( 'command', cmd, false ); // command failed - displayPrompt( this._repl, false ); - return; - } - debug( 'Successfully compiled command.' ); - code.raw = cmd; - - // Add the command to the command queue: - this._queue.push( code ); - - // Request to run the command: - drain( this._repl ); + // Evaluate command: + this._repl.emit( 'input', cmd ); }); /** @@ -739,7 +631,7 @@ setNonEnumerableReadOnly( MultilineHandler.prototype, 'beforeKeypress', function this._lines[ this._lineIndex ] = this._rli.line; // If we are in paste mode or the command is incomplete, trigger multi-line mode... - if ( !this._multiline.pasteMode && !this.isMultilineInput( cmd.join( '\n' ) ) ) { + if ( !this._multiline.pasteMode && !this._repl._isMultilineInput( cmd.join( '\n' ) ) ) { this._ttyWrite.call( this._rli, data, key ); return; } diff --git a/lib/node_modules/@stdlib/repl/lib/output_stream.js b/lib/node_modules/@stdlib/repl/cli/lib/output_stream.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/output_stream.js rename to lib/node_modules/@stdlib/repl/cli/lib/output_stream.js diff --git a/lib/node_modules/@stdlib/repl/lib/parse_key.js b/lib/node_modules/@stdlib/repl/cli/lib/parse_key.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/parse_key.js rename to lib/node_modules/@stdlib/repl/cli/lib/parse_key.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/property_comparator.js b/lib/node_modules/@stdlib/repl/cli/lib/property_comparator.js new file mode 100644 index 000000000000..856e1a3c1367 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/property_comparator.js @@ -0,0 +1,63 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Comparator function for sorting property names and symbols in lexicography order. +* +* ## Notes +* +* - Symbols are sorted **after** names. +* +* @private +* @param {(string|symbol)} a - property +* @param {(string|symbol)} b - property +* @returns {integer} comparison result +*/ +function comparator( a, b ) { + var ta = typeof a; + var tb = typeof b; + + // Strings are sorted before symbols: + if ( ta === 'string' && tb === 'symbol' ) { + return -1; + } + if ( ta === 'symbol' && tb === 'string' ) { + return 1; + } + // Convert symbols to strings: + a = String( a ); + b = String( b ); + + // Sort in lexicographic order: + if ( a < b ) { + return -1; + } + if ( a === b ) { + return 0; + } + return 1; +} + + +// EXPORTS // + +module.exports = comparator; diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_leading_whitespace.js b/lib/node_modules/@stdlib/repl/cli/lib/regexp_leading_whitespace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/regexp_leading_whitespace.js rename to lib/node_modules/@stdlib/repl/cli/lib/regexp_leading_whitespace.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/regexp_reserved_syntax_characters.js b/lib/node_modules/@stdlib/repl/cli/lib/regexp_reserved_syntax_characters.js new file mode 100644 index 000000000000..c72e86e13e6a --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/regexp_reserved_syntax_characters.js @@ -0,0 +1,42 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns a regular expression for matching reserved JavaScript syntax characters. +* +* @private +* @returns {RegExp} regular expression +* +* @example +* var RE_SYNTAX_CHARS = createRegExp(); +* +* var bool = RE_SYNTAX_CHARS.test( '()' ); +* // returns true +*/ +function createRegExp() { + return /[`~!@#%^&*()\-=+[\]{}\\/|;:'",<>? ]/; +} + + +// EXPORTS // + +module.exports = createRegExp; diff --git a/lib/node_modules/@stdlib/repl/cli/lib/set_commands.js b/lib/node_modules/@stdlib/repl/cli/lib/set_commands.js new file mode 100644 index 000000000000..c35a6736d8d4 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/set_commands.js @@ -0,0 +1,64 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); +var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); + + +// VARIABLES // + +var debug = logger( 'repl:set_commands' ); + + +// MAIN // + +/** +* Sets commands on a sandboxed `context` object. +* +* @private +* @param {Object} context - context object +* @param {ArrayArray} commands - commands +* @returns {Object} context object +*/ +function setCommands( context, commands ) { + var cmd; + var i; + + for ( i = 0; i < commands.length; i++ ) { + cmd = commands[ i ]; + if ( hasOwnProp( context, cmd[ 0 ] ) ) { + debug( 'Skipping command as global context property `'+cmd[0]+'` is already assigned.' ); + } else if ( cmd[ 2 ] ) { + setReadOnlyAccessor( context, cmd[ 0 ], cmd[ 1 ] ); + } else { + setReadOnly( context, cmd[ 0 ], cmd[ 1 ] ); + } + } + return context; +} + + +// EXPORTS // + +module.exports = setCommands; diff --git a/lib/node_modules/@stdlib/repl/cli/lib/set_commands_global.js b/lib/node_modules/@stdlib/repl/cli/lib/set_commands_global.js new file mode 100644 index 000000000000..3f3c7b36ce60 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/set_commands_global.js @@ -0,0 +1,72 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var logger = require( 'debug' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); +var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); // eslint-disable-line id-length + + +// VARIABLES // + +var debug = logger( 'repl:set_commands_global' ); + + +// MAIN // + +/** +* Sets commands on non-sandboxed `context` object. +* +* ## Notes +* +* - This function avoids overwriting properties in a non-sandboxed environment in order to avoid unintended side-effects. +* +* @private +* @param {Array} out - output array for storing a list of global variables added to the global namespace +* @param {Object} context - context object +* @param {ArrayArray} commands - commands +* @returns {Object} context object +*/ +function setCommandsGlobal( out, context, commands ) { + var cmd; + var i; + + for ( i = 0; i < commands.length; i++ ) { + cmd = commands[ i ]; + if ( hasOwnProp( context, cmd[ 0 ] ) ) { + debug( 'Skipping command as global context property `'+cmd[0]+'` is already assigned.' ); + } else { + out.push( cmd[ 0 ] ); + if ( cmd[ 2 ] ) { + setConfigurableReadOnlyAccessor( context, cmd[ 0 ], cmd[ 1 ] ); + } else { + setConfigurableReadOnly( context, cmd[ 0 ], cmd[ 1 ] ); + } + } + } + return context; +} + + +// EXPORTS // + +module.exports = setCommandsGlobal; diff --git a/lib/node_modules/@stdlib/repl/cli/lib/setdiff.js b/lib/node_modules/@stdlib/repl/cli/lib/setdiff.js new file mode 100644 index 000000000000..a646ba1dad93 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/setdiff.js @@ -0,0 +1,193 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// VARIABLES // + +var TYPE_SORT_ORDER = { + 'number': 0, + 'string': 1, + 'symbol': 2 +}; + + +// MAIN // + +/** +* Returns the set difference between two similarly **sorted** lists. +* +* ## Notes +* +* - The contents of the provided arrays are assumed to be either numbers, strings, or symbols. +* +* - The lists are **expected** to be sorted not only, e.g., lexicographically, but also according to type in the **following** order: `numbers`, `strings`, and then `symbols`. +* +* ```text +* A = [ 1, 2, 3, '1', '2', '3', Symbol('1'), Symbol('2'), Symbol('3') ] +* B = [ 1, 2, '1', '3', Symbol('2'), Symbol('3') ] +* // => [ 3, '2', Symbol('1') ] +* ``` +* +* @private +* @param {Array} A - first sorted list +* @param {Array} B - second sorted list +* @returns {Array} set difference +* +* @example +* var out = setdiff( [ 1, 2, 3 ], [ 2, 4, 5 ] ); +* // returns [ 1, 3, 4, 5 ] +* +* @example +* var out = setdiff( [ 1 ], [ 2, 4, 5 ] ); +* // returns [ 1, 2, 4, 5 ] +* +* @example +* var out = setdiff( [ 1, 2, 3 ], [ 2 ] ); +* // returns [ 1, 3 ] +* +* @example +* var out = setdiff( [ 1, 2, 3 ], [] ); +* // returns [ 1, 2, 3 ] +* +* @example +* var out = setdiff( [], [ 2, 4, 5 ] ); +* // returns [ 2, 4, 5 ] +* +* @example +* var out = setdiff( [ 1, 2, 3 ], [ 1, 2, 3 ] ); +* // returns [] +* +* @example +* var out = setdiff( [], [] ); +* // returns [] +* +* @example +* var out = setdiff( [ 1 ], [ 1 ] ); +* // returns [] +* +* @example +* var out = setdiff( [ 1, 2, 2, 3, 3 ], [ 2, 4, 5, 5 ] ); +* // returns [ 1, 2, 3, 3, 4, 5, 5 ] +* +* @example +* var out = setdiff( [ 1, 2, 3 ], [ 4, 5 ] ); +* // returns [ 1, 2, 3, 4, 5 ] +* +* @example +* var out = setdiff( [ 1, 2 ], [ 3, 4, 5 ] ); +* // returns [ 1, 2, 3, 4, 5 ] +* +* @example +* var out = setdiff( [ 1, 2, 3, 7 ], [ 0, 1, 2, 4, 5 ] ); +* // returns [ 0, 3, 4, 5, 7 ] +* +* @example +* var out = setdiff( [ 1, 2, 3, 7, 9 ], [ -2, -1, 0, 1, 2, 4, 5 ] ); +* // returns [ -2, -1, 0, 3, 4, 5, 7, 9 ] +*/ +function setdiff( A, B ) { + var out; + var la; + var lb; + var ta; + var tb; + var a; + var b; + var i; + var j; + var k; + + la = A.length; + lb = B.length; + if ( la === 0 ) { + return B.slice(); + } + if ( lb === 0 ) { + return A.slice(); + } + out = []; + i = 0; + j = 0; + while ( i < la && j < lb ) { + a = A[ i ]; + b = B[ j ]; + if ( a === b ) { // addresses numbers, strings, and symbols alike + i += 1; + j += 1; + continue; + } + ta = typeof a; + tb = typeof b; + if ( ta !== tb ) { + // Note: we assume we have found a "type" border! + ta = TYPE_SORT_ORDER[ ta ]; + tb = TYPE_SORT_ORDER[ tb ]; + if ( ta < tb ) { + out.push( a ); + i += 1; + } else { // tb < ta + out.push( b ); + j += 1; + } + } + // Note: the types for `a` and `b` are the *same*! + else if ( ta === 'symbol' ) { + // Note: symbols don't have a "natural" sort order, so we need to do things in a more computationally intensive way via linear scans... + while ( i < la ) { + for ( k = j+1; k < lb; k++ ) { // `j+1` because we already know the symbols are not equal + if ( a === B[ k ] ) { + break; + } + } + // If we searched through all the symbols in `B` and failed to find a match, we found a unique symbol... + if ( k === lb ) { + out.push( a ); + } else { + // We can leverage the fact that symbols in `A` and `B` should be similarly sorted by recognizing that, if we found a match, this means that the symbols in `B` preceding the match should be unique... + for ( ; j < k; j++ ) { + out.push( B[ j ] ); + } + } + i += 1; + } + } else if ( a < b ) { + out.push( a ); + i += 1; + } else { // b < a + out.push( b ); + j += 1; + } + } + if ( i < la ) { + for ( ; i < la; i++ ) { + out.push( A[ i ] ); + } + } + if ( j < lb ) { + for ( ; j < lb; j++ ) { + out.push( B[ j ] ); + } + } + return out; +} + + +// EXPORTS // + +module.exports = setdiff; diff --git a/lib/node_modules/@stdlib/repl/lib/settings.js b/lib/node_modules/@stdlib/repl/cli/lib/settings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/settings.js rename to lib/node_modules/@stdlib/repl/cli/lib/settings.js index 429e21b3d1a5..91103b5891ee 100644 --- a/lib/node_modules/@stdlib/repl/lib/settings.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/settings.js @@ -56,13 +56,13 @@ var SETTINGS = { 'desc': 'Enable syntax highlighting.', 'type': 'boolean' }, - 'eagerEvaluation': { - 'desc': 'Enable eager evaluation.', - 'type': 'boolean' - }, 'theme': { 'desc': 'Set the syntax highlighting theme.', 'type': 'string' + }, + 'eagerEvaluation': { + 'desc': 'Enable eager evaluation.', + 'type': 'boolean' } }; diff --git a/lib/node_modules/@stdlib/repl/lib/settings_alias_args.js b/lib/node_modules/@stdlib/repl/cli/lib/settings_names.js similarity index 60% rename from lib/node_modules/@stdlib/repl/lib/settings_alias_args.js rename to lib/node_modules/@stdlib/repl/cli/lib/settings_names.js index ead6beda6e6e..fb750e4b5663 100644 --- a/lib/node_modules/@stdlib/repl/lib/settings_alias_args.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/settings_names.js @@ -20,29 +20,22 @@ // MODULES // -var SETTINGS_ALIASES = require( './settings_aliases.js' ); +var objectKeys = require( '@stdlib/utils/keys' ); +var SETTINGS = require( './settings.js' ); // MAIN // /** -* Returns a list of argument completion flags for a specified settings API. +* List of settings names. * * @private -* @param {string} alias - alias -* @returns {(Array|null)} argument completion flags +* @name SETTINGS_NAMES +* @type {Array} */ -function argFlags( alias ) { - var i; - for ( i = 0; i < SETTINGS_ALIASES.length; i++ ) { - if ( SETTINGS_ALIASES[ i ][ 0 ] === alias ) { - return SETTINGS_ALIASES[ i ].slice( 1 ); - } - } - return null; -} +var SETTINGS_NAMES = objectKeys( SETTINGS ); // EXPORTS // -module.exports = argFlags; +module.exports = SETTINGS_NAMES; diff --git a/lib/node_modules/@stdlib/repl/cli/lib/settings_validators.js b/lib/node_modules/@stdlib/repl/cli/lib/settings_validators.js new file mode 100644 index 000000000000..345b07acaa48 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/settings_validators.js @@ -0,0 +1,112 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; +var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; +var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; +var format = require( '@stdlib/string/format' ); + + +// FUNCTIONS // + +/** +* Returns a formatted error message for a value is not a boolean. +* +* @private +* @param {string} name - setting name +* @param {*} value - invalid value +* @returns {string} formatted error message +*/ +function booleanErrMsg( name, value ) { + return format( 'invalid argument. `%s` setting must be a boolean. Value: `%s`.', name, value ); +} + +/** +* Returns a formatted error message for a value is not an integer. +* +* @private +* @param {string} name - setting name +* @param {*} value - invalid value +* @returns {string} formatted error message +*/ +function integerErrMsg( name, value ) { + return format( 'invalid argument. `%s` setting must be an integer. Value: `%s`.', name, value ); +} + +/** +* Returns a formatted error message for a value is not a number. +* +* @private +* @param {string} name - setting name +* @param {*} value - invalid value +* @returns {string} formatted error message +*/ +function numberErrMsg( name, value ) { + return format( 'invalid argument. `%s` setting must be a number. Value: `%s`.', name, value ); +} + +/** +* Returns a formatted error message for a value is not a string. +* +* @private +* @param {string} name - setting name +* @param {*} value - invalid value +* @returns {string} formatted error message +*/ +function stringErrMsg( name, value ) { + return format( 'invalid argument. `%s` setting must be a string. Value: `%s`.', name, value ); +} + + +// MAIN // + +/** +* Mapping from data types to validation functions. +* +* @private +* @name VALIDATORS +* @type {Object} +*/ +var VALIDATORS = { // eslint-disable-line vars-on-top + 'boolean': { + 'assert': isBoolean, + 'msg': booleanErrMsg + }, + 'integer': { + 'assert': isInteger, + 'msg': integerErrMsg + }, + 'number': { + 'assert': isNumber, + 'msg': numberErrMsg + }, + 'string': { + 'assert': isString, + 'msg': stringErrMsg + } +}; + + +// EXPORTS // + +module.exports = VALIDATORS; diff --git a/lib/node_modules/@stdlib/repl/lib/syntax_highlighter.js b/lib/node_modules/@stdlib/repl/cli/lib/syntax_highlighter.js similarity index 99% rename from lib/node_modules/@stdlib/repl/lib/syntax_highlighter.js rename to lib/node_modules/@stdlib/repl/cli/lib/syntax_highlighter.js index 0e09f00cb332..779273cbb1b8 100644 --- a/lib/node_modules/@stdlib/repl/lib/syntax_highlighter.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/syntax_highlighter.js @@ -30,7 +30,6 @@ var isEmptyArray = require( '@stdlib/assert/is-empty-array' ); var objectKeys = require( '@stdlib/utils/keys' ); var omit = require( '@stdlib/utils/omit' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var tokenizer = require( './tokenizer.js' ); var THEMES = require( './themes.js' ); var ANSI = require( './ansi_colors.js' ); @@ -329,7 +328,7 @@ setNonEnumerableReadOnly( SyntaxHighlighter.prototype, 'onKeypress', function on // Tokenize: debug( 'Line change detected. Tokenizing line: %s', this._rli.line ); this._line = this._rli.line; // update line buffer - tokens = tokenizer( this._line, this._repl._context ); + tokens = this._repl._tokenizer( this._line, this._repl._context ); if ( isEmptyArray( tokens ) ) { debug( 'No tokens found. Skipping highlighting...' ); this._highlightedLine = this._line; diff --git a/lib/node_modules/@stdlib/repl/lib/themes.js b/lib/node_modules/@stdlib/repl/cli/lib/themes.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/themes.js rename to lib/node_modules/@stdlib/repl/cli/lib/themes.js diff --git a/lib/node_modules/@stdlib/repl/lib/validate.js b/lib/node_modules/@stdlib/repl/cli/lib/validate.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/validate.js rename to lib/node_modules/@stdlib/repl/cli/lib/validate.js diff --git a/lib/node_modules/@stdlib/repl/lib/validate_keybindings.js b/lib/node_modules/@stdlib/repl/cli/lib/validate_keybindings.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/validate_keybindings.js rename to lib/node_modules/@stdlib/repl/cli/lib/validate_keybindings.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/validate_settings.js b/lib/node_modules/@stdlib/repl/cli/lib/validate_settings.js new file mode 100644 index 000000000000..923f860f6026 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/validate_settings.js @@ -0,0 +1,78 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isPlainObject = require( '@stdlib/assert/is-plain-object' ); +var hasOwnProp = require( '@stdlib/assert/has-own-property' ); +var format = require( '@stdlib/string/format' ); +var SETTINGS = require( './settings.js' ); +var SETTINGS_NAMES = require( './settings_names.js' ); +var VALIDATORS = require( './settings_validators.js' ); + + +// MAIN // + +/** +* Validates settings. +* +* @private +* @param {Object} opts - destination object +* @param {Object} options - settings options +* @returns {(Error|null)} error or null +* +* @example +* var options = { +* 'autoClosePairs': true +* }; +* var opts = {}; +* var err = validate( opts, options ); +* if ( err ) { +* throw err; +* } +*/ +function validate( opts, options ) { + var name; + var o; + var f; + var v; + var i; + if ( !isPlainObject( options ) ) { + return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); + } + for ( i = 0; i < SETTINGS_NAMES.length; i++ ) { + name = SETTINGS_NAMES[ i ]; + if ( hasOwnProp( options, name ) ) { + v = options[ name ]; + o = SETTINGS[ name ]; + f = VALIDATORS[ o.type ]; + if ( !f.assert( v ) ) { + return new TypeError( f.msg( name, v ) ); + } + opts[ name ] = v; + } + } + return null; +} + + +// EXPORTS // + +module.exports = validate; diff --git a/lib/node_modules/@stdlib/repl/lib/welcome_text.js b/lib/node_modules/@stdlib/repl/cli/lib/welcome_text.js similarity index 100% rename from lib/node_modules/@stdlib/repl/lib/welcome_text.js rename to lib/node_modules/@stdlib/repl/cli/lib/welcome_text.js diff --git a/lib/node_modules/@stdlib/repl/cli/package.json b/lib/node_modules/@stdlib/repl/cli/package.json new file mode 100644 index 000000000000..7e75fc1fac41 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/package.json @@ -0,0 +1,78 @@ +{ + "name": "@stdlib/repl/cli", + "version": "0.0.0", + "description": "REPL environment.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "bin": { + "stdlib-repl": "./bin/cli" + }, + "main": "./lib", + "browser": { + "./lib": "./lib/browser/index.js", + "process": "process/" + }, + "directories": { + "benchmark": "./benchmark", + "data": "./data", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "scripts": "./scripts", + "test": "./test" + }, + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "repl", + "read-eval-print-loop", + "eval", + "evaluate", + "interact", + "interactive", + "console", + "terminal", + "shell", + "server", + "toplevel" + ], + "__stdlib__": { + "envs": { + "browser": false + } + } +} diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/array_expression_right_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/array_expression_right_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/array_expression_right_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/array_expression_right_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/object_expression_right_brace.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/object_expression_right_brace.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/object_expression_right_brace.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/object_expression_right_brace.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_backtick.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_backtick.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_backtick.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_backtick.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_double_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_double_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_double_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_double_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_parenthesis.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_parenthesis.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_parenthesis.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_parenthesis.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/right_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/right_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/template_literal.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/template_literal.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/template_literal.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/template_literal.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/template_literal_with_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/template_literal_with_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/negative/template_literal_with_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/negative/template_literal_with_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/arrow_function_body.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/arrow_function_body.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/arrow_function_body.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/arrow_function_body.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/binary_left_member_expression_literal.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/binary_left_member_expression_literal.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/binary_left_member_expression_literal.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/binary_left_member_expression_literal.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression_string_argument_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression_string_argument_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression_string_argument_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression_string_argument_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression_template_argument_left_backtick.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression_template_argument_left_backtick.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/call_expression_template_argument_left_backtick.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/call_expression_template_argument_left_backtick.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_body.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_body.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_body.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_body.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_test.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_test.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_test.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_test.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_test_left_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_test_left_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/do_while_test_left_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/do_while_test_left_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_body.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_body.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_body.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_body.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_init.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_init.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_init.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_init.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_test.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_test.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_test.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_test.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_test_member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_test_member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_test_member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_test_member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_update.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_update.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_update.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_update.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_update_member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_update_member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/for_update_member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/for_update_member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/function_declaration_body.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/function_declaration_body.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/function_declaration_body.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/function_declaration_body.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/function_declaration_signature.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/function_declaration_signature.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/function_declaration_signature.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/function_declaration_signature.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_backtick.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_backtick.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_backtick.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_backtick.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_brace.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_brace.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_brace.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_brace.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_double_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_double_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_double_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_double_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_parenthesis.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_parenthesis.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_parenthesis.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_parenthesis.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/left_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/left_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_left_member_expression_literal.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_left_member_expression_literal.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_left_member_expression_literal.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_left_member_expression_literal.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_nested_member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_nested_member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_nested_member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_left_nested_member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_right_member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_right_member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/logical_with_right_member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/logical_with_right_member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression_literal.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression_literal.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression_literal.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_assignment_expression_literal.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_expression_call_expression.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_expression_call_expression.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/member_expression_call_expression.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/member_expression_call_expression.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/object_expression_left_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/object_expression_left_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/object_expression_left_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/object_expression_left_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_body_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_body_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_body_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_body_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_literal_left_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_literal_left_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_literal_left_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_literal_left_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/regexp_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/regexp_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/tagged_template.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/tagged_template.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/tagged_template.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/tagged_template.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/tagged_template_left_backtick.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/tagged_template_left_backtick.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/tagged_template_left_backtick.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/tagged_template_left_backtick.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_brace.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_brace.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_brace.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_brace.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_double_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_double_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_double_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_double_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_parenthesis.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_parenthesis.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_parenthesis.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/template_literal_expression_with_left_parenthesis.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/three_backticks.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/three_backticks.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/three_backticks.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/three_backticks.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/variable_declaration_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/variable_declaration_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/variable_declaration_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/variable_declaration_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/while_body.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/while_body.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/while_body.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/while_body.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/while_test.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/while_test.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/positive/while_test.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/positive/while_test.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/script.js b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/script.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-close-pairs/script.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-close-pairs/script.js diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/array_expression_left_bracket_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/array_expression_left_bracket_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/array_expression_left_bracket_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/array_expression_left_bracket_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_backtick_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_backtick_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_backtick_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_backtick_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_double_quote_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_double_quote_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_double_quote_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_double_quote_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_parenthesis_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_parenthesis_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_parenthesis_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_parenthesis_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_single_quote_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_single_quote_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/left_single_quote_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/left_single_quote_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/object_expression_left_brace_within_string.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/object_expression_left_brace_within_string.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/negative/object_expression_left_brace_within_string.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/negative/object_expression_left_brace_within_string.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/array_expression_left_bracket.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/array_expression_left_bracket.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/array_expression_left_bracket.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/array_expression_left_bracket.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_backtick.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_backtick.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_backtick.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_backtick.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_double_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_double_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_double_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_double_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_parenthesis.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_parenthesis.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_parenthesis.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_parenthesis.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_single_quote.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_single_quote.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/left_single_quote.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/left_single_quote.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/object_expression_left_brace.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/object_expression_left_brace.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/positive/object_expression_left_brace.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/positive/object_expression_left_brace.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/script.js b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/script.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/auto-delete-pairs/script.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/auto-delete-pairs/script.js diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/repl.js b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/repl.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/repl.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/repl.js diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/comments.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/comments.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/comments.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/comments.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/control_keywords.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/control_keywords.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/control_keywords.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/control_keywords.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/declaration_names.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/declaration_names.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/declaration_names.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/declaration_names.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/functions.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/functions.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/functions.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/functions.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/keywords.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/keywords.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/keywords.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/keywords.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/local_scopes.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/local_scopes.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/local_scopes.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/local_scopes.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/member_expressions.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/member_expressions.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/member_expressions.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/member_expressions.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/numeric_literals.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/numeric_literals.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/numeric_literals.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/numeric_literals.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/objects.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/objects.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/objects.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/objects.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/operators.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/operators.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/operators.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/operators.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/punctuation.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/punctuation.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/punctuation.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/punctuation.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/regexp.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/regexp.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/regexp.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/regexp.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/reserved_literals.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/reserved_literals.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/reserved_literals.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/reserved_literals.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/special_identifiers.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/special_identifiers.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/special_identifiers.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/special_identifiers.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/string_literals.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/string_literals.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/string_literals.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/string_literals.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/variables.json b/lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/variables.json similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/fixtures/syntax-highlighting/variables.json rename to lib/node_modules/@stdlib/repl/cli/test/integration/fixtures/syntax-highlighting/variables.json diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.auto_close_pairs.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_close_pairs.js similarity index 99% rename from lib/node_modules/@stdlib/repl/test/integration/test.auto_close_pairs.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_close_pairs.js index 67e6198e2c58..3e4222762350 100644 --- a/lib/node_modules/@stdlib/repl/test/integration/test.auto_close_pairs.js +++ b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_close_pairs.js @@ -147,7 +147,6 @@ function defaultSettings() { 'completionPreviews': false, 'syntaxHighlighting': false, 'eagerEvaluation': false - }; } diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.auto_delete_pairs.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_delete_pairs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/test.auto_delete_pairs.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_delete_pairs.js diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.auto_page.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/test.auto_page.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.completer_engine.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completer_engine.js similarity index 99% rename from lib/node_modules/@stdlib/repl/test/integration/test.completer_engine.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.completer_engine.js index ffcc95ba8562..289ddb2fe99f 100644 --- a/lib/node_modules/@stdlib/repl/test/integration/test.completer_engine.js +++ b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completer_engine.js @@ -48,8 +48,8 @@ function defaultSettings() { 'autoDisableBracketedPasteOnExit': false, 'completionPreviews': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoPage': false + 'autoPage': false, + 'eagerEvaluation': false }; } diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.completion_previews.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js similarity index 95% rename from lib/node_modules/@stdlib/repl/test/integration/test.completion_previews.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js index 6f572938b9a7..f8762ff4904a 100644 --- a/lib/node_modules/@stdlib/repl/test/integration/test.completion_previews.js +++ b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js @@ -47,8 +47,8 @@ tape( 'a REPL instance supports displaying a completion preview of user-defined 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -93,8 +93,8 @@ tape( 'a REPL instance supports displaying a completion preview for common prefi 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -140,8 +140,8 @@ tape( 'a REPL instance supports displaying a completion preview for recognized i 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -186,8 +186,8 @@ tape( 'a REPL instance supports displaying a completion preview when a cursor is 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -241,8 +241,8 @@ tape( 'a REPL instance supports auto-completing a completion candidate by moving 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -295,8 +295,8 @@ tape( 'a REPL instance supports auto-completing a completion preview and executi 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -350,8 +350,8 @@ tape( 'a REPL instance does not display a completion preview when no completion 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); @@ -410,8 +410,8 @@ tape( 'a REPL instance does not display a completion preview once a user enters 'settings': { 'autoPage': false, 'syntaxHighlighting': false, - 'eagerEvaluation': false, - 'autoDisableBracketedPasteOnExit': false + 'autoDisableBracketedPasteOnExit': false, + 'eagerEvaluation': false } }; r = repl( opts, onClose ); diff --git a/lib/node_modules/@stdlib/repl/test/integration/test.syntax_highlighting.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.syntax_highlighting.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/integration/test.syntax_highlighting.js rename to lib/node_modules/@stdlib/repl/cli/test/integration/test.syntax_highlighting.js diff --git a/lib/node_modules/@stdlib/repl/test/test.cli.js b/lib/node_modules/@stdlib/repl/cli/test/test.cli.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/test.cli.js rename to lib/node_modules/@stdlib/repl/cli/test/test.cli.js diff --git a/lib/node_modules/@stdlib/repl/test/test.js b/lib/node_modules/@stdlib/repl/cli/test/test.js similarity index 100% rename from lib/node_modules/@stdlib/repl/test/test.js rename to lib/node_modules/@stdlib/repl/cli/test/test.js diff --git a/lib/node_modules/@stdlib/repl/lib/complete_settings.js b/lib/node_modules/@stdlib/repl/lib/complete_settings.js deleted file mode 100644 index 93672a1f4da7..000000000000 --- a/lib/node_modules/@stdlib/repl/lib/complete_settings.js +++ /dev/null @@ -1,91 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var logger = require( 'debug' ); -var parse = require( 'acorn-loose' ).parse; -var startsWith = require( '@stdlib/string/starts-with' ); -var settingsAliasArgs = require( './settings_alias_args.js' ); -var SETTINGS_NAMES = require( './settings_names.js' ); - - -// VARIABLES // - -var debug = logger( 'repl:completer:settings' ); -var AOPTS = { - 'ecmaVersion': 'latest' -}; - - -// MAIN // - -/** -* Completes a settings API expression. -* -* @private -* @param {Array} out - output array for storing completions -* @param {REPL} repl - REPL instance -* @param {string} expression - expression to complete -* @param {string} alias - settings API alias -* @param {string} value - value to complete -* @returns {string} value filter -*/ -function complete( out, repl, expression, alias, value ) { - var args; - var ast; - var arg; - var v; - var i; - - // Get the list of argument types for the desired API: - debug( 'Settings API: %s', alias ); - args = settingsAliasArgs( alias ); - - // Parse the expression into an AST: - debug( 'Expression: %s', expression ); - ast = parse( expression, AOPTS ); - - // Check whether the argument which triggered TAB completion has a corresponding argument type which is completable: - debug( 'Checking if argument is completable...' ); - arg = args[ ast.body[ 0 ].expression.arguments.length-1 ]; - if ( !arg ) { - debug( 'Argument which triggered TAB completion is not completable.' ); - return ''; - } - debug( 'Argument is completable.' ); - - debug( 'Searching for completion candidates...' ); - for ( i = 0; i < SETTINGS_NAMES.length; i++ ) { - v = SETTINGS_NAMES[ i ]; - if ( startsWith( v, value ) ) { - debug( 'Found a completion: %s', v ); - out.push( v ); - } else { - debug( '%s does not match filter %s. Skipping...', v, value ); - } - } - return value; -} - - -// EXPORTS // - -module.exports = complete; diff --git a/lib/node_modules/@stdlib/repl/lib/regexp_settings.js b/lib/node_modules/@stdlib/repl/lib/regexp_settings.js deleted file mode 100644 index 161d77940a1f..000000000000 --- a/lib/node_modules/@stdlib/repl/lib/regexp_settings.js +++ /dev/null @@ -1,106 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var SETTINGS_ALIASES = require( './settings_aliases.js' ); - - -// MAIN // - -/** -* Returns a regular expression for matching settings APIs. -* -* ## Notes -* -* - Example output: -* -* ```text -* /\b(?:(settings)\s*\(\s*(.*,\s*)*(?:\[\s*(?:[^\]]*,\s*)*)?['"]([^'"]*))$/ -* ``` -* -* @private -* @returns {RegExp} regular expression -*/ -function createRegExp() { - var re; - var N; - var M; - var i; - - N = SETTINGS_ALIASES.length; - M = N - 1; - re = ''; - - // Match a word boundary: - re += '\\b'; - - // Create a capture group for detecting an alias with an incomplete invocation (e.g., `settings( 'foo`): - re += '(?:'; - - // Create a capture group for matching the alias... - re += '('; - for ( i = 0; i < N; i++ ) { - // Append the alias: - re += SETTINGS_ALIASES[ i ][ 0 ]; - - // Separate aliases with an OR separator: - if ( i < M ) { - re += '|'; - } - } - // Close the alias capture group: - re += ')'; - - // Match zero or more whitespace characters after the alias: - re += '\\s*'; - - // Match an opening parenthesis literal: - re += '\\('; - - // Match zero or more whitespace characters after the opening parenthesis: - re += '\\s*'; - - // Capture provided (comma-separated) arguments which precede the last argument: - re += '(.*,\\s*)*'; - - // Capture, but don't remember, an incomplete array argument (including all items except for the last) which occurs zero or one time: - re += '(?:\\[\\s*(?:[^\\]]*,\\s*)*)?'; - - // Match either a `'` or `"` literal: - re += '[\'"]'; - - // Capture the last (incomplete) argument (or array item): - re += '([^\'"]*)'; - - // Close the incomplete invocation capture group: - re += ')'; - - // Match the end of input (i.e., ensure that the match is an incomplete invocation): - re += '$'; - - // Return the regular expression: - return new RegExp( re ); -} - - -// EXPORTS // - -module.exports = createRegExp; diff --git a/lib/node_modules/@stdlib/repl/lib/settings_aliases.js b/lib/node_modules/@stdlib/repl/lib/settings_aliases.js deleted file mode 100644 index 7e27cf222120..000000000000 --- a/lib/node_modules/@stdlib/repl/lib/settings_aliases.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/* -* List of settings API aliases and corresponding argument completion compatibility. -* -* ## Notes -* -* - Each entry in the list has the following format: -* -* ``` -* [ , , ... ] -* ``` -* -* where `` is a settings API alias and `` is a `boolean` indicating whether an argument is compatible with settings name completion. -* -* - For the purposes of TAB completion, only those positional arguments which expect settings names need to be included. For example, if an API has three parameters and only the first argument expects a settings name, only that first argument needs to be included below; the remaining two arguments can be omitted, as those arguments are assumed to be incompatible with settings name completion. If an API has three parameters and only the second argument expects a settings name, only the first two arguments need to be included below, with the first argument documented as `null`; the remaining argument can be omitted. -*/ -var aliases = [ - // Note: keep in alphabetical order... - [ 'settings', true ] -]; - - -// EXPORTS // - -module.exports = aliases; From 93672455072fdb31c6eadd19e1433fd203f019fe Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Sat, 8 Feb 2025 13:28:28 +0000 Subject: [PATCH 03/26] refactor: move example --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- .../@stdlib/repl/{ => cli}/presentation/examples/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename lib/node_modules/@stdlib/repl/{ => cli}/presentation/examples/index.js (97%) diff --git a/lib/node_modules/@stdlib/repl/presentation/examples/index.js b/lib/node_modules/@stdlib/repl/cli/presentation/examples/index.js similarity index 97% rename from lib/node_modules/@stdlib/repl/presentation/examples/index.js rename to lib/node_modules/@stdlib/repl/cli/presentation/examples/index.js index f74db49e0416..0a34df541338 100644 --- a/lib/node_modules/@stdlib/repl/presentation/examples/index.js +++ b/lib/node_modules/@stdlib/repl/cli/presentation/examples/index.js @@ -19,7 +19,7 @@ 'use strict'; var join = require( 'path' ).join; -var REPL = require( '@stdlib/repl' ); +var REPL = require( '@stdlib/repl/cli' ); var Presentation = require( './../lib' ); // eslint-disable-line stdlib/no-redeclare function onExit() { From 1808c07ba42a1623a12dac8d598785a534e44e40 Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Thu, 6 Mar 2025 19:10:54 +0000 Subject: [PATCH 04/26] refactor: move commands to client implementation Signed-off-by: Snehil Shah --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: passed - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed --- --- lib/node_modules/@stdlib/repl/base/README.md | 271 ++++++++++++++++++ .../@stdlib/repl/base/benchmark/benchmark.js | 95 ++++++ .../base/{lib/log.js => examples/index.js} | 33 +-- .../@stdlib/repl/base/lib/commands.js | 130 --------- .../repl/base/lib/complete_tutorial.js | 93 ------ .../@stdlib/repl/base/lib/completer.js | 17 -- .../@stdlib/repl/base/lib/defaults.js | 3 - .../@stdlib/repl/base/lib/index.js | 17 +- .../@stdlib/repl/base/lib/main.js | 158 +--------- .../@stdlib/repl/base/lib/regexp_tutorial.js | 106 ------- .../@stdlib/repl/base/lib/set_commands.js | 64 ----- .../repl/base/lib/set_commands_global.js | 72 ----- .../@stdlib/repl/base/lib/settings.js | 68 ----- .../repl/base/lib/settings_validators.js | 112 -------- .../@stdlib/repl/base/lib/tutorial_aliases.js | 46 --- .../@stdlib/repl/base/lib/validate.js | 24 +- .../repl/base/lib/validate_settings.js | 78 ----- .../@stdlib/repl/base/package.json | 7 - .../{lib/settings_names.js => test/test.js} | 26 +- lib/node_modules/@stdlib/repl/cli/README.md | 4 +- .../repl/{base => cli}/data/contributor.json | 0 .../repl/{base => cli}/data/example.csv | 0 .../repl/{base => cli}/data/example.json | 0 .../@stdlib/repl/{base => cli}/data/help.csv | 0 .../@stdlib/repl/{base => cli}/data/help.json | 0 .../@stdlib/repl/{base => cli}/data/info.csv | 0 .../@stdlib/repl/{base => cli}/data/info.json | 0 .../repl/{base => cli}/data/license_text.json | 0 .../repl/{base => cli}/data/tutorial.csv | 0 .../repl/{base => cli}/data/tutorial.json | 0 .../{base => cli}/docs/commands/__done__.txt | 0 .../{base => cli}/docs/commands/_require.txt | 0 .../{base => cli}/docs/commands/alias2pkg.txt | 0 .../docs/commands/alias2related.txt | 0 .../repl/{base => cli}/docs/commands/ans.txt | 0 .../docs/commands/assignfrom.txt | 0 .../{base => cli}/docs/commands/assignin.txt | 0 .../{base => cli}/docs/commands/citation.txt | 0 .../docs/commands/clear_history.txt | 0 .../docs/commands/clear_user_docs.txt | 0 .../docs/commands/clear_vars.txt | 0 .../docs/commands/clear_workspace.txt | 0 .../docs/commands/contributor.txt | 0 .../{base => cli}/docs/commands/copyright.txt | 0 .../{base => cli}/docs/commands/credits.txt | 0 .../docs/commands/current_workspace.txt | 0 .../docs/commands/deeprerequire.txt | 0 .../docs/commands/delete_workspace.txt | 0 .../{base => cli}/docs/commands/donate.txt | 0 .../{base => cli}/docs/commands/evalin.txt | 0 .../{base => cli}/docs/commands/example.txt | 0 .../{base => cli}/docs/commands/global.txt | 0 .../repl/{base => cli}/docs/commands/help.txt | 0 .../repl/{base => cli}/docs/commands/info.txt | 0 .../docs/commands/is_keyword.txt | 0 .../docs/commands/is_workspace.txt | 0 .../docs/commands/license_text.txt | 0 .../repl/{base => cli}/docs/commands/load.txt | 0 .../docs/commands/load_workspace.txt | 0 .../{base => cli}/docs/commands/log_start.txt | 0 .../{base => cli}/docs/commands/log_stop.txt | 0 .../repl/{base => cli}/docs/commands/quit.txt | 0 .../docs/commands/rename_workspace.txt | 0 .../{base => cli}/docs/commands/rerequire.txt | 0 .../{base => cli}/docs/commands/rerun.txt | 0 .../{base => cli}/docs/commands/reset.txt | 0 .../repl/{base => cli}/docs/commands/save.txt | 0 .../docs/commands/save_start.txt | 0 .../{base => cli}/docs/commands/save_stop.txt | 0 .../{base => cli}/docs/commands/tutorial.txt | 0 .../{base => cli}/docs/commands/user_doc.txt | 0 .../repl/{base => cli}/docs/commands/vars.txt | 0 .../docs/commands/vars_workspace.txt | 0 .../{base => cli}/docs/commands/workspace.txt | 0 .../docs/commands/workspaces.txt | 0 .../repl/{base => cli}/lib/alias_to_string.js | 0 .../@stdlib/repl/cli/lib/commands.js | 74 +++++ .../{base => cli}/lib/commands/__done__.js | 0 .../{base => cli}/lib/commands/alias2pkg.js | 0 .../lib/commands/alias2related.js | 0 .../repl/{base => cli}/lib/commands/ans.js | 0 .../{base => cli}/lib/commands/assignfrom.js | 0 .../{base => cli}/lib/commands/assignin.js | 0 .../{base => cli}/lib/commands/citation.js | 0 .../lib/commands/clear_history.js | 0 .../lib/commands/clear_user_docs.js | 0 .../{base => cli}/lib/commands/clear_vars.js | 0 .../lib/commands/clear_workspace.js | 0 .../{base => cli}/lib/commands/contributor.js | 0 .../{base => cli}/lib/commands/copyright.js | 0 .../{base => cli}/lib/commands/credits.js | 0 .../lib/commands/current_workspace.js | 0 .../lib/commands/deeprerequire.js | 0 .../lib/commands/delete_workspace.js | 0 .../repl/{base => cli}/lib/commands/donate.js | 0 .../repl/{base => cli}/lib/commands/evalin.js | 0 .../{base => cli}/lib/commands/example.js | 2 +- .../repl/{base => cli}/lib/commands/help.js | 0 .../repl/{base => cli}/lib/commands/info.js | 0 .../{base => cli}/lib/commands/is_keyword.js | 0 .../lib/commands/is_workspace.js | 0 .../lib/commands/license_text.js | 0 .../repl/{base => cli}/lib/commands/load.js | 0 .../lib/commands/load_workspace.js | 0 .../repl/{base => cli}/lib/commands/quit.js | 0 .../lib/commands/rename_workspace.js | 0 .../{base => cli}/lib/commands/rerequire.js | 0 .../repl/{base => cli}/lib/commands/reset.js | 0 .../{base => cli}/lib/commands/tutorial.js | 0 .../{base => cli}/lib/commands/user_doc.js | 0 .../repl/{base => cli}/lib/commands/vars.js | 0 .../lib/commands/vars_workspace.js | 0 .../{base => cli}/lib/commands/workspace.js | 0 .../{base => cli}/lib/commands/workspaces.js | 0 .../@stdlib/repl/cli/lib/contains.js | 60 ++++ .../{base => cli}/lib/find_unique_entry.js | 0 .../repl/{base => cli}/lib/index_of.js | 0 lib/node_modules/@stdlib/repl/cli/lib/main.js | 98 ++++++- .../repl/{base => cli}/lib/repl_docs.js | 0 .../repl/cli/lib/restore_regexp_matches.js | 48 ++++ .../lib/update_regexp_cache.js} | 29 +- .../repl/{base => cli}/scripts/build.js | 0 .../scripts/build_contributors.js | 0 .../repl/{base => cli}/scripts/build_help.js | 0 .../{base => cli}/scripts/build_license.js | 0 .../{base => cli}/scripts/build_tutorials.js | 0 .../cli/test/integration/test.auto_page.js | 2 +- .../integration/test.completion_previews.js | 8 +- 128 files changed, 710 insertions(+), 1035 deletions(-) create mode 100644 lib/node_modules/@stdlib/repl/base/README.md create mode 100644 lib/node_modules/@stdlib/repl/base/benchmark/benchmark.js rename lib/node_modules/@stdlib/repl/base/{lib/log.js => examples/index.js} (57%) delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/commands.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/set_commands.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/settings.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/settings_validators.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js delete mode 100644 lib/node_modules/@stdlib/repl/base/lib/validate_settings.js rename lib/node_modules/@stdlib/repl/base/{lib/settings_names.js => test/test.js} (64%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/contributor.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/example.csv (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/example.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/help.csv (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/help.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/info.csv (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/info.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/license_text.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/tutorial.csv (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/data/tutorial.json (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/__done__.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/_require.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/alias2pkg.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/alias2related.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/ans.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/assignfrom.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/assignin.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/citation.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/clear_history.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/clear_user_docs.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/clear_vars.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/clear_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/contributor.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/copyright.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/credits.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/current_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/deeprerequire.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/delete_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/donate.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/evalin.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/example.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/global.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/help.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/info.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/is_keyword.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/is_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/license_text.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/load.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/load_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/log_start.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/log_stop.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/quit.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/rename_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/rerequire.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/rerun.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/reset.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/save.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/save_start.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/save_stop.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/tutorial.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/user_doc.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/vars.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/vars_workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/workspace.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/docs/commands/workspaces.txt (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/alias_to_string.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/__done__.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/alias2pkg.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/alias2related.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/ans.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/assignfrom.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/assignin.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/citation.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/clear_history.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/clear_user_docs.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/clear_vars.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/clear_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/contributor.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/copyright.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/credits.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/current_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/deeprerequire.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/delete_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/donate.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/evalin.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/example.js (98%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/help.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/info.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/is_keyword.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/is_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/license_text.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/load.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/load_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/quit.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/rename_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/rerequire.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/reset.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/tutorial.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/user_doc.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/vars.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/vars_workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/workspace.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/commands/workspaces.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/contains.js rename lib/node_modules/@stdlib/repl/{base => cli}/lib/find_unique_entry.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/index_of.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/lib/repl_docs.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/cli/lib/restore_regexp_matches.js rename lib/node_modules/@stdlib/repl/{base/lib/tutorial_alias_args.js => cli/lib/update_regexp_cache.js} (51%) rename lib/node_modules/@stdlib/repl/{base => cli}/scripts/build.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/scripts/build_contributors.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/scripts/build_help.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/scripts/build_license.js (100%) rename lib/node_modules/@stdlib/repl/{base => cli}/scripts/build_tutorials.js (100%) diff --git a/lib/node_modules/@stdlib/repl/base/README.md b/lib/node_modules/@stdlib/repl/base/README.md new file mode 100644 index 000000000000..0e9742584878 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/README.md @@ -0,0 +1,271 @@ + + +# REPL + +> Base class for Read-Eval-Print Loop (REPL) environment. + + + +
+ +A Read-Eval-Print Loop (REPL) environment is an interactive programming environment which takes individual user inputs (e.g., single expressions), evaluates those inputs, and returns the result. Accordingly, a program written in a REPL environment is executed piecewise and sequentially. + +REPL environments find common use in exploratory programming, prototyping, and debugging. + +The REPL environment exposed here is available both as a standalone application and as a library which is embeddable in other libraries and applications. + +
+ + + + + +
+ +## Usage + +```javascript +var REPL = require( '@stdlib/repl/base' ); +``` + +#### REPL( \[options] ) + +Returns a `REPL` instance. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Execute a command: +repl.emit( 'input', '2 + 3' ); + +// ... + +// Close the REPL: +repl.close(); +``` + +The function accepts the following `options`: + +- **input**: input (readable) stream. Default: [`stdin`][@stdlib/streams/node/stdin]. +- **output**: output (writable) stream. Default: [`stdout`][@stdlib/streams/node/stdout]. +- **error**: error (writable) stream. Default: [`stderr`][@stdlib/streams/node/stderr]. +- **sandbox**: boolean indicating whether to run a REPL in a sandboxed context. Default: `false`. +- **timeout**: number of milliseconds to execute a command before terminating execution. Default: `4294967295`. +- **save**: file path specifying where to save REPL command history. +- **log**: file path specifying where to save REPL commands and printed output. +- **quiet**: boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced. Default: `false`. + +#### REPL.prototype.createContext() + +Returns a REPL context. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Return a new REPL context: +var ctx = repl.createContext(); + +// ... + +// Close the REPL: +repl.close(); +``` + +#### REPL.prototype.resetContext() + +Resets a REPL's execution context. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Reset the REPL context: +repl.resetContext(); + +// ... + +// Close the REPL: +repl.close(); +``` + +#### REPL.prototype.clearHistory() + +Clears a REPL's history. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Clear the REPL history: +repl.clearHistory(); + +// ... + +// Close the REPL: +repl.close(); +``` + +#### REPL.prototype.clearUserDocs() + +Clears user-defined documentation. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Clear user-defined documentation: +repl.clearUserDocs(); + +// ... + +// Close the REPL: +repl.close(); +``` + +#### REPL.prototype.reset() + +Resets a REPL. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Reset the REPL: +repl.reset(); + +// ... + +// Close the REPL: +repl.close(); +``` + +#### REPL.prototype.close() + +Closes a REPL. + +```javascript +// Create a new REPL: +var repl = new REPL(); + +// ... + +// Close the REPL: +repl.close(); +``` + +* * * + +
+ + + + + +
+ +
+ + + + + +* * * + +
+ +## Examples + + + +```javascript +var REPL = require( '@stdlib/repl/base' ); + +function onCommand( cmd, success, res ) { + console.log( cmd + ' = ' + res.toString() ); +} + +// Create a new REPL: +var repl = new REPL(); +repl.on( 'command', onCommand ); + +// Execute a command: +repl.emit( 'input', '3 + 2' ); + +// Close the REPL: +repl.close(); +console.log( 'REPL closed.' ); +``` + +
+ + + +* * * + +
+ +
+ + + + + +
+ +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/repl/base/benchmark/benchmark.js b/lib/node_modules/@stdlib/repl/base/benchmark/benchmark.js new file mode 100644 index 000000000000..4b0a69062900 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/base/benchmark/benchmark.js @@ -0,0 +1,95 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var inspectSinkStream = require( '@stdlib/streams/node/inspect-sink' ); +var randu = require( '@stdlib/random/streams/randu' ); +var noop = require( '@stdlib/utils/noop' ); +var pkg = require( './../package.json' ).name; +var REPL = require( './../lib' ); + + +// MAIN // + +bench( pkg+'::new', function benchmark( b ) { + var sopts; + var opts; + var r; + var i; + + opts = { + 'output': inspectSinkStream( noop ), + 'error': inspectSinkStream( noop ) + }; + sopts = { + 'iter': 1 + }; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + opts.input = randu( sopts ); // Note: this is slow, but should not be rate-limiting + r = new REPL( opts ); + if ( typeof r !== 'object' ) { + b.fail( 'should return an object' ); + } + r.close(); + } + b.toc(); + if ( !( r instanceof REPL ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); + +bench( pkg+'::no_new', function benchmark( b ) { + var sopts; + var repl; + var opts; + var r; + var i; + + repl = REPL; + opts = { + 'output': inspectSinkStream( noop ), + 'error': inspectSinkStream( noop ) + }; + sopts = { + 'iter': 1 + }; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + opts.input = randu( sopts ); // Note: this is slow, but should not be rate-limiting + r = repl( opts ); + if ( typeof r !== 'object' ) { + b.fail( 'should return an object' ); + } + r.close(); + } + b.toc(); + if ( !( r instanceof REPL ) ) { + b.fail( 'should return an instance' ); + } + b.pass( 'benchmark finished' ); + b.end(); +}); diff --git a/lib/node_modules/@stdlib/repl/base/lib/log.js b/lib/node_modules/@stdlib/repl/base/examples/index.js similarity index 57% rename from lib/node_modules/@stdlib/repl/base/lib/log.js rename to lib/node_modules/@stdlib/repl/base/examples/index.js index 1ae2f532f99b..19ad97ab2eac 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/log.js +++ b/lib/node_modules/@stdlib/repl/base/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2019 The Stdlib Authors. +* Copyright (c) 2025 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,30 +16,21 @@ * limitations under the License. */ -/* eslint-disable no-underscore-dangle */ - 'use strict'; -// MAIN // +var REPL = require( './../lib' ); -/** -* Writes a message to the REPL output stream. -* -* ## Notes -* -* - Automatically appends a newline character to a provide message. -* -* @private -* @param {REPL} repl - REPL instance -* @param {string} msg - message -*/ -function log( repl, msg ) { - if ( repl._quiet === false ) { - repl._ostream.write( msg+'\n' ); - } +function onCommand( cmd, success, res ) { + console.log( cmd + ' = ' + res.toString() ); } +// Create a new REPL: +var repl = new REPL(); +repl.on( 'command', onCommand ); -// EXPORTS // +// Execute a command: +repl.emit( 'input', '3 + 2' ); -module.exports = log; +// Close the REPL: +repl.close(); +console.log( 'REPL closed.' ); diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands.js b/lib/node_modules/@stdlib/repl/base/lib/commands.js deleted file mode 100644 index 252afaf8d3d6..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/commands.js +++ /dev/null @@ -1,130 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var onAlias2Pkg = require( './commands/alias2pkg.js' ); -var onAlias2Related = require( './commands/alias2related.js' ); -var onAns = require( './commands/ans.js' ); -var onAssignin = require( './commands/assignin.js' ); -var onAssignfrom = require( './commands/assignfrom.js' ); -var onCitation = require( './commands/citation.js' ); -var onClearHistory = require( './commands/clear_history.js' ); -var onClearUserDocs = require( './commands/clear_user_docs.js' ); -var onClearVars = require( './commands/clear_vars.js' ); -var onClearWorkspace = require( './commands/clear_workspace.js' ); -var onContributors = require( './commands/contributor.js' ); -var onCopyright = require( './commands/copyright.js' ); -var onCredits = require( './commands/credits.js' ); -var onCurrentWorkspace = require( './commands/current_workspace.js' ); -var onDeleteWorkspace = require( './commands/delete_workspace.js' ); -var onDeeprerequire = require( './commands/deeprerequire.js' ); -var onDonate = require( './commands/donate.js' ); -var onDone = require( './commands/__done__.js' ); -var onEvalin = require( './commands/evalin.js' ); -var onExample = require( './commands/example.js' ); -var onHelp = require( './commands/help.js' ); -var onInfo = require( './commands/info.js' ); -var isWorkspace = require( './commands/is_workspace.js' ); -var isKeyword = require( './commands/is_keyword.js' ); -var onLicense = require( './commands/license_text.js' ); -var onLoad = require( './commands/load.js' ); -var onLoadWorkspace = require( './commands/load_workspace.js' ); -var onQuit = require( './commands/quit.js' ); -var onRenameWorkspace = require( './commands/rename_workspace.js' ); -var onRerequire = require( './commands/rerequire.js' ); -var onReset = require( './commands/reset.js' ); -var onTutorial = require( './commands/tutorial.js' ); -var onUserDoc = require( './commands/user_doc.js' ); -var onVars = require( './commands/vars.js' ); -var onVarsWorkspace = require( './commands/vars_workspace.js' ); -var onWorkspace = require( './commands/workspace.js' ); -var onWorkspaces = require( './commands/workspaces.js' ); - - -// MAIN // - -/** -* Returns a list of REPL-specific commands. -* -* ## Notes -* -* - Each array element is comprised as follows: -* -* ```text -* [ , , ] -* ``` -* -* where the first element is the command alias, the second element the command callback, and the third element a boolean indicating whether the callback is an accessor (getter; i.e., the command refers to a property rather than a function to be explicitly invoked). -* -* @private -* @param {REPL} repl - REPL instance -* @returns {ArrayArray} commands -*/ -function commands( repl ) { - var cmds; - - // Define a list of REPL-specific commands (NOTE: keep in alphabetical order): - cmds = []; - cmds.push( [ '__done__', onDone( repl ), false ] ); - cmds.push( [ 'alias2pkg', onAlias2Pkg( repl ), false ] ); - cmds.push( [ 'alias2related', onAlias2Related( repl, cmds ), false ] ); - cmds.push( [ 'ans', onAns( repl ), true ] ); - cmds.push( [ 'assignfrom', onAssignfrom( repl ), false ] ); - cmds.push( [ 'assignin', onAssignin( repl ), false ] ); - cmds.push( [ 'citation', onCitation( repl ), false ] ); - cmds.push( [ 'clearHistory', onClearHistory( repl ), false ] ); - cmds.push( [ 'clearUserDocs', onClearUserDocs( repl ), false ] ); - cmds.push( [ 'clearVars', onClearVars( repl ), false ] ); - cmds.push( [ 'clearWorkspace', onClearWorkspace( repl ), false ] ); - cmds.push( [ 'contributors', onContributors( repl ), false ] ); - cmds.push( [ 'copyright', onCopyright( repl ), false ] ); - cmds.push( [ 'credits', onCredits( repl ), false ] ); - cmds.push( [ 'currentWorkspace', onCurrentWorkspace( repl ), true ] ); - cmds.push( [ 'deleteWorkspace', onDeleteWorkspace( repl ), false ] ); - cmds.push( [ 'deeprerequire', onDeeprerequire( repl ), false ] ); - cmds.push( [ 'donate', onDonate( repl ), false ] ); - cmds.push( [ 'evalin', onEvalin( repl, cmds ), false ] ); - cmds.push( [ 'example', onExample( repl, cmds ), false ] ); - cmds.push( [ 'help', onHelp( repl, cmds ), false ] ); - cmds.push( [ 'info', onInfo( repl, cmds ), false ] ); - cmds.push( [ 'isKeyword', isKeyword( repl ), false ] ); - cmds.push( [ 'isWorkspace', isWorkspace( repl ), false ] ); - cmds.push( [ 'license', onLicense( repl ), false ] ); - cmds.push( [ 'load', onLoad( repl ), false ] ); - cmds.push( [ 'loadWorkspace', onLoadWorkspace( repl ), false ] ); - cmds.push( [ 'quit', onQuit( repl ), false ] ); - cmds.push( [ 'renameWorkspace', onRenameWorkspace( repl ), false ] ); - cmds.push( [ 'rerequire', onRerequire( repl ), false ] ); - cmds.push( [ 'reset', onReset( repl ), false ] ); - cmds.push( [ 'tutorial', onTutorial( repl ), false ] ); - cmds.push( [ 'userDoc', onUserDoc( repl ), false ] ); - cmds.push( [ 'vars', onVars( repl ), false ] ); - cmds.push( [ 'varsWorkspace', onVarsWorkspace( repl ), false ] ); - cmds.push( [ 'workspace', onWorkspace( repl ), false ] ); - cmds.push( [ 'workspaces', onWorkspaces( repl ), false ] ); - - return cmds; -} - - -// EXPORTS // - -module.exports = commands; diff --git a/lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js b/lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js deleted file mode 100644 index d66e1be6ca39..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/complete_tutorial.js +++ /dev/null @@ -1,93 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var logger = require( 'debug' ); -var parse = require( 'acorn-loose' ).parse; -var startsWith = require( '@stdlib/string/starts-with' ); -var objectKeys = require( '@stdlib/utils/keys' ); -var tutorialAliasArgs = require( './tutorial_alias_args.js' ); -var TUTORIALS = require( './repl_docs.js' ).tutorial; - - -// VARIABLES // - -var debug = logger( 'repl:completer:tutorial' ); -var TUTS = objectKeys( TUTORIALS ); -var AOPTS = { - 'ecmaVersion': 'latest' -}; - - -// MAIN // - -/** -* Completes a tutorial API expression. -* -* @private -* @param {Array} out - output array for storing completions -* @param {REPL} repl - REPL instance -* @param {string} expression - expression to complete -* @param {string} alias - tutorial API alias -* @param {string} value - value to complete -* @returns {string} value filter -*/ -function complete( out, repl, expression, alias, value ) { - var args; - var ast; - var arg; - var t; - var i; - - // Get the list of argument types for the desired API: - debug( 'Tutorial API: %s', alias ); - args = tutorialAliasArgs( alias ); - - // Parse the expression into an AST: - debug( 'Expression: %s', expression ); - ast = parse( expression, AOPTS ); - - // Check whether the argument which triggered TAB completion has a corresponding argument type which is completable: - debug( 'Checking if argument is completable...' ); - arg = args[ ast.body[ 0 ].expression.arguments.length-1 ]; - if ( !arg ) { - debug( 'Argument which triggered TAB completion is not completable.' ); - return ''; - } - debug( 'Argument is completable.' ); - - debug( 'Searching for completion candidates...' ); - for ( i = 0; i < TUTS.length; i++ ) { - t = TUTS[ i ]; - if ( startsWith( t, value ) ) { - debug( 'Found a completion: %s', t ); - out.push( t ); - } else { - debug( '%s does not match filter %s. Skipping...', t, value ); - } - } - return value; -} - - -// EXPORTS // - -module.exports = complete; diff --git a/lib/node_modules/@stdlib/repl/base/lib/completer.js b/lib/node_modules/@stdlib/repl/base/lib/completer.js index d859c4a6a92c..2688055ee4a9 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/completer.js +++ b/lib/node_modules/@stdlib/repl/base/lib/completer.js @@ -28,12 +28,10 @@ var hasOwnProp = require( '@stdlib/assert/has-own-property' ); var fsRegExp = require( './regexp_fs_aliases.js' ); var requireRegExp = require( './regexp_require.js' ); var workspaceRegExp = require( './regexp_workspace.js' ); -var tutorialRegExp = require( './regexp_tutorial.js' ); var reservedCharsRegExp = require( './regexp_reserved_syntax_characters.js' ); var completeRequire = require( './complete_require.js' ); var completeFS = require( './complete_fs.js' ); var completeWorkspace = require( './complete_workspace.js' ); -var completeTutorial = require( './complete_tutorial.js' ); var completeExpression = require( './complete_expression.js' ); @@ -148,21 +146,6 @@ function completer( repl ) { debug( 'Results: %s', res.join( ', ' ) ); return clbk( null, [ res, line ] ); } - // Test if the line has an incomplete tutorial expression: - match = line.match( tutorialRegExp() ); - if ( match ) { - debug( 'Detected incomplete tutorial expression.' ); - - debug( 'Expression: %s', match[ 0 ] ); - debug( 'Tutorial API: %s', match[ 1 ] ); - debug( 'Value to complete: %s', match[ 3 ] ); - line = completeTutorial( res, repl, match[ 0 ], match[ 1 ], match[ 3 ] ); // eslint-disable-line max-len - res = normalize( res ); - - debug( 'Completion filter: %s', line ); - debug( 'Results: %s', res.join( ', ' ) ); - return clbk( null, [ res, line ] ); - } // Sanity check that we are attempting to complete something which is completable: if ( reservedCharsRegExp().test( line[ repl._rli.cursor-1 ] ) ) { debug( 'Detected attempt to trigger completion after a special character.' ); diff --git a/lib/node_modules/@stdlib/repl/base/lib/defaults.js b/lib/node_modules/@stdlib/repl/base/lib/defaults.js index 02b42792e96b..bb9686d6114c 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/defaults.js +++ b/lib/node_modules/@stdlib/repl/base/lib/defaults.js @@ -57,9 +57,6 @@ function defaults() { // File path specifying where to save REPL command history: 'save': '', - // File path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file): - 'load': '', - // File path specifying where to save REPL commands and printed output: 'log': '', diff --git a/lib/node_modules/@stdlib/repl/base/lib/index.js b/lib/node_modules/@stdlib/repl/base/lib/index.js index 80fec5e90aaf..a19109130546 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/index.js +++ b/lib/node_modules/@stdlib/repl/base/lib/index.js @@ -19,23 +19,20 @@ 'use strict'; /** -* REPL. +* Base class for REPL. * * @module @stdlib/repl/base * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); * var REPL = require( '@stdlib/repl/base' ); * -* function onExit() { -* console.log( 'REPL closed.' ); -* } -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); -* repl.on( 'exit', onExit ); +* var repl = new REPL(); +* +* // ... +* +* // Execute a command: +* repl.emit( 'input', '2 + 3' ); * * // ... * diff --git a/lib/node_modules/@stdlib/repl/base/lib/main.js b/lib/node_modules/@stdlib/repl/base/lib/main.js index 4816c427590c..345598f25bb4 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/main.js +++ b/lib/node_modules/@stdlib/repl/base/lib/main.js @@ -23,30 +23,20 @@ // MODULES // var EventEmitter = require( 'events' ).EventEmitter; -var resolve = require( 'path' ).resolve; var logger = require( 'debug' ); var inherit = require( '@stdlib/utils/inherit' ); -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isFunction = require( '@stdlib/assert/is-function' ); var isConfigurableProperty = require( '@stdlib/assert/is-configurable-property' ); var hasOwnProp = require( '@stdlib/assert/has-own-property' ); var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' ); var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var format = require( '@stdlib/string/format' ); -var cwd = require( '@stdlib/process/cwd' ); -var readFileSync = require( '@stdlib/fs/read-file' ).sync; -var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; var fifo = require( '@stdlib/utils/fifo' ); var nextTick = require( '@stdlib/utils/next-tick' ); var validate = require( './validate.js' ); var defaults = require( './defaults.js' ); var setAliases = require( './set_aliases.js' ); var setAliasesGlobal = require( './set_aliases_global.js' ); -var setCommands = require( './set_commands.js' ); -var setCommandsGlobal = require( './set_commands_global.js' ); var createEvalContext = require( './create_evaluation_context.js' ); -var commands = require( './commands.js' ); var completerFactory = require( './completer.js' ); var tokenizer = require( './tokenizer.js' ); var processCommand = require( './process_command.js' ); @@ -64,7 +54,7 @@ var debug = logger( 'repl' ); // MAIN // /** -* REPL base constructor. +* REPL constructor. * * @constructor * @param {Options} options - constructor options @@ -73,7 +63,6 @@ var debug = logger( 'repl' ); * @param {WritableStream} [options.error=process.stderr] - error stream * @param {boolean} [options.sandbox=true] - boolean indicating whether to run a REPL in a sandboxed context * @param {PositiveInteger} [options.timeout=4294967295] - number of milliseconds to execute a command before terminating execution -* @param {string} [options.load] - file path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file) * @param {string} [options.save] - file path specifying where to save REPL command history * @param {string} [options.log] - file path specifying where to save REPL commands and printed output * @param {string} [options.quiet=false] - boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced @@ -81,17 +70,15 @@ var debug = logger( 'repl' ); * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* -* function onExit() { -* console.log( 'REPL closed.' ); -* } +* var REPL = require( '@stdlib/repl/base' ); * * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); -* repl.on( 'exit', onExit ); +* var repl = new REPL(); +* +* // ... +* +* // Execute a command: +* repl.emit( 'input', '2 + 3' ); * * // ... * @@ -126,7 +113,6 @@ function REPL( options ) { 'timeout': opts.timeout, 'isTTY': opts.isTTY, 'padding': opts.padding, - 'load': opts.load, 'save': opts.save, 'log': opts.log, 'quiet': opts.quiet @@ -218,12 +204,7 @@ function REPL( options ) { // TODO: check whether to synchronously initialize a REPL log file - // Check whether to load and execute a JavaScript file (e.g., prior REPL history) upon startup... - if ( opts.load ) { - this.load( opts.load ); - } else { - this._count += 1; - } + this._count += 1; return this; /** @@ -330,12 +311,8 @@ setNonEnumerableReadOnly( REPL.prototype, '_compileCommand', compileCommand ); * @returns {Object} REPL context * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // Return a new REPL context: * var ctx = repl.createContext(); @@ -345,7 +322,6 @@ setNonEnumerableReadOnly( REPL.prototype, '_compileCommand', compileCommand ); */ setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContext() { var context; - var cmds; debug( 'Creating REPL execution context...' ); @@ -359,16 +335,6 @@ setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContex setAliasesGlobal( this._globalVars, this._aliases, context, ALIAS_OVERRIDES ); // eslint-disable-line max-len } - // Get the list of REPL-specific commands: - cmds = commands( this ); - - // Add commands requiring privileged access to internal instance variables... - if ( this._sandbox ) { - setCommands( context, cmds ); - } else { - setCommandsGlobal( this._globalVars, context, cmds ); - } - return context; }); @@ -381,12 +347,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'createContext', function createContex * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // ... * @@ -457,12 +419,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'resetContext', function resetContext( * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // ... * @@ -489,12 +447,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'clearHistory', function clearHistory( * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // ... * @@ -512,80 +466,6 @@ setNonEnumerableReadOnly( REPL.prototype, 'clearUserDocs', function clearUserDoc return this; }); -/** -* Loads and evaluates a JavaScript file line-by-line. -* -* @name load -* @memberof REPL.prototype -* @type {Function} -* @param {string} fpath - file path -* @param {Function} clbk - callback -* @throws {Error} cannot load a file into a closed REPL -* @throws {TypeError} first argument must be a string -* @throws {TypeError} second argument must be a function -* @returns {void} -* -* @example -* // TODO -*/ -setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { - var self; - var file; - var len; - var i; - if ( this._closed ) { - throw new Error( 'invalid operation. Cannot load a file into a REPL which has already closed.' ); - } - if ( !isString( fpath ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', fpath ) ); - } - if ( !isFunction( clbk ) ) { - throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) ); - } - // Resolve the provided path to an absolute file path: - fpath = resolve( cwd(), fpath ); - debug( 'Loading filepath: %s', fpath ); - - // Attempt to synchronously read the file: - file = readFileSync( fpath, 'utf8' ); - if ( file instanceof Error ) { - debug( 'Error: %s', file.message ); - clbk( file ); - return; - } - self = this; - - // Split the file content into individual lines: - file = file.split( RE_EOL ); - - // Forward each line to the REPL readline interface in order to mimic user input... - len = file.length; - i = -1; - - nextTick( next ); - - /** - * Callback invoked after draining the command queue. - * - * @private - * @param {string} cmd - command - * @param {boolean} success - boolean indicating whether the command successfully executed - */ - function next() { - i += 1; - if ( i < len ) { - if ( file[ i ] ) { - self._rli.write( file[ i ]+'\n' ); - self.once( 'drain', next ); - } else { - nextTick( next ); - } - } else { - nextTick( clbk ); - } - } -}); - /** * Resets a REPL. * @@ -596,12 +476,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // ... * @@ -640,12 +516,8 @@ setNonEnumerableReadOnly( REPL.prototype, 'reset', function onReset() { * @returns {REPL} REPL instance * * @example -* var debug = require( '@stdlib/streams/node/debug-sink' ); -* * // Create a new REPL: -* var repl = new REPL({ -* 'output': debug() -* }); +* var repl = new REPL(); * * // ... * diff --git a/lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js b/lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js deleted file mode 100644 index 280554a6fe25..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/regexp_tutorial.js +++ /dev/null @@ -1,106 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var TUTORIAL_ALIASES = require( './tutorial_aliases.js' ); - - -// MAIN // - -/** -* Returns a regular expression for matching tutorial APIs. -* -* ## Notes -* -* - Example output: -* -* ```text -* /\b(?:(tutorial)\s*\(\s*(.*,\s*)*(?:\[\s*(?:[^\]]*,\s*)*)?['"]([^'"]*))$/ -* ``` -* -* @private -* @returns {RegExp} regular expression -*/ -function createRegExp() { - var re; - var N; - var M; - var i; - - N = TUTORIAL_ALIASES.length; - M = N - 1; - re = ''; - - // Match a word boundary: - re += '\\b'; - - // Create a capture group for detecting an alias with an incomplete invocation (e.g., `tutorial( 'foo`): - re += '(?:'; - - // Create a capture group for matching the alias... - re += '('; - for ( i = 0; i < N; i++ ) { - // Append the alias: - re += TUTORIAL_ALIASES[ i ][ 0 ]; - - // Separate aliases with an OR separator: - if ( i < M ) { - re += '|'; - } - } - // Close the alias capture group: - re += ')'; - - // Match zero or more whitespace characters after the alias: - re += '\\s*'; - - // Match an opening parenthesis literal: - re += '\\('; - - // Match zero or more whitespace characters after the opening parenthesis: - re += '\\s*'; - - // Capture provided (comma-separated) arguments which precede the last argument: - re += '(.*,\\s*)*'; - - // Capture, but don't remember, an incomplete array argument (including all items except for the last) which occurs zero or one time: - re += '(?:\\[\\s*(?:[^\\]]*,\\s*)*)?'; - - // Match either a `'` or `"` literal: - re += '[\'"]'; - - // Capture the last (incomplete) argument (or array item): - re += '([^\'"]*)'; - - // Close the incomplete invocation capture group: - re += ')'; - - // Match the end of input (i.e., ensure that the match is an incomplete invocation): - re += '$'; - - // Return the regular expression: - return new RegExp( re ); -} - - -// EXPORTS // - -module.exports = createRegExp; diff --git a/lib/node_modules/@stdlib/repl/base/lib/set_commands.js b/lib/node_modules/@stdlib/repl/base/lib/set_commands.js deleted file mode 100644 index c35a6736d8d4..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/set_commands.js +++ /dev/null @@ -1,64 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var logger = require( 'debug' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var setReadOnly = require( '@stdlib/utils/define-read-only-property' ); -var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); - - -// VARIABLES // - -var debug = logger( 'repl:set_commands' ); - - -// MAIN // - -/** -* Sets commands on a sandboxed `context` object. -* -* @private -* @param {Object} context - context object -* @param {ArrayArray} commands - commands -* @returns {Object} context object -*/ -function setCommands( context, commands ) { - var cmd; - var i; - - for ( i = 0; i < commands.length; i++ ) { - cmd = commands[ i ]; - if ( hasOwnProp( context, cmd[ 0 ] ) ) { - debug( 'Skipping command as global context property `'+cmd[0]+'` is already assigned.' ); - } else if ( cmd[ 2 ] ) { - setReadOnlyAccessor( context, cmd[ 0 ], cmd[ 1 ] ); - } else { - setReadOnly( context, cmd[ 0 ], cmd[ 1 ] ); - } - } - return context; -} - - -// EXPORTS // - -module.exports = setCommands; diff --git a/lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js b/lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js deleted file mode 100644 index 3f3c7b36ce60..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/set_commands_global.js +++ /dev/null @@ -1,72 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var logger = require( 'debug' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var setConfigurableReadOnly = require( '@stdlib/utils/define-configurable-read-only-property' ); -var setConfigurableReadOnlyAccessor = require( '@stdlib/utils/define-configurable-read-only-accessor' ); // eslint-disable-line id-length - - -// VARIABLES // - -var debug = logger( 'repl:set_commands_global' ); - - -// MAIN // - -/** -* Sets commands on non-sandboxed `context` object. -* -* ## Notes -* -* - This function avoids overwriting properties in a non-sandboxed environment in order to avoid unintended side-effects. -* -* @private -* @param {Array} out - output array for storing a list of global variables added to the global namespace -* @param {Object} context - context object -* @param {ArrayArray} commands - commands -* @returns {Object} context object -*/ -function setCommandsGlobal( out, context, commands ) { - var cmd; - var i; - - for ( i = 0; i < commands.length; i++ ) { - cmd = commands[ i ]; - if ( hasOwnProp( context, cmd[ 0 ] ) ) { - debug( 'Skipping command as global context property `'+cmd[0]+'` is already assigned.' ); - } else { - out.push( cmd[ 0 ] ); - if ( cmd[ 2 ] ) { - setConfigurableReadOnlyAccessor( context, cmd[ 0 ], cmd[ 1 ] ); - } else { - setConfigurableReadOnly( context, cmd[ 0 ], cmd[ 1 ] ); - } - } - } - return context; -} - - -// EXPORTS // - -module.exports = setCommandsGlobal; diff --git a/lib/node_modules/@stdlib/repl/base/lib/settings.js b/lib/node_modules/@stdlib/repl/base/lib/settings.js deleted file mode 100644 index 53a38eaffc00..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/settings.js +++ /dev/null @@ -1,68 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/** -* REPL settings. -* -* @private -* @name SETTINGS -* @type {Object} -*/ -var SETTINGS = { - 'autoClosePairs': { - 'desc': 'Automatically insert matching brackets, parentheses, and quotes.', - 'type': 'boolean' - }, - 'autoDeletePairs': { - 'desc': 'Automatically delete adjacent matching brackets, parentheses, and quotes.', - 'type': 'boolean' - }, - 'autoPage': { - 'desc': 'Automatically page return values whose display size exceeds the visible screen.', - 'type': 'boolean' - }, - 'bracketedPaste': { - 'desc': 'Enable bracketed-paste mode.', - 'type': 'boolean' - }, - 'completionPreviews': { - 'desc': 'Enable the display of completion previews for auto-completion.', - 'type': 'boolean' - }, - 'autoDisableBracketedPasteOnExit': { - 'desc': 'Automatically disable bracketed-paste upon exiting the REPL.', - 'type': 'boolean' - }, - 'syntaxHighlighting': { - 'desc': 'Enable syntax highlighting.', - 'type': 'boolean' - }, - 'theme': { - 'desc': 'Set the syntax highlighting theme.', - 'type': 'string' - } -}; - - -// EXPORTS // - -module.exports = SETTINGS; diff --git a/lib/node_modules/@stdlib/repl/base/lib/settings_validators.js b/lib/node_modules/@stdlib/repl/base/lib/settings_validators.js deleted file mode 100644 index 345b07acaa48..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/settings_validators.js +++ /dev/null @@ -1,112 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive; -var isString = require( '@stdlib/assert/is-string' ).isPrimitive; -var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; -var isInteger = require( '@stdlib/assert/is-integer' ).isPrimitive; -var format = require( '@stdlib/string/format' ); - - -// FUNCTIONS // - -/** -* Returns a formatted error message for a value is not a boolean. -* -* @private -* @param {string} name - setting name -* @param {*} value - invalid value -* @returns {string} formatted error message -*/ -function booleanErrMsg( name, value ) { - return format( 'invalid argument. `%s` setting must be a boolean. Value: `%s`.', name, value ); -} - -/** -* Returns a formatted error message for a value is not an integer. -* -* @private -* @param {string} name - setting name -* @param {*} value - invalid value -* @returns {string} formatted error message -*/ -function integerErrMsg( name, value ) { - return format( 'invalid argument. `%s` setting must be an integer. Value: `%s`.', name, value ); -} - -/** -* Returns a formatted error message for a value is not a number. -* -* @private -* @param {string} name - setting name -* @param {*} value - invalid value -* @returns {string} formatted error message -*/ -function numberErrMsg( name, value ) { - return format( 'invalid argument. `%s` setting must be a number. Value: `%s`.', name, value ); -} - -/** -* Returns a formatted error message for a value is not a string. -* -* @private -* @param {string} name - setting name -* @param {*} value - invalid value -* @returns {string} formatted error message -*/ -function stringErrMsg( name, value ) { - return format( 'invalid argument. `%s` setting must be a string. Value: `%s`.', name, value ); -} - - -// MAIN // - -/** -* Mapping from data types to validation functions. -* -* @private -* @name VALIDATORS -* @type {Object} -*/ -var VALIDATORS = { // eslint-disable-line vars-on-top - 'boolean': { - 'assert': isBoolean, - 'msg': booleanErrMsg - }, - 'integer': { - 'assert': isInteger, - 'msg': integerErrMsg - }, - 'number': { - 'assert': isNumber, - 'msg': numberErrMsg - }, - 'string': { - 'assert': isString, - 'msg': stringErrMsg - } -}; - - -// EXPORTS // - -module.exports = VALIDATORS; diff --git a/lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js b/lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js deleted file mode 100644 index 4ce3ee14a9f4..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/tutorial_aliases.js +++ /dev/null @@ -1,46 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2019 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MAIN // - -/* -* List of tutorial API aliases and corresponding argument completion compatibility. -* -* ## Notes -* -* - Each entry in the list has the following format: -* -* ``` -* [ , , ... ] -* ``` -* -* where `` is a tutorial API alias and `` is a `boolean` indicating whether an argument is compatible with tutorial name completion. -* -* - For the purposes of TAB completion, only those positional arguments which expect tutorial names need to be included. For example, if an API has three parameters and only the first argument expects a tutorial name, only that first argument needs to be included below; the remaining two arguments can be omitted, as those arguments are assumed to be incompatible with tutorial name completion. If an API has three parameters and only the second argument expects a tutorial name, only the first two arguments need to be included below, with the first argument documented as `null`; the remaining argument can be omitted. -*/ -var aliases = [ - // Note: keep in alphabetical order... - [ 'tutorial', true ] -]; - - -// EXPORTS // - -module.exports = aliases; diff --git a/lib/node_modules/@stdlib/repl/base/lib/validate.js b/lib/node_modules/@stdlib/repl/base/lib/validate.js index 98ee9d76a257..ab7ad4fc1453 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/validate.js +++ b/lib/node_modules/@stdlib/repl/base/lib/validate.js @@ -38,20 +38,14 @@ var format = require( '@stdlib/string/format' ); * @private * @param {Object} opts - destination object * @param {Options} options - function options -* @param {string} [options.inputPrompt] - input prompt -* @param {string} [options.outputPrompt] - output prompt -* @param {ReadableStream} [options.input=] - input stream -* @param {WritableStream} [options.output] - output stream -* @param {boolean} [options.sandbox] - boolean indicating whether to run a REPL in a sandboxed context -* @param {PositiveInteger} [options.timeout] - number of milliseconds to execute a command before terminating execution -* @param {boolean} [options.isTTY] - boolean indicating whether the input and output streams should be treated like a TTY (terminal) and whether the REPL should use ANSI/VT100 escape codes when writing to the output stream -* @param {string} [options.welcome] - welcome message -* @param {NonNegativeInteger} [options.padding] - number of empty lines between successive commands -* @param {string} [options.load] - file path specifying a JavaScript file to load and evaluate line-by-line (e.g., a previous REPL history file) +* @param {ReadableStream} [options.input=process.stdin] - input stream +* @param {WritableStream} [options.output=process.stdout] - output stream +* @param {WritableStream} [options.error=process.stderr] - error stream +* @param {boolean} [options.sandbox=true] - boolean indicating whether to run a REPL in a sandboxed context +* @param {PositiveInteger} [options.timeout=4294967295] - number of milliseconds to execute a command before terminating execution * @param {string} [options.save] - file path specifying where to save REPL command history * @param {string} [options.log] - file path specifying where to save REPL commands and printed output -* @param {string} [options.quiet] - boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced -* @param {Object} [options.settings] - REPL settings +* @param {string} [options.quiet=false] - boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced * @returns {(Error|null)} error or null * * @example @@ -92,12 +86,6 @@ function validate( opts, options ) { return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'save', options.save ) ); } } - if ( hasOwnProp( options, 'load' ) ) { - opts.load = options.load; - if ( !isString( options.load ) ) { - return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'load', options.load ) ); - } - } if ( hasOwnProp( options, 'log' ) ) { opts.log = options.log; if ( !isString( options.log ) ) { diff --git a/lib/node_modules/@stdlib/repl/base/lib/validate_settings.js b/lib/node_modules/@stdlib/repl/base/lib/validate_settings.js deleted file mode 100644 index 923f860f6026..000000000000 --- a/lib/node_modules/@stdlib/repl/base/lib/validate_settings.js +++ /dev/null @@ -1,78 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2024 The Stdlib Authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -'use strict'; - -// MODULES // - -var isPlainObject = require( '@stdlib/assert/is-plain-object' ); -var hasOwnProp = require( '@stdlib/assert/has-own-property' ); -var format = require( '@stdlib/string/format' ); -var SETTINGS = require( './settings.js' ); -var SETTINGS_NAMES = require( './settings_names.js' ); -var VALIDATORS = require( './settings_validators.js' ); - - -// MAIN // - -/** -* Validates settings. -* -* @private -* @param {Object} opts - destination object -* @param {Object} options - settings options -* @returns {(Error|null)} error or null -* -* @example -* var options = { -* 'autoClosePairs': true -* }; -* var opts = {}; -* var err = validate( opts, options ); -* if ( err ) { -* throw err; -* } -*/ -function validate( opts, options ) { - var name; - var o; - var f; - var v; - var i; - if ( !isPlainObject( options ) ) { - return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) ); - } - for ( i = 0; i < SETTINGS_NAMES.length; i++ ) { - name = SETTINGS_NAMES[ i ]; - if ( hasOwnProp( options, name ) ) { - v = options[ name ]; - o = SETTINGS[ name ]; - f = VALIDATORS[ o.type ]; - if ( !f.assert( v ) ) { - return new TypeError( f.msg( name, v ) ); - } - opts[ name ] = v; - } - } - return null; -} - - -// EXPORTS // - -module.exports = validate; diff --git a/lib/node_modules/@stdlib/repl/base/package.json b/lib/node_modules/@stdlib/repl/base/package.json index 99f01f492489..f592b42aad09 100644 --- a/lib/node_modules/@stdlib/repl/base/package.json +++ b/lib/node_modules/@stdlib/repl/base/package.json @@ -13,21 +13,14 @@ "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" } ], - "bin": { - "stdlib-repl": "./bin/cli" - }, "main": "./lib", "browser": { - "./lib": "./lib/browser/index.js", "process": "process/" }, "directories": { "benchmark": "./benchmark", - "data": "./data", - "doc": "./docs", "example": "./examples", "lib": "./lib", - "scripts": "./scripts", "test": "./test" }, "scripts": {}, diff --git a/lib/node_modules/@stdlib/repl/base/lib/settings_names.js b/lib/node_modules/@stdlib/repl/base/test/test.js similarity index 64% rename from lib/node_modules/@stdlib/repl/base/lib/settings_names.js rename to lib/node_modules/@stdlib/repl/base/test/test.js index fb750e4b5663..f302074f6ef2 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/settings_names.js +++ b/lib/node_modules/@stdlib/repl/base/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2019 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,22 +20,16 @@ // MODULES // -var objectKeys = require( '@stdlib/utils/keys' ); -var SETTINGS = require( './settings.js' ); +var tape = require( 'tape' ); +var repl = require( './../lib' ); -// MAIN // +// TESTS // -/** -* List of settings names. -* -* @private -* @name SETTINGS_NAMES -* @type {Array} -*/ -var SETTINGS_NAMES = objectKeys( SETTINGS ); - - -// EXPORTS // +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof repl, 'function', 'main export is a function' ); + t.end(); +}); -module.exports = SETTINGS_NAMES; +// TODO: tests diff --git a/lib/node_modules/@stdlib/repl/cli/README.md b/lib/node_modules/@stdlib/repl/cli/README.md index 7647a61919fd..281c5a156919 100644 --- a/lib/node_modules/@stdlib/repl/cli/README.md +++ b/lib/node_modules/@stdlib/repl/cli/README.md @@ -43,7 +43,7 @@ The REPL environment exposed here is available both as a standalone application ## Usage ```javascript -var REPL = require( '@stdlib/repl' ); +var REPL = require( '@stdlib/repl/cli' ); ``` #### REPL( \[options] ) @@ -1504,7 +1504,7 @@ In [1]: workspaces( { 'details': true } ) ```javascript var join = require( 'path' ).join; -var REPL = require( '@stdlib/repl' ); +var REPL = require( '@stdlib/repl/cli' ); function onExit() { console.log( '' ); diff --git a/lib/node_modules/@stdlib/repl/base/data/contributor.json b/lib/node_modules/@stdlib/repl/cli/data/contributor.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/contributor.json rename to lib/node_modules/@stdlib/repl/cli/data/contributor.json diff --git a/lib/node_modules/@stdlib/repl/base/data/example.csv b/lib/node_modules/@stdlib/repl/cli/data/example.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/example.csv rename to lib/node_modules/@stdlib/repl/cli/data/example.csv diff --git a/lib/node_modules/@stdlib/repl/base/data/example.json b/lib/node_modules/@stdlib/repl/cli/data/example.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/example.json rename to lib/node_modules/@stdlib/repl/cli/data/example.json diff --git a/lib/node_modules/@stdlib/repl/base/data/help.csv b/lib/node_modules/@stdlib/repl/cli/data/help.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/help.csv rename to lib/node_modules/@stdlib/repl/cli/data/help.csv diff --git a/lib/node_modules/@stdlib/repl/base/data/help.json b/lib/node_modules/@stdlib/repl/cli/data/help.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/help.json rename to lib/node_modules/@stdlib/repl/cli/data/help.json diff --git a/lib/node_modules/@stdlib/repl/base/data/info.csv b/lib/node_modules/@stdlib/repl/cli/data/info.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/info.csv rename to lib/node_modules/@stdlib/repl/cli/data/info.csv diff --git a/lib/node_modules/@stdlib/repl/base/data/info.json b/lib/node_modules/@stdlib/repl/cli/data/info.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/info.json rename to lib/node_modules/@stdlib/repl/cli/data/info.json diff --git a/lib/node_modules/@stdlib/repl/base/data/license_text.json b/lib/node_modules/@stdlib/repl/cli/data/license_text.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/license_text.json rename to lib/node_modules/@stdlib/repl/cli/data/license_text.json diff --git a/lib/node_modules/@stdlib/repl/base/data/tutorial.csv b/lib/node_modules/@stdlib/repl/cli/data/tutorial.csv similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/tutorial.csv rename to lib/node_modules/@stdlib/repl/cli/data/tutorial.csv diff --git a/lib/node_modules/@stdlib/repl/base/data/tutorial.json b/lib/node_modules/@stdlib/repl/cli/data/tutorial.json similarity index 100% rename from lib/node_modules/@stdlib/repl/base/data/tutorial.json rename to lib/node_modules/@stdlib/repl/cli/data/tutorial.json diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/__done__.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/__done__.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/__done__.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/__done__.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/_require.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/_require.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/_require.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/_require.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/alias2pkg.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/alias2pkg.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/alias2pkg.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/alias2pkg.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/alias2related.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/alias2related.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/alias2related.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/alias2related.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/ans.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/ans.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/ans.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/ans.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/assignfrom.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/assignfrom.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/assignfrom.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/assignfrom.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/assignin.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/assignin.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/assignin.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/assignin.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/citation.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/citation.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/citation.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/citation.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/clear_history.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/clear_history.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/clear_history.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/clear_history.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/clear_user_docs.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/clear_user_docs.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/clear_user_docs.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/clear_user_docs.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/clear_vars.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/clear_vars.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/clear_vars.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/clear_vars.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/clear_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/clear_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/clear_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/clear_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/contributor.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/contributor.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/contributor.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/contributor.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/copyright.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/copyright.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/copyright.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/copyright.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/credits.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/credits.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/credits.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/credits.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/current_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/current_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/current_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/current_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/deeprerequire.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/deeprerequire.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/deeprerequire.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/deeprerequire.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/delete_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/delete_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/delete_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/delete_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/donate.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/donate.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/donate.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/donate.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/evalin.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/evalin.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/evalin.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/evalin.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/example.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/example.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/example.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/example.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/global.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/global.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/global.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/global.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/help.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/help.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/help.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/help.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/info.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/info.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/info.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/info.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/is_keyword.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/is_keyword.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/is_keyword.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/is_keyword.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/is_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/is_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/is_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/is_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/license_text.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/license_text.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/license_text.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/license_text.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/load.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/load.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/load.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/load.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/load_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/load_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/load_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/load_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/log_start.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/log_start.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/log_start.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/log_start.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/log_stop.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/log_stop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/log_stop.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/log_stop.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/quit.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/quit.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/quit.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/quit.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/rename_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/rename_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/rename_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/rename_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/rerequire.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/rerequire.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/rerequire.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/rerequire.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/rerun.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/rerun.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/rerun.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/rerun.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/reset.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/reset.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/reset.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/reset.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/save.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/save.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/save.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/save.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/save_start.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/save_start.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/save_start.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/save_start.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/save_stop.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/save_stop.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/save_stop.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/save_stop.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/tutorial.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/tutorial.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/tutorial.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/tutorial.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/user_doc.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/user_doc.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/user_doc.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/user_doc.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/vars.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/vars.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/vars.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/vars.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/vars_workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/vars_workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/vars_workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/vars_workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/workspace.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/workspace.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/workspace.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/workspace.txt diff --git a/lib/node_modules/@stdlib/repl/base/docs/commands/workspaces.txt b/lib/node_modules/@stdlib/repl/cli/docs/commands/workspaces.txt similarity index 100% rename from lib/node_modules/@stdlib/repl/base/docs/commands/workspaces.txt rename to lib/node_modules/@stdlib/repl/cli/docs/commands/workspaces.txt diff --git a/lib/node_modules/@stdlib/repl/base/lib/alias_to_string.js b/lib/node_modules/@stdlib/repl/cli/lib/alias_to_string.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/alias_to_string.js rename to lib/node_modules/@stdlib/repl/cli/lib/alias_to_string.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/commands.js b/lib/node_modules/@stdlib/repl/cli/lib/commands.js index 9d7c5d124895..88c4a5a63ea9 100644 --- a/lib/node_modules/@stdlib/repl/cli/lib/commands.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/commands.js @@ -21,18 +21,55 @@ // MODULES // var onAddTheme = require( './commands/add_theme.js' ); +var onAlias2Pkg = require( './commands/alias2pkg.js' ); +var onAlias2Related = require( './commands/alias2related.js' ); +var onAns = require( './commands/ans.js' ); +var onAssignin = require( './commands/assignin.js' ); +var onAssignfrom = require( './commands/assignfrom.js' ); +var onCitation = require( './commands/citation.js' ); var onClear = require( './commands/clear.js' ); +var onClearHistory = require( './commands/clear_history.js' ); +var onClearUserDocs = require( './commands/clear_user_docs.js' ); +var onClearVars = require( './commands/clear_vars.js' ); +var onClearWorkspace = require( './commands/clear_workspace.js' ); +var onContributors = require( './commands/contributor.js' ); +var onCopyright = require( './commands/copyright.js' ); +var onCredits = require( './commands/credits.js' ); +var onCurrentWorkspace = require( './commands/current_workspace.js' ); var onDeleteTheme = require( './commands/delete_theme.js' ); +var onDeleteWorkspace = require( './commands/delete_workspace.js' ); +var onDeeprerequire = require( './commands/deeprerequire.js' ); +var onDonate = require( './commands/donate.js' ); +var onDone = require( './commands/__done__.js' ); +var onEvalin = require( './commands/evalin.js' ); +var onExample = require( './commands/example.js' ); var onGetTheme = require( './commands/get_theme.js' ); +var onHelp = require( './commands/help.js' ); +var onInfo = require( './commands/info.js' ); +var isWorkspace = require( './commands/is_workspace.js' ); +var isKeyword = require( './commands/is_keyword.js' ); var onKeybindings = require( './commands/keybindings.js' ); +var onLicense = require( './commands/license_text.js' ); +var onLoad = require( './commands/load.js' ); +var onLoadWorkspace = require( './commands/load_workspace.js' ); var onPager = require( './commands/pager.js' ); var onPresentationStart = require( './commands/presentation_start.js' ); var onPresentationStop = require( './commands/presentation_stop.js' ); +var onQuit = require( './commands/quit.js' ); var onRenameTheme = require( './commands/rename_theme.js' ); +var onRenameWorkspace = require( './commands/rename_workspace.js' ); +var onRerequire = require( './commands/rerequire.js' ); var onRerun = require( './commands/rerun.js' ); +var onReset = require( './commands/reset.js' ); var onSetKeybinding = require( './commands/set_keybinding.js' ); var onSettings = require( './commands/settings.js' ); var onThemes = require( './commands/themes.js' ); +var onTutorial = require( './commands/tutorial.js' ); +var onUserDoc = require( './commands/user_doc.js' ); +var onVars = require( './commands/vars.js' ); +var onVarsWorkspace = require( './commands/vars_workspace.js' ); +var onWorkspace = require( './commands/workspace.js' ); +var onWorkspaces = require( './commands/workspaces.js' ); // MAIN // @@ -59,19 +96,56 @@ function commands( repl ) { // Define a list of REPL-specific commands (NOTE: keep in alphabetical order): cmds = []; + cmds.push( [ '__done__', onDone( repl ), false ] ); cmds.push( [ 'addTheme', onAddTheme( repl ), false ] ); + cmds.push( [ 'alias2pkg', onAlias2Pkg( repl ), false ] ); + cmds.push( [ 'alias2related', onAlias2Related( repl, cmds ), false ] ); + cmds.push( [ 'ans', onAns( repl ), true ] ); + cmds.push( [ 'assignfrom', onAssignfrom( repl ), false ] ); + cmds.push( [ 'assignin', onAssignin( repl ), false ] ); + cmds.push( [ 'citation', onCitation( repl ), false ] ); cmds.push( [ 'clear', onClear( repl ), false ] ); + cmds.push( [ 'clearHistory', onClearHistory( repl ), false ] ); + cmds.push( [ 'clearUserDocs', onClearUserDocs( repl ), false ] ); + cmds.push( [ 'clearVars', onClearVars( repl ), false ] ); + cmds.push( [ 'clearWorkspace', onClearWorkspace( repl ), false ] ); + cmds.push( [ 'contributors', onContributors( repl ), false ] ); + cmds.push( [ 'copyright', onCopyright( repl ), false ] ); + cmds.push( [ 'credits', onCredits( repl ), false ] ); + cmds.push( [ 'currentWorkspace', onCurrentWorkspace( repl ), true ] ); cmds.push( [ 'deleteTheme', onDeleteTheme( repl ), false ] ); + cmds.push( [ 'deleteWorkspace', onDeleteWorkspace( repl ), false ] ); + cmds.push( [ 'deeprerequire', onDeeprerequire( repl ), false ] ); + cmds.push( [ 'donate', onDonate( repl ), false ] ); + cmds.push( [ 'evalin', onEvalin( repl, cmds ), false ] ); + cmds.push( [ 'example', onExample( repl, cmds ), false ] ); cmds.push( [ 'getTheme', onGetTheme( repl ), false ] ); + cmds.push( [ 'help', onHelp( repl, cmds ), false ] ); + cmds.push( [ 'info', onInfo( repl, cmds ), false ] ); + cmds.push( [ 'isKeyword', isKeyword( repl ), false ] ); + cmds.push( [ 'isWorkspace', isWorkspace( repl ), false ] ); cmds.push( [ 'keybindings', onKeybindings( repl ), false ] ); + cmds.push( [ 'license', onLicense( repl ), false ] ); + cmds.push( [ 'load', onLoad( repl ), false ] ); + cmds.push( [ 'loadWorkspace', onLoadWorkspace( repl ), false ] ); cmds.push( [ 'pager', onPager( repl ), false ] ); cmds.push( [ 'presentationStart', onPresentationStart( repl ), false ] ); cmds.push( [ 'presentationStop', onPresentationStop( repl ), false ] ); + cmds.push( [ 'quit', onQuit( repl ), false ] ); cmds.push( [ 'renameTheme', onRenameTheme( repl ), false ] ); + cmds.push( [ 'renameWorkspace', onRenameWorkspace( repl ), false ] ); + cmds.push( [ 'rerequire', onRerequire( repl ), false ] ); cmds.push( [ 'rerun', onRerun( repl ), false ] ); + cmds.push( [ 'reset', onReset( repl ), false ] ); cmds.push( [ 'setKeybinding', onSetKeybinding( repl ), false ] ); cmds.push( [ 'settings', onSettings( repl ), false ] ); cmds.push( [ 'themes', onThemes( repl ), false ] ); + cmds.push( [ 'tutorial', onTutorial( repl ), false ] ); + cmds.push( [ 'userDoc', onUserDoc( repl ), false ] ); + cmds.push( [ 'vars', onVars( repl ), false ] ); + cmds.push( [ 'varsWorkspace', onVarsWorkspace( repl ), false ] ); + cmds.push( [ 'workspace', onWorkspace( repl ), false ] ); + cmds.push( [ 'workspaces', onWorkspaces( repl ), false ] ); return cmds; } diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/__done__.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/__done__.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/__done__.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/__done__.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/alias2pkg.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/alias2pkg.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/alias2pkg.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/alias2pkg.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/alias2related.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/alias2related.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/alias2related.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/alias2related.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/ans.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/ans.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/ans.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/ans.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/assignfrom.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/assignfrom.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/assignfrom.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/assignfrom.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/assignin.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/assignin.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/assignin.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/assignin.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/citation.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/citation.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/citation.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/citation.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/clear_history.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/clear_history.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/clear_history.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/clear_history.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/clear_user_docs.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/clear_user_docs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/clear_user_docs.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/clear_user_docs.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/clear_vars.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/clear_vars.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/clear_vars.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/clear_vars.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/clear_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/clear_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/clear_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/clear_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/contributor.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/contributor.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/contributor.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/contributor.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/copyright.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/copyright.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/copyright.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/copyright.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/credits.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/credits.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/credits.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/credits.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/current_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/current_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/current_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/current_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/deeprerequire.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/deeprerequire.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/deeprerequire.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/deeprerequire.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/delete_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/delete_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/delete_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/delete_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/donate.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/donate.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/donate.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/donate.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/evalin.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/evalin.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/evalin.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/evalin.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/example.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/example.js similarity index 98% rename from lib/node_modules/@stdlib/repl/base/lib/commands/example.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/example.js index 28307dfac132..c60954b71b98 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/commands/example.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/commands/example.js @@ -162,7 +162,7 @@ function command( repl, cmds ) { lines.push( out[ i ] ); // If line is part of a multi-line input, wait for the next line... - if ( repl._multilineHandler.isMultilineInput( lines.join( '\n' ) ) ) { + if ( repl._isMultilineInput( lines.join( '\n' ) ) ) { return next(); } for ( j = 0; j < lines.length; j++ ) { diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/help.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/help.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/help.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/help.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/info.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/info.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/info.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/info.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/is_keyword.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/is_keyword.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/is_keyword.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/is_keyword.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/is_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/is_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/is_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/is_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/license_text.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/license_text.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/license_text.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/license_text.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/load.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/load.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/load.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/load.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/load_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/load_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/load_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/load_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/quit.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/quit.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/quit.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/quit.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/rename_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/rename_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/rename_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/rename_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/rerequire.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/rerequire.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/rerequire.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/rerequire.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/reset.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/reset.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/reset.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/reset.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/tutorial.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/tutorial.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/tutorial.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/tutorial.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/user_doc.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/user_doc.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/user_doc.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/user_doc.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/vars.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/vars.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/vars.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/vars.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/vars_workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/vars_workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/vars_workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/vars_workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/workspace.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/workspace.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/workspace.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/workspace.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/commands/workspaces.js b/lib/node_modules/@stdlib/repl/cli/lib/commands/workspaces.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/commands/workspaces.js rename to lib/node_modules/@stdlib/repl/cli/lib/commands/workspaces.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/contains.js b/lib/node_modules/@stdlib/repl/cli/lib/contains.js new file mode 100644 index 000000000000..c525a07d7d24 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/contains.js @@ -0,0 +1,60 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MAIN // + +/** +* Returns a boolean indicating if a strided array-like object contains a provided value. +* +* @private +* @param {NonNegativeInteger} N - number of elements to search +* @param {ArrayLike} arr - array to search +* @param {integer} stride - index stride +* @param {NonNegativeInteger} offset - index offset +* @param {*} value - search value +* @returns {boolean} boolean indicating if an array-like object contains a provided value +* +* @example +* var arr = [ 1, 2, 3 ]; +* +* var bool = contains( arr.length, arr, 1, 0, 2 ); +* // returns true +* +* bool = contains( arr.length, arr, 1, 0, 4 ); +* // returns false +*/ +function contains( N, arr, stride, offset, value ) { + var idx; + var i; + + idx = offset; + for ( i = 0; i < N; i++ ) { + if ( arr[ idx ] === value ) { + return true; + } + idx += stride; + } + return false; +} + + +// EXPORTS // + +module.exports = contains; diff --git a/lib/node_modules/@stdlib/repl/base/lib/find_unique_entry.js b/lib/node_modules/@stdlib/repl/cli/lib/find_unique_entry.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/find_unique_entry.js rename to lib/node_modules/@stdlib/repl/cli/lib/find_unique_entry.js diff --git a/lib/node_modules/@stdlib/repl/base/lib/index_of.js b/lib/node_modules/@stdlib/repl/cli/lib/index_of.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/index_of.js rename to lib/node_modules/@stdlib/repl/cli/lib/index_of.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/main.js b/lib/node_modules/@stdlib/repl/cli/lib/main.js index 56f48dc872b1..84dc95401311 100644 --- a/lib/node_modules/@stdlib/repl/cli/lib/main.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/main.js @@ -23,6 +23,7 @@ // MODULES // var readline = require( 'readline' ); +var resolve = require( 'path' ).resolve; var proc = require( 'process' ); var inspect = require( 'util' ).inspect; var logger = require( 'debug' ); @@ -30,14 +31,19 @@ var inherit = require( '@stdlib/utils/inherit' ); var isndarrayLike = require( '@stdlib/assert/is-ndarray-like' ); var replace = require( '@stdlib/string/replace' ); var isString = require( '@stdlib/assert/is-string' ).isPrimitive; +var isFunction = require( '@stdlib/assert/is-function' ); var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive; var isPlainObject = require( '@stdlib/assert/is-plain-object' ); var objectKeys = require( '@stdlib/utils/keys' ); +var format = require( '@stdlib/string/format' ); +var cwd = require( '@stdlib/process/cwd' ); +var readFileSync = require( '@stdlib/fs/read-file' ).sync; +var RE_EOL = require( '@stdlib/regexp/eol' ).REGEXP; var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' ); var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); var properties = require( '@stdlib/utils/properties' ); var append = require( '@stdlib/utils/append' ); -var format = require( '@stdlib/string/format' ); +var nextTick = require( '@stdlib/utils/next-tick' ); var Boolean = require( '@stdlib/boolean/ctor' ); var assign = require( '@stdlib/object/assign' ); var BaseREPL = require( '@stdlib/repl/base' ); @@ -184,7 +190,6 @@ function REPL( options ) { 'error': ostream, 'sandbox': opts.sandbox, 'timeout': opts.timeout, - 'load': opts.load, 'save': opts.save, 'log': opts.log, 'quiet': opts.quiet @@ -984,6 +989,83 @@ setNonEnumerableReadOnly( REPL.prototype, 'setKeybinding', function setKeybindin this._keybindings.set( action, keys ); }); +/** +* Loads and evaluates a JavaScript file line-by-line. +* +* @name load +* @memberof REPL.prototype +* @type {Function} +* @param {string} fpath - file path +* @param {Function} clbk - callback +* @throws {Error} cannot load a file into a closed REPL +* @throws {TypeError} first argument must be a string +* @throws {TypeError} second argument must be a function +* @returns {void} +* +* @example +* // TODO +*/ +setNonEnumerableReadOnly( REPL.prototype, 'load', function load( fpath, clbk ) { + var self; + var file; + var len; + var i; + if ( this._closed ) { + throw new Error( 'invalid operation. Cannot load a file into a REPL which has already closed.' ); + } + if ( !isString( fpath ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a string. Value: `%s`.', fpath ) ); + } + if ( !isFunction( clbk ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', clbk ) ); + } + // Resolve the provided path to an absolute file path: + fpath = resolve( cwd(), fpath ); + debug( 'Loading filepath: %s', fpath ); + + // Attempt to synchronously read the file: + file = readFileSync( fpath, 'utf8' ); + if ( file instanceof Error ) { + debug( 'Error: %s', file.message ); + clbk( file ); + return; + } + self = this; + + // Split the file content into individual lines: + file = file.split( RE_EOL ); + + // Forward each line to the REPL readline interface in order to mimic user input... + len = file.length; + i = -1; + + nextTick( next ); + + /** + * Callback invoked after draining the command queue. + * + * @private + * @param {string} cmd - command + * @param {boolean} success - boolean indicating whether the command successfully executed + */ + function next() { + i += 1; + if ( i < len ) { + if ( file[ i ] ) { + self._rli.write( file[ i ] ); + self._rli.write( '\n', { + 'name': 'return' + }); + self.once( 'drain', next ); + } else { + nextTick( next ); + } + } else { + nextTick( clbk ); + } + } +}); + /** * Resets a REPL. * @@ -1012,14 +1094,14 @@ setNonEnumerableReadOnly( REPL.prototype, 'setKeybinding', function setKeybindin * repl.close(); */ setNonEnumerableReadOnly( REPL.prototype, 'reset', function onReset() { - // Call the parent method: - BaseREPL.prototype.reset( this ); - if ( this._closed ) { throw new Error( 'invalid operation. Cannot reset a REPL which has already closed.' ); } debug( 'Resetting REPL...' ); + // Call the parent method: + BaseREPL.prototype.reset.call( this ); + // Clear any command which has been buffered but not yet executed: this.clearCommand(); @@ -1187,12 +1269,12 @@ setNonEnumerableReadOnly( REPL.prototype, 'close', function close() { debug( 'Attempted to close an already closed REPL.' ); return this; } - // Call the parent method: - BaseREPL.prototype.close.call( this ); - debug( 'Closing readline interface...' ); this._rli.close(); + // Call the parent method: + BaseREPL.prototype.close.call( this ); + return this; }); diff --git a/lib/node_modules/@stdlib/repl/base/lib/repl_docs.js b/lib/node_modules/@stdlib/repl/cli/lib/repl_docs.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/lib/repl_docs.js rename to lib/node_modules/@stdlib/repl/cli/lib/repl_docs.js diff --git a/lib/node_modules/@stdlib/repl/cli/lib/restore_regexp_matches.js b/lib/node_modules/@stdlib/repl/cli/lib/restore_regexp_matches.js new file mode 100644 index 000000000000..e1658458d972 --- /dev/null +++ b/lib/node_modules/@stdlib/repl/cli/lib/restore_regexp_matches.js @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2019 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// VARIABLES // + +var SEP_REGEXP_MATCHES = '\u0000\u0000\u0000'; +var RE_REGEXP_MATCHES = new RegExp( [ '^', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)', '(.*)$' ].join( SEP_REGEXP_MATCHES ) ); + + +// MAIN // + +/** +* Restores the (non-standard) properties on the `RegExp` expression object to cached matches. +* +* ## Notes +* +* - In certain JavaScript engines (e.g., V8, SpiderMonkey), the global `RegExp` object has ([non-standard][1]) static, read-only properties (`$1`, `$2`, ..., `$9`) with cached substring matches. This function restores matches to a prior state based on a provided list of cached matches. +* +* [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/n +* +* @private +* @param {StringArray} cache - list of previously saved substring matches +*/ +function restoreRegExpMatches( cache ) { + RE_REGEXP_MATCHES.test( cache.join( SEP_REGEXP_MATCHES ) ); +} + + +// EXPORTS // + +module.exports = restoreRegExpMatches; diff --git a/lib/node_modules/@stdlib/repl/base/lib/tutorial_alias_args.js b/lib/node_modules/@stdlib/repl/cli/lib/update_regexp_cache.js similarity index 51% rename from lib/node_modules/@stdlib/repl/base/lib/tutorial_alias_args.js rename to lib/node_modules/@stdlib/repl/cli/lib/update_regexp_cache.js index 92da3c082457..b630b6679ea5 100644 --- a/lib/node_modules/@stdlib/repl/base/lib/tutorial_alias_args.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/update_regexp_cache.js @@ -18,31 +18,30 @@ 'use strict'; -// MODULES // - -var TUTORIAL_ALIASES = require( './tutorial_aliases.js' ); - - // MAIN // /** -* Returns a list of argument completion flags for a specified tutorial API. +* Updates the cache of saved regular expression substring matches. +* +* ## Notes +* +* - In certain JavaScript engines (e.g., V8, SpiderMonkey), the global `RegExp` object has ([non-standard][1]) static, read-only properties (`$1`, `$2`, ..., `$9`) with cached substring matches. +* +* [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/n * * @private -* @param {string} alias - alias -* @returns {(Array|null)} argument completion flags +* @param {StringArray} cache - list of previously saved substring matches +* @returns {StringArray} cache */ -function argFlags( alias ) { +function updateRegExpCache( cache ) { var i; - for ( i = 0; i < TUTORIAL_ALIASES.length; i++ ) { - if ( TUTORIAL_ALIASES[ i ][ 0 ] === alias ) { - return TUTORIAL_ALIASES[ i ].slice( 1 ); - } + for ( i = 1; i < cache.length; i++ ) { + cache[ i ] = RegExp[ '$'+i ]; } - return null; + return cache; } // EXPORTS // -module.exports = argFlags; +module.exports = updateRegExpCache; diff --git a/lib/node_modules/@stdlib/repl/base/scripts/build.js b/lib/node_modules/@stdlib/repl/cli/scripts/build.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/scripts/build.js rename to lib/node_modules/@stdlib/repl/cli/scripts/build.js diff --git a/lib/node_modules/@stdlib/repl/base/scripts/build_contributors.js b/lib/node_modules/@stdlib/repl/cli/scripts/build_contributors.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/scripts/build_contributors.js rename to lib/node_modules/@stdlib/repl/cli/scripts/build_contributors.js diff --git a/lib/node_modules/@stdlib/repl/base/scripts/build_help.js b/lib/node_modules/@stdlib/repl/cli/scripts/build_help.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/scripts/build_help.js rename to lib/node_modules/@stdlib/repl/cli/scripts/build_help.js diff --git a/lib/node_modules/@stdlib/repl/base/scripts/build_license.js b/lib/node_modules/@stdlib/repl/cli/scripts/build_license.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/scripts/build_license.js rename to lib/node_modules/@stdlib/repl/cli/scripts/build_license.js diff --git a/lib/node_modules/@stdlib/repl/base/scripts/build_tutorials.js b/lib/node_modules/@stdlib/repl/cli/scripts/build_tutorials.js similarity index 100% rename from lib/node_modules/@stdlib/repl/base/scripts/build_tutorials.js rename to lib/node_modules/@stdlib/repl/cli/scripts/build_tutorials.js diff --git a/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js index b2b9cf1fc4bc..66c70b020261 100644 --- a/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js +++ b/lib/node_modules/@stdlib/repl/cli/test/integration/test.auto_page.js @@ -202,7 +202,7 @@ tape( 'a REPL instance avoids auto-paging short outputs', function test( t ) { } // Check if the output is printed without paging: expected = replace( FIXTURE, '\\n', '\n' ) + '\n'; - t.strictEqual( data[ data.length - 1 ], expected, 'returns expected value' ); + t.strictEqual( data[ data.length - 6 ], expected, 'returns expected value' ); t.end(); } diff --git a/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js index f8762ff4904a..58dd382361f1 100644 --- a/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js +++ b/lib/node_modules/@stdlib/repl/cli/test/integration/test.completion_previews.js @@ -322,16 +322,16 @@ tape( 'a REPL instance supports auto-completing a completion preview and executi return; } // Check for an ANSI-escaped color-coded 'gh' completion: - t.strictEqual( data[ data.length-5 ], '\u001b[90mgh\u001b[0m', 'returns expected value' ); + t.strictEqual( data[ data.length-10 ], '\u001b[90mgh\u001b[0m', 'returns expected value' ); // Check that the cursor is positioned BEFORE the completion preview: - t.strictEqual( data[ data.length-4 ], '\u001b[2D', 'returns expected value' ); + t.strictEqual( data[ data.length-9 ], '\u001b[2D', 'returns expected value' ); // Check that the completion preview was auto-completed prior to execution: - t.strictEqual( data[ data.length-3 ], 'gh', 'returns expected value' ); + t.strictEqual( data[ data.length-8 ], 'gh', 'returns expected value' ); // Check that the expression was executed: - t.strictEqual( trim( data[ data.length-1 ] ), '1', 'returns expected value' ); + t.strictEqual( trim( data[ data.length-6 ] ), '1', 'returns expected value' ); t.end(); } From fdbd335444d3d10a25152719bb32527e64d9476d Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Thu, 6 Mar 2025 22:14:38 +0000 Subject: [PATCH 05/26] fix: remove `command` token from themes Signed-off-by: Snehil Shah --- 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: passed - 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na --- --- lib/node_modules/@stdlib/repl/cli/README.md | 1 - lib/node_modules/@stdlib/repl/cli/lib/themes.js | 7 ------- 2 files changed, 8 deletions(-) diff --git a/lib/node_modules/@stdlib/repl/cli/README.md b/lib/node_modules/@stdlib/repl/cli/README.md index 281c5a156919..16ece9fc3da4 100644 --- a/lib/node_modules/@stdlib/repl/cli/README.md +++ b/lib/node_modules/@stdlib/repl/cli/README.md @@ -290,7 +290,6 @@ The syntax-highlighter supports the following tokens and associated theme fields - **number**: numeric literals. - **literal**: reserved literals (e.g., `true`, `false`, `null`, and `undefined`). - **regexp**: regular expressions. -- **command**: built-in REPL commands. - **function**: function identifiers. - **object**: object identifiers. - **variable**: literal identifiers. diff --git a/lib/node_modules/@stdlib/repl/cli/lib/themes.js b/lib/node_modules/@stdlib/repl/cli/lib/themes.js index 63edd47db577..36a0bc4e47a4 100644 --- a/lib/node_modules/@stdlib/repl/cli/lib/themes.js +++ b/lib/node_modules/@stdlib/repl/cli/lib/themes.js @@ -41,7 +41,6 @@ var THEMES = { 'regexp': 'underline brightRed', // Identifiers: - 'command': 'bold magenta', 'function': 'bold yellow', 'object': 'cyan', 'variable': null, @@ -65,7 +64,6 @@ var THEMES = { 'regexp': 'bold red', // Identifiers: - 'command': 'brightGreen', 'function': 'bold magenta', 'object': 'cyan', 'variable': null, @@ -89,7 +87,6 @@ var THEMES = { 'regexp': 'underline red', // Identifiers: - 'command': 'brightMagenta', 'function': 'yellow', 'object': 'bold', 'variable': null, @@ -113,7 +110,6 @@ var THEMES = { 'regexp': 'underline red', // Identifiers: - 'command': 'underline brightBlue', 'function': 'bold yellow', 'object': 'italic cyan', 'variable': 'green', @@ -137,7 +133,6 @@ var THEMES = { 'regexp': 'bold underline', // Identifiers: - 'command': 'underline bold', 'function': 'italic bold', 'object': 'italic', 'variable': null, @@ -161,7 +156,6 @@ var THEMES = { 'regexp': 'red', // Identifiers: - 'command': 'bold magenta', 'function': 'brightBlue', 'object': 'brightRed', 'variable': 'brightBlue', @@ -185,7 +179,6 @@ var THEMES = { 'regexp': 'underline yellow', // Identifiers: - 'command': 'bold brightGreen', 'function': 'brightGreen', 'object': 'italic brightMagenta', 'variable': null, From b7b5082662d1d3c3f8194afb99b838a7ee1af8c8 Mon Sep 17 00:00:00 2001 From: Snehil Shah Date: Sat, 8 Mar 2025 17:54:12 +0000 Subject: [PATCH 06/26] refactor: move base implementation to `ctor` package Signed-off-by: Snehil Shah --- 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: passed - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - 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 --- --- lib/node_modules/@stdlib/repl/base/README.md | 214 ++------------ .../@stdlib/repl/base/ctor/README.md | 271 ++++++++++++++++++ .../base/{ => ctor}/benchmark/benchmark.js | 0 .../@stdlib/repl/base/ctor/examples/index.js | 36 +++ .../lib/acorn_detect_multiline_input.js | 0 .../base/{ => ctor}/lib/alias_overrides.js | 0 .../repl/base/{ => ctor}/lib/aliases.js | 0 .../repl/base/{ => ctor}/lib/append_unique.js | 0 .../repl/base/{ => ctor}/lib/compile_code.js | 0 .../base/{ => ctor}/lib/compile_command.js | 0 .../{ => ctor}/lib/complete_expression.js | 0 .../repl/base/{ => ctor}/lib/complete_fs.js | 0 .../base/{ => ctor}/lib/complete_require.js | 0 .../{ => ctor}/lib/complete_walk_find_last.js | 0 .../base/{ => ctor}/lib/complete_workspace.js | 0 .../repl/base/{ => ctor}/lib/completer.js | 0 .../repl/base/{ => ctor}/lib/contains.js | 0 .../base/{ => ctor}/lib/create_accessor.js | 0 .../lib/create_evaluation_context.js | 0 .../base/{ => ctor}/lib/create_require.js | 0 .../repl/base/{ => ctor}/lib/defaults.js | 0 .../@stdlib/repl/base/{ => ctor}/lib/drain.js | 0 .../base/{ => ctor}/lib/filter_by_prefix.js | 0 .../repl/base/{ => ctor}/lib/fs_alias_args.js | 0 .../repl/base/{ => ctor}/lib/fs_aliases.js | 0 .../repl/base/{ => ctor}/lib/globals.js | 0 .../{ => ctor}/lib/has_async_directive.js | 0 .../@stdlib/repl/base/ctor/lib/index.js | 50 ++++ .../base/{ => ctor}/lib/is_block_scope.js | 0 .../base/{ => ctor}/lib/is_multiline_input.js | 0 .../repl/base/{ => ctor}/lib/is_scope.js | 0 .../base/{ => ctor}/lib/is_silent_command.js | 0 .../{ => ctor}/lib/longest_common_prefix.js | 0 .../@stdlib/repl/base/{ => ctor}/lib/main.js | 0 .../base/{ => ctor}/lib/process_command.js | 0 .../repl/base/{ => ctor}/lib/process_input.js | 0 .../{ => ctor}/lib/process_top_level_await.js | 0 .../{ => ctor}/lib/property_comparator.js | 0 .../base/{ => ctor}/lib/regexp_fs_aliases.js | 0 .../repl/base/{ => ctor}/lib/regexp_index.js | 0 .../repl/base/{ => ctor}/lib/regexp_path.js | 0 .../lib/regexp_relative_require_path.js | 0 .../base/{ => ctor}/lib/regexp_require.js | 0 .../lib/regexp_reserved_syntax_characters.js | 0 .../base/{ => ctor}/lib/regexp_workspace.js | 0 .../base/{ => ctor}/lib/reserved_keywords.js | 0 .../lib/reserved_keywords_common.js | 0 ...reserved_keywords_empty_block_statement.js | 0 .../base/{ => ctor}/lib/resolve_globals.js | 0 .../{ => ctor}/lib/resolve_local_scope.js | 0 .../{ => ctor}/lib/resolve_local_scopes.js | 0 .../{ => ctor}/lib/restore_regexp_matches.js | 0 .../repl/base/{ => ctor}/lib/set_aliases.js | 0 .../base/{ => ctor}/lib/set_aliases_global.js | 0 .../repl/base/{ => ctor}/lib/setdiff.js | 0 .../repl/base/{ => ctor}/lib/tokenizer.js | 0 .../{ => ctor}/lib/update_regexp_cache.js | 0 .../repl/base/{ => ctor}/lib/validate.js | 0 .../{ => ctor}/lib/workspace_alias_args.js | 0 .../base/{ => ctor}/lib/workspace_aliases.js | 0 .../@stdlib/repl/base/ctor/package.json | 71 +++++ .../@stdlib/repl/base/ctor/test/test.js | 35 +++ .../@stdlib/repl/base/examples/index.js | 18 +- .../@stdlib/repl/base/lib/index.js | 47 +-- .../@stdlib/repl/base/package.json | 13 +- .../@stdlib/repl/base/test/test.js | 15 +- 66 files changed, 518 insertions(+), 252 deletions(-) create mode 100644 lib/node_modules/@stdlib/repl/base/ctor/README.md rename lib/node_modules/@stdlib/repl/base/{ => ctor}/benchmark/benchmark.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/ctor/examples/index.js rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/acorn_detect_multiline_input.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/alias_overrides.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/aliases.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/append_unique.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/compile_code.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/compile_command.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/complete_expression.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/complete_fs.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/complete_require.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/complete_walk_find_last.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/complete_workspace.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/completer.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/contains.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/create_accessor.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/create_evaluation_context.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/create_require.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/defaults.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/drain.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/filter_by_prefix.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/fs_alias_args.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/fs_aliases.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/globals.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/has_async_directive.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/ctor/lib/index.js rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/is_block_scope.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/is_multiline_input.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/is_scope.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/is_silent_command.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/longest_common_prefix.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/main.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/process_command.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/process_input.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/process_top_level_await.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/property_comparator.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_fs_aliases.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_index.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_path.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_relative_require_path.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_require.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_reserved_syntax_characters.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/regexp_workspace.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/reserved_keywords.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/reserved_keywords_common.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/reserved_keywords_empty_block_statement.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/resolve_globals.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/resolve_local_scope.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/resolve_local_scopes.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/restore_regexp_matches.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/set_aliases.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/set_aliases_global.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/setdiff.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/tokenizer.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/update_regexp_cache.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/validate.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/workspace_alias_args.js (100%) rename lib/node_modules/@stdlib/repl/base/{ => ctor}/lib/workspace_aliases.js (100%) create mode 100644 lib/node_modules/@stdlib/repl/base/ctor/package.json create mode 100644 lib/node_modules/@stdlib/repl/base/ctor/test/test.js diff --git a/lib/node_modules/@stdlib/repl/base/README.md b/lib/node_modules/@stdlib/repl/base/README.md index 0e9742584878..be4dbb3c7849 100644 --- a/lib/node_modules/@stdlib/repl/base/README.md +++ b/lib/node_modules/@stdlib/repl/base/README.md @@ -18,191 +18,39 @@ limitations under the License. --> -# REPL +# Base -> Base class for Read-Eval-Print Loop (REPL) environment. - - - -
- -A Read-Eval-Print Loop (REPL) environment is an interactive programming environment which takes individual user inputs (e.g., single expressions), evaluates those inputs, and returns the result. Accordingly, a program written in a REPL environment is executed piecewise and sequentially. - -REPL environments find common use in exploratory programming, prototyping, and debugging. - -The REPL environment exposed here is available both as a standalone application and as a library which is embeddable in other libraries and applications. - -
- - - - +> Base REPL functionality.
## Usage ```javascript -var REPL = require( '@stdlib/repl/base' ); +var ns = require( '@stdlib/repl/base' ); ``` -#### REPL( \[options] ) +#### ns -Returns a `REPL` instance. +Namespace containing "base" (i.e., lower-level) REPL functionality. ```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Execute a command: -repl.emit( 'input', '2 + 3' ); - -// ... - -// Close the REPL: -repl.close(); +var o = ns; +// returns {...} ``` -The function accepts the following `options`: - -- **input**: input (readable) stream. Default: [`stdin`][@stdlib/streams/node/stdin]. -- **output**: output (writable) stream. Default: [`stdout`][@stdlib/streams/node/stdout]. -- **error**: error (writable) stream. Default: [`stderr`][@stdlib/streams/node/stderr]. -- **sandbox**: boolean indicating whether to run a REPL in a sandboxed context. Default: `false`. -- **timeout**: number of milliseconds to execute a command before terminating execution. Default: `4294967295`. -- **save**: file path specifying where to save REPL command history. -- **log**: file path specifying where to save REPL commands and printed output. -- **quiet**: boolean indicating whether log information, confirmation messages, and other possible REPL diagnostics should be silenced. Default: `false`. + -#### REPL.prototype.createContext() - -Returns a REPL context. - -```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Return a new REPL context: -var ctx = repl.createContext(); - -// ... - -// Close the REPL: -repl.close(); -``` +
-#### REPL.prototype.resetContext() - -Resets a REPL's execution context. - -```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Reset the REPL context: -repl.resetContext(); - -// ... - -// Close the REPL: -repl.close(); -``` - -#### REPL.prototype.clearHistory() - -Clears a REPL's history. - -```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Clear the REPL history: -repl.clearHistory(); - -// ... - -// Close the REPL: -repl.close(); -``` - -#### REPL.prototype.clearUserDocs() - -Clears user-defined documentation. - -```javascript -// Create a new REPL: -var repl = new REPL(); +
-// ... - -// Clear user-defined documentation: -repl.clearUserDocs(); - -// ... - -// Close the REPL: -repl.close(); -``` - -#### REPL.prototype.reset() - -Resets a REPL. - -```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Reset the REPL: -repl.reset(); - -// ... - -// Close the REPL: -repl.close(); -``` - -#### REPL.prototype.close() - -Closes a REPL. - -```javascript -// Create a new REPL: -var repl = new REPL(); - -// ... - -// Close the REPL: -repl.close(); -``` - -* * * +
- - -
- -
- - - - - -* * * -
## Examples @@ -210,44 +58,16 @@ repl.close(); ```javascript -var REPL = require( '@stdlib/repl/base' ); - -function onCommand( cmd, success, res ) { - console.log( cmd + ' = ' + res.toString() ); -} - -// Create a new REPL: -var repl = new REPL(); -repl.on( 'command', onCommand ); +var objectKeys = require( '@stdlib/utils/keys' ); +var ns = require( '@stdlib/repl/base' ); -// Execute a command: -repl.emit( 'input', '3 + 2' ); - -// Close the REPL: -repl.close(); -console.log( 'REPL closed.' ); +console.log( objectKeys( ns ) ); ```
-* * * - -
- -
- - - - - -
- -
- - -