Skip to content

Commit d6ec31e

Browse files
committed
feat: get sqlite to work on raycast env
1 parent 6a5fa1f commit d6ec31e

39 files changed

+7131
-1684
lines changed

apps/raycast-ntfy/.aliases

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
DB_PATH="./ntfy.db"
2+
ASSETS_PATH="./assets"
3+
SCRIPTS_PATH="./scripts"
4+
5+
alias setup="npx tsx $SCRIPTS_PATH/setup.ts"
6+
7+
function db() {
8+
if [ "$1" = "clear" ]; then
9+
if [ "$2" = "mig" ]; then
10+
rm -rf $ASSETS_PATH/drizzle
11+
else
12+
rm -rf $DB_PATH*
13+
fi
14+
elif [ "$1" = "gen" ]; then
15+
npx drizzle-kit generate
16+
elif [ "$1" = "seed" ]; then
17+
npx tsx $SCRIPTS_PATH/seed.ts
18+
elif [ "$1" = "reset" ]; then
19+
rm -rf $ASSETS_PATH/drizzle
20+
rm -rf $DB_PATH*
21+
npx drizzle-kit push --force
22+
npx tsx $SCRIPTS_PATH/seed.ts
23+
else
24+
npx drizzle-kit $*
25+
fi
26+
}

apps/raycast-ntfy/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ compiled_raycast_swift
1414

1515
# build
1616
dist
17+
18+
# sqlite
19+
*.db
20+
*.db-shm
21+
*.db-wal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["gruntfuggly.todo-tree"]
3+
}
+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"[javascript]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode"
6+
},
7+
"[javascriptreact]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"[json]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
},
13+
"[jsonc]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
16+
"[typescript]": {
17+
"editor.defaultFormatter": "esbenp.prettier-vscode"
18+
},
19+
"[typescriptreact]": {
20+
"editor.defaultFormatter": "esbenp.prettier-vscode"
21+
},
22+
"todo-tree.tree.scanMode": "workspace",
23+
"todo-tree.filtering.excludeGlobs": ["**/.vscode/settings.json"],
24+
"todo-tree.regex.enableMultiLine": true,
25+
"todo-tree.general.tags": [
26+
"[ ]",
27+
"[*]",
28+
"[!]",
29+
"[?]",
30+
"[-]",
31+
"[x]",
32+
"!",
33+
"!!",
34+
"?",
35+
"??",
36+
"BUG:",
37+
"HACK:",
38+
"FIXME:",
39+
"TODO:",
40+
"WIP:",
41+
"INFO:",
42+
"DB:",
43+
"MIGRATION:"
44+
],
45+
"todo-tree.regex.regex": "(//\\s($TAGS)|<!--\\s($TAGS)|/\\*\\s($TAGS)|(?:^\\s*\\*\\s($TAGS))|#\\s($TAGS)|--\\s($TAGS)|-\\s($TAGS)|-->\\s($TAGS))",
46+
"todo-tree.general.tagGroups": {
47+
"todo": ["TODO:", "WIP:", "[ ]"],
48+
"skip": ["[-]"],
49+
"done": ["[x]"],
50+
"warning": ["!", "!!", "[!]"],
51+
"error": ["BUG:", "HACK:", "FIXME:", "[*]"],
52+
"info": ["INFO:", "?", "??", "[?]"],
53+
"db": ["DB:", "MIGRATION:"],
54+
"debug": ["//"]
55+
},
56+
"todo-tree.highlights.customHighlight": {
57+
"db": {
58+
"icon": "database",
59+
"type": "line",
60+
"foreground": "#33FFFF",
61+
"iconColour": "#33FFFF",
62+
"gutterIcon": true
63+
},
64+
"warning": {
65+
"icon": "alert-fill",
66+
"type": "line",
67+
"foreground": "#FFFF00",
68+
"iconColour": "#FFFF00",
69+
"gutterIcon": true
70+
},
71+
"info": {
72+
"icon": "comment",
73+
"type": "line",
74+
"foreground": "#33FFFF",
75+
"iconColour": "#33FFFF",
76+
"gutterIcon": true
77+
},
78+
"todo": {
79+
"icon": "square",
80+
"type": "tag",
81+
"iconColour": "#FFFF00",
82+
"foreground": "#FFFF00",
83+
"gutterIcon": true
84+
},
85+
"skip": {
86+
"icon": "clock",
87+
"type": "tag",
88+
"iconColour": "#FFAA00",
89+
"foreground": "#FFAA00",
90+
"gutterIcon": true
91+
},
92+
"done": {
93+
"icon": "check",
94+
"type": "line",
95+
"textDecoration": "line-through",
96+
"iconColour": "#33FF33",
97+
"foreground": "#33FF33",
98+
"gutterIcon": true
99+
},
100+
"error": {
101+
"icon": "bug",
102+
"type": "line",
103+
"foreground": "#FF2D00",
104+
"iconColour": "#FF2D00",
105+
"gutterIcon": true
106+
}
107+
}
108+
}

