@theholocron/holocron-plugin-posthog 5.0.0-alpha.20 → 5.0.0-alpha.201

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
@@ -53,6 +53,6 @@ runtime — the personal key is for management only.
53
53
  | `whoami` | Calls `/api/users/@me/` to verify the token and return the org slug. |
54
54
  | `ensureProject` | Lists projects and returns the existing one if found by name; creates it via `POST /api/projects/` otherwise. Returns the project's `api_token` (`phc_*`) and `alreadyExists`. |
55
55
 
56
- `holocron setup` calls `ensureProject` and pushes `NEXT_PUBLIC_POSTHOG_KEY`
56
+ `holocron repo setup` calls `ensureProject` and pushes `NEXT_PUBLIC_POSTHOG_KEY`
57
57
  (the project `api_token`) and `NEXT_PUBLIC_POSTHOG_HOST` (the resolved
58
58
  `host` value) to GitHub Secrets.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { PostHogClient, PostHogClient as PostHogClient$1, PostHogClientOptions, PostHogProject, PostHogProjectsResponse, PostHogUser, createPostHogClient } from "@theholocron/posthog-client";
2
- import { Analytics, AuthError, ResolveTokenInput } from "@theholocron/cli";
2
+ import { Analytics, AuthError, ResolveTokenInput, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess } from "@theholocron/cli";
3
3
  //#region src/auth.d.ts
4
4
  declare const resolveToken: (input?: ResolveTokenInput) => string;
5
5
  //#endregion
@@ -30,21 +30,12 @@ declare class PostHogAnalytics implements Analytics {
30
30
  }
31
31
  //#endregion
32
32
  //#region src/verify-token.d.ts
33
- interface VerifyTokenSuccess {
34
- ok: true;
35
- subject: string;
36
- }
37
- interface VerifyTokenFailure {
38
- ok: false;
39
- message: string;
40
- }
41
- type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
42
33
  interface VerifyTokenOptions {
43
34
  host?: string;
44
35
  baseUrl?: string;
45
36
  fetch?: typeof fetch;
46
37
  }
47
- declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult>;
38
+ declare function verifyToken(token: string, opts?: VerifyTokenOptions): Promise<VerifyTokenResult$1>;
48
39
  //#endregion
49
40
  //#region src/index.d.ts
50
41
  interface PostHogPluginOptions extends ResolveTokenInput, PostHogAnalyticsOptions {
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { createPostHogClient, createPostHogClient as createPostHogClient$1 } from "@theholocron/posthog-client";
2
2
  import { AuthError, createResolveToken } from "@theholocron/cli";
3
+ import { errorMessage } from "@theholocron/misc-utils";
3
4
  //#region src/auth.ts
4
5
  const resolveToken = createResolveToken({
5
6
  envName: "HOLOCRON_POSTHOG_TOKEN",
@@ -62,7 +63,7 @@ async function verifyToken(token, opts = {}) {
62
63
  } catch (err) {
63
64
  return {
64
65
  ok: false,
65
- message: err instanceof Error ? err.message : String(err)
66
+ message: errorMessage(err)
66
67
  };
67
68
  }
68
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-posthog",
3
- "version": "5.0.0-alpha.20",
3
+ "version": "5.0.0-alpha.201",
4
4
  "description": "Holocron plugin for PostHog. Implements the analytics capability — project provisioning and tracking token retrieval.",
5
5
  "keywords": [
6
6
  "analytics",
@@ -8,12 +8,12 @@
8
8
  "plugin",
9
9
  "posthog"
10
10
  ],
11
- "homepage": "https://github.com/theholocron/holocron/tree/main/packages/holocron-plugin-posthog#readme",
11
+ "homepage": "https://github.com/theholocron/holocron/tree/main/plugins/holocron-plugin-posthog#readme",
12
12
  "bugs": "https://github.com/theholocron/holocron/issues",
13
13
  "repository": {
14
14
  "type": "git",
15
15
  "url": "git+https://github.com/theholocron/holocron.git",
16
- "directory": "packages/holocron-plugin-posthog"
16
+ "directory": "plugins/holocron-plugin-posthog"
17
17
  },
18
18
  "license": "MIT",
19
19
  "author": "Newton Koumantzelis",
@@ -30,14 +30,15 @@
30
30
  "dist"
31
31
  ],
32
32
  "dependencies": {
33
- "@theholocron/posthog-client": "^1.20.0"
33
+ "@theholocron/posthog-client": "^1.43.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@theholocron/eslint-config": "^8.0.0",
37
- "@theholocron/http-client": "^1.20.0",
38
- "@theholocron/tsconfig": "^8.0.0",
39
- "@theholocron/tsdown-config": "^8.0.0",
40
- "@theholocron/vitest-config": "^8.0.0",
36
+ "@theholocron/eslint-config": "^8.8.2",
37
+ "@theholocron/http-client": "^1.43.1",
38
+ "@theholocron/misc-utils": "^1.16.0",
39
+ "@theholocron/tsconfig": "^8.8.2",
40
+ "@theholocron/tsdown-config": "^8.8.2",
41
+ "@theholocron/vitest-config": "^8.8.2",
41
42
  "@types/node": "^26",
42
43
  "@vitest/coverage-v8": "^4.1.11",
43
44
  "@vitest/eslint-plugin": "^1.6.27",
@@ -46,13 +47,14 @@
46
47
  "eslint-plugin-n": "^18.3.0",
47
48
  "globals": "^17.11.0",
48
49
  "tsdown": "^0.22.14",
49
- "tsx": "4.23.12",
50
+ "tsx": "4.23.15",
50
51
  "typescript": "^5.9.3",
51
52
  "vitest": "^4.1.11",
52
- "@theholocron/cli": "5.0.0-alpha.20"
53
+ "@theholocron/cli": "5.0.0-alpha.201"
53
54
  },
54
55
  "peerDependencies": {
55
- "@theholocron/cli": "5.0.0-alpha.20"
56
+ "@theholocron/misc-utils": "^1.16.0",
57
+ "@theholocron/cli": "5.0.0-alpha.201"
56
58
  },
57
59
  "engines": {
58
60
  "node": ">=22"