@rise-x/apps-sdk 0.9.0 → 0.11.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 +116 -31
- package/build/rsbuild/index.d.ts +6 -1
- package/build/rsbuild/index.js +23 -2
- package/build/ui/classes.json +209 -0
- package/build/ui/components/ai.d.ts +33 -1
- package/build/ui/components/app-frame.d.ts +16 -10
- package/build/ui/components/chat-input.d.ts +28 -0
- package/build/ui/components/message-scroller.d.ts +34 -10
- package/build/ui/components/sheet.d.ts +10 -0
- package/build/ui/components/thinking-rings.d.ts +4 -0
- package/build/ui/demo.html +26794 -0
- package/build/ui/index.d.ts +2 -0
- package/build/ui/standalone.js +59 -58
- package/build/ui/styles.css +1 -1
- package/package.json +4 -3
- package/template/AGENTS.md +3 -3
- package/template/README.md +5 -5
- package/template/package.json +8 -9
- package/template/rsbuild.config.mts +17 -0
- package/template/src/App.tsx +4 -1
- package/template/tsconfig.json +3 -1
- package/build/ui/reference/README.md +0 -11
- package/build/ui/reference/components/accordion.tsx +0 -85
- package/build/ui/reference/components/ai.tsx +0 -293
- package/build/ui/reference/components/alert-dialog.tsx +0 -207
- package/build/ui/reference/components/alert.tsx +0 -112
- package/build/ui/reference/components/app-frame.tsx +0 -71
- package/build/ui/reference/components/aspect-ratio.tsx +0 -28
- package/build/ui/reference/components/avatar.tsx +0 -158
- package/build/ui/reference/components/badge.tsx +0 -160
- package/build/ui/reference/components/button-group.tsx +0 -77
- package/build/ui/reference/components/button.tsx +0 -109
- package/build/ui/reference/components/calendar.tsx +0 -119
- package/build/ui/reference/components/card.tsx +0 -144
- package/build/ui/reference/components/carousel.tsx +0 -248
- package/build/ui/reference/components/chart.tsx +0 -704
- package/build/ui/reference/components/checkbox.tsx +0 -44
- package/build/ui/reference/components/collapsible.tsx +0 -43
- package/build/ui/reference/components/combobox.tsx +0 -146
- package/build/ui/reference/components/command.tsx +0 -181
- package/build/ui/reference/components/context-menu.tsx +0 -243
- package/build/ui/reference/components/data-table.tsx +0 -650
- package/build/ui/reference/components/date-picker.tsx +0 -218
- package/build/ui/reference/components/dialog.tsx +0 -172
- package/build/ui/reference/components/direction.tsx +0 -22
- package/build/ui/reference/components/dropdown-menu.tsx +0 -245
- package/build/ui/reference/components/empty-state.tsx +0 -63
- package/build/ui/reference/components/field.tsx +0 -252
- package/build/ui/reference/components/file-upload.tsx +0 -116
- package/build/ui/reference/components/hover-card.tsx +0 -64
- package/build/ui/reference/components/input-group.tsx +0 -157
- package/build/ui/reference/components/input-otp.tsx +0 -106
- package/build/ui/reference/components/input.tsx +0 -86
- package/build/ui/reference/components/item.tsx +0 -188
- package/build/ui/reference/components/kbd.tsx +0 -43
- package/build/ui/reference/components/label.tsx +0 -19
- package/build/ui/reference/components/list.tsx +0 -191
- package/build/ui/reference/components/map.css +0 -251
- package/build/ui/reference/components/map.tsx +0 -294
- package/build/ui/reference/components/menubar.tsx +0 -275
- package/build/ui/reference/components/message-scroller.tsx +0 -141
- package/build/ui/reference/components/message.tsx +0 -177
- package/build/ui/reference/components/nav.tsx +0 -127
- package/build/ui/reference/components/navigation-menu.tsx +0 -191
- package/build/ui/reference/components/page-header.tsx +0 -245
- package/build/ui/reference/components/popover.tsx +0 -76
- package/build/ui/reference/components/progress.tsx +0 -31
- package/build/ui/reference/components/radio.tsx +0 -65
- package/build/ui/reference/components/resizable.tsx +0 -40
- package/build/ui/reference/components/scroll-area.tsx +0 -55
- package/build/ui/reference/components/segmented.tsx +0 -45
- package/build/ui/reference/components/select.tsx +0 -188
- package/build/ui/reference/components/separator.tsx +0 -26
- package/build/ui/reference/components/sheet.tsx +0 -184
- package/build/ui/reference/components/skeleton.tsx +0 -15
- package/build/ui/reference/components/slider.tsx +0 -161
- package/build/ui/reference/components/snackbar.tsx +0 -27
- package/build/ui/reference/components/sonner.tsx +0 -43
- package/build/ui/reference/components/spinner.tsx +0 -27
- package/build/ui/reference/components/statistic.tsx +0 -122
- package/build/ui/reference/components/stepper.tsx +0 -138
- package/build/ui/reference/components/switch.tsx +0 -47
- package/build/ui/reference/components/table.tsx +0 -246
- package/build/ui/reference/components/textarea.tsx +0 -28
- package/build/ui/reference/components/timeline.tsx +0 -101
- package/build/ui/reference/components/toggle-group.tsx +0 -86
- package/build/ui/reference/components/toggle.tsx +0 -46
- package/build/ui/reference/components/tooltip.tsx +0 -53
- package/build/ui/reference/index.ts +0 -69
- package/build/ui/reference/lib/utils.ts +0 -34
- package/template/webpack.config.js +0 -112
- package/template/webpack.local.config.js +0 -68
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
3
|
-
const { ModuleFederationPlugin } = require("webpack").container;
|
|
4
|
-
const pkg = require("./package.json");
|
|
5
|
-
|
|
6
|
-
// Conventions:
|
|
7
|
-
// package.json name → "@rise-x-apps/<slug>"
|
|
8
|
-
// remote scope → "app_<slug_with_underscores>"
|
|
9
|
-
// exposed module → "./App" → src/App.tsx
|
|
10
|
-
const slug = pkg.name.replace(/^@rise-x-apps\//, "");
|
|
11
|
-
const scope = "app_" + slug.replace(/-/g, "_");
|
|
12
|
-
|
|
13
|
-
module.exports = (_env, argv) => {
|
|
14
|
-
const isProd = argv.mode === "production";
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
entry: "./src/index.tsx",
|
|
18
|
-
mode: argv.mode || "development",
|
|
19
|
-
devtool: isProd ? "source-map" : "eval-source-map",
|
|
20
|
-
output: {
|
|
21
|
-
path: path.resolve(__dirname, "dist"),
|
|
22
|
-
// 'auto' lets webpack derive the chunk base URL from document.currentScript.src
|
|
23
|
-
// at runtime — required so the same bundle works in dev and when the shell loads
|
|
24
|
-
// remoteEntry.js from the CDN under /apps/<id>/<ver>/.
|
|
25
|
-
publicPath: "auto",
|
|
26
|
-
filename: "[name].[contenthash].js",
|
|
27
|
-
chunkFilename: "[name].[contenthash].js",
|
|
28
|
-
uniqueName: scope,
|
|
29
|
-
clean: true,
|
|
30
|
-
},
|
|
31
|
-
resolve: {
|
|
32
|
-
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
33
|
-
},
|
|
34
|
-
module: {
|
|
35
|
-
rules: [
|
|
36
|
-
{
|
|
37
|
-
test: /\.(ts|tsx)$/,
|
|
38
|
-
exclude: /node_modules/,
|
|
39
|
-
use: "ts-loader",
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
plugins: [
|
|
44
|
-
new ModuleFederationPlugin({
|
|
45
|
-
name: scope,
|
|
46
|
-
filename: "remoteEntry.js",
|
|
47
|
-
exposes: {
|
|
48
|
-
"./App": "./src/App",
|
|
49
|
-
"./lifecycle": "./src/lifecycle",
|
|
50
|
-
},
|
|
51
|
-
shared: {
|
|
52
|
-
// import: false — the app consumes React (and its JSX runtimes) from the shell
|
|
53
|
-
// only and never bundles a fallback. Prevents duplicate-React-instance bugs and
|
|
54
|
-
// the sync-require failure inside React 18's bundled jsx-runtime. For standalone
|
|
55
|
-
// local dev (no shell), use `pnpm start` which runs webpack.local.config.js.
|
|
56
|
-
// The dual range mirrors the SDK's peer range: hosts provide React 18
|
|
57
|
-
// or 19 depending on their generation, and the same bundle must load
|
|
58
|
-
// on both — author to the React 18-compatible API surface (AGENTS.md).
|
|
59
|
-
react: {
|
|
60
|
-
singleton: true,
|
|
61
|
-
requiredVersion: "^18.0.0 || ^19.0.0",
|
|
62
|
-
import: false,
|
|
63
|
-
},
|
|
64
|
-
"react-dom": {
|
|
65
|
-
singleton: true,
|
|
66
|
-
requiredVersion: "^18.0.0 || ^19.0.0",
|
|
67
|
-
import: false,
|
|
68
|
-
},
|
|
69
|
-
"react/jsx-runtime": {
|
|
70
|
-
singleton: true,
|
|
71
|
-
requiredVersion: "^18.0.0 || ^19.0.0",
|
|
72
|
-
import: false,
|
|
73
|
-
},
|
|
74
|
-
"react/jsx-dev-runtime": {
|
|
75
|
-
singleton: true,
|
|
76
|
-
requiredVersion: "^18.0.0 || ^19.0.0",
|
|
77
|
-
import: false,
|
|
78
|
-
},
|
|
79
|
-
// Rise-X design system, imported via `@rise-x/apps-sdk/ui`. The
|
|
80
|
-
// host (the Diana app) provides the only copy — and the Tailwind
|
|
81
|
-
// CSS that styles it — through the share scope; never bundle a
|
|
82
|
-
// fallback.
|
|
83
|
-
"@rise-x/ui": {
|
|
84
|
-
singleton: true,
|
|
85
|
-
requiredVersion: false,
|
|
86
|
-
import: false,
|
|
87
|
-
},
|
|
88
|
-
// Unlike react, keep the bundled fallback (no `import: false`): the
|
|
89
|
-
// app loads through an async MF boundary so there is no eager
|
|
90
|
-
// sync-require hazard, and the fallback keeps the app working on
|
|
91
|
-
// hosts that don't share react-query. When the shell does share it,
|
|
92
|
-
// `singleton: true` wins with the shell's copy — which is what lets
|
|
93
|
-
// the shell-managed per-app QueryClient reach the SDK's query hooks
|
|
94
|
-
// through React context.
|
|
95
|
-
"@tanstack/react-query": {
|
|
96
|
-
singleton: true,
|
|
97
|
-
requiredVersion: "^5.0.0",
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
}),
|
|
101
|
-
new HtmlWebpackPlugin({
|
|
102
|
-
template: path.resolve(__dirname, "public/index.html"),
|
|
103
|
-
}),
|
|
104
|
-
],
|
|
105
|
-
devServer: {
|
|
106
|
-
port: __APP_PORT__,
|
|
107
|
-
hot: true,
|
|
108
|
-
historyApiFallback: true,
|
|
109
|
-
headers: { "Access-Control-Allow-Origin": "*" },
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const path = require("path");
|
|
2
|
-
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
|
3
|
-
|
|
4
|
-
// Standalone dev config — bundles React directly so the app boots on its own
|
|
5
|
-
// port without the Rise-X shell. src/bootstrap.tsx installs createMockShell()
|
|
6
|
-
// on window.__DIANA_SHELL__, so shell hooks (useShellUser, useShellEnvironment)
|
|
7
|
-
// resolve against the mock. For the federated build loaded by the shell via
|
|
8
|
-
// Module Federation, see webpack.config.js.
|
|
9
|
-
module.exports = (_env, argv) => {
|
|
10
|
-
const isProd = argv.mode === "production";
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
entry: "./src/index.tsx",
|
|
14
|
-
mode: argv.mode || "development",
|
|
15
|
-
devtool: isProd ? "source-map" : "eval-source-map",
|
|
16
|
-
output: {
|
|
17
|
-
path: path.resolve(__dirname, "dist-local"),
|
|
18
|
-
publicPath: "/",
|
|
19
|
-
filename: "[name].[contenthash].js",
|
|
20
|
-
chunkFilename: "[name].[contenthash].js",
|
|
21
|
-
clean: true,
|
|
22
|
-
},
|
|
23
|
-
resolve: {
|
|
24
|
-
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
|
25
|
-
alias: {
|
|
26
|
-
// No shell → no share scope. Standalone builds bundle the SDK's own
|
|
27
|
-
// compiled copy of the design system instead (CSS self-injected,
|
|
28
|
-
// Inter included) — the federated build still gets the host's copy
|
|
29
|
-
// via the share scope (see webpack.config.js).
|
|
30
|
-
"@rise-x/ui": require.resolve("@rise-x/apps-sdk/ui/standalone"),
|
|
31
|
-
|
|
32
|
-
// Same single-physical-React pin the hosts use via Module Federation
|
|
33
|
-
// `shared` — but standalone dev has no share scope, so icon/UI deps
|
|
34
|
-
// that nest their own React (e.g. lucide-react, radix-ui on React 19
|
|
35
|
-
// in a pnpm hoisted workspace) would otherwise feed React-19 elements
|
|
36
|
-
// to this app's React-18 renderer, which rejects them outright.
|
|
37
|
-
// require.resolve walks up from this app's own node_modules, so it
|
|
38
|
-
// finds the app's own React — the workspace root in-repo, the app's
|
|
39
|
-
// local install for partner projects — and the alias forces every
|
|
40
|
-
// `react`/`react-dom` request in the compilation onto that one copy,
|
|
41
|
-
// including requests nested under those deps. Subpath requests
|
|
42
|
-
// (e.g. react/jsx-runtime) resolve through the same alias.
|
|
43
|
-
react: path.dirname(require.resolve("react/package.json")),
|
|
44
|
-
"react-dom": path.dirname(require.resolve("react-dom/package.json")),
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
module: {
|
|
48
|
-
rules: [
|
|
49
|
-
{
|
|
50
|
-
test: /\.(ts|tsx)$/,
|
|
51
|
-
exclude: /node_modules/,
|
|
52
|
-
use: "ts-loader",
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
plugins: [
|
|
57
|
-
new HtmlWebpackPlugin({
|
|
58
|
-
template: path.resolve(__dirname, "public/index.html"),
|
|
59
|
-
}),
|
|
60
|
-
],
|
|
61
|
-
devServer: {
|
|
62
|
-
port: __APP_PORT__,
|
|
63
|
-
hot: true,
|
|
64
|
-
historyApiFallback: true,
|
|
65
|
-
open: true,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
};
|