@currentjs/gen 0.3.0 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -6,38 +6,158 @@ All notable changes to this project will be documented in this file.
6
6
 
7
7
 
8
8
 
9
+
10
+
11
+ ## [0.3.2] - 2025-12-28
12
+
13
+ fixed an issue 6
14
+
15
+ ## [0.3.1] - 2025-10-03
16
+
17
+ bug fixed with overwriting committed changes
18
+
19
+
20
+ ## [0.3.2] - 2025-12-28
21
+
22
+ fixed an issue 6
23
+
9
24
  ## [0.3.0] - 2025-10-03
10
25
 
11
26
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
12
27
 
28
+
29
+
30
+ ## [0.3.2] - 2025-12-28
31
+
32
+ fixed an issue 6
33
+
34
+ ## [0.3.1] - 2025-10-03
35
+
36
+ bug fixed with overwriting committed changes
37
+
38
+
39
+ ## [0.3.2] - 2025-12-28
40
+
41
+ fixed an issue 6
42
+
13
43
  ## [0.2.2] - 2025-10-02
14
44
 
15
45
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
16
46
 
17
47
 
48
+
49
+
50
+ ## [0.3.2] - 2025-12-28
51
+
52
+ fixed an issue 6
53
+
54
+ ## [0.3.1] - 2025-10-03
55
+
56
+ bug fixed with overwriting committed changes
57
+
58
+
59
+ ## [0.3.2] - 2025-12-28
60
+
61
+ fixed an issue 6
62
+
18
63
  ## [0.3.0] - 2025-10-03
19
64
 
20
65
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
21
66
 
67
+
68
+
69
+ ## [0.3.2] - 2025-12-28
70
+
71
+ fixed an issue 6
72
+
73
+ ## [0.3.1] - 2025-10-03
74
+
75
+ bug fixed with overwriting committed changes
76
+
77
+
78
+ ## [0.3.2] - 2025-12-28
79
+
80
+ fixed an issue 6
81
+
22
82
  ## [0.2.1] - 2025-09-18
23
83
 
24
84
  Improve generated package.json
25
85
 
26
86
 
27
87
 
88
+
89
+
90
+ ## [0.3.2] - 2025-12-28
91
+
92
+ fixed an issue 6
93
+
94
+ ## [0.3.1] - 2025-10-03
95
+
96
+ bug fixed with overwriting committed changes
97
+
98
+
99
+ ## [0.3.2] - 2025-12-28
100
+
101
+ fixed an issue 6
102
+
28
103
  ## [0.3.0] - 2025-10-03
29
104
 
30
105
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
31
106
 
107
+
108
+
109
+ ## [0.3.2] - 2025-12-28
110
+
111
+ fixed an issue 6
112
+
113
+ ## [0.3.1] - 2025-10-03
114
+
115
+ bug fixed with overwriting committed changes
116
+
117
+
118
+ ## [0.3.2] - 2025-12-28
119
+
120
+ fixed an issue 6
121
+
32
122
  ## [0.2.2] - 2025-10-02
33
123
 
34
124
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
35
125
 
36
126
 
127
+
128
+
129
+ ## [0.3.2] - 2025-12-28
130
+
131
+ fixed an issue 6
132
+
133
+ ## [0.3.1] - 2025-10-03
134
+
135
+ bug fixed with overwriting committed changes
136
+
137
+
138
+ ## [0.3.2] - 2025-12-28
139
+
140
+ fixed an issue 6
141
+
37
142
  ## [0.3.0] - 2025-10-03
38
143
 
39
144
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
40
145
 
146
+
147
+
148
+ ## [0.3.2] - 2025-12-28
149
+
150
+ fixed an issue 6
151
+
152
+ ## [0.3.1] - 2025-10-03
153
+
154
+ bug fixed with overwriting committed changes
155
+
156
+
157
+ ## [0.3.2] - 2025-12-28
158
+
159
+ fixed an issue 6
160
+
41
161
  ## [0.2.0] - 2025-09-18
42
162
 
43
163
  implement multi-model generation (controllers, services); fix service-controller interaction; update documentation: more clear & reflect important things
