Schedule posts to Bluesky with Cloudflare workers. skyscheduler.work
cf tool bsky-tool cloudflare bluesky schedule bsky service social-media cloudflare-workers

add better directing of script paths

min vs not

+9 -4
+2 -2
src/layout/main.tsx
··· 2 2 import { Child } from 'hono/jsx'; 3 3 import MetaTags from './metaTags'; 4 4 import { PreloadRules } from '../types.d'; 5 - import { CURRENT_SCRIPT_VERSION } from '../limits.d'; 5 + import { CURRENT_SCRIPT_VERSION, USE_SCRIPT_MIN } from '../limits.d'; 6 6 7 7 type BaseLayoutProps = { 8 8 children: Child; ··· 35 35 <script type="text/javascript" src="/dep/toastify.js"></script> 36 36 <link rel="stylesheet" href="/dep/pico.min.css" /> 37 37 <link rel="stylesheet" href="/css/stylesheet.css" /> 38 - <script type="text/javascript" src="/js/main.min.js?v=${CURRENT_SCRIPT_VERSION}"></script> 38 + <script type="text/javascript" src="/js/main${USE_SCRIPT_MIN}.js?v=${CURRENT_SCRIPT_VERSION}"></script> 39 39 <title>${title}</title> 40 40 ${<MetaTags />} 41 41 </head>
+2 -2
src/layout/makePost.tsx
··· 3 3 MAX_REPOST_INTERVAL_LIMIT, MAX_REPOST_IN_HOURS, BSKY_VIDEO_MAX_DURATION, 4 4 BSKY_IMG_FILE_EXTS, BSKY_VIDEO_FILE_EXTS, BSKY_IMG_SIZE_LIMIT_IN_MB, 5 5 R2_FILE_SIZE_LIMIT_IN_MB, MAX_THUMBNAIL_SIZE, 6 - CURRENT_SCRIPT_VERSION } from "../limits.d" 6 + CURRENT_SCRIPT_VERSION, USE_SCRIPT_MIN } from "../limits.d" 7 7 import { PreloadRules } from "../types.d"; 8 8 import { ConstScript, ConstScriptPreload } from "./constScript"; 9 9 ··· 17 17 ]; 18 18 19 19 export function PostCreation() { 20 - const postHelperScriptStr: string = `/js/postHelper.min.js?v=${CURRENT_SCRIPT_VERSION}`; 20 + const postHelperScriptStr: string = `/js/postHelper${USE_SCRIPT_MIN}.js?v=${CURRENT_SCRIPT_VERSION}`; 21 21 const bskyImageLimits = `Max file size of ${BSKY_IMG_SIZE_LIMIT_IN_MB}MB`; 22 22 return ( 23 23 <section>
+5
src/limits.d.ts
··· 26 26 // for the runtime scripts (ex: main.js & postHelper.js) 27 27 export const CURRENT_SCRIPT_VERSION: string = "1.2.4"; 28 28 29 + // empty this string if you want to serve the full scripts 30 + // scripts have to be minimized by hand because I was lazy when I wrote them 31 + // I used https://minify-js.com/ 32 + export const USE_SCRIPT_MIN: string = ".min"; 33 + 29 34 /** INTERNAL LIMITS, DO NOT CHANGE **/ 30 35 // Maximums used internally, do not change these directly. 31 36 export const MAX_REPOST_INTERVAL_LIMIT: number = MAX_REPOST_INTERVAL + 1;