@foldspace-fe/casdoor-next-auth-kit 0.1.11 → 0.1.12

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.
@@ -9,6 +9,25 @@ metadata:
9
9
 
10
10
  本 skill 用于维护可复用的 `@foldspace-fe/casdoor-next-auth-kit` 认证套件仓库,以及消费该套件的宿主项目。当用户需要修改认证流程、路由壳模板、React 认证钩子、或执行宿主项目的 skill 安装流程时,应激活此 skill。
11
11
 
12
+ ### 修改前必读
13
+
14
+ 在改下面这些内容之前,先确认当前行为、生成结果和文档说明都已对齐:
15
+
16
+ - `packages/auth-kit/src/cli/templates.ts`
17
+ - `packages/auth-kit/src/cli/operations.ts`
18
+ - `packages/auth-kit/src/billing/*`
19
+ - `packages/auth-kit/src/core/env.ts`
20
+ - `docs/billing/*`
21
+ - `skills/casdoor-next-auth-kit/SKILL.md`
22
+
23
+ 如果修改会影响生成文件,必须先回答这三个问题:
24
+
25
+ 1. `npx @foldspace-fe/casdoor-next-auth-kit@latest init` 还能不能生成完整文件
26
+ 2. `npx @foldspace-fe/casdoor-next-auth-kit@latest update` 会不会删除旧文件、补齐新文件并保持可编译
27
+ 3. `pnpm build` 后宿主能不能直接 `next build`
28
+
29
+ 如果任一答案不确定,先补齐实现和文档,再继续改需求。
30
+
12
31
  ## 源码仓库
13
32
 
14
33
  - 仓库路径:`/root/projects/foldspace-stack/casdoor-next-auth-kit`
@@ -383,6 +402,12 @@ Billing 支付成功后,Casdoor 会回跳到宿主站内的两个固定回调
383
402
 
384
403
  宿主可以直接改这两个默认生成文件里的 custom block 来完成订单补全、Webhook 钩子、积分发放和最终跳转,而不需要额外手工创建 `@/lib/billing/*`。
385
404
 
405
+ 默认生成的 billing handler 文件必须保持“拿来就能编译”,文件里如果没有业务逻辑,也要保留可运行的空实现和明确日志,不允许生成只写注释或只留导入的半成品。
406
+
407
+ `app/(auth-kit)/auth-config.ts` 必须显式导出 `authKitConfig`、`adapter`、`persistence`、`paymentSuccessHandler` 和 `paymentFinishedHandler`,route 文件必须能直接从这个文件拿到所需配置和 handler,不要只保留局部变量让 route 间接取值。
408
+
409
+ billing 默认就是受管内容,CLI 必须同时生成 `lib/billing/payment-success.ts` 和 `lib/billing/payment-finished.ts`,`auth-config.ts` 直接导入这两个默认文件,不要要求宿主手工创建 `@/lib/billing/*`。
410
+
386
411
  如果默认处理器没有写入业务逻辑,路由仍会打印日志并回退到默认落点:
387
412
 
388
413
  - success 路由默认回退到 `/auth/payment/finished`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldspace-fe/casdoor-next-auth-kit",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {