Smart Component File Structure & Auto-Registration

Smart Component File Structure & Auto-Registration

Automatic Component Registration

Any Single-File Component placed inside components/custom/ or components/registered/ is instantly auto-detected and registered by the Conpacts Registry Engine without requiring manual registration hooks.

1. The Core Component Folders

All active components on your site reside within the protected components/ directory. The engine splits active components into two auto-registered folders:

conpacts/
├── bootstrap.php                        # Protected: Custom initialization
├── conpacts.php                         # Core loader
├── manifesto.md                         # Architecture guidelines
├── components/
│   ├── custom/                          # [AUTO-REGISTERED] 100% bespoke custom components
│   │   ├── assets/                      # Isolated custom scripts & styles
│   │   │   ├── scripts.js
│   │   │   └── styles.css
│   │   └── my-custom-widget.php
│   │
│   └── registered/                      # [AUTO-REGISTERED] Active library bundle components
│       ├── about-stats-arcturus.php
│       └── feature-bento-betelgeuse.php
│
└── extensions/
    ├── library/                         # READONLY: Upstream bundle warehouse (Conturalis Cloud)
    │   └── components/
    │       ├── arcturus/
    │       ├── betelgeuse/
    │       └── canopus/
    └── third-party/                     # Protected: External community packages
        └── components/

2. The Two Auto-Registration Directories

  • conpacts/components/custom/ (Auto-Registered Custom Scope):

    This is the dedicated folder for unique, bespoke components built specifically for your client or project. Any component placed here is automatically scanned, assigned the custom scope, and placed under the conpacts block category. It also includes an isolated assets/ folder for custom CSS and JS.

  • conpacts/components/registered/ (Auto-Registered Library Scope):

    This is the active directory for curated Conturalis library components. When a component from an upstream bundle is placed in this folder, the engine automatically registers it and assigns the library scope, allowing it to seamlessly receive upstream updates.

3. How to Activate and Connect Library Components

Curated component bundles (such as Arcturus or Betelgeuse) are stored inside extensions/library/components/. To activate a library component and keep it connected to upstream updates:

  1. Copy to registered/: Copy the component file from extensions/library/components/{bundle}/ into conpacts/components/registered/.
  2. Update DocBlock Status: Change the metadata comment from Status: Stored to Status: Registered.
  3. Automatic Upstream Sync: Because the component lives in registered/ and keeps its bundle name (e.g., cts-accordion-arcturus), it remains connected to receive non-destructive upstream template and logic updates during framework updates.

4. Decoupling with Custom Forks

If you need to make destructive or heavy modifications to a library component and want to disconnect it permanently from upstream updates:

  • Move the file into conpacts/components/custom/ instead of registered/.
  • Append the -custom-fork suffix to the filename and Nowdoc JSON name (e.g., accordion-arcturus-custom-fork.php and "name": "cts-accordion-arcturus-custom-fork").
  • Set "scope": "custom" in the JSON header.