feat: migrate template to defineModule v2 (module-kit 0.6.0)#2
Merged
Conversation
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.
…older ids fail nkzModulePreset)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.