Skip to content

Commit c46e93c

Browse files
committed
[add] GitHub issue form for Feature, Enhancement & Bug
[add] GitHub repository settings & guide [optimize] update Upstream packages
1 parent 037cb6d commit c46e93c

File tree

10 files changed

+516
-190
lines changed

10 files changed

+516
-190
lines changed
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: 🐛 Bug
2+
description: File a bug/issue
3+
title: <title>
4+
labels:
5+
- bug
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Is there an existing issue for this?
10+
description: Please search to see if an issue already exists for the bug you encountered.
11+
options:
12+
- label: I have searched the existing issues
13+
required: true
14+
15+
- type: textarea
16+
attributes:
17+
label: Current Behavior
18+
description: A concise description of what you're experiencing.
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
attributes:
24+
label: Expected Behavior
25+
description: A concise description of what you expected to happen.
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
attributes:
31+
label: Steps To Reproduce
32+
description: Steps to reproduce the behavior.
33+
placeholder: |
34+
1. In this environment...
35+
2. With this config...
36+
3. Run '...'
37+
4. See error...
38+
validations:
39+
required: true
40+
41+
- type: dropdown
42+
id: hardware
43+
attributes:
44+
label: What kind of hardware did the bug occur on?
45+
multiple: true
46+
options:
47+
- Desktop
48+
- Pad
49+
- Phone
50+
- Smart Device
51+
- Car
52+
validations:
53+
required: true
54+
55+
- type: dropdown
56+
id: system
57+
attributes:
58+
label: On which operating system are you experiencing the problem?
59+
multiple: true
60+
options:
61+
- BSD
62+
- Linux
63+
- Windows
64+
- MacOS
65+
- iOS
66+
- Android
67+
validations:
68+
required: true
69+
70+
- type: dropdown
71+
id: subsystem
72+
attributes:
73+
label: What subsystem is the problem related to?
74+
multiple: true
75+
options:
76+
- Docker
77+
- WSL
78+
- WINE
79+
80+
- type: dropdown
81+
id: cli
82+
attributes:
83+
label: Which command line terminal are you using?
84+
multiple: true
85+
options:
86+
- Shell
87+
- CMD
88+
- Powershell
89+
validations:
90+
required: true
91+
92+
- type: dropdown
93+
id: javascript_runtime
94+
attributes:
95+
label: Which JavaScript runtime are you using?
96+
multiple: true
97+
options:
98+
- Node.js
99+
- Bun
100+
- Deno
101+
validations:
102+
required: true
103+
104+
- type: dropdown
105+
id: javascript_package_manager
106+
attributes:
107+
label: Which JavaScript package manager are you using?
108+
multiple: true
109+
options:
110+
- npm
111+
- Yarn
112+
- pnpm
113+
- Bun
114+
validations:
115+
required: true
116+
117+
- type: dropdown
118+
id: development_environment
119+
attributes:
120+
label: Which development environment are you using?
121+
multiple: true
122+
options:
123+
- Local
124+
- Gitpod
125+
- GitHub Codespaces
126+
validations:
127+
required: true
128+
129+
- type: dropdown
130+
id: network_region
131+
attributes:
132+
label: What network region are you in?
133+
multiple: true
134+
options:
135+
- Global
136+
- China mainland
137+
138+
- type: textarea
139+
attributes:
140+
label: Anything else?
141+
description: |
142+
Links? References? Anything that will give us more context about the issue you are encountering!
143+
144+
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ✨ Feature/Enhancement
2+
description: Request a new feature or enhancement
3+
title: <title>
4+
labels:
5+
- enhancement
6+
body:
7+
- type: checkboxes
8+
attributes:
9+
label: Is there an existing feature request for this?
10+
description: Please search to see if a feature request already exists for the enhancement you are proposing.
11+
options:
12+
- label: I have searched the existing feature requests
13+
required: true
14+
15+
- type: textarea
16+
attributes:
17+
label: Description
18+
description: |
19+
A detailed description of the new feature or enhancement you are proposing. Additionally, provide any relevant
20+
links, references, or attachments to offer more context about the proposal. You can also attach images or other
21+
files by clicking this area to highlight it and then dragging files in.
22+
23+
Tip: You can attach images or other files by clicking this area to highlight it and then dragging files in.
24+
validations:
25+
required: true
26+
27+
- type: textarea
28+
attributes:
29+
label: Use Case
30+
description: Provide a use case or scenario where this feature or enhancement would be beneficial.
31+
32+
- type: textarea
33+
attributes:
34+
label: Proposed Solution
35+
description: If you have a specific solution in mind, please describe it here.

.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: master
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/deploy-production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
packages: write
2222
contents: read
2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

2626
- name: Inject Environment variables
2727
run: |

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ COPY . /app
1010
WORKDIR /app
1111

1212
FROM base AS prod-deps
13-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --prod --frozen-lockfile
13+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i -P --frozen-lockfile --ignore-scripts
1414

1515
FROM base AS build
16-
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --frozen-lockfile
16+
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm i --frozen-lockfile
1717
RUN pnpm build
1818

