Skip to content

Preview command#94

Merged
mringler merged 4 commits intodevelopfrom
preview-command
Feb 13, 2026
Merged

Preview command#94
mringler merged 4 commits intodevelopfrom
preview-command

Conversation

@mringler
Copy link
Copy Markdown
Collaborator

@mringler mringler commented Dec 3, 2025

Here is a fun one, this introduces a new command config:preview to output the directory structure for the current configuration.

It allows to check if paths in configuration and model namespaces in schema.xml result in the desired output without having to actually build the project (and subsequently finding and deleting files at the wrong location).

Example output looks like this:

Directory structure and files according to current config (directories marked as relative change when perpl is called from a different path):

└── $rootDir/
     ├── generated-conf/
     │    │  paths.phpConfDir Perpl configurations files (from config:convert and model:build). !from relative path!
     │    └─╼ loadDatabase.php (new)
     ├── generated-migrations/
     │       paths.migrationDir Migration files (target for migration:create, migration:migrate, etc) !from relative path!
     ├── generated-sql/
     │       paths.sqlDir SQL database initialization files for sql:insert (user-generated and generated from schema.xml by sql:build) !from relative path!
     └── tests/Fixtures/namespaced/
          │  paths.schemaDir Schema XML files (input for migration:diff, database:reverse, etc)
          ├── generated-classes/
          │    │  paths.phpDir Base target directory for model:build
          │    ├── Baz/
          │    │    ├── Base/
          │    │    │    ├── Collection/
          │    │    │    │    ├─╼ NamespacedBookClubCollection.php (exists, override if changed)
          │    │    │    │    ├─╼ NamespacedBookListRelCollection.php (exists, override if changed)
          │    │    │    │    └─╼ NamespacedPublisherCollection.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedBookClub.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedBookClubQuery.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedBookListRel.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedBookListRelQuery.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedPublisher.php (exists, override if changed)
          │    │    │    └─╼ NamespacedPublisherQuery.php (exists, override if changed)
          │    │    ├── Map/
          │    │    │    ├─╼ NamespacedBookClubTableMap.php (exists, override if changed)
          │    │    │    ├─╼ NamespacedBookListRelTableMap.php (exists, override if changed)
          │    │    │    └─╼ NamespacedPublisherTableMap.php (exists, override if changed)
          │    │    ├─╼ NamespacedBookClub.php (exists, no override)
          │    │    ├─╼ NamespacedBookClubQuery.php (exists, no override)
          │    │    ├─╼ NamespacedBookListRel.php (exists, no override)
          │    │    ├─╼ NamespacedBookListRelQuery.php (exists, no override)
          │    │    ├─╼ NamespacedPublisher.php (exists, no override)
          │    │    └─╼ NamespacedPublisherQuery.php (exists, no override)
          │    └── Foo/Bar/
          │         ...
          └─╼ schema.xml 

Actual output comes with some colors and without the gaps between lines:
preview

includes #93

Command currently requires schema dir with non-empty schema.xml. Maybe it should work without that too?

@mringler mringler merged commit e9d085c into develop Feb 13, 2026
38 checks passed
@mringler mringler deleted the preview-command branch February 13, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant