guess-js-deps-bash 0.1.50 → 0.1.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,7 @@ local AUTOGUESS_BUILD_UTIL_CMDS=(
22
22
  eslint
23
23
  jslint
24
24
  libdir-binlinks-cfg-linker-pmb
25
+ npm-ci-utils-pmb
25
26
  uglifyjs
26
27
  yamllint
27
28
  yaml-lint-all-recursive
package/guess-js-deps.sh CHANGED
@@ -402,7 +402,7 @@ function read_json_subtree () {
402
402
  [ "${SRC_FN:0:1}" == / ] || SRC_FN="./$SRC_FN"
403
403
  local CODE="require(process.env.SRCFN)$SUBDOT"
404
404
  case "$FX" in
405
- keys | values ) CODE="Object.$FX($CODE)";;
405
+ keys | values ) CODE="Object.$FX($CODE || false)";;
406
406
  esac
407
407
  CODE="JSON.stringify($CODE, null, 2)"
408
408
  SRCFN="$SRC_FN" nodejs -p "$CODE"
@@ -643,6 +643,9 @@ function guess_one_dep_type () {
643
643
  fi
644
644
 
645
645
  local SUBDIR=
646
+ local REQ_NORM_FEXT="$REQ_FILE"
647
+ REQ_NORM_FEXT="${REQ_NORM_FEXT/%.js/.%JS}"
648
+ REQ_NORM_FEXT="${REQ_NORM_FEXT/%.mjs/.%JS}"
646
649
  if [ "$DEP_TYPE" == dep ]; then
647
650
  SUBDIR="${REQ_FILE%%/*}"
648
651
  case "${SUBDIR%s}" in
@@ -652,13 +655,14 @@ function guess_one_dep_type () {
652
655
  doc | \
653
656
  test ) DEP_TYPE=devDep;;
654
657
  esac
655
- case "$REQ_FILE" in
658
+ case "$REQ_NORM_FEXT" in
656
659
  */webpack.config.js | \
657
660
  manif://scripts/*lint* | \
658
661
  manif://scripts/*test* | \
659
662
  manif://lint ) DEP_TYPE=devDep;;
660
663
  */* ) ;; # files in subdirs are handled above
661
664
  # below: top-level files
665
+ *[.-]test.%JS | \
662
666
  test.* ) DEP_TYPE=devDep;;
663
667
  esac
664
668
  fi
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  { "name": "guess-js-deps-bash",
2
- "version": "0.1.50",
2
+ "version": "0.1.53",
3
3
  "description": "A bash attempt at npm-forgot: Guess JavaScript require() dependencies, detect their versions, compare with package.json.",
4
4
 
5
5
  "keywords": [