@memberjunction/cli 5.6.0 → 5.8.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.
@@ -424,146 +424,68 @@
424
424
  "index.js"
425
425
  ]
426
426
  },
427
- "dbdoc:analyze": {
427
+ "codegen:5-0-fix-entity-names": {
428
428
  "aliases": [],
429
429
  "args": {},
430
- "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
430
+ "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema,\n ActionEntityExtended -> MJActionEntityExtended (extended subclasses),\n ActionEntityServerEntity -> MJActionEntityServer (server subclass suffix standardization),\n ActionFormComponentExtended -> MJActionFormComponentExtended (Angular form components).\n Explicit subclass mappings (57 entries from subclass-rename-map.json) take priority over\n auto-generated suffix rules, enabling suffix changes (e.g., _Server -> Server, ServerEntity -> Server).\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entity entries + 57 subclass entries) is built from entity_subclasses.ts @RegisterClass\ndecorators plus embedded rename maps. Runs in dry-run mode by default; use --fix to apply.",
431
431
  "examples": [
432
- "<%= config.bin %> <%= command.id %>",
433
- "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
434
- "<%= config.bin %> <%= command.id %> --config ./my-config.json"
435
- ],
436
- "flags": {
437
- "resume": {
438
- "char": "r",
439
- "description": "Resume from an existing state file",
440
- "name": "resume",
441
- "required": false,
442
- "hasDynamicHelp": false,
443
- "multiple": false,
444
- "type": "option"
432
+ {
433
+ "description": "Dry-run scan of the packages directory",
434
+ "command": "<%= config.bin %> <%= command.id %> --path packages/"
445
435
  },
446
- "config": {
447
- "char": "c",
448
- "description": "Path to config file",
449
- "name": "config",
450
- "default": "./config.json",
451
- "hasDynamicHelp": false,
452
- "multiple": false,
453
- "type": "option"
436
+ {
437
+ "description": "Scan a single file",
438
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/components/actions-overview.component.ts"
439
+ },
440
+ {
441
+ "description": "Apply fixes across the codebase",
442
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ --fix"
443
+ },
444
+ {
445
+ "description": "Quiet mode (summary only)",
446
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ -q"
454
447
  }
455
- },
456
- "hasDynamicHelp": false,
457
- "hiddenAliases": [],
458
- "id": "dbdoc:analyze",
459
- "pluginAlias": "@memberjunction/cli",
460
- "pluginName": "@memberjunction/cli",
461
- "pluginType": "core",
462
- "strict": true,
463
- "enableJsonFlag": false,
464
- "isESM": true,
465
- "relativePath": [
466
- "dist",
467
- "commands",
468
- "dbdoc",
469
- "analyze.js"
470
- ]
471
- },
472
- "dbdoc:export-sample-queries": {
473
- "aliases": [],
474
- "args": {},
475
- "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
476
- "examples": [
477
- "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
478
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
479
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
480
- "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
481
448
  ],
482
449
  "flags": {
483
- "input": {
484
- "char": "i",
485
- "description": "Path to sample-queries.json file generated by generate-queries command",
486
- "name": "input",
487
- "required": true,
488
- "hasDynamicHelp": false,
489
- "multiple": false,
490
- "type": "option"
491
- },
492
- "output": {
493
- "char": "o",
494
- "description": "Output path for the .queries.json metadata file",
495
- "name": "output",
496
- "required": true,
450
+ "path": {
451
+ "char": "p",
452
+ "description": "File or directory to scan. Accepts a single .ts file or a directory (scanned recursively). Defaults to the current working directory.",
453
+ "name": "path",
497
454
  "hasDynamicHelp": false,
498
455
  "multiple": false,
499
456
  "type": "option"
500
457
  },
501
- "separate-sql-files": {
502
- "description": "Write SQL to separate files and use @file: references",
503
- "name": "separate-sql-files",
458
+ "fix": {
459
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
460
+ "name": "fix",
504
461
  "allowNo": false,
505
462
  "type": "boolean"
506
463
  },
507
- "sql-dir": {
508
- "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
509
- "name": "sql-dir",
510
- "default": "SQL",
511
- "hasDynamicHelp": false,
512
- "multiple": false,
513
- "type": "option"
514
- },
515
- "category": {
516
- "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
517
- "name": "category",
518
- "required": false,
519
- "hasDynamicHelp": false,
520
- "multiple": false,
521
- "type": "option"
522
- },
523
- "status": {
524
- "description": "Status to assign to exported queries",
525
- "name": "status",
526
- "default": "Pending",
527
- "hasDynamicHelp": false,
528
- "multiple": false,
529
- "options": [
530
- "Approved",
531
- "Pending",
532
- "Rejected",
533
- "Expired"
534
- ],
535
- "type": "option"
536
- },
537
- "min-confidence": {
538
- "description": "Minimum confidence threshold to export (0-1)",
539
- "name": "min-confidence",
540
- "default": "0",
464
+ "entity-subclasses": {
465
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
466
+ "name": "entity-subclasses",
541
467
  "hasDynamicHelp": false,
542
468
  "multiple": false,
543
469
  "type": "option"
544
470
  },
545
- "validated-only": {
546
- "description": "Only export queries that were successfully validated",
547
- "name": "validated-only",
548
- "allowNo": false,
549
- "type": "boolean"
550
- },
551
- "append": {
552
- "description": "Append to existing metadata file instead of overwriting",
553
- "name": "append",
471
+ "quiet": {
472
+ "char": "q",
473
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
474
+ "name": "quiet",
554
475
  "allowNo": false,
555
476
  "type": "boolean"
556
477
  },
557
- "include-primary-key": {
558
- "description": "Include primaryKey and sync fields (for updating existing records)",
559
- "name": "include-primary-key",
478
+ "verbose": {
479
+ "char": "v",
480
+ "description": "Show detailed progress including each file being scanned.",
481
+ "name": "verbose",
560
482
  "allowNo": false,
561
483
  "type": "boolean"
562
484
  }
563
485
  },
564
486
  "hasDynamicHelp": false,
565
487
  "hiddenAliases": [],
566
- "id": "dbdoc:export-sample-queries",
488
+ "id": "codegen:5-0-fix-entity-names",
567
489
  "pluginAlias": "@memberjunction/cli",
568
490
  "pluginName": "@memberjunction/cli",
569
491
  "pluginType": "core",
@@ -573,100 +495,72 @@
573
495
  "relativePath": [
574
496
  "dist",
575
497
  "commands",
576
- "dbdoc",
577
- "export-sample-queries.js"
498
+ "codegen",
499
+ "5-0-fix-entity-names.js"
578
500
  ]
579
501
  },
580
- "dbdoc:export": {
502
+ "codegen:5-0-fix-html-entity-names": {
581
503
  "aliases": [],
582
504
  "args": {},
583
- "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
505
+ "description": "[v5.0 Migration] Scan Angular HTML template files for hardcoded entity names that need \"MJ: \" prefix updates.\n\nUses targeted regex patterns to find entity name references in template expressions\nand attribute values. Detects method calls like navigateToEntity('Actions'),\nOpenEntityRecord('Entities', id), and attribute values like RowsEntityName=\"Users\".\nRuns in dry-run mode by default; use --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
584
506
  "examples": [
585
- "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
586
- "<%= config.bin %> <%= command.id %> --sql",
587
- "<%= config.bin %> <%= command.id %> --markdown",
588
- "<%= config.bin %> <%= command.id %> --html",
589
- "<%= config.bin %> <%= command.id %> --csv",
590
- "<%= config.bin %> <%= command.id %> --mermaid",
591
- "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
507
+ {
508
+ "description": "Dry-run scan of Angular templates",
509
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/"
510
+ },
511
+ {
512
+ "description": "Apply fixes to HTML templates",
513
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/ --fix"
514
+ },
515
+ {
516
+ "description": "Scan with verbose output",
517
+ "command": "<%= config.bin %> <%= command.id %> --path packages/ -v"
518
+ },
519
+ {
520
+ "description": "Scan a single template file",
521
+ "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/actions-dashboard.component.html"
522
+ }
592
523
  ],
593
524
  "flags": {
594
- "state-file": {
595
- "char": "s",
596
- "description": "Path to state JSON file",
597
- "name": "state-file",
598
- "hasDynamicHelp": false,
599
- "multiple": false,
600
- "type": "option"
601
- },
602
- "output-dir": {
603
- "char": "o",
604
- "description": "Output directory for generated files",
605
- "name": "output-dir",
525
+ "path": {
526
+ "char": "p",
527
+ "description": "File or directory to scan. Accepts a single .html file or a directory (scanned recursively). Defaults to the current working directory.",
528
+ "name": "path",
606
529
  "hasDynamicHelp": false,
607
530
  "multiple": false,
608
531
  "type": "option"
609
532
  },
610
- "sql": {
611
- "description": "Generate SQL script",
612
- "name": "sql",
613
- "allowNo": false,
614
- "type": "boolean"
615
- },
616
- "markdown": {
617
- "description": "Generate Markdown documentation",
618
- "name": "markdown",
619
- "allowNo": false,
620
- "type": "boolean"
621
- },
622
- "html": {
623
- "description": "Generate interactive HTML documentation",
624
- "name": "html",
625
- "allowNo": false,
626
- "type": "boolean"
627
- },
628
- "csv": {
629
- "description": "Generate CSV exports (tables and columns)",
630
- "name": "csv",
631
- "allowNo": false,
632
- "type": "boolean"
633
- },
634
- "mermaid": {
635
- "description": "Generate Mermaid ERD diagram files",
636
- "name": "mermaid",
533
+ "fix": {
534
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
535
+ "name": "fix",
637
536
  "allowNo": false,
638
537
  "type": "boolean"
639
538
  },
640
- "report": {
641
- "description": "Generate analysis report",
642
- "name": "report",
643
- "allowNo": false,
644
- "type": "boolean"
539
+ "entity-subclasses": {
540
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
541
+ "name": "entity-subclasses",
542
+ "hasDynamicHelp": false,
543
+ "multiple": false,
544
+ "type": "option"
645
545
  },
646
- "apply": {
647
- "description": "Apply SQL to database",
648
- "name": "apply",
546
+ "quiet": {
547
+ "char": "q",
548
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
549
+ "name": "quiet",
649
550
  "allowNo": false,
650
551
  "type": "boolean"
651
552
  },
652
- "approved-only": {
653
- "description": "Only export approved items",
654
- "name": "approved-only",
553
+ "verbose": {
554
+ "char": "v",
555
+ "description": "Show detailed progress including each file being scanned.",
556
+ "name": "verbose",
655
557
  "allowNo": false,
656
558
  "type": "boolean"
657
- },
658
- "confidence-threshold": {
659
- "description": "Minimum confidence threshold",
660
- "name": "confidence-threshold",
661
- "default": "0",
662
- "hasDynamicHelp": false,
663
- "multiple": false,
664
- "type": "option"
665
559
  }
666
560
  },
667
561
  "hasDynamicHelp": false,
668
562
  "hiddenAliases": [],
669
- "id": "dbdoc:export",
563
+ "id": "codegen:5-0-fix-html-entity-names",
670
564
  "pluginAlias": "@memberjunction/cli",
671
565
  "pluginName": "@memberjunction/cli",
672
566
  "pluginType": "core",
@@ -676,87 +570,72 @@
676
570
  "relativePath": [
677
571
  "dist",
678
572
  "commands",
679
- "dbdoc",
680
- "export.js"
573
+ "codegen",
574
+ "5-0-fix-html-entity-names.js"
681
575
  ]
682
576
  },
683
- "dbdoc:generate-queries": {
577
+ "codegen:5-0-fix-metadata-names": {
684
578
  "aliases": [],
685
579
  "args": {},
686
- "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
580
+ "description": "[v5.0 Migration] Scan metadata JSON files for entity names that need \"MJ: \" prefix updates.\n\nTargets the metadata/ directory used by \"mj sync\". Detects entity name references in\n@lookup: directives (both the entity name and lookup value), .mj-sync.json and\n.mj-folder.json config files (entity/entityName fields), relatedEntities object keys,\nand fields.Name values in Entities-managing folders. Runs in dry-run mode by default;\nuse --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
687
581
  "examples": [
688
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
689
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
690
- "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
582
+ {
583
+ "description": "Dry-run scan of the metadata directory",
584
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/"
585
+ },
586
+ {
587
+ "description": "Apply fixes to metadata files",
588
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/ --fix"
589
+ },
590
+ {
591
+ "description": "Scan a specific subdirectory",
592
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/resource-types"
593
+ },
594
+ {
595
+ "description": "Scan and fix a single metadata file",
596
+ "command": "<%= config.bin %> <%= command.id %> --path metadata/entities/.audit-related-entities.json --fix"
597
+ }
691
598
  ],
692
599
  "flags": {
693
- "from-state": {
694
- "description": "Path to existing state.json file from previous analysis",
695
- "name": "from-state",
696
- "required": true,
600
+ "path": {
601
+ "char": "p",
602
+ "description": "File or directory to scan. Accepts a single .json file or a directory (scanned recursively, including dotfiles like .mj-sync.json). Defaults to the current working directory.",
603
+ "name": "path",
697
604
  "hasDynamicHelp": false,
698
605
  "multiple": false,
699
606
  "type": "option"
700
607
  },
701
- "output-dir": {
702
- "description": "Output directory for generated queries",
703
- "name": "output-dir",
704
- "required": false,
705
- "hasDynamicHelp": false,
706
- "multiple": false,
707
- "type": "option"
608
+ "fix": {
609
+ "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
610
+ "name": "fix",
611
+ "allowNo": false,
612
+ "type": "boolean"
708
613
  },
709
- "config": {
710
- "char": "c",
711
- "description": "Path to config file (for database connection and AI settings)",
712
- "name": "config",
713
- "default": "./config.json",
614
+ "entity-subclasses": {
615
+ "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
616
+ "name": "entity-subclasses",
714
617
  "hasDynamicHelp": false,
715
618
  "multiple": false,
716
619
  "type": "option"
717
620
  },
718
- "queries-per-table": {
719
- "description": "Number of queries to generate per table",
720
- "name": "queries-per-table",
721
- "required": false,
722
- "hasDynamicHelp": false,
723
- "multiple": false,
724
- "type": "option"
621
+ "quiet": {
622
+ "char": "q",
623
+ "description": "Suppress detailed per-file output; only show the final summary counts.",
624
+ "name": "quiet",
625
+ "allowNo": false,
626
+ "type": "boolean"
725
627
  },
726
- "max-execution-time": {
727
- "description": "Maximum execution time for query validation (ms)",
728
- "name": "max-execution-time",
729
- "required": false,
730
- "hasDynamicHelp": false,
731
- "multiple": false,
732
- "type": "option"
628
+ "verbose": {
629
+ "char": "v",
630
+ "description": "Show detailed progress including each file being scanned.",
631
+ "name": "verbose",
632
+ "allowNo": false,
633
+ "type": "boolean"
733
634
  }
734
635
  },
735
636
  "hasDynamicHelp": false,
736
637
  "hiddenAliases": [],
737
- "id": "dbdoc:generate-queries",
738
- "pluginAlias": "@memberjunction/cli",
739
- "pluginName": "@memberjunction/cli",
740
- "pluginType": "core",
741
- "strict": true,
742
- "enableJsonFlag": false,
743
- "isESM": true,
744
- "relativePath": [
745
- "dist",
746
- "commands",
747
- "dbdoc",
748
- "generate-queries.js"
749
- ]
750
- },
751
- "dbdoc": {
752
- "aliases": [],
753
- "args": {},
754
- "description": "AI-powered database documentation generator",
755
- "flags": {},
756
- "hasDynamicHelp": false,
757
- "hidden": false,
758
- "hiddenAliases": [],
759
- "id": "dbdoc",
638
+ "id": "codegen:5-0-fix-metadata-names",
760
639
  "pluginAlias": "@memberjunction/cli",
761
640
  "pluginName": "@memberjunction/cli",
762
641
  "pluginType": "core",
@@ -766,21 +645,35 @@
766
645
  "relativePath": [
767
646
  "dist",
768
647
  "commands",
769
- "dbdoc",
770
- "index.js"
648
+ "codegen",
649
+ "5-0-fix-metadata-names.js"
771
650
  ]
772
651
  },
773
- "dbdoc:init": {
652
+ "codegen": {
774
653
  "aliases": [],
775
654
  "args": {},
776
- "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
655
+ "description": "Run the full MemberJunction code generation pipeline.\n\nAnalyzes your SQL Server database schema, updates MemberJunction metadata, and\ngenerates synchronized code across the entire stack:\n\n - SQL views, stored procedures, indexes, and permissions\n - TypeScript entity classes with Zod validation schemas\n - Angular form components with AI-driven layouts\n - GraphQL resolvers and type definitions\n - Action subclasses and DB schema JSON\n\nConfiguration is loaded from mj.config.cjs in the current directory (or parent\ndirectories). Database connection can also be set via environment variables:\nDB_HOST, DB_DATABASE, CODEGEN_DB_USERNAME, CODEGEN_DB_PASSWORD.\n\nUse --skipdb to skip all database operations (metadata sync, SQL object\ngeneration) and only regenerate TypeScript, Angular, and GraphQL output from\nexisting metadata.",
777
656
  "examples": [
778
- "<%= config.bin %> <%= command.id %>"
657
+ {
658
+ "command": "<%= config.bin %> <%= command.id %>",
659
+ "description": "Run the full code generation pipeline"
660
+ },
661
+ {
662
+ "command": "<%= config.bin %> <%= command.id %> --skipdb",
663
+ "description": "Regenerate code files without touching the database"
664
+ }
779
665
  ],
780
- "flags": {},
666
+ "flags": {
667
+ "skipdb": {
668
+ "description": "Skip database operations (metadata sync, SQL generation). Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.",
669
+ "name": "skipdb",
670
+ "allowNo": false,
671
+ "type": "boolean"
672
+ }
673
+ },
781
674
  "hasDynamicHelp": false,
782
675
  "hiddenAliases": [],
783
- "id": "dbdoc:init",
676
+ "id": "codegen",
784
677
  "pluginAlias": "@memberjunction/cli",
785
678
  "pluginName": "@memberjunction/cli",
786
679
  "pluginType": "core",
@@ -790,30 +683,84 @@
790
683
  "relativePath": [
791
684
  "dist",
792
685
  "commands",
793
- "dbdoc",
794
- "init.js"
686
+ "codegen",
687
+ "index.js"
795
688
  ]
796
689
  },
797
- "dbdoc:reset": {
690
+ "codegen:manifest": {
798
691
  "aliases": [],
799
692
  "args": {},
800
- "description": "Reset analysis state (delegates to db-auto-doc reset)",
693
+ "description": "Generate a class registration manifest to prevent tree-shaking.\n\nMemberJunction uses @RegisterClass decorators with a dynamic class factory.\nModern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will\ntree-shake these classes out of production builds. This command scans the\ndependency tree for all @RegisterClass-decorated classes and emits a manifest\nfile with static imports that the bundler cannot eliminate.\n\nTypically used as a prebuild/prestart script for MJAPI and MJExplorer. For\nMJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap\nand @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to\ngenerate a supplemental manifest covering only your own application classes.",
801
694
  "examples": [
802
- "<%= config.bin %> <%= command.id %>",
803
- "<%= config.bin %> <%= command.id %> --force"
695
+ {
696
+ "command": "<%= config.bin %> <%= command.id %>",
697
+ "description": "Generate manifest with default output path"
698
+ },
699
+ {
700
+ "command": "<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts",
701
+ "description": "Generate manifest for a specific application directory"
702
+ },
703
+ {
704
+ "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction",
705
+ "description": "Exclude MJ packages (use pre-built bootstrap manifests instead)"
706
+ },
707
+ {
708
+ "command": "<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose",
709
+ "description": "Only include specific base classes with detailed progress"
710
+ }
804
711
  ],
805
712
  "flags": {
806
- "force": {
713
+ "output": {
714
+ "char": "o",
715
+ "description": "Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.",
716
+ "name": "output",
717
+ "default": "./src/generated/class-registrations-manifest.ts",
718
+ "hasDynamicHelp": false,
719
+ "multiple": false,
720
+ "type": "option"
721
+ },
722
+ "appDir": {
723
+ "char": "a",
724
+ "description": "Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.",
725
+ "name": "appDir",
726
+ "hasDynamicHelp": false,
727
+ "multiple": false,
728
+ "type": "option"
729
+ },
730
+ "filter": {
807
731
  "char": "f",
808
- "description": "Force reset without confirmation",
809
- "name": "force",
732
+ "description": "Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).",
733
+ "name": "filter",
734
+ "hasDynamicHelp": false,
735
+ "multiple": true,
736
+ "type": "option"
737
+ },
738
+ "exclude-packages": {
739
+ "char": "e",
740
+ "description": "Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.",
741
+ "name": "exclude-packages",
742
+ "hasDynamicHelp": false,
743
+ "multiple": true,
744
+ "type": "option"
745
+ },
746
+ "quiet": {
747
+ "char": "q",
748
+ "description": "Suppress all output except errors.",
749
+ "name": "quiet",
750
+ "allowNo": false,
751
+ "type": "boolean"
752
+ },
753
+ "verbose": {
754
+ "char": "v",
755
+ "description": "Show detailed progress including per-package scanning info and skipped classes.",
756
+ "name": "verbose",
810
757
  "allowNo": false,
811
758
  "type": "boolean"
812
759
  }
813
760
  },
814
761
  "hasDynamicHelp": false,
815
762
  "hiddenAliases": [],
816
- "id": "dbdoc:reset",
763
+ "id": "codegen:manifest",
817
764
  "pluginAlias": "@memberjunction/cli",
818
765
  "pluginName": "@memberjunction/cli",
819
766
  "pluginType": "core",
@@ -823,23 +770,34 @@
823
770
  "relativePath": [
824
771
  "dist",
825
772
  "commands",
826
- "dbdoc",
827
- "reset.js"
773
+ "codegen",
774
+ "manifest.js"
828
775
  ]
829
776
  },
830
- "dbdoc:status": {
777
+ "dbdoc:analyze": {
831
778
  "aliases": [],
832
779
  "args": {},
833
- "description": "Show analysis status and progress (delegates to db-auto-doc status)",
780
+ "description": "Analyze database and generate documentation (delegates to db-auto-doc analyze)",
834
781
  "examples": [
835
782
  "<%= config.bin %> <%= command.id %>",
836
- "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
783
+ "<%= config.bin %> <%= command.id %> --resume ./output/run-6/state.json",
784
+ "<%= config.bin %> <%= command.id %> --config ./my-config.json"
837
785
  ],
838
786
  "flags": {
839
- "state-file": {
840
- "char": "s",
841
- "description": "Path to state JSON file",
842
- "name": "state-file",
787
+ "resume": {
788
+ "char": "r",
789
+ "description": "Resume from an existing state file",
790
+ "name": "resume",
791
+ "required": false,
792
+ "hasDynamicHelp": false,
793
+ "multiple": false,
794
+ "type": "option"
795
+ },
796
+ "config": {
797
+ "char": "c",
798
+ "description": "Path to config file",
799
+ "name": "config",
800
+ "default": "./config.json",
843
801
  "hasDynamicHelp": false,
844
802
  "multiple": false,
845
803
  "type": "option"
@@ -847,7 +805,7 @@
847
805
  },
848
806
  "hasDynamicHelp": false,
849
807
  "hiddenAliases": [],
850
- "id": "dbdoc:status",
808
+ "id": "dbdoc:analyze",
851
809
  "pluginAlias": "@memberjunction/cli",
852
810
  "pluginName": "@memberjunction/cli",
853
811
  "pluginType": "core",
@@ -858,71 +816,104 @@
858
816
  "dist",
859
817
  "commands",
860
818
  "dbdoc",
861
- "status.js"
819
+ "analyze.js"
862
820
  ]
863
821
  },
864
- "codegen:5-0-fix-entity-names": {
822
+ "dbdoc:export-sample-queries": {
865
823
  "aliases": [],
866
824
  "args": {},
867
- "description": "[v5.0 Migration] Scan TypeScript files for entity names AND class names that need updating.\n\nThree strategies are applied:\n 1. Class name renames (regex) ActionEntity -> MJActionEntity, ActionSchema -> MJActionSchema,\n ActionEntityExtended -> MJActionEntityExtended (extended subclasses),\n ActionEntityServerEntity -> MJActionEntityServer (server subclass suffix standardization),\n ActionFormComponentExtended -> MJActionFormComponentExtended (Angular form components).\n Explicit subclass mappings (57 entries from subclass-rename-map.json) take priority over\n auto-generated suffix rules, enabling suffix changes (e.g., _Server -> Server, ServerEntity -> Server).\n 2. Multi-word entity name renames (regex) — 'AI Models' -> 'MJ: AI Models'\n 3. Single-word entity name renames (AST) — 'Actions' -> 'MJ: Actions' in GetEntityObject, OpenEntityRecord,\n navigateToEntity, EntityName: assignments, .Name === comparisons, @RegisterClass decorators.\n\nThe rename map (272 entity entries + 57 subclass entries) is built from entity_subclasses.ts @RegisterClass\ndecorators plus embedded rename maps. Runs in dry-run mode by default; use --fix to apply.",
825
+ "description": "Export sample queries to MemberJunction metadata format (delegates to db-auto-doc export-sample-queries)",
868
826
  "examples": [
869
- {
870
- "description": "Dry-run scan of the packages directory",
871
- "command": "<%= config.bin %> <%= command.id %> --path packages/"
872
- },
873
- {
874
- "description": "Scan a single file",
875
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/components/actions-overview.component.ts"
876
- },
877
- {
878
- "description": "Apply fixes across the codebase",
879
- "command": "<%= config.bin %> <%= command.id %> --path packages/ --fix"
880
- },
881
- {
882
- "description": "Quiet mode (summary only)",
883
- "command": "<%= config.bin %> <%= command.id %> --path packages/ -q"
884
- }
827
+ "<%= config.bin %> <%= command.id %> --input ./output/sample-queries.json --output ./metadata/queries/.queries.json",
828
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./metadata/queries/.queries.json --separate-sql-files",
829
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --category \"Database Documentation\"",
830
+ "<%= config.bin %> <%= command.id %> --input ./sample-queries.json --output ./queries/.queries.json --status Pending --min-confidence 0.8"
885
831
  ],
886
832
  "flags": {
887
- "path": {
888
- "char": "p",
889
- "description": "File or directory to scan. Accepts a single .ts file or a directory (scanned recursively). Defaults to the current working directory.",
890
- "name": "path",
833
+ "input": {
834
+ "char": "i",
835
+ "description": "Path to sample-queries.json file generated by generate-queries command",
836
+ "name": "input",
837
+ "required": true,
891
838
  "hasDynamicHelp": false,
892
839
  "multiple": false,
893
840
  "type": "option"
894
841
  },
895
- "fix": {
896
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
897
- "name": "fix",
842
+ "output": {
843
+ "char": "o",
844
+ "description": "Output path for the .queries.json metadata file",
845
+ "name": "output",
846
+ "required": true,
847
+ "hasDynamicHelp": false,
848
+ "multiple": false,
849
+ "type": "option"
850
+ },
851
+ "separate-sql-files": {
852
+ "description": "Write SQL to separate files and use @file: references",
853
+ "name": "separate-sql-files",
898
854
  "allowNo": false,
899
855
  "type": "boolean"
900
856
  },
901
- "entity-subclasses": {
902
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
903
- "name": "entity-subclasses",
857
+ "sql-dir": {
858
+ "description": "Directory for SQL files when using --separate-sql-files (relative to output file)",
859
+ "name": "sql-dir",
860
+ "default": "SQL",
904
861
  "hasDynamicHelp": false,
905
862
  "multiple": false,
906
863
  "type": "option"
907
864
  },
908
- "quiet": {
909
- "char": "q",
910
- "description": "Suppress detailed per-file output; only show the final summary counts.",
911
- "name": "quiet",
865
+ "category": {
866
+ "description": "Category name for @lookup reference (e.g., \"Database Documentation\")",
867
+ "name": "category",
868
+ "required": false,
869
+ "hasDynamicHelp": false,
870
+ "multiple": false,
871
+ "type": "option"
872
+ },
873
+ "status": {
874
+ "description": "Status to assign to exported queries",
875
+ "name": "status",
876
+ "default": "Pending",
877
+ "hasDynamicHelp": false,
878
+ "multiple": false,
879
+ "options": [
880
+ "Approved",
881
+ "Pending",
882
+ "Rejected",
883
+ "Expired"
884
+ ],
885
+ "type": "option"
886
+ },
887
+ "min-confidence": {
888
+ "description": "Minimum confidence threshold to export (0-1)",
889
+ "name": "min-confidence",
890
+ "default": "0",
891
+ "hasDynamicHelp": false,
892
+ "multiple": false,
893
+ "type": "option"
894
+ },
895
+ "validated-only": {
896
+ "description": "Only export queries that were successfully validated",
897
+ "name": "validated-only",
912
898
  "allowNo": false,
913
899
  "type": "boolean"
914
900
  },
915
- "verbose": {
916
- "char": "v",
917
- "description": "Show detailed progress including each file being scanned.",
918
- "name": "verbose",
901
+ "append": {
902
+ "description": "Append to existing metadata file instead of overwriting",
903
+ "name": "append",
904
+ "allowNo": false,
905
+ "type": "boolean"
906
+ },
907
+ "include-primary-key": {
908
+ "description": "Include primaryKey and sync fields (for updating existing records)",
909
+ "name": "include-primary-key",
919
910
  "allowNo": false,
920
911
  "type": "boolean"
921
912
  }
922
913
  },
923
914
  "hasDynamicHelp": false,
924
915
  "hiddenAliases": [],
925
- "id": "codegen:5-0-fix-entity-names",
916
+ "id": "dbdoc:export-sample-queries",
926
917
  "pluginAlias": "@memberjunction/cli",
927
918
  "pluginName": "@memberjunction/cli",
928
919
  "pluginType": "core",
@@ -932,72 +923,100 @@
932
923
  "relativePath": [
933
924
  "dist",
934
925
  "commands",
935
- "codegen",
936
- "5-0-fix-entity-names.js"
926
+ "dbdoc",
927
+ "export-sample-queries.js"
937
928
  ]
938
929
  },
939
- "codegen:5-0-fix-html-entity-names": {
930
+ "dbdoc:export": {
940
931
  "aliases": [],
941
932
  "args": {},
942
- "description": "[v5.0 Migration] Scan Angular HTML template files for hardcoded entity names that need \"MJ: \" prefix updates.\n\nUses targeted regex patterns to find entity name references in template expressions\nand attribute values. Detects method calls like navigateToEntity('Actions'),\nOpenEntityRecord('Entities', id), and attribute values like RowsEntityName=\"Users\".\nRuns in dry-run mode by default; use --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
933
+ "description": "Export documentation in multiple formats (delegates to db-auto-doc export)",
943
934
  "examples": [
944
- {
945
- "description": "Dry-run scan of Angular templates",
946
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/"
947
- },
948
- {
949
- "description": "Apply fixes to HTML templates",
950
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/ --fix"
951
- },
952
- {
953
- "description": "Scan with verbose output",
954
- "command": "<%= config.bin %> <%= command.id %> --path packages/ -v"
955
- },
956
- {
957
- "description": "Scan a single template file",
958
- "command": "<%= config.bin %> <%= command.id %> --path packages/Angular/Explorer/dashboards/src/Actions/actions-dashboard.component.html"
959
- }
935
+ "<%= config.bin %> <%= command.id %> --state-file=./db-doc-state.json",
936
+ "<%= config.bin %> <%= command.id %> --sql",
937
+ "<%= config.bin %> <%= command.id %> --markdown",
938
+ "<%= config.bin %> <%= command.id %> --html",
939
+ "<%= config.bin %> <%= command.id %> --csv",
940
+ "<%= config.bin %> <%= command.id %> --mermaid",
941
+ "<%= config.bin %> <%= command.id %> --sql --markdown --html --csv --mermaid --apply"
960
942
  ],
961
943
  "flags": {
962
- "path": {
963
- "char": "p",
964
- "description": "File or directory to scan. Accepts a single .html file or a directory (scanned recursively). Defaults to the current working directory.",
965
- "name": "path",
944
+ "state-file": {
945
+ "char": "s",
946
+ "description": "Path to state JSON file",
947
+ "name": "state-file",
966
948
  "hasDynamicHelp": false,
967
949
  "multiple": false,
968
950
  "type": "option"
969
951
  },
970
- "fix": {
971
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
972
- "name": "fix",
973
- "allowNo": false,
974
- "type": "boolean"
975
- },
976
- "entity-subclasses": {
977
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
978
- "name": "entity-subclasses",
952
+ "output-dir": {
953
+ "char": "o",
954
+ "description": "Output directory for generated files",
955
+ "name": "output-dir",
979
956
  "hasDynamicHelp": false,
980
957
  "multiple": false,
981
958
  "type": "option"
982
959
  },
983
- "quiet": {
984
- "char": "q",
985
- "description": "Suppress detailed per-file output; only show the final summary counts.",
986
- "name": "quiet",
960
+ "sql": {
961
+ "description": "Generate SQL script",
962
+ "name": "sql",
963
+ "allowNo": false,
964
+ "type": "boolean"
965
+ },
966
+ "markdown": {
967
+ "description": "Generate Markdown documentation",
968
+ "name": "markdown",
969
+ "allowNo": false,
970
+ "type": "boolean"
971
+ },
972
+ "html": {
973
+ "description": "Generate interactive HTML documentation",
974
+ "name": "html",
975
+ "allowNo": false,
976
+ "type": "boolean"
977
+ },
978
+ "csv": {
979
+ "description": "Generate CSV exports (tables and columns)",
980
+ "name": "csv",
981
+ "allowNo": false,
982
+ "type": "boolean"
983
+ },
984
+ "mermaid": {
985
+ "description": "Generate Mermaid ERD diagram files",
986
+ "name": "mermaid",
987
+ "allowNo": false,
988
+ "type": "boolean"
989
+ },
990
+ "report": {
991
+ "description": "Generate analysis report",
992
+ "name": "report",
993
+ "allowNo": false,
994
+ "type": "boolean"
995
+ },
996
+ "apply": {
997
+ "description": "Apply SQL to database",
998
+ "name": "apply",
987
999
  "allowNo": false,
988
1000
  "type": "boolean"
989
1001
  },
990
- "verbose": {
991
- "char": "v",
992
- "description": "Show detailed progress including each file being scanned.",
993
- "name": "verbose",
1002
+ "approved-only": {
1003
+ "description": "Only export approved items",
1004
+ "name": "approved-only",
994
1005
  "allowNo": false,
995
1006
  "type": "boolean"
1007
+ },
1008
+ "confidence-threshold": {
1009
+ "description": "Minimum confidence threshold",
1010
+ "name": "confidence-threshold",
1011
+ "default": "0",
1012
+ "hasDynamicHelp": false,
1013
+ "multiple": false,
1014
+ "type": "option"
996
1015
  }
997
1016
  },
998
1017
  "hasDynamicHelp": false,
999
1018
  "hiddenAliases": [],
1000
- "id": "codegen:5-0-fix-html-entity-names",
1019
+ "id": "dbdoc:export",
1001
1020
  "pluginAlias": "@memberjunction/cli",
1002
1021
  "pluginName": "@memberjunction/cli",
1003
1022
  "pluginType": "core",
@@ -1007,72 +1026,65 @@
1007
1026
  "relativePath": [
1008
1027
  "dist",
1009
1028
  "commands",
1010
- "codegen",
1011
- "5-0-fix-html-entity-names.js"
1029
+ "dbdoc",
1030
+ "export.js"
1012
1031
  ]
1013
1032
  },
1014
- "codegen:5-0-fix-metadata-names": {
1033
+ "dbdoc:generate-queries": {
1015
1034
  "aliases": [],
1016
1035
  "args": {},
1017
- "description": "[v5.0 Migration] Scan metadata JSON files for entity names that need \"MJ: \" prefix updates.\n\nTargets the metadata/ directory used by \"mj sync\". Detects entity name references in\n@lookup: directives (both the entity name and lookup value), .mj-sync.json and\n.mj-folder.json config files (entity/entityName fields), relatedEntities object keys,\nand fields.Name values in Entities-managing folders. Runs in dry-run mode by default;\nuse --fix to apply.\n\nThe rename map is built dynamically from entity_subclasses.ts by parsing all\n@RegisterClass(BaseEntity, 'MJ: XYZ') decorators (~272 entries).",
1036
+ "description": "Generate sample SQL queries from existing analysis state (delegates to db-auto-doc generate-queries)",
1018
1037
  "examples": [
1019
- {
1020
- "description": "Dry-run scan of the metadata directory",
1021
- "command": "<%= config.bin %> <%= command.id %> --path metadata/"
1022
- },
1023
- {
1024
- "description": "Apply fixes to metadata files",
1025
- "command": "<%= config.bin %> <%= command.id %> --path metadata/ --fix"
1026
- },
1027
- {
1028
- "description": "Scan a specific subdirectory",
1029
- "command": "<%= config.bin %> <%= command.id %> --path metadata/resource-types"
1030
- },
1031
- {
1032
- "description": "Scan and fix a single metadata file",
1033
- "command": "<%= config.bin %> <%= command.id %> --path metadata/entities/.audit-related-entities.json --fix"
1034
- }
1038
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json",
1039
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --output-dir ./queries",
1040
+ "<%= config.bin %> <%= command.id %> --from-state ./output/run-1/state.json --queries-per-table 10"
1035
1041
  ],
1036
1042
  "flags": {
1037
- "path": {
1038
- "char": "p",
1039
- "description": "File or directory to scan. Accepts a single .json file or a directory (scanned recursively, including dotfiles like .mj-sync.json). Defaults to the current working directory.",
1040
- "name": "path",
1043
+ "from-state": {
1044
+ "description": "Path to existing state.json file from previous analysis",
1045
+ "name": "from-state",
1046
+ "required": true,
1041
1047
  "hasDynamicHelp": false,
1042
1048
  "multiple": false,
1043
1049
  "type": "option"
1044
1050
  },
1045
- "fix": {
1046
- "description": "Apply fixes in place. Without this flag, the command runs in dry-run mode and only reports findings.",
1047
- "name": "fix",
1048
- "allowNo": false,
1049
- "type": "boolean"
1051
+ "output-dir": {
1052
+ "description": "Output directory for generated queries",
1053
+ "name": "output-dir",
1054
+ "required": false,
1055
+ "hasDynamicHelp": false,
1056
+ "multiple": false,
1057
+ "type": "option"
1050
1058
  },
1051
- "entity-subclasses": {
1052
- "description": "Explicit path to entity_subclasses.ts for building the rename map. If omitted, the tool searches common locations relative to the target path.",
1053
- "name": "entity-subclasses",
1059
+ "config": {
1060
+ "char": "c",
1061
+ "description": "Path to config file (for database connection and AI settings)",
1062
+ "name": "config",
1063
+ "default": "./config.json",
1054
1064
  "hasDynamicHelp": false,
1055
1065
  "multiple": false,
1056
1066
  "type": "option"
1057
1067
  },
1058
- "quiet": {
1059
- "char": "q",
1060
- "description": "Suppress detailed per-file output; only show the final summary counts.",
1061
- "name": "quiet",
1062
- "allowNo": false,
1063
- "type": "boolean"
1068
+ "queries-per-table": {
1069
+ "description": "Number of queries to generate per table",
1070
+ "name": "queries-per-table",
1071
+ "required": false,
1072
+ "hasDynamicHelp": false,
1073
+ "multiple": false,
1074
+ "type": "option"
1064
1075
  },
1065
- "verbose": {
1066
- "char": "v",
1067
- "description": "Show detailed progress including each file being scanned.",
1068
- "name": "verbose",
1069
- "allowNo": false,
1070
- "type": "boolean"
1076
+ "max-execution-time": {
1077
+ "description": "Maximum execution time for query validation (ms)",
1078
+ "name": "max-execution-time",
1079
+ "required": false,
1080
+ "hasDynamicHelp": false,
1081
+ "multiple": false,
1082
+ "type": "option"
1071
1083
  }
1072
1084
  },
1073
1085
  "hasDynamicHelp": false,
1074
1086
  "hiddenAliases": [],
1075
- "id": "codegen:5-0-fix-metadata-names",
1087
+ "id": "dbdoc:generate-queries",
1076
1088
  "pluginAlias": "@memberjunction/cli",
1077
1089
  "pluginName": "@memberjunction/cli",
1078
1090
  "pluginType": "core",
@@ -1082,35 +1094,76 @@
1082
1094
  "relativePath": [
1083
1095
  "dist",
1084
1096
  "commands",
1085
- "codegen",
1086
- "5-0-fix-metadata-names.js"
1097
+ "dbdoc",
1098
+ "generate-queries.js"
1087
1099
  ]
1088
1100
  },
1089
- "codegen": {
1101
+ "dbdoc": {
1090
1102
  "aliases": [],
1091
1103
  "args": {},
1092
- "description": "Run the full MemberJunction code generation pipeline.\n\nAnalyzes your SQL Server database schema, updates MemberJunction metadata, and\ngenerates synchronized code across the entire stack:\n\n - SQL views, stored procedures, indexes, and permissions\n - TypeScript entity classes with Zod validation schemas\n - Angular form components with AI-driven layouts\n - GraphQL resolvers and type definitions\n - Action subclasses and DB schema JSON\n\nConfiguration is loaded from mj.config.cjs in the current directory (or parent\ndirectories). Database connection can also be set via environment variables:\nDB_HOST, DB_DATABASE, CODEGEN_DB_USERNAME, CODEGEN_DB_PASSWORD.\n\nUse --skipdb to skip all database operations (metadata sync, SQL object\ngeneration) and only regenerate TypeScript, Angular, and GraphQL output from\nexisting metadata.",
1104
+ "description": "AI-powered database documentation generator",
1105
+ "flags": {},
1106
+ "hasDynamicHelp": false,
1107
+ "hidden": false,
1108
+ "hiddenAliases": [],
1109
+ "id": "dbdoc",
1110
+ "pluginAlias": "@memberjunction/cli",
1111
+ "pluginName": "@memberjunction/cli",
1112
+ "pluginType": "core",
1113
+ "strict": true,
1114
+ "enableJsonFlag": false,
1115
+ "isESM": true,
1116
+ "relativePath": [
1117
+ "dist",
1118
+ "commands",
1119
+ "dbdoc",
1120
+ "index.js"
1121
+ ]
1122
+ },
1123
+ "dbdoc:init": {
1124
+ "aliases": [],
1125
+ "args": {},
1126
+ "description": "Initialize DBAutoDoc project (delegates to db-auto-doc init)",
1093
1127
  "examples": [
1094
- {
1095
- "command": "<%= config.bin %> <%= command.id %>",
1096
- "description": "Run the full code generation pipeline"
1097
- },
1098
- {
1099
- "command": "<%= config.bin %> <%= command.id %> --skipdb",
1100
- "description": "Regenerate code files without touching the database"
1101
- }
1128
+ "<%= config.bin %> <%= command.id %>"
1129
+ ],
1130
+ "flags": {},
1131
+ "hasDynamicHelp": false,
1132
+ "hiddenAliases": [],
1133
+ "id": "dbdoc:init",
1134
+ "pluginAlias": "@memberjunction/cli",
1135
+ "pluginName": "@memberjunction/cli",
1136
+ "pluginType": "core",
1137
+ "strict": true,
1138
+ "enableJsonFlag": false,
1139
+ "isESM": true,
1140
+ "relativePath": [
1141
+ "dist",
1142
+ "commands",
1143
+ "dbdoc",
1144
+ "init.js"
1145
+ ]
1146
+ },
1147
+ "dbdoc:reset": {
1148
+ "aliases": [],
1149
+ "args": {},
1150
+ "description": "Reset analysis state (delegates to db-auto-doc reset)",
1151
+ "examples": [
1152
+ "<%= config.bin %> <%= command.id %>",
1153
+ "<%= config.bin %> <%= command.id %> --force"
1102
1154
  ],
1103
1155
  "flags": {
1104
- "skipdb": {
1105
- "description": "Skip database operations (metadata sync, SQL generation). Only regenerate TypeScript entities, Angular components, and GraphQL resolvers from existing metadata.",
1106
- "name": "skipdb",
1156
+ "force": {
1157
+ "char": "f",
1158
+ "description": "Force reset without confirmation",
1159
+ "name": "force",
1107
1160
  "allowNo": false,
1108
1161
  "type": "boolean"
1109
1162
  }
1110
1163
  },
1111
1164
  "hasDynamicHelp": false,
1112
1165
  "hiddenAliases": [],
1113
- "id": "codegen",
1166
+ "id": "dbdoc:reset",
1114
1167
  "pluginAlias": "@memberjunction/cli",
1115
1168
  "pluginName": "@memberjunction/cli",
1116
1169
  "pluginType": "core",
@@ -1120,84 +1173,31 @@
1120
1173
  "relativePath": [
1121
1174
  "dist",
1122
1175
  "commands",
1123
- "codegen",
1124
- "index.js"
1176
+ "dbdoc",
1177
+ "reset.js"
1125
1178
  ]
1126
1179
  },
1127
- "codegen:manifest": {
1180
+ "dbdoc:status": {
1128
1181
  "aliases": [],
1129
1182
  "args": {},
1130
- "description": "Generate a class registration manifest to prevent tree-shaking.\n\nMemberJunction uses @RegisterClass decorators with a dynamic class factory.\nModern bundlers (ESBuild, Vite) cannot detect dynamic instantiation and will\ntree-shake these classes out of production builds. This command scans the\ndependency tree for all @RegisterClass-decorated classes and emits a manifest\nfile with static imports that the bundler cannot eliminate.\n\nTypically used as a prebuild/prestart script for MJAPI and MJExplorer. For\nMJ distribution users, pre-built manifests ship inside @memberjunction/server-bootstrap\nand @memberjunction/ng-bootstrap -- use --exclude-packages @memberjunction to\ngenerate a supplemental manifest covering only your own application classes.",
1183
+ "description": "Show analysis status and progress (delegates to db-auto-doc status)",
1131
1184
  "examples": [
1132
- {
1133
- "command": "<%= config.bin %> <%= command.id %>",
1134
- "description": "Generate manifest with default output path"
1135
- },
1136
- {
1137
- "command": "<%= config.bin %> <%= command.id %> --appDir ./packages/MJAPI --output ./packages/MJAPI/src/generated/class-registrations-manifest.ts",
1138
- "description": "Generate manifest for a specific application directory"
1139
- },
1140
- {
1141
- "command": "<%= config.bin %> <%= command.id %> --exclude-packages @memberjunction",
1142
- "description": "Exclude MJ packages (use pre-built bootstrap manifests instead)"
1143
- },
1144
- {
1145
- "command": "<%= config.bin %> <%= command.id %> --filter BaseEngine --filter BaseAction --verbose",
1146
- "description": "Only include specific base classes with detailed progress"
1147
- }
1185
+ "<%= config.bin %> <%= command.id %>",
1186
+ "<%= config.bin %> <%= command.id %> --state-file ./custom-state.json"
1148
1187
  ],
1149
1188
  "flags": {
1150
- "output": {
1151
- "char": "o",
1152
- "description": "Output file path for the generated manifest. The file will contain named imports and a CLASS_REGISTRATIONS array.",
1153
- "name": "output",
1154
- "default": "./src/generated/class-registrations-manifest.ts",
1155
- "hasDynamicHelp": false,
1156
- "multiple": false,
1157
- "type": "option"
1158
- },
1159
- "appDir": {
1160
- "char": "a",
1161
- "description": "Root directory of the application whose package.json dependency tree will be scanned. Defaults to the current working directory.",
1162
- "name": "appDir",
1189
+ "state-file": {
1190
+ "char": "s",
1191
+ "description": "Path to state JSON file",
1192
+ "name": "state-file",
1163
1193
  "hasDynamicHelp": false,
1164
1194
  "multiple": false,
1165
1195
  "type": "option"
1166
- },
1167
- "filter": {
1168
- "char": "f",
1169
- "description": "Only include classes extending this base class. Can be repeated (e.g., --filter BaseEngine --filter BaseAction).",
1170
- "name": "filter",
1171
- "hasDynamicHelp": false,
1172
- "multiple": true,
1173
- "type": "option"
1174
- },
1175
- "exclude-packages": {
1176
- "char": "e",
1177
- "description": "Skip packages whose name starts with this prefix. Useful for excluding @memberjunction packages when using pre-built bootstrap manifests. Can be repeated.",
1178
- "name": "exclude-packages",
1179
- "hasDynamicHelp": false,
1180
- "multiple": true,
1181
- "type": "option"
1182
- },
1183
- "quiet": {
1184
- "char": "q",
1185
- "description": "Suppress all output except errors.",
1186
- "name": "quiet",
1187
- "allowNo": false,
1188
- "type": "boolean"
1189
- },
1190
- "verbose": {
1191
- "char": "v",
1192
- "description": "Show detailed progress including per-package scanning info and skipped classes.",
1193
- "name": "verbose",
1194
- "allowNo": false,
1195
- "type": "boolean"
1196
1196
  }
1197
1197
  },
1198
1198
  "hasDynamicHelp": false,
1199
1199
  "hiddenAliases": [],
1200
- "id": "codegen:manifest",
1200
+ "id": "dbdoc:status",
1201
1201
  "pluginAlias": "@memberjunction/cli",
1202
1202
  "pluginName": "@memberjunction/cli",
1203
1203
  "pluginType": "core",
@@ -1207,8 +1207,8 @@
1207
1207
  "relativePath": [
1208
1208
  "dist",
1209
1209
  "commands",
1210
- "codegen",
1211
- "manifest.js"
1210
+ "dbdoc",
1211
+ "status.js"
1212
1212
  ]
1213
1213
  },
1214
1214
  "doctor": {
@@ -3504,5 +3504,5 @@
3504
3504
  ]
3505
3505
  }
3506
3506
  },
3507
- "version": "5.6.0"
3507
+ "version": "5.8.0"
3508
3508
  }