Skip to content

Instantly share code, notes, and snippets.

View Innei's full-sized avatar
💭
Coding with cloud.

Innei Innei

💭
Coding with cloud.
View GitHub Profile
@Innei
Innei / 01-nextjs-vite-spa-migration.md
Created February 25, 2026 11:58
LobeChat SPA Migration Plans

Migration Plan: Next.js App Router → Vite + React Router SPA

Context

LobeChat 前端已基本完成 React Router 迁移(231 文件),src/libs/next/ 已预置抽象层。但 next dev 编译 20s+、内存 8-12G+,严重影响开发效率。本计划将前端构建从 Next App Router 迁至 Vite SPA,后端保留 Next.js。

核心架构决策

  • RouteVariants 机制:删除
  • Locale/Mobile:Vite 分两次 build 分别产出 desktop bundle 和 mobile bundle(通过 define: { __MOBILE__: true/false } 注入)。Locale 不由服务端注入,而是在 index.html 中插入前置 script 从 cookie(LOBE_LOCALE)读取并设置到 document.documentElement.lang。Next.js catch-all route 仅注入 serverConfig
@Innei
Innei / CLAUDE.md
Last active January 30, 2026 15:08
CLAUDE.md

CLAUDE RULES

Git

  • Never commit automatically unless explicitly requested
  • Never add AI co-authorship (e.g., "Co-Authored-By: Claude")

Security

  • Never read or access .env files
#!/usr/bin/env -S npx tsx
import { execSync } from 'node:child_process';
import { existsSync } from 'node:fs';
import { mkdir, readdir, symlink } from 'node:fs/promises';
import { dirname, join, relative } from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
@Innei
Innei / follow.md
Created July 11, 2025 11:35
CLAUDE rules

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Follow (Folo) is a modern RSS aggregator and content management platform with multiple applications across different platforms. It's built as a monorepo using pnpm workspaces with Turbo for build orchestration.

Repository Structure

@Innei
Innei / patch.diff
Created December 23, 2024 06:13
patch next@v14 ssr render issue
diff --git a/dist/build/webpack/loaders/next-flight-loader/index.js b/dist/build/webpack/loaders/next-flight-loader/index.js
index 34d196104da9e95a5d6d6202cc4739b10b3922e3..1c2d9faa02c8de84d0a18fa800ac6c6a1f69c174 100644
--- a/dist/build/webpack/loaders/next-flight-loader/index.js
+++ b/dist/build/webpack/loaders/next-flight-loader/index.js
@@ -57,6 +57,8 @@ function transformSource(source, sourceMap) {
if (typeof source !== "string") {
throw new Error("Expected source to have been transformed to a string.");
}
+ const options = this.getOptions()
+ const { isEdgeServer } = options
@Innei
Innei / overtime_commits.ts
Last active September 22, 2024 11:40
Calculation of overtime and vacation hours
import { execSync } from "node:child_process"
import fs from "node:fs"
import dayjs, { Dayjs } from "dayjs"
import customParseFormat from "dayjs/plugin/customParseFormat.js"
import isSameOrAfter from "dayjs/plugin/isSameOrAfter.js"
import isSameOrBefore from "dayjs/plugin/isSameOrBefore.js"
import weekday from "dayjs/plugin/weekday.js"
dayjs.extend(customParseFormat)
@Innei
Innei / init.lua
Created July 24, 2023 14:31
map-hjkl
local function pressFn(mods, key)
if key == nil then
key = mods
mods = {}
end
return function() hs.eventtap.keyStroke(mods, key, 1000) end
end
local function remap(mods, key, pressFn)
@Innei
Innei / colors.ts
Created June 10, 2023 05:38
UIKit Colors and materials
const UIKitColors = {
red: {
light: '#FF3B30',
dark: '#FF453A',
},
orange: {
light: '#FF9500',
dark: '#FF9F0A',
},
@Innei
Innei / xlog.css
Created April 29, 2023 01:58
xlog.css
@import url("https://cdnjs.cloudflare.com/ajax/libs/lxgw-wenkai-screen-webfont/1.7.0/lxgwwenkaiscreenr.css");
.xlog-page-index, .xlog-page-post {
font-family: "LXGW WenKai Screen R", sans-serif;
}
@font-face {
font-family: SFCompactRounded;
font-weight: 300;
src: url(https://ipfs.4everland.xyz/ipfs/bafybeidme3gx5cgofwznbtccc7vnfi2acecdzaiy7yfcjyq4e3qgzqwzem);
@Innei
Innei / box
Last active July 27, 2023 23:02
PS Box
Ghost of Tsushima 25 hrs 2 mins █████▏░░░░░░░ 40%
Ratchet & Clan... 22 hrs 29 mins █████████████ 100%
DEATH STRANDING™ 18 hrs 41 mins █████████▏░░░ 71%
SCARLET NEXUS 17 hrs 27 mins ████▊░░░░░░░░ 37%
UNCHARTED: Leg... 16 hrs 42 mins █▊░░░░░░░░░░░ 14%