Commit Graph

22 Commits

Author SHA1 Message Date
hykocx 384eadf7b7 style(admin): update sidebar width to 240px and refine nav item styles 2026-04-22 12:05:46 -04:00
hykocx 345371d43c style(admin): reduce header height and simplify layout spacing and menu item focus styles 2026-04-22 11:09:12 -04:00
hykocx ba3b6239b1 docs: add project plan documentation in French 2026-04-22 10:49:14 -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 060eb367d8 build(tsup): add @zen/core/api to external list and document rule
- Add `@zen/core/api` to the `external` array in `tsup.config.js` to
  prevent build failures caused by unresolved `dist/` imports at build time
- Document the externals rule in `docs/DEV.md`: any `@zen/core/*` import
  used in bundled module files must be declared as external, with an
  explanation of why and a code example to follow
2026-04-13 15:16:02 -04:00
hykocx 4ddf834990 refactor(api): refactor API module with route definitions and response utilities
Restructure the core API module to improve clarity, consistency, and
maintainability:

- Introduce `defineApiRoutes()` helper for declarative route definitions
  with built-in config validation at startup
- Add `apiSuccess()` / `apiError()` response utilities; enforce their
  use across all handlers (core and modules)
- Move auth enforcement to route definitions (`auth: 'public' | 'user' |
  'admin'`), removing manual auth checks from handlers
- Extract core routes into `core-routes.js`; router now has no knowledge
  of specific features
- Rename `nx-route.js` to `route-handler.js` and update package.json
  export accordingly
- Update ARCHITECTURE.md to reflect new API conventions and point to
  `src/core/api/README.md` for details
2026-04-13 15:13:03 -04:00
hykocx 89741d4460 docs: add project context note in DEV.md 2026-04-13 14:51:43 -04:00
hykocx 260fcfc4f8 docs: extract publication and architecture sections to dedicated files
Move the "Publier le package" section from DEV.md to a new
PUBLICATION.md file, and add references to ARCHITECTURE.md and
PUBLICATION.md in the main DEV.md index. This reduces the size of
DEV.md and improves discoverability by grouping related content
into focused documents.
2026-04-13 13:52:15 -04:00
hykocx 16db807004 docs: rewrite DEV.md with detailed dev and security guidelines
Replace the terse DEV.md with a comprehensive French-language guide
covering code standards, security rules, and the npm publish workflow.

Key changes:
- Expand code principles into readable prose (single responsibility,
  control flow, input validation, promise handling, minimal scope)
- Add concrete security sections: parameterized queries, secret
  management via env vars, dependency auditing, and opaque error
  messages
- Document the full publish procedure (version bump, build, audit,
  npm publish with provenance, git tag)
- Remove the NASA Power of Ten bullet list in favor of actionable,
  project-specific guidelines
2026-04-13 13:34:17 -04:00
hykocx 3e633e981a docs/refactor: rename getModuleMetadata and update route auth format
- Rename `getModuleMetadata` to `getModuleMetadataGenerator` in registry,
  index, and client exports to clarify its purpose (returns a generator
  function, not a metadata object)
- Add new `getModuleMetadata` and `getMetadataGenerator` exports from
  `modules.metadata.js` for server-side metadata object retrieval
- Update route auth format in docs from `requireAuth`/`requireAdmin`
  flags to a single `auth` field with values: `'admin'`, `'user'`,
  or `'public'`
- Fix `isModuleEnabledInEnv` to replace hyphens with underscores in
  env var names (e.g. `my-module` → `ZEN_MODULE_MY_MODULE`)
- Replace `useState` initializer in `ZenProvider` with `useRef` guard
  to avoid React strict mode double-invocation issues
2026-04-12 18:58:01 -04:00
hykocx c806c8d8d4 docs: replace project structure with dev philosophy section
Replace the project directory tree and PR integration/versioning
sections with a new "Philosophie de développement" section covering
the NASA Power of Ten rules and security-by-design principles.
2026-04-12 18:49:53 -04:00
hykocx 2017f9791b docs: remove zen-setup CLI and simplify installation guide
- Remove `zen-setup` binary from package.json and package-lock.json
- Replace manual setup steps with `npx @zen/start` CLI command
- Simplify INSTALL.md by reducing steps from 6 to 4
- Update DEV.md to reflect removal of zen-setup from CLI scripts
- Fix relative path to `.env.example` in documentation
2026-04-12 17:07:33 -04:00
hykocx 27a5887527 docs: add development and security links to README 2026-04-12 15:29:16 -04:00
hykocx b8a6b3e86c docs: update org name from hykocx to zen and expand DEV guide
- Replace `hykocx` with `zen`/`HYKO` in LICENSE copyright notices
- Update npm registry scope from `@hykocx` to `@zen` in INSTALL.md
- Update npm auth token config path to use `zen` org in DEV.md
- Add project structure overview to DEV.md
- Add contribution standards section referencing GUIDE.md and REDACTION.md
- Add semver versioning bump reference table to DEV.md
2026-04-12 15:13:11 -04:00
hykocx 81172bda94 chore: rename package from @hykocx/zen to @zen/core
Update all references across source files, documentation, and
configuration to reflect the new package scope and name. This includes
updating `.npmrc` registry config, install instructions, module
examples, and all import path comments throughout the codebase.
2026-04-12 15:09:26 -04:00
hykocx 54c4ad058d docs: translate INSTALL.md to French and add npm registry step
- Translate all installation instructions from English to French
- Add new step to configure the npm registry with a `.npmrc` file
- Renumber steps accordingly (now 6 steps instead of 5)
2026-04-12 14:37:33 -04:00
hykocx c33383adf7 docs: translate posts README to French and update language guide
- Rewrite content with clearer structure, adding env variable examples and improving field type descriptions
2026-04-12 14:32:21 -04:00
hykocx 99a56d2c39 feat(modules): add external module registration and defineModule support
- Add `./modules/define` export path pointing to `defineModule.js`
- Implement `registerExternalModules()` to handle modules passed via `zen.config.js`, with env var gating (`ZEN_MODULE_<NAME>=true`)
- Extract `buildAdminConfig()` helper to consolidate admin navigation/page config building
- Refactor `loadModuleConfig()` to use `buildAdminConfig()` and simplify public routes check
- Improve `initializeModuleTables()` to gracefully skip modules without `db.js` instead of erroring
- Update module discovery JSDoc to reflect external module registration support
2026-04-12 13:39:56 -04:00
hykocx 024d6e37e6 revert: fix package version from 1.4.0 to 1.3.1
Reverts the package version in package-lock.json from 1.4.0 back to 1.3.1
2026-04-12 13:07:59 -04:00
hykocx 65ae3c6788 chore: import codes 2026-04-12 12:50:14 -04:00