From 032b40ddc283e0c9ea7ed879db336049a4181526 Mon Sep 17 00:00:00 2001 From: Leo Wang Date: Tue, 6 Feb 2024 13:14:47 +0800 Subject: [PATCH] [chore] add prettier-plugin-sh --- pack-docs.sh | 18 +++++++----------- package.json | 8 ++++++-- pnpm-lock.yaml | 25 +++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/pack-docs.sh b/pack-docs.sh index d84e99d..51e9245 100755 --- a/pack-docs.sh +++ b/pack-docs.sh @@ -1,10 +1,8 @@ # generate multilingual file for file in ReadMe-*.md; do + typedoc --readme $file -typedoc --readme $file - -mv docs/index.html ${file%.md}.html - + mv docs/index.html ${file%.md}.html done # generate docs @@ -12,11 +10,9 @@ typedoc source/ # copy html file to docs folder, replace link for file in ReadMe-*.html; do + # example: mv ReadMe-zh.html docs/zh.html + mv $file docs/"${file#ReadMe-}" -# example: mv ReadMe-zh.html docs/zh.html -mv $file docs/"${file#ReadMe-}" - -# example: replace ReadMe-zh.md zh.html -replace "./${file%.html}.md" "./${file#ReadMe-}" docs/*.html - -done \ No newline at end of file + # example: replace ReadMe-zh.md zh.html + replace "./${file%.html}.md" "./${file#ReadMe-}" docs/*.html +done diff --git a/package.json b/package.json index 34c283e..f14055c 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "open-cli": "^8.0.0", "parcel": "~2.11.0", "prettier": "^3.2.4", + "prettier-plugin-sh": "^0.14.0", "replace": "^1.2.2", "rimraf": "^5.0.5", "ts-jest": "^29.1.2", @@ -80,14 +81,17 @@ "prepublishOnly": "npm test && npm run build" }, "lint-staged": { - "*.{md,json,yml,js,ts,tsx}": "prettier --write", + "*.{md,json,yml,js,ts,tsx,sh}": "prettier --write", "*.{js,ts,tsx}": "eslint --fix" }, "prettier": { "singleQuote": true, "trailingComma": "none", "arrowParens": "avoid", - "tabWidth": 4 + "tabWidth": 4, + "plugins": [ + "prettier-plugin-sh" + ] }, "browserslist": "> 0.5%, last 2 versions, not dead, IE 11", "targets": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cc476a..bcfb157 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,6 +82,9 @@ devDependencies: prettier: specifier: ^3.2.4 version: 3.2.4 + prettier-plugin-sh: + specifier: ^0.14.0 + version: 0.14.0(prettier@3.2.4) replace: specifier: ^1.2.2 version: 1.2.2 @@ -4681,6 +4684,10 @@ packages: msgpackr-extract: 3.0.2 dev: true + /mvdan-sh@0.10.1: + resolution: {integrity: sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==} + dev: true + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -5003,6 +5010,17 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prettier-plugin-sh@0.14.0(prettier@3.2.4): + resolution: {integrity: sha512-hfXulj5+zEl/ulrO5kMuuTPKmXvOg0bnLHY1hKFNN/N+/903iZbNp8NyZBTsgI8dtkSgFfAEIQq0IQTyP1ZVFQ==} + engines: {node: '>=16.0.0'} + peerDependencies: + prettier: ^3.0.3 + dependencies: + mvdan-sh: 0.10.1 + prettier: 3.2.4 + sh-syntax: 0.4.2 + dev: true + /prettier@3.2.4: resolution: {integrity: sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==} engines: {node: '>=14'} @@ -5217,6 +5235,13 @@ packages: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true + /sh-syntax@0.4.2: + resolution: {integrity: sha512-/l2UZ5fhGZLVZa16XQM9/Vq/hezGGbdHeVEA01uWjOL1+7Ek/gt6FquW0iKKws4a9AYPYvlz6RyVvjh3JxOteg==} + engines: {node: '>=16.0.0'} + dependencies: + tslib: 2.6.2 + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'}