guess-js-deps-bash 0.1.60 → 0.1.61
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.
- package/guess-js-deps.sh +21 -0
- package/package.json +1 -1
package/guess-js-deps.sh
CHANGED
|
@@ -88,6 +88,7 @@ function init_resolve_cache () {
|
|
|
88
88
|
|
|
89
89
|
function init_resolve_cache__prep () {
|
|
90
90
|
init_resolve_cache__webpack_cfg || return $?
|
|
91
|
+
init_resolve_cache__forced_custom || return $?
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
|
|
@@ -100,6 +101,26 @@ function init_resolve_cache__webpack_cfg () {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
|
|
104
|
+
function init_resolve_cache__forced_custom () {
|
|
105
|
+
local LIST=()
|
|
106
|
+
readarray -t LIST < <(
|
|
107
|
+
nodejs -p 'var manif = require("./package.json"); JSON.stringify([
|
|
108
|
+
manif.dependencies,
|
|
109
|
+
manif.devDependencies,
|
|
110
|
+
], null, 2)' | sed -nrf <(echo '
|
|
111
|
+
s~^\s+"~~
|
|
112
|
+
s~",?$~~
|
|
113
|
+
s~": "([a-z]\S+/\S+#\S)~\t\1~p
|
|
114
|
+
'))
|
|
115
|
+
local KEY= VAL=
|
|
116
|
+
for VAL in "${LIST[@]}"; do
|
|
117
|
+
KEY="${VAL%%$'\t'*}"
|
|
118
|
+
VAL="${VAL#*$'\t'}"
|
|
119
|
+
RESOLVE_CACHE["$KEY?ver"]="$VAL"
|
|
120
|
+
done
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
103
124
|
function find_scannable_files_in_project () {
|
|
104
125
|
local FF=(
|
|
105
126
|
-type f
|
package/package.json
CHANGED