Skip to content

Commit

Permalink
[add] GitHub action for updating Repository Meta
Browse files Browse the repository at this point in the history
[optimize] update Upstream packages
[optimize] some Tool-chain details
  • Loading branch information
TechQuery committed Nov 8, 2024
1 parent be942b5 commit 8846c8a
Show file tree
Hide file tree
Showing 7 changed files with 409 additions and 344 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/replace-repository-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ 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/$SourceOwner/$TargetOwner/ig" \
$(grep -i $SourceOwner -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)
36 changes: 36 additions & 0 deletions .github/workflows/update-meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI & CD
on:
push:
branches:
- main
paths:
- package.json
jobs:
Update-Meta:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Set NPM metadata
env:
# "Administration" repository permissions (write),
# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#replace-all-repository-topics
GH_TOKEN: ${{ secrets.GH_ADMIN_TOKEN || github.token }}
REPOSITORY: ${{ github.repository }}
run: |
DESCRIPTION=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).description || ''")
HOME_PAGE=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).homepage || ''")
TOPICS=$(node -p "JSON.parse(require('fs').readFileSync('package.json')).keywords?.join().toLowerCase() || ''")
[[ "$DESCRIPTION" ]] && gh repo edit "$REPOSITORY" --description "$DESCRIPTION"
[[ "$HOME_PAGE" ]] && gh repo edit "$REPOSITORY" --homepage "$HOME_PAGE"
[[ "$TOPICS" ]] && {
gh api --method PUT "repos/$REPOSITORY/topics" -f "names[]"
gh repo edit "$REPOSITORY" --add-topic "$TOPICS"
}
23 changes: 9 additions & 14 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ export default tsEslint.config(
{
plugins: {
'@typescript-eslint': tsEslint.plugin,
// https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
// @ts-expect-error https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
react: fixupPluginRules(reactPlugin),
'simple-import-sort': simpleImportSortPlugin
}
},
{
// config with just ignores is the replacement for `.eslintignore`
ignores: ['**/node_modules/**', '**/dist/**', '**/.parcel-cache/**']
},
// config with just ignores is the replacement for `.eslintignore`
{ ignores: ['**/node_modules/**', '**/dist/**', '**/.parcel-cache/**'] },

// extends ...
eslint.configs.recommended,
Expand All @@ -31,11 +29,7 @@ export default tsEslint.config(
// base config
{
languageOptions: {
globals: {
...globals.es2020,
...globals.browser,
...globals.node
},
globals: { ...globals.es2022, ...globals.browser, ...globals.node },
parserOptions: {
projectService: true,
tsconfigRootDir,
Expand All @@ -45,18 +39,19 @@ export default tsEslint.config(
rules: {
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'warn',
'react/jsx-no-target-blank': 'warn',
'react/jsx-sort-props': [
'error',
{
reservedFirst: true,
shorthandLast: true,
callbacksLast: true,
noSortAlphabetically: true
}
],
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'warn'
]
}
},
{
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,37 @@
"browser-unhandled-rejection": "^1.0.2",
"cell-router": "^3.0.0-rc.8",
"classnames": "^2.5.1",
"dom-renderer": "^2.3.0",
"dom-renderer": "^2.4.1",
"iterable-observer": "^1.1.0",
"mobx": "^6.13.3",
"mobx": "^6.13.5",
"web-cell": "^3.0.0",
"web-utility": "^4.4.0"
"web-utility": "^4.4.2"
},
"devDependencies": {
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.11.1",
"@eslint/compat": "^1.2.2",
"@eslint/js": "^9.14.0",
"@parcel/config-default": "~2.12.0",
"@parcel/packager-raw-url": "~2.12.0",
"@parcel/transformer-less": "~2.12.0",
"@parcel/transformer-typescript-tsc": "~2.12.0",
"@parcel/transformer-webmanifest": "~2.12.0",
"@softonus/prettier-plugin-duplicate-remover": "^1.0.1",
"@types/eslint-config-prettier": "^6.11.3",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.16.10",
"eslint": "^9.11.1",
"@types/node": "^20.17.6",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.37.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"globals": "^15.9.0",
"globals": "^15.12.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"parcel": "~2.12.0",
"postcss": "^8.4.47",
"prettier": "^3.3.3",
"prettier-plugin-css-order": "^2.1.2",
"typescript": "~5.6.2",
"typescript-eslint": "^8.7.0",
"workbox-cli": "^7.1.0"
"typescript": "~5.6.3",
"typescript-eslint": "^8.13.0",
"workbox-cli": "^7.3.0"
},
"prettier": {
"singleQuote": true,
Expand Down
Loading

1 comment on commit 8846c8a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for web-cell-scaffold ready!

✅ Preview
https://web-cell-scaffold-fzgu6pxuf-techquerys-projects.vercel.app

Built with commit 8846c8a.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.