NPM Distribution v4 - Validation Results
This document records the validation results for NPM Distribution v4 (version 0.2.0).
Test Date
2026-01-02
Test Environment
- macOS Darwin 24.5.0
- Node.js 20.x
- pnpm 8.x
- Next.js 15.4.6
- TypeScript 5.9.x
Projects Tested
1. nextspark-package (Monorepo Mode)
The source monorepo where @nextspark/core is developed.
Location: sass-boilerplate/nextspark-package/
2. nextspark-project (NPM Mode)
A consumer project that installs @nextspark/core as an npm package.
Location: sass-boilerplate/nextspark-project/
Phase 1-6: Build & Setup
| Phase | Status | Notes |
|---|---|---|
| 1. Build @nextspark/core with tsup | ✅ PASSED | ESM build successful |
| 2. Setup nextspark-project structure | ✅ PASSED | Project scaffolded |
| 3. Add dependencies | ✅ PASSED | Package linked |
| 4. Migrate imports | ✅ PASSED | 47 files updated to @nextspark/registries/* |
| 5. Configuration updates | ✅ PASSED | Turbopack + webpack aliases |
| 6. Build verification [GATE] | ✅ PASSED | pnpm build succeeds |
Phase 7: Monorepo Validation (16 Tests)
Tested in nextspark-package/:
| Test | Status |
|---|---|
| Login | ✅ PASSED |
| Dashboard | ✅ PASSED |
| Tasks CRUD | ✅ PASSED |
| Team Switch | ✅ PASSED |
| Superadmin Access | ✅ PASSED |
| DevTools Access | ✅ PASSED |
| Entity List | ✅ PASSED |
| Entity Create | ✅ PASSED |
| Entity Edit | ✅ PASSED |
| Entity Delete | ✅ PASSED |
| Permissions | ✅ PASSED |
| Templates | ✅ PASSED |
| i18n | ✅ PASSED |
| Theme Switching | ✅ PASSED |
| API Endpoints | ✅ PASSED |
| Registry Generation | ✅ PASSED |
Result: 16/16 PASSED
Phase 8: NPM Mode Validation (4 Tests)
Tested in nextspark-project/:
Test 1: CRUD Tasks
| Step | Status | Notes |
|---|---|---|
| Login as superadmin | ✅ | superadmin@nextspark.dev |
| Navigate to Tasks | ✅ | /dashboard/tasks loads |
| Tasks list loads | ✅ | 2 initial tasks shown |
| Create new task | ✅ | "Test Task from NPM Mode" |
| Task appears in list | ✅ | 3 tasks shown |
Test 2: Team Switch
| Step | Status | Notes |
|---|---|---|
| Click team switcher | ✅ | Menu opens |
| Shows current team | ✅ | "NextSpark Team" |
| Shows role | ✅ | "Owner" |
| "Manage Teams" link | ✅ | Navigates to /dashboard/settings/teams |
Test 3: Superadmin Teams Review
| Step | Status | Notes |
|---|---|---|
| Navigate to /superadmin | ✅ | Panel loads |
| Click on Teams | ✅ | /superadmin/teams |
| Total teams shown | ✅ | 27 teams |
| User Teams tab | ✅ | 26 teams listed |
| System Admin tab | ✅ | 1 team |
| Team details visible | ✅ | Name, owner, members, date |
Test 4: Developer DevTools
| Step | Status | Notes |
|---|---|---|
| Logout | ✅ | Returns to login |
| Use Dev Keyring | ✅ | Select "Developer" |
| Login as developer | ✅ | developer@nextspark.dev |
| DevTools link visible | ✅ | In top nav |
| Navigate to DevTools | ✅ | /devtools |
| API Explorer | ✅ | 16 endpoints shown |
| Entity endpoints | ✅ | 8 endpoints (customers, pages, posts, tasks) |
Result: 4/4 PASSED
Known Issues (Non-Blocking)
Translation Warnings
IntlError: MISSING_MESSAGE: Could not resolve `navigation.pages` in messages for locale `en`
IntlError: MISSING_MESSAGE: Could not resolve `common.userRoles.developer` in messages for locale `en`
Impact: Cosmetic only. Some UI labels show keys instead of translated text.
Fix: Add missing translation keys to contents/themes/default/messages/en/
Watch Mode Warnings
Error: ENOENT: no such file or directory, stat '.../contents/themes/...'
Impact: None. Expected in NPM mode where theme source files aren't watched. Fix: Not needed. This is expected behavior.
Architecture Validated
Alias Resolution Chain
Compiled Package Code
│
├── import from '@nextspark/registries/*'
│ │
│ ▼
│ Turbopack resolveAlias
│ │
│ ▼
│ .nextspark/registries/entity-registry.ts ✅
│
└── import from '@nextspark/core/*'
│
▼
node_modules/@nextspark/core/dist/*.js ✅
Registry Generation
postinstall hook
│
├── Detects NPM mode (node_modules/@nextspark/core exists)
│
├── Generates registries in .nextspark/registries/
│ ├── entity-registry.ts
│ ├── template-registry.ts
│ ├── template-registry.client.ts
│ ├── permissions-registry.ts
│ ├── plugin-registry.ts
│ ├── theme-registry.ts
│ └── ...
│
└── Updates tsconfig.json with @nextspark/* paths ✅
Conclusion
NPM Distribution v4 (version 0.2.0) is validated and ready for use.
The dual-mode architecture with external registry imports successfully allows:
- Development in monorepo with source registries
- Consumption as npm package with project-specific registries
- Turbopack and webpack compatibility
- TypeScript path resolution