Skip to content

Commit 948a6da

Browse files
authored
Use prettier for formatting files not supported by biome (#46)
1 parent 84d247e commit 948a6da

File tree

8 files changed

+100
-75
lines changed

8 files changed

+100
-75
lines changed

.github/workflows/release.yaml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -21,80 +21,80 @@ jobs:
2121
id-token: write
2222

2323
steps:
24-
- name: Generate token
25-
id: app-token
26-
uses: actions/create-github-app-token@v1
27-
with:
28-
app-id: ${{ vars.INTEGRATIONS_APP_ID }}
29-
private-key: ${{ secrets.INTEGRATIONS_APP_PRIVATE_KEY }}
24+
- name: Generate token
25+
id: app-token
26+
uses: actions/create-github-app-token@v1
27+
with:
28+
app-id: ${{ vars.INTEGRATIONS_APP_ID }}
29+
private-key: ${{ secrets.INTEGRATIONS_APP_PRIVATE_KEY }}
3030

31-
- uses: actions/checkout@v4
32-
with:
33-
token: ${{ steps.app-token.outputs.token }}
34-
fetch-depth: 0
31+
- uses: actions/checkout@v4
32+
with:
33+
token: ${{ steps.app-token.outputs.token }}
34+
fetch-depth: 0
3535

36-
- uses: actions/setup-node@v4
37-
with:
38-
node-version: 22.x
39-
cache: npm
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 22.x
39+
cache: npm
4040

41-
# Run install, test, and builds for sanity check.
42-
- run: npm ci
43-
- run: npm test
44-
- run: npm run build
41+
# Run install, test, and builds for sanity check.
42+
- run: npm ci
43+
- run: npm test
44+
- run: npm run build
4545

46-
- name: Get latest tag
47-
id: latest_tag
48-
run: echo "tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" >> "$GITHUB_OUTPUT"
46+
- name: Get latest tag
47+
id: latest_tag
48+
run: echo "tag=$(git describe --abbrev=0 --tags 2>/dev/null || echo '')" >> "$GITHUB_OUTPUT"
4949

50-
- name: Bump semver tag
51-
id: bump_tag
52-
env:
53-
LATEST_TAG: ${{ steps.latest_tag.outputs.tag }}
54-
BUMP: ${{ inputs.bump }}
55-
run: |
56-
set -e
57-
base=${LATEST_TAG#v}
58-
if [[ -z "$base" ]]; then
59-
echo "No tag found. Exiting."
60-
exit 1
61-
fi
62-
IFS=. read -r maj min pat <<< "$base"
63-
case "$BUMP" in
64-
major) ((maj++)); min=0; pat=0 ;;
65-
minor) ((min++)); pat=0 ;;
66-
patch) ((pat++)) ;;
67-
esac
68-
next="$maj.$min.$pat"
69-
echo "next_version=$next" >> "$GITHUB_OUTPUT"
70-
echo "next_tag=v$next" >> "$GITHUB_OUTPUT"
50+
- name: Bump semver tag
51+
id: bump_tag
52+
env:
53+
LATEST_TAG: ${{ steps.latest_tag.outputs.tag }}
54+
BUMP: ${{ inputs.bump }}
55+
run: |
56+
set -e
57+
base=${LATEST_TAG#v}
58+
if [[ -z "$base" ]]; then
59+
echo "No tag found. Exiting."
60+
exit 1
61+
fi
62+
IFS=. read -r maj min pat <<< "$base"
63+
case "$BUMP" in
64+
major) ((maj++)); min=0; pat=0 ;;
65+
minor) ((min++)); pat=0 ;;
66+
patch) ((pat++)) ;;
67+
esac
68+
next="$maj.$min.$pat"
69+
echo "next_version=$next" >> "$GITHUB_OUTPUT"
70+
echo "next_tag=v$next" >> "$GITHUB_OUTPUT"
7171
72-
# Updates package.json (but with no tag yet as it's not been committed)
73-
- run: npm version ${{ steps.bump_tag.outputs.next_version }} --no-git-tag-version
72+
# Updates package.json (but with no tag yet as it's not been committed)
73+
- run: npm version ${{ steps.bump_tag.outputs.next_version }} --no-git-tag-version
7474

