Skip to content

Commit dc89532

Browse files
committed
chore: update api and change pnpm to bun
1 parent 2ddb7c4 commit dc89532

17 files changed

+3237
-13678
lines changed

.github/workflows/autofix.yml

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818

19-
- name: Install pnpm
20-
uses: pnpm/action-setup@v4
19+
- name: Install Bun
20+
uses: oven-sh/setup-bun@v2
21+
with:
22+
bun-version: latest
2123

2224
- name: Set up Node.js
2325
uses: actions/setup-node@v4
2426
with:
25-
node-version: 22
26-
cache: pnpm
27+
node-version: lts/*
2728

2829
- name: Install dependencies
29-
run: pnpm install
30+
run: bun install
3031

3132
- name: Run TypeScript checks
32-
run: pnpm typecheck
33+
run: bun typecheck
3334

3435
- name: Run AutoFix
3536
uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef

.github/workflows/lint.yml

+9-8
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919

20-
- name: Install pnpm
21-
uses: pnpm/action-setup@v4
20+
- name: Install Bun
21+
uses: oven-sh/setup-bun@v2
22+
with:
23+
bun-version: latest
2224

23-
- name: Use Node.js
25+
- name: Set up Node.js
2426
uses: actions/setup-node@v4
2527
with:
26-
node-version: 22
27-
cache: pnpm
28+
node-version: lts/*
2829

2930
- name: Install Dependencies
30-
run: pnpm install
31+
run: bun install
3132

3233
- name: Lint
33-
run: pnpm lint
34+
run: bun lint
3435

3536
- name: Lint Fix
36-
run: pnpm lint:fix
37+
run: bun lint:fix

.github/workflows/nuxthub.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ on: push
33

44
jobs:
55
deploy:
6-
name: "Deploy to NuxtHub"
6+
name: 'Deploy to NuxtHub'
77
runs-on: ubuntu-latest
88
environment:
9-
name: ${{ github.ref == 'refs/heads/production' && 'production' || 'preview' }}
9+
name:
10+
${{ github.ref == 'refs/heads/production' && 'production' || 'preview'
11+
}}
1012
url: ${{ steps.deploy.outputs.deployment-url }}
1113
permissions:
1214
contents: read
@@ -15,23 +17,24 @@ jobs:
1517
steps:
1618
- uses: actions/checkout@v4
1719

18-
- name: Install pnpm
19-
uses: pnpm/action-setup@v4
20+
- name: Install Bun
21+
uses: oven-sh/setup-bun@v2
22+
with:
23+
bun-version: latest
2024

21-
- name: Install Node.js
25+
- name: Set up Node.js
2226
uses: actions/setup-node@v4
2327
with:
24-
node-version: 22
25-
cache: 'pnpm'
28+
node-version: lts/*
2629

2730
- name: Install dependencies
28-
run: pnpm install
31+
run: bun install
2932

3033
- name: Ensure NuxtHub module is installed
31-
run: pnpx nuxthub@latest ensure
34+
run: bunx nuxthub@latest ensure
3235

3336
- name: Build application
34-
run: pnpm build
37+
run: bun run build
3538

3639
- name: Deploy to NuxtHub
3740
uses: nuxt-hub/action@v1

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ logs
2323
.env.*
2424
!.env.example
2525
.vercel
26+
27+
.wrangler

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm commitlint --edit
1+
bun commitlint --edit

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm prettier
1+
bun prettier

app/components/App/Navbar.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const items = [
99
},
1010
{ name: 'Bookmarks', path: '/bookmarks', icon: 'solar:bookmark-linear' },
1111
{ name: 'Books', path: '/books', icon: 'solar:book-minimalistic-outline' },
12-
{ name: 'Uses', path: '/uses', icon: 'solar:backpack-outline' }
12+
{ name: 'Uses', path: '/uses', icon: 'solar:backpack-outline' },
13+
{ name: 'Notes', path: '/notes', icon: 'solar:document-outline' }
1314
]
1415
</script>
1516

app/pages/books.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ const fetchBooks = async () => {
2727
isLoading.value = true
2828
2929
try {
30-
const data = await $fetch<{
30+
const data = await useFetch<{
3131
results: NotionPage[]
3232
has_more: boolean
3333
next_cursor: string | null
34-
}>('https://api-mybooks.tuanductran-dev-f18.workers.dev', {
35-
params: {
34+
}>('/api/books', {
35+
query: {
3636
page_size: pageSize.value,
3737
start_cursor: startCursor.value || undefined
3838
}
39-
})
39+
}).then(res => res.data.value)
4040
4141
if (data?.results) {
4242
books.value.push(...data.results)

app/pages/notes.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@ const fetchNotes = async () => {
2727
isLoading.value = true
2828
2929
try {
30-
const data = await $fetch<{
30+
const data = await useFetch<{
3131
results: NotionPage[]
3232
has_more: boolean
3333
next_cursor: string | null
34-
}>('https://api-mynotes.tuanductran-dev-f18.workers.dev', {
35-
params: {
34+
}>('/api/notes', {
35+
query: {
3636
page_size: pageSize.value,
3737
start_cursor: startCursor.value || undefined
3838
}
39-
})
39+
}).then(res => res.data.value)
4040
4141
if (data?.results) {
4242
notes.value.push(...data.results)

bun.lock

+3,051
Large diffs are not rendered by default.

nuxt.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ export default defineNuxtConfig({
1717
'@nuxthub/core'
1818
],
1919

20+
hub: {
21+
cache: true
22+
},
23+
2024
app: {
2125
head: {
2226
htmlAttrs: {

package.json

+25-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
{
22
"name": "nuxt-content-blog",
3+
"version": "1.0.0",
4+
"description": "A modern, user-friendly blog built with Nuxt Content and optimized for performance",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/tuanductran/nuxt-content-blog.git"
8+
},
9+
"bugs": {
10+
"url": "https://github.com/tuanductran/nuxt-content-blog/issues"
11+
},
12+
"author": "Tuan Duc Tran <tuanductran.dev@gmail.com>",
13+
"license": "MIT",
314
"private": true,
4-
"packageManager": "pnpm@10.6.2",
15+
"packageManager": "bun@1.2.5",
16+
"keywords": [
17+
"nuxt",
18+
"content",
19+
"blog",
20+
"vue",
21+
"ssg",
22+
"markdown"
23+
],
524
"scripts": {
625
"build": "nuxi build",
726
"check:md": "node ./scripts/check-md.mjs",
@@ -14,7 +33,8 @@
1433
"lint:text": "case-police",
1534
"lint:text:fix": "case-police --fix",
1635
"postinstall": "nuxi prepare || husky",
17-
"prettier": "concurrently \"pnpm lint:fix\" \"pnpm lint:text:fix\" \"pnpm lint:prettier:fix\"",
36+
"preinstall": "npx only-allow bun",
37+
"prettier": "concurrently \"bun lint:fix\" \"bun lint:text:fix\" \"bun lint:prettier:fix\"",
1838
"preview": "nuxi preview",
1939
"typecheck": "vue-tsc --noEmit"
2040
},
@@ -51,13 +71,7 @@
5171
"vue-tsc": "^2.2.8",
5272
"wrangler": "^3.112.0"
5373
},
54-
"pnpm": {
55-
"onlyBuiltDependencies": [
56-
"@parcel/watcher",
57-
"better-sqlite3",
58-
"esbuild",
59-
"sharp",
60-
"workerd"
61-
]
62-
}
74+
"trustedDependencies": [
75+
"@parcel/watcher"
76+
]
6377
}

0 commit comments

Comments
 (0)