Skip to content

Commit 7e62455

Browse files
committed
Merge branch 'worker'
2 parents 76e4022 + 5c558fb commit 7e62455

File tree

22 files changed

+5046
-5483
lines changed

22 files changed

+5046
-5483
lines changed

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.11.0
1+
22.15.1

README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Site Token: SinkCool
7474
- **Framework**: [Nuxt](https://nuxt.com/)
7575
- **Database**: [Cloudflare Workers KV](https://developers.cloudflare.com/kv/)
7676
- **Analytics Engine**: [Cloudflare Workers Analytics Engine](https://developers.cloudflare.com/analytics/)
77-
- **UI Components**: [Shadcn-vue](https://www.shadcn-vue.com/)
77+
- **UI Components**: [shadcn-vue](https://www.shadcn-vue.com/)
7878
- **Styling:** [Tailwind CSS](https://tailwindcss.com/)
7979
- **Deployment**: [Cloudflare](https://www.cloudflare.com/)
8080

@@ -94,31 +94,12 @@ We welcome your contributions and PRs.
9494
- [ ] Analytics Enhancements (Support for merging filter conditions)
9595
- [ ] Dashboard Performance Optimization (Infinite loading)
9696
- [ ] Units Test
97-
- [ ] Support for Other Deployment Platforms
9897

9998
## 🏗️ Deployment
10099

101100
> Video tutorial: [Watch here](https://www.youtube.com/watch?v=MkU23U2VE9E)
102101
103-
1. [Fork](https://github.com/ccbikai/Sink/fork) the repository to your GitHub account.
104-
2. Create a project in [Cloudflare Pages](https://developers.cloudflare.com/pages/).
105-
3. Select the `Sink` repository and choose the `Nuxt.js` preset.
106-
4. Configure the following environment variables:
107-
- `NUXT_SITE_TOKEN`: Must be longer than **8** characters. This token grants access to your dashboard.
108-
- `NUXT_CF_ACCOUNT_ID`: Locate your [account ID](https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/).
109-
- `NUXT_CF_API_TOKEN`: Create a [Cloudflare API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with at least `Account.Account Analytics` permissions. [See reference.](https://developers.cloudflare.com/analytics/analytics-engine/sql-api/#authentication)
110-
111-
5. Save and deploy the project.
112-
6. Cancel the deployment, then navigate to **Settings** -> **Bindings** -> **Add**:
113-
- **KV Namespace**: Bind the variable name `KV` to a [KV namespace](https://developers.cloudflare.com/kv/) (create a new one under **Storage & Databases** -> **KV**).
114-
- **Workers AI** (_Optional_): Bind the variable name `AI` to the Workers AI Catalog.
115-
- **Analytics Engine**:
116-
- In **Workers & Pages**, go to **Account details** on the right side, find `Analytics Engine`, and click `Set up` to enable the free version.
117-
- Return to **Settings** -> **Bindings** -> **Add** and select **Analytics engine**.
118-
- Bind the variable name `ANALYTICS` to the `sink` dataset.
119-
120-
7. Redeploy the project.
121-
8. Update code, refer to the official GitHub documentation [Syncing a fork branch from the web UI](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork#syncing-a-fork-branch-from-the-web-ui).
102+
We currently support deployment to [Cloudflare Workers](./docs/deployment/workers.md) (recommended) and [Cloudflare Pages](./docs/deployment/pages.md).
122103

123104
## ⚒️ Configuration
124105

@@ -128,6 +109,32 @@ We welcome your contributions and PRs.
128109

129110
[API Docs](./docs/api.md)
130111

112+
## 🧰 MCP
113+
114+
We currently do not support native MCP Server, but we have OpenAPI documentation, and you can use the following method to support MCP.
115+
116+
> Replace the domain name in `OPENAPI_SPEC_URL` with your own domain name.
117+
>
118+
> The `API_KEY` is the same as the `NUXT_SITE_TOKEN` in the environment variables.
119+
120+
```json
121+
{
122+
"mcpServers": {
123+
"sink": {
124+
"command": "uvx",
125+
"args": [
126+
"mcp-openapi-proxy"
127+
],
128+
"env": {
129+
"OPENAPI_SPEC_URL": "https://sink.cool/_docs/openapi.json",
130+
"API_KEY": "SinkCool",
131+
"TOOL_WHITELIST": "/api/link/create"
132+
}
133+
}
134+
}
135+
}
136+
```
137+
131138
## 🙋🏻 FAQs
132139

133140
[FAQs](./docs/faqs.md)

app/components/dashboard/analysis/metrics/Locations.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup>
2-
import { ChartTooltip } from '@/components/ui/chart'
32
import { VisSingleContainer, VisTopoJSONMap, VisTopoJSONMapSelectors } from '@unovis/vue'
3+
import { ChartTooltip } from '@/components/ui/chart'
44
55
const id = inject('id')
66
const time = inject('time')

app/components/dashboard/links/Editor.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<script setup>
2-
import { DependencyType } from '@/components/ui/auto-form/interface'
32
import { LinkSchema, nanoid } from '@@/schemas/link'
43
import { toTypedSchema } from '@vee-validate/zod'
54
import { Shuffle, Sparkles } from 'lucide-vue-next'
65
import { useForm } from 'vee-validate'
76
import { toast } from 'vue-sonner'
87
import { z } from 'zod'
8+
import { DependencyType } from '@/components/ui/auto-form/interface'
99
1010
const props = defineProps({
1111
link: {

app/components/home/Hero.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup>
2-
import heroImg from '@/assets/images/hero.svg?raw'
32
import { AreaChart } from 'lucide-vue-next'
43
import { GitHubIcon } from 'vue3-simple-icons'
4+
import heroImg from '@/assets/images/hero.svg?raw'
55
66
const { title, description, github } = useAppConfig()
77
</script>

app/components/spark-ui/AnimatedList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts" setup>
2-
import { cn } from '@/lib/utils'
32
import { computed, onMounted, ref, useSlots } from 'vue'
3+
import { cn } from '@/lib/utils'
44
55
const props = withDefaults(defineProps<{
66
class?: string

app/utils/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { type ClassValue, clsx } from 'clsx'
1+
import type { ClassValue } from 'clsx'
2+
import { clsx } from 'clsx'
23
import { twMerge } from 'tailwind-merge'
34

45
export function cn(...inputs: ClassValue[]) {

app/utils/time.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { type DateValue, fromAbsolute, toCalendarDate } from '@internationalized/date'
1+
import type { DateValue } from '@internationalized/date'
2+
import { fromAbsolute, toCalendarDate } from '@internationalized/date'
23

34
export function getTimeZone() {
45
if (typeof Intl === 'undefined')

components.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
},
1111
"aliases": {
1212
"components": "@/components",
13-
"utils": "@/utils"
13+
"utils": "@/utils",
14+
"ui": "@/components/ui",
15+
"lib": "@/lib",
16+
"composables": "@/composables"
1417
}
1518
}

docs/deployment/pages.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Deployment on Cloudflare Pages
2+
3+
1. [Fork](https://github.com/ccbikai/Sink/fork) the repository to your GitHub account.
4+
2. Create a project in [Cloudflare Pages](https://developers.cloudflare.com/pages/).
5+
3. Select the `Sink` repository and choose the `Nuxt.js` preset.
6+
4. Configure the following environment variables:
7+
- `NUXT_SITE_TOKEN`: Must be at least **8** characters long. This token grants access to your dashboard.
8+
- `NUXT_CF_ACCOUNT_ID`: Find your [account ID](https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/).
9+
- `NUXT_CF_API_TOKEN`: Create a [Cloudflare API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with at least `Account.Account Analytics` permission. [See reference.](https://developers.cloudflare.com/analytics/analytics-engine/sql-api/#authentication)
10+
11+
5. Save and deploy the project.
12+
6. Cancel the deployment, then go to **Settings** -> **Bindings** -> **Add**:
13+
- **KV Namespace**: Bind the variable name `KV` to a [KV namespace](https://developers.cloudflare.com/kv/) (create a new one under **Storage & Databases** -> **KV**).
14+
- **Workers AI** (_Optional_): Bind the variable name `AI` to the Workers AI Catalog.
15+
- **Analytics Engine**:
16+
- In **Workers & Pages**, go to **Account details** in the right panel, locate `Analytics Engine`, and click `Set up` to enable the free tier.
17+
- Return to **Settings** -> **Bindings** -> **Add** and select **Analytics engine**.
18+
- Bind the variable name `ANALYTICS` to the `sink` dataset.
19+
20+
7. Add Compatibility flags
21+
- Go to **Settings** -> **Runtime** -> **Compatibility flags** and set the following flags `nodejs_compat`.
22+
8. Redeploy the project.
23+
9. To update code, refer to the official GitHub documentation [Syncing a fork branch from the web UI](https://docs.github.com/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork#syncing-a-fork-branch-from-the-web-ui).

0 commit comments

Comments
 (0)