@magicpages/ghost-typesense-cli 1.3.0 → 1.3.2

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/README.md CHANGED
@@ -11,6 +11,8 @@ npm install -g @magicpages/ghost-typesense-cli
11
11
  ## Usage
12
12
 
13
13
  1. Create `ghost-typesense.config.json`:
14
+
15
+ Minimal configuration:
14
16
  ```json
15
17
  {
16
18
  "ghost": {
@@ -32,6 +34,26 @@ npm install -g @magicpages/ghost-typesense-cli
32
34
  }
33
35
  ```
34
36
 
37
+ The tool comes with default field configurations optimized for Ghost CMS. These include:
38
+ - Required fields: `id`, `title`, `url`, `slug`, `html`, `excerpt`, `published_at`, `updated_at`
39
+ - Optional fields: `feature_image`, `tags`, `authors`
40
+
41
+ You can override or add additional fields by specifying them in the config:
42
+
43
+ ```json
44
+ {
45
+ "collection": {
46
+ "name": "ghost",
47
+ "fields": [
48
+ { "name": "title", "type": "string", "index": true, "sort": true },
49
+ { "name": "custom_field", "type": "string", "optional": true }
50
+ ]
51
+ }
52
+ }
53
+ ```
54
+
55
+ The tool will ensure all required fields are present with correct types while keeping your custom fields.
56
+
35
57
  2. Available commands:
36
58
 
37
59
  ```bash
package/dist/index.js CHANGED
@@ -9,7 +9,13 @@ import ora from "ora";
9
9
  import { validateConfig } from "@magicpages/ghost-typesense-config";
10
10
  import { GhostTypesenseManager } from "@magicpages/ghost-typesense-core";
11
11
  var program = new Command();
12
- program.name("ghost-typesense").description("CLI tool for managing Ghost content in Typesense").version("1.0.0");
12
+ var { version } = JSON.parse(
13
+ readFileSync(resolve(__dirname, "../package.json"), "utf-8")
14
+ );
15
+ program.name("ghost-typesense").description("CLI tool for managing Ghost content in Typesense").version(version, "-V, --version", "Output the version number").option("-v", "Output the version number", () => {
16
+ console.log(version);
17
+ process.exit(0);
18
+ });
13
19
  program.command("init").description("Initialize Typesense collection with schema from config").requiredOption("-c, --config <path>", "Path to config file").action(async (options) => {
14
20
  try {
15
21
  const spinner = ora("Reading configuration...").start();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicpages/ghost-typesense-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "CLI tool for managing Ghost content in Typesense",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,21 +19,21 @@
19
19
  "typecheck": "tsc --noEmit"
20
20
  },
21
21
  "dependencies": {
22
- "@magicpages/ghost-typesense-config": "*",
23
- "@magicpages/ghost-typesense-core": "*",
22
+ "@magicpages/ghost-typesense-config": "^1.3.1",
23
+ "@magicpages/ghost-typesense-core": "^1.3.1",
24
+ "chalk": "^5.3.0",
24
25
  "commander": "^12.0.0",
25
- "ora": "^8.0.1",
26
- "chalk": "^5.3.0"
26
+ "ora": "^8.0.1"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^20.11.17",
30
- "tsup": "^8.0.1",
31
30
  "rimraf": "^5.0.5",
32
- "vitest": "^1.2.2",
33
- "typescript": "^5.3.3"
31
+ "tsup": "^8.0.1",
32
+ "typescript": "^5.3.3",
33
+ "vitest": "^1.2.2"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
38
  "license": "MIT"
39
- }
39
+ }