Fix: Revert manifest structure to working baseline (v0.3.15)
All checks were successful
Build SilverBullet Plug / build (push) Successful in 21s

This commit is contained in:
2026-02-17 14:53:30 -08:00
parent 17f6308585
commit 03907f3789
7 changed files with 39 additions and 43 deletions

View File

@@ -2,4 +2,4 @@ FROM denoland/deno:latest
WORKDIR /app
COPY . .
RUN deno run -A https://github.com/silverbulletmd/silverbullet/releases/download/2.4.1/plug-compile.js -c deno.json icalendar.plug.yaml
CMD ["cat", "Library/sstent/icalendar.plug.js"]
CMD ["cat", "icalendar.plug.js"]

View File

@@ -1,8 +1,8 @@
---
name: Library/sstent/icalendar
version: 0.3.14
name: Library/sstent/icalendar/PLUG
version: 0.3.15
tags: meta/library
files:
- icalendar.plug.js
---
iCalendar sync plug for SilverBullet.
iCalendar sync plug for SilverBullet.

File diff suppressed because one or more lines are too long

View File

@@ -1,8 +1,8 @@
---
name: Library/sstent/icalendar
version: 0.3.14
name: Library/sstent/icalendar/PLUG
version: 0.3.15
tags: meta/library
files:
- icalendar.plug.js
---
iCalendar sync plug for SilverBullet.
iCalendar sync plug for SilverBullet.

File diff suppressed because one or more lines are too long

View File

@@ -1,19 +1,28 @@
name: Library/sstent/icalendar
version: 0.3.14
name: icalendar
version: 0.3.15
author: sstent
index: icalendar.ts
permissions:
- http
functions:
syncCalendars:
path: icalendar.ts:syncCalendars
command: "iCalendar: Sync"
path: ./icalendar.ts:syncCalendars
command:
name: "iCalendar: Sync"
priority: -1
events:
- editor:init
forceSync:
path: icalendar.ts:forceSync
command: "iCalendar: Force Sync"
path: ./icalendar.ts:forceSync
command:
name: "iCalendar: Force Sync"
priority: -1
clearCache:
path: icalendar.ts:clearCache
command: "iCalendar: Clear Cache"
path: ./icalendar.ts:clearCache
command:
name: "iCalendar: Clear All Events"
priority: -1
showVersion:
path: icalendar.ts:showVersion
command: "iCalendar: Show Version"
permissions:
- http
path: ./icalendar.ts:showVersion
command:
name: "iCalendar: Version"
priority: -2

View File

@@ -1,11 +1,9 @@
import { clientStore, config, datastore, editor, index } from "@silverbulletmd/silverbullet/syscalls";
import { convertIcsCalendar } from "https://esm.sh/ts-ics@2.4.0";
const VERSION = "0.3.14";
const VERSION = "0.3.15";
const CACHE_KEY = "icalendar:lastSync";
console.log(`[iCalendar] Plug script executing at top level (Version ${VERSION})`);
const TIMEZONE_OFFSETS: Record<string, number> = {
"GMT Standard Time": 0,
"W. Europe Standard Time": 1,
@@ -32,12 +30,8 @@ async function getSources(): Promise<{ sources: any[], tzShift: number }> {
}
async function fetchAndParseCalendar(source: any, hourShift = 0): Promise<any[]> {
console.log(`[iCalendar] Fetching from ${source.url}`);
const response = await fetch(source.url);
if (!response.ok) {
console.error(`[iCalendar] Fetch failed with status ${response.status}`);
return [];
}
if (!response.ok) return [];
const text = await response.text();
const calendar = convertIcsCalendar(undefined, text);
if (!calendar.events) return [];
@@ -70,13 +64,9 @@ async function fetchAndParseCalendar(source: any, hourShift = 0): Promise<any[]>
}
export async function syncCalendars() {
console.log(`[iCalendar] syncCalendars command triggered`);
try {
const { sources, tzShift } = await getSources();
if (sources.length === 0) {
await editor.flashNotification("No calendar sources configured", "warn");
return;
}
if (sources.length === 0) return;
await editor.flashNotification("Syncing calendars...", "info");
const allEvents: any[] = [];
for (const source of sources) {
@@ -95,13 +85,11 @@ export async function syncCalendars() {
}
export async function forceSync() {
console.log(`[iCalendar] forceSync command triggered`);
await clientStore.del(CACHE_KEY);
await syncCalendars();
}
export async function clearCache() {
console.log(`[iCalendar] clearCache command triggered`);
if (!await editor.confirm("Clear all calendar events?")) return;
const pageKeys = await datastore.query({ prefix: ["ridx", "$icalendar"] });
const allKeys: any[] = [];
@@ -115,6 +103,5 @@ export async function clearCache() {
}
export async function showVersion() {
console.log(`[iCalendar] showVersion command triggered`);
await editor.flashNotification(`iCalendar Plug ${VERSION}`, "info");
}
}