also looking at this
chore: remove subdir-resolve workaround plugin (core handles it now)
#122
2 files
+6
-17
stx-app-components.plugin.tsdeleted+0-16
| @@ -1,16 +0,0 @@ | ||
| 1 | // Registers the app's own `resources/components` tree as a component source. | |
| 2 | // | |
| 3 | // Why this exists: stx 0.2.72 searches the configured `componentsDir` FLAT — | |
| 4 | // only its top level — so subdirectory kebab tags never resolve. Nearly all of | |
| 5 | // this app's components live in subdirs (`dashboard/`, `tabs/`), e.g. | |
| 6 | // `<site-selector>` → `resources/components/dashboard/SiteSelector.stx`. Without | |
| 7 | // this, the whole dashboard renders "Error loading component: ENOENT ...". | |
| 8 | // | |
| 9 | // Plugin component dirs, unlike `componentsDir`, ARE walked recursively by the | |
| 10 | // resolver (the same mechanism that lets `@stacksjs/components/src/ui/**` | |
| 11 | // resolve), so pointing one at `resources/components` makes the subdir tags | |
| 12 | // resolve again. See stx-components.plugin.ts for the library equivalent. | |
| 13 | export default { | |
| 14 | name: 'app-components', | |
| 15 | components: 'resources/components', | |
| 16 | } | |
| @@ -1,5 +1,10 @@ | ||
| 1 | 1 | export default { |
| 2 | plugins: ['./stx-app-components.plugin.ts', './stx-components.plugin.ts'] as const, | |
| 2 | // stx-components.plugin registers the @stacksjs/components library (stx does | |
| 3 | // not auto-resolve it). The app's own resources/components no longer needs a | |
| 4 | // plugin — stx walks componentsDir recursively since stx@d914f3ab83, so subdir | |
| 5 | // kebab tags (<site-selector> → components/dashboard/SiteSelector.stx) resolve | |
| 6 | // natively. (Removed the old stx-app-components.plugin.ts workaround.) | |
| 7 | plugins: ['./stx-components.plugin.ts'] as const, | |
| 3 | 8 | // Paths relative to root ('resources', auto-detected). |
| 4 | 9 | // Don't include the 'resources/' prefix — it's already the root. |
| 5 | 10 | componentsDir: 'components', |