domma-js 0.9.6-alpha → 0.9.8-alpha

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.
Files changed (44) hide show
  1. package/bin/domma-cli.js +231 -22
  2. package/package.json +1 -1
  3. package/public/dist/domma-syntax.min.js +3 -3
  4. package/public/dist/domma.css +3 -3
  5. package/public/dist/domma.esm.js +4 -4
  6. package/public/dist/domma.min.js +4 -4
  7. package/public/dist/elements.css +3 -3
  8. package/public/dist/grid.css +3 -3
  9. package/public/dist/syntax.css +3 -3
  10. package/public/dist/themes/domma-themes.css +3 -3
  11. package/templates/kickstart/README.md +139 -0
  12. package/templates/kickstart/backend/.gitkeep +0 -0
  13. package/templates/kickstart/backend/README.md +160 -0
  14. package/templates/kickstart/domma.config.json +14 -10
  15. package/templates/kickstart/frontend/assets/logo/placeholder.svg +6 -0
  16. package/templates/kickstart/frontend/css/custom.css +121 -0
  17. package/templates/kickstart/frontend/js/app.js +167 -0
  18. package/templates/kickstart/frontend/pages/about/about.js +10 -0
  19. package/templates/kickstart/frontend/pages/about/index.html +232 -0
  20. package/templates/kickstart/frontend/pages/blog/blog.js +10 -0
  21. package/templates/kickstart/frontend/pages/blog/index.html +221 -0
  22. package/templates/kickstart/frontend/pages/contact/contact.js +33 -0
  23. package/templates/kickstart/frontend/pages/contact/index.html +199 -0
  24. package/templates/kickstart/frontend/pages/cookies/cookies.js +51 -0
  25. package/templates/kickstart/frontend/pages/cookies/index.html +384 -0
  26. package/templates/kickstart/frontend/pages/docs/docs.js +28 -0
  27. package/templates/kickstart/frontend/pages/docs/index.html +289 -0
  28. package/templates/kickstart/frontend/pages/index.html +164 -0
  29. package/templates/kickstart/frontend/pages/index.js +10 -0
  30. package/templates/kickstart/frontend/pages/privacy/index.html +280 -0
  31. package/templates/kickstart/frontend/pages/privacy/privacy.js +51 -0
  32. package/templates/kickstart/frontend/pages/terms/index.html +372 -0
  33. package/templates/kickstart/frontend/pages/terms/terms.js +51 -0
  34. package/templates/kickstart-old/domma.config.json +74 -0
  35. package/templates/page-template/page.html +54 -0
  36. package/templates/page-template/page.js +10 -0
  37. /package/templates/{kickstart → kickstart-old}/about/index.html +0 -0
  38. /package/templates/{kickstart → kickstart-old}/assets/logo/placeholder.svg +0 -0
  39. /package/templates/{kickstart → kickstart-old}/blog/index.html +0 -0
  40. /package/templates/{kickstart → kickstart-old}/contact/index.html +0 -0
  41. /package/templates/{kickstart → kickstart-old}/css/custom.css +0 -0
  42. /package/templates/{kickstart → kickstart-old}/docs/index.html +0 -0
  43. /package/templates/{kickstart → kickstart-old}/index.html +0 -0
  44. /package/templates/{kickstart → kickstart-old}/js/app.js +0 -0
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Domma Elements CSS v0.9.5-alpha
2
+ * Domma Elements CSS v0.9.6-alpha
3
3
  * Dynamic Object Manipulation & Modeling API
4
4
  * (c) 2026 Darryl Waterhouse & DCBW-IT
5
- * Built: 2026-01-16T09:03:57.627Z
6
- * Commit: 72d7b45
5
+ * Built: 2026-01-16T11:23:01.077Z
6
+ * Commit: 90ec825
7
7
  */
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Domma Grid CSS v0.9.5-alpha
2
+ * Domma Grid CSS v0.9.6-alpha
3
3
  * Dynamic Object Manipulation & Modeling API
4
4
  * (c) 2026 Darryl Waterhouse & DCBW-IT
