Skip to content

Commit f2e5dd1

Browse files
committed
[add] GitHub repository settings & PR badges
[add] VS Code extensions [optimize] upgrade to Node.js 20 & other Upstream packages/actions [fix] 2 Compatibility detail bugs
1 parent 0530fc2 commit f2e5dd1

File tree

11 files changed

+1454
-1026
lines changed

11 files changed

+1454
-1026
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: 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/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,26 @@ jobs:
77
Build-and-Publish:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v4
1111

12-
- uses: pnpm/action-setup@v2
12+
- uses: pnpm/action-setup@v4
1313
with:
1414
version: 9
15-
- uses: actions/setup-node@v3
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
registry-url: https://registry.npmjs.org
1919
cache: pnpm
2020
- name: Install Dependencies
2121
run: pnpm i --frozen-lockfile
2222

2323
- name: Build & Publish
24-
run: npm publish
24+
run: npm publish --access public --provenance
2525
env:
2626
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2727

2828
- name: Update document
29-
uses: peaceiris/actions-gh-pages@v3
29+
uses: peaceiris/actions-gh-pages@v4
3030
with:
3131
publish_dir: ./docs
3232
personal_token: ${{ secrets.GITHUB_TOKEN }}

.gitpod.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
# This configuration file was automatically generated by Gitpod.
2-
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
33
# and commit this file to your remote git repository to share the goodness with others.
44

5+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
6+
57
tasks:
68
- init: pnpm i && pnpm build
79
command: pnpm start
810
vscode:
911
extensions:
12+
- yzhang.markdown-all-in-one
13+
- redhat.vscode-yaml
14+
- akamud.vscode-caniuse
15+
- visualstudioexptteam.intellicode-api-usage-examples
16+
- pflannery.vscode-versionlens
17+
- christian-kohler.npm-intellisense
1018
- esbenp.prettier-vscode
19+
- eamodio.gitlens
20+
- github.vscode-pull-request-github
21+
- github.vscode-github-actions

.vscode/extensions.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"recommendations": [
3+
"yzhang.markdown-all-in-one",
4+
"redhat.vscode-yaml",
5+
"akamud.vscode-caniuse",
6+
"visualstudioexptteam.intellicode-api-usage-examples",
7+
"pflannery.vscode-versionlens",
8+
"christian-kohler.npm-intellisense",
9+
"esbenp.prettier-vscode",
10+
"eamodio.gitlens",
11+
"github.vscode-pull-request-github",
12+
"github.vscode-github-actions"
13+
]
14+
}

ReadMe.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
npm install web-utility
1616
```
1717

18-
`index.html`
18+
### `index.html`
1919

2020
```html
2121
<head>
@@ -27,7 +27,7 @@ npm install web-utility
2727
</head>
2828
```
2929

30-
`tsconfig.json`
30+
### `tsconfig.json`
3131

3232
```json
3333
{
@@ -114,7 +114,7 @@ document.addEventListener(
114114

115115
### Message Channel
116116

117-
`index.ts`
117+
#### `index.ts`
118118

119119
```typescript
120120
import { createMessageServer } from 'web-utility';
@@ -124,16 +124,14 @@ createMessageServer({
124124
});
125125
```
126126

127-
`iframe.ts`
127+
#### `iframe.ts`
128128

129129
```typescript
130130
import { createMessageClient } from 'web-utility';
131131

132132
const request = createMessageClient(globalThis.parent);
133133

134-
(async () => {
135-
console.log(await request('preset')); // { test: 1 }
136-
})();
134+
request('preset').then(console.log); // { test: 1 }
137135
```
138136

139137
### Service Worker updating
@@ -170,7 +168,7 @@ If you are looking for a simple alternative of [Mocha][6] or [Jest][7], just use
170168
npx ts-node index.spec.ts
171169
```
172170
173-
`index.spec.ts`
171+
#### `index.spec.ts`
174172
175173
```typescript
176174
import { describe, it } from 'web-utility';

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-utility",
3-
"version": "4.4.0",
3+
"version": "4.4.1",
44
"license": "LGPL-3.0",
55
"author": "[email protected]",
66
"description": "Web front-end toolkit based on TypeScript",
@@ -24,8 +24,8 @@
2424
"main": "dist/index.js",
2525
"module": "dist/index.esm.js",
2626
"dependencies": {
27-
"@swc/helpers": "^0.5.11",
28-
"element-internals-polyfill": "^1.3.11",
27+
"@swc/helpers": "^0.5.13",
28+
"element-internals-polyfill": "^1.3.12",
2929
"regenerator-runtime": "^0.14.1"
3030
},
3131
"peerDependencies": {
@@ -34,23 +34,23 @@
3434
"devDependencies": {
3535
"@parcel/packager-ts": "~2.12.0",
3636
"@parcel/transformer-typescript-types": "~2.12.0",
37-
"@peculiar/webcrypto": "^1.4.6",
38-
"@types/jest": "^29.5.12",
39-
"@types/node": "^18.19.31",
37+
"@peculiar/webcrypto": "^1.5.0",
38+
"@types/jest": "^29.5.13",
39+
"@types/node": "^20.16.11",
4040
"@webcomponents/webcomponentsjs": "^2.8.0",
41-
"core-js": "^3.37.0",
42-
"husky": "^9.0.11",
41+
"core-js": "^3.38.1",
42+
"husky": "^9.1.6",
4343
"intersection-observer": "^0.12.2",
4444
"jest": "^29.7.0",
4545
"jest-environment-jsdom": "^29.7.0",
46-
"lint-staged": "^15.2.2",
46+
"lint-staged": "^15.2.10",
4747
"open-cli": "^8.0.0",
4848
"parcel": "~2.12.0",
49-
"prettier": "^3.2.5",
50-
"ts-jest": "^29.1.2",
51-
"typedoc": "^0.25.13",
52-
"typedoc-plugin-mdn-links": "^3.1.23",
53-
"typescript": "~5.4.5"
49+
"prettier": "^3.3.3",
50+
"ts-jest": "^29.2.5",
51+
"typedoc": "^0.26.9",
52+
"typedoc-plugin-mdn-links": "^3.3.3",
53+
"typescript": "~5.6.3"
5454
},
5555
"prettier": {
5656
"singleQuote": true,
@@ -72,7 +72,7 @@
7272
}
7373
},
7474
"scripts": {
75-
"prepare": "husky install",
75+
"prepare": "husky",
7676
"test": "lint-staged && jest --no-cache",
7777
"build": "rm -rf dist/ docs/ && typedoc source/ && parcel build",
7878
"start": "typedoc source/ && open-cli docs/index.html",

0 commit comments

Comments
 (0)