@blastin-dev/clocktopus-cli 0.1.1 → 0.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAqEA,wBAAgB,GAAG,IAAI,IAAI,CAE1B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AA4EA,wBAAgB,GAAG,IAAI,IAAI,CAE1B"}
package/dist/src/index.js CHANGED
@@ -1,14 +1,21 @@
1
+ import { createRequire } from "node:module";
1
2
  import { Command } from "commander";
3
+ import { z } from "zod";
2
4
  import { clockInCommand, clockOutCommand, clockStatusCommand, } from "./commands/clock.js";
3
5
  import { loginCommand } from "./commands/login.js";
4
6
  import { logoutCommand } from "./commands/logout.js";
5
7
  import { whoamiCommand } from "./commands/whoami.js";
6
- import { ENVIRONMENTS, setRuntimeEnvironment, } from "./lib/config.js";
8
+ import { ENVIRONMENTS, setRuntimeEnvironment } from "./lib/config.js";
9
+ const require = createRequire(import.meta.url);
10
+ const parsedJson = z
11
+ .object({ version: z.string() })
12
+ .safeParse(require("../../package.json"));
13
+ const version = parsedJson.success ? parsedJson.data.version : "0.0.0";
7
14
  const program = new Command();
8
15
  program
9
16
  .name("clocktopus")
10
17
  .description("CLI for Clocktopus time tracking")
11
- .version("0.1.0")
18
+ .version(version)
12
19
  .option("-e, --env <environment>", "Use environment (dev or prod)")
13
20
  .hook("preAction", (thisCommand) => {
14
21
  const opts = thisCommand.opts();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blastin-dev/clocktopus-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "clocktopus": "./dist/bin/clocktopus.js"
@@ -11,11 +11,13 @@
11
11
  "dependencies": {
12
12
  "commander": "^13.0.0",
13
13
  "conf": "^13.0.0",
14
+ "date-fns": "4.1.0",
14
15
  "zod": "4.1.12"
15
16
  },
16
17
  "devDependencies": {
17
18
  "@types/node": "22.15.3",
18
19
  "eslint": "^9.28.0",
20
+ "eslint-plugin-import-x": "^4.16.1",
19
21
  "typescript": "5.9.2",
20
22
  "@repo/eslint-config": "0.0.0",
21
23
  "@repo/prettier-config": "0.1.0",