@autional-cn/shared 0.1.0-rc.1 → 0.1.0-rc.3
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.
- package/package.json +11 -12
- package/src/index.ts +11 -5
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autional-cn/shared",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.3",
|
|
4
4
|
"description": "Autional shared layer — API client, auth, types, hooks, utils",
|
|
5
|
+
"license": "AGPL-3.0",
|
|
5
6
|
"main": "./src/index.ts",
|
|
6
7
|
"module": "./src/index.ts",
|
|
7
8
|
"types": "./src/index.ts",
|
|
@@ -14,33 +15,31 @@
|
|
|
14
15
|
"./generated/queries": "./src/generated/queries.ts",
|
|
15
16
|
"./package.json": "./package.json"
|
|
16
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"src"
|
|
20
|
+
],
|
|
17
21
|
"sideEffects": false,
|
|
18
22
|
"dependencies": {
|
|
19
23
|
"@opentelemetry/api": "1.9.1",
|
|
20
24
|
"@tanstack/react-query": "5.100.9",
|
|
25
|
+
"@types/lodash-es": "4.17.12",
|
|
26
|
+
"@types/node": "26.1.2",
|
|
27
|
+
"@types/react": "19.2.14",
|
|
28
|
+
"@types/react-dom": "19.2.3",
|
|
21
29
|
"axios": "1.16.0",
|
|
22
30
|
"lodash-es": "4.18.1",
|
|
23
31
|
"zustand": "5.0.13"
|
|
24
32
|
},
|
|
25
33
|
"devDependencies": {
|
|
26
|
-
"@autional-cn/tsconfig": "0.1.0-rc",
|
|
27
|
-
"@types/lodash-es": "4.17.12",
|
|
28
|
-
"@types/node": "26.1.2",
|
|
29
|
-
"@types/react": "19.2.14",
|
|
30
|
-
"@types/react-dom": "19.2.3",
|
|
31
34
|
"react": "19.2.5",
|
|
32
35
|
"react-dom": "19.2.5",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
36
|
+
"typescript": "5.8.3",
|
|
37
|
+
"vitest": "3.2.0"
|
|
35
38
|
},
|
|
36
39
|
"peerDependencies": {
|
|
37
40
|
"react": ">=18.0.0",
|
|
38
41
|
"react-dom": ">=18.0.0"
|
|
39
42
|
},
|
|
40
|
-
"license": "AGPL-3.0",
|
|
41
|
-
"files": [
|
|
42
|
-
"src"
|
|
43
|
-
],
|
|
44
43
|
"scripts": {
|
|
45
44
|
"typecheck": "tsc --noEmit",
|
|
46
45
|
"test": "vitest run"
|
package/src/index.ts
CHANGED
|
@@ -128,6 +128,7 @@ export * from './seo';
|
|
|
128
128
|
|
|
129
129
|
// Components
|
|
130
130
|
export { RequireAuth } from './components/RequireAuth';
|
|
131
|
+
export { TenantRootRedirect } from './components/TenantRootRedirect';
|
|
131
132
|
export { OAuthCallbackPage } from './components/OAuthCallbackPage';
|
|
132
133
|
export { TenantSlugProvider, useTenantSlug } from './auth/tenant-slug-context';
|
|
133
134
|
export { useTenantSlugFromUrl, extractSlugFromPath, registerNonTenantSegments, clearNonTenantSegments } from './auth/slug-from-url';
|
|
@@ -157,14 +158,19 @@ export {
|
|
|
157
158
|
export { AuditStatsOnly } from './components/AuditStatsOnly';
|
|
158
159
|
export { TenantIndexGuard, usePublicTenantSlugs } from './components/TenantIndexGuard';
|
|
159
160
|
export type { TenantIndexGuardProps } from './components/TenantIndexGuard';
|
|
160
|
-
export { TenantRootRedirect } from './components/TenantRootRedirect';
|
|
161
161
|
export { buildTenantUrls } from './auth/build-tenant-urls';
|
|
162
162
|
export { resolvePortalBasename } from './config/resolve-basename';
|
|
163
163
|
|
|
164
|
-
//
|
|
165
|
-
//
|
|
166
|
-
//
|
|
167
|
-
//
|
|
164
|
+
// 生成代码的命名空间再导出(GeneratedApi / ApiGenerated / GeneratedTypes / ApiTypes)。
|
|
165
|
+
// 说明:这 4 行原先指向 @autional-cn/api-generated —— 那是各站逐站副本里用
|
|
166
|
+
// file:../../scripts/generate/api-generated-package 提供的本地包,一旦 shared 走 npm 发布
|
|
167
|
+
// 就必然解析不到(authenticator / security 的 tsc 就是这么炸的:TS2305 has no exported member)。
|
|
168
|
+
// 本包内的 src/generated/* 是同一份生成结果,因此改指包内相对路径;
|
|
169
|
+
// 消费方实际用到的类型面由逐站 tsc 验证。
|
|
170
|
+
export * as GeneratedApi from './generated/api';
|
|
171
|
+
export * as GeneratedTypes from './generated/types';
|
|
172
|
+
export * as ApiGenerated from './generated/api';
|
|
173
|
+
export * as ApiTypes from './generated/types';
|
|
168
174
|
|
|
169
175
|
// Branding(租户品牌 → CSS 变量 / favicon / customCss)
|
|
170
176
|
export {
|