@base44-preview/cli 0.0.44-pr.406.b97f4ba → 0.0.44-pr.410.d6ad399
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/bin/binary-entry.ts +1 -1
- package/dist/assets/templates/backend-and-client/README.md +5 -7
- package/dist/assets/templates/backend-and-client/index.html +2 -2
- package/dist/assets/templates/backend-and-client/package.json +6 -7
- package/dist/assets/templates/backend-and-client/src/App.tsx +74 -0
- package/dist/assets/templates/backend-and-client/src/index.css +5 -34
- package/dist/assets/templates/backend-and-client/src/main.tsx +10 -0
- package/dist/assets/templates/backend-and-client/tsconfig.app.json +32 -0
- package/dist/assets/templates/backend-and-client/tsconfig.json +7 -0
- package/dist/assets/templates/backend-and-client/tsconfig.node.json +24 -0
- package/dist/assets/templates/backend-and-client/vite.config.ts +15 -0
- package/dist/cli/index.js +373 -376
- package/dist/cli/index.js.map +10 -13
- package/package.json +1 -1
- package/dist/assets/templates/backend-and-client/base44/agents/task_manager.jsonc +0 -11
- package/dist/assets/templates/backend-and-client/components.json +0 -16
- package/dist/assets/templates/backend-and-client/jsconfig.json +0 -13
- package/dist/assets/templates/backend-and-client/postcss.config.js +0 -6
- package/dist/assets/templates/backend-and-client/src/App.jsx +0 -148
- package/dist/assets/templates/backend-and-client/src/components/Base44Logo.jsx +0 -15
- package/dist/assets/templates/backend-and-client/src/components/ui/button.jsx +0 -23
- package/dist/assets/templates/backend-and-client/src/components/ui/checkbox.jsx +0 -20
- package/dist/assets/templates/backend-and-client/src/components/ui/input.jsx +0 -13
- package/dist/assets/templates/backend-and-client/src/main.jsx +0 -6
- package/dist/assets/templates/backend-and-client/tailwind.config.js +0 -41
- package/dist/assets/templates/backend-and-client/vite.config.js +0 -12
- /package/dist/assets/templates/backend-and-client/src/api/{base44Client.js.ejs → base44Client.ts.ejs} +0 -0
package/bin/binary-entry.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Base44 App
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A React + TypeScript app with Base44 backend.
|
|
4
4
|
|
|
5
5
|
## Structure
|
|
6
6
|
|
|
@@ -11,10 +11,8 @@ base44/ # Backend configuration
|
|
|
11
11
|
└── task.jsonc # Task entity
|
|
12
12
|
|
|
13
13
|
src/ # Frontend code
|
|
14
|
-
├── App.
|
|
15
|
-
|
|
16
|
-
├── components/ui/ # UI components
|
|
17
|
-
└── lib/ # Utilities
|
|
14
|
+
├── App.tsx # Main app component
|
|
15
|
+
└── api/ # Base44 client
|
|
18
16
|
```
|
|
19
17
|
|
|
20
18
|
## Development
|
|
@@ -29,7 +27,7 @@ npm run dev
|
|
|
29
27
|
| Command | Description |
|
|
30
28
|
|---------|-------------|
|
|
31
29
|
| `npm run dev` | Start dev server |
|
|
32
|
-
| `npm run build` |
|
|
30
|
+
| `npm run build` | Type-check + build for production |
|
|
33
31
|
| `npm run preview` | Preview production build |
|
|
34
32
|
|
|
35
33
|
## Base44 CLI
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="https://base44.com/logo_v2.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>
|
|
7
|
+
<title>Base44 App</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
12
|
</body>
|
|
13
13
|
</html>
|
|
@@ -5,20 +5,19 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
8
|
-
"build": "vite build",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
9
|
"preview": "vite preview"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@base44/sdk": "^0.8.3",
|
|
13
|
-
"
|
|
14
|
-
"react": "^18.
|
|
15
|
-
"react-dom": "^18.2.0"
|
|
13
|
+
"react": "^18.3.1",
|
|
14
|
+
"react-dom": "^18.3.1"
|
|
16
15
|
},
|
|
17
16
|
"devDependencies": {
|
|
17
|
+
"@types/react": "^18.3.1",
|
|
18
|
+
"@types/react-dom": "^18.3.1",
|
|
18
19
|
"@vitejs/plugin-react": "^4.3.4",
|
|
19
|
-
"
|
|
20
|
-
"postcss": "^8.5.3",
|
|
21
|
-
"tailwindcss": "^3.4.17",
|
|
20
|
+
"typescript": "^5.7.2",
|
|
22
21
|
"vite": "^6.1.0"
|
|
23
22
|
}
|
|
24
23
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react'
|
|
2
|
+
import { base44 } from '@/api/base44Client'
|
|
3
|
+
|
|
4
|
+
interface Task {
|
|
5
|
+
id: string
|
|
6
|
+
title: string
|
|
7
|
+
completed: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Task = base44.entities.Task
|
|
11
|
+
|
|
12
|
+
export default function App() {
|
|
13
|
+
const [tasks, setTasks] = useState<Task[]>([])
|
|
14
|
+
const [input, setInput] = useState('')
|
|
15
|
+
const [loading, setLoading] = useState(true)
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
Task.list().then((data: Task[]) => {
|
|
19
|
+
setTasks(data)
|
|
20
|
+
setLoading(false)
|
|
21
|
+
})
|
|
22
|
+
}, [])
|
|
23
|
+
|
|
24
|
+
const addTask = async (e: React.FormEvent) => {
|
|
25
|
+
e.preventDefault()
|
|
26
|
+
if (!input.trim()) return
|
|
27
|
+
await Task.create({ title: input.trim(), completed: false })
|
|
28
|
+
setInput('')
|
|
29
|
+
setTasks(await Task.list())
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const toggleTask = async (task: Task) => {
|
|
33
|
+
await Task.update(task.id, { completed: !task.completed })
|
|
34
|
+
setTasks(await Task.list())
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const deleteTask = async (id: string) => {
|
|
38
|
+
await Task.delete(id)
|
|
39
|
+
setTasks(await Task.list())
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<main>
|
|
44
|
+
<h1>Tasks</h1>
|
|
45
|
+
<form onSubmit={addTask}>
|
|
46
|
+
<input
|
|
47
|
+
value={input}
|
|
48
|
+
onChange={(e) => setInput(e.target.value)}
|
|
49
|
+
placeholder="New task…"
|
|
50
|
+
/>
|
|
51
|
+
<button type="submit">Add</button>
|
|
52
|
+
</form>
|
|
53
|
+
{loading ? (
|
|
54
|
+
<p>Loading…</p>
|
|
55
|
+
) : (
|
|
56
|
+
<ul>
|
|
57
|
+
{tasks.map((task) => (
|
|
58
|
+
<li key={task.id}>
|
|
59
|
+
<input
|
|
60
|
+
type="checkbox"
|
|
61
|
+
checked={task.completed}
|
|
62
|
+
onChange={() => toggleTask(task)}
|
|
63
|
+
/>
|
|
64
|
+
<span style={{ textDecoration: task.completed ? 'line-through' : 'none' }}>
|
|
65
|
+
{task.title}
|
|
66
|
+
</span>
|
|
67
|
+
<button onClick={() => deleteTask(task.id)}>✕</button>
|
|
68
|
+
</li>
|
|
69
|
+
))}
|
|
70
|
+
</ul>
|
|
71
|
+
)}
|
|
72
|
+
</main>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
5
|
-
@layer base {
|
|
6
|
-
:root {
|
|
7
|
-
--background: 0 0% 100%;
|
|
8
|
-
--foreground: 222.2 84% 4.9%;
|
|
9
|
-
--card: 0 0% 100%;
|
|
10
|
-
--card-foreground: 222.2 84% 4.9%;
|
|
11
|
-
--popover: 0 0% 100%;
|
|
12
|
-
--popover-foreground: 222.2 84% 4.9%;
|
|
13
|
-
--primary: 222.2 47.4% 11.2%;
|
|
14
|
-
--primary-foreground: 210 40% 98%;
|
|
15
|
-
--secondary: 210 40% 96.1%;
|
|
16
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
17
|
-
--muted: 210 40% 96.1%;
|
|
18
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
19
|
-
--accent: 210 40% 96.1%;
|
|
20
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
21
|
-
--destructive: 0 84.2% 60.2%;
|
|
22
|
-
--destructive-foreground: 210 40% 98%;
|
|
23
|
-
--border: 214.3 31.8% 91.4%;
|
|
24
|
-
--input: 214.3 31.8% 91.4%;
|
|
25
|
-
--ring: 222.2 84% 4.9%;
|
|
26
|
-
--radius: 0.5rem;
|
|
27
|
-
}
|
|
1
|
+
*, *::before, *::after {
|
|
2
|
+
box-sizing: border-box;
|
|
28
3
|
}
|
|
29
4
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
body {
|
|
35
|
-
@apply bg-background text-foreground antialiased;
|
|
36
|
-
}
|
|
5
|
+
body {
|
|
6
|
+
margin: 0;
|
|
7
|
+
font-family: system-ui, sans-serif;
|
|
37
8
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"useDefineForClassFields": true,
|
|
6
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
|
|
18
|
+
/* Linting */
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"noUncheckedSideEffectImports": true,
|
|
24
|
+
|
|
25
|
+
/* Path alias */
|
|
26
|
+
"baseUrl": ".",
|
|
27
|
+
"paths": {
|
|
28
|
+
"@/*": ["./src/*"]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"include": ["src"]
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedSideEffectImports": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["vite.config.ts"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
plugins: [react()],
|
|
10
|
+
resolve: {
|
|
11
|
+
alias: {
|
|
12
|
+
'@': path.resolve(__dirname, './src'),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
})
|