Skip to content

Commit 9f9f2de

Browse files
committed
feat: initial release
1 parent fe4cc41 commit 9f9f2de

File tree

96 files changed

+6032
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+6032
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# name: "Bug reports"
2+
# title:
3+
# description: Use Q&A if you cannot fill out the form
4+
labels:
5+
- bug
6+
# assignees:
7+
# - macropygia
8+
body:
9+
- type: markdown
10+
attributes:
11+
value: ⚠ Please write in plain English. (Repository owner is not a native English speaker.) ※日本語可
12+
- type: checkboxes
13+
id: checklist
14+
attributes:
15+
label: Checklist
16+
description: Do all of the following conditions apply?
17+
options:
18+
- label: Using the latest version of `elysia-openid-client`.
19+
required: true
20+
- label: Using the latest version of Bun within the range specified in `engines`.
21+
required: true
22+
- label: Using the latest version of ElysiaJS within the range specified in `peerDependencies`.
23+
required: true
24+
- label: It is not due to dependencies, but rather the logic of `elysia-openid-client`.
25+
required: true
26+
- label: It is not due to the OpenID Provider violating the OpenID Connect specification.
27+
required: true
28+
- label: I will provide a minimal reproducible example.
29+
required: true
30+
- type: input
31+
id: bun-version
32+
attributes:
33+
label: What version of Bun are you using?
34+
placeholder: 1.0.0
35+
validations:
36+
required: true
37+
- type: input
38+
id: elysia-version
39+
attributes:
40+
label: What version of ElysiaJS are you using?
41+
placeholder: 1.0.0
42+
validations:
43+
required: true
44+
- type: input
45+
id: issuer
46+
attributes:
47+
label: OpenID Provider (URL or name)
48+
placeholder: https://example.com
49+
- type: checkboxes
50+
id: category
51+
attributes:
52+
label: Category
53+
description: You may select more than one.
54+
options:
55+
- label: Endpoints
56+
- label: Hooks
57+
- label: Data Adapters
58+
- label: Logic (other than above)
59+
- label: Other
60+
- type: textarea
61+
id: description
62+
attributes:
63+
label: Describe the bug
64+
description: A clear and concise description of what the bug is.
65+
validations:
66+
required: true
67+
- type: textarea
68+
id: expectation
69+
attributes:
70+
label: What's the expected result?
71+
description: Describe what you expect to happen.
72+
validations:
73+
required: true
74+
- type: textarea
75+
id: reproduction
76+
attributes:
77+
label: Write or link to minimal reproducible example
78+
description: Recommended to create a [minimal reproduction](https://github.com/renovatebot/renovate/blob/main/docs/development/minimal-reproductions.md) and link to it.
79+
validations:
80+
required: true
81+
- type: checkboxes
82+
id: will-pr
83+
attributes:
84+
label: Participation
85+
options:
86+
- label: I am willing to create a pull request for this issue.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# name: "Feature requests"
2+
# title:
3+
# description: Use General if you cannot fill out the form
4+
labels:
5+
- enhancement
6+
# assignees:
7+
# - macropygia
8+
body:
9+
- type: markdown
10+
attributes:
11+
value: ⚠ Please write in plain English. (Repository owner is not a native English speaker.) ※日本語可
12+
- type: checkboxes
13+
id: checklist
14+
attributes:
15+
label: Checklist
16+
description: Do all of the following conditions apply?
17+
options:
18+
- label: It does not attempt to support OpenID Connect specification not supported by [`openid-client`](https://github.com/panva/node-openid-client)."
19+
required: true
20+
- label: It does not intend to add support for OpenID Provider that violate the OpenID Connect specification.
21+
required: true
22+
- label: Custom data adapter is not a solution.
23+
required: true
24+
- label: Custom logger is not a solution.
25+
required: true
26+
- label: Feasibility is verified.
27+
required: true
28+
- type: checkboxes
29+
id: category
30+
attributes:
31+
label: Category
32+
description: You may select more than one.
33+
options:
34+
- label: Endpoints
35+
- label: Hooks
36+
- label: Data Adapters
37+
- label: Logic (other than above)
38+
- label: Documentation
39+
- label: Tests
40+
- label: Security/Vulnerability
41+
- label: Other
42+
- type: textarea
43+
id: description
44+
attributes:
45+
label: Description
46+
description: A clear and concise description of the request.
47+
validations:
48+
required: true
49+
- type: input
50+
id: additional-dependencies
51+
attributes:
52+
label: Additional dependencies
53+
description: If needed.
54+
- type: checkboxes
55+
id: will-pr
56+
attributes:
57+
label: Participation
58+
options:
59+
- label: I am willing to create a pull request for this issue.

.github/ISSUE_TEMPLATE/config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Start a discussion
4+
url: https://github.com/macropygia/elysia-openid-client/discussions/new/choose
5+
about: Any questions or suggestions about features or behavior.

.github/PULL_REQUEST_TEMPLATE.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Changes
2+
3+
## Context
4+
5+
## Testing status (must select at least one)
6+
7+
- [ ] Existing tests covered or no need to test
8+
- [ ] Code inspection only
9+
- [ ] Added or modified unit tests
10+
- [ ] Modified integration tests
11+
- [ ] Ran on a real project that could be an alternative to E2E tests

.github/release-drafter.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
version-resolver:
4+
major:
5+
labels:
6+
- "release:major"
7+
minor:
8+
labels:
9+
- "release:minor"
10+
patch:
11+
labels:
12+
- "release:patch"
13+
- "release:silent"
14+
default: patch
15+
exclude-labels:
16+
- "release:silent"
17+
exclude-contributors:
18+
- "macropygia"
19+
template: |
20+
## Changes
21+
22+
$CHANGES
23+
24+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/utils/token.sh

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/usr/bin/env bash
2+
3+
base64url() {
4+
openssl enc -base64 -A | tr '+/' '-_' | tr -d '='
5+
}
6+
7+
sign() {
8+
openssl dgst -binary -sha256 -sign <(printf '%s' "${PRIVATE_KEY}")
9+
}
10+
11+
header="$(printf '{"alg":"RS256","typ":"JWT"}' | base64url)"
12+
now="$(date '+%s')"
13+
iat="$((now - 60))"
14+
exp="$((now + (3 * 60)))"
15+
template='{"iss":"%s","iat":%s,"exp":%s}'
16+
payload="$(printf "${template}" "${APP_ID}" "${iat}" "${exp}" | base64url)"
17+
echo "::add-mask::${payload}"
18+
signature="$(printf '%s' "${header}.${payload}" | sign | base64url)"
19+
echo "::add-mask::${signature}"
20+
jwt="${header}.${payload}.${signature}"
21+
echo "::add-mask::${jwt}"
22+
23+
installation_id="$(curl --location --silent --request GET \
24+
--url "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/installation" \
25+
--header "Accept: application/vnd.github+json" \
26+
--header "X-GitHub-Api-Version: 2022-11-28" \
27+
--header "Authorization: Bearer ${jwt}" \
28+
| jq -r '.id'
29+
)"
30+
31+
repo_name="$(echo "${GITHUB_REPOSITORY}" | cut -d '/' -f 2)"
32+
token="$(curl --location --silent --request POST \
33+
--url "${GITHUB_API_URL}/app/installations/${installation_id}/access_tokens" \
34+
--header "Accept: application/vnd.github+json" \
35+
--header "X-GitHub-Api-Version: 2022-11-28" \
36+
--header "Authorization: Bearer ${jwt}" \
37+
--data "$(printf '{"repositories":["%s"]}' "${repo_name}")" \
38+
| jq -r '.token'
39+
)"
40+
echo "::add-mask::${token}"
41+
echo "token=${token}" >>"${GITHUB_OUTPUT}"