@@ -45,38 +165,158 @@ implement multi-model generation (controllers, services); fix service-controller
45
165
 
46
166
 
47
167
 
168
+
169
+
170
+ ## [0.3.2] - 2025-12-28
171
+
172
+ fixed an issue 6
173
+
174
+ ## [0.3.1] - 2025-10-03
175
+
176
+ bug fixed with overwriting committed changes
177
+
178
+
179
+ ## [0.3.2] - 2025-12-28
180
+
181
+ fixed an issue 6
182
+
48
183
  ## [0.3.0] - 2025-10-03
49
184
 
50
185
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
51
186
 
187
+
188
+
189
+ ## [0.3.2] - 2025-12-28
190
+
191
+ fixed an issue 6
192
+
193
+ ## [0.3.1] - 2025-10-03
194
+
195
+ bug fixed with overwriting committed changes
196
+
197
+
198
+ ## [0.3.2] - 2025-12-28
199
+
200
+ fixed an issue 6
201
+
52
202
  ## [0.2.2] - 2025-10-02
53
203
 
54
204
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
55
205
 
56
206
 
207
+
208
+
209
+ ## [0.3.2] - 2025-12-28
210
+
211
+ fixed an issue 6
212
+
213
+ ## [0.3.1] - 2025-10-03
214
+
215
+ bug fixed with overwriting committed changes
216
+
217
+
218
+ ## [0.3.2] - 2025-12-28
219
+
220
+ fixed an issue 6
221
+
57
222
  ## [0.3.0] - 2025-10-03
58
223
 
59
224
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
60
225
 
226
+
227
+
228
+ ## [0.3.2] - 2025-12-28
229
+
230
+ fixed an issue 6
231
+
232
+ ## [0.3.1] - 2025-10-03
233
+
234
+ bug fixed with overwriting committed changes
235
+
236
+
237
+ ## [0.3.2] - 2025-12-28
238
+
239
+ fixed an issue 6
240
+
61
241
  ## [0.2.1] - 2025-09-18
62
242
 
63
243
  Improve generated package.json
64
244
 
65
245
 
66
246
 
247
+
248
+
249
+ ## [0.3.2] - 2025-12-28
250
+
251
+ fixed an issue 6
252
+
253
+ ## [0.3.1] - 2025-10-03
254
+
255
+ bug fixed with overwriting committed changes
256
+
257
+
258
+ ## [0.3.2] - 2025-12-28
259
+
260
+ fixed an issue 6
261
+
67
262
  ## [0.3.0] - 2025-10-03
68
263
 
69
264
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
70
265
 
266
+
267
+
268
+ ## [0.3.2] - 2025-12-28
269
+
270
+ fixed an issue 6
271
+
272
+ ## [0.3.1] - 2025-10-03
273
+
274
+ bug fixed with overwriting committed changes
275
+
276
+
277
+ ## [0.3.2] - 2025-12-28
278
+
279
+ fixed an issue 6
280
+
71
281
  ## [0.2.2] - 2025-10-02
72
282
 
73
283
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
74
284
 
75
285
 
286
+
287
+
288
+ ## [0.3.2] - 2025-12-28
289
+
290
+ fixed an issue 6
291
+
292
+ ## [0.3.1] - 2025-10-03
293
+
294
+ bug fixed with overwriting committed changes
295
+
296
+
297
+ ## [0.3.2] - 2025-12-28
298
+
299
+ fixed an issue 6
300
+
76
301
  ## [0.3.0] - 2025-10-03
77
302
 
78
303
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
79
304
 
305
+
306
+
307
+ ## [0.3.2] - 2025-12-28
308
+
309
+ fixed an issue 6
310
+
311
+ ## [0.3.1] - 2025-10-03
312
+
313
+ bug fixed with overwriting committed changes
314
+
315
+
316
+ ## [0.3.2] - 2025-12-28
317
+
318
+ fixed an issue 6
319
+
80
320
  ## [0.1.2] - 2025-09-18
81
321
 
82
322
  fix: failed to generate with empty permissions actions
@@ -85,38 +325,158 @@ fix: failed to generate with empty permissions actions
85
325
 
86
326
 
87
327
 
