Skip to content

Commit 3d496ba

Browse files
committed
build: remove dev dependencies in standalone publish workflows
1 parent 66c4d3d commit 3d496ba

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_publish.yml.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,10 @@ jobs:
124124
mv ./package.json.tmp ./package.json
125125
fi
126126
done
127-
jq -r '.devDependencies | keys[]' ./package.json | while read -r dep; do
128-
if [[ "$dep" != "@stdlib"* ]]; then
129-
continue
130-
fi
131-
dep=$(echo "$dep" | xargs)
132-
if ! find lib -name "*.js" -exec grep -q "$dep" {} + && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
133-
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
134-
mv ./package.json.tmp ./package.json
135-
fi
136-
done
127+
128+
# Set `devDependencies` to an empty object:
129+
jq --indent 2 '.devDependencies = {}' ./package.json > ./package.json.tmp
130+
mv ./package.json.tmp ./package.json
137131

138132
# Remove CLI section:
139133
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+?<\!\-\- \/.cli \-\->//"

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_publish_cli.yml.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ jobs:
105105
SLUG=${{ github.repository }}
106106
git push "https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$SLUG.git" --follow-tags
107107

108+
# Remove development dependencies from package.json:
109+
- name: 'Remove development dependencies from package.json'
110+
run: |
111+
jq --indent 2 '.devDependencies = {}' ./package.json > ./package.json.tmp
112+
mv ./package.json.tmp ./package.json
113+
108114
# Replace GitHub MathJax equations with SVGs:
109115
- name: 'Replace GitHub MathJax equations with SVGs'
110116
run: |

0 commit comments

Comments
 (0)