Commit Graph

351 Commits

Author SHA1 Message Date
hykocx d855485ef1 chore(config): bump version to 1.3.27 2026-04-19 16:57:04 -04:00
hykocx 3a339d07da chore: bump version to 1.3.27 2026-04-19 16:56:58 -04:00
hykocx dcd4d9b9f9 refactor(admin): replace raw form elements with shared Input, Textarea, and Switch components in RoleEditPage 2026-04-19 16:56:50 -04:00
hykocx 10660bedf5 chore(release): bump version to 1.3.26 2026-04-19 16:42:56 -04:00
hykocx f08376d979 feat(users): refactor users system 2026-04-19 16:42:33 -04:00
hykocx af8da2aa86 docs(storage): add readme for the storage module 2026-04-19 16:09:31 -04:00
hykocx 5132d0b52a chore: bump version to 1.3.25 2026-04-19 16:06:51 -04:00
hykocx 692a014dd8 refactor(storage): replace configureStorageApi with additive registration pattern 2026-04-19 16:06:32 -04:00
hykocx b49cddece3 docs(assets): update git banner image 2026-04-15 20:55:12 -04:00
hykocx 5325b80c05 docs(TODO): mark theme task as done and add storage permissions task 2026-04-15 20:53:46 -04:00
hykocx 962d4c5008 chore(init): remove configureStorageApi initialization from zen setup 2026-04-15 20:52:33 -04:00
hykocx fc7d4ffe1f chore: bump version to 1.3.24 2026-04-15 20:51:09 -04:00
hykocx 91dff122c4 feat(storage): configure storage API with default access policies during initialization 2026-04-15 20:50:57 -04:00
hykocx c0a62fe87a chore: bump version to 1.3.23 2026-04-15 20:46:34 -04:00
hykocx 0eee13542d style(ui): remove hover translate-y animation from StatCard component 2026-04-15 20:46:26 -04:00
hykocx 1c6eb0c818 chore: bump version to 1.3.22 2026-04-15 20:43:21 -04:00
hykocx 41edccc1a3 refactor(admin): replace static dashboard stats with dynamic widget registry 2026-04-15 20:43:10 -04:00
hykocx 371a69c499 chore: bump version to 1.3.21 2026-04-15 19:58:02 -04:00
hykocx 73a8639324 fix(admin): prevent menu from closing when toggling theme in header dropdown 2026-04-15 19:57:46 -04:00
hykocx c7018848a1 chore: bump version to 1.3.20 2026-04-15 19:55:54 -04:00
hykocx 1d64ffd6f5 refactor(admin): replace ThemeToggle component with inline theme hook in AdminHeader 2026-04-15 19:55:38 -04:00
hykocx 8b8accdfce chore(release): bump version to 1.3.19 2026-04-15 19:47:48 -04:00
hykocx 44570eb773 refactor(storage): unify storage env vars by removing B2-specific prefixes 2026-04-15 19:47:34 -04:00
hykocx 2f5cf9fe22 chore: bump version to 1.3.18 2026-04-15 17:50:57 -04:00
hykocx a3cb55814f feat: extract ThemeWatcher component for system theme detection 2026-04-15 17:50:43 -04:00
hykocx 2b79abb351 chore: bump version to 1.3.17 and add themes export 2026-04-15 17:06:41 -04:00
hykocx 0d940e3997 refactor: extract theme logic into shared core module 2026-04-15 17:06:37 -04:00
hykocx e1a7815b76 docs: add TODO.md with planned features roadmap 2026-04-14 20:20:25 -04:00
hykocx be064011b3 chore: bump version to 1.3.16 2026-04-14 20:15:45 -04:00
hykocx 23ef354224 chore: bump version to 1.3.16 2026-04-14 20:15:37 -04:00
hykocx 6cd6ce6f6f build: set esbuildOptions outbase to 'src' in tsup config
Set `options.outbase = 'src'` in the esbuildOptions callback to ensure
output files preserve the correct directory structure relative to the
`src` folder, preventing path flattening during the build process.
2026-04-14 20:15:30 -04:00
hykocx 240bfd1ff1 chore: bump version from 1.3.14 to 1.3.15 2026-04-14 20:01:33 -04:00
hykocx 9cb761adbd chore: include .env.example in published package files 2026-04-14 20:01:22 -04:00
hykocx e1593ce0bf chore: bump version to 1.3.14 and update zen-db bin path
- Increment package version from 1.3.13 to 1.3.14
- Update `zen-db` binary path from `dist/cli/database.js`
  to `dist/core/database/cli.js` to reflect new file structure
