x-fidelity 3.16.0 → 3.17.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [3.17.0](https://github.com/zotoio/x-fidelity/compare/v3.16.0...v3.17.0) (2025-03-20)
2
+
3
+
4
+ ### Features
5
+
6
+ * **canary:** example with proxy support for canary installs in ci ([6b5aff3](https://github.com/zotoio/x-fidelity/commit/6b5aff317d0d4fedfccd6cf79304722e8e7a7556))
7
+
1
8
  # [3.16.0](https://github.com/zotoio/x-fidelity/compare/v3.15.0...v3.16.0) (2025-03-19)
2
9
 
3
10
 
@@ -3,10 +3,8 @@
3
3
  # This script uses the LaunchDarkly Node SDK to evaluate a feature flag
4
4
  # and conditionally run a command based on the flag’s value.
5
5
  #
6
- # Requirements:
7
- # - Node.js installed.
8
- # - LaunchDarkly Node SDK installed:
9
- # yarn global add launchdarkly-node-client-sdk
6
+ # global-agent is used to make the launchdarkly connection via proxy set in environment
7
+ # to run a local test proxy: DEBUG=* npx proxy --port 3128
10
8
  #
11
9
  # Set your LaunchDarkly clientid and feature flag key here.
12
10
  # note that the clientid is not a secret, as it is public in the client-side SDKs
@@ -23,7 +21,9 @@ echo "XFI_LD_CLIENT_ID: $XFI_LD_CLIENT_ID"
23
21
  echo "XFI_VERSION_FLAG_KEY: $XFI_VERSION_FLAG_KEY"
24
22
 
25
23
  # Run a Node.js script to evaluate the flag.
26
- FLAG_VALUE=$(node ./flagCheck.js $XFI_CONTEXT_KEY)
24
+ export GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE=
25
+ FLAG_VALUE=$(yarn add -s global-agent launchdarkly-node-client-sdk --ignore-engines \
26
+ && node ./flagCheck.js $XFI_CONTEXT_KEY)
27
27
  echo "FLAG_VALUE: $FLAG_VALUE"
28
28
 
29
29
  # Check if the Node.js command succeeded.
@@ -34,11 +34,11 @@ fi
34
34
 
35
35
  # Decide which command to run based on the flag value.
36
36
  if [ "$FLAG_VALUE" == "true" ]; then
37
- echo "Installing the NEW version of xfi"
38
- # add your canary CI install command here
39
- # eg. yarn global add x-fidelity@3.9.1 --ignore-engines
37
+ export XFI_VERSION=$(cat ./xfi-version-new.txt)
38
+ echo "Installing the NEW version of xfi $XFI_VERSION"
39
+ yarn global add x-fidelity@$XFI_VERSION --ignore-engines
40
40
  else
41
- echo "Installing the current version of xfi"
42
- # add your current CI install command here
43
- # eg. yarn global add x-fidelity@2.17.2 --ignore-engines
41
+ export XFI_VERSION=$(cat ./xfi-version-current.txt)
42
+ echo "Installing the current version of xfi $XFI_VERSION"
43
+ yarn global add x-fidelity@$XFI_VERSION --ignore-engines
44
44
  fi
@@ -1,3 +1,5 @@
1
+
2
+ const bootstrap = require('global-agent/bootstrap');
1
3
  const ldclient = require('launchdarkly-node-client-sdk');
2
4
 
3
5
  (async function main(contextKey) {
@@ -0,0 +1 @@
1
+ 2.17.2
@@ -0,0 +1 @@
1
+ 3.16.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-fidelity",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "cli for opinionated framework adherence checks",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -88,6 +88,7 @@
88
88
  "esprima": "^4.0.1",
89
89
  "express": "^4.21.2",
90
90
  "express-rate-limit": "^7.5.0",
91
+ "global-agent": "^3.0.0",
91
92
  "helmet": "^8.0.0",
92
93
  "json-rules-engine": "^7.3.1",
93
94
  "jsonpath-plus": "^10.3.0",