.github/workflows/checks-pr.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Checks (PR)
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.ts'
9+
- 'biome.json'
10+
- 'package.json'
11+
- 'tsconfig.json'
12+
- '!**/.github/**'
13+
- '!**/.vscode/**'
14+
- '!**/examples/**'
15+
- '!**/*.config.ts'
16+
- '!./build.ts'
17+
pull_request:
18+
branches:
19+
- main
20+
types: [opened, reopened, synchronize]
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: oven-sh/setup-bun@v1
32+
- run: bun install
33+
- run: bun check:apply
34+
- run: bun type-check
35+
- run: bun test

.github/workflows/publish-dry-run.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Publish (Manual/Dry-run)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
defaults:
7+
run:
8+
shell: bash
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: oven-sh/setup-bun@v1
19+
with:
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: bun install
22+
- run: bun check:apply
23+
- run: bun type-check
24+
- run: bun test --coverage
25+
- run: bun docs
26+
- run: bun run build
27+
- run: npm publish --dry-run
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/publish.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
defaults:
8+
run:
9+
shell: bash
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Verify that tag and package.json match.
21+
run: |
22+
TAGGED_VERSION=$(echo "${{ github.ref_name }}" | grep -oP "[0-9]+\.[0-9]+\.[0-9]$")
23+
PUBLISH_VERSION=$(jq --raw-output .version package.json)
24+
if [ "$TAGGED_VERSION" != "$PUBLISH_VERSION" ]; then
25+
exit 1
26+
fi
27+
28+
- name: Build
29+
uses: oven-sh/setup-bun@v1
30+
with:
31+
registry-url: 'https://registry.npmjs.org'
32+
- run: bun install
33+
- run: bun check:apply
34+
- run: bun type-check
35+
- run: bun test
36+
- run: bun docs
37+
- run: bun run build
38+
39+
- name: Publish
40+
run: npm publish
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
44+
# - uses: actions/setup-node@v4
45+
# with:
46+
# registry-url: 'https://npm.pkg.github.com'
47+
# - run: npm publish
48+
# env:
49+
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Generate docs
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: ./docs
55+
56+
deploy:
57+
needs: build
58+
permissions:
59+
pages: write
60+
id-token: write
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Deploy docs to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release Drafter (PR)
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
types: [opened, reopened, synchronize]
8+
9+
defaults:
10+
run:
11+
shell: bash
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
update_release_draft:
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: release-drafter/release-drafter@v6
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
commitish: "main"

0 commit comments

Comments
 (0)