Skip to content

Commit 631fedd

Browse files
committed
Rename directory and add recipe to list module names
1 parent 7f2bc5f commit 631fedd

File tree

13 files changed

+63
-22
lines changed

13 files changed

+63
-22
lines changed

tools/make/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ endif
2828
include $(TOOLS_MAKE_LIB_DIR)/help/Makefile
2929
include $(TOOLS_MAKE_LIB_DIR)/init/Makefile
3030
include $(TOOLS_MAKE_LIB_DIR)/repl/Makefile
31-
include $(TOOLS_MAKE_LIB_DIR)/find/Makefile
31+
include $(TOOLS_MAKE_LIB_DIR)/ls/Makefile
3232
include $(TOOLS_MAKE_LIB_DIR)/lint/Makefile
3333
include $(TOOLS_MAKE_LIB_DIR)/deps/Makefile
3434
include $(TOOLS_MAKE_LIB_DIR)/notes/Makefile

tools/make/README.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
Makefile
2-
===
1+
# Makefile
32

43
> Development utility.
54
@@ -16,7 +15,7 @@ To view a list of available `Makefile` targets,
1615
$ make help
1716
```
1817

19-
===
18+
---
2019

2120
#### REPL
2221

@@ -26,7 +25,7 @@ To launch a REPL,
2625
$ make repl
2726
```
2827

29-
===
28+
---
3029

3130
#### Notes
3231

@@ -57,7 +56,7 @@ The following annotations are recognized:
5756
* __OPTIMIZE__: annotates code which needs optimizing.
5857
* __NOTE__: annotates questions, comments, or anything which does not fit under `TODO`/`FIXME`/`HACK`/`WARNING`/`OPTIMIZE` and should be brought to a reader's attention.
5958

60-
===
59+
---
6160

6261
#### Files
6362

@@ -210,7 +209,7 @@ $ make EXAMPLES_FILTER=.*/math/base/special/.* list-examples
210209

211210
##### Modules
212211

213-
To list all modules,
212+
To list all modules (as absolute paths),
214213

215214
``` bash
216215
$ make list-modules
@@ -223,7 +222,20 @@ To filter based on a file path,
223222
$ make MODULES_FILTER=.*/math/base/special/.* list-modules
224223
```
225224

226-
===
225+
To list all module names under the `@stdlib` scope,
226+
227+
``` bash
228+
$ make list-module-names
229+
```
230+
231+
To list all module names under a `@stdlib` descendant directory,
232+
233+
``` bash
234+
$ make MODULES_NAMES_DIR=./@stdlib/math/base list-module-names
235+
```
236+
237+
238+
---
227239

228240
#### Module Examples
229241

@@ -240,7 +252,7 @@ To limit which examples are run, use the same environment variables recognized b
240252
$ make EXAMPLES_FILTER=.*/math/base/special/.* EXAMPLES_PATTERN=index.js examples
241253
```
242254

243-
===
255+
---
244256

245257
#### Unit Tests
246258

@@ -311,7 +323,7 @@ $ make TESTS_FILTER=.*/math/base/utils/.* test-browsers
311323
$ make TESTS_FILTER=.*/\@stdlib/utils/.* test-view-browsers
312324
```
313325

314-
===
326+
---
315327

316328
#### Benchmarks
317329

@@ -328,7 +340,7 @@ To limit which benchmarks are run, use the same environment variables recognized
328340
$ make BENCHMARKS_FILTER=.*/math/base/special/.* BENCHMARKS_PATTERN=benchmark.js benchmark
329341
```
330342

331-
===
343+
---
332344

333345
#### Documentation
334346

@@ -344,7 +356,7 @@ To view the documentation in a local web browser,
344356
$ make view-src-docs
345357
```
346358

347-
===
359+
---
348360

349361
#### Lint
350362

@@ -384,7 +396,7 @@ To lint only JavaScript files,
384396
$ make SOURCES_FILTER=... TESTS_FILTER=... EXAMPLES_FILTER=... lint-javascript
385397
```
386398

387-
===
399+
---
388400

389401
#### Complexity
390402

@@ -418,7 +430,7 @@ To analyze only JavaScript files,
418430
$ make SOURCES_FILTER=... TESTS_FILTER=... EXAMPLES_FILTER=... complexity-javascript
419431
```
420432

421-
===
433+
---
422434

423435
#### Dependencies
424436

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,12 @@ MODULES_FILTER ?= .*/.*
4949

5050
# DEPENDENCIES #
5151

52-
include $(TOOLS_MAKE_LIB_DIR)/find/files.mk
53-
include $(TOOLS_MAKE_LIB_DIR)/find/sources.mk
54-
include $(TOOLS_MAKE_LIB_DIR)/find/tests.mk
55-
include $(TOOLS_MAKE_LIB_DIR)/find/tests_fixtures.mk
56-
include $(TOOLS_MAKE_LIB_DIR)/find/benchmarks.mk
57-
include $(TOOLS_MAKE_LIB_DIR)/find/examples.mk
58-
include $(TOOLS_MAKE_LIB_DIR)/find/markdown.mk
59-
include $(TOOLS_MAKE_LIB_DIR)/find/modules.mk
52+
include $(TOOLS_MAKE_LIB_DIR)/ls/files.mk
53+
include $(TOOLS_MAKE_LIB_DIR)/ls/sources.mk
54+
include $(TOOLS_MAKE_LIB_DIR)/ls/tests.mk
55+
include $(TOOLS_MAKE_LIB_DIR)/ls/tests_fixtures.mk
56+
include $(TOOLS_MAKE_LIB_DIR)/ls/benchmarks.mk
57+
include $(TOOLS_MAKE_LIB_DIR)/ls/examples.mk
58+
include $(TOOLS_MAKE_LIB_DIR)/ls/markdown.mk
59+
include $(TOOLS_MAKE_LIB_DIR)/ls/modules.mk
60+
include $(TOOLS_MAKE_LIB_DIR)/ls/module_names.mk

tools/make/lib/ls/module_names.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
# VARIABLES #
3+
4+
# Define the command for Node:
5+
NODE ?= node
6+
7+
# Define the root directory from which to search for modules:
8+
MODULE_NAMES_DIR ?= $(ROOT_DIR)/lib/node_modules
9+
10+
# Define the path of the executable:
11+
LIST_MODULE_NAMES ?= $(TOOLS_DIR)/ls/module-names/bin/cli
12+
13+
# Define the command flags:
14+
LIST_MODULE_NAMES_FLAGS ?= \
15+
--dir $(MODULE_NAMES_DIR)
16+
17+
18+
# TARGETS #
19+
20+
# List all module names.
21+
#
22+
# This target prints a list of all module names.
23+
24+
list-module-names: $(LIST_MODULE_NAMES)
25+
$(LIST_MODULE_NAMES) $(LIST_MODULE_NAMES_FLAGS)
26+
27+
.PHONY: list-module-names

0 commit comments

Comments
 (0)