@posthog/convex 2.1.5 → 2.1.7

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,2 +1,2 @@
1
- export declare const version = "2.1.5";
1
+ export declare const version = "2.1.7";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export const version = '2.1.5';
1
+ export const version = "2.1.7";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "https://github.com/PostHog/posthog-js/issues"
12
12
  },
13
13
  "author": "PostHog Inc.",
14
- "version": "2.1.5",
14
+ "version": "2.1.7",
15
15
  "license": "MIT",
16
16
  "keywords": [
17
17
  "convex",
@@ -21,7 +21,8 @@
21
21
  ],
22
22
  "files": [
23
23
  "dist",
24
- "src"
24
+ "src",
25
+ "!src/**/*.spec.md"
25
26
  ],
26
27
  "exports": {
27
28
  "./package.json": "./package.json",
@@ -48,8 +49,8 @@
48
49
  "types": "./dist/client/index.d.ts",
49
50
  "module": "./dist/client/index.js",
50
51
  "dependencies": {
51
- "@posthog/core": "^1.55.1",
52
- "posthog-node": "^5.52.5"
52
+ "@posthog/core": "^1.59.3",
53
+ "posthog-node": "^5.56.4"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@edge-runtime/vm": "^5.0.0",
@@ -67,7 +68,7 @@
67
68
  },
68
69
  "scripts": {
69
70
  "check-types": "pnpm prebuild && pnpm typecheck",
70
- "prebuild": "node -p \"'export const version = \\'' + require('./package.json').version + '\\''\" > src/component/version.ts",
71
+ "prebuild": "node ../../tooling/write-version.mjs src/component/version.ts",
71
72
  "build": "tsc --project ./tsconfig.build.json",
72
73
  "setup:codegen": "test -f .env.local || npx convex dev --once --configure new --dev-deployment local --project posthog-convex-component --typecheck disable || true",
73
74
  "build:codegen": "pnpm run setup:codegen && npx convex codegen --component-dir ./src/component --typecheck disable && pnpm build",
@@ -60,6 +60,27 @@ describe('LocalFeatureFlagEvaluator', () => {
60
60
  expect(await evaluator.getFeatureFlag('pp-flag', 'user', {}, { plan: 'free' })).toBe(false)
61
61
  })
62
62
 
63
+ test.each(['not_icontains', 'not_starts_with', 'not_ends_with', 'not_regex', 'is_not', 'exact', 'gt'])(
64
+ 'returns undefined for an unresolved property with %s',
65
+ async (operator) => {
66
+ const evaluator = new LocalFeatureFlagEvaluator(
67
+ definitions([
68
+ makeFlag('unresolved', {
69
+ filters: {
70
+ groups: [
71
+ {
72
+ properties: [{ key: 'plan', value: 'pro', operator, type: 'person' }],
73
+ rollout_percentage: 100,
74
+ },
75
+ ],
76
+ },
77
+ }),
78
+ ])
79
+ )
80
+ expect(await evaluator.getFeatureFlag('unresolved', 'user', {}, { plan: undefined })).toBeUndefined()
81
+ }
82
+ )
83
+
63
84
  test('returns variant key for multivariate flags', async () => {
64
85
  const evaluator = new LocalFeatureFlagEvaluator(
65
86
  definitions([
@@ -118,15 +118,15 @@ describe('matchProperty — starts_with / ends_with', () => {
118
118
  }
119
119
  )
120
120
 
121
- test.each(['starts_with', 'not_starts_with', 'ends_with', 'not_ends_with'])(
122
- '%s returns false when the property value is null or undefined',
123
- (op) => {
124
- // The null guard fires before operator dispatch, so the not_ variants are not
125
- // pure negations here — both directions return false, matching icontains.
126
- expect(matchProperty(prop(op, 'Val'), { k: null })).toBe(false)
127
- expect(matchProperty(prop(op, 'Val'), { k: undefined })).toBe(false)
128
- }
129
- )
121
+ test.each([
122
+ ['starts_with', false],
123
+ ['not_starts_with', true],
124
+ ['ends_with', false],
125
+ ['not_ends_with', true],
126
+ ] as const)('%s matches null as a string and keeps undefined inconclusive', (op, expected) => {
127
+ expect(matchProperty(prop(op, 'Val'), { k: null })).toBe(expected)
128
+ expect(() => matchProperty(prop(op, 'Val'), { k: undefined })).toThrow(InconclusiveMatchError)
129
+ })
130
130
  })
131
131
 
132
132
  describe('matchProperty — SemVer compatibility policy', () => {
@@ -1 +1 @@
1
- export const version = '2.1.5'
1
+ export const version = "2.1.7"