Skip to content

Commit

Permalink
chore: move script to shell
Browse files Browse the repository at this point in the history
  • Loading branch information
hosseinmd committed Oct 6, 2023
1 parent c4e4db5 commit 9a8b84b
Show file tree
Hide file tree
Showing 4 changed files with 4,572 additions and 4,769 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"release": "standard-version && yarn publish && git push --follow-tags origin master",
"prettierAll": "prettier --write \"**/*.ts\"",
"clean": "rm -fr dist",
"build": "node script.mjs"
"build": "chmod +x ./script.sh && ./script.sh"
},
"keywords": [
"prettier",
Expand All @@ -47,7 +47,7 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/jest": "^29.5.4",
"@types/mdast": "^3.0.10",
"@types/mdast": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"commitlint": "^14.1.0",
Expand All @@ -71,7 +71,7 @@
"dependencies": {
"binary-searching": "^2.0.5",
"comment-parser": "^1.4.0",
"mdast-util-from-markdown": "^1.2.0"
"mdast-util-from-markdown": "^2.0.0"
},
"engines": {
"node": ">=14.13.1 || >=16.0.0"
Expand Down
32 changes: 0 additions & 32 deletions script.mjs

This file was deleted.

38 changes: 38 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# Parameter default value
test=0

while [ $# -gt 0 ]; do
case "$1" in
--test)
test=1
;;
# -a|-arg_1|--arg_1)
# arg_1="$2"
# ;;
*)
printf "***************************\n"
printf "* Error: Invalid argument.*\n"
printf "***************************\n"
exit 1
esac
shift
shift
done

npm run clean
npm run lint
tsc --project tsconfig.json


if [ $test -ne 1 ]; then
# bundleUmd
rollup dist/index.js --file dist/index.umd.js --format umd --name sayHello
# bundleUmdMin
terser --ecma 6 --compress --mangle -o dist/index.umd.min.js -- dist/index.umd.js && gzip -9 -c dist/index.umd.min.js > dist/index.umd.min.js.gz

# buildStats
cd dist
ls -lh index.umd* | tail -n +2 | awk '{print $5,$9}'
fi

0 comments on commit 9a8b84b

Please sign in to comment.