Skip to content

Commit 6d8afc5

Browse files
committed
build: include tools when resolving namespace dev dependencies
--- 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: na - 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 56a6ce8 commit 6d8afc5

File tree

1 file changed

+11
-0
lines changed
  • lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/lib

1 file changed

+11
-0
lines changed

lib/node_modules/@stdlib/_tools/pkgs/namespace-deps/lib/deps.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var logger = require( 'debug' );
2525
var isNodeBuiltin = require( '@stdlib/assert/is-node-builtin' );
2626
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
27+
var existsSync = require( '@stdlib/fs/exists' ).sync;
2728
var startsWith = require( '@stdlib/string/starts-with' );
2829
var contains = require( '@stdlib/assert/contains' );
2930
var instanceOf = require( '@stdlib/assert/instance-of' );
@@ -76,6 +77,16 @@ function namespaceDeps( pkgName, level, dev ) {
7677
} else {
7778
namespacePkgs = namespacePkgs[ 0 ].deps;
7879
}
80+
81+
// Check if there is a `/tools` subdirectory that is not exported from the main namespace entry point (only for dev dependencies):
82+
if ( dev && !contains( namespacePkgs, pkgName+'/tools' ) ) {
83+
fpath = resolve( getRoot( '' ), pkgName, 'tools' );
84+
if ( existsSync( fpath ) ) {
85+
debug( 'Found tools subdirectory not exported from main entry point: %s', fpath );
86+
namespacePkgs.push( pkgName+'/tools' );
87+
}
88+
}
89+
7990
deps = [];
8091
try {
8192
entry = dirname( require.resolve( pkgName ) );

0 commit comments

Comments
 (0)