@lark-apaas/coding-templates 0.1.14 → 0.1.16

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-templates",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "OpenClaw project templates for mclaw CLI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -4,11 +4,9 @@ import HomePage from "@/pages/home";
4
4
  import TodosPage from "@/pages/todos";
5
5
  import NotFoundPage from "@/pages/not-found";
6
6
 
7
- declare const __APP_BASE_PATH__: string;
8
-
9
7
  export default function App() {
10
8
  return (
11
- <BrowserRouter basename={__APP_BASE_PATH__}>
9
+ <BrowserRouter basename={process.env.CLIENT_BASE_PATH || '/'}>
12
10
  <Routes>
13
11
  <Route element={<Layout />}>
14
12
  <Route index element={<HomePage />} />
@@ -1,10 +1,14 @@
1
1
  import { StrictMode } from "react";
2
2
  import { createRoot } from "react-dom/client";
3
+ import { AppContainer } from "@lark-apaas/client-toolkit-lite";
4
+ import "@lark-apaas/client-toolkit-lite/styles";
3
5
  import App from "./app";
4
6
  import "./index.css";
5
7
 
6
8
  createRoot(document.getElementById("root")!).render(
7
9
  <StrictMode>
8
- <App />
10
+ <AppContainer>
11
+ <App />
12
+ </AppContainer>
9
13
  </StrictMode>,
10
14
  );
@@ -44,6 +44,7 @@
44
44
  "@radix-ui/react-toggle": "^1.1.9",
45
45
  "@radix-ui/react-toggle-group": "^1.1.10",
46
46
  "@radix-ui/react-tooltip": "^1.1.18",
47
+ "@lark-apaas/client-toolkit-lite": "^0.0.1",
47
48
  "@formkit/auto-animate": "^0.9.0",
48
49
  "framer-motion": "^12.38.0",
49
50
  "class-variance-authority": "^0.7.1",
@@ -6,6 +6,11 @@ OUTPUT="$ROOT/dist/output"
6
6
  OUTPUT_RESOURCE="$ROOT/dist/output_resource"
7
7
  OUTPUT_STATIC="$ROOT/dist/output_static"
8
8
 
9
+ # 映射平台环境变量到 preset 期望的变量名
10
+ export CLIENT_BASE_PATH="${MCLAW_APP_ID:+/app/$MCLAW_APP_ID}"
11
+ export ASSETS_CDN_PATH="${MCLAW_CDN_DOMAIN:-/}"
12
+ export NODE_ENV="${NODE_ENV:-production}"
13
+
9
14
  # 清理
10
15
  rm -rf "$ROOT/dist"
11
16