Skip to content

feat: migrate template to defineModule v2 (module-kit 0.6.0)#2

Merged
k8-benetis merged 3 commits into
mainfrom
feat/template-define-module-v2
May 14, 2026
Merged

feat: migrate template to defineModule v2 (module-kit 0.6.0)#2
k8-benetis merged 3 commits into
mainfrom
feat/template-define-module-v2

Conversation

@k8-benetis
Copy link
Copy Markdown
Collaborator

Reflects the canonical pattern after Fase A.2: single defineModule({...}) source of truth, auto-generated manifest, simplified vite.config, MockProvider in dev shell, all module-kit hooks available to consumers.

Reflects the canonical pattern documented after Fase A.2.

Frontend:
- New src/Module.tsx as the single declarative source — defineModule({...})
  with id, displayName, accent, route, navigation, slots, api, requiredRoles,
  requiredPlan, and data (CSP-of-data allowlist).
- src/moduleEntry.ts deleted — entry is auto-generated by @nekazari/module-builder.
- manifest.json deleted — emitted into dist/manifest.json at build time.
- vite.config.ts simplified to a single defineConfig(nkzModulePreset({...}))
  call; moduleId is read from package.json#nkz.moduleId.
- src/main.tsx now wraps the dev shell in MockProvider for `pnpm dev`.
- src/App.tsx becomes the production main page (rendered at the module's
  route), consuming useAuth + useI18n.
- src/slots/index.ts simplified to the {id, component, priority?} shape;
  module-kit handles the SlotWidgetDefinition translation internally.
- ExampleSlot.tsx switched to @nekazari/module-kit hooks (useAuth, useI18n).

Dependencies bumped:
- @nekazari/module-kit ^0.6.0  (new)
- @nekazari/module-builder ^1.2.0
- @nekazari/sdk ^1.1.0
- @nekazari/ui-kit ^1.0.2-alpha.4
- @tanstack/react-query ^5.59.0  (peer of module-kit)

README rewritten to document the new declarative API + hook surface.
@k8-benetis k8-benetis merged commit 7b5ab97 into main May 14, 2026
3 checks passed
@k8-benetis k8-benetis deleted the feat/template-define-module-v2 branch May 14, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant