Skip to content

Commit

Permalink
Create Letterboxd Plugin for Kunkun
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyKLai authored and HuakunShen committed Sep 17, 2024
1 parent 1ed3745 commit 7eab90f
Show file tree
Hide file tree
Showing 7 changed files with 1,649 additions and 0 deletions.
15 changes: 15 additions & 0 deletions extensions/letterboxd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Letterboxd Plugin for Kunkun

To install dependencies:

```bash
bun install
```

To run:

```bash
bun run index.ts
```

Search for movies on Letterboxd, add to watchlist, log a film...
24 changes: 24 additions & 0 deletions extensions/letterboxd/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { watch } from "fs"
import { join } from "path"
import { refreshTemplateWorkerExtension } from "@kksh/api/dev"
import { $ } from "bun"

async function build() {
try {
await $`bun build --minify --target=browser --outdir=./dist ./src/index.ts`
await refreshTemplateWorkerExtension()
} catch (error) {
console.error(error)
}
}

const srcDir = join(import.meta.dir, "src")

await build()

if (Bun.argv.includes("dev")) {
console.log(`Watching ${srcDir} for changes...`)
watch(srcDir, { recursive: true }, async (event, filename) => {
await build()
})
}
53 changes: 53 additions & 0 deletions extensions/letterboxd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "https://schema.kunkun.sh",
"name": "letterboxd",
"version": "0.0.2",
"type": "module",
"kunkun": {
"name": "Letterboxd",
"shortDescription": "Letterboxd Integration for Kunkun",
"longDescription": "Search for movies on Letterboxd, add it to your watchlist, and more.",
"identifier": "letterboxd",
"permissions": [
"fetch:all",
{
"permission": "open:url",
"allow": [
{
"url": "https://letterboxd.com/**"
}
]
}
],
"demoImages": [],
"icon": {
"type": "iconify",
"value": "simple-icons:letterboxd"
},
"customUiCmds": [],
"templateUiCmds": [
{
"name": "Letterboxd",
"main": "dist/index.js",
"cmds": []
}
]
},
"scripts": {
"dev": "bun build.ts dev",
"build": "bun build.ts"
},
"dependencies": {
"@kksh/api": "0.0.12-beta.2"
},
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"files": [
"./dist",
".gitignore"
]
}
Loading

0 comments on commit 7eab90f

Please sign in to comment.