{"_id":"@electronlibre/pupitre-core","name":"@electronlibre/pupitre-core","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@electronlibre/pupitre-core","version":"0.1.0","description":"Portable editorial CMS core for Pupitre — plugin registry, lifecycle hooks, injectable CRUD (articles, categories, media, authors, users).","type":"module","license":"MIT","engines":{"node":">=22.12.0"},"exports":{".":"./src/index.mjs"},"scripts":{"test":"node --test 'src/**/*.test.mjs' 'src/*.test.mjs'","demo":"node examples/minimal/demo.mjs","prepublishOnly":"npm test"},"peerDependencies":{"busboy":"^1.6.0"},"repository":{"type":"git","url":"git+https://github.com/ZaraA1971/pupitre-core.git"},"bugs":{"url":"https://github.com/ZaraA1971/pupitre-core/issues"},"homepage":"https://github.com/ZaraA1971/pupitre-core#readme","keywords":["cms","editorial","desk","pupitre","plugins"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_id":"@electronlibre/pupitre-core@0.1.0","gitHead":"8d875fe96363dbd3eb74efa679ce4c877e543570","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-lvk1etn5C83zmee8FKjxeD2zQdAdAkIf0bq0dmVd3X5XjqfiqofbYWpd/Z2hVTezbmEtLrZkpAcDAlgCl49L2g==","shasum":"257ed5bb6474096cfa054b6576e9fb02fc947963","tarball":"https://registry.npmjs.org/@electronlibre/pupitre-core/-/pupitre-core-0.1.0.tgz","fileCount":27,"unpackedSize":91119,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@electronlibre%2fpupitre-core@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpS7BPhy4ylXr6mWM9556vAtUXB4E4JreG+xh0l5rQJAIgb/pwXc+V4cLFFsUp71NqnU0WpJlTAkKLZ693VXPkghg="}]},"_npmUser":{"name":"zaraa","email":"emmanueltorregano@me.com"},"directories":{},"maintainers":[{"name":"zaraa","email":"emmanueltorregano@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pupitre-core_0.1.0_1785519799921_0.9626756422726799"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-31T17:43:19.734Z","0.1.0":"2026-07-31T17:43:20.075Z","modified":"2026-07-31T17:43:20.504Z"},"maintainers":[{"name":"zaraa","email":"emmanueltorregano@me.com"}],"description":"Portable editorial CMS core for Pupitre — plugin registry, lifecycle hooks, injectable CRUD (articles, categories, media, authors, users).","homepage":"https://github.com/ZaraA1971/pupitre-core#readme","keywords":["cms","editorial","desk","pupitre","plugins"],"repository":{"type":"git","url":"git+https://github.com/ZaraA1971/pupitre-core.git"},"bugs":{"url":"https://github.com/ZaraA1971/pupitre-core/issues"},"license":"MIT","readme":"# pupitre-core\n\nPortable **Pupitre** CMS core — plugin registry, lifecycle hooks, and injectable HTTP CRUD for articles, categories, media, authors, and users.\n\n**MIT** licensed. Built for hosts that bring their own auth, SQL tables, password hashing, and product plugins.\n\n> This package is the extractable slice from [ElectronLibre](https://electronlibre.info)’s editorial desk. The ElectronLibre host, SPA, billing, Brevo, OneSignal, and RAG adapters are **not** included.\n\n## Install\n\n```bash\nnpm install @electronlibre/pupitre-core busboy\n```\n\n(Peer dependency: `busboy` for media uploads.)\n\nFrom this repo without publishing:\n\n```bash\ngit clone https://github.com/ZaraA1971/pupitre-core.git\ncd pupitre-core\nnpm install busboy\nnpm test\nnpm run demo\n```\n\n## What you get\n\n| Surface | Role |\n|---------|------|\n| `createPluginRegistry` | Caps, route dispatch, lifecycle hooks |\n| `emitDeskLifecycle` | Bump `contentGen` + run hooks |\n| `createArticleHelpers` | Slugs / ids / `canEditArticle` (inject table + role predicates) |\n| `createCategoriesStore` / `createMediaStore` / `createUsersStore` | SQL stores (table names injected) |\n| `tryHandleCoreCrud` | HTTP CRUD: articles, categories, media, authors, users |\n| Pure utils | `slugify`, `asJson`, `nowMysql`, … |\n\n## What you must provide (host)\n\n- HTTP session / auth gate before calling core routers\n- MySQL (or compatible) `pool`\n- `rowToArticle` / `parseJsonArray` mappers for your schema\n- Role predicates (`canAccessDesk`, `canEditAll`, `canPublish`, …)\n- **`userPolicy.hashPassword`** — the core never hashes passwords itself\n- Optional hooks: `afterPublish`, `afterUserCreate`, `afterUserDelete`, twin/keyword helpers\n- Media FS helpers via `ctx.mediaFs` when using media routes\n\n## Minimal demo\n\n```bash\nnpm run demo\n```\n\nExercises registry + lifecycle + `createArticleHelpers` (no database).\n\n## Security notes (users)\n\n- Core refuses to run users routes without a complete `userPolicy` (including `hashPassword`).\n- Side effects (email, newsletter enrollment, reset tokens) belong in host hooks, not in this package.\n- Columns such as `wp_role` / `newsletter_opt_in` are an opinionated editorial schema, not a WordPress runtime dependency.\n\n## Non-goals\n\n- Full SPA desk UI\n- Stripe / Brevo / OneSignal / RAG\n- Opinionated public front-end\n\n## npm\n\nPublished as [`@electronlibre/pupitre-core`](https://www.npmjs.com/package/@electronlibre/pupitre-core) (public scoped package).\n\n```bash\nnpm install @electronlibre/pupitre-core busboy\n```\n\nMaintainers: create the npm org `electronlibre`, add an automation token as GitHub secret `NPM_TOKEN`, then publish via GitHub Release or:\n\n```bash\nnpm publish --access public\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","readmeFilename":"README.md","_rev":"1-d129fe8f0a0c7c29a63fe697b68eb73f"}