328
+
329
+
330
+ ## [0.3.2] - 2025-12-28
331
+
332
+ fixed an issue 6
333
+
334
+ ## [0.3.1] - 2025-10-03
335
+
336
+ bug fixed with overwriting committed changes
337
+
338
+
339
+ ## [0.3.2] - 2025-12-28
340
+
341
+ fixed an issue 6
342
+
88
343
  ## [0.3.0] - 2025-10-03
89
344
 
90
345
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
91
346
 
347
+
348
+
349
+ ## [0.3.2] - 2025-12-28
350
+
351
+ fixed an issue 6
352
+
353
+ ## [0.3.1] - 2025-10-03
354
+
355
+ bug fixed with overwriting committed changes
356
+
357
+
358
+ ## [0.3.2] - 2025-12-28
359
+
360
+ fixed an issue 6
361
+
92
362
  ## [0.2.2] - 2025-10-02
93
363
 
94
364
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
95
365
 
96
366
 
367
+
368
+
369
+ ## [0.3.2] - 2025-12-28
370
+
371
+ fixed an issue 6
372
+
373
+ ## [0.3.1] - 2025-10-03
374
+
375
+ bug fixed with overwriting committed changes
376
+
377
+
378
+ ## [0.3.2] - 2025-12-28
379
+
380
+ fixed an issue 6
381
+
97
382
  ## [0.3.0] - 2025-10-03
98
383
 
99
384
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
100
385
 
386
+
387
+
388
+ ## [0.3.2] - 2025-12-28
389
+
390
+ fixed an issue 6
391
+
392
+ ## [0.3.1] - 2025-10-03
393
+
394
+ bug fixed with overwriting committed changes
395
+
396
+
397
+ ## [0.3.2] - 2025-12-28
398
+
399
+ fixed an issue 6
400
+
101
401
  ## [0.2.1] - 2025-09-18
102
402
 
103
403
  Improve generated package.json
104
404
 
105
405
 
106
406
 
407
+
408
+
409
+ ## [0.3.2] - 2025-12-28
410
+
411
+ fixed an issue 6
412
+
413
+ ## [0.3.1] - 2025-10-03
414
+
415
+ bug fixed with overwriting committed changes
416
+
417
+
418
+ ## [0.3.2] - 2025-12-28
419
+
420
+ fixed an issue 6
421
+
107
422
  ## [0.3.0] - 2025-10-03
108
423
 
109
424
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
110
425
 
426
+
427
+
428
+ ## [0.3.2] - 2025-12-28
429
+
430
+ fixed an issue 6
431
+
432
+ ## [0.3.1] - 2025-10-03
433
+
434
+ bug fixed with overwriting committed changes
435
+
436
+
437
+ ## [0.3.2] - 2025-12-28
438
+
439
+ fixed an issue 6
440
+
111
441
  ## [0.2.2] - 2025-10-02
112
442
 
113
443
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
114
444
 
115
445
 
446
+
447
+
448
+ ## [0.3.2] - 2025-12-28
449
+
450
+ fixed an issue 6
451
+
452
+ ## [0.3.1] - 2025-10-03
453
+
454
+ bug fixed with overwriting committed changes
455
+
456
+
457
+ ## [0.3.2] - 2025-12-28
458
+
459
+ fixed an issue 6
460
+
116
461
  ## [0.3.0] - 2025-10-03
117
462
 
118
463
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
119
464
 
465
+
466
+
467
+ ## [0.3.2] - 2025-12-28
468
+
469
+ fixed an issue 6
470
+
471
+ ## [0.3.1] - 2025-10-03
472
+
473
+ bug fixed with overwriting committed changes
474
+
475
+
476
+ ## [0.3.2] - 2025-12-28
477
+
478
+ fixed an issue 6
479
+
120
480
  ## [0.2.0] - 2025-09-18
121
481
 
122
482
  implement multi-model generation (controllers, services); fix service-controller interaction; update documentation: more clear & reflect important things
@@ -124,38 +484,158 @@ implement multi-model generation (controllers, services); fix service-controller
124
484
 
125
485
 
126
486
 
