@magicpages/ghost-typesense-cli 1.3.1 → 1.3.3

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -2
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -3,13 +3,22 @@
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
5
5
  import { readFileSync } from "fs";
6
- import { resolve } from "path";
6
+ import { resolve, dirname } from "path";
7
+ import { fileURLToPath } from "url";
7
8
  import chalk from "chalk";
8
9
  import ora from "ora";
9
10
  import { validateConfig } from "@magicpages/ghost-typesense-config";
10
11
  import { GhostTypesenseManager } from "@magicpages/ghost-typesense-core";
11
12
  var program = new Command();
12
- program.name("ghost-typesense").description("CLI tool for managing Ghost content in Typesense").version("1.0.0");
13
+ var __filename = fileURLToPath(import.meta.url);
14
+ var __dirname = dirname(__filename);
15
+ var { version } = JSON.parse(
16
+ readFileSync(resolve(__dirname, "../package.json"), "utf-8")
17
+ );
18
+ 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", () => {
19
+ console.log(version);
20
+ process.exit(0);
21
+ });
13
22
  program.command("init").description("Initialize Typesense collection with schema from config").requiredOption("-c, --config <path>", "Path to config file").action(async (options) => {
14
23
  try {
15
24
  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.1",
3
+ "version": "1.3.3",
4
4
  "description": "CLI tool for managing Ghost content in Typesense",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,19 +21,19 @@
21
21
  "dependencies": {
22
22
  "@magicpages/ghost-typesense-config": "^1.3.1",
23
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
+ }