2026-04-14 19:58:31 -04:00
hykocx 7ef37e3ebd refactor: reorganize package exports under namespaced paths
- Prefix feature exports with `features/` (auth, admin, provider)
- Prefix shared exports with `shared/` (components, icons, lib, config, logger, rate-limit)
- Add new explicit exports for `shared/logger`, `shared/config`, and `shared/rate-limit`
- Update internal imports to use package self-referencing (`@zen/core/shared/*`) instead of relative paths
2026-04-14 19:57:48 -04:00
hykocx cee521b0e4 refactor(auth): replace relative imports with @zen/core alias
Update BaseLayout imports in auth email templates to use the
`@zen/core/email/templates` module alias instead of relative paths,
improving maintainability and consistency across the codebase.
2026-04-14 19:35:19 -04:00
hykocx 9584b23ed7 fix: correct import paths and remove DatabaseError export
- Fix BaseLayout import paths in auth email templates from
  `../../core/...` to `../../../core/...` to match correct
  directory depth
- Remove unused `DatabaseError` from db.js exports
2026-04-14 19:31:00 -04:00
hykocx 6a5f43d50e fix: update database CLI entry point path
Move the database CLI entry point from `src/cli/database.js` to
`src/core/database/cli.js` to better reflect its location within
the core database module. Update both the `package.json` bin path
and `tsup.config.js` build entry accordingly.
2026-04-14 19:29:07 -04:00
hykocx 91c86172e4 fix: update database CLI entry point path
Move the database CLI from `src/cli/database.js` to
`src/core/database/cli.js` to better reflect its association
with the database module. Update both the `package.json` bin
path and `tsup.config.js` entry points accordingly.
2026-04-14 19:29:02 -04:00
hykocx 3131df2b71 refactor: remove module system integration from admin and CLI
Removes all module-related logic from the admin dashboard, CLI database
initialization, and AdminPages component:

- Drop `initModules` call from `db init` CLI command and simplify the
  completion message to only reflect core feature tables
- Remove `getModuleDashboardStats` and module page routing from admin
  stats actions and update usage documentation accordingly
- Simplify `AdminPagesClient` to remove module page loading, lazy
  components, and module-specific props (`moduleStats`, `modulePageInfo`,
  `routeInfo`, `enabledModules`)
2026-04-14 19:26:48 -04:00
hykocx 242ea69664 feat(storage): refactor storage config and remove module registry
Introduce a dedicated `storage-config.js` for registering public
prefixes and access policies via `configureStorageApi()`, replacing the
previous `getAllStoragePublicPrefixes` / `getAllStorageAccessPolicies`
imports from the module registry.

Remove `getAllApiRoutes()` from the router so module-level routes are no
longer auto-collected; feature routes must now be registered explicitly
via `registerFeatureRoutes()` during `initializeZen()`.

Update `.env.example` to document separate `ZEN_STORAGE_PROVIDER`,
`ZEN_STORAGE_B2_*` variables for Backblaze B2 alongside the existing
Cloudflare R2 variables, making provider selection explicit.

Clean up admin navigation and page components to drop module-injected
nav entries, keeping only core and system sections.
2026-04-14 17:43:06 -04:00
hykocx 4a06cace5d refactor: remove modules system from core package
- Remove all module-related entry points from package.json exports
- Remove module source files from tsup build configuration
- Clean up external dependencies related to modules
- Update DEV.md to reflect modules removal from architecture
- Clarify package description to specify Next.js CMS
2026-04-14 17:27:04 -04:00
hykocx 936d21fdec docs/feat: add storage policies to discovery and refactor utils
- Add `storagePublicPrefixes` and `storageAccessPolicies` fields to
  both internal and external module config loading in discovery.js
- Add a module-level `MIME_TYPES` constant in storage/utils.js to
  avoid recreating the object on every `getMimeType` call
- Remove unused `validateImageDimensions` export from storage/index.js
- Remove dead `isFinite` check after `Math.min/max` in `getPresignedUrl`
  (result is always finite at that point)
- Remove unused `warn` import from storage/utils.js
- Add documentation rule in DEV.md: comments must always reflect the
  actual behavior of the code they describe
2026-04-14 17:23:43 -04:00
hykocx 2e348a1608 feat(storage): add configurable storage access policies
Replace hardcoded `users/` path-based access control with a
declarative `storageAccessPolicies` system defined per module via
`defineModule()`.

