@itayzrihan/create-box-app 1.0.4 → 1.1.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/package.json +1 -1
- package/template/README.md +44 -0
- package/template/box.config.json +14 -0
- package/template/package.json +6 -2
- package/template/src/main.box +0 -2
- package/template/src/welcome.box +0 -82
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -38,6 +38,7 @@ Visit **http://localhost:3000** and start building!
|
|
|
38
38
|
```
|
|
39
39
|
my-box-app/
|
|
40
40
|
├── my-box-app.code-workspace # ⬅️ OPEN THIS FILE in VS Code!
|
|
41
|
+
├── box.config.json # Build configuration
|
|
41
42
|
├── src/
|
|
42
43
|
│ ├── main.box # App entry point
|
|
43
44
|
│ ├── counter.box # State management example
|
|
@@ -114,8 +115,51 @@ Files named `api+name.box` become routes:
|
|
|
114
115
|
|---------|-------------|
|
|
115
116
|
| `npm run dev` | Start development server with HMR |
|
|
116
117
|
| `npm run build` | Build for production |
|
|
118
|
+
| `npm run build:analyze` | Build with detailed bundle analysis |
|
|
119
|
+
| `npm run build:prod` | Build with aggressive minification |
|
|
117
120
|
| `npm run start` | Run production server |
|
|
118
121
|
| `npm run preview` | Build and run production |
|
|
122
|
+
| `npm run clean` | Remove dist/ and build artifacts |
|
|
123
|
+
| `npm run lint` | Validate all .box files for errors |
|
|
124
|
+
|
|
125
|
+
## 📦 CLI Commands
|
|
126
|
+
|
|
127
|
+
The BOX CLI offers powerful tools for development:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Generate new components
|
|
131
|
+
box add ui header # Create UI component
|
|
132
|
+
box add api users # Create API endpoint
|
|
133
|
+
box add page about # Create full page with SEO meta
|
|
134
|
+
box add layout main # Create layout wrapper
|
|
135
|
+
|
|
136
|
+
# Development
|
|
137
|
+
box dev # Start dev server with HMR
|
|
138
|
+
box build # Production build
|
|
139
|
+
box build --analyze # Show bundle analysis
|
|
140
|
+
box build --minify=none # Disable minification
|
|
141
|
+
|
|
142
|
+
# Maintenance
|
|
143
|
+
box clean # Remove build artifacts
|
|
144
|
+
box lint # Validate .box files
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## ⚙️ Configuration
|
|
148
|
+
|
|
149
|
+
Your project includes `box.config.json` for customization:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"minify": "basic", // none | basic | aggressive
|
|
154
|
+
"outDir": "dist",
|
|
155
|
+
"srcDir": "src",
|
|
156
|
+
"port": 3000,
|
|
157
|
+
"build": {
|
|
158
|
+
"cleanFirst": false,
|
|
159
|
+
"analyze": false
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
119
163
|
|
|
120
164
|
## 🔌 VS Code Setup
|
|
121
165
|
|
package/template/package.json
CHANGED
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "box dev",
|
|
7
7
|
"build": "box build",
|
|
8
|
+
"build:analyze": "box build --analyze",
|
|
9
|
+
"build:prod": "box build --minify=aggressive",
|
|
8
10
|
"start": "node dist/server.js",
|
|
9
|
-
"preview": "npm run build && npm run start"
|
|
11
|
+
"preview": "npm run build && npm run start",
|
|
12
|
+
"clean": "box clean",
|
|
13
|
+
"lint": "box lint"
|
|
10
14
|
},
|
|
11
15
|
"keywords": [
|
|
12
16
|
"box",
|
|
@@ -16,6 +20,6 @@
|
|
|
16
20
|
"author": "",
|
|
17
21
|
"license": "MIT",
|
|
18
22
|
"dependencies": {
|
|
19
|
-
"@itayzrihan/box-framework": "^1.
|
|
23
|
+
"@itayzrihan/box-framework": "^1.1.0"
|
|
20
24
|
}
|
|
21
25
|
}
|
package/template/src/main.box
CHANGED
package/template/src/welcome.box
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
<style>
|
|
2
|
-
.welcome {
|
|
3
|
-
text-align: center;
|
|
4
|
-
padding: 3rem 2rem;
|
|
5
|
-
min-height: 100vh;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
align-items: center;
|
|
10
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
11
|
-
color: white;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.welcome-title {
|
|
15
|
-
font-size: 3.5rem;
|
|
16
|
-
font-weight: bold;
|
|
17
|
-
margin-bottom: 1rem;
|
|
18
|
-
text-shadow: 0 2px 10px rgba(0,0,0,0.2);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.welcome-subtitle {
|
|
22
|
-
font-size: 1.25rem;
|
|
23
|
-
margin-bottom: 2rem;
|
|
24
|
-
opacity: 0.95;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.welcome-box {
|
|
28
|
-
background: rgba(255, 255, 255, 0.1);
|
|
29
|
-
backdrop-filter: blur(10px);
|
|
30
|
-
padding: 2rem;
|
|
31
|
-
border-radius: 16px;
|
|
32
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
33
|
-
max-width: 600px;
|
|
34
|
-
margin: 2rem 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.welcome-text {
|
|
38
|
-
font-size: 1rem;
|
|
39
|
-
line-height: 1.6;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.welcome-link {
|
|
43
|
-
display: inline-block;
|
|
44
|
-
margin-top: 1.5rem;
|
|
45
|
-
padding: 0.75rem 1.5rem;
|
|
46
|
-
background: white;
|
|
47
|
-
color: #667eea;
|
|
48
|
-
text-decoration: none;
|
|
49
|
-
border-radius: 8px;
|
|
50
|
-
font-weight: 600;
|
|
51
|
-
transition: transform 0.2s;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.welcome-link:hover {
|
|
55
|
-
transform: scale(1.05);
|
|
56
|
-
}
|
|
57
|
-
</style>
|
|
58
|
-
|
|
59
|
-
<template>
|
|
60
|
-
<div class="welcome">
|
|
61
|
-
<h1 class="welcome-title">Welcome to BOX 📦</h1>
|
|
62
|
-
<p class="welcome-subtitle">A zero-dependency, full-stack framework</p>
|
|
63
|
-
|
|
64
|
-
<div class="welcome-box">
|
|
65
|
-
<p class="welcome-text">
|
|
66
|
-
Your BOX project is ready! Edit <strong>src/main.box</strong> to get started.
|
|
67
|
-
</p>
|
|
68
|
-
<p class="welcome-text">
|
|
69
|
-
This welcome component demonstrates the power of reactive state management.
|
|
70
|
-
</p>
|
|
71
|
-
<a href="https://github.com/itayzrihan/box" class="welcome-link">
|
|
72
|
-
Learn More →
|
|
73
|
-
</a>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</template>
|
|
77
|
-
|
|
78
|
-
<script>
|
|
79
|
-
console.log('🎉 Welcome component loaded!');
|
|
80
|
-
console.log('💡 Tip: Run "npm run dev" to start the dev server');
|
|
81
|
-
console.log('📚 Read the docs: https://github.com/itayzrihan/box#readme');
|
|
82
|
-
</script>
|