Skip to content

Commit 7d38ffc

Browse files
authored
[add] GitHub repository settings & PR badges (#16)
1 parent cb9b887 commit 7d38ffc

File tree

12 files changed

+1389
-1188
lines changed

12 files changed

+1389
-1188
lines changed

.github/pr-badge.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- icon: visualstudio
2+
label: 'GitHub.dev'
3+
message: 'PR-$prNumber'
4+
color: 'blue'
5+
url: 'https://github.dev/$owner/$repo/pull/$prNumber'
6+
7+
- icon: github
8+
label: 'GitHub codespaces'
9+
message: 'PR-$prNumber'
10+
color: 'black'
11+
url: 'https://codespaces.new/$owner/$repo/pull/$prNumber'
12+
13+
- icon: git
14+
label: 'GitPod.io'
15+
message: 'PR-$prNumber'
16+
color: 'orange'
17+
url: 'https://gitpod.io/?autostart=true#https://github.com/$owner/$repo/pull/$prNumber'

.github/settings.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
allow_merge_commit: false
5+
6+
delete_branch_on_merge: true
7+
8+
enable_vulnerability_alerts: true
9+
10+
labels:
11+
- name: bug
12+
color: '#d73a4a'
13+
description: Something isn't working
14+
15+
- name: documentation
16+
color: '#0075ca'
17+
description: Improvements or additions to documentation
18+
19+
- name: duplicate
20+
color: '#cfd3d7'
21+
description: This issue or pull request already exists
22+
23+
- name: enhancement
24+
color: '#a2eeef'
25+
description: Some improvements
26+
27+
- name: feature
28+
color: '#16b33f'
29+
description: New feature or request
30+
31+
- name: good first issue
32+
color: '#7057ff'
33+
description: Good for newcomers
34+
35+
- name: help wanted
36+
color: '#008672'
37+
description: Extra attention is needed
38+
39+
- name: invalid
40+
color: '#e4e669'
41+
description: This doesn't seem right
42+
43+
- name: question
44+
color: '#d876e3'
45+
description: Further information is requested
46+
47+
- name: wontfix
48+
color: '#ffffff'
49+
description: This will not be worked on
50+
51+
branches:
52+
- name: main
53+
# https://docs.github.com/en/rest/reference/repos#update-branch-protection
54+
protection:
55+
# Required. Require at least one approving review on a pull request, before merging. Set to null to disable.
56+
required_pull_request_reviews:
57+
# The number of approvals required. (1-6)
58+
required_approving_review_count: 1
59+
# Dismiss approved reviews automatically when a new commit is pushed.
60+
dismiss_stale_reviews: true
61+
# Blocks merge until code owners have reviewed.
62+
require_code_owner_reviews: true
63+
# Specify which users and teams can dismiss pull request reviews.
64+
# Pass an empty dismissal_restrictions object to disable.
65+
# User and team dismissal_restrictions are only available for organization-owned repositories.
66+
# Omit this parameter for personal repositories.
67+
dismissal_restrictions:
68+
# users: []
69+
# teams: []
70+
# Required. Require status checks to pass before merging. Set to null to disable
71+
required_status_checks:
72+
# Required. Require branches to be up to date before merging.
73+
strict: true
74+
# Required. The list of status checks to require in order to merge into this branch
75+
contexts: []
76+
# Required. Enforce all configured restrictions for administrators.
77+
# Set to true to enforce required status checks for repository administrators.
78+
# Set to null to disable.
79+
enforce_admins: true
80+
# Prevent merge commits from being pushed to matching branches
81+
required_linear_history: true
82+
# Required. Restrict who can push to this branch.
83+
# Team and user restrictions are only available for organization-owned repositories.
84+
# Set to null to disable.
85+
restrictions: null

.github/workflows/main.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,40 @@ on:
66
jobs:
77
Build-and-Publish:
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
id-token: write
912
steps:
10-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1114

12-
- uses: pnpm/action-setup@v2
15+
- uses: pnpm/action-setup@v4
1316
with:
1417
version: 9
15-
- uses: actions/setup-node@v3
18+
- uses: actions/setup-node@v4
1619
with:
17-
node-version: 18
20+
node-version: 20
1821
registry-url: https://registry.npmjs.org
1922
cache: pnpm
2023
- name: Install Dependencies
2124
run: pnpm i --frozen-lockfile
2225

23-
- name: Build & Publish
26+
- name: Build & Publish the core package
2427
run: |
2528
echo GITHUB_PAT=${{ secrets.PAT }} > .env
2629
npm publish
2730
env:
2831
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
33+
- name: Build & Publish the Strapi package
34+
run: |
35+
cd wrapper/Strapi
36+
pnpm i --frozen-lockfile
37+
npm publish || true
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40+
2941
- name: Update document
30-
uses: peaceiris/actions-gh-pages@v3
42+
uses: peaceiris/actions-gh-pages@v4
3143
with:
3244
publish_dir: ./docs
3345
personal_token: ${{ secrets.GITHUB_TOKEN }}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
provenance = true
12
auto-install-peers = false

ReadMe.md

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# MobX RESTful
22

3-
Common [MobX][1] **abstract base Class & Decorator** utilities for [RESTful API][2].
3+
Common [MobX][1] **abstract base Class & [Decorator][2]** utilities for [RESTful API][3].
44

55
Just define your **Data models** & **Client HTTP methods**, then leave rest of things to MobX!
66

77
[![MobX compatibility](https://img.shields.io/badge/Compatible-1?logo=mobx&label=MobX%206%2F7)][1]
8-
[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/MobX-RESTful.svg)][3]
9-
[![CI & CD](https://github.com/idea2app/MobX-RESTful/actions/workflows/main.yml/badge.svg)][4]
8+
[![NPM Dependency](https://img.shields.io/librariesio/github/idea2app/MobX-RESTful.svg)][4]
9+
[![CI & CD](https://github.com/idea2app/MobX-RESTful/actions/workflows/main.yml/badge.svg)][5]
1010

11-
[![NPM](https://nodei.co/npm/mobx-restful.png?downloads=true&downloadRank=true&stars=true)][5]
11+
[![NPM](https://nodei.co/npm/mobx-restful.png?downloads=true&downloadRank=true&stars=true)][6]
1212

1313
## Versions
1414

@@ -19,6 +19,27 @@ Just define your **Data models** & **Client HTTP methods**, then leave rest of t
1919

2020
## Usage
2121

22+
### `package.json`
23+
24+
```json
25+
{
26+
"dependencies": {
27+
"koajax": "^3.0.0",
28+
"mobx": "^6.13.1",
29+
"mobx-restful": "^1.0.1"
30+
},
31+
"resolutions": {
32+
"native-file-system-adapter": "npm:@tech_query/native-file-system-adapter@^3.0.1"
33+
}
34+
}
35+
```
36+
37+
> This `resolutions` configuration is used for **Node.js**, such Back-end API or Server-side Rendering.
38+
>
39+
> You should install your project with [Yarn][7] or [PNPM][8] to support this feature.
40+
>
41+
> It can be removed after [`require('esm')` shipped formally][9].
42+
2243
### `tsconfig.json`
2344

2445
```json
@@ -83,7 +104,7 @@ export default new RepositoryModel();
83104

84105
#### `page/Repository.tsx`
85106

86-
Use [WebCell][6] as an Example
107+
Use [WebCell][10] as an Example
87108

88109
```tsx
89110
import { component, observer } from 'web-cell';
@@ -230,12 +251,16 @@ Here is an example:
230251

231252
## Limitation
232253

233-
- [ ] [`abstract` hint of Mixin is missing][7]
254+
- [ ] [`abstract` hint of Mixin is missing][11]
234255

235256
[1]: https://mobx.js.org/
236-
[2]: https://en.wikipedia.org/wiki/Representational_state_transfer
237-
[3]: https://libraries.io/npm/mobx-restful
238-
[4]: https://github.com/idea2app/MobX-RESTful/actions/workflows/main.yml
239-
[5]: https://nodei.co/npm/mobx-restful/
240-
[6]: https://github.com/EasyWebApp/WebCell
241-
[7]: https://github.com/microsoft/TypeScript/issues/39752#issuecomment-1239810720
257+
[2]: https://github.com/tc39/proposal-decorators
258+
[3]: https://en.wikipedia.org/wiki/Representational_state_transfer
259+
[4]: https://libraries.io/npm/mobx-restful
260+
[5]: https://github.com/idea2app/MobX-RESTful/actions/workflows/main.yml
261+
[6]: https://nodei.co/npm/mobx-restful/
262+
[7]: https://yarnpkg.com/
263+
[8]: https://pnpm.io/
264+
[9]: https://joyeecheung.github.io/blog/2024/03/18/require-esm-in-node-js/
265+
[10]: https://github.com/EasyWebApp/WebCell
266+
[11]: https://github.com/microsoft/TypeScript/issues/39752#issuecomment-1239810720

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-restful",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "LGPL-3.0",
55
"author": "[email protected]",
66
"description": "MobX SDK for RESTful API",
@@ -27,9 +27,9 @@
2727
"module": "dist/index.esm.js",
2828
"main": "dist/index.js",
2929
"dependencies": {
30-
"@swc/helpers": "^0.5.11",
30+
"@swc/helpers": "^0.5.13",
3131
"idb-keyval": "^6.2.1",
32-
"koajax": "^1.1.2",
32+
"koajax": ">=1 <4",
3333
"native-file-system-adapter": "^3.0.1",
3434
"regenerator-runtime": "^0.14.1",
3535
"web-streams-polyfill": "^4.0.0",
@@ -45,20 +45,20 @@
4545
"@parcel/transformer-typescript-tsc": "~2.12.0",
4646
"@parcel/transformer-typescript-types": "~2.12.0",
4747
"@types/jest": "^29.5.12",
48-
"@types/node": "^18.19.34",
48+
"@types/node": "^20.16.3",
4949
"dotenv": "^16.4.5",
50-
"husky": "^9.0.11",
50+
"husky": "^9.1.5",
5151
"jest": "^29.7.0",
5252
"jest-environment-jsdom": "^29.7.0",
53-
"lint-staged": "^15.2.5",
54-
"mobx": "^6.12.3",
53+
"lint-staged": "^15.2.10",
54+
"mobx": "^6.13.1",
5555
"open-cli": "^8.0.0",
5656
"parcel": "~2.12.0",
57-
"prettier": "^3.3.1",
58-
"ts-jest": "^29.1.4",
59-
"typedoc": "^0.25.13",
60-
"typedoc-plugin-mdn-links": "^3.1.28",
61-
"typescript": "~5.5.0-beta"
57+
"prettier": "^3.3.3",
58+
"ts-jest": "^29.2.5",
59+
"typedoc": "^0.26.6",
60+
"typedoc-plugin-mdn-links": "^3.2.11",
61+
"typescript": "~5.5.4"
6262
},
6363
"prettier": {
6464
"singleQuote": true,

0 commit comments

Comments
 (0)