baraqex 1.0.50 → 1.0.51

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": "baraqex",
3
- "version": "1.0.50",
3
+ "version": "1.0.51",
4
4
  "description": "A powerful server-side framework built on Frontend Hamroun",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ dist
3
+ coverage
4
+ *.config.js
5
+ *.config.ts
@@ -0,0 +1,25 @@
1
+ {
2
+ "root": true,
3
+ "env": {
4
+ "browser": true,
5
+ "es2020": true
6
+ },
7
+ "extends": [
8
+ "eslint:recommended",
9
+ "plugin:@typescript-eslint/recommended"
10
+ ],
11
+ "ignorePatterns": ["dist", ".eslintrc.json"],
12
+ "parser": "@typescript-eslint/parser",
13
+ "plugins": [
14
+ "@typescript-eslint",
15
+ "react-refresh"
16
+ ],
17
+ "rules": {
18
+ "react-refresh/only-export-components": [
19
+ "warn",
20
+ { "allowConstantExport": true }
21
+ ],
22
+ "@typescript-eslint/no-explicit-any": "off",
23
+ "@typescript-eslint/ban-ts-comment": "off"
24
+ }
25
+ }
@@ -0,0 +1,166 @@
1
+ # Baraqex Basic App Template
2
+
3
+ A comprehensive demonstration of the Baraqex framework featuring all major capabilities and beautiful Tailwind CSS styling.
4
+
5
+ ## 🚀 What's Included
6
+
7
+ This template showcases:
8
+
9
+ - **State Management**: useState, useEffect, useMemo, useRef hooks
10
+ - **Error Boundaries**: useErrorBoundary for graceful error handling
11
+ - **Context API**: createContext and useContext for state sharing
12
+ - **Interactive Components**: Counter, Todo List, Error Testing
13
+ - **Responsive Design**: Tailwind CSS with dark/light mode
14
+ - **Performance Optimizations**: Memoization and efficient re-rendering
15
+
16
+ ## 🎯 Features Demo
17
+
18
+ ### Counter Component
19
+ - State management with useState
20
+ - Effect tracking with useEffect
21
+ - Performance optimization with useMemo
22
+ - Render counting with useRef
23
+
24
+ ### Todo List Component
25
+ - Complex state operations (add, toggle, delete)
26
+ - Form handling and validation
27
+ - Progress tracking
28
+ - List rendering optimization
29
+
30
+ ### Error Boundary Test
31
+ - Error boundary implementation
32
+ - Graceful error recovery
33
+ - User-friendly error messages
34
+
35
+ ### Context API Demo
36
+ - Theme switching across components
37
+ - Global state management
38
+ - Provider/Consumer pattern
39
+
40
+ ## 🎨 Styling
41
+
42
+ - **Tailwind CSS**: Utility-first CSS framework
43
+ - **Custom Components**: Reusable button, card, and input styles
44
+ - **Responsive Design**: Mobile-first approach
45
+ - **Dark Mode**: Full theme switching support
46
+ - **Animations**: Smooth transitions and hover effects
47
+
48
+ ## 📁 Project Structure
49
+
50
+ ```
51
+ src/
52
+ ├── main.tsx # Main application component
53
+ ├── main.css # Tailwind CSS imports and custom styles
54
+ └── App.jsx # Alternative app component structure
55
+
56
+ public/
57
+ ├── logo.png # Baraqex logo (add your own)
58
+ └── index.html # HTML template
59
+
60
+ dist/
61
+ ├── bundle.js # Compiled JavaScript
62
+ └── main.css # Compiled CSS
63
+ ```
64
+
65
+ ## 🛠️ Development
66
+
67
+ ```bash
68
+ # Install dependencies
69
+ npm install
70
+
71
+ # Start development server with hot reload
72
+ npm run dev
73
+
74
+ # Build for production
75
+ npm run build
76
+
77
+ # Preview production build
78
+ npm run preview
79
+ ```
80
+
81
+ ## 📖 About Baraqex
82
+
83
+ Baraqex is a powerful full-stack framework built on Frontend Hamroun that provides:
84
+
85
+ - ⚡ **Reactive State Management**: Intuitive hooks API
86
+ - 🌐 **Server-Side Rendering**: SEO-friendly and fast loading
87
+ - 🔄 **WebAssembly Support**: High-performance computing
88
+ - 🛡️ **Built-in Security**: Authentication and validation
89
+ - 📦 **Zero Configuration**: Works out of the box
90
+ - 🎯 **TypeScript Ready**: Full type safety support
91
+
92
+ ## 🔧 Customization
93
+
94
+ ### Adding Components
95
+
96
+ Create new components following the established pattern:
97
+
98
+ ```tsx
99
+ import { jsx, useState } from 'baraqex';
100
+
101
+ function MyComponent() {
102
+ const [state, setState] = useState('initial');
103
+
104
+ return (
105
+ <div className="card">
106
+ <h3>My Component</h3>
107
+ <p>State: {state}</p>
108
+ </div>
109
+ );
110
+ }
111
+ ```
112
+
113
+ ### Styling Guidelines
114
+
115
+ Use the established Tailwind classes and custom components:
116
+
117
+ ```tsx
118
+ // Buttons
119
+ <button className="btn btn-primary">Primary Action</button>
120
+ <button className="btn btn-secondary">Secondary Action</button>
121
+
122
+ // Cards
123
+ <div className="card">Content here</div>
124
+
125
+ // Inputs
126
+ <input className="input" placeholder="Enter text..." />
127
+ ```
128
+
129
+ ### Adding New Features
130
+
131
+ 1. Create component in `src/`
132
+ 2. Import and use in `main.tsx`
133
+ 3. Add to navigation if needed
134
+ 4. Test error boundaries
135
+ 5. Ensure responsive design
136
+
137
+ ## 🚀 Deployment
138
+
139
+ The built application can be deployed to any static hosting service:
140
+
141
+ ```bash
142
+ # Build production files
143
+ npm run build
144
+
145
+ # Deploy the dist/ folder contents
146
+ ```
147
+
148
+ **Deployment Options:**
149
+ - Vercel: `vercel --prod`
150
+ - Netlify: Drag & drop the project folder
151
+ - GitHub Pages: Push to `gh-pages` branch
152
+ - Any static host: Upload `dist/` contents
153
+
154
+ ## 📚 Learn More
155
+
156
+ - [Baraqex Documentation](https://www.baraqex.tech/docs)
157
+ - [Frontend Hamroun Hooks](https://frontend-hamroun.com/hooks)
158
+ - [Tailwind CSS Docs](https://tailwindcss.com/docs)
159
+
160
+ ## 🤝 Contributing
161
+
162
+ This template is part of the Baraqex framework. Contributions welcome!
163
+
164
+ ---
165
+
166
+ **Happy coding with Baraqex! 🚀**
@@ -0,0 +1,37 @@
1
+ import * as esbuild from 'esbuild';
2
+
3
+ const isWatch = process.argv.includes('--watch');
4
+
5
+ const config = {
6
+ entryPoints: ['src/main.tsx'],
7
+ bundle: true,
8
+ outfile: 'dist/bundle.js',
9
+ format: 'esm',
10
+ platform: 'browser',
11
+ target: 'es2020',
12
+ minify: !isWatch,
13
+ sourcemap: isWatch,
14
+ define: {
15
+ 'process.env.NODE_ENV': isWatch ? '"development"' : '"production"'
16
+ },
17
+ external: [],
18
+ loader: {
19
+ '.tsx': 'tsx',
20
+ '.ts': 'tsx',
21
+ '.jsx': 'jsx',
22
+ '.js': 'jsx',
23
+ '.css': 'css'
24
+ },
25
+ // Don't transform JSX since we're using jsx() function calls
26
+ jsx: 'preserve'
27
+ };
28
+
29
+ if (isWatch) {
30
+ const ctx = await esbuild.context(config);
31
+ await ctx.watch();
32
+ console.log('👀 Watching for changes...');
33
+ console.log('📦 Bundle will be rebuilt automatically');
34
+ } else {
35
+ await esbuild.build(config);
36
+ console.log('✅ Build complete');
37
+ }
Binary file
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <link rel="icon" type="image/x-icon" href="/favicon.ico">
7
+ <title>My Frontend App</title>
8
+ </head>
9
+ <body class="bg-gray-100 min-h-screen">
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,3 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;