xinyu-pro 0.22.0 → 0.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,8 @@ import { NextRequest, NextResponse } from 'next/server';
2
2
  import { execute } from '@/lib/db';
3
3
  import { ensureDb } from '@/lib/db-init';
4
4
 
5
+ export const dynamic = 'force-dynamic';
6
+
5
7
  const SETTINGS_KEY = 'app_settings';
6
8
 
7
9
  export async function GET() {
package/lib/db.ts CHANGED
@@ -14,7 +14,9 @@ async function ensureDb(): Promise<SqlJsDatabase> {
14
14
  if (db) return db;
15
15
  if (!initPromise) {
16
16
  initPromise = (async () => {
17
- if (!SQL) SQL = await initSqlJs();
17
+ if (!SQL) SQL = await initSqlJs({
18
+ locateFile: (file: string) => join(process.cwd(), 'public', file),
19
+ });
18
20
  const dbPath = getDbPath();
19
21
  if (existsSync(dbPath)) {
20
22
  const buffer = readFileSync(dbPath);
package/next.config.mjs CHANGED
@@ -6,6 +6,12 @@ const nextConfig = {
6
6
  typescript: {
7
7
  ignoreBuildErrors: true,
8
8
  },
9
+ webpack: (config, { isServer }) => {
10
+ if (isServer) {
11
+ config.externals = [...(Array.isArray(config.externals) ? config.externals : []), 'sql.js'];
12
+ }
13
+ return config;
14
+ },
9
15
  async headers() {
10
16
  const cspValue = [
11
17
  "default-src 'self'",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xinyu-pro",
3
- "version": "0.22.0",
3
+ "version": "0.22.1",
4
4
  "private": false,
5
5
  "description": "星语 Pro - AI 驱动的互动叙事平台",
6
6
  "author": "RestRegular",
Binary file
package/version.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.22.0",
2
+ "version": "0.22.1",
3
3
  "name": "xinyu-pro",
4
4
  "displayName": "星语 Pro",
5
5
  "description": "AI 驱动的互动叙事平台"