Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/package-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ jobs:
- name: Restore package.json
# This step is necessary because the previous step may have updated package.json
run: git checkout -- package.json packages/*/package.json
- name: Audit dependencies
# Report findings without blocking builds until the tooling that needs tar 7 supports tar 8.
continue-on-error: true
run: |
audit_status=0
for scope in . packages/node-sdk/examples/cloudflare-worker packages/openfeature-node-provider/example; do
echo "Auditing $scope"
if ! (cd "$scope" && yarn npm audit --all --recursive --no-deprecations); then
echo "::warning::Dependency audit did not pass for $scope; see the audit output."
audit_status=1
fi
done
exit "$audit_status"
- name: Check dependency tooling
run: yarn test:tooling
- name: Check release channel safeguards
run: yarn test:release
- name: Install Playwright Browsers
Expand All @@ -51,6 +66,15 @@ jobs:
for example in packages/node-sdk/examples/cloudflare-worker packages/openfeature-node-provider/example; do
(cd "$example" && yarn install --immutable && yarn build && yarn test:ci)
done
- name: Check native development tooling
run: |
yarn workspace reflag-react-native-sdk-bare-rn react-native config > "$RUNNER_TEMP/native-config.json"
yarn tsc --project packages/react-native-sdk/dev/bare-rn/tsconfig.json --noEmit
yarn tsc --project packages/react-native-sdk/dev/expo/tsconfig.json --noEmit
for platform in ios android; do
yarn workspace reflag-react-native-sdk-bare-rn react-native bundle --platform "$platform" --dev false --entry-file index.js --bundle-output "$RUNNER_TEMP/bare-$platform.bundle" --assets-dest "$RUNNER_TEMP/bare-$platform-assets" --max-workers 2
yarn workspace reflag-react-sdk-expo expo export --platform "$platform" --output-dir "$RUNNER_TEMP/expo-$platform" --max-workers 2
done
- name: Report test results
uses: dorny/test-reporter@v1.6.0
# Reporting only. Failing tests already fail the "Test the project"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ playwright/.cache/

.pnp.*
.yarn/*
**/.yarn/install-state.gz
!.yarn/patches
!.yarn/plugins
!.yarn/releases
Expand Down
23 changes: 23 additions & 0 deletions .yarn/patches/typedoc-npm-0.27.6-baed42df20.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/dist/lib/utils/fs.js b/dist/lib/utils/fs.js
index 2953bf089262c040638d29307c4b4ea7e9925ca9..c6f20f3c13c6ba240d2e6a0aaedc53788c8657b3 100644
--- a/dist/lib/utils/fs.js
+++ b/dist/lib/utils/fs.js
@@ -230,6 +230,8 @@ export function discoverFiles(rootDir, controller) {
*/
export function glob(pattern, root, options = {}) {
const mini = new Minimatch(normalizePath(pattern));
+ // Directory traversal must test the positive pattern, even for negated globs.
+ const partialMini = new Minimatch(normalizePath(pattern), { flipNegate: true });
const shouldIncludeNodeModules = pattern.includes("node_modules");
const controller = {
matches(path) {
@@ -244,7 +246,8 @@ export function glob(pattern, root, options = {}) {
!shouldIncludeNodeModules) {
return false;
}
- return mini.set.some((row) => mini.matchOne(childPath, row, /* partial */ true));
+ // minimatch 11 removes matchOne; match supports partial directory matches.
+ return partialMini.match(childPath.join("/"), /* partial */ true);
},
matchDirectories: options.includeDirectories,
followSymlinks: options.followSymlinks,
39 changes: 34 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"dev": "lerna run dev --parallel",
"build": "lerna run build --stream",
"test:ci": "lerna run test:ci --stream",
"test:tooling": "node --test scripts/dependency-tooling.test.cjs",
"test:release": "node --test scripts/release-channel.test.mjs scripts/publish-manifests.test.mjs",
"check:publish-manifests": "node scripts/publish-manifests.mjs",
"test": "lerna run test --stream",
Expand All @@ -42,7 +43,7 @@
"oxlint": "^1.42.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"typedoc": "0.27.6",
"typedoc": "patch:typedoc@npm%3A0.27.6#~/.yarn/patches/typedoc-npm-0.27.6-baed42df20.patch",
"typedoc-plugin-frontmatter": "^1.1.2",
"typedoc-plugin-markdown": "^4.4.2",
"typedoc-plugin-mdn-links": "^4.0.7",
Expand All @@ -52,17 +53,45 @@
"@changesets/assemble-release-plan@npm:^6.0.9": "patch:@changesets/assemble-release-plan@npm%3A6.0.9#~/.yarn/patches/@changesets-assemble-release-plan-npm-6.0.9-e01af97ef4.patch",
"get-uri@npm:8.0.1": "npm:8.0.2",
"glob@npm:13.0.6": "npm:14.0.6",
"glob@npm:^10.3.10": "npm:14.0.6",
"glob@npm:^10.4.1": "npm:14.0.6",
"glob@npm:^10.4.2": "npm:14.0.6",
"glob@npm:^13.0.0": "npm:14.0.6",
"glob@npm:^13.0.6": "npm:14.0.6",
"minimatch@npm:10.2.3": "npm:11.0.9",
"minimatch@npm:10.2.5": "npm:10.2.6",
"minimatch@npm:9.0.1": "npm:9.0.9",
"metro-babel-transformer@npm:0.83.3": "npm:0.83.8",
"metro-cache-key@npm:0.83.3": "npm:0.83.8",
"metro-cache@npm:0.83.3": "npm:0.83.8",
"metro-config@npm:0.83.3": "npm:0.83.8",
"metro-core@npm:0.83.3": "npm:0.83.8",
"metro-file-map@npm:0.83.3": "npm:0.83.8",
"metro-minify-terser@npm:0.83.3": "npm:0.83.8",
"metro-resolver@npm:0.83.3": "npm:0.83.8",
"metro-runtime@npm:0.83.3": "npm:0.83.8",
"metro-source-map@npm:0.83.3": "npm:0.83.8",
"metro-symbolicate@npm:0.83.3": "npm:0.83.8",
"metro-transform-plugins@npm:0.83.3": "npm:0.83.8",
"metro-transform-worker@npm:0.83.3": "npm:0.83.8",
"metro@npm:0.83.3": "npm:0.83.8",
"minimatch@npm:10.2.3": "npm:11.0.10",
"minimatch@npm:10.2.5": "npm:11.0.10",
"minimatch@npm:10.2.6": "npm:11.0.10",
"minimatch@npm:9.0.1": "npm:11.0.10",
"minimatch@npm:^10.0.3": "npm:11.0.10",
"minimatch@npm:^10.2.2": "npm:11.0.10",
"minimatch@npm:^10.2.6": "npm:11.0.10",
"minimatch@npm:^9.0.0": "npm:11.0.10",
"minimatch@npm:^9.0.3": "npm:11.0.10",
"minimatch@npm:^9.0.4": "npm:11.0.10",
"minimatch@npm:^9.0.5": "npm:11.0.10",
"minimatch@npm:~10.2.4": "npm:11.0.10",
"postcss@npm:8.4.31": "npm:8.5.32",
"postcss@npm:~8.4.32": "npm:8.5.32",
"react": "19.1.0",
"react-dom": "19.1.0",
"tar@npm:7.5.22": "npm:7.5.24",
"tinypool@npm:2.0.0": "npm:2.2.0",
"undici@npm:7.29.0": "npm:7.30.2"
"undici@npm:7.29.0": "npm:7.30.2",
"ws@npm:8.21.0": "npm:8.23.1"
},
"lint-staged": {
"*.{ts,tsx,js,jsx,mjs,cjs,mts,cts,vue}": [
Expand Down
3 changes: 2 additions & 1 deletion packages/node-sdk/examples/cloudflare-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"wrangler": "^4.158.0"
},
"resolutions": {
"glob@npm:^10.2.2": "npm:14.0.6"
"glob@npm:^10.2.2": "npm:14.0.6",
"ws@npm:8.21.0": "npm:8.23.1"
},
"packageManager": "yarn@4.10.3"
}
24 changes: 12 additions & 12 deletions packages/node-sdk/examples/cloudflare-worker/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1450,12 +1450,12 @@ __metadata:
linkType: hard

"minimatch@npm:^11.0.5":
version: 11.0.9
resolution: "minimatch@npm:11.0.9"
version: 11.0.10
resolution: "minimatch@npm:11.0.10"
dependencies:
"@isaacs/nonrecursive-glob-match": "npm:^1.1.0"
brace-expansion: "npm:^5.0.12"
checksum: 10c0/17c8b5caebaa8c1ecc1c6d58028d192f0e94ebe03976bb9f348920c107cde3185614f74543fe40dfc79ecf0bd74158b816633fc9a8f66da32c0d5327ecbb91e9
checksum: 10c0/076259fbe3668047a9ca9ac46aac1eccf3cf2e2ffa6df3ff1fab0f0d628cd197b5d30576639b7e3c7e99a1966a5a5eb6eb5260108f76877c1a73339eabf7c70c
languageName: node
linkType: hard

Expand Down Expand Up @@ -1519,14 +1519,14 @@ __metadata:
languageName: node
linkType: hard

"minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.0.4, minipass@npm:^7.1.2":
"minipass@npm:^7.0.2, minipass@npm:^7.0.3, minipass@npm:^7.1.2":
version: 7.1.2
resolution: "minipass@npm:7.1.2"
checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557
languageName: node
linkType: hard

"minipass@npm:^7.1.3":
"minipass@npm:^7.0.4, minipass@npm:^7.1.3":
version: 7.1.3
resolution: "minipass@npm:7.1.3"
checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb
Expand Down Expand Up @@ -1945,15 +1945,15 @@ __metadata:
linkType: hard

"tar@npm:^7.4.3":
version: 7.5.22
resolution: "tar@npm:7.5.22"
version: 7.5.24
resolution: "tar@npm:7.5.24"
dependencies:
"@isaacs/fs-minipass": "npm:^4.0.0"
chownr: "npm:^3.0.0"
minipass: "npm:^7.1.2"
minizlib: "npm:^3.1.0"
yallist: "npm:^5.0.0"
checksum: 10c0/1311f6be85a8157ac4c9147bae43e13923d2a1aae15e4aa1bd5239e4e03d2cf53cfe103dde7f35832fbb4c938b042856bc8e9a0afd29abd05e2d1608788c4fea
checksum: 10c0/6e9b955e6af05fdabf0400cd166f45795c7595657906a9afb1a86fe94a491936e1a7c1d068ec9ab8145db0fea66f0294db0a23f2e0183124d110df450f154275
languageName: node
linkType: hard

Expand Down Expand Up @@ -2273,9 +2273,9 @@ __metadata:
languageName: node
linkType: hard

"ws@npm:8.21.0":
version: 8.21.0
resolution: "ws@npm:8.21.0"
"ws@npm:8.23.1":
version: 8.23.1
resolution: "ws@npm:8.23.1"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ">=5.0.2"
Expand All @@ -2284,7 +2284,7 @@ __metadata:
optional: true
utf-8-validate:
optional: true
checksum: 10c0/ef4a243476283fc49bc7550966c4af4aa0eef56273837211e700de3b664e08604a760cdddcb5ba43c049140e74ccfec5b0ee0bb439e08c2adf9138902fdde5f9
checksum: 10c0/32af99bf5f81d55a76446de997d4335e4a2597f2d70ed6e1955fad2df397f48ed076ccc26595980890b71da68e72bfa87f7a99f7a8d2e8f65f2a998ea32b8c68
languageName: node
linkType: hard

Expand Down
15 changes: 4 additions & 11 deletions packages/openfeature-node-provider/example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1496,20 +1496,13 @@ __metadata:
languageName: node
linkType: hard

"minipass@npm:^7.0.4":
"minipass@npm:^7.0.4, minipass@npm:^7.1.2":
version: 7.1.3
resolution: "minipass@npm:7.1.3"
checksum: 10c0/539da88daca16533211ea5a9ee98dc62ff5742f531f54640dd34429e621955e91cc280a91a776026264b7f9f6735947629f920944e9c1558369e8bf22eb33fbb
languageName: node
linkType: hard

"minipass@npm:^7.1.2":
version: 7.1.2
resolution: "minipass@npm:7.1.2"
checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557
languageName: node
linkType: hard

"minizlib@npm:^3.1.0":
version: 3.1.0
resolution: "minizlib@npm:3.1.0"
Expand Down Expand Up @@ -1947,15 +1940,15 @@ __metadata:
linkType: hard

"tar@npm:^7.5.7":
version: 7.5.22
resolution: "tar@npm:7.5.22"
version: 7.5.24
resolution: "tar@npm:7.5.24"
dependencies:
"@isaacs/fs-minipass": "npm:^4.0.0"
chownr: "npm:^3.0.0"
minipass: "npm:^7.1.2"
minizlib: "npm:^3.1.0"
yallist: "npm:^5.0.0"
checksum: 10c0/1311f6be85a8157ac4c9147bae43e13923d2a1aae15e4aa1bd5239e4e03d2cf53cfe103dde7f35832fbb4c938b042856bc8e9a0afd29abd05e2d1608788c4fea
checksum: 10c0/6e9b955e6af05fdabf0400cd166f45795c7595657906a9afb1a86fe94a491936e1a7c1d068ec9ab8145db0fea66f0294db0a23f2e0183124d110df450f154275
languageName: node
linkType: hard

Expand Down
6 changes: 3 additions & 3 deletions packages/react-native-sdk/dev/bare-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "20.0.0",
"@react-native-community/cli-platform-android": "20.0.0",
"@react-native-community/cli-platform-ios": "20.0.0",
"@react-native-community/cli": "20.2.0",
"@react-native-community/cli-platform-android": "20.2.0",
"@react-native-community/cli-platform-ios": "20.2.0",
"@react-native/babel-preset": "0.81.5",
"@react-native/codegen": "0.81.5",
"@react-native/metro-config": "0.81.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-sdk/dev/bare-rn/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "@react-native/typescript-config",
"compilerOptions": { "types": ["react-native"] },
"compilerOptions": { "types": ["react"] },
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["**/node_modules", "**/Pods"]
}
2 changes: 1 addition & 1 deletion packages/react-native-sdk/dev/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@react-native-async-storage/async-storage": "^2.2.0",
"@reflag/react-native-sdk": "workspace:*",
"expo": "~54.0.0",
"expo": "~54.0.38",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-safe-area-context": "^5.6.0"
Expand Down
65 changes: 65 additions & 0 deletions scripts/dependency-tooling.test.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
const assert = require("node:assert/strict");
const fs = require("node:fs/promises");
const { createRequire } = require("node:module");
const os = require("node:os");
const path = require("node:path");
const { pipeline } = require("node:stream/promises");
const { test } = require("node:test");
const { pathToFileURL } = require("node:url");

async function temporaryDirectory(t) {
const directory = await fs.mkdtemp(
path.join(os.tmpdir(), "dependency-tooling-"),
);
t.after(() => fs.rm(directory, { recursive: true, force: true }));
return directory;
}

test("TypeDoc finds nested files with positive and negated globs", async (t) => {
const directory = await temporaryDirectory(t);
const included = ["root.ts", "src/nested/entry.ts"];
for (const file of [
...included,
"node_modules/ignored.ts",
"src/node_modules/ignored.ts",
]) {
const absolute = path.join(directory, file);
await fs.mkdir(path.dirname(absolute), { recursive: true });
await fs.writeFile(absolute, "");
}
const utility = path.join(
path.dirname(require.resolve("typedoc")),
"lib/utils/fs.js",
);
const { glob } = await import(pathToFileURL(utility).href);
assert.deepEqual(
glob("**/*.ts", directory).sort(),
included.map((file) => path.join(directory, file)).sort(),
);
assert.deepEqual(
glob("!**/node_modules/**", directory).sort(),
included.map((file) => path.join(directory, file)).sort(),
);
});

test("tar retains the streaming APIs used by Lerna and node-gyp", async (t) => {
const source = await temporaryDirectory(t);
const target = await temporaryDirectory(t);
const { create } = createRequire(require.resolve("lerna"))("tar");
const { extract } = createRequire(require.resolve("node-gyp"))("tar");

await fs.writeFile(path.join(source, "fixture.h"), "#define FIXTURE 1\n");
await fs.writeFile(path.join(source, "README.md"), "Compatibility fixture\n");
await pipeline(
create({ cwd: source, prefix: "package/", portable: true, gzip: true }, [
"fixture.h",
"README.md",
]),
extract({ cwd: target, strip: 1, filter: (file) => file.endsWith(".h") }),
);
assert.deepEqual(await fs.readdir(target), ["fixture.h"]);
assert.equal(
await fs.readFile(path.join(target, "fixture.h"), "utf8"),
"#define FIXTURE 1\n",
);
});
Loading
Loading