Skip to content

Commit

Permalink
[add] Initialization script & action of GitHub template repository
Browse files Browse the repository at this point in the history
[optimize] update Upstream packages
  • Loading branch information
TechQuery committed Jun 27, 2024
1 parent 67b01fd commit 7b64ab3
Show file tree
Hide file tree
Showing 8 changed files with 370 additions and 392 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/init-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Template Repository initialization
on:
push:
branches:
- master
env:
TEMPLATE_OWNER: idea2app
TEMPLATE_NAME: React-MobX-Ant-Design-ts

jobs:
replace-repository-name:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- if: github.repository != format('{0}/{1}', env.TEMPLATE_OWNER, env.TEMPLATE_NAME)
run: |
sh .github/workflows/replace-repository-name.sh \
${{ env.TEMPLATE_OWNER }} ${{ env.TEMPLATE_NAME }} \
${{ github.repository_owner }} ${{ github.event.repository.name }}
rm -f .github/workflows/init-template.yml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[fix] replace Repository Name'
11 changes: 11 additions & 0 deletions .github/workflows/replace-repository-name.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /usr/bin/env bash

SourceOwner=$1
SourceName=$2
TargetOwner=$3
TargetName=$4

sed -i "s/$SourceOwner\/$SourceName/$TargetOwner\/$TargetName/ig" \
$(grep -i $SourceOwner/$SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
sed -i "s/$SourceName/$TargetName/ig" \
$(grep -i $SourceName -rl . --exclude-dir=.git --exclude-dir=node_modules)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# React-MobX-Ant-Design.ts
# React-MobX-Ant-Design-ts

[React][1] project scaffold based on [TypeScript][2], [MobX][3] & [Ant Design][4],
which is inspired by [WebCell scaffold][5].
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@
"url": "https://github.com/idea2app/React-MobX-Ant-Design-ts/issues"
},
"dependencies": {
"@ant-design/cssinjs": "^1.20.0",
"@ant-design/cssinjs": "^1.21.0",
"@ant-design/icons": "^5.3.7",
"antd": "^5.18.0",
"antd": "^5.18.3",
"browser-unhandled-rejection": "^1.0.2",
"koajax": "^1.1.2",
"lodash": "^4.17.21",
"mobx": "^6.12.3",
"mobx-github": "^0.3.1",
"mobx": "^6.12.4",
"mobx-github": "^0.3.2",
"mobx-i18n": "^0.5.0",
"mobx-react": "^9.1.1",
"mobx-react-helper": "^0.3.1",
"mobx-restful": "^1.0.0-rc.6",
"mobx-restful": "^1.0.0",
"mobx-restful-table": "^2.0.0-rc.1",
"preact": "^10.22.0",
"react-router": "^6.23.1",
"react-router": "^6.24.0",
"react-router-class-tools": "^0.1.3",
"react-router-dom": "^6.23.1",
"react-router-dom": "^6.24.0",
"web-utility": "^4.4.0"
},
"devDependencies": {
"@parcel/config-default": "~2.12.0",
"@parcel/packager-raw-url": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@types/lodash": "^4.17.4",
"@types/node": "^18.19.34",
"@types/lodash": "^4.17.5",
"@types/node": "^18.19.39",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.7",
"parcel": "~2.12.0",
"prettier": "^3.3.1",
"prettier": "^3.3.2",
"process": "^0.11.10",
"typescript": "~5.4.5",
"typescript": "~5.5.2",
"workbox-cli": "^7.1.0"
},
"alias": {
Expand All @@ -63,7 +63,7 @@
"prepare": "husky",
"test": "lint-staged",
"clean": "rm -rf .parcel-cache/ dist/",
"start": "npm run clean && parcel src/index.html --open",
"start": "npm run clean && parcel src/index.html",
"pack": "npm run clean && parcel build src/index.html --public-url .",
"build": "npm run pack && workbox generateSW"
}
Expand Down
Loading

0 comments on commit 7b64ab3

Please sign in to comment.