apps/raycast-ntfy/WIP.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Work In Progress
2+
3+
Some kind of organization so I can focus better
4+
5+
## Doing
6+
7+
Current work
8+
9+
- [ ] Configure multiple servers/topics
10+
- [x] Get SQLite to work
11+
- [ ] Add default server and topic on init/setup
12+
- [ ] List servers and topics
13+
- [ ] Manage servers and topics
14+
15+
## To Do
16+
17+
Tasks that matured for doing
18+
19+
- [ ] Read/receive notifications on Raycast
20+
- [ ] Fetch messages and store in DB
21+
- [ ] List messages
22+
23+
## Backlog
24+
25+
Ideas that need to mature
26+
27+
- [ ] Better customization of the notification via UI
28+
- [-] Sending attachment files through the notification
29+
- [-] Contribute to [ntfy.sh][ntfy]:
30+
- [ ] Add support for [android intent/activity][android-intent], so we can trigger share activities and possibly more
31+
32+
## Done
33+
34+
Tasks completed
35+
36+
- [x] Ship to store
37+
38+
## Graveyard
39+
40+
Tasks that were discarded
41+
42+
[ntfy]: https://ntfy.sh/
43+
[android-intent]: https://developer.android.com/guide/components/intents-filters
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
CREATE TABLE `ntfy_messages` (
2+
`id` text PRIMARY KEY NOT NULL,
3+
`server_id` text NOT NULL,
4+
`topic_id` text NOT NULL,
5+
`message` text NOT NULL,
6+
`created_at` text DEFAULT CURRENT_TIMESTAMP NOT NULL,
7+
`updated_at` text,
8+
FOREIGN KEY (`server_id`) REFERENCES `ntfy_servers`(`id`) ON UPDATE no action ON DELETE no action,
9+
FOREIGN KEY (`topic_id`) REFERENCES `ntfy_topics`(`id`) ON UPDATE no action ON DELETE no action
10+
);
11+
--> statement-breakpoint
12+
CREATE TABLE `ntfy_servers` (
13+
`id` text PRIMARY KEY NOT NULL,
14+
`name` text NOT NULL,
15+
`description` text,
16+
`url` TEXT DEFAULT '"https://ntfy.sh/"' NOT NULL
17+
);
18+
--> statement-breakpoint
19+
CREATE UNIQUE INDEX `ntfy_servers_url_unique` ON `ntfy_servers` (`url`);--> statement-breakpoint
20+
CREATE TABLE `ntfy_topics` (
21+
`id` text PRIMARY KEY NOT NULL,
22+
`description` text,
23+
`topic` text NOT NULL,
24+
`server_id` text NOT NULL,
25+
FOREIGN KEY (`server_id`) REFERENCES `ntfy_servers`(`id`) ON UPDATE no action ON DELETE no action
26+
);

0 commit comments

Comments
 (0)