Skip to content

Commit 8c19fbe

Browse files
committed
fix(deps): remediate dependency-scanning advisories
1 parent b4fe5b3 commit 8c19fbe

33 files changed

Lines changed: 5665 additions & 9987 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@reflag/cli": patch
3+
---
4+
5+
Update Express and Zod to patched versions. Preserve CLI schema parsing behavior when migrating to Zod 4.

‎.github/workflows/package-ci.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
- id: test
4141
name: Test the project
4242
run: yarn test:ci
43+
- name: Check standalone examples
44+
run: |
45+
for example in packages/node-sdk/examples/cloudflare-worker packages/openfeature-node-provider/example; do
46+
(cd "$example" && yarn install --immutable && yarn build && yarn test:ci)
47+
done
4348
- name: Report test results
4449
uses: dorny/test-reporter@v1.6.0
4550
with:

‎.nvmrc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.13.0
1+
24.22.0

‎package.json‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"devDependencies": {
3333
"@changesets/cli": "^2.29.6",
3434
"husky": "^9.1.7",
35-
"lerna": "^8.1.3",
35+
"lerna": "^10.1.1",
3636
"lint-staged": "^16.2.7",
3737
"oxfmt": "^0.27.0",
3838
"oxlint": "^1.42.0",
@@ -45,8 +45,13 @@
4545
"typescript": "^5.7.3"
4646
},
4747
"resolutions": {
48+
"minimatch@npm:9.0.1": "npm:9.0.9",
49+
"postcss@npm:8.4.31": "npm:8.5.32",
50+
"postcss@npm:~8.4.32": "npm:8.5.32",
4851
"react": "19.1.0",
49-
"react-dom": "19.1.0"
52+
"react-dom": "19.1.0",
53+
"tinypool@npm:2.0.0": "npm:2.2.0",
54+
"undici@npm:7.29.0": "npm:7.30.2"
5055
},
5156
"lint-staged": {
5257
"*.{ts,tsx,js,jsx,mjs,cjs,mts,cts,vue}": [

‎packages/browser-sdk/package.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,24 @@
4646
"preact": "^10.22.1"
4747
},
4848
"devDependencies": {
49-
"@playwright/test": "^1.49.1",
49+
"@playwright/test": "^1.64.1",
5050
"@reflag/tsconfig": "0.0.2",
5151
"@types/js-cookie": "^3.0.6",
5252
"@types/node": "^22.12.0",
53-
"@vitest/coverage-v8": "4.1.11",
53+
"@vitest/coverage-v8": "4.1.12",
5454
"c8": "~10.1.3",
5555
"http-server": "^14.1.1",
5656
"jsdom": "^24.1.0",
57-
"msw": "^2.3.4",
57+
"msw": "^2.15.0",
5858
"nock": "^14.0.1",
5959
"postcss": "^8.4.33",
6060
"postcss-nesting": "^12.0.2",
6161
"postcss-preset-env": "^9.3.0",
6262
"typescript": "^5.7.3",
6363
"vite": "^6.4.2",
64-
"vite-plugin-dts": "^4.0.0-beta.1",
64+
"vite-plugin-dts": "^4.5.4",
6565
"vite-plugin-static-copy": "^2.3.2",
66-
"vitest": "^4.1.11"
66+
"vitest": "^4.1.12"
6767
},
6868
"packageManager": "yarn@4.1.1"
6969
}

