easy-cms 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "./chunk-RXY6YYSF.js";
4
+ } from "./chunk-L3XDY7HM.js";
5
5
 
6
6
  // src/bin.ts
7
7
  process.exitCode = await run(process.argv.slice(2));
@@ -210,6 +210,7 @@ Commands:
210
210
  admin:create Create an admin user (also: create-admin)
211
211
  serve Run the CMS as its own server (admin + REST API)
212
212
  jobs:run Run due scheduled publishes, jobs, webhook and email retries (also: run-scheduled)
213
+ search:reindex [slug] Build the search index again from the database
213
214
  backup <file> Copy the database to a SQLite file while the CMS runs
214
215
  backup:decrypt <file> Decrypt a backup made with backups.encryptionKey
215
216
  copy --from <config> Copy all content from another config's database into this one
@@ -275,6 +276,12 @@ Stop writing to the source while copying, or copy from a backup.
275
276
 
276
277
  Runs due scheduled publishes and unpublishes, and retries failed webhook deliveries, once:
277
278
  for a cron job where no server process keeps running. Servers do this every minute on their own.
279
+ `,
280
+ "search:reindex": `Usage: easy-cms search:reindex [collection] [options]
281
+
282
+ Builds the search index (\`search\` in the config) again from the published documents of every
283
+ collection with \`search\`, or of one: after adding \`search\` to a collection or changing its
284
+ fields, or when indexing failed. An in-memory index (memorySearch) is built when the server starts.
278
285
  `,
279
286
  serve: `Usage: easy-cms serve [--port <n>] [--host <host>] [--watch] [--trust-proxy] [options]
280
287
 
@@ -416,6 +423,22 @@ async function run(argv, io = defaultIO) {
416
423
  );
417
424
  return failed ? 1 : 0;
418
425
  }
426
+ case "search:reindex": {
427
+ if (!cms.config.search) {
428
+ io.err("Set `search` in the config first, e.g. search: memorySearch().");
429
+ return 1;
430
+ }
431
+ if (cms.config.search.ephemeral) {
432
+ io.out(
433
+ "This search index lives in the memory of the server process and is built when it starts: restart the server instead."
434
+ );
435
+ return 0;
436
+ }
437
+ const slug = rest.join(" ").trim();
438
+ for (const done of await cms.reindexSearch(slug || void 0))
439
+ io.out(`Indexed ${done.documents} document(s) of ${done.collection}.`);
440
+ return 0;
441
+ }
419
442
  case "migrate": {
420
443
  const applied = await cms.db.migrate();
421
444
  io.out(
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  createStandaloneHandler,
3
3
  run,
4
4
  startServer
5
- } from "./chunk-RXY6YYSF.js";
5
+ } from "./chunk-L3XDY7HM.js";
6
6
  export {
7
7
  createStandaloneHandler,
8
8
  run,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-cms",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Command line tool for Easy CMS",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,11 +21,11 @@
21
21
  "node": ">=22.12"
22
22
  },
23
23
  "dependencies": {
24
- "@easy-cms/core": "^1.12.0",
25
- "@easy-cms/admin": "^1.12.0"
24
+ "@easy-cms/core": "^1.13.0",
25
+ "@easy-cms/admin": "^1.13.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@easy-cms/db-sqlite": "^1.12.0"
28
+ "@easy-cms/db-sqlite": "^1.13.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"