- Add `storageAccessPolicies` field to `defineModule()` defaults with
  support for `owner` and `admin` policy types
- Expose `getAllStorageAccessPolicies()` from the modules/storage layer
- Refactor `handleGetFile` in `storage/api.js` to resolve access
  control dynamically from registered policies instead of hardcoded
  path checks
- Add `ZEN_STORAGE_ENDPOINT` env var and update `.env.example` to
  support S3-compatible backends (Cloudflare R2, Backblaze B2)
- Document the env/doc sync convention in `DEV.md`
2026-04-14 17:09:27 -04:00
hykocx 67de464e1d refactor(pdf): simplify PDF module by removing redundant utilities
Remove helper functions (cmToPoints, inchesToPoints, mmToPoints,
createElement, PAGE_SIZES) and consolidate re-exports from
@react-pdf/renderer into a single export statement. Retain only
the getFilename utility and streamline the module to reduce
unnecessary abstraction over the underlying library.
2026-04-13 18:50:13 -04:00
hykocx dd6eda3a8a refactor(payments): simplify Stripe module with singleton and static imports
- Replace dynamic `import('stripe')` with static import for clarity
- Introduce singleton pattern for Stripe instance to avoid re-initialization
- Convert `getStripe()` from async to sync function
- Remove redundant JSDoc comments to reduce verbosity
- Remove `paymentMethodTypes` option from `createCheckoutSession`
- Remove default export of `stripe` instance from payments index
- Add webhook signature verification and idempotency key helpers
- Add customer and subscription management utilities
2026-04-13 18:42:48 -04:00
hykocx 87a04db04b feat(email): refactor email module and improve config handling
- Simplify `sendEmail` by extracting `resolveFrom` and `buildPayload` helpers
- Remove `sendAuthEmail` and `sendAppEmail` exports, keeping only `sendEmail` and `sendBatchEmails`
- Replace hardcoded fallback sender with env-based validation (throws if missing)
- Update `BaseLayout` to resolve `supportEmail` from `ZEN_SUPPORT_EMAIL` env var instead of hardcoded default
- Conditionally render support section only when a support email is available
- Remove verbose JSDoc comments and reduce overall code verbosity
2026-04-13 18:37:06 -04:00
hykocx 59fce3cd91 refactor(api): update README and refactor api route registration
Restructure the core API to separate infrastructure routes from feature
routes. Key changes:

- Add `runtime.js` for global state: session resolver and feature route
  registry
- Add `file-response.js` for streaming file responses (storage endpoint)
- Remove feature routes (auth/users) from `core-routes.js`, keeping only
  true infrastructure routes (health, storage)
- Introduce `registerFeatureRoutes()` so features self-register during
  `initializeZen()` instead of being hardcoded in `core-routes.js`
- Add `UserFacingError` class to safely surface client-facing errors
  without leaking internal details
- Fix import path for `rateLimit.js` to use shared lib location
- Update README to reflect new two-step registration flow and clarify
  the role of `core-routes.js`
2026-04-13 17:20:14 -04:00
hykocx a3921a0b98 feat(database): refactor CLI, add column whitelist, and SSL config
- Add `ZEN_DB_SSL_DISABLED` env variable to allow disabling SSL for database connections
- Refactor database CLI to split init logic into `initFeatures` and `initModules` for modular table initialization, with graceful fallback when modules are absent
- Extract `printHelp` and `askConfirmation` helpers for cleaner CLI structure
- Ensure `closePool` is called on both success and error paths in CLI
- Add `filterAllowedColumns` utility in `crud.js` to enforce column whitelists, preventing mass-assignment of privileged fields (e.g. `role`, `email_verified`)
- Update drop command description from "auth tables" to "all tables"
2026-04-13 16:35:23 -04:00
hykocx 6521179e10 feat(cron): refactor cron utility with validation and metadata
- Add input validation for name, schedule expression, and handler
- Store full CronEntry metadata (handler, schedule, timezone, registeredAt)
  instead of raw job instance to support introspection
- Add JSDoc typedefs for CronEntry and improve all function docs
- Use globalThis symbol store to survive Next.js hot-reload
- Remove verbose per-run info logs to reduce noise
- Replace `||` with `??` for runOnInit default to handle falsy correctly
- Fix stop/stopAll to access `entry.job` from new storage structure
2026-04-13 15:30:17 -04:00