487
+
488
+
489
+ ## [0.3.2] - 2025-12-28
490
+
491
+ fixed an issue 6
492
+
493
+ ## [0.3.1] - 2025-10-03
494
+
495
+ bug fixed with overwriting committed changes
496
+
497
+
498
+ ## [0.3.2] - 2025-12-28
499
+
500
+ fixed an issue 6
501
+
127
502
  ## [0.3.0] - 2025-10-03
128
503
 
129
504
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
130
505
 
506
+
507
+
508
+ ## [0.3.2] - 2025-12-28
509
+
510
+ fixed an issue 6
511
+
512
+ ## [0.3.1] - 2025-10-03
513
+
514
+ bug fixed with overwriting committed changes
515
+
516
+
517
+ ## [0.3.2] - 2025-12-28
518
+
519
+ fixed an issue 6
520
+
131
521
  ## [0.2.2] - 2025-10-02
132
522
 
133
523
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
134
524
 
135
525
 
526
+
527
+
528
+ ## [0.3.2] - 2025-12-28
529
+
530
+ fixed an issue 6
531
+
532
+ ## [0.3.1] - 2025-10-03
533
+
534
+ bug fixed with overwriting committed changes
535
+
536
+
537
+ ## [0.3.2] - 2025-12-28
538
+
539
+ fixed an issue 6
540
+
136
541
  ## [0.3.0] - 2025-10-03
137
542
 
138
543
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
139
544
 
545
+
546
+
547
+ ## [0.3.2] - 2025-12-28
548
+
549
+ fixed an issue 6
550
+
551
+ ## [0.3.1] - 2025-10-03
552
+
553
+ bug fixed with overwriting committed changes
554
+
555
+
556
+ ## [0.3.2] - 2025-12-28
557
+
558
+ fixed an issue 6
559
+
140
560
  ## [0.2.1] - 2025-09-18
141
561
 
142
562
  Improve generated package.json
143
563
 
144
564
 
145
565
 
566
+
567
+
568
+ ## [0.3.2] - 2025-12-28
569
+
570
+ fixed an issue 6
571
+
572
+ ## [0.3.1] - 2025-10-03
573
+
574
+ bug fixed with overwriting committed changes
575
+
576
+
577
+ ## [0.3.2] - 2025-12-28
578
+
579
+ fixed an issue 6
580
+
146
581
  ## [0.3.0] - 2025-10-03
147
582
 
148
583
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
149
584
 
585
+
586
+
587
+ ## [0.3.2] - 2025-12-28
588
+
589
+ fixed an issue 6
590
+
591
+ ## [0.3.1] - 2025-10-03
592
+
593
+ bug fixed with overwriting committed changes
594
+
595
+
596
+ ## [0.3.2] - 2025-12-28
597
+
598
+ fixed an issue 6
599
+
150
600
  ## [0.2.2] - 2025-10-02
151
601
 
152
602
  fix bug: required params after optional in the generated models; fix: views(templates) are not stored in the registry and being regenerated (overwritten); small readme fix; running 'npm i' on 'create app' and 'npm run build' on 'generate'
153
603
 
154
604
 
605
+
606
+
607
+ ## [0.3.2] - 2025-12-28
608
+
609
+ fixed an issue 6
610
+
611
+ ## [0.3.1] - 2025-10-03
612
+
613
+ bug fixed with overwriting committed changes
614
+
615
+
616
+ ## [0.3.2] - 2025-12-28
617
+
618
+ fixed an issue 6
619
+
155
620
  ## [0.3.0] - 2025-10-03
156
621
 
157
622
  - model relationship (between each other); - frontend script cleanup; - new command: migrate commit; - small refactoring.
158
623
 
624
+
625
+
626
+ ## [0.3.2] - 2025-12-28
627
+
628
+ fixed an issue 6
629
+
630
+ ## [0.3.1] - 2025-10-03
631
+
632
+ bug fixed with overwriting committed changes
633
+
634
+
635
+ ## [0.3.2] - 2025-12-28
636
+
637
+ fixed an issue 6
638
+
159
639
  ## [0.1.1] - 2025-09-17
160
640
 
161
641
  Initial release