1919
FROM base
20-
COPY --from=prod-deps /app/node_modules /app/node_modules
21-
COPY --from=build /app/dist /app/dist
20+
COPY --from=prod-deps /app/node_modules ./node_modules
21+
COPY --from=build /app/dist ./dist
2222
EXPOSE 8080
2323
CMD ["npm", "start"]

ReadMe.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,26 @@
66

77
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)][5]
88

9+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)][6]
10+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][7]
11+
912
## Feature
1013

11-
1. HTTP server: [Koa][6]
12-
2. Controller framework: [Routing Controllers][7]
13-
3. Model framework: [Class Transformer][8] & [Class Validator][9]
14-
4. ORM framework: [TypeORM][10]
15-
5. API document: [Swagger][11]
16-
6. Mock API: [OpenAPI backend][12]
14+
1. HTTP server: [Koa][8]
15+
2. Controller framework: [Routing Controllers][9]
16+
3. Model framework: [Class Transformer][10] & [Class Validator][11]
17+
4. ORM framework: [TypeORM][12]
18+
5. API document: [Swagger][13]
19+
6. Mock API: [OpenAPI backend][14]
20+
21+
## Best practice
22+
23+
1. Install **[Settings][15] GitHub app** in your account or organization
24+
2. Click the **[Use this template][16] button** on the top of this GitHub repository's home page, then create your own repository in the app-installed namespace above
25+
3. Click the **[Open in GitHub codespaces][17] button** on the top of ReadMe file, then an **online VS Code development environment** will be started immediately
26+
4. Recommend to add a [Notification step in GitHub actions][18] for your Team IM app
27+
5. Remind the PMs & users of your product to submit **Feature/Enhancement** requests or **Bug** reports with [Issue forms][19] instead of IM messages or Mobile Phone calls
28+
6. Collect all these issues into [Project kanbans][20], then create **Pull requests** & add `closes #issue_number` into its description for automation
1729

1830
## API Usage
1931

@@ -25,7 +37,7 @@
2537

2638
#### Sign in GitHub packages with NPM
2739

28-
1. Generate a [PAT][13] with `read:packages` authorization
40+
1. Generate a [PAT][21] with `read:packages` authorization
2941
2. Run Sign-in command in your terminal, and use PAT as password:
3042

3143
```shell
@@ -62,7 +74,7 @@ pnpm i
6274
pnpm dev
6375
```
6476

65-
or just press <kbd>F5</kbd> key in [VS Code][14].
77+
or just press <kbd>F5</kbd> key in [VS Code][22].
6678

6779
### Migration
6880

@@ -114,12 +126,20 @@ git push origin master --tags
114126
[3]: https://www.typescriptlang.org/
115127
[4]: https://github.com/idea2app/REST-Node-ts/actions/workflows/deploy-production.yml
116128
[5]: https://render.com/deploy
117-
[6]: https://koajs.com/
118-
[7]: https://github.com/typestack/routing-controllers
119-
[8]: https://github.com/typestack/class-transformer
120-
[9]: https://github.com/typestack/class-validator
121-
[10]: https://typeorm.io/
122-
[11]: https://swagger.io/
123-
[12]: https://github.com/anttiviljami/openapi-backend
124-
[13]: https://github.com/settings/tokens
125-
[14]: https://code.visualstudio.com/
129+
[6]: https://codespaces.new/idea2app/REST-Node-ts
130+
[7]: https://gitpod.io/?autostart=true#https://github.com/idea2app/REST-Node-ts
131+
[8]: https://koajs.com/
132+
[9]: https://github.com/typestack/routing-controllers
133+
[10]: https://github.com/typestack/class-transformer
134+
[11]: https://github.com/typestack/class-validator
135+
[12]: https://typeorm.io/
136+
[13]: https://swagger.io/
137+
[14]: https://github.com/anttiviljami/openapi-backend
138+
[15]: https://github.com/apps/settings
139+
[16]: https://github.com/new?template_name=REST-Node-ts&template_owner=idea2app
140+
[17]: https://codespaces.new/idea2app/REST-Node-ts
141+
[18]: https://github.com/kaiyuanshe/kaiyuanshe.github.io/blob/bb4675a56bf1d6b207231313da5ed0af7cf0ebd6/.github/workflows/pull-request.yml#L32-L56
142+
[19]: https://github.com/idea2app/REST-Node-ts/issues/new/choose
143+
[20]: https://github.com/idea2app/REST-Node-ts/projects
144+
[21]: https://github.com/settings/tokens
145+
[22]: https://code.visualstudio.com/

docker-compose.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ services:
1212
- POSTGRES_PASSWORD=${APP_SECRET}
1313
volumes:
1414
- database-data:/var/lib/postgresql/data/
15-
ports:
16-
- 5432:5432
1715
networks:
1816
- idea2app
1917
restart: always
@@ -25,8 +23,6 @@ services:
2523
- NODE_ENV=production
2624
- DATABASE_URL=postgres://postgres:${APP_SECRET}@postgres:5432/postgres
2725
- PORT=8080
28-
ports:
29-
- 8080:8080
3026
networks:
3127
- idea2app
3228
healthcheck:

0 commit comments

Comments
 (0)