@rise-x/apps-sdk 0.6.0 → 0.7.0
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/README.md +192 -10
- package/build/connectors/agents.js +1 -1
- package/build/connectors/assets.d.ts +9 -3
- package/build/connectors/assets.js +32 -1
- package/build/connectors/index.d.ts +3 -2
- package/build/connectors/index.js +4 -1
- package/build/connectors/search.d.ts +34 -0
- package/build/connectors/search.js +63 -0
- package/build/connectors/types.d.ts +51 -0
- package/build/connectors/types.js +71 -0
- package/build/connectors/work.d.ts +7 -1
- package/build/connectors/work.js +13 -0
- package/build/index.d.ts +1 -1
- package/build/mockShell.d.ts +11 -0
- package/build/mockShell.js +159 -2
- package/build/query/assets.d.ts +19 -6
- package/build/query/assets.js +35 -3
- package/build/query/context.d.ts +14 -0
- package/build/query/context.js +16 -0
- package/build/query/index.d.ts +4 -3
- package/build/query/index.js +14 -2
- package/build/query/keys.d.ts +4 -0
- package/build/query/keys.js +7 -0
- package/build/query/layer.d.ts +25 -3
- package/build/query/work.d.ts +14 -1
- package/build/query/work.js +32 -1
- package/build/shellBridge.d.ts +1 -1
- package/build/ui/components/data-table.d.ts +13 -2
- package/build/ui/components/table.d.ts +7 -1
- package/build/ui/reference/components/alert-dialog.tsx +6 -1
- package/build/ui/reference/components/button.tsx +8 -1
- package/build/ui/reference/components/data-table.tsx +199 -29
- package/build/ui/reference/components/dialog.tsx +1 -1
- package/build/ui/reference/components/dropdown-menu.tsx +2 -2
- package/build/ui/reference/components/nav.tsx +3 -0
- package/build/ui/reference/components/popover.tsx +1 -1
- package/build/ui/reference/components/select.tsx +1 -1
- package/build/ui/reference/components/sheet.tsx +5 -2
- package/build/ui/reference/components/table.tsx +15 -2
- package/build/ui/standalone.js +9 -9
- package/build/ui/styles.css +1 -1
- package/package.json +10 -9
- package/template/README.md +6 -0
- package/template/src/App.tsx +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rise-x/apps-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "SDK for building federated apps on top of the Rise-X Diana shell. Includes a CLI for scaffolding new apps.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rise-X",
|
|
@@ -56,6 +56,14 @@
|
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.19.0"
|
|
58
58
|
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"clean": "shx rm -rf build",
|
|
61
|
+
"test": "jest",
|
|
62
|
+
"build:package": "pnpm clean && tsc -p tsconfig.package.json && tsc -p tsconfig.ui.json && node scripts/build-ui.js && shx chmod +x build/cli/index.js",
|
|
63
|
+
"build": "pnpm build:package",
|
|
64
|
+
"start:package": "tsc-watch -p ./tsconfig.package.json",
|
|
65
|
+
"prepack": "pnpm --filter @rise-x/ui build && pnpm build:package"
|
|
66
|
+
},
|
|
59
67
|
"peerDependencies": {
|
|
60
68
|
"@tanstack/react-query": "^5.0.0",
|
|
61
69
|
"axios": "^1.0.0",
|
|
@@ -103,12 +111,5 @@
|
|
|
103
111
|
"ts-jest": "^29.1.2",
|
|
104
112
|
"tsc-watch": "^6.0.0",
|
|
105
113
|
"typescript": "^5.3.0"
|
|
106
|
-
},
|
|
107
|
-
"scripts": {
|
|
108
|
-
"clean": "shx rm -rf build",
|
|
109
|
-
"test": "jest",
|
|
110
|
-
"build:package": "pnpm clean && tsc -p tsconfig.package.json && tsc -p tsconfig.ui.json && node scripts/build-ui.js && shx chmod +x build/cli/index.js",
|
|
111
|
-
"build": "pnpm build:package",
|
|
112
|
-
"start:package": "tsc-watch -p ./tsconfig.package.json"
|
|
113
114
|
}
|
|
114
|
-
}
|
|
115
|
+
}
|
package/template/README.md
CHANGED
|
@@ -61,6 +61,12 @@ the SDK's own client. Keep `@tanstack/react-query` in `webpack.config.js`'s
|
|
|
61
61
|
`shared` block (already configured) so the shell-managed client can reach the
|
|
62
62
|
app.
|
|
63
63
|
|
|
64
|
+
Plain react-query calls (`useQuery` on an SDK factory, `useQueryClient`,
|
|
65
|
+
devtools) read the client from React context instead, which standalone dev has
|
|
66
|
+
no provider for — `App.tsx` already wraps the app in `<AppQueryProvider>`,
|
|
67
|
+
which publishes whichever client the SDK resolved. Never mount a
|
|
68
|
+
`QueryClient` of your own: that shadows the shell's and breaks its caching.
|
|
69
|
+
|
|
64
70
|
## UI components
|
|
65
71
|
|
|
66
72
|
```tsx
|
package/template/src/App.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
Settings,
|
|
9
9
|
Users,
|
|
10
10
|
} from "lucide-react";
|
|
11
|
+
import { AppQueryProvider } from "@rise-x/apps-sdk/query";
|
|
11
12
|
import {
|
|
12
13
|
Badge,
|
|
13
14
|
Button,
|
|
@@ -51,7 +52,15 @@ const SCREENS = [
|
|
|
51
52
|
] as const;
|
|
52
53
|
|
|
53
54
|
export default function App() {
|
|
54
|
-
|
|
55
|
+
// Publishes the QueryClient the SDK resolved (the host's own inside the
|
|
56
|
+
// shell, a per-bundle fallback standalone) so plain react-query calls —
|
|
57
|
+
// useQuery on an SDK factory, useQueryClient, devtools — find one. Never
|
|
58
|
+
// mount a QueryClient of your own: that shadows the shell's.
|
|
59
|
+
return (
|
|
60
|
+
<AppQueryProvider>
|
|
61
|
+
<Shell />
|
|
62
|
+
</AppQueryProvider>
|
|
63
|
+
);
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
function Shell() {
|