@@ -394,8 +394,7 @@ window.AppConfig = {
394
394
  target.innerHTML = html;
395
395
  // Update browser history
396
396
  window.history.pushState({}, '', url);
397
- // Re-initialize event listeners for new content
398
- initializeEventListeners();
397
+ // No need to re-initialize - delegation handles new content automatically
399
398
  })
400
399
  .catch(error => {
401
400
  console.error('Navigation failed:', error);
@@ -616,56 +615,52 @@ window.AppConfig = {
616
615
  // ===== INITIALIZATION =====
617
616
 
618
617
  /**
619
- * Initialize event listeners for links and forms
618
+ * Initialize event delegation for links and forms
619
+ * Uses document-level listeners that work for all current and future elements
620
620
  */
621
621
  function initializeEventListeners() {
622
- // Handle internal links
623
- document.querySelectorAll('a[href]').forEach(link => {
622
+ // Only initialize once
623
+ if (window._appEventListenersInitialized) return;
624
+ window._appEventListenersInitialized = true;
625
+
626
+ // Handle all link clicks via delegation
627
+ document.addEventListener('click', function(event) {
628
+ const link = event.target.closest('a[href]');
629
+ if (!link) return;
630
+
624
631
  const href = link.getAttribute('href');
625
-
632
+
626
633
  // Skip external links, anchors, and special protocols
627
- if (!href ||
628
- href.startsWith('http://') ||
629
- href.startsWith('https://') ||
630
- href.startsWith('mailto:') ||
631
- href.startsWith('tel:') ||
634
+ if (!href ||
635
+ href.startsWith('http://') ||
636
+ href.startsWith('https://') ||
637
+ href.startsWith('mailto:') ||
638
+ href.startsWith('tel:') ||
632
639
  href.startsWith('#') ||
633
640
  href.startsWith('javascript:')) {
634
641
  return;
635
642
  }
636
-
637
- // Remove any existing event listeners and add new one
638
- link.removeEventListener('click', handleLinkClick);
639
- link.addEventListener('click', handleLinkClick);
640
- });
641
-
642
- // Handle forms with strategy
643
- document.querySelectorAll('form[data-strategy]').forEach(form => {
644
- // Remove any existing event listeners and add new one
645
- form.removeEventListener('submit', handleFormSubmit);
646
- form.addEventListener('submit', handleFormSubmit);
647
- });
648
- }
649
643
 
650
- /**
651
- * Handle link click for internal navigation
652
- * @param {Event} event - Click event
653
- */
654
- function handleLinkClick(event) {
655
- event.preventDefault();
656
- const href = event.currentTarget.getAttribute('href');
657
- if (href) {
644
+ event.preventDefault();
658
645
  navigateToPage(href);
659
- }
646
+ });
647
+
648
+ // Handle all form submissions via delegation
649
+ document.addEventListener('submit', function(event) {
650
+ const form = event.target.closest('form[data-strategy]');
651
+ if (!form) return;
652
+
653
+ event.preventDefault();
654
+ handleFormSubmit(event, form);
655
+ });
660
656
  }
661
657
 
662
658
  /**
663
659
  * Handle form submission
664
660
  * @param {Event} event - Submit event
665
661
  */
666
- function handleFormSubmit(event) {
667
- event.preventDefault();
668
- const form = event.target;
662
+ function handleFormSubmit(event, form) {
663
+ //const form = event.target.closest ? event.target.closest('form') : event.target;
669
664
 
670
665
  // Check for confirmation message
671
666
  const confirmMessage = form.getAttribute('data-confirm-message');
@@ -158,7 +158,7 @@ async function writeGeneratedFile(filePath, contents, options) {
158
158
  const applied = (0, commitUtils_1.tryApplyCommitsToGenerated)(abs, contents);
159
159
  if (applied.applied) {
160
160
  fs.writeFileSync(abs, applied.content);
161
- updateStoredHash(abs, computeContentHash(applied.content));
161
+ updateStoredHash(abs, newHash);
162
162
  if (!silent)
163
163
  console.log(colors_1.colors.cyan(`Updated (with commits) ${rel}`));
164
164
  return 'written';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@currentjs/gen",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "CLI code generator",
5
5
  "license": "LGPL-3.0",
6
6
  "author": "Konstantin Zavalny",