‎packages/browser-sdk/test/e2e/feedback-widget.browser.spec.ts‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,13 @@ test("Opens a feedback widget in the bottom right by default", async ({
246246

247247
await expect(container).toBeAttached();
248248

249-
const bbox = await container.locator(".dialog").boundingBox();
250-
expect(bbox?.x).toEqual(WINDOW_WIDTH - bbox!.width - 16);
251-
expect(bbox?.y).toBeGreaterThan(WINDOW_HEIGHT - bbox!.height - 30); // Account for browser differences
252-
expect(bbox?.y).toBeLessThan(WINDOW_HEIGHT - bbox!.height);
249+
// Attachment happens before the entrance animation has reached its position.
250+
await expect(async () => {
251+
const bbox = await container.locator(".dialog").boundingBox();
252+
expect(bbox?.x).toEqual(WINDOW_WIDTH - bbox!.width - 16);
253+
expect(bbox?.y).toBeGreaterThan(WINDOW_HEIGHT - bbox!.height - 30); // Account for browser differences
254+
expect(bbox?.y).toBeLessThan(WINDOW_HEIGHT - bbox!.height);
255+
}).toPass({ timeout: 5000 });
253256
});
254257

255258
test("Opens a feedback widget in the correct position when overridden", async ({
@@ -268,10 +271,12 @@ test("Opens a feedback widget in the correct position when overridden", async ({
268271

269272
await expect(container).toBeAttached();
270273

271-
const bbox = await container.locator(".dialog").boundingBox();
272-
expect(bbox?.x).toEqual(16);
273-
expect(bbox?.y).toBeGreaterThan(0); // Account for browser differences
274-
expect(bbox?.y).toBeLessThanOrEqual(16);
274+
await expect(async () => {
275+
const bbox = await container.locator(".dialog").boundingBox();
276+
expect(bbox?.x).toEqual(16);
277+
expect(bbox?.y).toBeGreaterThan(0); // Account for browser differences
278+
expect(bbox?.y).toBeLessThanOrEqual(16);
279+
}).toPass({ timeout: 5000 });
275280
});
276281

277282
test("Opens a feedback widget with the correct translations", async ({

‎packages/cli/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646
"change-case": "^5.4.4",
4747
"commander": "^12.1.0",
4848
"comment-json": "^4.2.5",
49-
"express": "^4.21.2",
49+
"express": "^4.22.3",
5050
"fast-deep-equal": "^3.1.3",
5151
"find-up": "^7.0.0",
5252
"open": "^10.1.0",
5353
"ora": "^8.1.0",
5454
"semver": "^7.7.2",
5555
"slug": "^10.0.0",
56-
"zod": "^3.24.2"
56+
"zod": "^4.6.7"
5757
},
5858
"devDependencies": {
5959
"@reflag/tsconfig": "^0.0.2",
@@ -63,7 +63,7 @@
6363
"@types/slug": "^5.0.9",
6464
"shx": "^0.3.4",
6565
"typescript": "^5.5.4",
66-
"vitest": "^4.1.11"
66+
"vitest": "^4.1.12"
6767
},
6868
"engines": {
6969
"node": ">=18.0.0"

‎packages/cli/test/schemas.test.ts‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { describe, expect, it } from "vitest";
2+
3+
import { FlagCreateSchema, FlagsQuerySchema } from "../services/flags.js";
4+
import { booleanish, PaginationQueryBaseSchema } from "../utils/schemas.js";
5+
6+
describe("CLI schemas", () => {
7+
it.each([
8+
["true", true],
9+
["1", true],
10+
["false", false],
11+
["0", false],
12+
[true, true],
13+
[false, false],
14+
])("parses boolean-like input %s as %s", (input, expected) => {
15+
expect(booleanish.parse(input)).toBe(expected);
16+
});
17+
18+
it("preserves flag query defaults", () => {
19+
expect(FlagsQuerySchema.parse({ envId: "env_test" })).toEqual({
20+
envId: "env_test",
21+
sortBy: "key",
22+
sortOrder: "asc",
23+
includeRemoteConfigs: false,
24+
});
25+
});
26+
27+
it("rejects unknown query and flag fields", () => {
28+
expect(
29+
FlagsQuerySchema.safeParse({ envId: "env_test", unknown: true }).success,
30+
).toBe(false);
31+
expect(
32+
FlagCreateSchema.safeParse({ name: "Flag", key: "flag", unknown: true })
33+
.success,
34+
).toBe(false);
35+
});
36+
37+
it("coerces pagination input and enforces page-size bounds", () => {
38+
const schema = PaginationQueryBaseSchema();
39+
expect(schema.parse({ pageIndex: "2", pageSize: "10" })).toEqual({
40+
sortOrder: "asc",
41+
pageIndex: 2,
42+
pageSize: 10,
43+
});
44+
expect(schema.safeParse({ pageSize: 0 }).success).toBe(false);
45+
expect(schema.safeParse({ pageSize: 101 }).success).toBe(false);
46+
});
47+
});

‎packages/cli/utils/schemas.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ export const booleanish = z.preprocess((value) => {
99
return value === "true" || value === "1";
1010
}
1111
return Boolean(value);
12-
}, z.boolean().describe("Boolean value that can be parsed from strings like 'true' or '1'")) as z.ZodEffects<
13-
z.ZodBoolean,
12+
}, z.boolean().describe("Boolean value that can be parsed from strings like 'true' or '1'")) as z.ZodType<
1413
boolean,
1514
boolean
1615
>;

‎packages/flag-evaluation/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
"@types/node": "^22.12.0",
3737
"ts-node": "^10.9.2",
3838
"typescript": "^5.7.3",
39-
"vitest": "^4.1.11"
39+
"vitest": "^4.1.12"
4040
}
4141
}

0 commit comments

Comments
 (0)