5
- * Built: 2026-01-16T09:03:57.619Z
6
- * Commit: 72d7b45
5
+ * Built: 2026-01-16T11:23:01.066Z
6
+ * Commit: 90ec825
7
7
  */
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Domma Syntax Highlighting CSS v0.9.5-alpha
2
+ * Domma Syntax Highlighting CSS v0.9.6-alpha
3
3
  * Dynamic Object Manipulation & Modeling API
4
4
  * (c) 2026 Darryl Waterhouse & DCBW-IT
5
- * Built: 2026-01-16T09:03:57.638Z
6
- * Commit: 72d7b45
5
+ * Built: 2026-01-16T11:23:01.085Z
6
+ * Commit: 90ec825
7
7
  */
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Domma Themes v0.9.5-alpha
2
+ * Domma Themes v0.9.6-alpha
3
3
  * Dynamic Object Manipulation & Modeling API
4
4
  * (c) 2026 Darryl Waterhouse & DCBW-IT
5
- * Built: 2026-01-16T09:03:57.587Z
6
- * Commit: 72d7b45
5
+ * Built: 2026-01-16T11:23:01.020Z
6
+ * Commit: 90ec825
7
7
  */
8
8
 
9
9
  /**
@@ -0,0 +1,139 @@
1
+ # {{projectName}}
2
+
3
+ A modern web project powered by Domma - the lightweight JavaScript framework with zero dependencies.
4
+
5
+ ## Project Structure
6
+
7
+ ```
8
+ {{projectName}}/
9
+ ├── frontend/
10
+ │ ├── dist/ # Domma distribution files
11
+ │ ├── pages/ # All application pages
12
+ │ │ ├── index.html + index.js
13
+ │ │ ├── about/
14
+ │ │ ├── blog/
15
+ │ │ ├── contact/
16
+ │ │ └── docs/
17
+ │ ├── assets/ # Images, logos, etc.
18
+ │ ├── css/custom.css # Your custom styles
19
+ │ └── js/app.js # Global initialization
20
+ ├── backend/ # Backend implementation (future)
21
+ ├── domma.config.json # Project configuration
22
+ └── README.md # This file
23
+ ```
24
+
25
+ ## Getting Started
26
+
27
+ ### 1. View Your Project
28
+
29
+ Open `frontend/pages/index.html` in your browser, or use a development server:
30
+
31
+ ```bash
32
+ # Using Python
33
+ python3 -m http.server 8000
34
+
35
+ # Using Node.js (http-server)
36
+ npx http-server
37
+ ```
38
+
39
+ Then visit `http://localhost:8000/frontend/pages/`
40
+
41
+ ### 2. Customize Your Project
42
+
43
+ Edit `domma.config.json` to configure:
44
+
45
+ - **Theme**: Choose from 16+ built-in themes
46
+ - **Navbar**: Brand, menu items, styling
47
+ - **Footer**: Copyright, links
48
+ - **Features**: Icons, back-to-top, code copy, smooth scroll
49
+
50
+ ### 3. Add New Pages
51
+
52
+ Use the Domma CLI to generate new pages:
53
+
54
+ ```bash
55
+ # Interactive mode (prompts for page name)
56
+ npx domma-js add page
57
+
58
+ # Quick mode (direct creation)
59
+ npx domma-js add page dashboard --quick
60
+ ```
61
+
62
+ This creates:
63
+ - `frontend/pages/dashboard/index.html`
64
+ - `frontend/pages/dashboard/dashboard.js`
65
+
66
+ Don't forget to add the new page to your navbar in `domma.config.json`!
67
+
68
+ ### 4. Add a Backend
69
+
70
+ When ready, follow the instructions in `backend/README.md` to set up a Fastify server with authentication and CORS support.
71
+
72
+ ## Configuration
73
+
74
+ ### Theme
75
+
76
+ Change your theme by editing `domma.config.json`:
77
+
78
+ ```json
79
+ {
80
+ "theme": {
81
+ "default": "ocean-dark",
82
+ "persist": true
83
+ }
84
+ }
85
+ ```
86
+
87
+ Available themes: charcoal-dark, ocean-dark, forest-dark, sunset-light, silver-light, ocean-light, forest-light, sunset-dark, royal-dark, lemon-light, and more.
88
+
89
+ ### Navbar
90
+
91
+ Customize your navigation:
92
+
93
+ ```json
94
+ {
95
+ "navbar": {
96
+ "brand": {
97
+ "text": "My App",
98
+ "logo": "frontend/assets/logo/placeholder.svg"
99
+ },
100
+ "items": [
101
+ { "text": "Home", "url": "/frontend/pages/" },
102
+ { "text": "About", "url": "/frontend/pages/about/" }
103
+ ]
104
+ }
105
+ }
106
+ ```
107
+
108
+ ## Page-Specific JavaScript
109
+
110
+ Each page has its own initialization file:
111
+
112
+ - `frontend/pages/index.js` - Home page logic
113
+ - `frontend/pages/about/about.js` - About page logic
114
+ - `frontend/pages/contact/contact.js` - Contact form handling
115
+ - `frontend/pages/docs/docs.js` - Documentation tabs/navigation
116
+
117
+ Example page initialization:
118
+
119
+ ```javascript
120
+ $(() => {
121
+ // Your page-specific code here
122
+ console.log('Page initialized');
123
+ });
124
+ ```
125
+
126
+ ## Resources
127
+
128
+ - [Domma Documentation](https://github.com/dcbw-it/domma)
129
+ - [Domma API Reference](https://github.com/dcbw-it/domma/blob/main/docs/API.md)
130
+ - [Domma Showcase](https://dcbw-it.github.io/domma/showcase/)
131
+
132
+ ## License
133
+
134
+ This project was generated with Domma CLI.
135
+ Domma is ISC licensed.
136
+
137
+ ---
138
+
139
+ **Built with** [Domma](https://github.com/dcbw-it/domma) • The lightweight JavaScript framework
File without changes
@@ -0,0 +1,160 @@
1
+ # Backend Directory
2
+
3
+ This directory is a placeholder for your backend implementation.
4
+
5
+ ## Future Implementation
6
+
7
+ When you're ready to add a backend, we recommend using **Fastify** with authentication and CORS support.
8
+
9
+ ### Quick Start with Fastify
10
+
11
+ ```bash
12
+ cd backend
13
+ npm init -y
14
+ npm install fastify @fastify/cors @fastify/jwt @fastify/static
15
+ ```
16
+
17
+ ### Basic Server Setup
18
+
19
+ Create `server.js`:
20
+
21
+ ```javascript
22
+ import Fastify from 'fastify';
23
+ import cors from '@fastify/cors';
24
+ import jwt from '@fastify/jwt';
25
+ import staticFiles from '@fastify/static';
26
+ import { join, dirname } from 'path';
27
+ import { fileURLToPath } from 'url';
28
+
29
+ const __dirname = dirname(fileURLToPath(import.meta.url));
30
+ const fastify = Fastify({ logger: true });
31
+
32
+ // JWT Authentication
33
+ await fastify.register(jwt, {
34
+ secret: process.env.JWT_SECRET || 'supersecret-change-in-production'
35
+ });
36
+
37
+ // CORS configuration
38
+ await fastify.register(cors, {
39
+ origin: process.env.CORS_ORIGIN || 'http://localhost:3000',
40
+ credentials: true
41
+ });
42
+
43
+ // Serve frontend files
44
+ await fastify.register(staticFiles, {
45
+ root: join(__dirname, '..', 'frontend'),
46
+ prefix: '/frontend/'
47
+ });
48
+
49
+ // Health check
50
+ fastify.get('/api/health', async () => ({
51
+ status: 'ok',
52
+ timestamp: new Date().toISOString()
53
+ }));
54
+
55
+ // Protected route example
56
+ fastify.get('/api/protected', {
57
+ onRequest: [fastify.authenticate]
58
+ }, async (request, reply) => {
59
+ return { user: request.user };
60
+ });
61
+
62
+ // Authentication middleware
63
+ fastify.decorate('authenticate', async function(request, reply) {
64
+ try {
65
+ await request.jwtVerify();
66
+ } catch (err) {
67
+ reply.send(err);
68
+ }
69
+ });
70
+
71
+ // Start server
72
+ const start = async () => {
73
+ try {
74
+ await fastify.listen({
75
+ port: parseInt(process.env.PORT || '3000'),
76
+ host: '0.0.0.0'
77
+ });
78
+ console.log(`Server running on http://localhost:${fastify.server.address().port}`);
79
+ } catch (err) {
80
+ fastify.log.error(err);
81
+ process.exit(1);
82
+ }
83
+ };
84
+
85
+ start();
86
+ ```
87
+
88
+ ### Authentication
89
+
90
+ For JWT-based authentication:
91
+
92
+ ```javascript
93
+ // Login route
94
+ fastify.post('/api/login', async (request, reply) => {
95
+ const { username, password } = request.body;
96
+
97
+ // Verify credentials (replace with your logic)
98
+ if (username === 'admin' && password === 'password') {
99
+ const token = fastify.jwt.sign({
100
+ id: 1,
101
+ username: 'admin'
102
+ });
103
+
104
+ return { token };
105
+ }
106
+
107
+ reply.code(401).send({ error: 'Invalid credentials' });
108
+ });
109
+ ```
110
+
111
+ ### CORS Configuration
112
+
113
+ The `@fastify/cors` plugin is recommended for handling cross-origin requests:
114
+
115
+ ```javascript
116
+ await fastify.register(cors, {
117
+ origin: [
118
+ 'http://localhost:3000',
119
+ 'https://yourdomain.com'
120
+ ],
121
+ credentials: true,
122
+ methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']
123
+ });
124
+ ```
125
+
126
+ ## Recommended Directory Structure
127
+
128
+ ```
129
+ backend/
130
+ ├── server.js # Entry point
131
+ ├── routes/
132
+ │ ├── api.js # API routes
133
+ │ ├── auth.js # Authentication routes
134
+ │ └── users.js # User management
135
+ ├── middleware/
136
+ │ └── auth.js # Auth middleware
137
+ ├── models/
138
+ │ └── user.js # Data models
139
+ ├── utils/
140
+ │ └── db.js # Database connection
141
+ ├── .env # Environment variables (don't commit!)
142
+ └── package.json
143
+ ```
144
+
145
+ ## Environment Variables
146
+
147
+ Create a `.env` file:
148
+
149
+ ```env
150
+ PORT=3000
151
+ JWT_SECRET=your-secret-key-here
152
+ CORS_ORIGIN=http://localhost:3000
153
+ DATABASE_URL=your-database-url
154
+ ```
155
+
156
+ ## Resources
157
+
158
+ - [Fastify Documentation](https://www.fastify.io/docs/latest/)
159
+ - [@fastify/cors](https://github.com/fastify/fastify-cors)
160
+ - [@fastify/jwt](https://github.com/fastify/fastify-jwt)
@@ -13,30 +13,30 @@
13
13
  "navbar": {
14
14
  "brand": {
15
15
  "text": "{{projectName}}",
16
- "logo": "assets/logo/placeholder.svg",
17
- "url": "/"
16
+ "logo": "frontend/assets/logo/placeholder.svg",
17
+ "url": "/frontend/pages/"
18
18
  },
19
19
  "items": [
20
20
  {
21
21
  "text": "Home",
22
- "url": "/",
22
+ "url": "/frontend/pages/",
23
23
  "active": true
24
24
  },
25
25
  {
26
26
  "text": "About",
27
- "url": "/about/"
27
+ "url": "/frontend/pages/about/"
28
28
  },
29
29
  {
30
30
  "text": "Contact",
31
- "url": "/contact/"
31
+ "url": "/frontend/pages/contact/"
32
32
  },
33
33
  {
34
34
  "text": "Blog",
35
- "url": "/blog/"
35
+ "url": "/frontend/pages/blog/"
36
36
  },
37
37
  {
38
38
  "text": "Docs",
39
- "url": "/docs/"
39
+ "url": "/frontend/pages/docs/"
40
40
  },
41
41
  {
42
42
  "text": "QuickStart",
@@ -53,15 +53,19 @@
53
53
  "links": [
54
54
  {
55
55
  "text": "Privacy Policy",
56
- "url": "#privacy"
56
+ "url": "/frontend/pages/privacy/"
57
+ },
58
+ {
59
+ "text": "Cookie Policy",
60
+ "url": "/frontend/pages/cookies/"
57
61
  },
58
62
  {
59
63
  "text": "Terms of Service",
60
- "url": "#terms"
64
+ "url": "/frontend/pages/terms/"
61
65
  },
62
66
  {
63
67
  "text": "Contact Us",
64
- "url": "/contact/"
68
+ "url": "/frontend/pages/contact/"
65
69
  }
66
70
  ]
67
71
  },
@@ -0,0 +1,6 @@
1
+ <svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect width="40" height="40" rx="8" fill="#3b82f6"/>
3
+ <path d="M12 20L18 14L24 20L30 14" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M12 28L18 22L24 28L30 22" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"
5
+ opacity="0.6"/>
6
+ </svg>
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Custom Styles for {{projectName}}
3
+ * ════════════════════════════════════════════════════════════════
4
+ *
5
+ * This file is loaded after all Domma CSS, allowing you to override
6
+ * theme variables and component styles.
7
+ */
8
+
9
+ /* ────────────────────────────────────────────────────────────────
10
+ * Theme Overrides
11
+ * ────────────────────────────────────────────────────────────────
12
+ * Override any theme variable to customize your brand colors.
13
+ * Full list of variables: https://github.com/dcbw-it/domma
14
+ *
15
+ * Example: Customize primary color
16
+ */
17
+ :root {
18
+ /* Uncomment to override:
19
+ --dm-primary: #3b82f6;
20
+ --dm-primary-hover: #2563eb;
21
+ --dm-primary-text: #ffffff;
22
+ */
23
+ }
24
+
25
+ /* ────────────────────────────────────────────────────────────────
26
+ * Component Overrides
27
+ * ────────────────────────────────────────────────────────────────
28
+ * Override component styles after Domma loads.
29
+ */
30
+
31
+ /* Example: Custom button styles */
32
+ /*
33
+ .btn-custom {
34
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
35
+ border: none;
36
+ color: white;
37
+ }
38
+
39
+ .btn-custom:hover {
40
+ transform: translateY(-2px);
41
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
42
+ }
43
+ */
44
+
45
+ /* ────────────────────────────────────────────────────────────────
46
+ * Layout Customizations
47
+ * ────────────────────────────────────────────────────────────────
48
+ */
49
+
50
+ /* Footer styling */
51
+ .page-footer {
52
+ background-color: var(--dm-surface);
53
+ border-top: 1px solid var(--dm-border);
54
+ padding: var(--dm-space-6) 0;
55
+ margin-top: var(--dm-space-8);
56
+ }
57
+
58
+ .footer-content {
59
+ max-width: 1200px;
60
+ margin: 0 auto;
61
+ padding: 0 var(--dm-space-4);
62
+ display: flex;
63
+ justify-content: space-between;
64
+ align-items: center;
65
+ flex-wrap: wrap;
66
+ gap: var(--dm-space-4);
67
+ }
68
+
69
+ .footer-content p {
70
+ margin: 0;
71
+ color: var(--dm-text-secondary);
72
+ }
73
+
74
+ .footer-nav {
75
+ display: flex;
76
+ gap: var(--dm-space-6);
77
+ }
78
+
79
+ .footer-nav a {
80
+ color: var(--dm-text-secondary);
81
+ text-decoration: none;
82
+ transition: color 0.2s ease;
83
+ }
84
+
85
+ .footer-nav a:hover {
86
+ color: var(--dm-primary);
87
+ }
88
+
89
+ /* Code copy button styling */
90
+ .code-copy-btn {
91
+ position: absolute;
92
+ top: var(--dm-space-2);
93
+ right: var(--dm-space-2);
94
+ opacity: 0.7;
95
+ }
96
+
97
+ .code-copy-btn:hover {
98
+ opacity: 1;
99
+ }
100
+
101
+ /* ────────────────────────────────────────────────────────────────
102
+ * Responsive Adjustments
103
+ * ────────────────────────────────────────────────────────────────
104
+ */
105
+ @media (max-width: 768px) {
106
+ .footer-content {
107
+ flex-direction: column;
108
+ text-align: center;
109
+ }
110
+
111
+ .footer-nav {
112
+ flex-direction: column;
113
+ gap: var(--dm-space-2);
114
+ }
115
+ }
116
+
117
+ /* ────────────────────────────────────────────────────────────────
118
+ * Your Custom Styles
119
+ * ────────────────────────────────────────────────────────────────
120
+ * Add your project-specific styles below this line.
121
+ */