75-
# 6. Commit + tag
76-
- name: Commit & tag
77-
run: |
78-
git config --local user.name "github-actions[bot]"
79-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
80-
git add package.json
81-
git add package-lock.json
82-
git commit -m "chore: bump version to ${{ steps.bump_tag.outputs.next_tag }}" || echo "nothing to commit"
83-
git tag ${{ steps.bump_tag.outputs.next_tag }}
75+
# 6. Commit + tag
76+
- name: Commit & tag
77+
run: |
78+
git config --local user.name "github-actions[bot]"
79+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
80+
git add package.json
81+
git add package-lock.json
82+
git commit -m "chore: bump version to ${{ steps.bump_tag.outputs.next_tag }}" || echo "nothing to commit"
83+
git tag ${{ steps.bump_tag.outputs.next_tag }}
8484
85-
- run: |
86-
git push origin HEAD:${GITHUB_REF#refs/heads/}
87-
git push origin ${{ steps.bump_tag.outputs.next_tag }}
88-
env:
89-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
85+
- run: |
86+
git push origin HEAD:${GITHUB_REF#refs/heads/}
87+
git push origin ${{ steps.bump_tag.outputs.next_tag }}
88+
env:
89+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
9090
91-
- name: Create GitHub release
92-
uses: ncipollo/release-action@v1
93-
with:
94-
tag: ${{ steps.bump_tag.outputs.next_tag }}
95-
generateReleaseNotes: true
96-
# Because workflows cannot be triggered from other workflows using the
97-
# default "GITHUB_TOKEN", we need the elevated token from the installed
98-
# GitHub App. See more:
99-
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
100-
token: ${{ steps.app-token.outputs.token }}
91+
- name: Create GitHub release
92+
uses: ncipollo/release-action@v1
93+
with:
94+
tag: ${{ steps.bump_tag.outputs.next_tag }}
95+
generateReleaseNotes: true
96+
# Because workflows cannot be triggered from other workflows using the
97+
# default "GITHUB_TOKEN", we need the elevated token from the installed
98+
# GitHub App. See more:
99+
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow
100+
token: ${{ steps.app-token.outputs.token }}

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.ts
2+
*.mts
3+
*.js
4+
*.cjs
5+
*.mjs
6+
*.css
7+
*.json
8+
*.jsonc

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ npm run test
3333
```
3434

3535
# Submitting Contributions
36-

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ server.addTool({
5151
validator: new ZodValidator(
5252
z.object({
5353
a: z.number().describe("First number"),
54-
b: z.number().describe("Second number")
55-
})
54+
b: z.number().describe("Second number"),
55+
}),
5656
),
5757
handler: async ({ a, b }) => ({
5858
content: [{ type: "text", text: String(a + b) }],
5959
isError: false,
60-
})
60+
}),
6161
});
6262
```
6363

6464
3. Wire up your MCP server with a transport:
6565

6666
```ts
67-
const transport = new HTTPStreamableTransport()
67+
const transport = new HTTPStreamableTransport();
6868
await transport.connect();
6969

7070
server.withTransport(transport);

examples/servers/use-spec-types/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ npm i
99
npm run build
1010
npm run start
1111
```
12-

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "tsc",
88
"test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" npx jest",
99
"lint": "npx @biomejs/[email protected] check src/",
10-
"lint:fix": "npx @biomejs/[email protected] check src/ --fix",
10+
"lint:fix": "npx @biomejs/[email protected] check src/ --fix && prettier format . --write",
1111
"lint:fix-unsafe": "npx @biomejs/[email protected] check src/ --fix --unsafe",
1212
"format": "npx @biomejs/[email protected] format src/ --write"
1313
},
@@ -93,6 +93,7 @@
9393
"@types/jest": "^29.5.14",
9494
"@types/node": "^22.15.14",
9595
"jest": "^29.7.0",
96+
"prettier": "^3.6.2",
9697
"ts-jest": "^29.3.2",
9798
"ts-node": "^10.9.2",
9899
"typescript": "^5.8.3"

0 commit comments

Comments
 (0)