From cde46e994d19bdf6009ddd124d633edfd2e12fcb Mon Sep 17 00:00:00 2001 From: Tamara Barum <88795935+Tamara-Barum@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:12:58 -0500 Subject: [PATCH 01/39] Remove SourceClear scan workflow due to security vulnerability (#1139) Removes the SourceClear workflow that contains a dangerous curl|bash pattern, which presents risks of script injection and untrusted remote code execution in the CI/CD pipeline. This follows the same remediation approach used in the PHP SDK (optimizely/php-sdk#294). Co-authored-by: Claude Sonnet 4.5 --- .github/workflows/source_clear_crone.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/source_clear_crone.yml diff --git a/.github/workflows/source_clear_crone.yml b/.github/workflows/source_clear_crone.yml deleted file mode 100644 index 328feb6ab..000000000 --- a/.github/workflows/source_clear_crone.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Source clear - -on: - push: - branches: [ master ] - schedule: - # Runs "weekly" - - cron: '0 0 * * 0' - -jobs: - source_clear: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Source clear scan - env: - SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }} - run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan \ No newline at end of file From 41d25803d5c46638f2e1b88be5e140b6e627c4e5 Mon Sep 17 00:00:00 2001 From: Farhan Anjum Date: Tue, 31 Mar 2026 10:07:20 +0600 Subject: [PATCH 02/39] [AI-FSSDK] [FSSDK-12337] Add Feature Rollout support (#1140) ## Summary Adds Feature Rollout support to the JavaScript SDK. Feature Rollouts are a new experiment rule type that combines Targeted Delivery simplicity with A/B test measurement capabilities. During project config parsing, the "everyone else" variation from the flag's rollout is injected into any experiment with type "feature_rollout", enabling correct evaluation without changes to decision logic. ## Changes - Added optional `type` string field to the Experiment interface - Added config parsing logic to inject the "everyone else" rollout variation into feature_rollout experiments - Added traffic allocation entry (endOfRange=10000) for the injected variation - Added `getEveryoneElseVariation` helper function to extract the last rollout rule's first variation - Updated variation lookup maps (variationKeyMap, variationIdMap, variationVariableUsageMap) with injected variation - Added 6 unit tests covering feature rollout injection, edge cases, and backward compatibility --------- Co-authored-by: Raju Ahmed --- lib/project_config/project_config.spec.ts | 160 ++++++++++++++++++++++ lib/project_config/project_config.ts | 46 ++++++- lib/shared_types.ts | 1 + lib/utils/enums/index.ts | 8 ++ 4 files changed, 214 insertions(+), 1 deletion(-) diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index ad288c515..5cc1b6cba 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -1324,3 +1324,163 @@ describe('tryCreatingProjectConfig', () => { expect(logger.error).not.toHaveBeenCalled(); }); }); + +describe('Feature Rollout support', () => { + const makeDatafile = (overrides: Record = {}) => { + const base: Record = { + version: '4', + revision: '1', + projectId: 'rollout_test', + accountId: '12345', + sdkKey: 'test-key', + environmentKey: 'production', + events: [], + audiences: [], + typedAudiences: [], + attributes: [], + groups: [], + integrations: [], + holdouts: [], + experiments: [ + { + id: 'exp_ab', + key: 'ab_experiment', + layerId: 'layer_ab', + status: 'Running', + variations: [{ id: 'var_ab_1', key: 'variation_ab_1', variables: [] }], + trafficAllocation: [{ entityId: 'var_ab_1', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + { + id: 'exp_rollout', + key: 'rollout_experiment', + layerId: 'layer_rollout', + status: 'Running', + type: 'fr', + variations: [{ id: 'var_rollout_1', key: 'variation_rollout_1', variables: [] }], + trafficAllocation: [{ entityId: 'var_rollout_1', endOfRange: 5000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + ], + rollouts: [ + { + id: 'rollout_1', + experiments: [ + { + id: 'rollout_rule_1', + key: 'rollout_rule_1_key', + layerId: 'rollout_layer_1', + status: 'Running', + variations: [{ id: 'var_rr1', key: 'variation_rr1', variables: [] }], + trafficAllocation: [{ entityId: 'var_rr1', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + { + id: 'rollout_everyone_else', + key: 'rollout_everyone_else_key', + layerId: 'rollout_layer_ee', + status: 'Running', + variations: [{ id: 'var_ee', key: 'variation_everyone_else', variables: [] }], + trafficAllocation: [{ entityId: 'var_ee', endOfRange: 10000 }], + audienceIds: [], + audienceConditions: [], + forcedVariations: {}, + }, + ], + }, + ], + featureFlags: [ + { + id: 'feature_1', + key: 'feature_rollout_flag', + rolloutId: 'rollout_1', + experimentIds: ['exp_ab', 'exp_rollout'], + variables: [], + }, + ], + ...overrides, + }; + return base; + }; + + it('should preserve type=undefined for experiments without type field (backward compatibility)', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(datafile as any); + const abExperiment = config.experimentIdMap['exp_ab']; + expect(abExperiment.type).toBeUndefined(); + }); + + it('should inject everyone else variation into fr (feature rollout) experiments', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(datafile as any); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // Should have 2 variations: original + injected everyone else + expect(rolloutExperiment.variations).toHaveLength(2); + expect(rolloutExperiment.variations[1].id).toBe('var_ee'); + expect(rolloutExperiment.variations[1].key).toBe('variation_everyone_else'); + + // Should have injected traffic allocation entry + const lastAllocation = rolloutExperiment.trafficAllocation[rolloutExperiment.trafficAllocation.length - 1]; + expect(lastAllocation.entityId).toBe('var_ee'); + expect(lastAllocation.endOfRange).toBe(10000); + }); + + it('should update variation lookup maps with injected variation', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(datafile as any); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // variationKeyMap on the experiment should contain the injected variation + expect(rolloutExperiment.variationKeyMap['variation_everyone_else']).toBeDefined(); + expect(rolloutExperiment.variationKeyMap['variation_everyone_else'].id).toBe('var_ee'); + + // Global variationIdMap should contain the injected variation + expect(config.variationIdMap['var_ee']).toBeDefined(); + expect(config.variationIdMap['var_ee'].key).toBe('variation_everyone_else'); + }); + + it('should not modify non-rollout experiments (A/B, MAB, CMAB)', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(datafile as any); + const abExperiment = config.experimentIdMap['exp_ab']; + + // A/B experiment should still have only 1 variation + expect(abExperiment.variations).toHaveLength(1); + expect(abExperiment.variations[0].id).toBe('var_ab_1'); + expect(abExperiment.trafficAllocation).toHaveLength(1); + }); + + it('should silently skip injection when feature has no rolloutId', () => { + const datafile = makeDatafile({ + featureFlags: [ + { + id: 'feature_no_rollout', + key: 'feature_no_rollout', + rolloutId: '', + experimentIds: ['exp_rollout'], + variables: [], + }, + ], + }); + const config = projectConfig.createProjectConfig(datafile as any); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + + // Should still have only 1 variation (no injection) + expect(rolloutExperiment.variations).toHaveLength(1); + expect(rolloutExperiment.variations[0].id).toBe('var_rollout_1'); + }); + + it('should correctly preserve experiment type field from datafile', () => { + const datafile = makeDatafile(); + const config = projectConfig.createProjectConfig(datafile as any); + const rolloutExperiment = config.experimentIdMap['exp_rollout']; + expect(rolloutExperiment.type).toBe('fr'); + }); +}); diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index 2627abe09..a3a72caf0 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -15,7 +15,7 @@ */ import { find, objectEntries, objectValues, keyBy, assignBy } from '../utils/fns'; -import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; +import { EXPERIMENT_TYPES, FEATURE_VARIABLE_TYPES } from '../utils/enums'; import configValidator from '../utils/config_validator'; import { LoggerFacade } from '../logging/logger'; @@ -301,6 +301,28 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str }); }); + // Inject "everyone else" variation into feature rollout (FR) experiments + (projectConfig.featureFlags || []).forEach(featureFlag => { + const everyoneElseVariation = getEveryoneElseVariation(projectConfig, featureFlag); + if (!everyoneElseVariation) { + return; + } + + (featureFlag.experimentIds || []).forEach(experimentId => { + const experiment = projectConfig.experimentIdMap[experimentId]; + if (experiment && experiment.type === EXPERIMENT_TYPES.FR) { + experiment.variations.push(everyoneElseVariation); + experiment.trafficAllocation.push({ + entityId: everyoneElseVariation.id, + endOfRange: 10000, + }); + + // Update variation lookup map + experiment.variationKeyMap[everyoneElseVariation.key] = everyoneElseVariation; + } + }); + }); + // all rules (experiment rules and delivery rules) for each flag projectConfig.flagRulesMap = {}; @@ -343,6 +365,28 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str return projectConfig; }; +/** + * Get the "everyone else" variation from the last rule in the flag's rollout. + * Returns null if the rollout cannot be resolved or has no variations. + */ +const getEveryoneElseVariation = function( + projectConfig: ProjectConfig, + featureFlag: FeatureFlag, +): Variation | null { + if (!featureFlag.rolloutId) { + return null; + } + const rollout = projectConfig.rolloutIdMap[featureFlag.rolloutId]; + if (!rollout || !rollout.experiments || rollout.experiments.length === 0) { + return null; + } + const everyoneElseRule = rollout.experiments[rollout.experiments.length - 1]; + if (!everyoneElseRule.variations || everyoneElseRule.variations.length === 0) { + return null; + } + return everyoneElseRule.variations[0]; +}; + const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { projectConfig.holdouts = projectConfig.holdouts || []; projectConfig.holdoutIdMap = keyBy(projectConfig.holdouts, 'id'); diff --git a/lib/shared_types.ts b/lib/shared_types.ts index c46b38da6..4d39a317d 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -163,6 +163,7 @@ export interface Experiment extends ExperimentCore { status: string; forcedVariations?: { [key: string]: string }; isRollout?: boolean; + type?: string; cmab?: { trafficAllocation: number; attributeIds: string[]; diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index abc8e0b1d..1760eb603 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -61,6 +61,14 @@ export const DECISION_SOURCES = { export type DecisionSource = typeof DECISION_SOURCES[keyof typeof DECISION_SOURCES]; +export const EXPERIMENT_TYPES = { + AB: 'ab', + MAB: 'mab', + CMAB: 'cmab', + TD: 'td', + FR: 'fr', +} as const; + export const AUDIENCE_EVALUATION_TYPES = { RULE: 'rule', EXPERIMENT: 'experiment', From 80a0375d15a67b9b2112f6976ba4fd2a4d1eaf6f Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Thu, 7 May 2026 05:19:22 -0700 Subject: [PATCH 03/39] [AI-FSSDK] prepare for release javascript-sdk v6.4.0 (#1149) Co-authored-by: Raju Ahmed --- CHANGELOG.md | 16 ++++++++++++++++ lib/export_types.ts | 1 + lib/index.browser.tests.js | 2 +- lib/index.node.tests.js | 2 +- lib/index.react_native.spec.ts | 2 +- lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- srcclr.yml | 1 - 9 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 srcclr.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 45a87fd2e..d3032a8f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.4.0] - May 7, 2026 + +### New Features + +**Feature Rollout**: Added support for Feature Rollouts, a new experiment type +combining Targeted Delivery simplicity with A/B test measurement capabilities. +Feature Rollouts enable progressive rollouts with full impact analytics, metric tracking, +and confidence intervals. +See [Feature Rollout docs](https://support.optimizely.com/hc/en-us/articles/45552846481037-Run-Feature-Rollouts-in-Feature-Experimentation) for more information. + +- Add Feature Rollout support ([#1140](https://github.com/optimizely/javascript-sdk/pull/1140)) + +### Bug Fixes +- Export `UserProfileServiceAsync` type + + ## [6.3.1] - January 26, 2026 ### Changed diff --git a/lib/export_types.ts b/lib/export_types.ts index 51109d933..652ed7ae2 100644 --- a/lib/export_types.ts +++ b/lib/export_types.ts @@ -95,6 +95,7 @@ export type { Event, DatafileOptions, UserProfileService, + UserProfileServiceAsync, UserProfile, ListenerPayload, OptimizelyDecision, diff --git a/lib/index.browser.tests.js b/lib/index.browser.tests.js index 46e29748a..0a6feb28b 100644 --- a/lib/index.browser.tests.js +++ b/lib/index.browser.tests.js @@ -153,7 +153,7 @@ describe('javascript-sdk (Browser)', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.3.1'); + assert.equal(optlyInstance.clientVersion, '6.4.0'); }); it('should set the JavaScript client engine and version', function() { diff --git a/lib/index.node.tests.js b/lib/index.node.tests.js index 2ce076d6c..1b4b6f185 100644 --- a/lib/index.node.tests.js +++ b/lib/index.node.tests.js @@ -88,7 +88,7 @@ describe('optimizelyFactory', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.3.1'); + assert.equal(optlyInstance.clientVersion, '6.4.0'); }); // TODO: user will create and inject an event processor // these tests will be refactored accordingly diff --git a/lib/index.react_native.spec.ts b/lib/index.react_native.spec.ts index ba7f7ab5d..20493ab11 100644 --- a/lib/index.react_native.spec.ts +++ b/lib/index.react_native.spec.ts @@ -92,7 +92,7 @@ describe('javascript-sdk/react-native', () => { expect(optlyInstance).toBeInstanceOf(Optimizely); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - expect(optlyInstance.clientVersion).toEqual('6.3.1'); + expect(optlyInstance.clientVersion).toEqual('6.4.0'); }); it('should set the React Native JS client engine and javascript SDK version', () => { diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 1760eb603..560640c5c 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.3.1'; +export const CLIENT_VERSION = '6.4.0'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index 7edefb829..57da2656f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.4.0", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index 545b9eed5..8c548407a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.3.1", + "version": "6.4.0", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", diff --git a/srcclr.yml b/srcclr.yml deleted file mode 100644 index 5941418eb..000000000 --- a/srcclr.yml +++ /dev/null @@ -1 +0,0 @@ -scope: production From 6c0a6e9b934d8647bbe770d571d256b1ba5c91eb Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Thu, 7 May 2026 07:10:59 -0700 Subject: [PATCH 04/39] [AI-FSSDK] [FSSDK-12368] Remove legacy flag-level holdout fields (#1146) ## Summary simplify holdout handling to treat all holdouts as global. ## Changes - Removed `includedHoldouts`, `excludedHoldouts`, and `globalHoldouts` from ProjectConfig - Removed `getHoldoutsForFlag()` method from ProjectConfig - Removed 3 test cases for deleted functionality - Updated remaining tests to use new global holdout behavior Co-authored-by: Claude Sonnet 4.5 Co-authored-by: Raju Ahmed --- lib/core/decision_service/index.spec.ts | 90 +---------------------- lib/core/decision_service/index.ts | 6 +- lib/project_config/project_config.spec.ts | 54 +------------- lib/project_config/project_config.ts | 65 ++-------------- lib/shared_types.ts | 8 +- 5 files changed, 17 insertions(+), 206 deletions(-) diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index af76674b6..866bb8166 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -1960,55 +1960,7 @@ describe('DecisionService', () => { }); }); - it("should consider global holdout even if local holdout is present", async () => { - const { decisionService } = getDecisionService(); - const datafile = getHoldoutTestDatafile(); - const newEntry = { - id: 'holdout_included_id', - key: 'holdout_included', - status: 'Running', - includedFlags: ['1001'], - excludedFlags: [], - audienceIds: ['4002'], // age_40 audience - audienceConditions: ['or', '4002'], - variations: [ - { - id: 'holdout_variation_included_id', - key: 'holdout_variation_included', - variables: [], - }, - ], - trafficAllocation: [ - { - entityId: 'holdout_variation_included_id', - endOfRange: 5000, - }, - ], - }; - datafile.holdouts = [newEntry, ...datafile.holdouts]; - const config = createProjectConfig(datafile); - const user = new OptimizelyUserContext({ - optimizely: {} as any, - userId: 'tester', - attributes: { - age: 20, // satisfies both global holdout (age_22) and included holdout (age_40) audiences - }, - }); - const feature = config.featureKeyMap['flag_1']; - const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - - expect(value).toBeInstanceOf(Promise); - - const variation = (await value)[0]; - - expect(variation.result).toEqual({ - experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], - variation: config.variationIdMap['holdout_variation_running_id'], - decisionSource: DECISION_SOURCES.HOLDOUT, - }); - }); - - it("should consider local holdout if misses global holdout", async () => { + it("should consider next global holdout if misses previous holdouts", async () => { const { decisionService } = getDecisionService(); const datafile = getHoldoutTestDatafile(); @@ -2016,7 +1968,7 @@ describe('DecisionService', () => { id: 'holdout_included_specific_id', key: 'holdout_included_specific', status: 'Running', - includedFlags: ['1001'], + includedFlags: [], excludedFlags: [], audienceIds: ['4002'], // age_60 audience (age <= 60) audienceConditions: ['or', '4002'], @@ -2039,7 +1991,7 @@ describe('DecisionService', () => { optimizely: {} as any, userId: 'test_holdout_user', attributes: { - age: 50, // Does not satisfy global holdout (age_22, age <= 22) but satisfies included holdout (age_60, age <= 60) + age: 50, // Does not satisfy first global holdout (age_22, age <= 22) but satisfies newly added holdout (age_60, age <= 60) }, }); const feature = config.featureKeyMap['flag_1']; @@ -2195,42 +2147,6 @@ describe('DecisionService', () => { }); }); - it('should skip holdouts excluded for specific flags', async () => { - const { decisionService } = getDecisionService(); - const datafile = getHoldoutTestDatafile(); - - datafile.holdouts = datafile.holdouts.map((holdout: any) => { - if(holdout.id === 'holdout_running_id') { - return { - ...holdout, - excludedFlags: ['1001'] - } - } - return holdout; - }); - - const config = createProjectConfig(datafile); - const user = new OptimizelyUserContext({ - optimizely: {} as any, - userId: 'tester', - attributes: { - age: 15, // satisfies age_22 audience condition (age <= 22) for global holdout, but holdout excludes flag_1 - }, - }); - const feature = config.featureKeyMap['flag_1']; - const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - - expect(value).toBeInstanceOf(Promise); - - const variation = (await value)[0]; - - expect(variation.result).toEqual({ - experiment: config.experimentKeyMap['exp_1'], - variation: config.variationIdMap['5001'], - decisionSource: DECISION_SOURCES.FEATURE_TEST, - }); - }); - it('should handle multiple holdouts and use first matching one', async () => { const { decisionService } = getDecisionService(); const datafile = getHoldoutTestDatafile(); diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 217550f17..4b26f3804 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -31,7 +31,6 @@ import { getVariationKeyFromId, isActive, ProjectConfig, - getHoldoutsForFlag, } from '../../project_config/project_config'; import { AudienceEvaluator, createAudienceEvaluator } from '../audience_evaluator'; import * as stringValidator from '../../utils/string_value_validator'; @@ -943,7 +942,10 @@ export class DecisionService { reasons: decideReasons, }); } - const holdouts = getHoldoutsForFlag(configObj, feature.key); + + // all global holouts should be evaluated for all flags + // global holdouts are available in configObj.holdouts + const { holdouts } = configObj; for (const holdout of holdouts) { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index 5cc1b6cba..13c086539 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -30,7 +30,7 @@ import testDatafile from '../tests/test_data'; import configValidator from '../utils/config_validator'; import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; import { keyBy, sprintf } from '../utils/fns'; -import projectConfig, { ProjectConfig, getHoldoutsForFlag } from './project_config'; +import projectConfig, { ProjectConfig } from './project_config'; const cloneDeep = (obj: any) => JSON.parse(JSON.stringify(obj)); const logger = getMockLogger(); @@ -329,7 +329,7 @@ const getHoldoutDatafile = () => { key: 'holdout_2', status: 'Running', includedFlags: [], - excludedFlags: ['44829230000'], + excludedFlags: [], audienceIds: [], audienceConditions: [], variations: [ @@ -350,7 +350,7 @@ const getHoldoutDatafile = () => { id: 'holdout_id_3', key: 'holdout_3', status: 'Draft', - includedFlags: ['4482920077'], + includedFlags: [], excludedFlags: [], audienceIds: [], audienceConditions: [], @@ -392,22 +392,6 @@ describe('createProjectConfig - holdouts', () => { holdout_id_2: configObj.holdouts[1], holdout_id_3: configObj.holdouts[2], }); - - expect(configObj.globalHoldouts).toHaveLength(2); - expect(configObj.globalHoldouts).toEqual([ - configObj.holdouts[0], // holdout_1 has empty includedFlags - configObj.holdouts[1] // holdout_2 has empty includedFlags - ]); - - expect(configObj.includedHoldouts).toEqual({ - feature_1: [configObj.holdouts[2]], // holdout_3 includes feature_1 (ID: 4482920077) - }); - - expect(configObj.excludedHoldouts).toEqual({ - feature_3: [configObj.holdouts[1]] // holdout_2 excludes feature_3 (ID: 44829230000) - }); - - expect(configObj.flagHoldoutsMap).toEqual({}); }); it('should handle empty holdouts array', function() { @@ -417,10 +401,6 @@ describe('createProjectConfig - holdouts', () => { expect(configObj.holdouts).toEqual([]); expect(configObj.holdoutIdMap).toEqual({}); - expect(configObj.globalHoldouts).toEqual([]); - expect(configObj.includedHoldouts).toEqual({}); - expect(configObj.excludedHoldouts).toEqual({}); - expect(configObj.flagHoldoutsMap).toEqual({}); }); it('should handle undefined includedFlags and excludedFlags in holdout', function() { @@ -436,34 +416,6 @@ describe('createProjectConfig - holdouts', () => { }); }); -describe('getHoldoutsForFlag', () => { - it('should return all applicable holdouts for a flag', () => { - const datafile = getHoldoutDatafile(); - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); - - const feature1Holdouts = getHoldoutsForFlag(configObj, 'feature_1'); - expect(feature1Holdouts).toHaveLength(3); - expect(feature1Holdouts).toEqual([ - configObj.holdouts[0], - configObj.holdouts[1], - configObj.holdouts[2], - ]); - - const feature2Holdouts = getHoldoutsForFlag(configObj, 'feature_2'); - expect(feature2Holdouts).toHaveLength(2); - expect(feature2Holdouts).toEqual([ - configObj.holdouts[0], - configObj.holdouts[1], - ]); - - const feature3Holdouts = getHoldoutsForFlag(configObj, 'feature_3'); - expect(feature3Holdouts).toHaveLength(1); - expect(feature3Holdouts).toEqual([ - configObj.holdouts[0], - ]); - }); -}); - describe('getExperimentId', () => { let testData: Record; let configObj: ProjectConfig; diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index a3a72caf0..9f966549b 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -113,10 +113,6 @@ export interface ProjectConfig { odpIntegrationConfig: OdpIntegrationConfig; holdouts: Holdout[]; holdoutIdMap?: { [id: string]: Holdout }; - globalHoldouts: Holdout[]; - includedHoldouts: { [key: string]: Holdout[]; } - excludedHoldouts: { [key: string]: Holdout[]; } - flagHoldoutsMap: { [key: string]: Holdout[]; } } const EXPERIMENT_RUNNING_STATUS = 'Running'; @@ -390,70 +386,19 @@ const getEveryoneElseVariation = function( const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { projectConfig.holdouts = projectConfig.holdouts || []; projectConfig.holdoutIdMap = keyBy(projectConfig.holdouts, 'id'); - projectConfig.globalHoldouts = []; - projectConfig.includedHoldouts = {}; - projectConfig.excludedHoldouts = {}; - projectConfig.flagHoldoutsMap = {}; - - const featureFlagIdMap = keyBy(projectConfig.featureFlags, 'id'); projectConfig.holdouts.forEach((holdout) => { - if (!holdout.includedFlags) { - holdout.includedFlags = []; - } - - if (!holdout.excludedFlags) { - holdout.excludedFlags = []; - } + // Original design of holdouts made use of the includeFlags and excludeFlags fields to identify local holdouts. + // But this was never released. In the current design, these fields are no longer used. These fields are kept + // and assigned empty array to keep the published type `Holdout` unchanged. + holdout.includedFlags = []; + holdout.excludedFlags = []; holdout.variationKeyMap = keyBy(holdout.variations, 'key'); - assignBy(holdout.variations, 'id', projectConfig.variationIdMap); - - if (holdout.includedFlags.length === 0) { - projectConfig.globalHoldouts.push(holdout); - - holdout.excludedFlags.forEach((flagId: string) => { - const flag = featureFlagIdMap[flagId]; - if (flag) { - const flagKey = flag.key; - if (!projectConfig.excludedHoldouts[flagKey]) { - projectConfig.excludedHoldouts[flagKey] = []; - } - projectConfig.excludedHoldouts[flagKey].push(holdout); - } - }); - } else { - holdout.includedFlags.forEach((flagId: string) => { - const flag = featureFlagIdMap[flagId]; - if (flag) { - const flagKey = flag.key; - if (!projectConfig.includedHoldouts[flagKey]) { - projectConfig.includedHoldouts[flagKey] = []; - } - projectConfig.includedHoldouts[flagKey].push(holdout); - } - }) - } }); } -export const getHoldoutsForFlag = (projectConfig: ProjectConfig, flagKey: string): Holdout[] => { - if (projectConfig.flagHoldoutsMap[flagKey]) { - return projectConfig.flagHoldoutsMap[flagKey]; - } - - const flagHoldouts: Holdout[] = [ - ...projectConfig.globalHoldouts.filter((holdout) => { - return !(projectConfig.excludedHoldouts[flagKey] || []).includes(holdout); - }), - ...(projectConfig.includedHoldouts[flagKey] || []), - ]; - - projectConfig.flagHoldoutsMap[flagKey] = flagHoldouts; - return flagHoldouts; -} - /** * Extract all audience segments used in this audience's conditions * @param {Audience} audience Object representing the audience being parsed diff --git a/lib/shared_types.ts b/lib/shared_types.ts index 4d39a317d..5fc10498b 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -179,12 +179,8 @@ export interface Holdout extends ExperimentCore { } export function isHoldout(obj: Experiment | Holdout): obj is Holdout { - // Holdout has 'status', 'includedFlags', and 'excludedFlags' properties - return ( - (obj as Holdout).status !== undefined && - Array.isArray((obj as Holdout).includedFlags) && - Array.isArray((obj as Holdout).excludedFlags) - ); + // Holdout doesn't have 'layerId' property, while Experiment does + return (obj as Experiment).layerId === undefined; } export enum VariableType { From a2b378ce00ef10e539983fbfd1185b8a7e41a00f Mon Sep 17 00:00:00 2001 From: Matjaz Pirnovar Date: Mon, 1 Jun 2026 10:22:49 -0700 Subject: [PATCH 05/39] [AI-FSSDK] [FSSDK-12369] Add local holdouts support to JavaScript SDK (#1151) Co-authored-by: Raju Ahmed --- lib/core/decision_service/index.spec.ts | 221 ++++++++++++++++++++++ lib/core/decision_service/index.ts | 186 ++++++++++++------ lib/feature_toggle.ts | 3 + lib/project_config/project_config.spec.ts | 149 ++++++++++++++- lib/project_config/project_config.ts | 51 +++++ lib/shared_types.ts | 13 ++ 6 files changed, 565 insertions(+), 58 deletions(-) diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index 866bb8166..90aa5016e 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -2879,4 +2879,225 @@ describe('DecisionService', () => { expect(variation).toBe(null); }); }); + + describe('local holdouts', () => { + // Helper: build a datafile that has a local holdout targeting a specific experiment or delivery rule. + const makeLocalHoldoutDatafile = (targetRuleId: string, ruleIds: string[] = [targetRuleId]) => { + const datafile = getDecisionTestDatafile(); + (datafile as any).holdouts = [ + { + id: 'local_holdout_id', + key: 'local_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + includedRules: ruleIds, + audienceIds: [], + audienceConditions: [], + variations: [ + { + id: 'local_holdout_variation_id', + key: 'local_holdout_variation', + variables: [] + } + ], + trafficAllocation: [ + { entityId: 'local_holdout_variation_id', endOfRange: 10000 } + ] + } + ]; + return datafile; + }; + + beforeEach(() => { + mockBucket.mockReset(); + }); + + it('global holdout branch: global holdout is evaluated before per-rule logic', async () => { + const datafile = getDecisionTestDatafile(); + (datafile as any).holdouts = [ + { + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + // No includedRules → global holdout + audienceIds: [], + audienceConditions: [], + variations: [ + { id: 'global_holdout_var_id', key: 'global_holdout_var', variables: [] } + ], + trafficAllocation: [{ entityId: 'global_holdout_var_id', endOfRange: 10000 }] + } + ]; + const config = createProjectConfig(datafile); + const { decisionService } = getDecisionService(); + + // bucket returns the global holdout variation for the holdout, nothing for experiments + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'global_holdout_id') { + return { result: 'global_holdout_var_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Decision should be from the global holdout, not from any experiment + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); + expect(value[0].result.experiment?.id).toBe('global_holdout_id'); + }); + + it('local holdout hit branch: user bucketed into local holdout for experiment rule returns holdout variation; audience and traffic not evaluated for that rule', async () => { + // exp_1 has id '2001' + const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const { decisionService } = getDecisionService(); + + // bucket returns holdout variation when evaluating the local holdout + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Should return holdout decision for the local holdout + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); + expect(value[0].result.experiment?.id).toBe('local_holdout_id'); + expect(value[0].result.variation?.id).toBe('local_holdout_variation_id'); + }); + + it('local holdout miss branch: user not bucketed into local holdout falls through to regular rule evaluation', async () => { + // exp_1 has id '2001' and audience 4001 (age <= 22) + const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const { decisionService } = getDecisionService(); + + // bucket returns null for the local holdout, then succeeds for the experiment + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: null, reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; // variation_1 in exp_1 + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, // satisfies 4001 audience (age <= 22) + }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Should fall through to experiment evaluation (not holdout) + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.variation?.id).toBe('5001'); + }); + + it('rule specificity: local holdout targeting experiment rule X does not affect experiment rule Y', async () => { + // exp_1 = '2001', exp_2 = '2002'. Local holdout targets only '2002' (exp_2). + // Audience for exp_1: 4001 (age <= 22). User satisfies exp_1 audience but not exp_2. + const config = createProjectConfig(makeLocalHoldoutDatafile('2002')); + const { decisionService } = getDecisionService(); + + // bucket returns holdout variation only for the local holdout when evaluating for '2002', + // and returns experiment variation for '2001' + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + // User satisfies exp_1 audience (age <= 22) + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // exp_1 is evaluated first; local holdout targets '2002' not '2001', so exp_1 is evaluated normally + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.experiment?.id).toBe('2001'); + }); + + it('local holdout applies to delivery rules (rollouts) as well as experiment rules', async () => { + // delivery_1 has id '3001' + const config = createProjectConfig(makeLocalHoldoutDatafile('3001')); + const { decisionService } = getDecisionService(); + + // bucket returns null for all experiments and the local holdout variation for delivery rule + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + // No audience attributes → experiments won't match, falls through to rollout + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, // satisfies 4001 used by delivery_1 + }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Should be a holdout decision from the local holdout targeting the delivery rule + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); + expect(value[0].result.experiment?.id).toBe('local_holdout_id'); + }); + + it('forced decision beats a 100% traffic local holdout: forced decision takes precedence over local holdout', async () => { + // exp_1 has id '2001', key 'exp_1', variation key 'variation_1' (id '5001') + // Local holdout targets '2001' with 100% traffic allocation. + // User also has a forced decision set for exp_1. + // Expected: forced decision wins; decisionSource is FEATURE_TEST, not HOLDOUT. + const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const { decisionService } = getDecisionService(); + + // bucket should NOT be called for local_holdout_id because forced decision short-circuits first + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + // returning holdout variation here to prove the test fails if ordering is wrong + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + + // Set forced decision for exp_1 → variation_1 + user.setForcedDecision( + { flagKey: 'flag_1', ruleKey: 'exp_1' }, + { variationKey: 'variation_1' } + ); + + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Forced decision must win — source must be FEATURE_TEST, not HOLDOUT + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); + expect(value[0].result.variation?.key).toBe('variation_1'); + }); + }); }); + diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 4b26f3804..7d2ebf093 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -29,6 +29,8 @@ import { getVariationIdFromExperimentAndVariationKey, getVariationFromId, getVariationKeyFromId, + getGlobalHoldouts, + getHoldoutsForRule, isActive, ProjectConfig, } from '../../project_config/project_config'; @@ -72,10 +74,12 @@ import { } from 'log_message'; import { OptimizelyError } from '../../error/optimizly_error'; import { CmabService } from './cmab/cmab_service'; -import { Maybe, OpType, OpValue } from '../../utils/type'; +import { Maybe, OpType } from '../../utils/type'; import { Value } from '../../utils/promise/operation_value'; import { Platform } from '../../platform_support'; +import { localHoldout } from '../../feature_toggle'; + export const EXPERIMENT_NOT_RUNNING = 'Experiment %s is not running.'; export const RETURNING_STORED_VARIATION = 'Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.'; @@ -133,28 +137,48 @@ interface DecisionServiceOptions { cmabService: CmabService; } -interface DeliveryRuleResponse extends DecisionResponse { - skipToEveryoneElse: K; -} -interface UserProfileTracker { - userProfile: ExperimentBucketMap | null; - isProfileUpdated: boolean; -} +export type DecisionReason = [string, ...any[]]; -type VarationKeyWithCmabParams = { - variationKey?: string; +export type VariationIdWithCmabParams = { + variationId? : string; cmabUuid?: string; }; -export type DecisionReason = [string, ...any[]]; -export type VariationResult = DecisionResponse; -export type DecisionResult = DecisionResponse; -type VariationIdWithCmabParams = { - variationId? : string; + +export type VariationKeyWithCmabParams = { + variationKey? : string; cmabUuid?: string; }; + +export type DecisionResult = DecisionResponse; + + +type LocalHoldoutResult = DecisionResponse & { + holdoutDecision: true +} + +type ExperimentEvaluationResult = DecisionResponse & { + holdoutDecision?: false; +} + +export type ExperimentRuleResponse = ExperimentEvaluationResult | LocalHoldoutResult; + +type DeliveryEvaluationResult = DecisionResponse & { + holdoutDecision?: false; + skipToEveryoneElse: boolean; +} + +type DeliveryRuleResponse = DeliveryEvaluationResult | LocalHoldoutResult; + +type VariationKeyResult = DecisionResponse + export type DecideOptionsMap = Partial>; +interface UserProfileTracker { + userProfile: ExperimentBucketMap | null; + isProfileUpdated: boolean; +} + export const CMAB_DUMMY_ENTITY_ID= '$' export const LOGGER_NAME = 'DecisionService'; @@ -212,7 +236,7 @@ export class DecisionService { user: OptimizelyUserContext, decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, - ): Value { + ): Value { const userId = user.getUserId(); const experimentKey = experiment.key; @@ -300,7 +324,7 @@ export class DecisionService { this.getDecisionForCmabExperiment(op, configObj, experiment, user, decideOptions) : this.getDecisionFromBucketer(op, configObj, experiment, user); - return decisionVariationValue.then((variationResult): Value => { + return decisionVariationValue.then((variationResult): Value => { decideReasons.push(...variationResult.reasons); if (variationResult.error) { return Value.of(op, { @@ -943,11 +967,11 @@ export class DecisionService { }); } - // all global holouts should be evaluated for all flags - // global holdouts are available in configObj.holdouts - const { holdouts } = configObj; + // Global holdouts are evaluated at flag level, before any per-rule logic. + // getGlobalHoldouts() returns holdouts with includedRules == null/undefined. + const globalHoldouts = getGlobalHoldouts(configObj); - for (const holdout of holdouts) { + for (const holdout of globalHoldouts) { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); decideReasons.push(...holdoutDecision.reasons); @@ -1073,14 +1097,22 @@ export class DecisionService { op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); } - const decisionVariationValue = this.getVariationFromExperimentRule( + const experimentResponse = this.getVariationFromExperimentRule( op, configObj, feature.key, experiment, user, decideOptions, userProfileTracker, ); - return decisionVariationValue.then((decisionVariation) => { - decideReasons.push(...decisionVariation.reasons); + return experimentResponse.then((experimentResponse) => { + decideReasons.push(...experimentResponse.reasons); - if (decisionVariation.error) { + // If a local holdout was hit, return the holdout decision directly (preserves holdout as experiment). + if (experimentResponse.holdoutDecision) { + return Value.of(op, { + result: experimentResponse.result, + reasons: decideReasons, + }); + } + + if (experimentResponse.error) { return Value.of(op, { error: true, result: { @@ -1092,12 +1124,12 @@ export class DecisionService { }); } - if(!decisionVariation.result.variationKey) { + if(!experimentResponse.result.variationKey) { return this.traverseFeatureExperimentList( op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); } - - const variationKey = decisionVariation.result.variationKey; + + const variationKey = experimentResponse.result.variationKey; let variation: Variation | null = experiment.variationKeyMap[variationKey]; if (!variation) { variation = getFlagVariationByKey(configObj, feature.key, variationKey); @@ -1105,7 +1137,7 @@ export class DecisionService { return Value.of(op, { result: { - cmabUuid: decisionVariation.result.cmabUuid, + cmabUuid: experimentResponse.result.cmabUuid, experiment, variation, decisionSource: DECISION_SOURCES.FEATURE_TEST, @@ -1121,11 +1153,10 @@ export class DecisionService { user: OptimizelyUserContext, ): DecisionResponse { const decideReasons: DecisionReason[] = []; - let decisionObj: DecisionObj; if (!feature.rolloutId) { this.logger?.debug(NO_ROLLOUT_EXISTS, feature.key); decideReasons.push([NO_ROLLOUT_EXISTS, feature.key]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1145,7 +1176,7 @@ export class DecisionService { feature.key, ); decideReasons.push([INVALID_ROLLOUT_ID, feature.rolloutId, feature.key]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1163,7 +1194,7 @@ export class DecisionService { feature.rolloutId, ); decideReasons.push([ROLLOUT_HAS_NO_EXPERIMENTS, feature.rolloutId]); - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1173,19 +1204,34 @@ export class DecisionService { reasons: decideReasons, }; } - let decisionVariation; - let skipToEveryoneElse; - let variation; - let rolloutRule; + let index = 0; while (index < rolloutRules.length) { - decisionVariation = this.getVariationFromDeliveryRule(configObj, feature.key, rolloutRules, index, user); - decideReasons.push(...decisionVariation.reasons); - variation = decisionVariation.result; - skipToEveryoneElse = decisionVariation.skipToEveryoneElse; + const deliveryRuleResponse = this.getVariationFromDeliveryRule(configObj, feature.key, rolloutRules, index, user); + + decideReasons.push(...deliveryRuleResponse.reasons); + + // If a local holdout was hit for this delivery rule, use its decision object directly. + if (deliveryRuleResponse.holdoutDecision) { + return { + reasons: decideReasons, + result: deliveryRuleResponse.result, + } + } + + + const variation = deliveryRuleResponse.result; + const skipToEveryoneElse = deliveryRuleResponse.skipToEveryoneElse; + if (variation) { - rolloutRule = configObj.experimentIdMap[rolloutRules[index].id]; - decisionObj = { + // if (decisionVariation.localHoldoutDecision) { + // return { + // result: decisionVariation.localHoldoutDecision, + // reasons: decideReasons, + // }; + // } + const rolloutRule = configObj.experimentIdMap[rolloutRules[index].id]; + const decisionObj = { experiment: rolloutRule, variation: variation, decisionSource: DECISION_SOURCES.ROLLOUT @@ -1199,7 +1245,7 @@ export class DecisionService { index = skipToEveryoneElse ? (rolloutRules.length - 1) : (index + 1); } - decisionObj = { + const decisionObj = { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, @@ -1548,7 +1594,7 @@ export class DecisionService { user: OptimizelyUserContext, decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, - ): Value { + ): Value { const decideReasons: DecisionReason[] = []; // check forced decision first @@ -1562,26 +1608,35 @@ export class DecisionService { reasons: decideReasons, }); } + + if (localHoldout()) { + // Check local holdouts targeting this specific experiment rule. + // Inserted immediately after the forced-decision block, before regular rule evaluation. + const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForExperiment) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. + return Value.of(op, { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }); + } + } + } + const decisionVariationValue = this.resolveVariation(op, configObj, rule, user, decideOptions, userProfileTracker); return decisionVariationValue.then((variationResult) => { decideReasons.push(...variationResult.reasons); - return Value.of(op, { + return Value.of(op, { error: variationResult.error, result: variationResult.result, reasons: decideReasons, }); }); - - // return response; - - // decideReasons.push(...decisionVariation.reasons); - // const variationKey = decisionVariation.result; - - // return { - // result: variationKey, - // reasons: decideReasons, - // }; } private getVariationFromDeliveryRule( @@ -1590,7 +1645,7 @@ export class DecisionService { rules: Experiment[], ruleIndex: number, user: OptimizelyUserContext - ): DeliveryRuleResponse { + ): DeliveryRuleResponse { const decideReasons: DecisionReason[] = []; let skipToEveryoneElse = false; @@ -1608,6 +1663,23 @@ export class DecisionService { }; } + if (localHoldout()) { + // Check local holdouts targeting this specific delivery rule (FSSDK-12369). + // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. + const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForDelivery) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + return { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }; + } + } + } + const userId = user.getUserId(); const attributes = user.getAttributes(); const bucketingId = this.getBucketingId(userId, attributes); diff --git a/lib/feature_toggle.ts b/lib/feature_toggle.ts index c567c46a3..85fba2a88 100644 --- a/lib/feature_toggle.ts +++ b/lib/feature_toggle.ts @@ -39,4 +39,7 @@ import { Platform } from './platform_support'; export type IfActive boolean, Y, N = unknown> = ReturnType extends true ? Y : N; + +export const localHoldout = () => true as const; + export const __platforms: Platform[] = ['__universal__']; diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index 13c086539..7eee6a096 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -30,7 +30,7 @@ import testDatafile from '../tests/test_data'; import configValidator from '../utils/config_validator'; import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; import { keyBy, sprintf } from '../utils/fns'; -import projectConfig, { ProjectConfig } from './project_config'; +import projectConfig, { ProjectConfig, getGlobalHoldouts, getHoldoutsForRule } from './project_config'; const cloneDeep = (obj: any) => JSON.parse(JSON.stringify(obj)); const logger = getMockLogger(); @@ -416,6 +416,153 @@ describe('createProjectConfig - holdouts', () => { }); }); +// Level 1 tests for local holdouts (FSSDK-12369): isGlobal, getGlobalHoldouts, getHoldoutsForRule +describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { + const makeLocalHoldoutsDatafile = () => { + const datafile = testDatafile.getTestDecideProjectConfig(); + // Holdout with no includedRules → global + // Holdout with includedRules array → local + (datafile as any).holdouts = [ + { + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + variations: [{ id: 'global_var_id', key: 'global_var', variables: [] }], + trafficAllocation: [{ entityId: 'global_var_id', endOfRange: 5000 }], + // no includedRules → isGlobal should be true + }, + { + id: 'local_holdout_rule_a_id', + key: 'local_holdout_rule_a', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_a', 'rule_b'], + variations: [{ id: 'local_var_id', key: 'local_var', variables: [] }], + trafficAllocation: [{ entityId: 'local_var_id', endOfRange: 5000 }], + }, + { + id: 'empty_local_holdout_id', + key: 'empty_local_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: [], // empty array → local holdout (NOT global) + variations: [{ id: 'empty_var_id', key: 'empty_var', variables: [] }], + trafficAllocation: [{ entityId: 'empty_var_id', endOfRange: 5000 }], + }, + { + id: 'null_included_rules_id', + key: 'null_included_rules', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: null, // explicit null → global holdout + variations: [{ id: 'null_var_id', key: 'null_var', variables: [] }], + trafficAllocation: [{ entityId: 'null_var_id', endOfRange: 5000 }], + }, + ]; + return datafile; + }; + + it('should set isGlobal=true for holdout with no includedRules field (backward compat with old datafiles)', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const holdout = config.holdoutIdMap!['global_holdout_id']; + expect(holdout.isGlobal).toBe(true); + }); + + it('should set isGlobal=false for holdout with includedRules array', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const holdout = config.holdoutIdMap!['local_holdout_rule_a_id']; + expect(holdout.isGlobal).toBe(false); + }); + + it('should set isGlobal=false for holdout with empty includedRules array (empty array is still local)', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const holdout = config.holdoutIdMap!['empty_local_holdout_id']; + expect(holdout.isGlobal).toBe(false); + }); + + it('should set isGlobal=true for holdout with explicit null includedRules', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const holdout = config.holdoutIdMap!['null_included_rules_id']; + expect(holdout.isGlobal).toBe(true); + }); + + it('getGlobalHoldouts should return only holdouts with isGlobal=true', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const globals = getGlobalHoldouts(config); + const globalIds = globals.map(h => h.id); + expect(globalIds).toContain('global_holdout_id'); + expect(globalIds).toContain('null_included_rules_id'); + expect(globalIds).not.toContain('local_holdout_rule_a_id'); + expect(globalIds).not.toContain('empty_local_holdout_id'); + }); + + it('getHoldoutsForRule should return local holdouts targeting the given rule ID', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const forRuleA = getHoldoutsForRule(config, 'rule_a'); + expect(forRuleA).toHaveLength(1); + expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); + + const forRuleB = getHoldoutsForRule(config, 'rule_b'); + expect(forRuleB).toHaveLength(1); + expect(forRuleB[0].id).toBe('local_holdout_rule_a_id'); + }); + + it('getHoldoutsForRule should return empty array for an unknown rule ID', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const forUnknown = getHoldoutsForRule(config, 'nonexistent_rule'); + expect(forUnknown).toHaveLength(0); + }); + + it('getGlobalHoldouts should return empty array when all holdouts are local', () => { + const datafile = cloneDeep(makeLocalHoldoutsDatafile()); + (datafile as any).holdouts = [ + { + id: 'only_local_id', + key: 'only_local', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['some_rule'], + variations: [{ id: 'only_local_var_id', key: 'only_local_var', variables: [] }], + trafficAllocation: [{ entityId: 'only_local_var_id', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(datafile as any); + expect(getGlobalHoldouts(config)).toHaveLength(0); + }); + + it('should handle datafile with no holdouts gracefully', () => { + const datafile = testDatafile.getTestProjectConfig(); + const config = projectConfig.createProjectConfig(datafile as any); + expect(getGlobalHoldouts(config)).toHaveLength(0); + expect(getHoldoutsForRule(config, 'any_rule')).toHaveLength(0); + }); + + it('a single local holdout targeting multiple rules should appear for each targeted rule', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const forRuleA = getHoldoutsForRule(config, 'rule_a'); + const forRuleB = getHoldoutsForRule(config, 'rule_b'); + // Both rule_a and rule_b point to the same holdout + expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); + expect(forRuleB[0].id).toBe('local_holdout_rule_a_id'); + }); +}); + describe('getExperimentId', () => { let testData: Record; let configObj: ProjectConfig; diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index 9f966549b..9401e8a66 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -113,6 +113,18 @@ export interface ProjectConfig { odpIntegrationConfig: OdpIntegrationConfig; holdouts: Holdout[]; holdoutIdMap?: { [id: string]: Holdout }; + holdoutConfig?: HoldoutConfig; +} + +/** + * Holds pre-computed holdout lookup structures built during config parsing. + * Stored as plain data (no methods) to be serializable and equality-safe. + */ +export interface HoldoutConfig { + /** All holdouts whose includedRules is null or undefined (global holdouts). */ + global: Holdout[]; + /** Maps a rule ID to the local holdouts that target it. */ + ruleHoldoutsMap: { [ruleId: string]: Holdout[] }; } const EXPERIMENT_RUNNING_STATUS = 'Running'; @@ -387,6 +399,9 @@ const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { projectConfig.holdouts = projectConfig.holdouts || []; projectConfig.holdoutIdMap = keyBy(projectConfig.holdouts, 'id'); + const global: Holdout[] = []; + const ruleHoldoutsMap: { [ruleId: string]: Holdout[] } = {}; + projectConfig.holdouts.forEach((holdout) => { // Original design of holdouts made use of the includeFlags and excludeFlags fields to identify local holdouts. @@ -396,9 +411,45 @@ const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { holdout.excludedFlags = []; holdout.variationKeyMap = keyBy(holdout.variations, 'key'); assignBy(holdout.variations, 'id', projectConfig.variationIdMap); + + // Compute isGlobal: null/undefined includedRules means global holdout. + // An empty array ([]) means local holdout targeting no rules — still NOT global. + holdout.isGlobal = holdout.includedRules === null || holdout.includedRules === undefined; + + if (holdout.isGlobal) { + global.push(holdout); + } else { + // Local holdout: register under each rule ID it targets. + for (const ruleId of holdout.includedRules!) { + if (!ruleHoldoutsMap[ruleId]) { + ruleHoldoutsMap[ruleId] = []; + } + ruleHoldoutsMap[ruleId].push(holdout); + } + } }); + + projectConfig.holdoutConfig = { + global, + ruleHoldoutsMap, + }; } +/** + * Returns all global holdouts from the holdout config. + * Global holdouts have includedRules === null or undefined. + */ +export const getGlobalHoldouts = (projectConfig: ProjectConfig): Holdout[] => { + return projectConfig.holdoutConfig?.global ?? []; +}; + +/** + * Returns local holdouts targeting the given rule ID, or an empty array. + */ +export const getHoldoutsForRule = (projectConfig: ProjectConfig, ruleId: string): Holdout[] => { + return projectConfig.holdoutConfig?.ruleHoldoutsMap[ruleId] ?? []; +}; + /** * Extract all audience segments used in this audience's conditions * @param {Audience} audience Object representing the audience being parsed diff --git a/lib/shared_types.ts b/lib/shared_types.ts index 5fc10498b..f82aa0bce 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -176,6 +176,19 @@ export interface Holdout extends ExperimentCore { status: HoldoutStatus; includedFlags: string[]; excludedFlags: string[]; + /** + * When null or undefined, this is a global holdout (applies to all rules across all flags). + * When an array of rule ID strings, this is a local holdout (applies only to those rules). + * An empty array means a local holdout with no matching rules (still local, not global). + * This field may be absent in old datafiles — treated as null (global). + */ + includedRules?: string[] | null; + /** + * True if this is a global holdout (includedRules is null or undefined). + * False if this is a local holdout targeting specific rules. + * Computed and set during config parsing in parseHoldoutsConfig. + */ + isGlobal: boolean; } export function isHoldout(obj: Experiment | Holdout): obj is Holdout { From 80e4c842eded4ead2ebe691d05bc5fbe1675b4d6 Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Mon, 1 Jun 2026 12:17:11 -0700 Subject: [PATCH 06/39] [AI-FSSDK] [FSSDK-12670] Block ODP identify event for single identifier (#1152) Co-authored-by: Claude Opus 4.6 Co-authored-by: Raju Ahmed --- lib/message/log_message.ts | 1 + lib/odp/odp_manager.spec.ts | 12 ++++-------- lib/odp/odp_manager.ts | 12 ++++++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/message/log_message.ts b/lib/message/log_message.ts index 2e9180535..39a5e33fd 100644 --- a/lib/message/log_message.ts +++ b/lib/message/log_message.ts @@ -69,6 +69,7 @@ export const INVALIDATE_CMAB_CACHE = 'Invalidating CMAB cache for user %s and ru export const CMAB_CACHE_HIT = 'Cache hit for user %s and rule %s.'; export const CMAB_CACHE_ATTRIBUTES_MISMATCH = 'CMAB cache attributes mismatch for user %s and rule %s, fetching new decision.'; export const CMAB_CACHE_MISS = 'Cache miss for user %s and rule %s.'; +export const ODP_IDENTIFY_NOT_DISPATCHED= 'ODP identify event is not dispatched (fewer than 2 valid identifiers).' export const messages: string[] = []; diff --git a/lib/odp/odp_manager.spec.ts b/lib/odp/odp_manager.spec.ts index 9ae0daf69..3cc8c4532 100644 --- a/lib/odp/odp_manager.spec.ts +++ b/lib/odp/odp_manager.spec.ts @@ -618,7 +618,7 @@ describe('DefaultOdpManager', () => { expect(identifiers).toEqual(new Map([['fs_user_id', 'user'], ['vuid', 'vuid_a']])); }); - it('sends identified event when called with just fs_user_id in first parameter', async () => { + it('does not send identified event when called with just fs_user_id (single identifier)', async () => { const eventManager = getMockOdpEventManager(); eventManager.onRunning.mockReturnValue(Promise.resolve()); @@ -634,12 +634,10 @@ describe('DefaultOdpManager', () => { await odpManager.onRunning(); odpManager.identifyUser('user'); - expect(mockSendEvents).toHaveBeenCalledOnce(); - const { identifiers } = mockSendEvents.mock.calls[0][0]; - expect(identifiers).toEqual(new Map([['fs_user_id', 'user']])); + expect(mockSendEvents).not.toHaveBeenCalled(); }); - it('sends identified event when called with just vuid in first parameter', async () => { + it('does not send identified event when called with just vuid (single identifier)', async () => { const eventManager = getMockOdpEventManager(); eventManager.onRunning.mockReturnValue(Promise.resolve()); @@ -655,9 +653,7 @@ describe('DefaultOdpManager', () => { await odpManager.onRunning(); odpManager.identifyUser('vuid_a'); - expect(mockSendEvents).toHaveBeenCalledOnce(); - const { identifiers } = mockSendEvents.mock.calls[0][0]; - expect(identifiers).toEqual(new Map([['vuid', 'vuid_a']])); + expect(mockSendEvents).not.toHaveBeenCalled(); }); it('should reject onRunning() if stopped in new state', async () => { diff --git a/lib/odp/odp_manager.ts b/lib/odp/odp_manager.ts index 7525d0efb..2eb9c2e16 100644 --- a/lib/odp/odp_manager.ts +++ b/lib/odp/odp_manager.ts @@ -15,7 +15,7 @@ */ import { v4 as uuidV4} from 'uuid'; -import { LoggerFacade } from '../logging/logger'; +import { LoggerFacade, LogLevel } from '../logging/logger'; import { OdpIntegrationConfig, odpIntegrationsAreEqual } from './odp_config'; import { OdpEventManager } from './event_manager/odp_event_manager'; @@ -32,6 +32,7 @@ import { Maybe } from '../utils/type'; import { sprintf } from '../utils/fns'; import { SERVICE_STOPPED_BEFORE_RUNNING } from '../service'; import { Platform } from '../platform_support'; +import { ODP_IDENTIFY_NOT_DISPATCHED } from '../message/log_message'; export interface OdpManager extends Service { updateConfig(odpIntegrationConfig: OdpIntegrationConfig): boolean; @@ -212,7 +213,7 @@ export class DefaultOdpManager extends BaseService implements OdpManager { identifyUser(userId: string, vuid?: string): void { const identifiers = new Map(); - + let finalUserId: Maybe = userId; let finalVuid: Maybe = vuid; @@ -229,6 +230,13 @@ export class DefaultOdpManager extends BaseService implements OdpManager { identifiers.set(ODP_USER_KEY.FS_USER_ID, finalUserId); } + // Identify requires 2+ identifiers to link (e.g., vuid + fs_user_id). + // A single identifier has no cross-reference value and generates unnecessary traffic. + if (identifiers.size < 2) { + this.logger?.debug(ODP_IDENTIFY_NOT_DISPATCHED); + return; + } + const event = new OdpEvent(ODP_DEFAULT_EVENT_TYPE, ODP_EVENT_ACTION.IDENTIFIED, identifiers); this.sendEvent(event); } From 25b71296037f83ea0e9f0a900c9546e012f7807b Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Mon, 15 Jun 2026 18:55:07 +0600 Subject: [PATCH 07/39] [FSSDK-12759] fix content-length header in NodeRequestHandler (#1156) prevously, body.length was being used for content-length header, which is incorrect (The length data property of a String value contains the length of the string in UTF-16 code units, we need the byte length of utf-8 endcoded string). This PR fixes it. --- .../request_handler.node.spec.ts | 74 +++++++++++++++++++ .../request_handler.node.ts | 7 +- 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/lib/utils/http_request_handler/request_handler.node.spec.ts b/lib/utils/http_request_handler/request_handler.node.spec.ts index 33f190676..8f5b62806 100644 --- a/lib/utils/http_request_handler/request_handler.node.spec.ts +++ b/lib/utils/http_request_handler/request_handler.node.spec.ts @@ -16,6 +16,7 @@ import { describe, beforeEach, afterEach, beforeAll, afterAll, it, vi, expect } from 'vitest'; +import http from 'http'; import nock from 'nock'; import zlib from 'zlib'; import { NodeRequestHandler } from './request_handler.node'; @@ -202,6 +203,79 @@ describe('NodeRequestHandler', () => { scope.done(); }); + describe('multi-byte unicode data', () => { + let server: http.Server; + let port: number; + let receivedBody: string; + + beforeAll(async () => { + nock.enableNetConnect('localhost'); + server = http.createServer((req, res) => { + const chunks: Buffer[] = []; + req.on('data', (chunk: Buffer) => chunks.push(chunk)); + req.on('end', () => { + receivedBody = Buffer.concat(chunks).toString('utf8'); + res.writeHead(200, { 'content-type': 'application/json' }); + res.end(JSON.stringify({ ok: true })); + }); + }); + + await new Promise((resolve) => { + server.listen(0, () => { + port = (server.address() as { port: number }).port; + resolve(); + }); + }); + }); + + afterAll(async () => { + await new Promise((resolve) => server.close(() => resolve())); + nock.disableNetConnect(); + }); + + it('should correctly transmit ASCII data', async () => { + const data = '{"key":"value"}'; + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + + it('should correctly transmit emoji data', async () => { + const data = JSON.stringify({ message: '🚀 launch' }); + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + + it('should correctly transmit CJK character data', async () => { + const data = JSON.stringify({ greeting: '你好世界' }); + + const { responsePromise } = nodeRequestHandler.makeRequest( + `http://localhost:${port}/test`, + { 'content-type': 'application/json' }, + 'POST', + data, + ); + await responsePromise; + + expect(receivedBody).toBe(data); + }); + }); + describe('timeout', () => { beforeEach(() => { vi.useFakeTimers(); diff --git a/lib/utils/http_request_handler/request_handler.node.ts b/lib/utils/http_request_handler/request_handler.node.ts index b972c0526..1c7ef4435 100644 --- a/lib/utils/http_request_handler/request_handler.node.ts +++ b/lib/utils/http_request_handler/request_handler.node.ts @@ -62,16 +62,13 @@ export class NodeRequestHandler implements RequestHandler { headers: { ...headers, 'accept-encoding': 'gzip,deflate', - 'content-length': String(data?.length || 0) + 'content-length': String(data ? Buffer.byteLength(data) : 0), }, timeout: this.timeout, }); const abortableRequest = this.getAbortableRequestFromRequest(request); - if (data) { - request.write(data); - } - request.end(); + request.end(data); return abortableRequest; } From 1d56eeb62ccf3d4b6d8ef493efb17520a734841b Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Tue, 16 Jun 2026 13:03:49 -0700 Subject: [PATCH 08/39] [AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility (#1157) --------- Co-authored-by: Raju Ahmed --- lib/core/decision_service/index.spec.ts | 5 +- lib/message/error_message.ts | 1 + lib/project_config/project_config.spec.ts | 316 ++++++++++++++++++---- lib/project_config/project_config.ts | 133 ++++++--- lib/shared_types.ts | 15 +- 5 files changed, 361 insertions(+), 109 deletions(-) diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index 90aa5016e..d3b405284 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -2882,9 +2882,12 @@ describe('DecisionService', () => { describe('local holdouts', () => { // Helper: build a datafile that has a local holdout targeting a specific experiment or delivery rule. + // Per FSSDK-12760, local holdouts live in the top-level `localHoldouts` section + // (separate from `holdouts`, which now only carries global holdouts). const makeLocalHoldoutDatafile = (targetRuleId: string, ruleIds: string[] = [targetRuleId]) => { const datafile = getDecisionTestDatafile(); - (datafile as any).holdouts = [ + (datafile as any).holdouts = []; + (datafile as any).localHoldouts = [ { id: 'local_holdout_id', key: 'local_holdout', diff --git a/lib/message/error_message.ts b/lib/message/error_message.ts index 624e4085d..83059f93f 100644 --- a/lib/message/error_message.ts +++ b/lib/message/error_message.ts @@ -100,6 +100,7 @@ export const INVALID_CMAB_FETCH_RESPONSE = 'Invalid CMAB fetch response'; export const PROMISE_NOT_ALLOWED = "Promise value is not allowed in sync operation"; export const SERVICE_NOT_RUNNING = "%s not running"; export const EVENT_STORE_FULL = 'Event store is full. Not saving event with id %d.'; +export const LOCAL_HOLDOUT_MISSING_INCLUDED_RULES = 'Local holdout "%s" is missing or has empty "includedRules"; skipping.'; export const messages: string[] = []; diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index 7eee6a096..6cf68a82d 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -21,6 +21,7 @@ import { UNEXPECTED_RESERVED_ATTRIBUTE_PREFIX, UNRECOGNIZED_ATTRIBUTE, VARIABLE_KEY_NOT_IN_DATAFILE, + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, } from 'error_message'; import { Mock, afterAll, afterEach, assert, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import { OptimizelyError } from '../error/optimizly_error'; @@ -416,12 +417,12 @@ describe('createProjectConfig - holdouts', () => { }); }); -// Level 1 tests for local holdouts (FSSDK-12369): isGlobal, getGlobalHoldouts, getHoldoutsForRule -describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { - const makeLocalHoldoutsDatafile = () => { +// Level 1 tests for local holdouts (FSSDK-12369, FSSDK-12760). +// Section membership (`holdouts` vs `localHoldouts`) is the sole signal for scope. +describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () => { + const makeHoldoutsDatafile = () => { const datafile = testDatafile.getTestDecideProjectConfig(); - // Holdout with no includedRules → global - // Holdout with includedRules array → local + // Entries in `holdouts` are global by section membership. (datafile as any).holdouts = [ { id: 'global_holdout_id', @@ -433,8 +434,10 @@ describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { audienceConditions: [], variations: [{ id: 'global_var_id', key: 'global_var', variables: [] }], trafficAllocation: [{ entityId: 'global_var_id', endOfRange: 5000 }], - // no includedRules → isGlobal should be true }, + ]; + // Entries in `localHoldouts` are local; scoped via includedRules. + (datafile as any).localHoldouts = [ { id: 'local_holdout_rule_a_id', key: 'local_holdout_rule_a', @@ -447,70 +450,32 @@ describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { variations: [{ id: 'local_var_id', key: 'local_var', variables: [] }], trafficAllocation: [{ entityId: 'local_var_id', endOfRange: 5000 }], }, - { - id: 'empty_local_holdout_id', - key: 'empty_local_holdout', - status: 'Running', - includedFlags: [], - excludedFlags: [], - audienceIds: [], - audienceConditions: [], - includedRules: [], // empty array → local holdout (NOT global) - variations: [{ id: 'empty_var_id', key: 'empty_var', variables: [] }], - trafficAllocation: [{ entityId: 'empty_var_id', endOfRange: 5000 }], - }, - { - id: 'null_included_rules_id', - key: 'null_included_rules', - status: 'Running', - includedFlags: [], - excludedFlags: [], - audienceIds: [], - audienceConditions: [], - includedRules: null, // explicit null → global holdout - variations: [{ id: 'null_var_id', key: 'null_var', variables: [] }], - trafficAllocation: [{ entityId: 'null_var_id', endOfRange: 5000 }], - }, ]; return datafile; }; - it('should set isGlobal=true for holdout with no includedRules field (backward compat with old datafiles)', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + it('should set isGlobal=true for entries in the holdouts section (backward compat with old datafiles)', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const holdout = config.holdoutIdMap!['global_holdout_id']; expect(holdout.isGlobal).toBe(true); }); - it('should set isGlobal=false for holdout with includedRules array', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + it('should set isGlobal=false for entries in the localHoldouts section', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const holdout = config.holdoutIdMap!['local_holdout_rule_a_id']; expect(holdout.isGlobal).toBe(false); }); - it('should set isGlobal=false for holdout with empty includedRules array (empty array is still local)', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); - const holdout = config.holdoutIdMap!['empty_local_holdout_id']; - expect(holdout.isGlobal).toBe(false); - }); - - it('should set isGlobal=true for holdout with explicit null includedRules', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); - const holdout = config.holdoutIdMap!['null_included_rules_id']; - expect(holdout.isGlobal).toBe(true); - }); - - it('getGlobalHoldouts should return only holdouts with isGlobal=true', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + it('getGlobalHoldouts should return only entries from the holdouts section', () => { + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const globals = getGlobalHoldouts(config); const globalIds = globals.map(h => h.id); expect(globalIds).toContain('global_holdout_id'); - expect(globalIds).toContain('null_included_rules_id'); expect(globalIds).not.toContain('local_holdout_rule_a_id'); - expect(globalIds).not.toContain('empty_local_holdout_id'); }); it('getHoldoutsForRule should return local holdouts targeting the given rule ID', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const forRuleA = getHoldoutsForRule(config, 'rule_a'); expect(forRuleA).toHaveLength(1); expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); @@ -520,15 +485,97 @@ describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { expect(forRuleB[0].id).toBe('local_holdout_rule_a_id'); }); + it('getHoldoutsForRule should only return holdouts targeting that rule and exclude others', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).localHoldouts = [ + { + id: 'holdout_for_rule_x', + key: 'holdout_rule_x', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_x'], + variations: [{ id: 'var_x', key: 'var_x', variables: [] }], + trafficAllocation: [{ entityId: 'var_x', endOfRange: 5000 }], + }, + { + id: 'holdout_for_rule_y', + key: 'holdout_rule_y', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_y'], + variations: [{ id: 'var_y', key: 'var_y', variables: [] }], + trafficAllocation: [{ entityId: 'var_y', endOfRange: 5000 }], + }, + { + id: 'holdout_for_both', + key: 'holdout_both', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_x', 'rule_y'], + variations: [{ id: 'var_both', key: 'var_both', variables: [] }], + trafficAllocation: [{ entityId: 'var_both', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(datafile as any); + + const forRuleX = getHoldoutsForRule(config, 'rule_x'); + const forRuleXIds = forRuleX.map(h => h.id).sort(); + expect(forRuleXIds).toEqual(['holdout_for_both', 'holdout_for_rule_x']); + + const forRuleY = getHoldoutsForRule(config, 'rule_y'); + const forRuleYIds = forRuleY.map(h => h.id).sort(); + expect(forRuleYIds).toEqual(['holdout_for_both', 'holdout_for_rule_y']); + + // rule_x results must not contain holdout_for_rule_y and vice versa + expect(forRuleXIds).not.toContain('holdout_for_rule_y'); + expect(forRuleYIds).not.toContain('holdout_for_rule_x'); + }); + + it('getHoldoutsForRule should not return global holdouts', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).localHoldouts = [ + { + id: 'local_only', + key: 'local_only', + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules: ['rule_z'], + variations: [{ id: 'var_local', key: 'var_local', variables: [] }], + trafficAllocation: [{ entityId: 'var_local', endOfRange: 5000 }], + }, + ]; + const config = projectConfig.createProjectConfig(datafile as any); + + const forRuleZ = getHoldoutsForRule(config, 'rule_z'); + expect(forRuleZ).toHaveLength(1); + expect(forRuleZ[0].id).toBe('local_only'); + // global holdout must never appear in rule lookups + const allRuleHoldoutIds = forRuleZ.map(h => h.id); + expect(allRuleHoldoutIds).not.toContain('global_holdout_id'); + }); + it('getHoldoutsForRule should return empty array for an unknown rule ID', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const forUnknown = getHoldoutsForRule(config, 'nonexistent_rule'); expect(forUnknown).toHaveLength(0); }); - it('getGlobalHoldouts should return empty array when all holdouts are local', () => { - const datafile = cloneDeep(makeLocalHoldoutsDatafile()); - (datafile as any).holdouts = [ + it('getGlobalHoldouts should return empty array when only the localHoldouts section is populated', () => { + const datafile = cloneDeep(makeHoldoutsDatafile()); + (datafile as any).holdouts = []; + (datafile as any).localHoldouts = [ { id: 'only_local_id', key: 'only_local', @@ -554,7 +601,7 @@ describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { }); it('a single local holdout targeting multiple rules should appear for each targeted rule', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeLocalHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); const forRuleA = getHoldoutsForRule(config, 'rule_a'); const forRuleB = getHoldoutsForRule(config, 'rule_b'); // Both rule_a and rule_b point to the same holdout @@ -563,6 +610,163 @@ describe('createProjectConfig - local holdouts (FSSDK-12369)', () => { }); }); +// Level 1 tests for the FSSDK-12760 backward-compatible localHoldouts section design. +// Older SDKs (Gen 1/Gen 2) ignore the unknown `localHoldouts` top-level key entirely. +// Gen 3 SDKs (this one) treat section membership as the sole signal for scope. +describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { + const makeBaseDatafile = () => testDatafile.getTestDecideProjectConfig(); + + const makeLocal = (id: string, key: string, includedRules: any) => ({ + id, + key, + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + includedRules, + variations: [{ id: `${id}_var`, key: 'holdout', variables: [] }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + }); + + const makeGlobal = (id: string, key: string, extra: Record = {}) => ({ + id, + key, + status: 'Running', + includedFlags: [], + excludedFlags: [], + audienceIds: [], + audienceConditions: [], + variations: [{ id: `${id}_var`, key: 'holdout', variables: [] }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + ...extra, + }); + + it('exposes localHoldouts as a top-level array on the project config', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('l1', 'local_h', ['rule_x'])]; + const config = projectConfig.createProjectConfig(datafile); + expect(Array.isArray(config.localHoldouts)).toBe(true); + expect(config.localHoldouts).toHaveLength(1); + expect(config.localHoldouts[0].id).toBe('l1'); + }); + + it('defaults localHoldouts to an empty array when the section is absent (backward compat)', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'global_h')]; + // No localHoldouts key at all + const config = projectConfig.createProjectConfig(datafile); + expect(config.localHoldouts).toEqual([]); + expect(getGlobalHoldouts(config).map(h => h.id)).toContain('g1'); + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + }); + + it('ignores includedRules on entries in the global holdouts section', () => { + // An includedRules field on a `holdouts` entry must NOT narrow its scope — + // section membership is the sole signal for scope. + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [ + makeGlobal('stray', 'stray_global', { includedRules: ['rule_should_be_ignored'] }), + ]; + datafile.localHoldouts = []; + const config = projectConfig.createProjectConfig(datafile); + + const stray = config.holdoutIdMap!['stray']; + // includedRules must be stripped at parse time + expect(stray.includedRules).toBeUndefined(); + // Entity is global + expect(stray.isGlobal).toBe(true); + // It appears in global list and NOT in the rule map + expect(getGlobalHoldouts(config).map(h => h.id)).toContain('stray'); + expect(getHoldoutsForRule(config, 'rule_should_be_ignored')).toEqual([]); + }); + + it('does not mutate the caller-provided datafile when stripping includedRules', () => { + // Regression guard: parsing a datafile must not bleed mutations into the + // caller's reference (some hosts re-use the same datafile object). + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [ + makeGlobal('stray', 'stray_global', { includedRules: ['rule_x'] }), + ]; + projectConfig.createProjectConfig(datafile); + // Original datafile still has includedRules on the entry + expect(datafile.holdouts[0].includedRules).toEqual(['rule_x']); + }); + + it('partitions both sections correctly when both are present', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'g'), makeGlobal('g2', 'g2')]; + datafile.localHoldouts = [ + makeLocal('l1', 'l1', ['rule_a']), + makeLocal('l2', 'l2', ['rule_b']), + ]; + const config = projectConfig.createProjectConfig(datafile); + + expect(getGlobalHoldouts(config).map(h => h.id).sort()).toEqual(['g1', 'g2']); + expect(getHoldoutsForRule(config, 'rule_a').map(h => h.id)).toEqual(['l1']); + expect(getHoldoutsForRule(config, 'rule_b').map(h => h.id)).toEqual(['l2']); + // ID map covers both sections + expect(config.holdoutIdMap!['g1']).toBeDefined(); + expect(config.holdoutIdMap!['l1']).toBeDefined(); + }); + + it('logs an error and excludes localHoldouts entries with no includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + // Invalid: no includedRules at all + const invalid: any = makeLocal('bad', 'invalid_local', undefined); + delete invalid.includedRules; + datafile.localHoldouts = [invalid]; + + const config = projectConfig.createProjectConfig(datafile, null, logger); + + expect(getGlobalHoldouts(config)).toEqual([]); + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'invalid_local' + ); + }); + + it('logs an error and excludes localHoldouts entries with null includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('bad_null', 'null_local', null)]; + + const config = projectConfig.createProjectConfig(datafile, null, logger); + + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad_null']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'null_local' + ); + }); + + it('logs an error and excludes localHoldouts entries with empty includedRules', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = []; + datafile.localHoldouts = [makeLocal('bad_empty', 'empty_local', [])]; + + const config = projectConfig.createProjectConfig(datafile, null, logger); + + expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); + expect(config.holdoutIdMap!['bad_empty']).toBeUndefined(); + expect(logger.error).toHaveBeenCalledWith( + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, 'empty_local' + ); + }); + + it('keeps holdout variations in the variationIdMap from both sections', () => { + const datafile = cloneDeep(makeBaseDatafile()) as any; + datafile.holdouts = [makeGlobal('g1', 'g')]; + datafile.localHoldouts = [makeLocal('l1', 'l', ['rule_x'])]; + const config = projectConfig.createProjectConfig(datafile); + expect(config.variationIdMap['g1_var']).toBeDefined(); + expect(config.variationIdMap['l1_var']).toBeDefined(); + }); +}); + describe('getExperimentId', () => { let testData: Record; let configObj: ProjectConfig; diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index 9401e8a66..41f8fb6d0 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -49,6 +49,7 @@ import { UNRECOGNIZED_ATTRIBUTE, VARIABLE_KEY_NOT_IN_DATAFILE, VARIATION_ID_NOT_IN_DATAFILE, + LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, } from 'error_message'; import { SKIPPING_JSON_VALIDATION, VALID_DATAFILE } from 'log_message'; import { OptimizelyError } from '../error/optimizly_error'; @@ -112,17 +113,12 @@ export interface ProjectConfig { integrationKeyMap?: { [key: string]: Integration }; odpIntegrationConfig: OdpIntegrationConfig; holdouts: Holdout[]; + /** + * Local (rule-scoped) holdouts parsed from the top-level `localHoldouts` + * datafile section. Absent in older datafiles — defaults to an empty array. + */ + localHoldouts: Holdout[]; holdoutIdMap?: { [id: string]: Holdout }; - holdoutConfig?: HoldoutConfig; -} - -/** - * Holds pre-computed holdout lookup structures built during config parsing. - * Stored as plain data (no methods) to be serializable and equality-safe. - */ -export interface HoldoutConfig { - /** All holdouts whose includedRules is null or undefined (global holdouts). */ - global: Holdout[]; /** Maps a rule ID to the local holdouts that target it. */ ruleHoldoutsMap: { [ruleId: string]: Holdout[] }; } @@ -158,6 +154,16 @@ function createMutationSafeDatafileCopy(datafile: any): ProjectConfig { return rolloutCopy; }); + // Shallow-copy each holdout entry so per-entry mutations (e.g. stripping + // `includedRules` from global-section entries) don't bleed into the caller's + // datafile object. + datafileCopy.holdouts = (datafile.holdouts || []).map((holdout: Holdout) => { + return { ...holdout }; + }); + datafileCopy.localHoldouts = (datafile.localHoldouts || []).map((holdout: Holdout) => { + return { ...holdout }; + }); + datafileCopy.environmentKey = datafile.environmentKey ?? ''; datafileCopy.sdkKey = datafile.sdkKey ?? ''; @@ -168,9 +174,15 @@ function createMutationSafeDatafileCopy(datafile: any): ProjectConfig { * Creates projectConfig object to be used for quick project property lookup * @param {Object} datafileObj JSON datafile representing the project * @param {string|null} datafileStr JSON string representation of the datafile + * @param {LoggerFacade} logger Optional logger for parse-time diagnostics + * (e.g. invalid local-holdout entries). * @return {ProjectConfig} Object representing project configuration */ -export const createProjectConfig = function(datafileObj?: JSON, datafileStr: string | null = null): ProjectConfig { +export const createProjectConfig = function( + datafileObj?: JSON, + datafileStr: string | null = null, + logger?: LoggerFacade +): ProjectConfig { const projectConfig = createMutationSafeDatafileCopy(datafileObj); if (!projectConfig.region) { @@ -368,7 +380,7 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str projectConfig.flagVariationsMap[flagKey] = variations; }); - parseHoldoutsConfig(projectConfig); + parseHoldoutsConfig(projectConfig, logger); return projectConfig; }; @@ -395,15 +407,31 @@ const getEveryoneElseVariation = function( return everyoneElseRule.variations[0]; }; -const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { +/** + * Parse holdouts from the two top-level datafile sections. + * + * Two top-level sections drive holdout scoping (Gen 3+): + * - `holdouts` → ALL entries are global holdouts (applied to every flag). + * Any `includedRules` field on these entries is IGNORED; + * section membership alone determines scope. + * - `localHoldouts` → ALL entries are local holdouts (rule-scoped via + * `includedRules`). Entries missing/with empty `includedRules` + * are invalid and skipped with an error log. + * + * Backward compatibility: older datafiles that only emit the `holdouts` section + * continue to work — every entry is treated as global, matching pre-localHoldouts + * behavior. The `localHoldouts` key is simply absent and parsed as an empty list. + */ +const parseHoldoutsConfig = (projectConfig: ProjectConfig, logger?: LoggerFacade): void => { projectConfig.holdouts = projectConfig.holdouts || []; - projectConfig.holdoutIdMap = keyBy(projectConfig.holdouts, 'id'); + projectConfig.localHoldouts = projectConfig.localHoldouts || []; - const global: Holdout[] = []; + // const global: Holdout[] = []; const ruleHoldoutsMap: { [ruleId: string]: Holdout[] } = {}; + const holdoutIdMap: { [id: string]: Holdout } = {}; - projectConfig.holdouts.forEach((holdout) => { - + // Helper to seed common per-holdout fields (matches legacy behavior). + const initHoldout = (holdout: Holdout): void => { // Original design of holdouts made use of the includeFlags and excludeFlags fields to identify local holdouts. // But this was never released. In the current design, these fields are no longer used. These fields are kept // and assigned empty array to keep the published type `Holdout` unchanged. @@ -411,43 +439,61 @@ const parseHoldoutsConfig = (projectConfig: ProjectConfig): void => { holdout.excludedFlags = []; holdout.variationKeyMap = keyBy(holdout.variations, 'key'); assignBy(holdout.variations, 'id', projectConfig.variationIdMap); + }; - // Compute isGlobal: null/undefined includedRules means global holdout. - // An empty array ([]) means local holdout targeting no rules — still NOT global. - holdout.isGlobal = holdout.includedRules === null || holdout.includedRules === undefined; - - if (holdout.isGlobal) { - global.push(holdout); - } else { - // Local holdout: register under each rule ID it targets. - for (const ruleId of holdout.includedRules!) { - if (!ruleHoldoutsMap[ruleId]) { - ruleHoldoutsMap[ruleId] = []; - } - ruleHoldoutsMap[ruleId].push(holdout); + // Process global holdouts: section membership is the sole signal for scope. + // Drop any `includedRules` field on entries here so the entity is unambiguously + // global (isGlobal === true), even if the datafile incorrectly includes one. + projectConfig.holdouts.forEach((holdout) => { + initHoldout(holdout); + delete holdout.includedRules; + holdout.isGlobal = true; + holdoutIdMap[holdout.id] = holdout; + }); + + // Process local holdouts: every entry must carry a non-empty `includedRules` list. + // Entries missing it (or with [] / null) are invalid per spec — log an error and + // exclude from evaluation. Do NOT fall back to global application — the partition + // between sections is hard. + projectConfig.localHoldouts.forEach((holdout) => { + const includedRules = holdout.includedRules; + if (!Array.isArray(includedRules) || includedRules.length === 0) { + logger?.error(LOCAL_HOLDOUT_MISSING_INCLUDED_RULES, holdout.key); + return; + } + + initHoldout(holdout); + holdout.isGlobal = false; + holdoutIdMap[holdout.id] = holdout; + for (const ruleId of includedRules) { + if (!ruleHoldoutsMap[ruleId]) { + ruleHoldoutsMap[ruleId] = []; } + ruleHoldoutsMap[ruleId].push(holdout); } }); - projectConfig.holdoutConfig = { - global, - ruleHoldoutsMap, - }; + projectConfig.holdoutIdMap = holdoutIdMap; + projectConfig.ruleHoldoutsMap = ruleHoldoutsMap; } /** - * Returns all global holdouts from the holdout config. - * Global holdouts have includedRules === null or undefined. + * Returns all global holdouts (parsed from the top-level `holdouts` section). + * Section membership in `holdouts` is the sole signal for global scope — + * any `includedRules` field on these entries is ignored. */ export const getGlobalHoldouts = (projectConfig: ProjectConfig): Holdout[] => { - return projectConfig.holdoutConfig?.global ?? []; + return projectConfig.holdouts; }; /** * Returns local holdouts targeting the given rule ID, or an empty array. + * + * Local holdouts come from the top-level `localHoldouts` datafile section and + * are scoped per-rule via their `includedRules` field. */ export const getHoldoutsForRule = (projectConfig: ProjectConfig, ruleId: string): Holdout[] => { - return projectConfig.holdoutConfig?.ruleHoldoutsMap[ruleId] ?? []; + return projectConfig.ruleHoldoutsMap[ruleId] ?? []; }; /** @@ -968,13 +1014,10 @@ export const tryCreatingProjectConfig = function( config.logger?.info(SKIPPING_JSON_VALIDATION); } - const createProjectConfigArgs = [newDatafileObj]; - if (typeof config.datafile === 'string') { - // Since config.datafile was validated above, we know that it is a valid JSON string - createProjectConfigArgs.push(config.datafile); - } - - const newConfigObj = createProjectConfig(...createProjectConfigArgs); + // Pass the datafile string (when available) and the logger so parse-time + // diagnostics (e.g. invalid local-holdout entries) are surfaced. + const datafileStr = typeof config.datafile === 'string' ? config.datafile : null; + const newConfigObj = createProjectConfig(newDatafileObj, datafileStr, config.logger); return newConfigObj; }; diff --git a/lib/shared_types.ts b/lib/shared_types.ts index f82aa0bce..6640622ab 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -177,16 +177,17 @@ export interface Holdout extends ExperimentCore { includedFlags: string[]; excludedFlags: string[]; /** - * When null or undefined, this is a global holdout (applies to all rules across all flags). - * When an array of rule ID strings, this is a local holdout (applies only to those rules). - * An empty array means a local holdout with no matching rules (still local, not global). - * This field may be absent in old datafiles — treated as null (global). + * Per-rule targeting for local holdouts. Required on entries from the + * `localHoldouts` datafile section; stripped from entries in the `holdouts` + * section at parse time. Scope is determined by datafile section membership, + * not this field. */ includedRules?: string[] | null; /** - * True if this is a global holdout (includedRules is null or undefined). - * False if this is a local holdout targeting specific rules. - * Computed and set during config parsing in parseHoldoutsConfig. + * True if this holdout came from the `holdouts` (global) datafile section. + * Computed during config parsing in parseHoldoutsConfig — `includedRules` is + * stripped from global-section entries, so this stays consistent with section + * membership. */ isGlobal: boolean; } From 49b58cc9b6deeeaa3c929dd60d9d65f164b4d325 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Tue, 30 Jun 2026 20:17:31 +0600 Subject: [PATCH 09/39] [FSSDK-12820] Upgrade to uuid v13 (#1159) * [FSSDK-12820] Upgrade to uuid v13 Upgrade uuid to v13 (ESM-only). Update rollup config to bundle uuid into CJS outputs instead of keeping it as an external dependency, since CJS consumers cannot require() an ESM-only package. Add a CJS require hook shim so mocha/ts-node tests can still load uuid in CommonJS mode. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/javascript.yml | 15 ++ examples/node-commonjs/index.js | 84 ++++++++++++ examples/node-commonjs/package.json | 9 ++ .../{typescript => shared}/datafile-server.js | 11 +- examples/{typescript => shared}/datafile.json | 0 examples/typescript/.gitignore | 1 - examples/typescript/README.md | 2 - examples/typescript/package-lock.json | 41 ++++++ examples/typescript/src/index.ts | 2 +- lib/tests/uuid_cjs_shim.js | 22 +++ package-lock.json | 128 ++++++++++++++---- package.json | 10 +- rollup.config.mjs | 30 +++- scripts/run-cjs-example.js | 80 +++++++++++ scripts/run-ts-example.js | 4 +- tsconfig.json | 6 + 16 files changed, 394 insertions(+), 51 deletions(-) create mode 100644 examples/node-commonjs/index.js create mode 100644 examples/node-commonjs/package.json rename examples/{typescript => shared}/datafile-server.js (90%) rename examples/{typescript => shared}/datafile.json (100%) create mode 100644 examples/typescript/package-lock.json create mode 100644 lib/tests/uuid_cjs_shim.js create mode 100644 scripts/run-cjs-example.js diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index ec1c01176..847fd9751 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -42,6 +42,21 @@ jobs: npm install npm run test-typescript + commonjs_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '18' + cache-dependency-path: ./package-lock.json + cache: 'npm' + - name: Run CommonJS example + run: | + npm install + npm run test-commonjs + integration_tests: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master secrets: diff --git a/examples/node-commonjs/index.js b/examples/node-commonjs/index.js new file mode 100644 index 000000000..4a1ee5260 --- /dev/null +++ b/examples/node-commonjs/index.js @@ -0,0 +1,84 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const fs = require('fs'); +const path = require('path'); + +const { + createInstance, + createStaticProjectConfigManager, + createForwardingEventProcessor, + createLogger, + createErrorNotifier, + INFO, +} = require('@optimizely/optimizely-sdk'); + +const datafilePath = path.join(__dirname, '..', 'shared', 'datafile.json'); +const testDatafile = fs.readFileSync(datafilePath, 'utf8'); + +const TIMEOUT_MS = 10000; + +async function testCommonJsRequire() { + let resolveUuid; + const uuidPromise = new Promise((resolve, reject) => { + resolveUuid = resolve; + setTimeout(() => reject(new Error('Timed out waiting for event dispatch')), TIMEOUT_MS); + }); + + const dispatcher = { + dispatchEvent(logEvent) { + const uuid = logEvent.params.visitors[0].snapshots[0].events[0].uuid; + console.log(`Dispatched event with uuid: ${uuid}`); + + if (typeof uuid === 'string' && uuid.length > 0) { + resolveUuid(uuid); + } + + return Promise.resolve({}); + }, + }; + + const configManager = createStaticProjectConfigManager({ + datafile: testDatafile, + }); + + const eventProcessor = createForwardingEventProcessor(dispatcher); + + const client = createInstance({ + projectConfigManager: configManager, + eventProcessor: eventProcessor, + }); + + await client.onReady(); + + const userContext = client.createUserContext('test_user', { age: 22 }); + userContext.decide('flag_1'); + + const uuid = await uuidPromise; + console.log(`Test passed: event contained valid uuid "${uuid}"`); + + client.close(); +} + +testCommonJsRequire() + .then(() => { + console.log('\n=== CommonJS example completed successfully! ===\n'); + process.exit(0); + }) + .catch((error) => { + console.error('Test failed:', error); + process.exit(1); + }); diff --git a/examples/node-commonjs/package.json b/examples/node-commonjs/package.json new file mode 100644 index 000000000..ef436bad9 --- /dev/null +++ b/examples/node-commonjs/package.json @@ -0,0 +1,9 @@ +{ + "name": "optimizely-sdk-commonjs-example", + "version": "1.0.0", + "private": true, + "description": "CommonJS example for Optimizely SDK - verifies CJS compatibility", + "scripts": { + "start": "node index.js" + } +} diff --git a/examples/typescript/datafile-server.js b/examples/shared/datafile-server.js similarity index 90% rename from examples/typescript/datafile-server.js rename to examples/shared/datafile-server.js index d6984c1d3..58ffced11 100755 --- a/examples/typescript/datafile-server.js +++ b/examples/shared/datafile-server.js @@ -21,14 +21,9 @@ * Runs at http://localhost:PORT */ -import http from 'http'; -import fs from 'fs'; -import path from 'path'; -import { fileURLToPath } from 'url'; -import { dirname } from 'path'; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = dirname(__filename); +const http = require('http'); +const fs = require('fs'); +const path = require('path'); const PORT = 8910; const datafilePath = path.join(__dirname, 'datafile.json'); diff --git a/examples/typescript/datafile.json b/examples/shared/datafile.json similarity index 100% rename from examples/typescript/datafile.json rename to examples/shared/datafile.json diff --git a/examples/typescript/.gitignore b/examples/typescript/.gitignore index 5d3055a0d..dd6e803c7 100644 --- a/examples/typescript/.gitignore +++ b/examples/typescript/.gitignore @@ -2,4 +2,3 @@ node_modules/ dist/ *.log .DS_Store -package-lock.json diff --git a/examples/typescript/README.md b/examples/typescript/README.md index cc4430e0f..918f71624 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -5,8 +5,6 @@ This example demonstrates all factory functions from the Optimizely SDK, includi ## Files - `src/index.ts` - Main example demonstrating all SDK factory functions -- `datafile.json` - Test datafile with Optimizely configuration -- `datafile-server.js` - Simple HTTP server for testing polling datafile manager ## Running the Example diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json new file mode 100644 index 000000000..907f416c9 --- /dev/null +++ b/examples/typescript/package-lock.json @@ -0,0 +1,41 @@ +{ + "name": "optimizely-sdk-typescript-example", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "optimizely-sdk-typescript-example", + "version": "1.0.0", + "devDependencies": { + "@types/node": "^20.0.0", + "typescript": "^4.7.4" + } + }, + "node_modules/@types/node": { + "version": "20.19.28", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/typescript": { + "version": "4.9.5", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/src/index.ts b/examples/typescript/src/index.ts index 1681d245b..85d9655d0 100644 --- a/examples/typescript/src/index.ts +++ b/examples/typescript/src/index.ts @@ -50,7 +50,7 @@ import { fileURLToPath } from 'url'; const __filename: string = fileURLToPath(import.meta.url); const __dirname: string = dirname(__filename); -const datafilePath: string = path.join(__dirname, '..', 'datafile.json'); +const datafilePath: string = path.join(__dirname, '..', '..', 'shared', 'datafile.json'); const testDatafile: string = fs.readFileSync(datafilePath, 'utf8'); async function testStaticConfigSetup(): Promise { diff --git a/lib/tests/uuid_cjs_shim.js b/lib/tests/uuid_cjs_shim.js new file mode 100644 index 000000000..117f990da --- /dev/null +++ b/lib/tests/uuid_cjs_shim.js @@ -0,0 +1,22 @@ +/** + * CJS require hook that intercepts `require('uuid')` to provide a CJS-compatible + * shim. Needed because uuid v13+ is ESM-only and cannot be loaded via require(). + * Uses Node's built-in crypto.randomUUID() which produces identical RFC 4122 v4 UUIDs. + */ +const Module = require('module'); // eslint-disable-line @typescript-eslint/no-var-requires +const crypto = require('crypto'); // eslint-disable-line @typescript-eslint/no-var-requires + +const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; + +const uuidShim = { + v4: () => crypto.randomUUID(), + validate: (str) => typeof str === 'string' && UUID_REGEX.test(str), +}; + +const originalLoad = Module._load; +Module._load = function (request, parent, isMain) { + if (request === 'uuid') { + return uuidShim; + } + return originalLoad.call(this, request, parent, isMain); +}; diff --git a/package-lock.json b/package-lock.json index 57da2656f..e58033959 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "decompress-response": "^7.0.0", "json-schema": "^0.4.0", "murmurhash": "^2.0.1", - "uuid": "^10.0.0" + "uuid": "^13.0.2" }, "devDependencies": { "@react-native-async-storage/async-storage": "^2", @@ -26,7 +26,6 @@ "@types/nise": "^1.4.0", "@types/node": "^18.7.18", "@types/ua-parser-js": "^0.7.36", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "@vitest/browser": "3.2.4", @@ -56,7 +55,7 @@ "rollup": "^4.55.1", "sinon": "^2.3.1", "ts-loader": "^9.3.1", - "ts-node": "^8.10.2", + "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "tslib": "^2.8.1", "typescript": "^4.7.4", @@ -634,6 +633,28 @@ "node": ">=0.1.90" } }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", @@ -2628,6 +2649,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@tsconfig/node10": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.12.tgz", + "integrity": "sha512-UCYBaeFvM11aU2y3YPZ//O5Rhj+xKyzy7mvcIoAjASbigy8mHMryP5cK7dgjlz2hWxh1g5pLw084E0a/wlUSFQ==", + "dev": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -2845,13 +2890,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/whatwg-mimetype": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/@types/whatwg-mimetype/-/whatwg-mimetype-3.0.2.tgz", @@ -3822,6 +3860,18 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -5238,6 +5288,12 @@ "node": ">= 14" } }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -13045,29 +13101,46 @@ } }, "node_modules/ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "dev": true, - "license": "MIT", - "dependencies": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "source-map-support": "^0.5.17", + "v8-compile-cache-lib": "^3.0.1", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, - "engines": { - "node": ">=6.0.0" - }, "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, "node_modules/ts-node/node_modules/diff": { @@ -13332,18 +13405,23 @@ } }, "node_modules/uuid": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", - "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.2.tgz", + "integrity": "sha512-vzi9uRZ926x4XV73S/4qQaTwPXM2JBj6/6lI/byHH1jOpCzb0zDbfytgA9LcN/hzb2l7WQSQnxITOVx5un/wGw==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist-node/bin/uuid" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", diff --git a/package.json b/package.json index 8c548407a..70a798480 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "test-umd": "node ./scripts/run-umd-tests.js", "test-umd-local": "USE_LOCAL_BROWSER=true node ./scripts/run-umd-tests.js", "test-umd-browserstack": "USE_LOCAL_BROWSER=false node ./scripts/run-umd-tests.js", - "test-mocha": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", + "test-mocha": "mocha -r lib/tests/uuid_cjs_shim.js -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", "test": "npm run test-mocha && npm run test-vitest", "posttest": "npm run lint", "test-ci": "npm run test-xbrowser && npm run test-umdbrowser", @@ -82,7 +82,8 @@ "prepare": "npm run build", "prepublishOnly": "npm test", "genmsg": "jiti message_generator ./lib/message/error_message.ts ./lib/message/log_message.ts", - "test-typescript": "node ./scripts/run-ts-example.js" + "test-typescript": "node ./scripts/run-ts-example.js", + "test-commonjs": "node ./scripts/run-cjs-example.js" }, "repository": { "type": "git", @@ -103,7 +104,7 @@ "decompress-response": "^7.0.0", "json-schema": "^0.4.0", "murmurhash": "^2.0.1", - "uuid": "^10.0.0" + "uuid": "^13.0.2" }, "devDependencies": { "@react-native-async-storage/async-storage": "^2", @@ -117,7 +118,6 @@ "@types/nise": "^1.4.0", "@types/node": "^18.7.18", "@types/ua-parser-js": "^0.7.36", - "@types/uuid": "^10.0.0", "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "@vitest/browser": "3.2.4", @@ -147,7 +147,7 @@ "rollup": "^4.55.1", "sinon": "^2.3.1", "ts-loader": "^9.3.1", - "ts-node": "^8.10.2", + "ts-node": "^10.9.2", "tsconfig-paths": "^4.2.0", "tslib": "^2.8.1", "typescript": "^4.7.4", diff --git a/rollup.config.mjs b/rollup.config.mjs index 020778d8f..fe3df3d85 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -28,15 +28,22 @@ const __dirname = dirname(__filename); const require = createRequire(import.meta.url); const { dependencies, peerDependencies } = require('./package.json'); -const resolvePlugin = nodeResolve({ - extensions: ['.js'] +const resolvePlugin = nodeResolve(); + +const resolvePluginNode = nodeResolve({ + exportConditions: ['node'], }); const resolvePluginBrowser = nodeResolve({ browser: true, - extensions: ['.js'] + exportConditions: ['browser'], }); +const resolvePluginByPlatform = { + node: resolvePluginNode, + browser: resolvePluginBrowser, +}; + const aliasPlugin = alias({ entries: [ { find: 'error_message', replacement: join(__dirname, '.build/message/error_message.gen.js') }, @@ -44,6 +51,13 @@ const aliasPlugin = alias({ ] }); +const externalDeps = ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})); + +// uuid@13 is ESM-only and does not provide a CommonJS export. +// Since our CJS bundles must work in CommonJS environments, we bundle uuid +// into the CJS output instead of leaving it as an external dependency. +const externalDepsWithoutUuid = externalDeps.filter(dep => dep !== 'uuid'); + const cjsBundleFor = (platform, opt = {}) => { const { minify, ext } = { minify: true, @@ -54,8 +68,8 @@ const cjsBundleFor = (platform, opt = {}) => { const min = minify ? '.min' : ''; return { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})), + plugins: [aliasPlugin, resolvePluginByPlatform[platform] || resolvePlugin, commonjs()], + external: externalDepsWithoutUuid, input: `.build/index.${platform}.js`, output: { exports: 'named', @@ -78,6 +92,7 @@ const esmBundleFor = (platform, opt) => { return { ...cjsBundleFor(platform), + external: externalDeps, output: [ { format: 'es', @@ -100,7 +115,7 @@ const cjsBundleForUAParser = (opt = {}) => { return { plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})), + external: externalDepsWithoutUuid, input: `.build/odp/ua_parser/ua_parser.js`, output: { exports: 'named', @@ -123,6 +138,7 @@ const esmBundleForUAParser = (opt = {}) => { return { ...cjsBundleForUAParser(), + external: externalDeps, output: [ { format: 'es', @@ -162,7 +178,7 @@ const umdBundle = { // A separate bundle for json schema validator. const jsonSchemaBundle = { plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['json-schema', 'uuid'], + external: ['json-schema'], input: '.build/utils/json_schema_validator/index.js', output: { exports: 'named', diff --git a/scripts/run-cjs-example.js b/scripts/run-cjs-example.js new file mode 100644 index 000000000..fa213d54c --- /dev/null +++ b/scripts/run-cjs-example.js @@ -0,0 +1,80 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { execSync } = require('child_process'); +const path = require('path'); +const fs = require('fs'); + +const rootDir = path.join(__dirname, '..'); +const exampleDir = path.join(rootDir, 'examples', 'node-commonjs'); + +function run(command, cwd) { + console.log(`\n> ${command}`); + console.log(` (in ${cwd})\n`); + try { + execSync(command, { + cwd, + stdio: 'inherit', + shell: true + }); + } catch (error) { + console.error(`\nError executing: ${command}`); + process.exit(1); + } +} + +function runQuiet(command, cwd) { + try { + const output = execSync(command, { + cwd, + encoding: 'utf8', + shell: true + }).trim(); + const lines = output.split('\n'); + return lines[lines.length - 1].trim(); + } catch (error) { + console.error(`\nError executing: ${command}`); + process.exit(1); + } +} + +function main() { + console.log('=== Building SDK and Running CommonJS Example ===\n'); + + console.log('Installing SDK dependencies...'); + run('npm install', rootDir); + + console.log('\nPacking SDK tarball...'); + const packOutput = runQuiet('npm pack', rootDir); + const tarballPath = path.join(rootDir, packOutput); + console.log(`Created: ${packOutput}`); + + console.log('\nInstalling SDK tarball in cjs-example...'); + run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); + + console.log('\nRunning cjs-example...'); + run('npm start', exampleDir); + + console.log('\nCleaning up tarball...'); + fs.unlinkSync(tarballPath); + console.log(`Removed: ${packOutput}`); + + console.log('\n=== Example completed successfully! ===\n'); +} + +main(); diff --git a/scripts/run-ts-example.js b/scripts/run-ts-example.js index 32c7f7ec6..ee1c7255d 100755 --- a/scripts/run-ts-example.js +++ b/scripts/run-ts-example.js @@ -62,7 +62,7 @@ function startDatafileServer() { console.log('\n=== Starting Datafile Server ==='); console.log('Starting server at http://localhost:8910...\n'); - const serverPath = path.join(exampleDir, 'datafile-server.js'); + const serverPath = path.join(rootDir, 'examples', 'shared', 'datafile-server.js'); datafileServer = spawn('node', [serverPath], { stdio: 'inherit', detached: false @@ -114,7 +114,7 @@ async function main() { run('npm install', exampleDir); console.log('\nInstalling SDK tarball in ts-example...'); - run(`npm install --no-save ${tarballPath}`, exampleDir); + run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); console.log('\nBuilding ts-example...'); run('npm run build', exampleDir); diff --git a/tsconfig.json b/tsconfig.json index b3d1744e4..25be5af80 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,6 +33,12 @@ "skipLibCheck": true, "useUnknownInCatchVariables": false }, + "ts-node": { + "compilerOptions": { + "module": "commonjs" + }, + "transpileOnly": true + }, "exclude": [ "./dist", "./.build", From 44828e60eed88365789c3270f454e90a47e4effa Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 1 Jul 2026 19:42:55 +0600 Subject: [PATCH 10/39] [AI-FSSDK] [FSSDK-12750] Use attribute id instead of key for CMAB prediction requests (#1160) --- .../decision_service/cmab/cmab_service.spec.ts | 14 +++++++------- lib/core/decision_service/cmab/cmab_service.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/core/decision_service/cmab/cmab_service.spec.ts b/lib/core/decision_service/cmab/cmab_service.spec.ts index 38ee205e4..fa3c3615f 100644 --- a/lib/core/decision_service/cmab/cmab_service.spec.ts +++ b/lib/core/decision_service/cmab/cmab_service.spec.ts @@ -96,8 +96,8 @@ describe('DefaultCmabService', () => { expect(ruleIdArg).toEqual(ruleId); expect(userIdArg).toEqual(userContext.getUserId()); expect(attributesArg).toEqual({ - country: 'US', - age: '25', + '66': 'US', + '77': '25', }); }); @@ -124,13 +124,13 @@ describe('DefaultCmabService', () => { expect(mockCmabClient.fetchDecision).toHaveBeenCalledTimes(2); expect(mockCmabClient.fetchDecision.mock.calls[0][2]).toEqual({ - country: 'US', - age: '25', - language: 'en', + '66': 'US', + '77': '25', + '88': 'en', }); expect(mockCmabClient.fetchDecision.mock.calls[1][2]).toEqual({ - country: 'US', - gender: 'male' + '66': 'US', + '99': 'male' }); }); diff --git a/lib/core/decision_service/cmab/cmab_service.ts b/lib/core/decision_service/cmab/cmab_service.ts index 004a146c0..2e613b4fd 100644 --- a/lib/core/decision_service/cmab/cmab_service.ts +++ b/lib/core/decision_service/cmab/cmab_service.ts @@ -182,9 +182,9 @@ export class DefaultCmabService implements CmabService { cmabAttributeIds.forEach((aid) => { const attribute = projectConfig.attributeIdMap[aid]; - + if (userAttributes.hasOwnProperty(attribute.key)) { - filteredAttributes[attribute.key] = userAttributes[attribute.key]; + filteredAttributes[aid] = userAttributes[attribute.key]; } }); From fc368a288f5329fa4016f11dd3b06da3996eff94 Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Tue, 7 Jul 2026 07:29:56 -0700 Subject: [PATCH 11/39] [AI-FSSDK] [FSSDK-12813] Normalize decision event campaign_id, variation_id, and entity_id (#1158) Co-authored-by: Raju Ahmed --- .../event_builder/log_event.spec.ts | 429 +++++++++++++++++- .../event_builder/log_event.ts | 18 +- lib/optimizely/index.tests.js | 4 +- 3 files changed, 422 insertions(+), 29 deletions(-) diff --git a/lib/event_processor/event_builder/log_event.spec.ts b/lib/event_processor/event_builder/log_event.spec.ts index ad3b22b94..50750d508 100644 --- a/lib/event_processor/event_builder/log_event.spec.ts +++ b/lib/event_processor/event_builder/log_event.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2022, 2024, Optimizely + * Copyright 2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,19 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, it, expect } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import { makeEventBatch, buildLogEvent, } from './log_event'; -import { ImpressionEvent, ConversionEvent, UserEvent } from './user_event'; +import { ImpressionEvent, ConversionEvent } from './user_event'; import { Region } from '../../project_config/project_config'; describe('makeEventBatch', () => { it('should build a batch with single impression event when experiment and variation are defined', () => { + // Fixtures use valid numeric IDs so the wire output matches the + // post-normalization happy-path expectations. const impressionEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -47,16 +49,16 @@ describe('makeEventBatch', () => { }, layer: { - id: 'layerId', + id: '11111', }, experiment: { - id: 'expId', + id: '22222', key: 'expKey', }, variation: { - id: 'varId', + id: '33333', key: 'varKey', }, @@ -82,9 +84,9 @@ describe('makeEventBatch', () => { { decisions: [ { - campaign_id: 'layerId', - experiment_id: 'expId', - variation_id: 'varId', + campaign_id: '11111', + experiment_id: '22222', + variation_id: '33333', metadata: { flag_key: 'flagKey1', rule_key: 'expKey', @@ -96,7 +98,7 @@ describe('makeEventBatch', () => { ], events: [ { - entity_id: 'layerId', + entity_id: '11111', timestamp: 69, key: 'campaign_activated', uuid: 'uuid', @@ -125,6 +127,9 @@ describe('makeEventBatch', () => { }) it('should build a batch with simlge impression event when experiment and variation are not defined', () => { + // When campaign_id, experiment_id, and variation_id are all + // missing/invalid, the normalized wire output is campaign_id=null, + // variation_id=null, and entity_id mirrors campaign_id byte-for-byte. const impressionEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -183,7 +188,7 @@ describe('makeEventBatch', () => { { campaign_id: null, experiment_id: "", - variation_id: "", + variation_id: null, metadata: { flag_key: 'flagKey1', rule_key: '', @@ -691,17 +696,18 @@ describe('makeEventBatch', () => { attributes: [{ entityId: 'attr1-id', key: 'attr1-key', value: 'attr1-value' }], }, + // Use numeric-string IDs so the happy-path wire output is unchanged. layer: { - id: 'layerId', + id: '11111', }, experiment: { - id: 'expId', + id: '22222', key: 'expKey', }, variation: { - id: 'varId', + id: '33333', key: 'varKey', }, @@ -728,9 +734,9 @@ describe('makeEventBatch', () => { { decisions: [ { - campaign_id: 'layerId', - experiment_id: 'expId', - variation_id: 'varId', + campaign_id: '11111', + experiment_id: '22222', + variation_id: '33333', metadata: { flag_key: 'flagKey1', rule_key: 'expKey', @@ -742,7 +748,7 @@ describe('makeEventBatch', () => { ], events: [ { - entity_id: 'layerId', + entity_id: '11111', timestamp: 69, key: 'campaign_activated', uuid: 'uuid', @@ -809,6 +815,8 @@ describe('makeEventBatch', () => { describe('buildLogEvent', () => { it('should select the correct URL based on the event context region', () => { + // Use numeric-string IDs so normalization is a no-op here; this test + // only covers URL-region behavior. const baseEvent: ImpressionEvent = { type: 'impression', timestamp: 69, @@ -827,14 +835,14 @@ describe('buildLogEvent', () => { attributes: [] }, layer: { - id: 'layerId' + id: '11111' }, experiment: { - id: 'expId', + id: '22222', key: 'expKey' }, variation: { - id: 'varId', + id: '33333', key: 'varKey' }, ruleKey: 'expKey', @@ -868,3 +876,382 @@ describe('buildLogEvent', () => { expect(euResult.url).toBe('https://eu.logx.optimizely.com/v1/events'); }); }); + +/** + * Decision-event ID normalization tests. + * + * Pins the normalization contract for decisions[].campaign_id, + * decisions[].variation_id, and events[].entity_id on impression events: + * + * - campaign_id: non-empty string (opaque IDs allowed); fall back to + * experiment_id when empty/null/missing; emit null when both are + * empty/null. + * - variation_id: non-empty decimal-digit string OR null; any invalid + * input (empty, whitespace, non-numeric) normalizes to null. + * - events[].entity_id (impression only) follows the campaign_id rule + * and must equal decisions[].campaign_id byte-for-byte. + * - Rule applies uniformly across all decision types (experiment, + * feature-test, rollout, holdout) — no per-type branching. + * - Conversion events derive entity_id from event.id and are unchanged. + * - Normalization never drops, fails, or logs. + */ +describe('decision event ID normalization', () => { + const baseContext = { + accountId: 'accountId', + projectId: 'projectId', + clientName: 'node-sdk', + clientVersion: '3.0.0', + revision: 'revision', + botFiltering: true, + anonymizeIP: true, + }; + + const baseUser = { + id: 'userId', + attributes: [], + }; + + const makeImpression = (overrides: { + layerId: string | null; + experimentId: string | null; + variationId: string | null; + ruleType: string; + }): ImpressionEvent => ({ + type: 'impression', + timestamp: 69, + uuid: 'uuid', + context: { ...baseContext }, + user: { ...baseUser, attributes: [] }, + layer: { id: overrides.layerId }, + experiment: { id: overrides.experimentId, key: 'expKey' }, + variation: { id: overrides.variationId, key: 'varKey' }, + ruleKey: 'expKey', + flagKey: 'flagKey1', + ruleType: overrides.ruleType, + enabled: true, + }); + + const getDecision = (event: ImpressionEvent) => + makeEventBatch([event]).visitors[0].snapshots[0].decisions![0]; + + const getSnapshotEvent = (event: ImpressionEvent) => + makeEventBatch([event]).visitors[0].snapshots[0].events[0]; + + // --------------------------------------------------------------------------- + // FR-001 / FR-002: campaign_id normalization + // --------------------------------------------------------------------------- + describe('campaign_id (FR-001 / FR-002)', () => { + it('preserves a valid numeric-string layerId', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('12345'); + }); + + it('preserves a numeric-string layerId with leading zeros', () => { + const decision = getDecision( + makeImpression({ layerId: '00042', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('00042'); + }); + + it('preserves an opaque non-numeric layerId unchanged', () => { + // campaign_id contract is "any non-empty string"; opaque IDs like + // "layer_abc" or "default-12345" pass through unchanged. + const decision = getDecision( + makeImpression({ layerId: 'layer_abc', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('layer_abc'); + }); + + it('preserves a layerId with a negative sign unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '-123', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('-123'); + }); + + it('preserves a decimal-formatted layerId unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '123.45', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('123.45'); + }); + + it('preserves an exponential-notation layerId unchanged', () => { + const decision = getDecision( + makeImpression({ layerId: '1e5', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('1e5'); + }); + + it('preserves a whitespace-only layerId unchanged', () => { + // Whitespace is a non-empty string; only empty string, null, and + // undefined trigger the experiment_id fallback. + const decision = getDecision( + makeImpression({ layerId: ' ', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe(' '); + }); + + it('substitutes experiment_id when layerId is null', () => { + const decision = getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it('substitutes experiment_id when layerId is an empty string', () => { + const decision = getDecision( + makeImpression({ layerId: '', experimentId: '67890', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it('substitutes an opaque experiment_id when layerId is null', () => { + // experiment_id fallback also accepts any non-empty string. + const decision = getDecision( + makeImpression({ layerId: null, experimentId: 'exp_42', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBe('exp_42'); + }); + + it('emits null when both layerId and experiment_id are null', () => { + const decision = getDecision( + makeImpression({ layerId: null, experimentId: null, variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBeNull(); + }); + + it('emits null when both layerId and experiment_id are empty strings', () => { + const decision = getDecision( + makeImpression({ layerId: '', experimentId: '', variationId: '111', ruleType: 'experiment' }) + ); + expect(decision.campaign_id).toBeNull(); + }); + }); + + // --------------------------------------------------------------------------- + // FR-003 / FR-004: variation_id normalization + // --------------------------------------------------------------------------- + describe('variation_id (FR-003 / FR-004)', () => { + it('preserves a valid numeric-string variationId', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '99999', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBe('99999'); + }); + + it('preserves a numeric-string variationId with leading zeros', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '00007', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBe('00007'); + }); + + it('normalizes null variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: null, ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes empty-string variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes whitespace variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: ' ', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes non-numeric variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: 'variation_a', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes negative numeric variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '-1', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + + it('normalizes decimal variationId to null', () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: '1.5', ruleType: 'experiment' }) + ); + expect(decision.variation_id).toBeNull(); + }); + }); + + // --------------------------------------------------------------------------- + // FR-005: Uniform application across all decision types + // --------------------------------------------------------------------------- + describe('uniform application across decision types (FR-005)', () => { + const ruleTypes = ['experiment', 'feature-test', 'rollout', 'holdout']; + + ruleTypes.forEach((ruleType) => { + it(`normalizes campaign_id identically for ruleType=${ruleType}`, () => { + // null layerId triggers fallback to experiment_id; the fallback + // fires identically regardless of rule type. + const decision = getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType }) + ); + expect(decision.campaign_id).toBe('67890'); + }); + + it(`normalizes variation_id identically for ruleType=${ruleType}`, () => { + const decision = getDecision( + makeImpression({ layerId: '12345', experimentId: '67890', variationId: 'bad', ruleType }) + ); + expect(decision.variation_id).toBeNull(); + }); + }); + + it('produces byte-equivalent campaign_id for the same invalid input across all rule types', () => { + const outputs = ruleTypes.map((ruleType) => + getDecision( + makeImpression({ layerId: null, experimentId: '67890', variationId: '111', ruleType }) + ).campaign_id + ); + expect(new Set(outputs).size).toBe(1); + expect(outputs[0]).toBe('67890'); + }); + }); + + // --------------------------------------------------------------------------- + // FR-006: Never drop, defer, or fail event dispatch + // --------------------------------------------------------------------------- + describe('event dispatch resilience (FR-006)', () => { + it('does not throw on all-invalid inputs', () => { + expect(() => + makeEventBatch([ + makeImpression({ layerId: null, experimentId: null, variationId: null, ruleType: 'holdout' }), + ]) + ).not.toThrow(); + }); + + it('still produces a single visitor + snapshot when ids are invalid', () => { + const batch = makeEventBatch([ + makeImpression({ layerId: null, experimentId: null, variationId: null, ruleType: 'rollout' }), + ]); + expect(batch.visitors).toHaveLength(1); + expect(batch.visitors[0].snapshots).toHaveLength(1); + expect(batch.visitors[0].snapshots[0].decisions).toHaveLength(1); + expect(batch.visitors[0].snapshots[0].events).toHaveLength(1); + }); + }); + + // --------------------------------------------------------------------------- + // FR-007: Normalization path must not log + // --------------------------------------------------------------------------- + describe('silent normalization (FR-007)', () => { + it('does not write to console.warn or console.error on invalid inputs', () => { + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => undefined); + const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => undefined); + try { + makeEventBatch([ + makeImpression({ layerId: 'abc', experimentId: 'def', variationId: 'ghi', ruleType: 'experiment' }), + ]); + expect(warnSpy).not.toHaveBeenCalled(); + expect(errorSpy).not.toHaveBeenCalled(); + } finally { + warnSpy.mockRestore(); + errorSpy.mockRestore(); + } + }); + }); + + // --------------------------------------------------------------------------- + // FR-008: Cross-SDK byte-equivalent wire output for the same input + // --------------------------------------------------------------------------- + describe('byte-equivalent output (FR-008)', () => { + it('produces identical JSON for two identical event inputs', () => { + // layerId here is a valid non-empty string (passes through); the + // variationId is non-numeric and normalizes to null. + const e1 = makeImpression({ + layerId: 'layer_abc', + experimentId: '67890', + variationId: 'bad', + ruleType: 'experiment', + }); + const e2 = makeImpression({ + layerId: 'layer_abc', + experimentId: '67890', + variationId: 'bad', + ruleType: 'experiment', + }); + const out1 = JSON.stringify(makeEventBatch([e1])); + const out2 = JSON.stringify(makeEventBatch([e2])); + expect(out1).toBe(out2); + }); + }); + + // --------------------------------------------------------------------------- + // FR-009: entity_id on impression events equals campaign_id byte-for-byte + // --------------------------------------------------------------------------- + describe('impression entity_id equals campaign_id byte-for-byte (FR-009)', () => { + const cases: Array<{ + name: string; + layerId: string | null; + experimentId: string | null; + }> = [ + { name: 'valid numeric layerId', layerId: '12345', experimentId: '67890' }, + { name: 'opaque non-numeric layerId preserved', layerId: 'layer_abc', experimentId: '67890' }, + { name: 'empty-string layerId falls back to experiment_id', layerId: '', experimentId: '67890' }, + { name: 'null layerId falls back to experiment_id', layerId: null, experimentId: '67890' }, + { name: 'both empty/null -> null', layerId: '', experimentId: '' }, + { name: 'both null -> null', layerId: null, experimentId: null }, + { name: 'layerId leading zeros preserved', layerId: '00099', experimentId: '67890' }, + ]; + + cases.forEach(({ name, layerId, experimentId }) => { + it(`entity_id === campaign_id (${name})`, () => { + const event = makeImpression({ layerId, experimentId, variationId: '111', ruleType: 'experiment' }); + const decision = getDecision(event); + const snapshotEvent = getSnapshotEvent(event); + expect(snapshotEvent.entity_id).toBe(decision.campaign_id); + }); + }); + }); + + // --------------------------------------------------------------------------- + // FR-010: Conversion events derive entity_id from a different source + // --------------------------------------------------------------------------- + describe('conversion entity_id is not normalized (FR-010)', () => { + const makeConversion = (eventId: string | null): ConversionEvent => ({ + type: 'conversion', + timestamp: 69, + uuid: 'uuid', + context: { ...baseContext }, + user: { ...baseUser, attributes: [] }, + event: { id: eventId, key: 'event-key' }, + tags: undefined, + revenue: null, + value: null, + }); + + it('passes through a non-numeric conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion('event-id-string')]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBe('event-id-string'); + }); + + it('passes through null conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion(null)]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBeNull(); + }); + + it('passes through a numeric conversion event id unchanged', () => { + const batch = makeEventBatch([makeConversion('42')]); + expect(batch.visitors[0].snapshots[0].events[0].entity_id).toBe('42'); + }); + }); +}); diff --git a/lib/event_processor/event_builder/log_event.ts b/lib/event_processor/event_builder/log_event.ts index 1d13bb5fb..8d63e421a 100644 --- a/lib/event_processor/event_builder/log_event.ts +++ b/lib/event_processor/event_builder/log_event.ts @@ -1,5 +1,5 @@ /** - * Copyright 2021-2022, 2024, Optimizely + * Copyright 2021-2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,17 +160,23 @@ function makeConversionSnapshot(conversion: ConversionEvent): Snapshot { } } +function normalizeVariationId(id: string | null | undefined): string | null { + return id && /^[0-9]+$/.test(id) ? id : null +} + function makeDecisionSnapshot(event: ImpressionEvent): Snapshot { const { layer, experiment, variation, ruleKey, flagKey, ruleType, enabled, cmabUuid } = event - const layerId = layer ? layer.id : null - const experimentId = experiment?.id ?? '' - const variationId = variation?.id ?? '' + const layerId = layer?.id; + const experimentId = experiment?.id ?? ''; + const variationId = normalizeVariationId(variation?.id); const variationKey = variation ? variation.key : '' + const campaignId = layerId || experimentId || null; + return { decisions: [ { - campaign_id: layerId, + campaign_id: campaignId, experiment_id: experimentId, variation_id: variationId, metadata: { @@ -185,7 +191,7 @@ function makeDecisionSnapshot(event: ImpressionEvent): Snapshot { ], events: [ { - entity_id: layerId, + entity_id: campaignId, timestamp: event.timestamp, key: ACTIVATE_EVENT_KEY, uuid: event.uuid, diff --git a/lib/optimizely/index.tests.js b/lib/optimizely/index.tests.js index 437749cfb..50eba745a 100644 --- a/lib/optimizely/index.tests.js +++ b/lib/optimizely/index.tests.js @@ -1,5 +1,5 @@ /** - * Copyright 2016-2025, Optimizely + * Copyright 2016-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -6690,7 +6690,7 @@ describe('lib/optimizely', function() { { campaign_id: null, experiment_id: '', - variation_id: '', + variation_id: null, metadata: { flag_key: 'test_feature', rule_key: '', From 9884d73096f83654ec3f0a63478fd7cc0041d9b5 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Tue, 7 Jul 2026 21:38:19 +0600 Subject: [PATCH 12/39] [FSSDK-12865] url parse fix (#1161) --- lib/message/error_message.ts | 1 + .../request_handler.node.spec.ts | 12 ++++++++++++ .../request_handler.node.ts | 19 +++++++++++++------ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/lib/message/error_message.ts b/lib/message/error_message.ts index 83059f93f..20433e153 100644 --- a/lib/message/error_message.ts +++ b/lib/message/error_message.ts @@ -87,6 +87,7 @@ export const OUT_OF_BOUNDS = export const REQUEST_TIMEOUT = 'Request timeout'; export const REQUEST_ERROR = 'Request error'; export const NO_STATUS_CODE_IN_RESPONSE = 'No status code in response'; +export const INVALID_REQUEST_URL = 'Invalid request URL: %s'; export const UNSUPPORTED_PROTOCOL = 'Unsupported protocol: %s'; export const RETRY_CANCELLED = 'Retry cancelled'; export const ONLY_POST_REQUESTS_ARE_SUPPORTED = 'Only POST requests are supported'; diff --git a/lib/utils/http_request_handler/request_handler.node.spec.ts b/lib/utils/http_request_handler/request_handler.node.spec.ts index 8f5b62806..b982c5ec5 100644 --- a/lib/utils/http_request_handler/request_handler.node.spec.ts +++ b/lib/utils/http_request_handler/request_handler.node.spec.ts @@ -21,6 +21,8 @@ import nock from 'nock'; import zlib from 'zlib'; import { NodeRequestHandler } from './request_handler.node'; import { getMockLogger } from '../../tests/mock/mock_logger'; +import { OptimizelyError } from '../../error/optimizly_error'; +import { INVALID_REQUEST_URL } from 'error_message'; beforeAll(() => { nock.disableNetConnect(); @@ -173,6 +175,16 @@ describe('NodeRequestHandler', () => { await expect(request.responsePromise).rejects.toThrow(); }); + it('should return a rejected response promise when the URL is malformed', async () => { + const malformedUrl = 'not a valid url'; + const request = nodeRequestHandler.makeRequest(malformedUrl, {}, 'get'); + + const error = await request.responsePromise.catch((e) => e); + expect(error).toBeInstanceOf(OptimizelyError); + expect(error.baseMessage).toBe(INVALID_REQUEST_URL); + expect(error.params).toEqual([malformedUrl]); + }); + it('should return a rejected promise when there is a request error', async () => { const scope = nock(host) .get(path) diff --git a/lib/utils/http_request_handler/request_handler.node.ts b/lib/utils/http_request_handler/request_handler.node.ts index 1c7ef4435..51202ca13 100644 --- a/lib/utils/http_request_handler/request_handler.node.ts +++ b/lib/utils/http_request_handler/request_handler.node.ts @@ -15,12 +15,11 @@ */ import http from 'http'; import https from 'https'; -import url from 'url'; import { AbortableRequest, Headers, RequestHandler, Response } from './http'; import decompressResponse from 'decompress-response'; import { LoggerFacade } from '../../logging/logger'; import { REQUEST_TIMEOUT_MS } from '../enums'; -import { NO_STATUS_CODE_IN_RESPONSE, REQUEST_ERROR, REQUEST_TIMEOUT, UNSUPPORTED_PROTOCOL } from 'error_message'; +import { INVALID_REQUEST_URL, NO_STATUS_CODE_IN_RESPONSE, REQUEST_ERROR, REQUEST_TIMEOUT, UNSUPPORTED_PROTOCOL } from 'error_message'; import { OptimizelyError } from '../../error/optimizly_error'; import { Platform } from '../../platform_support'; /** @@ -46,7 +45,15 @@ export class NodeRequestHandler implements RequestHandler { * @returns AbortableRequest contains both the response Promise and capability to abort() */ makeRequest(requestUrl: string, headers: Headers, method: string, data?: string): AbortableRequest { - const parsedUrl = url.parse(requestUrl); + let parsedUrl: URL; + try { + parsedUrl = new URL(requestUrl); + } catch { + return { + responsePromise: Promise.reject(new OptimizelyError(INVALID_REQUEST_URL, requestUrl)), + abort: () => {}, + }; + } if (parsedUrl.protocol !== 'https:' && parsedUrl.protocol !== 'http:') { return { @@ -79,11 +86,11 @@ export class NodeRequestHandler implements RequestHandler { * @private * @returns http.RequestOptions Standard request options dictionary compatible with both http and https */ - private getRequestOptionsFromUrl(url: url.UrlWithStringQuery): http.RequestOptions { + private getRequestOptionsFromUrl(url: URL): http.RequestOptions { return { hostname: url.hostname, - path: url.path, - port: url.port, + path: url.pathname + url.search, + port: url.port || null, protocol: url.protocol, }; } From e3ba148ad425dbda6a22fed8bb6bee31ba4d231a Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Tue, 7 Jul 2026 21:46:49 +0600 Subject: [PATCH 13/39] [FSSDK-12879] Remove Karma testing infrastructure (#1162) * Remove Karma testing infrastructure Karma config files, scripts, and devDependencies are no longer used. Remove them along with the README reference. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 22 +- karma.base.conf.js | 136 ---- karma.bs.conf.js | 34 - karma.local_chrome.bs.conf.js | 29 - karma.local_chrome.umd.conf.js | 30 - karma.umd.conf.js | 35 - package-lock.json | 1350 ++------------------------------ package.json | 12 +- 8 files changed, 66 insertions(+), 1582 deletions(-) delete mode 100644 karma.base.conf.js delete mode 100644 karma.bs.conf.js delete mode 100644 karma.local_chrome.bs.conf.js delete mode 100644 karma.local_chrome.umd.conf.js delete mode 100644 karma.umd.conf.js diff --git a/README.md b/README.md index 3e22b28e3..3c81208af 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ This system is enforced at build time through ESLint rules and validation script ### Unit Tests -There is a mix of testing paradigms used within the JavaScript SDK which include Mocha, Chai, Karma, and Vitest, indicated by their respective `*.tests.js` and `*.spec.ts` filenames. +There is a mix of testing paradigms used within the JavaScript SDK which include Mocha, Chai, and Vitest, indicated by their respective `*.tests.js` and `*.spec.ts` filenames. When contributing code to the SDK, aim to keep the percentage of code test coverage at the current level ([![Coveralls](https://img.shields.io/coveralls/optimizely/javascript-sdk.svg)](https://coveralls.io/github/optimizely/javascript-sdk)) or above. @@ -231,8 +231,8 @@ To run unit tests, you can take the following steps: 2. Run `npm test` to run all test files. 3. Run `npm run test-vitest` to run only tests written using Vitest. 4. Run `npm run test-mocha` to run only tests written using Mocha. -4. (For cross-browser testing) Run `npm run test-xbrowser` to run tests in many browsers via BrowserStack. -5. Resolve any tests that fail before continuing with your contribution. +5. (For cross-browser testing) Run `npm run test-browser-browserstack` to run browser tests via BrowserStack, or `npm run test-browser-local` to run them locally. +6. Resolve any tests that fail before continuing with your contribution. This information is relevant only if you plan on contributing to the SDK itself. @@ -243,14 +243,20 @@ npm install # Run unit tests. npm test -# Run unit tests in many browsers, currently via BrowserStack. +# Run browser tests locally. +npm run test-browser-local + +# Run browser tests via BrowserStack. # For this to work, the following environment variables must be set: -# - BROWSER_STACK_USERNAME -# - BROWSER_STACK_PASSWORD -npm run test-xbrowser +# - BROWSERSTACK_USERNAME +# - BROWSERSTACK_ACCESS_KEY +npm run test-browser-browserstack + +# Run UMD bundle tests via BrowserStack. +npm run test-umd-browserstack ``` -[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSER_STACK_USERNAME` and `BROWSER_STACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-xbrowser`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/). +[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-browser-browserstack`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/). ### Contributing diff --git a/karma.base.conf.js b/karma.base.conf.js deleted file mode 100644 index 9691083ef..000000000 --- a/karma.base.conf.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright 2018, 2020, 2022 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Karma base configuration -module.exports = { - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: '', - - //plugins - plugins: ['karma-mocha', 'karma-webpack', require('karma-browserstack-launcher')], - - webpack: { - mode: 'production', - module: { - rules: [ - { - test: /\.[tj]s$/, - use: 'ts-loader', - exclude: /node_modules/, - }, - ], - }, - resolve: { - extensions: ['.ts', '.js'], - }, - }, - - //browserStack setup - browserStack: { - username: process.env.BROWSER_STACK_USERNAME, - accessKey: process.env.BROWSER_STACK_ACCESS_KEY, - }, - - // to avoid DISCONNECTED messages when connecting to BrowserStack - browserDisconnectTimeout: 10000, // default 2000 - browserDisconnectTolerance: 1, // default 0 - browserNoActivityTimeout: 4 * 60 * 1000, //default 10000 - captureTimeout: 4 * 60 * 1000, //default 60000 - - // define browsers - customLaunchers: { - bs_chrome_mac: { - base: 'BrowserStack', - os: 'OS X', - os_version: 'Mojave', - browserName: 'Chrome', - browser_version: '102.0', - browser: 'Chrome', - }, - bs_edge: { - base: 'BrowserStack', - os: 'Windows', - os_version: '10', - browserName: 'Edge', - browser_version: '84.0', - browser: 'Edge', - }, - bs_firefox: { - base: 'BrowserStack', - os: 'Windows', - browser: 'Firefox', - os_version: '10', - browserName: 'Firefox', - browser_version: '91.0', - }, - - bs_opera_mac: { - base: 'BrowserStack', - browser: 'Opera', - os_version: 'Mojave', - browserName: 'Opera', - browser: 'Opera', - browser_version: '76.0', - os: 'OS X', - }, - bs_safari: { - base: 'BrowserStack', - os: 'OS X', - os_version: 'Catalina', - browserName: 'Safari', - browser_version: '13.0', - browser: 'Safari', - device: null, - }, - }, - - browsers: ['bs_chrome_mac', 'bs_edge', 'bs_firefox', 'bs_opera_mac', 'bs_safari'], - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'], - - // list of files to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - './lib/**/*tests.js': ['webpack'], - }, - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity, -}; diff --git a/karma.bs.conf.js b/karma.bs.conf.js deleted file mode 100644 index 7b7ce8cbb..000000000 --- a/karma.bs.conf.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright 2018, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Karma configuration for cross-browser testing -const baseConfig = require('./karma.base.conf.js'); - -module.exports = function(config) { - config.set({ - ...baseConfig, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // list of files / patterns to load in the browser - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './lib/index.browser.tests.js' - ], - }); -}; diff --git a/karma.local_chrome.bs.conf.js b/karma.local_chrome.bs.conf.js deleted file mode 100644 index 7b6fc0b8a..000000000 --- a/karma.local_chrome.bs.conf.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright 2021 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const baseConfig = require('./karma.base.conf'); - -module.exports = function(config) { - config.set({ - ...baseConfig, - plugins: ['karma-mocha', 'karma-webpack', 'karma-chrome-launcher'], - browserStack: null, - browsers: ['Chrome'], - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './lib/index.browser.tests.js' - ], - }); -} diff --git a/karma.local_chrome.umd.conf.js b/karma.local_chrome.umd.conf.js deleted file mode 100644 index 9c5da74c2..000000000 --- a/karma.local_chrome.umd.conf.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Copyright 2021 Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const baseConfig = require('./karma.base.conf'); - -module.exports = function(config) { - config.set({ - ...baseConfig, - plugins: ['karma-mocha', 'karma-webpack', 'karma-chrome-launcher'], - browserStack: null, - browsers: ['Chrome'], - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './dist/optimizely.browser.umd.min.js', - './lib/index.browser.umdtests.js' - ], - }); -} diff --git a/karma.umd.conf.js b/karma.umd.conf.js deleted file mode 100644 index 51d621238..000000000 --- a/karma.umd.conf.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Copyright 2018, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Karma configuration for UMD bundle testing -const baseConfig = require('./karma.base.conf.js'); - -module.exports = function(config) { - config.set({ - ...baseConfig, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // list of files / patterns to load in the browser - files: [ - './node_modules/promise-polyfill/dist/polyfill.min.js', - './dist/optimizely.browser.umd.min.js', - './lib/index.browser.umdtests.js' - ], - }); -}; diff --git a/package-lock.json b/package-lock.json index e58033959..ec9915af4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "@vitest/browser": "3.2.4", + "browserstack-local": "^1.5.13", "chai": "^4.2.0", "coveralls-next": "^5.0.0", "eslint": "^8.21.0", @@ -37,12 +38,6 @@ "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", "jiti": "^2.4.1", - "karma": "^6.4.0", - "karma-browserstack-launcher": "^1.5.1", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.1.1", - "karma-mocha": "^2.0.1", - "karma-webpack": "^5.0.1", "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", @@ -623,16 +618,6 @@ "node": ">=6.9.0" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.1.90" - } - }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -2601,13 +2586,6 @@ "dev": true, "license": "(Unlicense OR Apache-2.0)" }, - "node_modules/@socket.io/component-emitter": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", - "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==", - "dev": true, - "license": "MIT" - }, "node_modules/@testing-library/dom": { "version": "10.4.1", "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", @@ -2736,16 +2714,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/cors": { - "version": "2.8.19", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.19.tgz", - "integrity": "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/deep-eql": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", @@ -3816,6 +3784,7 @@ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -3877,7 +3846,6 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dev": true, - "license": "MIT", "dependencies": { "debug": "4" }, @@ -4494,16 +4462,6 @@ ], "license": "MIT" }, - "node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^4.5.0 || >= 5.9" - } - }, "node_modules/baseline-browser-mapping": { "version": "2.9.14", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz", @@ -4537,48 +4495,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/body-parser": { - "version": "1.20.4", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.4.tgz", - "integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.14.0", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true, - "license": "MIT" - }, "node_modules/boolbase": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", @@ -4650,42 +4566,16 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/browserstack": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.5.3.tgz", - "integrity": "sha512-AO+mECXsW4QcqC9bxwM29O7qWa7bJT94uBFzeb5brylIQwawuEziwq20dPYbins95GlWzOawgyDNdjYAo32EKg==", - "dev": true, - "license": "MIT", - "dependencies": { - "https-proxy-agent": "^2.2.1" - } - }, "node_modules/browserstack-local": { - "version": "1.5.8", - "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.5.8.tgz", - "integrity": "sha512-8p8APDD7bY8E806pZBratRQmd9quqB8o3jiOqxVHWTiYGAW5ePMqFDKbZaedUkFM52Dnfl5Gxviz2bHXiiV3DQ==", + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.5.13.tgz", + "integrity": "sha512-7helY+Ms3ss4BtIQZTIyshdAFZSvS9A7ZpEB9stRaobeZ9BM1BkJFTuMakQNTOj78llv0+/qDI5Ak+bkGWV1xg==", "dev": true, - "license": "MIT", "dependencies": { "agent-base": "^6.0.2", "https-proxy-agent": "^5.0.1", "is-running": "^2.1.0", - "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9" - } - }, - "node_modules/browserstack-local/node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" + "tree-kill": "^1.2.2" } }, "node_modules/bser": { @@ -4741,16 +4631,6 @@ "dev": true, "license": "MIT" }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -4777,37 +4657,6 @@ "node": ">=8" } }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -5167,6 +5016,7 @@ "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "finalhandler": "1.1.2", @@ -5183,6 +5033,7 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -5192,17 +5043,8 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT" - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.6" - } + "peer": true }, "node_modules/convert-source-map": { "version": "1.9.0", @@ -5211,16 +5053,6 @@ "dev": true, "license": "MIT" }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -5228,20 +5060,6 @@ "dev": true, "license": "MIT" }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/coveralls-next": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/coveralls-next/-/coveralls-next-5.0.0.tgz", @@ -5352,13 +5170,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", - "dev": true, - "license": "MIT" - }, "node_modules/data-uri-to-buffer": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", @@ -5369,16 +5180,6 @@ "node": ">= 14" } }, - "node_modules/date-format": { - "version": "4.0.14", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", - "integrity": "sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -5499,6 +5300,7 @@ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -5519,18 +5321,12 @@ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==", - "dev": true, - "license": "MIT" - }, "node_modules/diff": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", @@ -5574,19 +5370,6 @@ "dev": true, "license": "MIT" }, - "node_modules/dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha512-Yra4DbvoW7/Z6LBN560ZwXMjoNOSAN2wRsKFGc4iBeso+mpIA6qj1vfdf9HpMaKAqG6wXTy+1SYEzmNpKXOSsQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" - } - }, "node_modules/dom-serializer": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", @@ -5646,28 +5429,6 @@ "url": "https://github.com/fb55/domutils?sponsor=1" } }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true, - "license": "MIT" - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -5784,7 +5545,8 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/electron-to-chromium": { "version": "1.5.267", @@ -5806,6 +5568,7 @@ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -5847,59 +5610,6 @@ "once": "^1.4.0" } }, - "node_modules/engine.io": { - "version": "6.6.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.5.tgz", - "integrity": "sha512-2RZdgEbXmp5+dVbRm0P7HQUImZpICccJy7rN7Tv+SFa55pH+lxnuw6/K1ZxxBfHoYpSkHLAO92oa8O4SwFXA2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.7.2", - "cors": "~2.8.5", - "debug": "~4.4.1", - "engine.io-parser": "~5.2.1", - "ws": "~8.18.3" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/engine.io-parser": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.3.tgz", - "integrity": "sha512-HqD3yTBfnBxIrbnM1DoD6Pcq8NECnh8d4As1Qgh0z5Gg3jRRIqijury0CL3ghu/edArpUYiYqQiDUQBIs4np3Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/engine.io/node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/enhanced-resolve": { "version": "5.18.4", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz", @@ -5914,22 +5624,6 @@ "node": ">=10.13.0" } }, - "node_modules/ent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.2.tgz", - "integrity": "sha512-kKvD1tO6BM+oK9HzCPpUdRb4vKFQY/FPTFmurMvh6LlN68VMrdj77w8yp51/kDbpkFOS9J8w5W6zIzgM2H8/hw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.3", - "es-errors": "^1.3.0", - "punycode": "^1.4.1", - "safe-regex-test": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -5954,26 +5648,6 @@ "stackframe": "^1.3.4" } }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es-module-lexer": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", @@ -5981,19 +5655,6 @@ "dev": true, "license": "MIT" }, - "node_modules/es-object-atoms": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", - "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -6001,23 +5662,6 @@ "dev": true, "license": "MIT" }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true, - "license": "MIT" - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "es6-promise": "^4.0.3" - } - }, "node_modules/esbuild": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", @@ -6075,7 +5719,8 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -6418,22 +6063,6 @@ "node": ">= 0.6" } }, - "node_modules/event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" - } - }, "node_modules/event-target-shim": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", @@ -6444,13 +6073,6 @@ "node": ">=6" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "dev": true, - "license": "MIT" - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -6489,13 +6111,6 @@ "license": "Apache-2.0", "peer": true }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true, - "license": "MIT" - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -6713,6 +6328,7 @@ "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -6732,6 +6348,7 @@ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ms": "2.0.0" } @@ -6741,7 +6358,8 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/finalhandler/node_modules/on-finished": { "version": "2.3.0", @@ -6749,6 +6367,7 @@ "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -6831,27 +6450,6 @@ "license": "MIT", "peer": true }, - "node_modules/follow-redirects": { - "version": "1.15.11", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", - "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "license": "MIT", - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, "node_modules/foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -6888,13 +6486,6 @@ "node": ">= 0.6" } }, - "node_modules/from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", - "dev": true, - "license": "MIT" - }, "node_modules/fromentries": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", @@ -6916,34 +6507,6 @@ ], "license": "MIT" }, - "node_modules/fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha512-05cXDIwNbFaoFWaz5gNHlUTbH5whiss/hr/ibzPd4MH3cR4w0ZKeIPiVdbyJurg3O5r/Bjpvn9KOb1/rPMf3nA==", - "dev": true, - "license": "MIT", - "dependencies": { - "null-check": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" - }, - "engines": { - "node": ">=6 <7 || >=8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -7065,31 +6628,6 @@ "node": "*" } }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -7113,20 +6651,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "dev": true, - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", @@ -7271,19 +6795,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -7349,35 +6860,6 @@ "node": ">=8" } }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasha": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", @@ -7508,6 +6990,7 @@ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", @@ -7529,25 +7012,11 @@ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" - }, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/http-proxy-agent": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", @@ -7573,53 +7042,16 @@ } }, "node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "license": "MIT", - "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - }, - "engines": { - "node": ">= 4.5.0" - } - }, - "node_modules/https-proxy-agent/node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "license": "MIT", - "dependencies": { - "es6-promisify": "^5.0.0" - }, - "engines": { - "node": ">= 4.0.0" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "dev": true, - "license": "MIT", "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "agent-base": "6", + "debug": "4" }, "engines": { - "node": ">=0.10.0" + "node": ">= 6" } }, "node_modules/ieee754": { @@ -7891,31 +7323,11 @@ "@types/estree": "*" } }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-running": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", "integrity": "sha512-mjJd3PujZMl7j+D395WTIO5tU5RIDBfVSRtRR4VOJou3H66E38UjbjvDGh3slJzPuolsb+yQFqwHNNdyp5jg3w==", - "dev": true, - "license": "BSD" + "dev": true }, "node_modules/is-stream": { "version": "2.0.1", @@ -7981,19 +7393,6 @@ "dev": true, "license": "MIT" }, - "node_modules/isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/gjtorikian/" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -8541,16 +7940,6 @@ "node": ">=6" } }, - "node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "license": "MIT", - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -8604,174 +7993,6 @@ "dev": true, "license": "MIT" }, - "node_modules/karma": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.4.tgz", - "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.7.2", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" - }, - "bin": { - "karma": "bin/karma" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/karma-browserstack-launcher": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.6.0.tgz", - "integrity": "sha512-Y/UWPdHZkHIVH2To4GWHCTzmrsB6H7PBWy6pw+TWz5sr4HW2mcE+Uj6qWgoVNxvQU1Pfn5LQQzI6EQ65p8QbiQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "browserstack": "~1.5.1", - "browserstack-local": "^1.3.7", - "q": "~1.5.0" - }, - "peerDependencies": { - "karma": ">=0.9" - } - }, - "node_modules/karma-chai": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", - "integrity": "sha512-mqKCkHwzPMhgTYca10S90aCEX9+HjVjjrBFAsw36Zj7BlQNbokXXCAe6Ji04VUMsxcY5RLP7YphpfO06XOubdg==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "chai": "*", - "karma": ">=0.10.9" - } - }, - "node_modules/karma-chrome-launcher": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", - "dev": true, - "license": "MIT", - "dependencies": { - "fs-access": "^1.0.0", - "which": "^1.2.1" - } - }, - "node_modules/karma-chrome-launcher/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "license": "ISC", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.3" - } - }, - "node_modules/karma-webpack": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/karma-webpack/-/karma-webpack-5.0.1.tgz", - "integrity": "sha512-oo38O+P3W2mSPCSUrQdySSPv1LvPpXP+f+bBimNomS5sW+1V4SuhCuW8TfJzV+rDv921w2fDSDw0xJbPe6U+kQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "glob": "^7.1.3", - "minimatch": "^9.0.3", - "webpack-merge": "^4.1.5" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "webpack": "^5.0.0" - } - }, - "node_modules/karma/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/karma/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/karma/node_modules/ua-parser-js": { - "version": "0.7.41", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.41.tgz", - "integrity": "sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - }, - { - "type": "github", - "url": "https://github.com/sponsors/faisalman" - } - ], - "license": "MIT", - "bin": { - "ua-parser-js": "script/cli.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -9039,23 +8260,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log4js": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", - "integrity": "sha512-1somDdy9sChrr9/f4UlzhdaGfDR2c/SaD2a4T7qEkG4jTS57/B3qmnjLYePwQ8cqWnUHZI0iAKxMBpCZICiZ2g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "date-format": "^4.0.14", - "debug": "^4.3.4", - "flatted": "^3.2.7", - "rfdc": "^1.3.0", - "streamroller": "^3.1.5" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/loglevel": { "version": "1.9.2", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", @@ -9179,12 +8383,6 @@ "tmpl": "1.0.5" } }, - "node_modules/map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==", - "dev": true - }, "node_modules/marky": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/marky/-/marky-1.3.0.tgz", @@ -9193,26 +8391,6 @@ "license": "Apache-2.0", "peer": true }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", @@ -9712,19 +8890,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -9991,6 +9156,7 @@ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -10094,16 +9260,6 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, - "node_modules/null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha512-j8ZNHg19TyIQOWCGeeQJBuu6xZYIEurf8M1Qsfd8mFrGEfIZytbw18YjKWg+LcO25NowXGZXZpKAx+Ui3TFfDw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nullthrows": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", @@ -10302,30 +9458,7 @@ "flow-enums-runtime": "^0.0.6" }, "engines": { - "node": ">=20.19.4" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=20.19.4" } }, "node_modules/on-finished": { @@ -10334,6 +9467,7 @@ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ee-first": "1.1.1" }, @@ -10602,6 +9736,7 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -10705,19 +9840,6 @@ "node": "*" } }, - "node_modules/pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", - "dev": true, - "license": [ - "MIT", - "Apache2" - ], - "dependencies": { - "through": "~2.3" - } - }, "node_modules/pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", @@ -11047,22 +10169,6 @@ "dev": true, "license": "MIT" }, - "node_modules/ps-tree": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "event-stream": "=3.3.4" - }, - "bin": { - "ps-tree": "bin/ps-tree.js" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/pump": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.3.tgz", @@ -11074,51 +10180,6 @@ "once": "^1.3.1" } }, - "node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==", - "deprecated": "You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.\n\n(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" - } - }, - "node_modules/qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.9" - } - }, - "node_modules/qs": { - "version": "6.14.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", - "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", - "dev": true, - "license": "BSD-3-Clause", - "dependencies": { - "side-channel": "^1.1.0" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/query-selector-shadow-dom": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", @@ -11174,26 +10235,11 @@ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } }, - "node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", - "dev": true, - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/react": { "version": "19.2.3", "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", @@ -11540,13 +10586,6 @@ "dev": true, "license": "ISC" }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "dev": true, - "license": "MIT" - }, "node_modules/resolve": { "version": "1.22.11", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", @@ -11616,13 +10655,6 @@ "node": ">=0.10.0" } }, - "node_modules/rfdc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", - "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", - "dev": true, - "license": "MIT" - }, "node_modules/rgb2hex": { "version": "0.2.5", "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.2.5.tgz", @@ -11747,24 +10779,6 @@ ], "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", - "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "is-regex": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/safe-regex2": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.0.0.tgz", @@ -12027,7 +11041,8 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/shebang-command": { "version": "2.0.0", @@ -12066,82 +11081,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/side-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", - "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3", - "side-channel-list": "^1.0.0", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", - "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", - "dev": true, - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -12247,72 +11186,6 @@ "dev": true, "license": "MIT" }, - "node_modules/socket.io": { - "version": "4.8.3", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.3.tgz", - "integrity": "sha512-2Dd78bqzzjE6KPkD5fHZmDAKRNe3J15q+YHDrIsy9WEkqttc7GY+kT9OBLSMaPbQaEd0x1BjcmtMtXkfpc+T5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "cors": "~2.8.5", - "debug": "~4.4.1", - "engine.io": "~6.6.0", - "socket.io-adapter": "~2.5.2", - "socket.io-parser": "~4.2.4" - }, - "engines": { - "node": ">=10.2.0" - } - }, - "node_modules/socket.io-adapter": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.5.6.tgz", - "integrity": "sha512-DkkO/dz7MGln0dHn5bmN3pPy+JmywNICWrJqVWiVOyvXjWQFIv9c2h24JrQLLFJ2aQVQf/Cvl1vblnd4r2apLQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "~4.4.1", - "ws": "~8.18.3" - } - }, - "node_modules/socket.io-adapter/node_modules/ws": { - "version": "8.18.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", - "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/socket.io-parser": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.5.tgz", - "integrity": "sha512-bPMmpy/5WWKHea5Y/jYAP6k74A+hvmRCQaJuJB6I/ML5JZq/KfNieUVo/3Mh7SAqn7TyFdIo6wqYHInG1MU1bQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@socket.io/component-emitter": "~3.1.0", - "debug": "~4.4.1" - }, - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/socks": { "version": "2.8.7", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", @@ -12419,19 +11292,6 @@ "node": ">=8" } }, - "node_modules/split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", - "dev": true, - "license": "MIT", - "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" - } - }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -12520,6 +11380,7 @@ "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.6" } @@ -12531,31 +11392,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", - "dev": true, - "license": "MIT", - "dependencies": { - "duplexer": "~0.1.1" - } - }, - "node_modules/streamroller": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.1.5.tgz", - "integrity": "sha512-KFxaM7XT+irxvdqSP1LGLgNWbYN7ay5owZ3r/8t77p+EtSUAfUgtl7be3xtqtOmGUl9K9YPO2ca8133RlTjvKw==", - "dev": true, - "license": "MIT", - "dependencies": { - "date-format": "^4.0.14", - "debug": "^4.3.4", - "fs-extra": "^8.1.0" - }, - "engines": { - "node": ">=8.0" - } - }, "node_modules/streamx": { "version": "2.23.0", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", @@ -12759,33 +11595,6 @@ "streamx": "^2.15.0" } }, - "node_modules/temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha512-WfecDCR1xC9b0nsrzSaxPf3ZuWeWLUWblW4vlDQAa1biQaKHiImHnJfeQocQe/hXKMcolRzgkcVX/7kK4zoWbw==", - "dev": true, - "license": "MIT", - "dependencies": { - "rimraf": "~2.5.2" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/temp-fs/node_modules/rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha512-Lw7SHMjssciQb/rRz7JyPIy9+bbUshEucPoLRvWqy09vC5zQixl8Uet+Zl+SROBB/JMWHJRdCk1qdxNWHNMvlQ==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "glob": "^7.0.5" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/terser": { "version": "5.44.1", "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz", @@ -12950,13 +11759,6 @@ "license": "MIT", "peer": true }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", - "dev": true, - "license": "MIT" - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -13018,16 +11820,6 @@ "node": ">=14.0.0" } }, - "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14.14" - } - }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -13055,6 +11847,7 @@ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.6" } @@ -13069,6 +11862,15 @@ "node": ">=6" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/ts-loader": { "version": "9.5.4", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.4.tgz", @@ -13244,20 +12046,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -13299,22 +12087,13 @@ "dev": true, "license": "MIT" }, - "node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8" } @@ -13400,6 +12179,7 @@ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.4.0" } @@ -13422,16 +12202,6 @@ "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", "dev": true }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/vite": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.1.tgz", @@ -13679,16 +12449,6 @@ "license": "MIT", "peer": true }, - "node_modules/void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/wait-port": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz", @@ -13969,16 +12729,6 @@ } } }, - "node_modules/webpack-merge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", - "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.15" - } - }, "node_modules/webpack-sources": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.3.3.tgz", diff --git a/package.json b/package.json index 70a798480..cbc2eebe8 100644 --- a/package.json +++ b/package.json @@ -70,10 +70,7 @@ "test-mocha": "mocha -r lib/tests/uuid_cjs_shim.js -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", "test": "npm run test-mocha && npm run test-vitest", "posttest": "npm run lint", - "test-ci": "npm run test-xbrowser && npm run test-umdbrowser", - "test-xbrowser": "karma start karma.bs.conf.js --single-run", - "test-umdbrowser": "npm run build-browser-umd && karma start karma.umd.conf.js --single-run", - "test-karma-local": "karma start karma.local_chrome.bs.conf.js && npm run build-browser-umd && karma start karma.local_chrome.umd.conf.js", + "test-ci": "npm run test", "prebuild": "npm run clean", "build": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && cp dist/index.browser.d.ts dist/index.d.ts", "build:win": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && copy dist\\index.browser.d.ts dist\\index.d.ts", @@ -121,6 +118,7 @@ "@typescript-eslint/eslint-plugin": "^5.33.0", "@typescript-eslint/parser": "^5.33.0", "@vitest/browser": "3.2.4", + "browserstack-local": "^1.5.13", "chai": "^4.2.0", "coveralls-next": "^5.0.0", "eslint": "^8.21.0", @@ -129,12 +127,6 @@ "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", "jiti": "^2.4.1", - "karma": "^6.4.0", - "karma-browserstack-launcher": "^1.5.1", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.1.1", - "karma-mocha": "^2.0.1", - "karma-webpack": "^5.0.1", "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", From ccaf38ba15981b03a04ad5f1510a610f4e5ef544 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Jul 2026 21:24:45 +0600 Subject: [PATCH 14/39] [FSSDK-12880] Refactor project config creation (#1164) * [FSSDK-12880] Refactor project config creation - Simplify createProjectConfig to accept a datafile string directly instead of string | object, inlining datafile validation - Remove the separate config_validator module and its tests - Break monolithic config builder into focused parse functions: parseAudienceConfig, parseAttributeConfig, parseGroupConfig, parseRolloutConfig, parseIntegrationConfig, parseExperimentConfig, parseFeatureFlagConfig - Eliminate mutation-safe datafile copy in favor of direct construction - Refactor redundant iterations over experiments and feature flags - Remove lodash dev dependency Benchmarks show ~10% faster config parsing for 3-4 MB datafiles. Removing createMutationSafeDatafileCopy also fixes a memory issue where it allocated ~4x the datafile size in shallow copies per call, causing OOM under repeated parsing of large datafiles. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/core/bucketer/index.spec.ts | 12 +- lib/core/bucketer/index.tests.js | 10 +- lib/core/decision_service/index.spec.ts | 146 +++---- lib/core/decision_service/index.tests.js | 16 +- .../event_builder/user_event.spec.ts | 4 +- lib/index.browser.tests.js | 17 +- lib/index.browser.umdtests.js | 5 - lib/index.node.tests.js | 13 +- lib/index.react_native.spec.ts | 5 +- lib/optimizely/index.spec.ts | 16 +- lib/optimizely/index.tests.js | 56 +-- lib/optimizely_user_context/index.spec.ts | 2 +- lib/optimizely_user_context/index.tests.js | 10 +- lib/project_config/optimizely_config.spec.ts | 11 +- lib/project_config/optimizely_config.tests.js | 11 +- lib/project_config/project_config.spec.ts | 166 ++++---- lib/project_config/project_config.tests.js | 78 ++-- lib/project_config/project_config.ts | 360 ++++++++---------- .../project_config_manager.spec.ts | 142 ++++--- lib/project_config/project_config_manager.ts | 11 +- lib/tests/mock/mock_datafile_manager.ts | 12 +- lib/utils/config_validator/index.spec.ts | 65 ---- lib/utils/config_validator/index.tests.js | 89 ----- lib/utils/config_validator/index.ts | 65 ---- package-lock.json | 352 ++++++++--------- package.json | 1 - 26 files changed, 668 insertions(+), 1007 deletions(-) delete mode 100644 lib/utils/config_validator/index.spec.ts delete mode 100644 lib/utils/config_validator/index.tests.js delete mode 100644 lib/utils/config_validator/index.ts diff --git a/lib/core/bucketer/index.spec.ts b/lib/core/bucketer/index.spec.ts index 4a6998597..a00c860f0 100644 --- a/lib/core/bucketer/index.spec.ts +++ b/lib/core/bucketer/index.spec.ts @@ -74,7 +74,7 @@ describe('excluding groups', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -125,7 +125,7 @@ describe('including groups: random', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -231,7 +231,7 @@ describe('including groups: overlapping', () => { vi.clearAllMocks(); setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -276,7 +276,7 @@ describe('bucket value falls into empty traffic allocation ranges', () => { beforeEach(() => { setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { @@ -326,7 +326,7 @@ describe('traffic allocation has invalid variation ids', () => { beforeEach(() => { setLogSpy(mockLogger); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment //@ts-ignore bucketerParams = { @@ -369,7 +369,7 @@ describe('testBucketWithBucketingId', () => { let bucketerParams: BucketerParams; beforeEach(() => { - const configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + const configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore bucketerParams = { diff --git a/lib/core/bucketer/index.tests.js b/lib/core/bucketer/index.tests.js index a1e046088..976ac82ab 100644 --- a/lib/core/bucketer/index.tests.js +++ b/lib/core/bucketer/index.tests.js @@ -65,7 +65,7 @@ describe('lib/core/bucketer', function () { describe('return values for bucketing (excluding groups)', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -107,7 +107,7 @@ describe('lib/core/bucketer', function () { describe('return values for bucketing (including groups)', function () { var bucketerStub; beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -255,7 +255,7 @@ describe('lib/core/bucketer', function () { describe('when the bucket value falls into empty traffic allocation ranges', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -303,7 +303,7 @@ describe('lib/core/bucketer', function () { describe('when the traffic allocation has invalid variation ids', function () { beforeEach(function () { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { experimentId: configObj.experiments[0].id, experimentKey: configObj.experiments[0].key, @@ -364,7 +364,7 @@ describe('lib/core/bucketer', function () { }); beforeEach(function () { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); bucketerParams = { trafficAllocationConfig: configObj.experiments[0].trafficAllocation, variationIdMap: configObj.variationIdMap, diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index d3b405284..2334a386b 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -212,7 +212,7 @@ describe('DecisionService', () => { userId: 'tester' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const fakeDecisionResponse = { result: '111128', @@ -242,7 +242,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const fakeDecisionResponse = { result: '111128', @@ -269,7 +269,7 @@ describe('DecisionService', () => { userId: 'user2' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -292,7 +292,7 @@ describe('DecisionService', () => { userId: 'user3' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -317,7 +317,7 @@ describe('DecisionService', () => { userId: 'user2' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -342,7 +342,7 @@ describe('DecisionService', () => { userId: 'user3', // no attributes are set, should not satisfy audience condition 11154 }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['122227']; @@ -362,7 +362,7 @@ describe('DecisionService', () => { userId: 'user1' }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['133337']; @@ -382,7 +382,7 @@ describe('DecisionService', () => { reasons: [], }; - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -431,7 +431,7 @@ describe('DecisionService', () => { reasons: [], }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -466,7 +466,7 @@ describe('DecisionService', () => { experiment_bucket_map: {}, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -504,7 +504,7 @@ describe('DecisionService', () => { userProfileService?.lookup.mockReturnValue(null); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -549,7 +549,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -593,7 +593,7 @@ describe('DecisionService', () => { experiment_bucket_map: {}, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -634,7 +634,7 @@ describe('DecisionService', () => { throw new Error('I am an error'); }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -678,7 +678,7 @@ describe('DecisionService', () => { throw new Error('I am an error'); }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const user = new OptimizelyUserContext({ @@ -720,7 +720,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -753,7 +753,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -786,7 +786,7 @@ describe('DecisionService', () => { }, }); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -812,7 +812,7 @@ describe('DecisionService', () => { userProfileService?.lookup.mockReturnValue(null); - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const experiment = config.experimentIdMap['111127']; const attributes: UserAttributes = { @@ -864,7 +864,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -914,7 +914,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -970,7 +970,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1037,7 +1037,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1091,7 +1091,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1147,7 +1147,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1214,7 +1214,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1246,7 +1246,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1300,7 +1300,7 @@ describe('DecisionService', () => { reasons: [], })); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const rolloutId = config.featureKeyMap['flag_1'].rolloutId; config.rolloutIdMap[rolloutId].experiments = []; // remove the experiments from the rollout @@ -1340,7 +1340,7 @@ describe('DecisionService', () => { it('should return variation from the first experiment for which a variation is available', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1379,7 +1379,7 @@ describe('DecisionService', () => { it('should not return variation and should not call cmab service \ for cmab experiment if user is not bucketed into it', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1419,7 +1419,7 @@ describe('DecisionService', () => { it('should get decision from the cmab service if the experiment is a cmab experiment \ and user is bucketed into it', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1471,7 +1471,7 @@ describe('DecisionService', () => { it('should pass the correct DecideOptionMap to cmabService', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1527,7 +1527,7 @@ describe('DecisionService', () => { it('should return error if cmab getDecision fails', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1610,7 +1610,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user1 = new OptimizelyUserContext({ optimizely: {} as any, @@ -1697,7 +1697,7 @@ describe('DecisionService', () => { cmabUuid: 'uuid-test', }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1756,7 +1756,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1817,7 +1817,7 @@ describe('DecisionService', () => { } }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1893,7 +1893,7 @@ describe('DecisionService', () => { cmabUuid: 'uuid-test-2', }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -1938,7 +1938,7 @@ describe('DecisionService', () => { describe('holdout', () => { it('should return holdout variation when user is bucketed into running holdout', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -1986,7 +1986,7 @@ describe('DecisionService', () => { } ] }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'test_holdout_user', @@ -2022,7 +2022,7 @@ describe('DecisionService', () => { return holdout; }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2046,7 +2046,7 @@ describe('DecisionService', () => { it('should fallback to experiment when user does not meet holdout audience conditions', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2070,7 +2070,7 @@ describe('DecisionService', () => { it('should fallback to experiment when user is not bucketed into holdout traffic', async () => { const { decisionService } = getDecisionService(); - const config = createProjectConfig(getHoldoutTestDatafile()); + const config = createProjectConfig(JSON.stringify(getHoldoutTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2125,7 +2125,7 @@ describe('DecisionService', () => { return experiment; }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2174,7 +2174,7 @@ describe('DecisionService', () => { ] }); - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'tester', @@ -2206,7 +2206,7 @@ describe('DecisionService', () => { it('should skip cmab experiments', async () => { const { decisionService, cmabService } = getDecisionService(); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2279,7 +2279,7 @@ describe('DecisionService', () => { }; }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2341,7 +2341,7 @@ describe('DecisionService', () => { }; }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user1 = new OptimizelyUserContext({ optimizely: {} as any, @@ -2432,7 +2432,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2515,7 +2515,7 @@ describe('DecisionService', () => { }); }); - const config = createProjectConfig(getDecisionTestDatafile()); + const config = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const user = new OptimizelyUserContext({ optimizely: {} as any, @@ -2565,7 +2565,7 @@ describe('DecisionService', () => { describe('forced variation management', () => { it('should return true for a valid forcedVariation in setForcedVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2578,7 +2578,7 @@ describe('DecisionService', () => { }); it('should return the same variation from getVariation as was set in setVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); decisionService.setForcedVariation( config, @@ -2592,7 +2592,7 @@ describe('DecisionService', () => { }); it('should return null from getVariation if no forced variation was set for a valid experimentKey', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); expect(config.experimentKeyMap['testExperiment']).toBeDefined(); @@ -2602,7 +2602,7 @@ describe('DecisionService', () => { }); it('should return null from getVariation for an invalid experimentKey', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); expect(config.experimentKeyMap['definitely_not_valid_exp_key']).not.toBeDefined(); @@ -2612,7 +2612,7 @@ describe('DecisionService', () => { }); it('should return null when a forced decision is set on another experiment key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); decisionService.setForcedVariation(config, 'testExperiment', 'user1', 'control'); @@ -2621,7 +2621,7 @@ describe('DecisionService', () => { }); it('should not set forced variation for an invalid variation key and return false', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const wasSet = decisionService.setForcedVariation( @@ -2637,7 +2637,7 @@ describe('DecisionService', () => { }); it('should reset the forcedVariation if null is passed to setForcedVariation', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2666,7 +2666,7 @@ describe('DecisionService', () => { }); it('should be able to add variations for multiple experiments for one user', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation1 = decisionService.setForcedVariation( @@ -2692,7 +2692,7 @@ describe('DecisionService', () => { }); it('should be able to forced variation to same experiment for multiple users', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation1 = decisionService.setForcedVariation( @@ -2719,7 +2719,7 @@ describe('DecisionService', () => { }); it('should be able to reset a variation for a user with multiple experiments', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); // Set the first time @@ -2762,7 +2762,7 @@ describe('DecisionService', () => { }); it('should be able to unset a variation for a user with multiple experiments', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); // Set the first time @@ -2799,7 +2799,7 @@ describe('DecisionService', () => { }); it('should return false for an empty variation key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation(config, 'testExperiment', 'user1', ''); @@ -2807,7 +2807,7 @@ describe('DecisionService', () => { }); it('should return null when a variation was previously set, and that variation no longer exists on the config object', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2837,13 +2837,13 @@ describe('DecisionService', () => { user2: 'variation', }; // Now the only variation in testExperiment is 'variation' - const newConfigObj = createProjectConfig(newDatafile); + const newConfigObj = createProjectConfig(JSON.stringify(newDatafile)); const forcedVar = decisionService.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; expect(forcedVar).toBe(null); }); it("should return null when a variation was previously set, and that variation's experiment no longer exists on the config object", function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2854,13 +2854,13 @@ describe('DecisionService', () => { ); expect(didSetVariation).toBe(true); - const newConfigObj = createProjectConfig(cloneDeep(testDataWithFeatures)); + const newConfigObj = createProjectConfig(JSON.stringify(testDataWithFeatures)); const forcedVar = decisionService.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; expect(forcedVar).toBe(null); }); it('should return false from setForcedVariation and not set for invalid experiment key', function() { - const config = createProjectConfig(cloneDeep(testData)); + const config = createProjectConfig(JSON.stringify(testData)); const { decisionService } = getDecisionService(); const didSetVariation = decisionService.setForcedVariation( @@ -2934,7 +2934,7 @@ describe('DecisionService', () => { trafficAllocation: [{ entityId: 'global_holdout_var_id', endOfRange: 10000 }] } ]; - const config = createProjectConfig(datafile); + const config = createProjectConfig(JSON.stringify(datafile)); const { decisionService } = getDecisionService(); // bucket returns the global holdout variation for the holdout, nothing for experiments @@ -2956,7 +2956,7 @@ describe('DecisionService', () => { it('local holdout hit branch: user bucketed into local holdout for experiment rule returns holdout variation; audience and traffic not evaluated for that rule', async () => { // exp_1 has id '2001' - const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); const { decisionService } = getDecisionService(); // bucket returns holdout variation when evaluating the local holdout @@ -2979,7 +2979,7 @@ describe('DecisionService', () => { it('local holdout miss branch: user not bucketed into local holdout falls through to regular rule evaluation', async () => { // exp_1 has id '2001' and audience 4001 (age <= 22) - const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); const { decisionService } = getDecisionService(); // bucket returns null for the local holdout, then succeeds for the experiment @@ -3009,7 +3009,7 @@ describe('DecisionService', () => { it('rule specificity: local holdout targeting experiment rule X does not affect experiment rule Y', async () => { // exp_1 = '2001', exp_2 = '2002'. Local holdout targets only '2002' (exp_2). // Audience for exp_1: 4001 (age <= 22). User satisfies exp_1 audience but not exp_2. - const config = createProjectConfig(makeLocalHoldoutDatafile('2002')); + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2002'))); const { decisionService } = getDecisionService(); // bucket returns holdout variation only for the local holdout when evaluating for '2002', @@ -3040,7 +3040,7 @@ describe('DecisionService', () => { it('local holdout applies to delivery rules (rollouts) as well as experiment rules', async () => { // delivery_1 has id '3001' - const config = createProjectConfig(makeLocalHoldoutDatafile('3001')); + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('3001'))); const { decisionService } = getDecisionService(); // bucket returns null for all experiments and the local holdout variation for delivery rule @@ -3070,7 +3070,7 @@ describe('DecisionService', () => { // Local holdout targets '2001' with 100% traffic allocation. // User also has a forced decision set for exp_1. // Expected: forced decision wins; decisionSource is FEATURE_TEST, not HOLDOUT. - const config = createProjectConfig(makeLocalHoldoutDatafile('2001')); + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); const { decisionService } = getDecisionService(); // bucket should NOT be called for local_holdout_id because forced decision short-circuits first diff --git a/lib/core/decision_service/index.tests.js b/lib/core/decision_service/index.tests.js index 84c4f8c5f..0559460c3 100644 --- a/lib/core/decision_service/index.tests.js +++ b/lib/core/decision_service/index.tests.js @@ -82,7 +82,7 @@ var createLogger = () => ({ describe('lib/core/decision_service', function() { describe('APIs', function() { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); var decisionServiceInstance; var mockLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); var bucketerStub; @@ -991,7 +991,7 @@ describe('lib/core/decision_service', function() { user2: 'variation', }; // Now the only variation in testExperiment is 'variation' - var newConfigObj = projectConfig.createProjectConfig(newDatafile); + var newConfigObj = projectConfig.createProjectConfig(JSON.stringify(newDatafile)); var forcedVar = decisionServiceInstance.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; assert.strictEqual(forcedVar, null); }); @@ -1004,7 +1004,7 @@ describe('lib/core/decision_service', function() { 'control' ); assert.strictEqual(didSetVariation, true); - var newConfigObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + var newConfigObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); var forcedVar = decisionServiceInstance.getForcedVariation(newConfigObj, 'testExperiment', 'user1').result; assert.strictEqual(forcedVar, null); }); @@ -1029,7 +1029,7 @@ describe('lib/core/decision_service', function() { // TODO: Move tests that test methods of Optimizely to lib/optimizely/index.tests.js describe('when a bucketingID is provided', function() { - var configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); var createdLogger = createLogger({ logLevel: LOG_LEVEL.DEBUG, logToConsole: false, @@ -1040,7 +1040,7 @@ describe('lib/core/decision_service', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(cloneDeep(testData)) + initConfig: createProjectConfig(JSON.stringify(testData)) }), jsonSchemaValidator: jsonSchemaValidator, isValidInstance: true, @@ -1173,7 +1173,7 @@ describe('lib/core/decision_service', function() { sinon.stub(mockLogger, 'warn'); sinon.stub(mockLogger, 'error'); - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); decisionService = createDecisionService({ logger: mockLogger, }); @@ -1216,7 +1216,7 @@ describe('lib/core/decision_service', function() { }); var user; beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); sandbox = sinon.sandbox.create(); sandbox.stub(mockLogger, 'debug'); sandbox.stub(mockLogger, 'info'); @@ -1941,7 +1941,7 @@ describe('lib/core/decision_service', function() { var user; beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testDataWithFeatures)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDataWithFeatures)); feature = configObj.featureKeyMap.test_feature; decisionService = createDecisionService({ logger: createLogger({ logLevel: LOG_LEVEL.INFO }), diff --git a/lib/event_processor/event_builder/user_event.spec.ts b/lib/event_processor/event_builder/user_event.spec.ts index e8cb373b3..7bd55ce76 100644 --- a/lib/event_processor/event_builder/user_event.spec.ts +++ b/lib/event_processor/event_builder/user_event.spec.ts @@ -7,7 +7,7 @@ import testData from '../../tests/test_data'; describe('buildImpressionEvent', () => { it('should use correct region from projectConfig in event context', () => { const projectConfig = createProjectConfig( - testData.getTestProjectConfig(), + JSON.stringify(testData.getTestProjectConfig()), ) const experiment = projectConfig.experiments[0]; @@ -51,7 +51,7 @@ describe('buildImpressionEvent', () => { describe('buildConversionEvent', () => { it('should use correct region from projectConfig in event context', () => { const projectConfig = createProjectConfig( - testData.getTestProjectConfig(), + JSON.stringify(testData.getTestProjectConfig()), ) const conversionEvent = buildConversionEvent({ diff --git a/lib/index.browser.tests.js b/lib/index.browser.tests.js index 0a6feb28b..0f032bef9 100644 --- a/lib/index.browser.tests.js +++ b/lib/index.browser.tests.js @@ -19,7 +19,6 @@ import Optimizely from './optimizely'; import testData from './tests/test_data'; import packageJSON from '../package.json'; import * as optimizelyFactory from './index.browser'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { createProjectConfig } from './project_config/project_config'; import { wrapConfigManager } from './project_config/config_manager_factory'; @@ -180,7 +179,7 @@ describe('javascript-sdk (Browser)', function() { it('should activate with provided event dispatcher', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -191,7 +190,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set and get a forced variation', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -206,7 +205,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set and unset a forced variation', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -227,7 +226,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -252,7 +251,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user, and unset one', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -280,7 +279,7 @@ describe('javascript-sdk (Browser)', function() { it('should be able to set multiple experiments for one user, and reset one', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -312,7 +311,7 @@ describe('javascript-sdk (Browser)', function() { it('should override bucketing when setForcedVariation is called', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); @@ -333,7 +332,7 @@ describe('javascript-sdk (Browser)', function() { it('should override bucketing when setForcedVariation is called for a not running experiment', function() { var optlyInstance = optimizelyFactory.createInstance({ projectConfigManager: wrapConfigManager(getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), })), logger: wrapLogger(mockLogger), }); diff --git a/lib/index.browser.umdtests.js b/lib/index.browser.umdtests.js index a13f5046b..ac8b4906c 100644 --- a/lib/index.browser.umdtests.js +++ b/lib/index.browser.umdtests.js @@ -16,14 +16,12 @@ import { assert } from 'chai'; import sinon from 'sinon'; -import configValidator from './utils/config_validator'; import * as enums from './utils/enums'; import * as logger from './plugins/logger'; import Optimizely from './optimizely'; import testData from './tests/test_data'; import packageJSON from '../package.json'; import eventDispatcher from './plugins/event_dispatcher/index.browser'; -import { INVALID_CONFIG_OR_SOMETHING } from './exception_messages'; describe('javascript-sdk', function() { describe('APIs', function() { @@ -37,7 +35,6 @@ describe('javascript-sdk', function() { logLevel: enums.LOG_LEVEL.INFO, logToConsole: false, }); - sinon.stub(configValidator, 'validate'); sinon.stub(Optimizely.prototype, 'close'); global.XMLHttpRequest = sinon.useFakeXMLHttpRequest(); @@ -56,7 +53,6 @@ describe('javascript-sdk', function() { console.warn.restore(); console.error.restore(); window.addEventListener.restore(); - configValidator.validate.restore(); Optimizely.prototype.close.restore(); delete global.XMLHttpRequest }); @@ -93,7 +89,6 @@ describe('javascript-sdk', function() { }); it('should not throw if the provided config is not valid', function() { - configValidator.validate.throws(new Error(INVALID_CONFIG_OR_SOMETHING)); assert.doesNotThrow(function() { var optlyInstance = window.optimizelySdk.createInstance({ datafile: {}, diff --git a/lib/index.node.tests.js b/lib/index.node.tests.js index 1b4b6f185..eb4bd13f5 100644 --- a/lib/index.node.tests.js +++ b/lib/index.node.tests.js @@ -19,7 +19,6 @@ import sinon from 'sinon'; import Optimizely from './optimizely'; import testData from './tests/test_data'; import * as optimizelyFactory from './index.node'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { wrapConfigManager } from './project_config/config_manager_factory'; import { wrapLogger } from './logging/logger_factory'; @@ -105,7 +104,7 @@ describe('optimizelyFactory', function() { // it('should ignore invalid event flush interval and use default instead', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -123,7 +122,7 @@ describe('optimizelyFactory', function() { // it('should use default event flush interval when none is provided', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -140,7 +139,7 @@ describe('optimizelyFactory', function() { // it('should use provided event flush interval when valid', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -158,7 +157,7 @@ describe('optimizelyFactory', function() { // it('should ignore invalid event batch size and use default instead', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -176,7 +175,7 @@ describe('optimizelyFactory', function() { // it('should use default event batch size when none is provided', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, @@ -193,7 +192,7 @@ describe('optimizelyFactory', function() { // it('should use provided event batch size when valid', function() { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), // }), // errorHandler: fakeErrorHandler, // eventDispatcher: fakeEventDispatcher, diff --git a/lib/index.react_native.spec.ts b/lib/index.react_native.spec.ts index 20493ab11..9f9e16d63 100644 --- a/lib/index.react_native.spec.ts +++ b/lib/index.react_native.spec.ts @@ -19,7 +19,6 @@ import Optimizely from './optimizely'; import testData from './tests/test_data'; import packageJSON from '../package.json'; import * as optimizelyFactory from './index.react_native'; -import configValidator from './utils/config_validator'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { createProjectConfig } from './project_config/project_config'; import { getMockLogger } from './tests/mock/mock_logger'; @@ -137,7 +136,7 @@ describe('javascript-sdk/react-native', () => { // it('should call logging.setLogLevel', () => { // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfig()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), // }), // logLevel: optimizelyFactory.enums.LOG_LEVEL.ERROR, // }); @@ -159,7 +158,7 @@ describe('javascript-sdk/react-native', () => { // const fakeLogger = { log: function() {} }; // optimizelyFactory.createInstance({ // projectConfigManager: getMockProjectConfigManager({ - // initConfig: createProjectConfig(testData.getTestProjectConfig()), + // initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), // }), // // eslint-disable-next-line @typescript-eslint/ban-ts-comment // // @ts-ignore diff --git a/lib/optimizely/index.spec.ts b/lib/optimizely/index.spec.ts index 4ed119fba..d891e283a 100644 --- a/lib/optimizely/index.spec.ts +++ b/lib/optimizely/index.spec.ts @@ -75,7 +75,7 @@ describe('Optimizely', () => { it('should pass disposable options to the respective services', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); vi.spyOn(projectConfigManager, 'makeDisposable'); @@ -100,7 +100,7 @@ describe('Optimizely', () => { it('should set child logger to respective services', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -136,7 +136,7 @@ describe('Optimizely', () => { describe('decideAsync', () => { it('should return an error decision with correct reasons if decisionService returns error', async () => { - const projectConfig = createProjectConfig(getDecisionTestDatafile()); + const projectConfig = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -186,7 +186,7 @@ describe('Optimizely', () => { }); it('should include cmab uuid in dispatched event if decisionService returns a cmab uuid', async () => { - const projectConfig = createProjectConfig(getDecisionTestDatafile()); + const projectConfig = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -257,7 +257,7 @@ describe('Optimizely', () => { beforeEach(() => { const datafile = getDecisionTestDatafile(); datafile.holdouts = JSON.parse(JSON.stringify(holdoutData)); // Deep copy to avoid mutations - projectConfig = createProjectConfig(datafile); + projectConfig = createProjectConfig(JSON.stringify(datafile)); const projectConfigManager = getMockProjectConfigManager({ initConfig: projectConfig, @@ -876,7 +876,7 @@ describe('Optimizely', () => { it('should flush eventProcessor and odpManager on flushImmediately()', async () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -909,7 +909,7 @@ describe('Optimizely', () => { it('should log error when sendOdpEvent is called without odpManager', () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const mockLogger = getMockLogger(); @@ -931,7 +931,7 @@ describe('Optimizely', () => { it('should log error when fetchQualifiedSegments is called without odpManager', async () => { const projectConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); const mockLogger = getMockLogger(); diff --git a/lib/optimizely/index.tests.js b/lib/optimizely/index.tests.js index 50eba745a..d1ea1b8b3 100644 --- a/lib/optimizely/index.tests.js +++ b/lib/optimizely/index.tests.js @@ -103,7 +103,7 @@ var createLogger = () => ({ const getOptlyInstance = ({ datafileObj, defaultDecideOptions }) => { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -302,7 +302,7 @@ describe('lib/optimizely', function() { }); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -922,7 +922,7 @@ describe('lib/optimizely', function() { bucketStub.returns(fakeDecisionResponse); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); var instance = new Optimizely({ @@ -1675,7 +1675,7 @@ describe('lib/optimizely', function() { it('should track when logger is in DEBUG mode', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); var instance = new Optimizely({ @@ -2535,7 +2535,7 @@ describe('lib/optimizely', function() { describe('activate', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -2598,7 +2598,7 @@ describe('lib/optimizely', function() { describe('getVariation', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -2655,7 +2655,7 @@ describe('lib/optimizely', function() { it('should send notification with variation key and type feature-test when getVariation returns feature experiment variation', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); var optly = new Optimizely({ @@ -2696,7 +2696,7 @@ describe('lib/optimizely', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -4319,7 +4319,7 @@ describe('lib/optimizely', function() { describe('#createUserContext', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -4986,7 +4986,7 @@ describe('lib/optimizely', function() { describe('with DISABLE_DECISION_EVENT flag in default decide options', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -5057,7 +5057,7 @@ describe('lib/optimizely', function() { describe('with INCLUDE_REASONS flag in default decide options', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstance = new Optimizely({ @@ -5115,7 +5115,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); var optlyInstanceWithUserProfile = new Optimizely({ @@ -5543,7 +5543,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5590,7 +5590,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5641,7 +5641,7 @@ describe('lib/optimizely', function() { save: sinon.stub(), }; const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }); optlyInstanceWithUserProfile = new Optimizely({ @@ -5771,7 +5771,7 @@ describe('lib/optimizely', function() { clientEngine: 'node-sdk', datafile: testData.getTestDecideProjectConfig(), projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }), userProfileService: userProfileServiceInstance, @@ -6013,7 +6013,7 @@ describe('lib/optimizely', function() { clientEngine: 'node-sdk', datafile: testData.getTestDecideProjectConfig(), projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())), }), userProfileService: userProfileServiceInstance, @@ -6084,7 +6084,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -6157,7 +6157,7 @@ describe('lib/optimizely', function() { beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -6787,7 +6787,7 @@ describe('lib/optimizely', function() { it('return features that are enabled for the user and send notification for every feature', function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfigWithFeatures()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())), }); optlyInstance = new Optimizely({ @@ -8882,7 +8882,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTypedAudiencesConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTypedAudiencesConfig())), }); optlyInstance = new Optimizely({ @@ -9027,7 +9027,7 @@ describe('lib/optimizely', function() { ); beforeEach(function() { const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTypedAudiencesConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTypedAudiencesConfig())), }); optlyInstance = new Optimizely({ @@ -9266,7 +9266,7 @@ describe('lib/optimizely', function() { eventProcessorStopPromise = Promise.resolve(); mockEventProcessor.onTerminated.returns(eventProcessorStopPromise); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -9303,7 +9303,7 @@ describe('lib/optimizely', function() { eventProcessorStopPromise.catch(() => {}); mockEventProcessor.onTerminated.returns(eventProcessorStopPromise); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestProjectConfig()), + initConfig: createProjectConfig(JSON.stringify(testData.getTestProjectConfig())), }); optlyInstance = new Optimizely({ @@ -9613,7 +9613,7 @@ describe('lib/optimizely', function() { const datafile = testData.getTestProjectConfigWithFeatures(); - const newConfig = createProjectConfig(datafile, JSON.stringify(datafile)); + const newConfig = createProjectConfig(JSON.stringify(datafile)); fakeProjectConfigManager.setConfig(newConfig); fakeProjectConfigManager.pushUpdate(newConfig); @@ -9644,7 +9644,7 @@ describe('lib/optimizely', function() { ], }); differentDatafile.revision = '44'; - var differentConfig = createProjectConfig(differentDatafile, JSON.stringify(differentDatafile)); + var differentConfig = createProjectConfig(JSON.stringify(differentDatafile)); fakeProjectConfigManager.setConfig(differentConfig); fakeProjectConfigManager.pushUpdate(differentConfig); @@ -9658,7 +9658,7 @@ describe('lib/optimizely', function() { NOTIFICATION_TYPES.OPTIMIZELY_CONFIG_UPDATE, listener ); - var newConfig = createProjectConfig(testData.getTestProjectConfigWithFeatures()); + var newConfig = createProjectConfig(JSON.stringify(testData.getTestProjectConfigWithFeatures())); fakeProjectConfigManager.pushUpdate(newConfig); sinon.assert.calledOnce(listener); @@ -9683,7 +9683,7 @@ describe('lib/optimizely', function() { const datafile = testData.getTestProjectConfig(); const mockConfigManager = getMockProjectConfigManager(); - mockConfigManager.setConfig(createProjectConfig(datafile, JSON.stringify(datafile))); + mockConfigManager.setConfig(createProjectConfig(JSON.stringify(datafile))); optlyInstance = new Optimizely({ clientEngine: 'node-sdk', diff --git a/lib/optimizely_user_context/index.spec.ts b/lib/optimizely_user_context/index.spec.ts index 5f451ccb4..097d0ae1d 100644 --- a/lib/optimizely_user_context/index.spec.ts +++ b/lib/optimizely_user_context/index.spec.ts @@ -51,7 +51,7 @@ interface GetOptlyInstanceParams { const getOptlyInstance = ({ datafileObj, defaultDecideOptions }: GetOptlyInstanceParams) => { const createdLogger = getMockLogger(); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); diff --git a/lib/optimizely_user_context/index.tests.js b/lib/optimizely_user_context/index.tests.js index 6eed2437e..97b07634b 100644 --- a/lib/optimizely_user_context/index.tests.js +++ b/lib/optimizely_user_context/index.tests.js @@ -54,7 +54,7 @@ var createLogger = () => ({ const getOptlyInstance = ({ datafileObj, defaultDecideOptions }) => { const createdLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); const mockConfigManager = getMockProjectConfigManager({ - initConfig: createProjectConfig(datafileObj), + initConfig: createProjectConfig(JSON.stringify(datafileObj)), }); const eventDispatcher = getMockEventDispatcher(); const eventProcessor = getForwardingEventProcessor(eventDispatcher); @@ -400,7 +400,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -759,7 +759,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -865,7 +865,7 @@ describe('lib/optimizely_user_context', function() { optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, @@ -911,7 +911,7 @@ describe('lib/optimizely_user_context', function() { var optlyInstance = new Optimizely({ clientEngine: 'node-sdk', projectConfigManager: getMockProjectConfigManager({ - initConfig: createProjectConfig(testData.getTestDecideProjectConfig()) + initConfig: createProjectConfig(JSON.stringify(testData.getTestDecideProjectConfig())) }), eventProcessor, isValidInstance: true, diff --git a/lib/project_config/optimizely_config.spec.ts b/lib/project_config/optimizely_config.spec.ts index 6e9e6747b..bd48a68a2 100644 --- a/lib/project_config/optimizely_config.spec.ts +++ b/lib/project_config/optimizely_config.spec.ts @@ -31,7 +31,6 @@ const datafile: ProjectConfig = getTestProjectConfigWithFeatures(); const typedAudienceDatafile = getTypedAudiencesConfig(); const similarRuleKeyDatafile = getSimilarRuleKeyConfig(); const similarExperimentKeyDatafile = getSimilarExperimentKeyConfig(); -const cloneDeep = (obj: any) => JSON.parse(JSON.stringify(obj)); const getAllExperimentsFromDatafile = (datafile: ProjectConfig) => { const allExperiments: Experiment[] = []; datafile.groups.forEach(group => { @@ -57,15 +56,15 @@ describe('Optimizely Config', () => { const logger = getMockLogger(); beforeEach(() => { - projectConfigObject = createProjectConfig(cloneDeep(datafile as any)); + projectConfigObject = createProjectConfig(JSON.stringify(datafile)); optimizelyConfigObject = createOptimizelyConfig(projectConfigObject, JSON.stringify(datafile)); - projectTypedAudienceConfigObject = createProjectConfig(cloneDeep(typedAudienceDatafile)); - projectSimilarRuleKeyConfigObject = createProjectConfig(cloneDeep(similarRuleKeyDatafile)); + projectTypedAudienceConfigObject = createProjectConfig(JSON.stringify(typedAudienceDatafile)); + projectSimilarRuleKeyConfigObject = createProjectConfig(JSON.stringify(similarRuleKeyDatafile)); optimizelySimilarRuleKeyConfigObject = createOptimizelyConfig( projectSimilarRuleKeyConfigObject, JSON.stringify(similarRuleKeyDatafile) ); - projectSimilarExperimentKeyConfigObject = createProjectConfig(cloneDeep(similarExperimentKeyDatafile)); + projectSimilarExperimentKeyConfigObject = createProjectConfig(JSON.stringify(similarExperimentKeyDatafile)); optimizelySimilarExperimentkeyConfigObject = createOptimizelyConfig( projectSimilarExperimentKeyConfigObject, JSON.stringify(similarExperimentKeyDatafile) @@ -99,7 +98,7 @@ describe('Optimizely Config', () => { it('should keep the last experiment in case of duplicate key and log a warning', () => { const datafile = getDuplicateExperimentKeyConfig(); - const configObj = createProjectConfig(datafile, JSON.stringify(datafile)); + const configObj = createProjectConfig(JSON.stringify(datafile)); const optimizelyConfig = createOptimizelyConfig(configObj, JSON.stringify(datafile), logger); const experimentsMap = optimizelyConfig.experimentsMap; const duplicateKey = 'experiment_rule'; diff --git a/lib/project_config/optimizely_config.tests.js b/lib/project_config/optimizely_config.tests.js index 22d2b95f3..244fb632f 100644 --- a/lib/project_config/optimizely_config.tests.js +++ b/lib/project_config/optimizely_config.tests.js @@ -14,7 +14,6 @@ * limitations under the License. */ import { assert } from 'chai'; -import { cloneDeep } from 'lodash'; import sinon from 'sinon'; import { createOptimizelyConfig, OptimizelyConfig } from './optimizely_config'; @@ -57,13 +56,13 @@ describe('lib/core/optimizely_config', function() { var projectSimilarExperimentKeyConfigObject; beforeEach(function() { - projectConfigObject = createProjectConfig(cloneDeep(datafile)); + projectConfigObject = createProjectConfig(JSON.stringify(datafile)); optimizelyConfigObject = createOptimizelyConfig(projectConfigObject, JSON.stringify(datafile)); - projectTypedAudienceConfigObject = createProjectConfig(cloneDeep(typedAudienceDatafile)); + projectTypedAudienceConfigObject = createProjectConfig(JSON.stringify(typedAudienceDatafile)); optimizelyTypedAudienceConfigObject = createOptimizelyConfig(projectTypedAudienceConfigObject, JSON.stringify(typedAudienceDatafile)); - projectSimilarRuleKeyConfigObject = createProjectConfig(cloneDeep(similarRuleKeyDatafile)); + projectSimilarRuleKeyConfigObject = createProjectConfig(JSON.stringify(similarRuleKeyDatafile)); optimizelySimilarRuleKeyConfigObject = createOptimizelyConfig(projectSimilarRuleKeyConfigObject, JSON.stringify(similarRuleKeyDatafile)); - projectSimilarExperimentKeyConfigObject = createProjectConfig(cloneDeep(similarExperimentKeyDatafile)); + projectSimilarExperimentKeyConfigObject = createProjectConfig(JSON.stringify(similarExperimentKeyDatafile)); optimizelySimilarExperimentkeyConfigObject = createOptimizelyConfig(projectSimilarExperimentKeyConfigObject, JSON.stringify(similarExperimentKeyDatafile)); }); @@ -90,7 +89,7 @@ describe('lib/core/optimizely_config', function() { it('should keep the last experiment in case of duplicate key and log a warning', function() { const datafile = getDuplicateExperimentKeyConfig(); - const configObj = createProjectConfig(datafile, JSON.stringify(datafile)); + const configObj = createProjectConfig(JSON.stringify(datafile)); const logger = { warn: sinon.spy(), diff --git a/lib/project_config/project_config.spec.ts b/lib/project_config/project_config.spec.ts index 6cf68a82d..b4521267b 100644 --- a/lib/project_config/project_config.spec.ts +++ b/lib/project_config/project_config.spec.ts @@ -28,7 +28,6 @@ import { OptimizelyError } from '../error/optimizly_error'; import { VariableType } from '../shared_types'; import { getMockLogger } from '../tests/mock/mock_logger'; import testDatafile from '../tests/test_data'; -import configValidator from '../utils/config_validator'; import { FEATURE_VARIABLE_TYPES } from '../utils/enums'; import { keyBy, sprintf } from '../utils/fns'; import projectConfig, { ProjectConfig, getGlobalHoldouts, getHoldoutsForRule } from './project_config'; @@ -42,7 +41,7 @@ describe('createProjectConfig', () => { it('should use US region when no region is specified in datafile', () => { const datafile = testDatafile.getTestProjectConfig(); - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(config.region).toBe('US'); }); @@ -51,19 +50,19 @@ describe('createProjectConfig', () => { const datafileUs = testDatafile.getTestProjectConfig(); datafileUs.region = 'US'; - const configUs = projectConfig.createProjectConfig(datafileUs); + const configUs = projectConfig.createProjectConfig(JSON.stringify(datafileUs)); expect(configUs.region).toBe('US'); const datafileEu = testDatafile.getTestProjectConfig(); datafileEu.region = 'EU'; - const configEu = projectConfig.createProjectConfig(datafileEu); + const configEu = projectConfig.createProjectConfig(JSON.stringify(datafileEu)); expect(configEu.region).toBe('EU'); }); it('should set properties correctly when createProjectConfig is called', () => { const testData: Record = testDatafile.getTestProjectConfig(); - configObj = projectConfig.createProjectConfig(testData as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); testData.audiences.forEach((audience: any) => { audience.conditions = JSON.parse(audience.conditions); @@ -154,21 +153,13 @@ describe('createProjectConfig', () => { expect(configObj.experimentIdMap).toEqual(expectedExperimentIdMap); }); - - it('should not mutate the datafile', () => { - const datafile = testDatafile.getTypedAudiencesConfig(); - const datafileClone = cloneDeep(datafile); - projectConfig.createProjectConfig(datafile as any); - - expect(datafile).toEqual(datafileClone); - }); }); describe('createProjectConfig - feature management', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); it('should create a rolloutIdMap from rollouts in the datafile', () => { @@ -242,7 +233,7 @@ describe('createProjectConfig - flag variations', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTestDecideProjectConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestDecideProjectConfig())); }); it('should populate flagVariationsMap correctly', function() { @@ -260,8 +251,8 @@ describe('createProjectConfig - flag variations', () => { return variation.key; }, {}); - expect(feature1VariationsKeys).toEqual(['a', 'b', '3324490633', '3324490562', '18257766532']); - expect(feature2VariationsKeys).toEqual(['variation_with_traffic', 'variation_no_traffic']); + expect(feature1VariationsKeys.sort()).toEqual(['18257766532', '3324490562', '3324490633', 'a', 'b']); + expect(feature2VariationsKeys.sort()).toEqual(['variation_no_traffic', 'variation_with_traffic']); expect(feature3VariationsKeys).toEqual([]); }); }); @@ -279,7 +270,7 @@ describe('createProjectConfig - cmab experiments', () => { trafficAllocation: 1414, }; - const configObj = projectConfig.createProjectConfig(datafile); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); const experiment0 = configObj.experiments[0]; expect(experiment0.cmab).toEqual({ @@ -378,7 +369,7 @@ describe('createProjectConfig - holdouts', () => { it('should populate holdouts fields correctly', function() { const datafile = getHoldoutDatafile(); - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toHaveLength(3); configObj.holdouts.forEach((holdout, i) => { @@ -398,7 +389,7 @@ describe('createProjectConfig - holdouts', () => { it('should handle empty holdouts array', function() { const datafile = testDatafile.getTestProjectConfig(); - const configObj = projectConfig.createProjectConfig(datafile); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toEqual([]); expect(configObj.holdoutIdMap).toEqual({}); @@ -409,7 +400,7 @@ describe('createProjectConfig - holdouts', () => { datafile.holdouts[0].includedFlags = undefined; datafile.holdouts[0].excludedFlags = undefined; - const configObj = projectConfig.createProjectConfig(JSON.parse(JSON.stringify(datafile))); + const configObj = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(configObj.holdouts).toHaveLength(3); expect(configObj.holdouts[0].includedFlags).toEqual([]); @@ -455,19 +446,19 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = }; it('should set isGlobal=true for entries in the holdouts section (backward compat with old datafiles)', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const holdout = config.holdoutIdMap!['global_holdout_id']; expect(holdout.isGlobal).toBe(true); }); it('should set isGlobal=false for entries in the localHoldouts section', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const holdout = config.holdoutIdMap!['local_holdout_rule_a_id']; expect(holdout.isGlobal).toBe(false); }); it('getGlobalHoldouts should return only entries from the holdouts section', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const globals = getGlobalHoldouts(config); const globalIds = globals.map(h => h.id); expect(globalIds).toContain('global_holdout_id'); @@ -475,7 +466,7 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = }); it('getHoldoutsForRule should return local holdouts targeting the given rule ID', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const forRuleA = getHoldoutsForRule(config, 'rule_a'); expect(forRuleA).toHaveLength(1); expect(forRuleA[0].id).toBe('local_holdout_rule_a_id'); @@ -525,7 +516,7 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = trafficAllocation: [{ entityId: 'var_both', endOfRange: 5000 }], }, ]; - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const forRuleX = getHoldoutsForRule(config, 'rule_x'); const forRuleXIds = forRuleX.map(h => h.id).sort(); @@ -556,7 +547,7 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = trafficAllocation: [{ entityId: 'var_local', endOfRange: 5000 }], }, ]; - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const forRuleZ = getHoldoutsForRule(config, 'rule_z'); expect(forRuleZ).toHaveLength(1); @@ -567,7 +558,7 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = }); it('getHoldoutsForRule should return empty array for an unknown rule ID', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const forUnknown = getHoldoutsForRule(config, 'nonexistent_rule'); expect(forUnknown).toHaveLength(0); }); @@ -589,19 +580,19 @@ describe('createProjectConfig - local holdouts (FSSDK-12369, FSSDK-12760)', () = trafficAllocation: [{ entityId: 'only_local_var_id', endOfRange: 5000 }], }, ]; - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(getGlobalHoldouts(config)).toHaveLength(0); }); it('should handle datafile with no holdouts gracefully', () => { const datafile = testDatafile.getTestProjectConfig(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(getGlobalHoldouts(config)).toHaveLength(0); expect(getHoldoutsForRule(config, 'any_rule')).toHaveLength(0); }); it('a single local holdout targeting multiple rules should appear for each targeted rule', () => { - const config = projectConfig.createProjectConfig(cloneDeep(makeHoldoutsDatafile()) as any); + const config = projectConfig.createProjectConfig(JSON.stringify(makeHoldoutsDatafile())); const forRuleA = getHoldoutsForRule(config, 'rule_a'); const forRuleB = getHoldoutsForRule(config, 'rule_b'); // Both rule_a and rule_b point to the same holdout @@ -646,7 +637,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { const datafile = cloneDeep(makeBaseDatafile()) as any; datafile.holdouts = []; datafile.localHoldouts = [makeLocal('l1', 'local_h', ['rule_x'])]; - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(Array.isArray(config.localHoldouts)).toBe(true); expect(config.localHoldouts).toHaveLength(1); expect(config.localHoldouts[0].id).toBe('l1'); @@ -656,7 +647,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { const datafile = cloneDeep(makeBaseDatafile()) as any; datafile.holdouts = [makeGlobal('g1', 'global_h')]; // No localHoldouts key at all - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(config.localHoldouts).toEqual([]); expect(getGlobalHoldouts(config).map(h => h.id)).toContain('g1'); expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); @@ -670,7 +661,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { makeGlobal('stray', 'stray_global', { includedRules: ['rule_should_be_ignored'] }), ]; datafile.localHoldouts = []; - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const stray = config.holdoutIdMap!['stray']; // includedRules must be stripped at parse time @@ -689,7 +680,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { datafile.holdouts = [ makeGlobal('stray', 'stray_global', { includedRules: ['rule_x'] }), ]; - projectConfig.createProjectConfig(datafile); + projectConfig.createProjectConfig(JSON.stringify(datafile)); // Original datafile still has includedRules on the entry expect(datafile.holdouts[0].includedRules).toEqual(['rule_x']); }); @@ -701,7 +692,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { makeLocal('l1', 'l1', ['rule_a']), makeLocal('l2', 'l2', ['rule_b']), ]; - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(getGlobalHoldouts(config).map(h => h.id).sort()).toEqual(['g1', 'g2']); expect(getHoldoutsForRule(config, 'rule_a').map(h => h.id)).toEqual(['l1']); @@ -719,7 +710,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { delete invalid.includedRules; datafile.localHoldouts = [invalid]; - const config = projectConfig.createProjectConfig(datafile, null, logger); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); expect(getGlobalHoldouts(config)).toEqual([]); expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); @@ -734,7 +725,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { datafile.holdouts = []; datafile.localHoldouts = [makeLocal('bad_null', 'null_local', null)]; - const config = projectConfig.createProjectConfig(datafile, null, logger); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); expect(config.holdoutIdMap!['bad_null']).toBeUndefined(); @@ -748,7 +739,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { datafile.holdouts = []; datafile.localHoldouts = [makeLocal('bad_empty', 'empty_local', [])]; - const config = projectConfig.createProjectConfig(datafile, null, logger); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile), { logger }); expect(getHoldoutsForRule(config, 'any_rule')).toEqual([]); expect(config.holdoutIdMap!['bad_empty']).toBeUndefined(); @@ -761,7 +752,7 @@ describe('createProjectConfig - localHoldouts section (FSSDK-12760)', () => { const datafile = cloneDeep(makeBaseDatafile()) as any; datafile.holdouts = [makeGlobal('g1', 'g')]; datafile.localHoldouts = [makeLocal('l1', 'l', ['rule_x'])]; - const config = projectConfig.createProjectConfig(datafile); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); expect(config.variationIdMap['g1_var']).toBeDefined(); expect(config.variationIdMap['l1_var']).toBeDefined(); }); @@ -774,7 +765,7 @@ describe('getExperimentId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); createdLogger = getMockLogger(); }); @@ -800,7 +791,7 @@ describe('getLayerId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve layer ID for valid experiment key in getLayerId', function() { @@ -824,7 +815,7 @@ describe('getAttributeId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); createdLogger = getMockLogger(); }); @@ -862,7 +853,7 @@ describe('getEventId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve event ID for valid event key in getEventId', function() { @@ -880,7 +871,7 @@ describe('getExperimentStatus', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve experiment status for valid experiment key in getExperimentStatus', function() { @@ -902,7 +893,7 @@ describe('isActive', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return true if experiment status is set to Running in isActive', function() { @@ -920,7 +911,7 @@ describe('isRunning', () => { beforeEach(() => { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return true if experiment status is set to Running in isRunning', function() { @@ -938,7 +929,7 @@ describe('getVariationKeyFromId', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve variation key for valid experiment key and variation ID in getVariationKeyFromId', function() { expect(projectConfig.getVariationKeyFromId(configObj, testData.experiments[0].variations[0].id)).toBe( @@ -953,7 +944,7 @@ describe('getTrafficAllocation', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should retrieve traffic allocation given valid experiment key in getTrafficAllocation', function() { @@ -980,7 +971,7 @@ describe('getVariationIdFromExperimentAndVariationKey', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return the variation id for the given experiment key and variation key', () => { @@ -1000,7 +991,7 @@ describe('getSendFlagDecisionsValue', () => { beforeEach(function() { testData = cloneDeep(testDatafile.getTestProjectConfig()); - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); }); it('should return false when sendFlagDecisions is undefined', () => { @@ -1028,7 +1019,7 @@ describe('getVariableForFeature', function() { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -1089,7 +1080,7 @@ describe('getVariableValueForVariation', () => { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -1177,7 +1168,7 @@ describe('getTypeCastValue', () => { beforeEach(() => { featureManagementLogger = getMockLogger(); - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); afterEach(() => { @@ -1310,7 +1301,7 @@ describe('getAudiencesById', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); }); it('should retrieve audiences by checking first in typedAudiences, and then second in audiences', () => { @@ -1327,13 +1318,13 @@ describe('getExperimentAudienceConditions', () => { }); it('should retrieve audiences for valid experiment key', () => { - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); expect(projectConfig.getExperimentAudienceConditions(configObj, testData.experiments[1].id)).toEqual(['11154']); }); it('should throw error for invalid experiment key', () => { - configObj = projectConfig.createProjectConfig(cloneDeep(testData) as JSON); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); expect(() => { projectConfig.getExperimentAudienceConditions(configObj, 'invalidExperimentId'); @@ -1346,7 +1337,7 @@ describe('getExperimentAudienceConditions', () => { }); it('should return experiment audienceIds if experiment has no audienceConditions', () => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); const result = projectConfig.getExperimentAudienceConditions(configObj, '11564051718'); expect(result).toEqual([ @@ -1361,7 +1352,7 @@ describe('getExperimentAudienceConditions', () => { }); it('should return experiment audienceConditions if experiment has audienceConditions', () => { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); // audience_combinations_experiment has both audienceConditions and audienceIds // audienceConditions should be preferred over audienceIds const result = projectConfig.getExperimentAudienceConditions(configObj, '1323241598'); @@ -1376,21 +1367,21 @@ describe('getExperimentAudienceConditions', () => { describe('isFeatureExperiment', () => { it('should return true for a feature test', () => { - const config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); const result = projectConfig.isFeatureExperiment(config, '594098'); // id of 'testing_my_feature' expect(result).toBe(true); }); it('should return false for an A/B test', () => { - const config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); const result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' expect(result).toBe(false); }); it('should return true for a feature test in a mutex group', () => { - const config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + const config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); let result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' expect(result).toBe(true); @@ -1457,7 +1448,7 @@ describe('integrations: with segments', () => { let configObj: ProjectConfig; beforeEach(() => { - configObj = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithSegments()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -1484,7 +1475,7 @@ describe('integrations: with segments', () => { describe('integrations: without segments', () => { let config: ProjectConfig; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithoutSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithoutSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -1508,7 +1499,7 @@ describe('without valid integration key', () => { it('should throw an error when parsing the project config due to integrations not containing a key', () => { const odpIntegratedConfigWithoutKey = testDatafile.getOdpIntegratedConfigWithoutKey(); - expect(() => projectConfig.createProjectConfig(odpIntegratedConfigWithoutKey)).toThrowError(OptimizelyError); + expect(() => projectConfig.createProjectConfig(JSON.stringify(odpIntegratedConfigWithoutKey))).toThrowError(OptimizelyError); }); }); @@ -1518,7 +1509,7 @@ describe('without integrations', () => { beforeEach(() => { const odpIntegratedConfigWithSegments = testDatafile.getOdpIntegratedConfigWithSegments(); const noIntegrationsConfigWithSegments = { ...odpIntegratedConfigWithSegments, integrations: [] }; - config = projectConfig.createProjectConfig(noIntegrationsConfigWithSegments); + config = projectConfig.createProjectConfig(JSON.stringify(noIntegrationsConfigWithSegments)); }); it('should convert integrations from the datafile into the project config', () => { @@ -1533,25 +1524,23 @@ describe('without integrations', () => { }); }); -describe('tryCreatingProjectConfig', () => { +describe('createProjectConfig with options', () => { let mockJsonSchemaValidator: Mock; beforeEach(() => { mockJsonSchemaValidator = vi.fn().mockReturnValue(true); - vi.spyOn(configValidator, 'validateDatafile').mockReturnValue(true); }); afterEach(() => { vi.restoreAllMocks(); }); - it('should return a project config object created by createProjectConfig when all validation is applied and there are no errors', () => { + it('should return a project config object when all validation is applied and there are no errors', () => { const configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(configDatafile); - const configObj = { foo: 'bar', experimentKeyMap: { @@ -1560,11 +1549,9 @@ describe('tryCreatingProjectConfig', () => { }, }; - // stubJsonSchemaValidator.returns(true); mockJsonSchemaValidator.mockReturnValueOnce(true); - const result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + const result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }); @@ -1572,15 +1559,11 @@ describe('tryCreatingProjectConfig', () => { expect(result).toMatchObject(configObj); }); - it('should throw an error when validateDatafile throws', function() { - vi.spyOn(configValidator, 'validateDatafile').mockImplementationOnce(() => { - throw new Error(); - }); + it('should throw an error when datafile is invalid JSON', function() { mockJsonSchemaValidator.mockReturnValueOnce(true); expect(() => - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig('invalid json', { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }) @@ -1588,14 +1571,13 @@ describe('tryCreatingProjectConfig', () => { }); it('should throw an error when jsonSchemaValidator.validate throws', function() { - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(true); + const configDatafile = { version: '4', foo: 'bar' }; mockJsonSchemaValidator.mockImplementationOnce(() => { throw new Error(); }); expect(() => - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: mockJsonSchemaValidator, logger: logger, }) @@ -1604,12 +1586,11 @@ describe('tryCreatingProjectConfig', () => { it('should skip json validation when jsonSchemaValidator is not provided', function() { const configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - vi.spyOn(configValidator, 'validateDatafile').mockReturnValueOnce(configDatafile); - const configObj = { foo: 'bar', experimentKeyMap: { @@ -1618,8 +1599,7 @@ describe('tryCreatingProjectConfig', () => { }, }; - const result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + const result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { logger: logger, }); @@ -1714,14 +1694,14 @@ describe('Feature Rollout support', () => { it('should preserve type=undefined for experiments without type field (backward compatibility)', () => { const datafile = makeDatafile(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const abExperiment = config.experimentIdMap['exp_ab']; expect(abExperiment.type).toBeUndefined(); }); it('should inject everyone else variation into fr (feature rollout) experiments', () => { const datafile = makeDatafile(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const rolloutExperiment = config.experimentIdMap['exp_rollout']; // Should have 2 variations: original + injected everyone else @@ -1737,7 +1717,7 @@ describe('Feature Rollout support', () => { it('should update variation lookup maps with injected variation', () => { const datafile = makeDatafile(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const rolloutExperiment = config.experimentIdMap['exp_rollout']; // variationKeyMap on the experiment should contain the injected variation @@ -1751,7 +1731,7 @@ describe('Feature Rollout support', () => { it('should not modify non-rollout experiments (A/B, MAB, CMAB)', () => { const datafile = makeDatafile(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const abExperiment = config.experimentIdMap['exp_ab']; // A/B experiment should still have only 1 variation @@ -1772,7 +1752,7 @@ describe('Feature Rollout support', () => { }, ], }); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const rolloutExperiment = config.experimentIdMap['exp_rollout']; // Should still have only 1 variation (no injection) @@ -1782,7 +1762,7 @@ describe('Feature Rollout support', () => { it('should correctly preserve experiment type field from datafile', () => { const datafile = makeDatafile(); - const config = projectConfig.createProjectConfig(datafile as any); + const config = projectConfig.createProjectConfig(JSON.stringify(datafile)); const rolloutExperiment = config.experimentIdMap['exp_rollout']; expect(rolloutExperiment.type).toBe('fr'); }); diff --git a/lib/project_config/project_config.tests.js b/lib/project_config/project_config.tests.js index d69afda46..eebbce3a1 100644 --- a/lib/project_config/project_config.tests.js +++ b/lib/project_config/project_config.tests.js @@ -21,7 +21,6 @@ import fns from '../utils/fns'; import projectConfig from './project_config'; import { FEATURE_VARIABLE_TYPES, LOG_LEVEL } from '../utils/enums'; import testDatafile from '../tests/test_data'; -import configValidator from '../utils/config_validator'; import { INVALID_EXPERIMENT_ID, INVALID_EXPERIMENT_KEY, @@ -47,7 +46,7 @@ describe('lib/core/project_config', function() { describe('createProjectConfig method', function() { it('should set properties correctly when createProjectConfig is called', function() { var testData = testDatafile.getTestProjectConfig(); - var configObj = projectConfig.createProjectConfig(testData); + var configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); forEach(testData.audiences, function(audience) { audience.conditions = JSON.parse(audience.conditions); @@ -184,17 +183,10 @@ describe('lib/core/project_config', function() { }; }); - it('should not mutate the datafile', function() { - var datafile = testDatafile.getTypedAudiencesConfig(); - var datafileClone = cloneDeep(datafile); - projectConfig.createProjectConfig(datafile); - assert.deepEqual(datafileClone, datafile); - }); - describe('feature management', function() { var configObj; beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); }); it('creates a rolloutIdMap from rollouts in the datafile', function() { @@ -265,7 +257,7 @@ describe('lib/core/project_config', function() { describe('flag variations', function() { var configObj; beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestDecideProjectConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestDecideProjectConfig())); }); it('it should populate flagVariationsMap correctly', function() { @@ -283,8 +275,8 @@ describe('lib/core/project_config', function() { return variation.key; }, {}); - assert.deepEqual(feature1VariationsKeys, ['a', 'b', '3324490633', '3324490562', '18257766532']); - assert.deepEqual(feature2VariationsKeys, ['variation_with_traffic', 'variation_no_traffic']); + assert.deepEqual(feature1VariationsKeys.sort(), ['18257766532', '3324490562', '3324490633', 'a', 'b']); + assert.deepEqual(feature2VariationsKeys.sort(), ['variation_no_traffic', 'variation_with_traffic']); assert.deepEqual(feature3VariationsKeys, []); }); }); @@ -296,7 +288,7 @@ describe('lib/core/project_config', function() { var createdLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); beforeEach(function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); sinon.stub(createdLogger, 'warn'); }); @@ -450,7 +442,7 @@ describe('lib/core/project_config', function() { describe('feature management', function() { var featureManagementLogger = createLogger({ logLevel: LOG_LEVEL.INFO }); beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); sinon.stub(featureManagementLogger, 'warn'); sinon.stub(featureManagementLogger, 'error'); sinon.stub(featureManagementLogger, 'info'); @@ -676,7 +668,7 @@ describe('lib/core/project_config', function() { describe('#getAudiencesById', function() { beforeEach(function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); }); it('should retrieve audiences by checking first in typedAudiences, and then second in audiences', function() { @@ -686,14 +678,14 @@ describe('lib/core/project_config', function() { describe('#getExperimentAudienceConditions', function() { it('should retrieve audiences for valid experiment key', function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); assert.deepEqual(projectConfig.getExperimentAudienceConditions(configObj, testData.experiments[1].id), [ '11154', ]); }); it('should throw error for invalid experiment key', function() { - configObj = projectConfig.createProjectConfig(cloneDeep(testData)); + configObj = projectConfig.createProjectConfig(JSON.stringify(testData)); const ex = assert.throws(function() { projectConfig.getExperimentAudienceConditions(configObj, 'invalidExperimentId'); }); @@ -702,7 +694,7 @@ describe('lib/core/project_config', function() { }); it('should return experiment audienceIds if experiment has no audienceConditions', function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); var result = projectConfig.getExperimentAudienceConditions(configObj, '11564051718'); assert.deepEqual(result, [ '3468206642', @@ -716,7 +708,7 @@ describe('lib/core/project_config', function() { }); it('should return experiment audienceConditions if experiment has audienceConditions', function() { - configObj = projectConfig.createProjectConfig(testDatafile.getTypedAudiencesConfig()); + configObj = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTypedAudiencesConfig())); // audience_combinations_experiment has both audienceConditions and audienceIds // audienceConditions should be preferred over audienceIds var result = projectConfig.getExperimentAudienceConditions(configObj, '1323241598'); @@ -730,19 +722,19 @@ describe('lib/core/project_config', function() { describe('#isFeatureExperiment', function() { it('returns true for a feature test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfigWithFeatures()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfigWithFeatures())); var result = projectConfig.isFeatureExperiment(config, '594098'); // id of 'testing_my_feature' assert.isTrue(result); }); it('returns false for an A/B test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); var result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' assert.isFalse(result); }); it('returns true for a feature test in a mutex group', function() { - var config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); var result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' assert.isTrue(result); result = projectConfig.isFeatureExperiment(config, '17139931304'); // id of 'f_test2' @@ -800,13 +792,13 @@ describe('lib/core/project_config', function() { }); it('returns false for an A/B test', function() { - var config = projectConfig.createProjectConfig(testDatafile.getTestProjectConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getTestProjectConfig())); var result = projectConfig.isFeatureExperiment(config, '111127'); // id of 'testExperiment' assert.isFalse(result); }); it('returns true for a feature test in a mutex group', function() { - var config = projectConfig.createProjectConfig(testDatafile.getMutexFeatureTestsConfig()); + var config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getMutexFeatureTestsConfig())); var result = projectConfig.isFeatureExperiment(config, '17128410791'); // id of 'f_test1' assert.isTrue(result); result = projectConfig.isFeatureExperiment(config, '17139931304'); // id of 'f_test2' @@ -819,7 +811,7 @@ describe('lib/core/project_config', function() { describe('#withSegments', () => { var config; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -839,7 +831,7 @@ describe('lib/core/project_config', function() { describe('#withoutSegments', () => { var config; beforeEach(() => { - config = projectConfig.createProjectConfig(testDatafile.getOdpIntegratedConfigWithoutSegments()); + config = projectConfig.createProjectConfig(JSON.stringify(testDatafile.getOdpIntegratedConfigWithoutSegments())); }); it('should convert integrations from the datafile into the project config', () => { @@ -860,7 +852,7 @@ describe('lib/core/project_config', function() { it('should throw an error when parsing the project config due to integrations not containing a key', () => { const odpIntegratedConfigWithoutKey = testDatafile.getOdpIntegratedConfigWithoutKey(); assert.throws(() => { - projectConfig.createProjectConfig(odpIntegratedConfigWithoutKey); + projectConfig.createProjectConfig(JSON.stringify(odpIntegratedConfigWithoutKey)); }); }); }); @@ -870,7 +862,7 @@ describe('lib/core/project_config', function() { beforeEach(() => { const odpIntegratedConfigWithSegments = testDatafile.getOdpIntegratedConfigWithSegments(); const noIntegrationsConfigWithSegments = { ...odpIntegratedConfigWithSegments, integrations: [] }; - config = projectConfig.createProjectConfig(noIntegrationsConfigWithSegments); + config = projectConfig.createProjectConfig(JSON.stringify(noIntegrationsConfigWithSegments)); }); it('should convert integrations from the datafile into the project config', () => { @@ -885,25 +877,23 @@ describe('lib/core/project_config', function() { }); }); -describe('#tryCreatingProjectConfig', function() { +describe('#createProjectConfig with options', function() { var stubJsonSchemaValidator; beforeEach(function() { stubJsonSchemaValidator = sinon.stub().returns(true); - sinon.stub(configValidator, 'validateDatafile').returns(true); sinon.spy(logger, 'error'); }); afterEach(function() { - configValidator.validateDatafile.restore(); logger.error.restore(); }); - it('returns a project config object created by createProjectConfig when all validation is applied and there are no errors', function() { + it('returns a project config object when all validation is applied and there are no errors', function() { var configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - configValidator.validateDatafile.returns(configDatafile); var configObj = { foo: 'bar', experimentKeyMap: { @@ -914,8 +904,7 @@ describe('#tryCreatingProjectConfig', function() { stubJsonSchemaValidator.returns(true); - var result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + var result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -923,12 +912,10 @@ describe('#tryCreatingProjectConfig', function() { assert.deepInclude(result, configObj); }); - it('throws an error when validateDatafile throws', function() { - configValidator.validateDatafile.throws(); + it('throws an error when datafile is invalid JSON', function() { stubJsonSchemaValidator.returns(true); assert.throws(() => { - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig('invalid json', { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -936,11 +923,10 @@ describe('#tryCreatingProjectConfig', function() { }); it('throws an error when jsonSchemaValidator.validate throws', function() { - configValidator.validateDatafile.returns(true); + var configDatafile = { version: '4', foo: 'bar' }; stubJsonSchemaValidator.throws(); assert.throws(() => { - projectConfig.tryCreatingProjectConfig({ - datafile: { foo: 'bar' }, + projectConfig.createProjectConfig(JSON.stringify(configDatafile), { jsonSchemaValidator: stubJsonSchemaValidator, logger: logger, }); @@ -949,12 +935,11 @@ describe('#tryCreatingProjectConfig', function() { it('skips json validation when jsonSchemaValidator is not provided', function() { var configDatafile = { + version: '4', foo: 'bar', experiments: [{ key: 'a' }, { key: 'b' }], }; - configValidator.validateDatafile.returns(configDatafile); - var configObj = { foo: 'bar', experimentKeyMap: { @@ -963,8 +948,7 @@ describe('#tryCreatingProjectConfig', function() { }, }; - var result = projectConfig.tryCreatingProjectConfig({ - datafile: configDatafile, + var result = projectConfig.createProjectConfig(JSON.stringify(configDatafile), { logger: logger, }); diff --git a/lib/project_config/project_config.ts b/lib/project_config/project_config.ts index 41f8fb6d0..5496e1d01 100644 --- a/lib/project_config/project_config.ts +++ b/lib/project_config/project_config.ts @@ -13,10 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { find, objectEntries, objectValues, keyBy, assignBy } from '../utils/fns'; +import { find, keyBy, assignBy } from '../utils/fns'; -import { EXPERIMENT_TYPES, FEATURE_VARIABLE_TYPES } from '../utils/enums'; -import configValidator from '../utils/config_validator'; +import { DATAFILE_VERSIONS, EXPERIMENT_TYPES, FEATURE_VARIABLE_TYPES } from '../utils/enums'; +import { + INVALID_DATAFILE_MALFORMED, + INVALID_DATAFILE_VERSION, +} from 'error_message'; import { LoggerFacade } from '../logging/logger'; @@ -54,10 +57,7 @@ import { import { SKIPPING_JSON_VALIDATION, VALID_DATAFILE } from 'log_message'; import { OptimizelyError } from '../error/optimizly_error'; import { Platform } from '../platform_support'; -interface TryCreatingProjectConfigConfig { - // TODO[OASIS-6649]: Don't use object type - // eslint-disable-next-line @typescript-eslint/ban-types - datafile: string | object; +interface CreateProjectConfigOptions { jsonSchemaValidator?: Transformer; logger?: LoggerFacade; } @@ -110,7 +110,7 @@ export interface ProjectConfig { flagRulesMap: { [key: string]: Experiment[] }; flagVariationsMap: { [key: string]: Variation[] }; integrations: Integration[]; - integrationKeyMap?: { [key: string]: Integration }; + integrationKeyMap: { [key: string]: Integration }; odpIntegrationConfig: OdpIntegrationConfig; holdouts: Holdout[]; /** @@ -118,7 +118,7 @@ export interface ProjectConfig { * datafile section. Absent in older datafiles — defaults to an empty array. */ localHoldouts: Holdout[]; - holdoutIdMap?: { [id: string]: Holdout }; + holdoutIdMap: { [id: string]: Holdout }; /** Maps a rule ID to the local holdouts that target it. */ ruleHoldoutsMap: { [ruleId: string]: Holdout[] }; } @@ -126,71 +126,9 @@ export interface ProjectConfig { const EXPERIMENT_RUNNING_STATUS = 'Running'; const RESERVED_ATTRIBUTE_PREFIX = '$opt_'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function createMutationSafeDatafileCopy(datafile: any): ProjectConfig { - const datafileCopy = { ...datafile }; - - datafileCopy.audiences = (datafile.audiences || []).map((audience: Audience) => { - return { ...audience }; - }); - datafileCopy.experiments = (datafile.experiments || []).map((experiment: Experiment) => { - return { ...experiment }; - }); - datafileCopy.featureFlags = (datafile.featureFlags || []).map((featureFlag: FeatureFlag) => { - return { ...featureFlag }; - }); - datafileCopy.groups = (datafile.groups || []).map((group: Group) => { - const groupCopy = { ...group }; - groupCopy.experiments = (group.experiments || []).map(experiment => { - return { ...experiment }; - }); - return groupCopy; - }); - datafileCopy.rollouts = (datafile.rollouts || []).map((rollout: Rollout) => { - const rolloutCopy = { ...rollout }; - rolloutCopy.experiments = (rollout.experiments || []).map(experiment => { - return { ...experiment }; - }); - return rolloutCopy; - }); - - // Shallow-copy each holdout entry so per-entry mutations (e.g. stripping - // `includedRules` from global-section entries) don't bleed into the caller's - // datafile object. - datafileCopy.holdouts = (datafile.holdouts || []).map((holdout: Holdout) => { - return { ...holdout }; - }); - datafileCopy.localHoldouts = (datafile.localHoldouts || []).map((holdout: Holdout) => { - return { ...holdout }; - }); - - datafileCopy.environmentKey = datafile.environmentKey ?? ''; - datafileCopy.sdkKey = datafile.sdkKey ?? ''; - - return datafileCopy; -} - -/** - * Creates projectConfig object to be used for quick project property lookup - * @param {Object} datafileObj JSON datafile representing the project - * @param {string|null} datafileStr JSON string representation of the datafile - * @param {LoggerFacade} logger Optional logger for parse-time diagnostics - * (e.g. invalid local-holdout entries). - * @return {ProjectConfig} Object representing project configuration - */ -export const createProjectConfig = function( - datafileObj?: JSON, - datafileStr: string | null = null, - logger?: LoggerFacade -): ProjectConfig { - const projectConfig = createMutationSafeDatafileCopy(datafileObj); - - if (!projectConfig.region) { - projectConfig.region = 'US'; // Default to US region if not specified - } - - projectConfig.__datafileStr = datafileStr === null ? JSON.stringify(datafileObj) : datafileStr; +const SUPPORTED_DATAFILE_VERSIONS = Object.values(DATAFILE_VERSIONS); +const parseAudienceConfig = (projectConfig: ProjectConfig) => { /* * Conditions of audiences in projectConfig.typedAudiences are not * expected to be string-encoded as they are here in projectConfig.audiences. @@ -203,7 +141,9 @@ export const createProjectConfig = function( projectConfig.audiencesById = {}; assignBy(projectConfig.audiences, 'id', projectConfig.audiencesById); assignBy(projectConfig.typedAudiences, 'id', projectConfig.audiencesById); +} +const parseAttributeConfig = (projectConfig: ProjectConfig) => { projectConfig.attributes = projectConfig.attributes || []; projectConfig.attributeKeyMap = {}; projectConfig.attributeIdMap = {}; @@ -211,38 +151,40 @@ export const createProjectConfig = function( projectConfig.attributeKeyMap[attribute.key] = attribute; projectConfig.attributeIdMap[attribute.id] = attribute; }); +} - projectConfig.eventKeyMap = keyBy(projectConfig.events, 'key'); - projectConfig.groupIdMap = keyBy(projectConfig.groups, 'id'); +const parseGroupConfig = (projectConfig: ProjectConfig) => { + projectConfig.groupIdMap = {}; - let experiments; - Object.keys(projectConfig.groupIdMap || {}).forEach(Id => { - experiments = projectConfig.groupIdMap[Id].experiments; - (experiments || []).forEach(experiment => { - experiment.groupId = Id; + (projectConfig.groups || []).forEach((group) => { + projectConfig.groupIdMap[group.id] = group; + + (group.experiments || []).forEach((experiment) => { + experiment.groupId = group.id; projectConfig.experiments.push(experiment); - }); + }) }); +} - projectConfig.rolloutIdMap = keyBy(projectConfig.rollouts || [], 'id'); - objectValues(projectConfig.rolloutIdMap || {}).forEach(rollout => { - (rollout.experiments || []).forEach(experiment => { +const parseRolloutConfig = (projectConfig: ProjectConfig) => { + projectConfig.rolloutIdMap = {}; + (projectConfig.rollouts || []).forEach((rollout) => { + projectConfig.rolloutIdMap[rollout.id] = rollout; + (rollout.experiments || []).forEach((experiment) => { experiment.isRollout = true projectConfig.experiments.push(experiment); - // Creates { : } map inside of the experiment - experiment.variationKeyMap = keyBy(experiment.variations, 'key'); }); }); +} +const parseIntegrationConfig = (projectConfig: ProjectConfig) => { const allSegmentsSet = new Set(); - Object.keys(projectConfig.audiencesById) - .map(audience => getAudienceSegments(projectConfig.audiencesById[audience])) - .forEach(audienceSegments => { - audienceSegments.forEach(segment => { - allSegmentsSet.add(segment); - }); + Object.keys(projectConfig.audiencesById).forEach(id => { + getAudienceSegments(projectConfig.audiencesById[id]).forEach(segment => { + allSegmentsSet.add(segment); }); + }); const allSegments = Array.from(allSegmentsSet); @@ -251,22 +193,22 @@ export const createProjectConfig = function( let odpApiKey = ''; let odpPixelUrl = ''; - if (projectConfig.integrations) { - projectConfig.integrationKeyMap = keyBy(projectConfig.integrations, 'key'); + projectConfig.integrationKeyMap = {}; - projectConfig.integrations.forEach(integration => { - if (!('key' in integration)) { - throw new OptimizelyError(MISSING_INTEGRATION_KEY); - } + (projectConfig.integrations || []).forEach(integration => { + if (!('key' in integration)) { + throw new OptimizelyError(MISSING_INTEGRATION_KEY); + } - if (integration.key === 'odp') { - odpIntegrated = true; - odpApiKey = odpApiKey || integration.publicKey || ''; - odpApiHost = odpApiHost || integration.host || ''; - odpPixelUrl = odpPixelUrl || integration.pixelUrl || ''; - } - }); - } + projectConfig.integrationKeyMap[integration.key] = integration + + if (integration.key === 'odp') { + odpIntegrated = true; + odpApiKey = odpApiKey || integration.publicKey || ''; + odpApiHost = odpApiHost || integration.host || ''; + odpPixelUrl = odpPixelUrl || integration.pixelUrl || ''; + } + }); if (odpIntegrated) { projectConfig.odpIntegrationConfig = { @@ -276,61 +218,76 @@ export const createProjectConfig = function( } else { projectConfig.odpIntegrationConfig = { integrated: false }; } +} - projectConfig.experimentKeyMap = keyBy(projectConfig.experiments, 'key'); - projectConfig.experimentIdMap = keyBy(projectConfig.experiments, 'id'); - +const parseExperimentConfig = (projectConfig: ProjectConfig) => { + projectConfig.experimentKeyMap = {}; + projectConfig.experimentIdMap = {}; projectConfig.variationIdMap = {}; projectConfig.variationVariableUsageMap = {}; - (projectConfig.experiments || []).forEach(experiment => { - // Creates { : } map inside of the experiment - experiment.variationKeyMap = keyBy(experiment.variations, 'key'); - assignBy(experiment.variations, 'id', projectConfig.variationIdMap); + (projectConfig.experiments || []).forEach((experiment) => { + projectConfig.experimentKeyMap[experiment.key] = experiment; + projectConfig.experimentIdMap[experiment.id] = experiment; - objectValues(experiment.variationKeyMap || {}).forEach(variation => { + experiment.variationKeyMap = {}; + (experiment.variations || []).forEach((variation) => { + experiment.variationKeyMap[variation.key] = variation; + projectConfig.variationIdMap[variation.id] = variation; if (variation.variables) { projectConfig.variationVariableUsageMap[variation.id] = keyBy(variation.variables, 'id'); } }); }); +} +const parseFeatureFlagConfig = (projectConfig: ProjectConfig) => { // Object containing experiment Ids that exist in any feature // for checking that experiment is a feature experiment or not. projectConfig.experimentFeatureMap = {}; + projectConfig.featureKeyMap = {} + + // all rules (experiment rules and delivery rules) for each flag + projectConfig.flagRulesMap = {}; + projectConfig.flagVariationsMap = {}; + + (projectConfig.featureFlags || []).forEach((feature) => { + projectConfig.featureKeyMap[feature.key] = feature; + + feature.variableKeyMap = {} - projectConfig.featureKeyMap = keyBy(projectConfig.featureFlags || [], 'key'); - objectValues(projectConfig.featureKeyMap || {}).forEach(feature => { - // Json type is represented in datafile as a subtype of string for the sake of backwards compatibility. - // Converting it to a first-class json type while creating Project Config feature.variables.forEach(variable => { + // Json type is represented in datafile as a subtype of string for the sake of backwards compatibility. + // Converting it to a first-class json type while creating Project Config if (variable.type === FEATURE_VARIABLE_TYPES.STRING && variable.subType === FEATURE_VARIABLE_TYPES.JSON) { variable.type = FEATURE_VARIABLE_TYPES.JSON as VariableType; delete variable.subType; } + + feature.variableKeyMap[variable.key] = variable; }); - feature.variableKeyMap = keyBy(feature.variables, 'key'); + + const flagRuleExperiments: Experiment[] = []; + + // all variations for the flag mapped by id + const flagVariationsById: Record = {}; + + const everyoneElseVariation = getEveryoneElseVariation(projectConfig, feature); + (feature.experimentIds || []).forEach(experimentId => { - // Add this experiment in experiment-feature map. - if (projectConfig.experimentFeatureMap[experimentId]) { - projectConfig.experimentFeatureMap[experimentId].push(feature.id); - } else { - projectConfig.experimentFeatureMap[experimentId] = [feature.id]; - } - }); - }); - // Inject "everyone else" variation into feature rollout (FR) experiments - (projectConfig.featureFlags || []).forEach(featureFlag => { - const everyoneElseVariation = getEveryoneElseVariation(projectConfig, featureFlag); - if (!everyoneElseVariation) { - return; - } + projectConfig.experimentFeatureMap[experimentId] = + projectConfig.experimentFeatureMap[experimentId] || []; - (featureFlag.experimentIds || []).forEach(experimentId => { + projectConfig.experimentFeatureMap[experimentId].push(feature.id); + const experiment = projectConfig.experimentIdMap[experimentId]; - if (experiment && experiment.type === EXPERIMENT_TYPES.FR) { + + flagRuleExperiments.push(experiment); + + // Inject "everyone else" variation into feature rollout (FR) experiments + if (experiment && experiment.type === EXPERIMENT_TYPES.FR && everyoneElseVariation) { experiment.variations.push(everyoneElseVariation); experiment.trafficAllocation.push({ entityId: everyoneElseVariation.id, @@ -340,47 +297,78 @@ export const createProjectConfig = function( // Update variation lookup map experiment.variationKeyMap[everyoneElseVariation.key] = everyoneElseVariation; } - }); - }); - - // all rules (experiment rules and delivery rules) for each flag - projectConfig.flagRulesMap = {}; - (projectConfig.featureFlags || []).forEach(featureFlag => { - const flagRuleExperiments: Experiment[] = []; - featureFlag.experimentIds.forEach(experimentId => { - const experiment = projectConfig.experimentIdMap[experimentId]; - if (experiment) { - flagRuleExperiments.push(experiment); - } + (experiment.variations || []).forEach((variation) => { + flagVariationsById[variation.id] = variation; + }); }); - const rollout = projectConfig.rolloutIdMap[featureFlag.rolloutId]; + // add all rollout experiments to the flagRuleExperiments list + const rollout = projectConfig.rolloutIdMap[feature.rolloutId]; if (rollout) { - flagRuleExperiments.push(...rollout.experiments); - } + (rollout.experiments || []).forEach((experiment) => { + flagRuleExperiments.push(experiment); + (experiment.variations || []).forEach((variation) => { + flagVariationsById[variation.id] = variation; + }); + }); + } - projectConfig.flagRulesMap[featureFlag.key] = flagRuleExperiments; + projectConfig.flagRulesMap[feature.key] = flagRuleExperiments; + projectConfig.flagVariationsMap[feature.key] = Object.values(flagVariationsById) }); +} - // all variations for each flag - // - datafile does not contain a separate entity for this. - // - we collect variations used in each rule (experiment rules and delivery rules) - projectConfig.flagVariationsMap = {}; +/** + * Creates projectConfig object to be used for quick project property lookup + * @param {string} datafileStr JSON string representation of the datafile + * @return {ProjectConfig} Object representing project configuration + */ +export const createProjectConfig = function(datafileStr: string, options?: CreateProjectConfigOptions): ProjectConfig { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let projectConfig: ProjectConfig; - objectEntries(projectConfig.flagRulesMap || {}).forEach(([flagKey, rules]) => { - const variations: OptimizelyVariation[] = []; - rules.forEach(rule => { - rule.variations.forEach(variation => { - if (!find(variations, item => item.id === variation.id)) { - variations.push(variation); - } - }); - }); - projectConfig.flagVariationsMap[flagKey] = variations; - }); + try { + projectConfig = JSON.parse(datafileStr); + } catch { + throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); + } + + const version = (projectConfig as unknown as { version: string }).version + + if (SUPPORTED_DATAFILE_VERSIONS.indexOf(version) === -1) { + throw new OptimizelyError(INVALID_DATAFILE_VERSION, version); + } + + if (options?.jsonSchemaValidator) { + options.jsonSchemaValidator(projectConfig); + options.logger?.info(VALID_DATAFILE); + } else { + options?.logger?.info(SKIPPING_JSON_VALIDATION); + } + + if (!projectConfig.region) { + projectConfig.region = 'US'; + } + + projectConfig.__datafileStr = datafileStr; + + parseAudienceConfig(projectConfig); + parseAttributeConfig(projectConfig); + + projectConfig.eventKeyMap = keyBy(projectConfig.events, 'key'); + + parseGroupConfig(projectConfig); - parseHoldoutsConfig(projectConfig, logger); + parseRolloutConfig(projectConfig); + + parseIntegrationConfig(projectConfig); + + parseExperimentConfig(projectConfig); + + parseFeatureFlagConfig(projectConfig); + + parseHoldoutsConfig(projectConfig, options?.logger); return projectConfig; }; @@ -984,43 +972,6 @@ export const toDatafile = function(projectConfig: ProjectConfig): string { return projectConfig.__datafileStr; }; -/** - * @typedef {Object} - * @property {Object|null} configObj - * @property {Error|null} error - */ - -/** - * Try to create a project config object from the given datafile and - * configuration properties. - * Returns a ProjectConfig if successful. - * Otherwise, throws an error. - * @param {Object} config - * @param {Object|string} config.datafile - * @param {Object} config.jsonSchemaValidator - * @param {Object} config.logger - * @returns {Object} ProjectConfig - * @throws {Error} - */ -export const tryCreatingProjectConfig = function( - config: TryCreatingProjectConfigConfig -): ProjectConfig { - const newDatafileObj = configValidator.validateDatafile(config.datafile); - - if (config.jsonSchemaValidator) { - config.jsonSchemaValidator(newDatafileObj); - config.logger?.info(VALID_DATAFILE); - } else { - config.logger?.info(SKIPPING_JSON_VALIDATION); - } - - // Pass the datafile string (when available) and the logger so parse-time - // diagnostics (e.g. invalid local-holdout entries) are surfaced. - const datafileStr = typeof config.datafile === 'string' ? config.datafile : null; - const newConfigObj = createProjectConfig(newDatafileObj, datafileStr, config.logger); - return newConfigObj; -}; - /** * Get the send flag decisions value * @param {ProjectConfig} projectConfig @@ -1056,7 +1007,6 @@ export default { eventWithKeyExists, isFeatureExperiment, toDatafile, - tryCreatingProjectConfig, getTrafficAllocation, }; diff --git a/lib/project_config/project_config_manager.spec.ts b/lib/project_config/project_config_manager.spec.ts index 507c90b46..8fb63dc98 100644 --- a/lib/project_config/project_config_manager.spec.ts +++ b/lib/project_config/project_config_manager.spec.ts @@ -23,8 +23,6 @@ import { resolvablePromise } from '../utils/promise/resolvablePromise'; import { getMockDatafileManager } from '../tests/mock/mock_datafile_manager'; import { wait } from '../tests/testUtils'; -const cloneDeep = (x: any) => JSON.parse(JSON.stringify(x)); - describe('ProjectConfigManagerImpl', () => { describe('a logger is passed in the constructor', () => { it('should set name on the logger passed into the constructor', () => { @@ -92,7 +90,7 @@ describe('ProjectConfigManagerImpl', () => { describe('when constructed with only a datafile', () => { it('should reject onRunning() and log error if the datafile is invalid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: {}}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify({})}); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); expect(logger.error).toHaveBeenCalled(); @@ -100,7 +98,7 @@ describe('ProjectConfigManagerImpl', () => { it('should set status to Failed if the datafile is invalid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: {}}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify({})}); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); expect(manager.getState()).toBe(ServiceState.Failed); @@ -115,7 +113,7 @@ describe('ProjectConfigManagerImpl', () => { it('should fulfill onRunning() and set status to Running if the datafile is valid', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); manager.start(); await expect(manager.onRunning()).resolves.not.toThrow(); expect(manager.getState()).toBe(ServiceState.Running); @@ -123,7 +121,7 @@ describe('ProjectConfigManagerImpl', () => { it('should call onUpdate listeners registered before start() with the project config', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); @@ -131,16 +129,16 @@ describe('ProjectConfigManagerImpl', () => { await manager.onRunning(); expect(listener).toHaveBeenCalledOnce(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return the correct config from getConfig() both before or after onRunning() resolves', async () => { const logger = getMockLogger(); - const manager = new ProjectConfigManagerImpl({ logger, datafile: testData.getTestProjectConfig()}); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(testData.getTestProjectConfig())}); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); @@ -152,7 +150,7 @@ describe('ProjectConfigManagerImpl', () => { onRunning: resolvablePromise().promise, // this will not be resolved }); vi.spyOn(datafileManager, 'onRunning'); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); expect(datafileManager.onRunning).toHaveBeenCalled(); @@ -165,7 +163,7 @@ describe('ProjectConfigManagerImpl', () => { onRunning, }); vi.spyOn(datafileManager, 'onRunning'); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); expect(datafileManager.onRunning).toHaveBeenCalled(); @@ -179,11 +177,11 @@ describe('ProjectConfigManagerImpl', () => { const listener = vi.fn(); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.onUpdate(listener); manager.start(); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return the correct config from getConfig() both before or after onRunning() resolves', async () => { @@ -191,60 +189,60 @@ describe('ProjectConfigManagerImpl', () => { onRunning: resolvablePromise().promise, // this will not be resolved }); - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig(), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()), datafileManager }); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); describe('when datafile is invalid', () => { it('should reject onRunning() with the same error if datafileManager.onRunning() rejects', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.reject(new Error('test error')) }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); manager.start(); await expect(manager.onRunning()).rejects.toThrow('DatafileManager failed to start, reason: test error'); }); it('should resolve onRunning() if datafileManager.onUpdate() is fired and should update config', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); manager.start(); const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return undefined from getConfig() before onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); manager.start(); expect(manager.getConfig()).toBeUndefined(); }); it('should return the correct config from getConfig() after onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: {}, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); }); @@ -273,10 +271,10 @@ describe('ProjectConfigManagerImpl', () => { const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); - expect(listener).toHaveBeenCalledWith(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); it('should return undefined from getConfig() before onRunning() resolves', async () => { @@ -291,9 +289,9 @@ describe('ProjectConfigManagerImpl', () => { const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); }); @@ -301,25 +299,25 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({}); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); - const updatedDatafile = cloneDeep(datafile); + const updatedDatafile = testData.getTestProjectConfig(); updatedDatafile['revision'] = '99'; - datafileManager.pushUpdate(updatedDatafile); + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(updatedDatafile)); - expect(listener).toHaveBeenNthCalledWith(2, createProjectConfig(updatedDatafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(updatedDatafile))); + expect(listener).toHaveBeenNthCalledWith(2, createProjectConfig(JSON.stringify(updatedDatafile))); }); it('should not call onUpdate handlers and should log error when datafileManager onUpdate is fired with invalid datafile', async () => { @@ -327,24 +325,24 @@ describe('ProjectConfigManagerImpl', () => { const logger = getMockLogger(); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ logger, datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(testData.getTestProjectConfig())); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); - expect(listener).toHaveBeenCalledWith(createProjectConfig(datafile)); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(datafile))); - const updatedDatafile = {}; - datafileManager.pushUpdate(updatedDatafile); + const updatedDatafile = {}; + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); expect(listener).toHaveBeenCalledTimes(1); expect(logger.error).toHaveBeenCalled(); }); @@ -354,41 +352,41 @@ describe('ProjectConfigManagerImpl', () => { const datafile = testData.getTestProjectConfig(); const jsonSchemaValidator = vi.fn().mockReturnValue(true); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager, jsonSchemaValidator }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager, jsonSchemaValidator }); manager.start(); await manager.onRunning(); - const updatedDatafile = cloneDeep(datafile); + const updatedDatafile = testData.getTestProjectConfig(); updatedDatafile['revision'] = '99'; - datafileManager.pushUpdate(updatedDatafile); + datafileManager.pushUpdate(JSON.stringify(updatedDatafile)); await Promise.resolve(); expect(jsonSchemaValidator).toHaveBeenCalledTimes(2); - expect(jsonSchemaValidator).toHaveBeenNthCalledWith(1, datafile); - expect(jsonSchemaValidator).toHaveBeenNthCalledWith(2, updatedDatafile); + expect(jsonSchemaValidator.mock.calls[0][0].version).toBe(datafile.version); + expect(jsonSchemaValidator.mock.calls[1][0].revision).toBe('99'); }); it('should not call onUpdate handlers when datafileManager onUpdate is fired with the same datafile', async () => { const datafileManager = getMockDatafileManager({}); const datafile = testData.getTestProjectConfig(); - const manager = new ProjectConfigManagerImpl({ datafile, datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile), datafileManager }); const listener = vi.fn(); manager.onUpdate(listener); manager.start(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); await manager.onRunning(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); - datafileManager.pushUpdate(cloneDeep(datafile)); + datafileManager.pushUpdate(JSON.stringify(datafile)); await Promise.resolve(); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); expect(listener).toHaveBeenCalledTimes(1); }); @@ -396,7 +394,7 @@ describe('ProjectConfigManagerImpl', () => { const datafile = testData.getTestProjectConfig(); const datafileManager = getMockDatafileManager({}); - const manager = new ProjectConfigManagerImpl({ datafile }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(datafile) }); const listener = vi.fn(); const dispose = manager.onUpdate(listener); @@ -404,11 +402,11 @@ describe('ProjectConfigManagerImpl', () => { manager.start(); await manager.onRunning(); - expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(datafile)); + expect(listener).toHaveBeenNthCalledWith(1, createProjectConfig(JSON.stringify(datafile))); dispose(); - datafileManager.pushUpdate(cloneDeep(testData.getTestProjectConfigWithFeatures())); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfigWithFeatures())); await Promise.resolve(); expect(listener).toHaveBeenCalledTimes(1); }); @@ -424,8 +422,8 @@ describe('ProjectConfigManagerImpl', () => { manager.start(); await manager.onRunning(); - expect(listener).toHaveBeenCalledWith(createProjectConfig(datafile)); - expect(manager.getConfig()).toEqual(createProjectConfig(datafile)); + expect(listener).toHaveBeenCalledWith(createProjectConfig(JSON.stringify(datafile))); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(datafile))); }); it('should reject onRunning() and log error if the datafile string is an invalid json', async () => { @@ -439,7 +437,7 @@ describe('ProjectConfigManagerImpl', () => { it('should reject onRunning() and log error if the datafile version is not supported', async () => { const logger = getMockLogger(); const datafile = testData.getUnsupportedVersionConfig(); - const manager = new ProjectConfigManagerImpl({ logger, datafile }); + const manager = new ProjectConfigManagerImpl({ logger, datafile: JSON.stringify(datafile) }); manager.start(); await expect(manager.onRunning()).rejects.toThrow(); @@ -476,7 +474,7 @@ describe('ProjectConfigManagerImpl', () => { }); it('should set status to Terminated immediately if no datafile manager is provided and resolve onTerminated', async () => { - const manager = new ProjectConfigManagerImpl({ datafile: testData.getTestProjectConfig() }); + const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify(testData.getTestProjectConfig()) }); manager.stop(); expect(manager.getState()).toBe(ServiceState.Terminated); await expect(manager.onTerminated()).resolves.not.toThrow(); @@ -487,7 +485,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -502,7 +500,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -521,7 +519,7 @@ describe('ProjectConfigManagerImpl', () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve(), onTerminated: datafileManagerTerminated.promise }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); manager.stop(); @@ -544,12 +542,12 @@ describe('ProjectConfigManagerImpl', () => { const listener = vi.fn(); manager.onUpdate(listener); - datafileManager.pushUpdate(testData.getTestProjectConfig()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await manager.onRunning(); expect(listener).toHaveBeenCalledTimes(1); manager.stop(); - datafileManager.pushUpdate(testData.getTestProjectConfigWithFeatures()); + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfigWithFeatures())); datafileManagerTerminated.resolve(); await expect(manager.onTerminated()).resolves.not.toThrow(); diff --git a/lib/project_config/project_config_manager.ts b/lib/project_config/project_config_manager.ts index b7d527a23..0985c5c3a 100644 --- a/lib/project_config/project_config_manager.ts +++ b/lib/project_config/project_config_manager.ts @@ -17,7 +17,7 @@ import { LoggerFacade } from '../logging/logger'; import { createOptimizelyConfig } from './optimizely_config'; import { OptimizelyConfig } from '../shared_types'; import { DatafileManager } from './datafile_manager'; -import { ProjectConfig, toDatafile, tryCreatingProjectConfig } from './project_config'; +import { ProjectConfig, toDatafile, createProjectConfig } from './project_config'; import { Service, ServiceState, BaseService } from '../service'; import { Consumer, Fn, Transformer } from '../utils/type'; import { EventEmitter } from '../utils/event_emitter/event_emitter'; @@ -33,7 +33,7 @@ export const GOT_INVALID_DATAFILE = 'got invalid datafile'; import { sprintf } from '../utils/fns'; import { Platform } from '../platform_support'; interface ProjectConfigManagerConfig { - datafile?: string | Record; + datafile?: string; jsonSchemaValidator?: Transformer, datafileManager?: DatafileManager; logger?: LoggerFacade; @@ -57,7 +57,7 @@ export interface ProjectConfigManager extends Service { export const LOGGER_NAME = 'ProjectConfigManager'; export class ProjectConfigManagerImpl extends BaseService implements ProjectConfigManager { - private datafile?: string | object; + private datafile?: string; private projectConfig?: ProjectConfig; private optimizelyConfig?: OptimizelyConfig; public jsonSchemaValidator?: Transformer; @@ -146,14 +146,13 @@ export class ProjectConfigManagerImpl extends BaseService implements ProjectConf * the project config and optimizely config objects will not be updated. If the error * is fatal, handleInitError will be called. */ - private handleNewDatafile(newDatafile: string | object, fromConfig = false): void { + private handleNewDatafile(newDatafile: string, fromConfig = false): void { if (this.isDone()) { return; } try { - const config = tryCreatingProjectConfig({ - datafile: newDatafile, + const config = createProjectConfig(newDatafile, { jsonSchemaValidator: this.jsonSchemaValidator, logger: this.logger, }); diff --git a/lib/tests/mock/mock_datafile_manager.ts b/lib/tests/mock/mock_datafile_manager.ts index 1c9d66b38..2a48f3660 100644 --- a/lib/tests/mock/mock_datafile_manager.ts +++ b/lib/tests/mock/mock_datafile_manager.ts @@ -21,14 +21,14 @@ import { BaseService } from '../../service'; import { LoggerFacade } from '../../logging/logger'; type MockConfig = { - datafile?: string | object; + datafile?: string; onRunning?: Promise, onTerminated?: Promise, } class MockDatafileManager extends BaseService implements DatafileManager { eventEmitter: EventEmitter<{ update: string}> = new EventEmitter(); - datafile: string | object | undefined; + datafile: string | undefined; constructor(opt: MockConfig) { super(); @@ -49,9 +49,6 @@ class MockDatafileManager extends BaseService implements DatafileManager { } get(): string | undefined { - if (typeof this.datafile === 'object') { - return JSON.stringify(this.datafile); - } return this.datafile; } @@ -63,10 +60,7 @@ class MockDatafileManager extends BaseService implements DatafileManager { return this.eventEmitter.on('update', listener) } - pushUpdate(datafile: string | object): void { - if (typeof datafile === 'object') { - datafile = JSON.stringify(datafile); - } + pushUpdate(datafile: string): void { this.datafile = datafile; this.eventEmitter.emit('update', datafile); } diff --git a/lib/utils/config_validator/index.spec.ts b/lib/utils/config_validator/index.spec.ts deleted file mode 100644 index c8496ecc4..000000000 --- a/lib/utils/config_validator/index.spec.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { describe, it, expect } from 'vitest'; -import configValidator from './'; -import testData from '../../tests/test_data'; -import { INVALID_DATAFILE_MALFORMED, INVALID_DATAFILE_VERSION, NO_DATAFILE_SPECIFIED } from 'error_message'; -import { OptimizelyError } from '../../error/optimizly_error'; - -describe('validate', () => { - it('should complain if datafile is not provided', () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - expect(() => configValidator.validateDatafile()).toThrow(OptimizelyError); - - try { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - configValidator.validateDatafile(); - } catch (err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(NO_DATAFILE_SPECIFIED); - } - }); - - it('should complain if datafile is malformed', () => { - expect(() => configValidator.validateDatafile('abc')).toThrow( OptimizelyError); - - try { - configValidator.validateDatafile('abc'); - } catch(err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(INVALID_DATAFILE_MALFORMED); - } - }); - - it('should complain if datafile version is not supported', () => { - expect(() => configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())).toThrow(OptimizelyError)); - - try { - configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())); - } catch(err) { - expect(err).toBeInstanceOf(OptimizelyError); - expect(err.baseMessage).toBe(INVALID_DATAFILE_VERSION); - expect(err.params).toEqual(['5']); - } - }); - - it('should not complain if datafile is valid', () => { - expect(() => configValidator.validateDatafile(JSON.stringify(testData.getTestProjectConfig())).not.toThrowError()); - }); -}); diff --git a/lib/utils/config_validator/index.tests.js b/lib/utils/config_validator/index.tests.js deleted file mode 100644 index 2680a07da..000000000 --- a/lib/utils/config_validator/index.tests.js +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2016, 2018-2020, 2022, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { assert } from 'chai'; -import { sprintf } from '../../utils/fns'; - -import configValidator from './'; -import testData from '../../tests/test_data'; -import { - INVALID_DATAFILE_MALFORMED, - INVALID_DATAFILE_VERSION, - INVALID_ERROR_HANDLER, - INVALID_EVENT_DISPATCHER, - INVALID_LOGGER, - NO_DATAFILE_SPECIFIED, -} from 'error_message'; - -describe('lib/utils/config_validator', function() { - describe('APIs', function() { - describe('validate', function() { - it.skip('should complain if the provided error handler is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - errorHandler: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_ERROR_HANDLER); - }); - - it.skip('should complain if the provided event dispatcher is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - eventDispatcher: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_EVENT_DISPATCHER); - }); - - it.skip('should complain if the provided logger is invalid', function() { - const ex = assert.throws(function() { - configValidator.validate({ - logger: {}, - }); - }); - assert.equal(ex.baseMessage, INVALID_LOGGER); - }); - - it('should complain if datafile is not provided', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile(); - }); - assert.equal(ex.baseMessage, NO_DATAFILE_SPECIFIED); - }); - - it('should complain if datafile is malformed', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile('abc'); - }); - assert.equal(ex.baseMessage, INVALID_DATAFILE_MALFORMED); - }); - - it('should complain if datafile version is not supported', function() { - const ex = assert.throws(function() { - configValidator.validateDatafile(JSON.stringify(testData.getUnsupportedVersionConfig())); - }); - assert.equal(ex.baseMessage, INVALID_DATAFILE_VERSION); - assert.deepEqual(ex.params, ['5']); - }); - - it('should not complain if datafile is valid', function() { - assert.doesNotThrow(function() { - configValidator.validateDatafile(JSON.stringify(testData.getTestProjectConfig())); - }); - }); - }); - }); -}); diff --git a/lib/utils/config_validator/index.ts b/lib/utils/config_validator/index.ts deleted file mode 100644 index 4b59b066d..000000000 --- a/lib/utils/config_validator/index.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2016, 2018-2020, 2022, 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { - DATAFILE_VERSIONS, -} from '../enums'; -import { - INVALID_DATAFILE_MALFORMED, - INVALID_DATAFILE_VERSION, - NO_DATAFILE_SPECIFIED, -} from 'error_message'; -import { OptimizelyError } from '../../error/optimizly_error'; -import { Platform } from '../../platform_support'; -const SUPPORTED_VERSIONS = [DATAFILE_VERSIONS.V2, DATAFILE_VERSIONS.V3, DATAFILE_VERSIONS.V4]; - -/** - * Validates the datafile - * @param {Object|string} datafile - * @return {Object} The datafile object if the datafile is valid - * @throws If the datafile is not valid for any of the following reasons: - - The datafile string is undefined - - The datafile string cannot be parsed as a JSON object - - The datafile version is not supported - */ -// eslint-disable-next-line -export const validateDatafile = function(datafile: unknown): any { - if (!datafile) { - throw new OptimizelyError(NO_DATAFILE_SPECIFIED); - } - if (typeof datafile === 'string') { - // Attempt to parse the datafile string - try { - datafile = JSON.parse(datafile); - } catch (ex) { - throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); - } - } - if (typeof datafile === 'object' && !Array.isArray(datafile) && datafile !== null) { - if (SUPPORTED_VERSIONS.indexOf(datafile['version' as keyof unknown]) === -1) { - throw new OptimizelyError(INVALID_DATAFILE_VERSION, datafile['version' as keyof unknown]); - } - } else { - throw new OptimizelyError(INVALID_DATAFILE_MALFORMED); - } - - return datafile; -}; - -export default { - validateDatafile: validateDatafile, -} - -export const __platforms: Platform[] = ['__universal__']; diff --git a/package-lock.json b/package-lock.json index ec9915af4..f0e86527e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,7 +38,6 @@ "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", "jiti": "^2.4.1", - "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", @@ -1136,9 +1135,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -1147,9 +1146,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -1186,9 +1185,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -1197,9 +1196,9 @@ } }, "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -1301,13 +1300,13 @@ } }, "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" @@ -1387,9 +1386,9 @@ } }, "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz", + "integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==", "dev": true, "license": "MIT", "dependencies": { @@ -1782,9 +1781,9 @@ } }, "node_modules/@puppeteer/browsers/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "dependencies": { @@ -1884,9 +1883,9 @@ } }, "node_modules/@react-native/codegen/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -1998,9 +1997,9 @@ } }, "node_modules/@react-native/dev-middleware/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -3457,13 +3456,13 @@ } }, "node_modules/@wdio/logger/node_modules/strip-ansi": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", - "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", "dev": true, "license": "MIT", "dependencies": { - "ansi-regex": "^6.0.1" + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" @@ -3493,9 +3492,9 @@ } }, "node_modules/@wdio/repl/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -3523,9 +3522,9 @@ } }, "node_modules/@wdio/types/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -3868,9 +3867,9 @@ } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dev": true, "license": "MIT", "dependencies": { @@ -3903,9 +3902,9 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -3985,9 +3984,9 @@ } }, "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -4503,9 +4502,9 @@ "license": "ISC" }, "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", "dev": true, "license": "MIT", "dependencies": { @@ -5328,9 +5327,9 @@ } }, "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -5515,23 +5514,23 @@ } }, "node_modules/edgedriver/node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", + "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "engines": { - "node": ">=16" + "node": ">=20" } }, "node_modules/edgedriver/node_modules/which": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-6.0.0.tgz", - "integrity": "sha512-f+gEpIKMR9faW/JgAgPK1D7mekkFoqbmiwvNzuhsHetni20QSgzg9Vhn0g2JSJkkfehQnqdUAx7/e15qS1lPxg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", + "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", "dev": true, "license": "ISC", "dependencies": { - "isexe": "^3.1.1" + "isexe": "^4.0.0" }, "bin": { "node-which": "bin/which.js" @@ -5587,19 +5586,6 @@ "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" } }, - "node_modules/encoding-sniffer/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/end-of-stream": { "version": "1.4.5", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", @@ -5897,9 +5883,9 @@ } }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -5935,9 +5921,9 @@ } }, "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6735,9 +6721,9 @@ "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -6746,9 +6732,9 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -6834,9 +6820,9 @@ } }, "node_modules/happy-dom/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -7054,6 +7040,19 @@ "node": ">= 6" } }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -7717,9 +7716,9 @@ } }, "node_modules/jest-util/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "peer": true, @@ -8810,9 +8809,9 @@ } }, "node_modules/metro/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -8833,9 +8832,9 @@ } }, "node_modules/metro/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -8878,9 +8877,9 @@ } }, "node_modules/micromatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -8926,13 +8925,13 @@ } }, "node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", "dev": true, "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^2.0.2" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -9049,9 +9048,9 @@ } }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -9803,9 +9802,9 @@ "license": "ISC" }, "node_modules/path-to-regexp": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", - "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", "dev": true, "license": "MIT", "funding": { @@ -9855,9 +9854,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", "dev": true, "license": "MIT", "engines": { @@ -10264,9 +10263,9 @@ } }, "node_modules/react-devtools-core/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -10408,9 +10407,9 @@ "peer": true }, "node_modules/react-native/node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "version": "7.5.11", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.11.tgz", + "integrity": "sha512-zS54Oen9bITtp7kp2XM3AydrCIq1D+HwJOuH+c+e4LfpL/lotP5osijd+UoMnxwAam1GN8R4KtLAyIrIcBNpiA==", "dev": true, "license": "MIT", "peer": true, @@ -10431,9 +10430,9 @@ } }, "node_modules/react-native/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dev": true, "license": "MIT", "peer": true, @@ -10500,9 +10499,9 @@ } }, "node_modules/readdir-glob/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", "dev": true, "license": "ISC", "dependencies": { @@ -10526,9 +10525,9 @@ } }, "node_modules/readdirp/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -10843,9 +10842,9 @@ } }, "node_modules/schema-utils/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", "dev": true, "license": "MIT", "dependencies": { @@ -10880,9 +10879,9 @@ "license": "MIT" }, "node_modules/semver": { - "version": "7.7.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", - "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "dev": true, "license": "ISC", "bin": { @@ -11117,9 +11116,9 @@ } }, "node_modules/sinon/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.1.tgz", + "integrity": "sha512-Z3u54A8qGyqFOSr2pk0ijYs8mOE9Qz8kTvtKeBI+upoG9j04Sq+oI7W8zAJiQybDcESET8/uIdHzs0p3k4fZlw==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -11703,9 +11702,9 @@ } }, "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", "dev": true, "license": "MIT", "dependencies": { @@ -11714,9 +11713,9 @@ } }, "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "license": "ISC", "dependencies": { @@ -11946,9 +11945,9 @@ } }, "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -12071,9 +12070,9 @@ } }, "node_modules/undici": { - "version": "7.18.2", - "resolved": "https://registry.npmjs.org/undici/-/undici-7.18.2.tgz", - "integrity": "sha512-y+8YjDFzWdQlSE9N5nzKMT3g4a5UBX1HKowfdXh0uvAnTaqqwqB92Jt4UXBAeKekDs5IaDKyJFR4X1gYVCgXcw==", + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.28.0.tgz", + "integrity": "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==", "dev": true, "license": "MIT", "engines": { @@ -12526,9 +12525,9 @@ } }, "node_modules/webdriver/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -12560,9 +12559,9 @@ } }, "node_modules/webdriver/node_modules/undici": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-6.23.0.tgz", - "integrity": "sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==", + "version": "6.27.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.27.0.tgz", + "integrity": "sha512-YmfV3YnEDzXRC5lZ2jWtWWHKGUm1zIt8AhesR1tens+HTNv+YZlN/dp6G727LOvMJ8xjP9Be7Y2Sdr96LDm+pg==", "dev": true, "license": "MIT", "engines": { @@ -12622,9 +12621,9 @@ } }, "node_modules/webdriverio/node_modules/@types/node": { - "version": "20.19.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.28.tgz", - "integrity": "sha512-VyKBr25BuFDzBFCK5sUM6ZXiWfqgCTwTAOK8qzGV/m9FCirXYDlmczJ+d5dXBAQALGCdRRdbteKYfJ84NGEusw==", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -12740,9 +12739,9 @@ } }, "node_modules/webpack/node_modules/es-module-lexer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.0.0.tgz", - "integrity": "sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", + "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", "dev": true, "license": "MIT" }, @@ -12760,19 +12759,6 @@ "node": ">=18" } }, - "node_modules/whatwg-encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/whatwg-fetch": { "version": "3.6.20", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.6.20.tgz", @@ -12906,9 +12892,9 @@ } }, "node_modules/ws": { - "version": "8.19.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", - "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", "dev": true, "license": "MIT", "engines": { @@ -12962,9 +12948,9 @@ } }, "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.2.tgz", + "integrity": "sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index cbc2eebe8..00480aa9d 100644 --- a/package.json +++ b/package.json @@ -127,7 +127,6 @@ "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", "jiti": "^2.4.1", - "lodash": "^4.17.11", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", From 72a727ab23a41bea10eee4114aaf5a14bfedc402 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Jul 2026 21:35:56 +0600 Subject: [PATCH 15/39] [FSSDK-12868] update version assertions in tests (#1165) --- lib/index.browser.tests.js | 2 +- lib/index.node.tests.js | 3 ++- lib/index.react_native.spec.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/index.browser.tests.js b/lib/index.browser.tests.js index 0f032bef9..21576b24a 100644 --- a/lib/index.browser.tests.js +++ b/lib/index.browser.tests.js @@ -152,7 +152,7 @@ describe('javascript-sdk (Browser)', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.4.0'); + assert.equal(optlyInstance.clientVersion, packageJSON.version); }); it('should set the JavaScript client engine and version', function() { diff --git a/lib/index.node.tests.js b/lib/index.node.tests.js index eb4bd13f5..382f0cc9f 100644 --- a/lib/index.node.tests.js +++ b/lib/index.node.tests.js @@ -18,6 +18,7 @@ import sinon from 'sinon'; import Optimizely from './optimizely'; import testData from './tests/test_data'; +import packageJSON from '../package.json'; import * as optimizelyFactory from './index.node'; import { getMockProjectConfigManager } from './tests/mock/mock_project_config_manager'; import { wrapConfigManager } from './project_config/config_manager_factory'; @@ -87,7 +88,7 @@ describe('optimizelyFactory', function() { }); assert.instanceOf(optlyInstance, Optimizely); - assert.equal(optlyInstance.clientVersion, '6.4.0'); + assert.equal(optlyInstance.clientVersion, packageJSON.version); }); // TODO: user will create and inject an event processor // these tests will be refactored accordingly diff --git a/lib/index.react_native.spec.ts b/lib/index.react_native.spec.ts index 9f9e16d63..0715c6518 100644 --- a/lib/index.react_native.spec.ts +++ b/lib/index.react_native.spec.ts @@ -91,7 +91,7 @@ describe('javascript-sdk/react-native', () => { expect(optlyInstance).toBeInstanceOf(Optimizely); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - expect(optlyInstance.clientVersion).toEqual('6.4.0'); + expect(optlyInstance.clientVersion).toEqual(packageJSON.version); }); it('should set the React Native JS client engine and javascript SDK version', () => { From e5a4f5d8cc5125bf8c5f0b47f7e9a5cb78aaa540 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Jul 2026 22:01:01 +0600 Subject: [PATCH 16/39] [FSSDK-12868] remove localHoldout feature toggle (#1166) --- lib/core/decision_service/index.ts | 56 +++++++++++++----------------- lib/feature_toggle.ts | 3 -- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 7d2ebf093..2064ec2a2 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -78,8 +78,6 @@ import { Maybe, OpType } from '../../utils/type'; import { Value } from '../../utils/promise/operation_value'; import { Platform } from '../../platform_support'; -import { localHoldout } from '../../feature_toggle'; - export const EXPERIMENT_NOT_RUNNING = 'Experiment %s is not running.'; export const RETURNING_STORED_VARIATION = 'Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.'; @@ -1609,21 +1607,19 @@ export class DecisionService { }); } - if (localHoldout()) { - // Check local holdouts targeting this specific experiment rule. - // Inserted immediately after the forced-decision block, before regular rule evaluation. - const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); - for (const holdout of localHoldoutsForExperiment) { - const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); - decideReasons.push(...holdoutDecision.reasons); - if (holdoutDecision.result.variation) { - // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. - return Value.of(op, { - result: holdoutDecision.result, - reasons: decideReasons, - holdoutDecision: true, - }); - } + // Check local holdouts targeting this specific experiment rule. + // Inserted immediately after the forced-decision block, before regular rule evaluation. + const localHoldoutsForExperiment = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForExperiment) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. + return Value.of(op, { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }); } } @@ -1663,20 +1659,18 @@ export class DecisionService { }; } - if (localHoldout()) { - // Check local holdouts targeting this specific delivery rule (FSSDK-12369). - // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. - const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); - for (const holdout of localHoldoutsForDelivery) { - const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); - decideReasons.push(...holdoutDecision.reasons); - if (holdoutDecision.result.variation) { - return { - result: holdoutDecision.result, - reasons: decideReasons, - holdoutDecision: true, - }; - } + // Check local holdouts targeting this specific delivery rule (FSSDK-12369). + // Inserted immediately after the forced-decision block, before audience and traffic allocation checks. + const localHoldoutsForDelivery = getHoldoutsForRule(configObj, rule.id); + for (const holdout of localHoldoutsForDelivery) { + const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); + decideReasons.push(...holdoutDecision.reasons); + if (holdoutDecision.result.variation) { + return { + result: holdoutDecision.result, + reasons: decideReasons, + holdoutDecision: true, + }; } } diff --git a/lib/feature_toggle.ts b/lib/feature_toggle.ts index 85fba2a88..c567c46a3 100644 --- a/lib/feature_toggle.ts +++ b/lib/feature_toggle.ts @@ -39,7 +39,4 @@ import { Platform } from './platform_support'; export type IfActive boolean, Y, N = unknown> = ReturnType extends true ? Y : N; - -export const localHoldout = () => true as const; - export const __platforms: Platform[] = ['__universal__']; From 7d8e5baf1d4c576900620a022461cd5076cd8f68 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Jul 2026 23:05:52 +0600 Subject: [PATCH 17/39] [FSSDK-12868] prepare for release 6.5.0 (#1167) --- CHANGELOG.md | 21 +++++++++++++++++++++ lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3032a8f6..34e629441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.5.0] - July 8, 2026 + +### New Features +- **Local Holdouts**: Added support for Local Holdouts, enabling holdout experiments +to be scoped to specific feature flag rules rather than applied globally. +Local Holdouts let you measure the true incremental impact of individual features +by holding out a subset of users from specific rollouts while still serving them other experiences. +See [Holdouts docs](https://support.optimizely.com/hc/en-us/articles/38941939408269-Global-holdouts) for more information. + +### Changed +- Refactor project config creation ([#1164](https://github.com/optimizely/javascript-sdk/pull/1164)) +- Replace deprecated url.parse() with the WHATWG URL in NodeRequestHandler ([#1161](https://github.com/optimizely/javascript-sdk/pull/1161)) +- Upgrade to uuid v13 ([#1159](https://github.com/optimizely/javascript-sdk/pull/1159)) +- Don't send ODP identify event for single identifier ([#1152](https://github.com/optimizely/javascript-sdk/pull/1152)) + +### Bug Fixes +- Use attribute id instead of key for CMAB prediction requests ([#1160](https://github.com/optimizely/javascript-sdk/pull/1160)) +- Normalize decision event campaign_id, variation_id, and entity_id ([#1158](https://github.com/optimizely/javascript-sdk/pull/1158)) +- Fix content-length header in NodeRequestHandler ([#1156](https://github.com/optimizely/javascript-sdk/pull/1156)) + + ## [6.4.0] - May 7, 2026 ### New Features diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 560640c5c..65f511fe8 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.4.0'; +export const CLIENT_VERSION = '6.5.0'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index f0e86527e..7af8d336f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.4.0", + "version": "6.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.4.0", + "version": "6.5.0", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index 00480aa9d..84ce000b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.4.0", + "version": "6.5.0", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From 0105135bd034d357394a71d44269ce0f17bf1015 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Fri, 17 Jul 2026 21:42:23 +0600 Subject: [PATCH 18/39] [FSSDK-12881] NPM to GPR backfill + release workflow update (#1168) --- .github/workflows/ghr_backfill.yml | 78 ++++++++++++++++ .github/workflows/release.yml | 89 +++++++++--------- scripts/publish.sh | 144 +++++++++++++++++++++++++++++ 3 files changed, 265 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/ghr_backfill.yml create mode 100755 scripts/publish.sh diff --git a/.github/workflows/ghr_backfill.yml b/.github/workflows/ghr_backfill.yml new file mode 100644 index 000000000..fe0141b73 --- /dev/null +++ b/.github/workflows/ghr_backfill.yml @@ -0,0 +1,78 @@ +name: Backfill GitHub Package Registry + +# Manually triggered. Copies versions already published on npm into the GitHub +# Package Registry (GHR) so GHR mirrors npm. Re-publishing the npm tarball +# guarantees the GHR copy is byte-identical to what npm consumers received +# (no rebuild). +# +# dist-tags: scripts/publish.sh computes the tag for each version from the +# version string against GHR's current latest (latest only when strictly newer, +# otherwise v-last-published; beta/alpha/rc for pre-releases), so latest +# never moves backwards while backfilling historical versions. +# +# Idempotent: scripts/publish.sh skips any version already present on GHR, so +# this can be re-run safely. + +on: + workflow_dispatch: + inputs: + version: + description: "Single version to backfill (e.g. 5.3.4). Leave blank to process all published npm versions (versions already on GHR are skipped)." + required: false + default: "" + dry_run: + description: "Dry run: report what would be published to GHR without publishing." + type: boolean + required: false + default: false + +jobs: + backfill: + name: Backfill npm versions to GHR + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout branch + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Configure GitHub Package Registry auth + run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Backfill + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DRY_RUN: ${{ inputs.dry_run }} + INPUT_VERSION: ${{ inputs.version }} + run: | + set -euo pipefail + pkg="@optimizely/optimizely-sdk" + npm_registry="https://registry.npmjs.org" + gpr_registry="https://npm.pkg.github.com" + + if [[ -n "$INPUT_VERSION" ]]; then + versions="$INPUT_VERSION" + else + versions=$(npm view "$pkg" versions --json --registry "$npm_registry" | jq -r '.[]') + fi + + for v in $versions; do + echo "::group::${pkg}@${v}" + # npm pack writes the tarball filename to stdout and notices/errors to + # stderr; keep stderr visible so pack failures (auth/404/network) show + # in the logs. pipefail (set above) makes a failed pack abort the job. + tarball=$(npm pack "${pkg}@${v}" --registry "$npm_registry" | tail -n1) + scripts/publish.sh "$gpr_registry" "$tarball" + rm -f "$tarball" + echo "::endgroup::" + done diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3e710a44..29a13ace4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Publish SDK to NPM +name: Publish SDK to NPM and GitHub Package Registry on: release: @@ -7,12 +7,17 @@ on: jobs: publish: - name: Publish to NPM + name: Publish to NPM and GitHub Package Registry runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' || !github.event.release.draft }} + permissions: + contents: read + packages: write steps: - name: Checkout branch uses: actions/checkout@v4 + with: + persist-credentials: false - name: Setup Node uses: actions/setup-node@v3 @@ -20,58 +25,50 @@ jobs: node-version: 18 registry-url: "https://registry.npmjs.org/" always-auth: "true" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} + # Add auth for the GitHub Package Registry publish. npm expands + # ${NODE_AUTH_TOKEN} at runtime per-step, so each publish step uses the + # right token for its registry. We do NOT route the @optimizely scope to + # GHR, so `npm ci` still resolves dependencies from npm; publish.sh passes + # --registry explicitly to target GHR. + - name: Configure GitHub Package Registry auth + run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc + + # Deps only. --ignore-scripts stops `prepare` from building here; we build + # exactly once in the pack step below. - name: Install dependencies - run: npm install + run: npm ci --ignore-scripts - - id: latest-release - name: Export latest release git tag + # Test, build, and pack a single tarball. Both registries publish this + # same artifact, so npm and GHR receive byte-identical bytes and the test + # suite runs only once. --ignore-scripts on pack avoids a rebuild. + - id: pack + name: Test, build, and pack run: | - echo "latest-release-tag=$(curl -qsSL \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/latest" \ - | jq -r .tag_name)" >> $GITHUB_OUTPUT - - - id: npm-tag - name: Determine NPM tag - env: - GITHUB_RELEASE_TAG: ${{ github.event.release.tag_name }} - run: | - VERSION=$(jq -r '.version' package.json) - LATEST_RELEASE_TAG="${{ steps.latest-release.outputs['latest-release-tag']}}" - - if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then - RELEASE_TAG=${GITHUB_REF#refs/tags/} - else - RELEASE_TAG=$GITHUB_RELEASE_TAG - fi - - if [[ $RELEASE_TAG == $LATEST_RELEASE_TAG ]]; then - echo "npm-tag=latest" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-beta"* ]]; then - echo "npm-tag=beta" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-alpha"* ]]; then - echo "npm-tag=alpha" >> "$GITHUB_OUTPUT" - elif [[ "$VERSION" == *"-rc"* ]]; then - echo "npm-tag=rc" >> "$GITHUB_OUTPUT" - else - echo "npm-tag=v$(echo $VERSION | awk -F. '{print $1}')-latest" >> "$GITHUB_OUTPUT" - fi + npm test + npm run build + tarball=$(npm pack --ignore-scripts | tail -n1) + echo "tarball=$tarball" >> "$GITHUB_OUTPUT" + # publish.sh derives name/version from the tarball and computes the + # dist-tag itself: `latest` only when strictly newer than the registry's + # current latest, otherwise v-last-published; beta/alpha/rc for + # pre-releases. npm publishes first; if it fails the job stops before GHR, + # keeping the registries in sync. - id: release - name: Test, build and publish to npm + name: Publish to NPM env: - BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} - BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} - run: | - if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then - DRY_RUN="--dry-run" - fi - npm publish --tag=${{ steps.npm-tag.outputs['npm-tag'] }} $DRY_RUN + TARBALL: ${{ steps.pack.outputs.tarball }} + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} + run: scripts/publish.sh "https://registry.npmjs.org" "$TARBALL" + + - name: Publish to GitHub Package Registry + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TARBALL: ${{ steps.pack.outputs.tarball }} + DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} + run: scripts/publish.sh "https://npm.pkg.github.com" "$TARBALL" # - name: Report results to Jellyfish # uses: optimizely/jellyfish-deployment-reporter-action@main diff --git a/scripts/publish.sh b/scripts/publish.sh new file mode 100755 index 000000000..e9f874961 --- /dev/null +++ b/scripts/publish.sh @@ -0,0 +1,144 @@ +#!/usr/bin/env bash +# +# Registry-agnostic, idempotent publish for @optimizely/optimizely-sdk. +# +# Usage: +# scripts/publish.sh [tarball] +# +# Args: +# registry-url Target registry, e.g. https://registry.npmjs.org +# or https://npm.pkg.github.com +# tarball Optional. When given, publishes that packed tarball instead +# of the current working directory (used by the GHR backfill). +# +# Env: +# NODE_AUTH_TOKEN Auth token for the target registry. Used both to read the +# registry (existence/dist-tag lookup) and, via the caller's +# .npmrc entry (`///:_authToken=${NODE_AUTH_TOKEN}`, +# which setup-node writes), to publish. This script passes +# --registry explicitly, so no scope-to-registry routing is +# required (and the GHR job intentionally does NOT route +# @optimizely to GHR, so that `npm ci` still installs +# dependencies from npm). +# DRY_RUN When "true", report what would happen (publish vs. skip) +# without actually publishing. +# +# Behavior: +# - Reads the target registry's packument once (a single HTTP GET) and: +# * 200 -> package exists; skip (exit 0) if this exact version is already +# present, so re-running a release or the backfill is a safe no-op. +# * 404 -> package/version absent; proceed to publish. +# * any other status or a network failure -> abort (exit 1) rather than +# guess. A flaky lookup must never be misread as "not published" and +# trigger a publish. +# - Computes the dist-tag from the version: +# * pre-releases (beta/alpha/rc) get their own tag, never `latest`. +# * a stable release gets `latest` ONLY when it is strictly greater (by +# semver) than the registry's current `latest`, so `latest` never moves +# backwards onto an older release — e.g. 5.x shipped after 6.x, or a +# 6.4.1 patch shipped while latest is 6.5.0. Otherwise it is tagged +# `v-last-published`: a per-major pointer to the most recently +# published version on that major line. It is named for recency (not +# "latest") on purpose — an out-of-order backport can leave it below the +# highest version in the major. Consumers install a line via +# @@v-last-published. +set -euo pipefail + +dry_run="${DRY_RUN:-false}" + +registry="${1:?usage: publish.sh [tarball]}" +tarball="${2:-}" + +if [[ -n "$tarball" ]]; then + # Derive name/version from the tarball's own package.json so the guard matches + # exactly what we're about to publish (backfill of historical versions). + meta=$(tar -xzO -f "$tarball" package/package.json) + pkg=$(printf '%s' "$meta" | jq -r '.name') + version=$(printf '%s' "$meta" | jq -r '.version') +else + pkg=$(jq -r '.name' package.json) + version=$(jq -r '.version' package.json) +fi + +# Returns 0 if $1 is strictly greater than $2 (numeric major.minor.patch). Only +# called for stable versions, so no pre-release precedence handling is needed. +version_gt() { + local -a a b + local i x y + IFS=. read -ra a <<< "$1" + IFS=. read -ra b <<< "$2" + for i in 0 1 2; do + x=${a[i]:-0} + y=${b[i]:-0} + (( 10#$x > 10#$y )) && return 0 + (( 10#$x < 10#$y )) && return 1 + done + return 1 +} + +# --- Existence / current-latest lookup (single packument GET) ---------------- +# npm scoped names are URL-encoded with the slash as %2f: @scope/name. +pkg_encoded="${pkg//\//%2f}" +packument_url="${registry%/}/${pkg_encoded}" + +body_file=$(mktemp) +trap 'rm -f "$body_file"' EXIT + +# curl -sS (no --fail) returns 0 for any HTTP response, non-zero only on +# network/protocol errors — so we can cleanly separate "server answered" from +# "could not reach server". +if ! http_code=$(curl -sS -m 30 -o "$body_file" -w '%{http_code}' \ + -H "Authorization: Bearer ${NODE_AUTH_TOKEN:-}" "$packument_url"); then + echo "ERROR: request to ${packument_url} failed (network/timeout); refusing to publish on an ambiguous result." >&2 + exit 1 +fi + +current_latest="" +case "$http_code" in + 200) + if jq -e --arg v "$version" '.versions[$v] != null' "$body_file" >/dev/null 2>&1; then + echo "Version ${pkg}@${version} already on ${registry}, skipping." + exit 0 + fi + current_latest=$(jq -r '.["dist-tags"].latest // empty' "$body_file") + ;; + 404) + # Package (or this version) not published yet; nothing to compare against. + current_latest="" + ;; + *) + echo "ERROR: unexpected HTTP ${http_code} querying ${packument_url}; refusing to publish on an ambiguous result." >&2 + exit 1 + ;; +esac + +# --- dist-tag selection ------------------------------------------------------ +case "$version" in + *-beta*) tag=beta ;; + *-alpha*) tag=alpha ;; + *-rc*) tag=rc ;; + *) + # Stable release: `latest` only if strictly greater than the current latest. + if [[ -z "$current_latest" ]] || version_gt "$version" "$current_latest"; then + tag=latest + else + major=${version%%.*} + tag="v${major}-last-published" + echo "Current latest is ${current_latest}; ${version} is not newer, tagging as ${tag} (latest preserved)." + fi + ;; +esac + +if [[ "$dry_run" == "true" ]]; then + echo "[dry-run] would publish ${pkg}@${version} (tag: ${tag}) to ${registry}" + exit 0 +fi + +echo "Publishing ${pkg}@${version} (tag: ${tag}) to ${registry}" +if [[ -n "$tarball" ]]; then + # The tarball is a prebuilt artifact; skip lifecycle scripts (prepublishOnly + # = test + build) that would otherwise run from the current package.json. + npm publish "$tarball" --registry "$registry" --tag "$tag" --ignore-scripts +else + npm publish --registry "$registry" --tag "$tag" +fi From a3857a08d675fa92b9928679754b754f53c44ac7 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Tue, 21 Jul 2026 22:47:25 +0600 Subject: [PATCH 19/39] [FSSDK-12933] Refactor message generator to use TS compiler API (#1170) * [FSSDK-12933] Refactor message generator to use TS compiler API Replace the dynamic-import-based message_generator.ts with a static TS-parser approach (scripts/generate-messages.js) that preserves declaration order and eliminates the jiti runtime dependency. Add a test script and CI job for the generator. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/javascript.yml | 15 ++++ message_generator.ts | 36 --------- package-lock.json | 3 +- package.json | 3 +- scripts/generate-messages.js | 121 ++++++++++++++++++++++++++++++ scripts/test-generate-messages.js | 90 ++++++++++++++++++++++ 6 files changed, 229 insertions(+), 39 deletions(-) delete mode 100644 message_generator.ts create mode 100755 scripts/generate-messages.js create mode 100644 scripts/test-generate-messages.js diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 847fd9751..7ff3ba050 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -115,6 +115,21 @@ jobs: # npm install # npm run test-ci + generate_messages_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 20 + cache-dependency-path: ./package-lock.json + cache: 'npm' + - name: Test generate-messages script + run: | + npm install + node scripts/test-generate-messages.js + unit_tests: runs-on: ubuntu-latest strategy: diff --git a/message_generator.ts b/message_generator.ts deleted file mode 100644 index 5571f84e7..000000000 --- a/message_generator.ts +++ /dev/null @@ -1,36 +0,0 @@ -import path from 'path'; -import { writeFile } from 'fs/promises'; - -const generate = async () => { - const inp = process.argv.slice(2); - for(const filePath of inp) { - console.log('generating messages for: ', filePath); - const parsedPath = path.parse(filePath); - const fileName = parsedPath.name; - const dirName = parsedPath.dir; - const ext = parsedPath.ext; - - const genFilePath = path.join(dirName, `${fileName}.gen${ext}`); - console.log('generated file path: ', genFilePath); - const exports = await import(filePath); - const messages : Array = []; - - let genOut = ''; - - Object.keys(exports).forEach((key, i) => { - if (key === 'messages' || key === '__platforms') return; - genOut += `export const ${key} = '${i}';\n`; - messages.push(exports[key]) - }); - - genOut += `export const messages = ${JSON.stringify(messages, null, 2)};` - await writeFile(genFilePath, genOut, 'utf-8'); - } -} - -generate().then(() => { - console.log('successfully generated messages'); -}).catch((e) => { - console.error(e); - process.exit(1); -}); diff --git a/package-lock.json b/package-lock.json index 7af8d336f..3812dc53d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,6 @@ "eslint-plugin-local-rules": "^3.0.2", "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", - "jiti": "^2.4.1", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", @@ -7840,6 +7839,8 @@ "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", "dev": true, "license": "MIT", + "optional": true, + "peer": true, "bin": { "jiti": "lib/jiti-cli.mjs" } diff --git a/package.json b/package.json index 84ce000b4..f4f5fad6c 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "coveralls": "nyc --reporter=lcov npm test", "prepare": "npm run build", "prepublishOnly": "npm test", - "genmsg": "jiti message_generator ./lib/message/error_message.ts ./lib/message/log_message.ts", + "genmsg": "./scripts/generate-messages.js ./lib/message/error_message.ts ./lib/message/log_message.ts", "test-typescript": "node ./scripts/run-ts-example.js", "test-commonjs": "node ./scripts/run-cjs-example.js" }, @@ -126,7 +126,6 @@ "eslint-plugin-local-rules": "^3.0.2", "eslint-plugin-prettier": "^3.1.2", "happy-dom": "^20.0.11", - "jiti": "^2.4.1", "minimatch": "^9.0.5", "mocha": "^10.2.0", "mocha-lcov-reporter": "^1.3.0", diff --git a/scripts/generate-messages.js b/scripts/generate-messages.js new file mode 100755 index 000000000..bd347fc01 --- /dev/null +++ b/scripts/generate-messages.js @@ -0,0 +1,121 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const ts = require('typescript'); +const fs = require('fs'); +const path = require('path'); + +function extractMessages(filePath) { + const source = fs.readFileSync(filePath, 'utf-8'); + const sourceFile = ts.createSourceFile( + filePath, + source, + ts.ScriptTarget.Latest, + true, + ); + + const exports = []; + + for (const statement of sourceFile.statements) { + if (!ts.isVariableStatement(statement)) continue; + + const hasExport = statement.modifiers?.some( + (m) => m.kind === ts.SyntaxKind.ExportKeyword, + ); + if (!hasExport) continue; + + for (const decl of statement.declarationList.declarations) { + const name = decl.name.getText(sourceFile); + if (name === 'messages' || name === '__platforms') continue; + if (!decl.initializer || !ts.isStringLiteral(decl.initializer)) continue; + + exports.push({ name, value: decl.initializer.text }); + } + } + + return exports; +} + +function buildOutputAst(exports) { + const { factory } = ts; + const statements = []; + + exports.forEach((exp, i) => { + statements.push( + factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [factory.createVariableDeclaration(exp.name, undefined, undefined, factory.createStringLiteral(String(i)))], + ts.NodeFlags.Const, + ), + ), + ); + }); + + statements.push( + factory.createVariableStatement( + [factory.createModifier(ts.SyntaxKind.ExportKeyword)], + factory.createVariableDeclarationList( + [ + factory.createVariableDeclaration( + 'messages', + undefined, + undefined, + factory.createArrayLiteralExpression( + exports.map((exp) => factory.createStringLiteral(exp.value)), + true, + ), + ), + ], + ts.NodeFlags.Const, + ), + ), + ); + + return factory.createSourceFile(statements, factory.createToken(ts.SyntaxKind.EndOfFileToken), ts.NodeFlags.None); +} + +function generate(filePath) { + const absPath = path.resolve(filePath); + const parsed = path.parse(absPath); + const genPath = path.join(parsed.dir, `${parsed.name}.gen${parsed.ext}`); + + console.log('generating messages for:', absPath); + + const exports = extractMessages(absPath); + const outputAst = buildOutputAst(exports); + + const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed }); + const output = printer.printFile(outputAst); + + fs.writeFileSync(genPath, output, 'utf-8'); + console.log('generated file path:', genPath); +} + +const files = process.argv.slice(2); + +if (files.length === 0) { + console.error('Usage: generate-messages.js [file2.ts] ...'); + process.exit(1); +} + +for (const file of files) { + generate(file); +} + +console.log('successfully generated messages'); diff --git a/scripts/test-generate-messages.js b/scripts/test-generate-messages.js new file mode 100644 index 000000000..93f8edd60 --- /dev/null +++ b/scripts/test-generate-messages.js @@ -0,0 +1,90 @@ +#!/usr/bin/env node + +const assert = require('node:assert/strict'); +const { execFileSync } = require('node:child_process'); +const fs = require('node:fs'); +const os = require('node:os'); +const path = require('node:path'); +const ts = require('typescript'); + +const SCRIPT = path.resolve(__dirname, 'generate-messages.js'); + +const FILE1_EXPECTED = [ + { name: 'HELLO', value: 'Hello, %s!' }, + { name: 'GOODBYE', value: 'Goodbye, %s!' }, + { name: 'WARNING', value: 'Warning: %s' }, +]; + +const FILE2_EXPECTED = [ + { name: 'ERR_NOT_FOUND', value: 'Resource %s not found' }, + { name: 'ERR_TIMEOUT', value: 'Request timed out after %s ms' }, + { name: 'ERR_INVALID', value: 'Invalid input: %s' }, + { name: 'ERR_PERMISSION', value: 'Permission denied for %s' }, +]; + +function buildFileContent(expected, { includeMessages = true, includePlatforms = false } = {}) { + let content = expected.map((e) => `export const ${e.name} = '${e.value}';`).join('\n'); + if (includeMessages) content += `\n\nexport const messages: string[] = [];`; + if (includePlatforms) content += `\nexport const __platforms: string[] = ['__universal__'];`; + return content; +} + +function compileAndLoad(tsPath) { + const source = fs.readFileSync(tsPath, 'utf-8'); + const { outputText } = ts.transpileModule(source, { + compilerOptions: { module: ts.ModuleKind.CommonJS }, + }); + const jsPath = tsPath.replace(/\.ts$/, '.js'); + fs.writeFileSync(jsPath, outputText, 'utf-8'); + return require(jsPath); +} + +function runTest() { + const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gen-msg-test-')); + + try { + const file1 = path.join(tmpDir, 'file1.ts'); + const file2 = path.join(tmpDir, 'file2.ts'); + fs.writeFileSync(file1, buildFileContent(FILE1_EXPECTED, { includePlatforms: true }), 'utf-8'); + fs.writeFileSync(file2, buildFileContent(FILE2_EXPECTED), 'utf-8'); + + execFileSync(process.execPath, [SCRIPT, file1, file2], { stdio: 'pipe' }); + + const genFile1 = path.join(tmpDir, 'file1.gen.ts'); + const genFile2 = path.join(tmpDir, 'file2.gen.ts'); + assert.ok(fs.existsSync(genFile1), 'file1.gen.ts should be created'); + assert.ok(fs.existsSync(genFile2), 'file2.gen.ts should be created'); + + for (const [expected, genPath, label] of [ + [FILE1_EXPECTED, genFile1, 'file1'], + [FILE2_EXPECTED, genFile2, 'file2'], + ]) { + const mod = compileAndLoad(genPath); + + assert.ok(Array.isArray(mod.messages), `${label}: messages should be an array`); + assert.equal(mod.messages.length, expected.length, + `${label}: messages array length should be ${expected.length}, got ${mod.messages.length}`); + + assert.equal(mod.__platforms, undefined, `${label}: __platforms should not be exported`); + + const constantCount = Object.keys(mod).filter((k) => k !== 'messages').length; + assert.equal(constantCount, expected.length, + `${label}: should have ${expected.length} constants, got ${constantCount}`); + + for (const exp of expected) { + assert.ok(exp.name in mod, + `${label}: constant "${exp.name}" should be present`); + + const index = Number(mod[exp.name]); + assert.equal(mod.messages[index], exp.value, + `${label}: messages[${index}] should be "${exp.value}", got "${mod.messages[index]}"`); + } + } + + console.log('All tests passed.'); + } finally { + fs.rmSync(tmpDir, { recursive: true, force: true }); + } +} + +runTest(); From 6da739883b1f35add1547e0e16f4256d68bb261c Mon Sep 17 00:00:00 2001 From: Farhan Anjum Date: Wed, 22 Jul 2026 17:00:36 +0600 Subject: [PATCH 20/39] [FSSDK-12891] Switch npm publishing to OIDC trusted publishing (#1169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [FSSDK-12891] Switch npm publishing to OIDC trusted publishing Replace long-lived NPM_PUBLISH_TOKEN with OIDC trusted publishing for more secure, tokenless CI publishing to npm. Workflow changes: - Add id-token: write permission for OIDC token generation - Move permissions to workflow level (add packages: write for GHR) - Add GitHub environment gate (npm) for deployment protection - Upgrade setup-node to v4 and Node to 22 (npm 11.5.1+ requirement) - Add npm upgrade step to ensure OIDC support - Remove NPM_PUBLISH_TOKEN from npm publish step (OIDC replaces it) publish.sh changes: - Make NODE_AUTH_TOKEN optional in curl lookup (public packages don't need auth for registry reads) - Add --provenance flag for npm registry publishes (supply-chain attestations, not supported by GHR) GHR publish step is unchanged — still uses GITHUB_TOKEN. Co-Authored-By: Claude Opus 4.6 (1M context) * test: temp version bump for OIDC test (revert before merge) * fix: use string instead of array for optional curl auth header * test: switch to rc.1 version for OIDC test * revert: remove temp version bump --------- Co-authored-by: Claude Opus 4.6 (1M context) --- .github/workflows/release.yml | 30 +++++++++++++++++------------- scripts/publish.sh | 17 ++++++++++++++--- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29a13ace4..8b79c33b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,14 +5,17 @@ on: types: [published, edited] workflow_dispatch: {} +permissions: + id-token: write + contents: read + packages: write + jobs: publish: name: Publish to NPM and GitHub Package Registry runs-on: ubuntu-latest if: ${{ github.event_name == 'workflow_dispatch' || !github.event.release.draft }} - permissions: - contents: read - packages: write + environment: npm steps: - name: Checkout branch uses: actions/checkout@v4 @@ -20,17 +23,16 @@ jobs: persist-credentials: false - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 - registry-url: "https://registry.npmjs.org/" - always-auth: "true" + node-version: 22 + + - name: Upgrade npm for OIDC support + run: npm install -g npm@latest - # Add auth for the GitHub Package Registry publish. npm expands - # ${NODE_AUTH_TOKEN} at runtime per-step, so each publish step uses the - # right token for its registry. We do NOT route the @optimizely scope to - # GHR, so `npm ci` still resolves dependencies from npm; publish.sh passes - # --registry explicitly to target GHR. + # Configure auth for GHR only. npm registry auth is handled by OIDC + # (no .npmrc token entry needed — omitting registry-url from setup-node + # ensures npm falls through to OIDC for registry.npmjs.org). - name: Configure GitHub Package Registry auth run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc @@ -55,10 +57,12 @@ jobs: # current latest, otherwise v-last-published; beta/alpha/rc for # pre-releases. npm publishes first; if it fails the job stops before GHR, # keeping the registries in sync. + # + # npm publish uses OIDC trusted publishing (no NPM_PUBLISH_TOKEN needed). + # publish.sh adds --provenance for supply-chain attestations. - id: release name: Publish to NPM env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} TARBALL: ${{ steps.pack.outputs.tarball }} DRY_RUN: ${{ github.event_name == 'workflow_dispatch' }} run: scripts/publish.sh "https://registry.npmjs.org" "$TARBALL" diff --git a/scripts/publish.sh b/scripts/publish.sh index e9f874961..a10f0d0b0 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -87,8 +87,12 @@ trap 'rm -f "$body_file"' EXIT # curl -sS (no --fail) returns 0 for any HTTP response, non-zero only on # network/protocol errors — so we can cleanly separate "server answered" from # "could not reach server". +auth_header="" +if [[ -n "${NODE_AUTH_TOKEN:-}" ]]; then + auth_header="Authorization: Bearer ${NODE_AUTH_TOKEN}" +fi if ! http_code=$(curl -sS -m 30 -o "$body_file" -w '%{http_code}' \ - -H "Authorization: Bearer ${NODE_AUTH_TOKEN:-}" "$packument_url"); then + ${auth_header:+-H "$auth_header"} "$packument_url"); then echo "ERROR: request to ${packument_url} failed (network/timeout); refusing to publish on an ambiguous result." >&2 exit 1 fi @@ -134,11 +138,18 @@ if [[ "$dry_run" == "true" ]]; then exit 0 fi +# Add --provenance for npm registry (OIDC trusted publishing generates +# supply-chain attestations). Not supported by GitHub Package Registry. +provenance_flag="" +if [[ "$registry" == *"registry.npmjs.org"* ]]; then + provenance_flag="--provenance" +fi + echo "Publishing ${pkg}@${version} (tag: ${tag}) to ${registry}" if [[ -n "$tarball" ]]; then # The tarball is a prebuilt artifact; skip lifecycle scripts (prepublishOnly # = test + build) that would otherwise run from the current package.json. - npm publish "$tarball" --registry "$registry" --tag "$tag" --ignore-scripts + npm publish "$tarball" --registry "$registry" --tag "$tag" --ignore-scripts $provenance_flag else - npm publish --registry "$registry" --tag "$tag" + npm publish --registry "$registry" --tag "$tag" $provenance_flag fi From ee1ef199dcf0d828307e1cabd3937e705e85e172 Mon Sep 17 00:00:00 2001 From: esrakartalOpt <102107327+esrakartalOpt@users.noreply.github.com> Date: Thu, 30 Jul 2026 13:11:18 -0500 Subject: [PATCH 21/39] [AI-FSSDK] [FSSDK-12735] Add holdout exclusion logic for Targeted Delivery rules (#1171) Implements holdout exclusion logic for Targeted Delivery rules. When a holdout's `excludeTargetedDeliveries` flag is true, users bucketed into that holdout will still be served Targeted Delivery (rollout) rules normally, while A/B Test and Multi-Armed Bandit experiment rules continue to be blocked by the holdout. ## Changes - Added `excludeTargetedDeliveries` field to the Holdout interface in shared types - Updated `resolveVariationForFlag` to evaluate delivery rules when holdout has exclusion enabled, falling back to holdout decision if no delivery rule matches - Added decision reason logging for when Targeted Delivery rules are excluded from holdout logic --------- Co-authored-by: Raju Ahmed --- lib/core/decision_service/index.spec.ts | 194 +++++++++++++++++++++++- lib/core/decision_service/index.ts | 45 ++++-- lib/optimizely/index.spec.ts | 60 ++++++++ lib/optimizely/index.ts | 16 ++ lib/shared_types.ts | 1 + 5 files changed, 306 insertions(+), 10 deletions(-) diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index 2334a386b..77e942e0a 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -19,7 +19,7 @@ import { USER_HAS_NO_FORCED_VARIATION } from 'log_message'; import { beforeEach, describe, expect, it, MockInstance, vi } from 'vitest'; -import { CMAB_DUMMY_ENTITY_ID, CMAB_FETCH_FAILED, DecisionService } from '.'; +import { CMAB_DUMMY_ENTITY_ID, CMAB_FETCH_FAILED, DecisionService, TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT } from '.'; import OptimizelyUserContext from '../../optimizely_user_context'; import { createProjectConfig, ProjectConfig } from '../../project_config/project_config'; import { BucketerParams, Experiment, ExperimentBucketMap, Holdout, OptimizelyDecideOption, UserAttributes, UserProfile } from '../../shared_types'; @@ -2196,6 +2196,170 @@ describe('DecisionService', () => { decisionSource: DECISION_SOURCES.HOLDOUT, }); }); + + describe('excludeTargetedDeliveries', () => { + const getExcludeTDDatafile = (excludeTargetedDeliveries?: boolean) => { + const datafile = getHoldoutTestDatafile(); + datafile.holdouts = datafile.holdouts.map((holdout: any) => { + if (holdout.id === 'holdout_running_id') { + return { + ...holdout, + ...(excludeTargetedDeliveries !== undefined ? { excludeTargetedDeliveries } : {}), + }; + } + return holdout; + }); + return datafile; + }; + + it('should return holdout variation immediately when excludeTargetedDeliveries is false', async () => { + const { decisionService } = getDecisionService(); + const config = createProjectConfig(JSON.stringify(getExcludeTDDatafile(false))); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + decisionSource: DECISION_SOURCES.HOLDOUT, + }); + }); + + it('should return holdout variation immediately when excludeTargetedDeliveries is undefined', async () => { + const { decisionService } = getDecisionService(); + const config = createProjectConfig(JSON.stringify(getExcludeTDDatafile(undefined))); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + decisionSource: DECISION_SOURCES.HOLDOUT, + }); + }); + + it('should return delivery variation with holdout info when excludeTargetedDeliveries is true and delivery matches', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'delivery_1') { + return { result: '5004', reasons: [] }; + } + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: config.experimentKeyMap['delivery_1'], + variation: config.variationIdMap['5004'], + decisionSource: DECISION_SOURCES.ROLLOUT, + holdout: { + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + }, + }); + + const reasonStrings = variation.reasons.map((r: any) => typeof r === 'string' ? r : r[0]); + expect(reasonStrings).toContain(TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT); + }); + + it('should return null decision with holdout info when excludeTargetedDeliveries is true but no delivery matches', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdout: { + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + }, + }); + }); + + it('should still block experiment rules when excludeTargetedDeliveries is true', async () => { + const { decisionService } = getDecisionService(); + const datafile = getExcludeTDDatafile(true); + + const config = createProjectConfig(JSON.stringify(datafile)); + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'tester', + attributes: { age: 20 }, + }); + + mockBucket.mockImplementation((param: BucketerParams) => { + if (param.experimentKey === 'holdout_running') { + return { result: 'holdout_variation_running_id', reasons: [] }; + } + if (param.experimentKey === 'exp_1') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const feature = config.featureKeyMap['flag_1']; + const value = decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + const variation = (await value)[0]; + + expect(variation.result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdout: { + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + }, + }); + }); + }); }); }); @@ -3101,6 +3265,34 @@ describe('DecisionService', () => { expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.FEATURE_TEST); expect(value[0].result.variation?.key).toBe('variation_1'); }); + + it('local holdout ignores excludeTargetedDeliveries and applies normally', async () => { + const datafile = makeLocalHoldoutDatafile('2001'); + (datafile as any).localHoldouts[0].excludeTargetedDeliveries = true; + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ + optimizely: {} as any, + userId: 'user1', + attributes: { age: 15 }, + }); + + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + // Local holdout applies normally even with excludeTargetedDeliveries set + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); + expect(value[0].result.experiment?.id).toBe('local_holdout_id'); + expect(value[0].result.variation?.id).toBe('local_holdout_variation_id'); + }); }); }); diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index 2064ec2a2..a7cfc3783 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -119,12 +119,17 @@ export const USER_MEETS_CONDITIONS_FOR_HOLDOUT = 'User %s meets conditions for h export const USER_DOESNT_MEET_CONDITIONS_FOR_HOLDOUT = 'User %s does not meet conditions for holdout %s.'; export const USER_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in variation %s of holdout %s.'; export const USER_NOT_BUCKETED_INTO_HOLDOUT_VARIATION = 'User %s is in no holdout variation.'; +export const TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT = 'Holdout "%s" has excludeTargetedDeliveries enabled, continuing to rollout evaluation.'; export interface DecisionObj { experiment: Experiment | Holdout | null; variation: Variation | null; decisionSource: DecisionSource; cmabUuid?: string; + holdout?: { + experiment: Holdout; + variation: Variation; + }; } interface DecisionServiceOptions { @@ -913,11 +918,7 @@ export class DecisionService { options: DecideOptionsMap): Value { const userId = user.getUserId(); const attributes = user.getAttributes(); - const decisions: DecisionResponse[] = []; - // const userProfileTracker : UserProfileTracker = { - // isProfileUpdated: false, - // userProfile: null, - // } + const shouldIgnoreUPS = !!options[OptimizelyDecideOption.IGNORE_USER_PROFILE_SERVICE]; const userProfileTrackerValue: Value> = shouldIgnoreUPS ? Value.of(op, undefined) @@ -969,11 +970,23 @@ export class DecisionService { // getGlobalHoldouts() returns holdouts with includedRules == null/undefined. const globalHoldouts = getGlobalHoldouts(configObj); + let appliedHoldout : DecisionObj['holdout'] | undefined = undefined; + for (const holdout of globalHoldouts) { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); decideReasons.push(...holdoutDecision.reasons); if (holdoutDecision.result.variation) { + if (holdout.excludeTargetedDeliveries) { + this.logger?.info(TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key); + decideReasons.push([TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key]); + appliedHoldout = { + experiment: holdout, + variation: holdoutDecision.result.variation + } + break; + } + return Value.of(op, { result: holdoutDecision.result, reasons: decideReasons, @@ -981,7 +994,17 @@ export class DecisionService { } } - return this.getVariationForFeatureExperiment(op, configObj, feature, user, decideOptions, userProfileTracker).then((experimentDecision) => { + const experimentDecision: Value = appliedHoldout ? + Value.of(op, { + reasons: decideReasons, + result: { + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.FEATURE_TEST, + } + }) : this.getVariationForFeatureExperiment(op, configObj, feature, user, decideOptions, userProfileTracker); + + return experimentDecision.then((experimentDecision) => { if (experimentDecision.error || experimentDecision.result.variation !== null) { return Value.of(op, { ...experimentDecision, @@ -990,12 +1013,12 @@ export class DecisionService { } decideReasons.push(...experimentDecision.reasons); - + const rolloutDecision = this.getVariationForRollout(configObj, feature, user); decideReasons.push(...rolloutDecision.reasons); const rolloutDecisionResult = rolloutDecision.result; const userId = user.getUserId(); - + if (rolloutDecisionResult.variation) { this.logger?.debug(USER_IN_ROLLOUT, userId, feature.key); decideReasons.push([USER_IN_ROLLOUT, userId, feature.key]); @@ -1003,7 +1026,11 @@ export class DecisionService { this.logger?.debug(USER_NOT_IN_ROLLOUT, userId, feature.key); decideReasons.push([USER_NOT_IN_ROLLOUT, userId, feature.key]); } - + + if (appliedHoldout) { + rolloutDecisionResult.holdout = appliedHoldout; + } + return Value.of(op, { result: rolloutDecisionResult, reasons: decideReasons, diff --git a/lib/optimizely/index.spec.ts b/lib/optimizely/index.spec.ts index d891e283a..07f31dcc1 100644 --- a/lib/optimizely/index.spec.ts +++ b/lib/optimizely/index.spec.ts @@ -872,6 +872,66 @@ describe('Optimizely', () => { }), }); }); + + it('should dispatch separate holdout impression when decisionObj.holdout is populated', async () => { + const processSpy = vi.spyOn(eventProcessor, 'process'); + const notificationSpyLocal = vi.fn(); + optimizely.notificationCenter.addNotificationListener( + NOTIFICATION_TYPES.DECISION, + notificationSpyLocal + ); + + const holdoutExperiment = projectConfig.holdouts[0]; + const holdoutVariation = projectConfig.holdouts[0].variations[0]; + const rolloutExperiment = projectConfig.experimentKeyMap['delivery_1'] || Object.values(projectConfig.experimentIdMap)[0]; + const rolloutVariation = rolloutExperiment?.variations?.[0] || { id: 'test_var_id', key: 'test_var_key', variables: [] }; + + vi.spyOn(decisionService, 'resolveVariationsForFeatureList').mockImplementation(() => { + return Value.of('async', [{ + error: false, + result: { + variation: rolloutVariation, + experiment: rolloutExperiment, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdout: { + experiment: holdoutExperiment, + variation: holdoutVariation, + }, + }, + reasons: [], + }]); + }); + + const user = new OptimizelyUserContext({ + optimizely, + userId: 'test_user', + attributes: {}, + }); + + await optimizely.decideAsync(user, 'flag_1', []); + + // The holdout impression is dispatched even when the main rollout impression is not + // (sendFlagDecisions not set). Verify at least one impression is a holdout event. + expect(processSpy).toHaveBeenCalled(); + + const holdoutEvent = processSpy.mock.calls.find( + (call: any) => (call[0] as ImpressionEvent).ruleType === 'holdout' + ); + expect(holdoutEvent).toBeDefined(); + const holdoutImpression = holdoutEvent![0] as ImpressionEvent; + expect(holdoutImpression.ruleKey).toBe('holdout_test_key'); + expect(holdoutImpression.ruleType).toBe('holdout'); + expect(holdoutImpression.enabled).toBe(false); + + expect(notificationSpyLocal).toHaveBeenCalledWith( + expect.objectContaining({ + type: DECISION_NOTIFICATION_TYPES.FLAG, + decisionInfo: expect.objectContaining({ + decisionEventDispatched: true, + }), + }) + ); + }); }); it('should flush eventProcessor and odpManager on flushImmediately()', async () => { diff --git a/lib/optimizely/index.ts b/lib/optimizely/index.ts index 251c08b0e..c7277ba65 100644 --- a/lib/optimizely/index.ts +++ b/lib/optimizely/index.ts @@ -1542,6 +1542,22 @@ export default class Optimizely extends BaseService implements Client { decisionEventDispatched = true; } + if (decisionObj.holdout && !options[OptimizelyDecideOption.DISABLE_DECISION_EVENT]) { + const holdoutDecisionObj: DecisionObj = { + experiment: decisionObj.holdout.experiment, + variation: decisionObj.holdout.variation, + decisionSource: DECISION_SOURCES.HOLDOUT, + }; + this.sendImpressionEvent( + holdoutDecisionObj, + key, + userId, + decision.getFeatureEnabledFromVariation(holdoutDecisionObj), + attributes, + ); + decisionEventDispatched = true; + } + const shouldIncludeReasons = options[OptimizelyDecideOption.INCLUDE_REASONS]; let reportedReasons: string[] = []; diff --git a/lib/shared_types.ts b/lib/shared_types.ts index 6640622ab..4cc772019 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -190,6 +190,7 @@ export interface Holdout extends ExperimentCore { * membership. */ isGlobal: boolean; + excludeTargetedDeliveries?: boolean; } export function isHoldout(obj: Experiment | Holdout): obj is Holdout { From ce9aa2df129347428d80c6858dfd19a258eb1a2e Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Thu, 20 Aug 2026 20:09:48 +0600 Subject: [PATCH 22/39] adjust (#1173) --- lib/notification_center/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/notification_center/index.ts b/lib/notification_center/index.ts index ee792179b..471a4c60e 100644 --- a/lib/notification_center/index.ts +++ b/lib/notification_center/index.ts @@ -121,6 +121,7 @@ export class DefaultNotificationCenter implements NotificationCenter, Notificati const remover = this.removers.get(listenerId); if (remover) { remover(); + this.removers.delete(listenerId); return true; } return false From de6b7eca0c60770a3a85cc307e12d4f6ebcc0435 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Thu, 3 Sep 2026 19:09:25 +0600 Subject: [PATCH 23/39] [AI-FSSDK] [FSSDK-13070] prepare for release javascript v6.6.0 (#1174) * [FSSDK-13070] update CHANGELOG for javascript v6.6.0 * [FSSDK-13070] bump version to 6.6.0 * [FSSDK-13070] adjustment * [FSSDK-13070] adjustment --- CHANGELOG.md | 8 ++++++++ lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34e629441..0ebb868e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.6.0] - September 3, 2026 + +### New Features + +**Holdout Targeted Delivery Exclusion**: Holdouts can now be configured to exclude Targeted Delivery rules, so users held out of experiments still receive their Targeted Delivery experiences. This gives you a cleaner measure of experiment impact without holding users back from ongoing rollouts. + +- Add holdout exclusion logic for Targeted Delivery rules ([#1171](https://github.com/optimizely/javascript-sdk/pull/1171)) + ## [6.5.0] - July 8, 2026 ### New Features diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 65f511fe8..4410ff6c1 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.5.0'; +export const CLIENT_VERSION = '6.6.0'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index 3812dc53d..4f1363743 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.5.0", + "version": "6.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.5.0", + "version": "6.6.0", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index f4f5fad6c..eaeddfa84 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.5.0", + "version": "6.6.0", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From 4867bbba9612e8218221236a2068023d0d4f7506 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Mon, 14 Sep 2026 21:21:29 +0600 Subject: [PATCH 24/39] [FSSDK-13110] cache update (#1175) --- .../event_processor_factory.browser.ts | 5 +-- .../event_processor_factory.react_native.ts | 3 +- lib/event_processor/event_store.spec.ts | 44 ++++++++++--------- lib/event_processor/event_store.ts | 8 ++-- .../polling_datafile_manager.spec.ts | 14 +++--- .../polling_datafile_manager.ts | 2 +- .../async_storage_cache.react_native.spec.ts | 37 +++++----------- .../cache/async_storage_cache.react_native.ts | 14 +++--- .../cache/local_storage_cache.browser.spec.ts | 35 +++++---------- .../cache/local_storage_cache.browser.ts | 13 +++--- lib/vuid/vuid_manager_factory.browser.ts | 2 +- lib/vuid/vuid_manager_factory.react_native.ts | 2 +- 12 files changed, 74 insertions(+), 105 deletions(-) diff --git a/lib/event_processor/event_processor_factory.browser.ts b/lib/event_processor/event_processor_factory.browser.ts index a4d782c7a..e55436236 100644 --- a/lib/event_processor/event_processor_factory.browser.ts +++ b/lib/event_processor/event_processor_factory.browser.ts @@ -15,8 +15,7 @@ */ import { EventDispatcher } from './event_dispatcher/event_dispatcher'; import { EventProcessor } from './event_processor'; -import { EventWithId } from './batch_event_processor'; -import { +import { getOpaqueBatchEventProcessor, BatchEventProcessorOptions, OpaqueEventProcessor, @@ -44,7 +43,7 @@ export const createBatchEventProcessor = ( options: BatchEventProcessorOptions = {} ): OpaqueEventProcessor => { const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : new EventStore({ - store: new LocalStorageCache(), + store: new LocalStorageCache(), maxSize: options.batchSize ? Math.max(options.batchSize * 2, DEFAULT_MAX_EVENTS_IN_STORE) : DEFAULT_MAX_EVENTS_IN_STORE, ttl: options.storeTtl, diff --git a/lib/event_processor/event_processor_factory.react_native.ts b/lib/event_processor/event_processor_factory.react_native.ts index 1b4f58dc9..950bddd75 100644 --- a/lib/event_processor/event_processor_factory.react_native.ts +++ b/lib/event_processor/event_processor_factory.react_native.ts @@ -24,7 +24,6 @@ import { getForwardingEventProcessor, } from './event_processor_factory'; import { FAILED_EVENT_RETRY_INTERVAL } from './event_processor_factory'; -import { EventWithId } from './batch_event_processor'; import { AsyncStorageCache } from '../utils/cache/async_storage_cache.react_native'; import { ReactNativeNetInfoEventProcessor } from './batch_event_processor.react_native'; import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store'; @@ -43,7 +42,7 @@ export const createBatchEventProcessor = ( options: BatchEventProcessorOptions = {} ): OpaqueEventProcessor => { const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : new EventStore({ - store: new AsyncStorageCache(), + store: new AsyncStorageCache(), maxSize: options.batchSize ? Math.max(options.batchSize * 2, DEFAULT_MAX_EVENTS_IN_STORE) : DEFAULT_MAX_EVENTS_IN_STORE, ttl: options.storeTtl, diff --git a/lib/event_processor/event_store.spec.ts b/lib/event_processor/event_store.spec.ts index 785eea183..c45eea214 100644 --- a/lib/event_processor/event_store.spec.ts +++ b/lib/event_processor/event_store.spec.ts @@ -30,7 +30,7 @@ type TestStoreConfig = { } const getEventStore = (config: TestStoreConfig = {}) => { - const mockStore = getMockAsyncCache(); + const mockStore = getMockAsyncCache(); const store = new EventStore({...config, store: mockStore }); return { mockStore, store } } @@ -213,17 +213,18 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { if (call++ > 0) { return originalSet(key, value); } // Simulate old stored event without time info + const stored: StoredEvent = JSON.parse(value); const eventWithoutTime: StoredEvent = { - id: value.id, - event: value.event, + id: stored.id, + event: stored.event, }; - return originalSet(key, eventWithoutTime); + return originalSet(key, JSON.stringify(eventWithoutTime)); }); await store.set('test', event); @@ -235,12 +236,12 @@ describe('EventStore', () => { await exhaustMicrotasks(); expect(setSpy).toHaveBeenCalledTimes(2); - const secondCall = setSpy.mock.calls[1]; + const resavedEvent: StoredEvent = JSON.parse(setSpy.mock.calls[1][1]); - expect(secondCall[1]._time).toBeDefined(); - expect(secondCall[1]._time?.storedAt).toBeLessThanOrEqual(Date.now()); - expect(secondCall[1]._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); - expect(secondCall[1]._time?.ttl).toBe(ttl); + expect(resavedEvent._time).toBeDefined(); + expect(resavedEvent._time?.storedAt).toBeLessThanOrEqual(Date.now()); + expect(resavedEvent._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); + expect(resavedEvent._time?.ttl).toBe(ttl); }); it('should store event when key expires after store being full', async () => { @@ -327,24 +328,25 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + const setSpy = vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { if (call++ > 0) { return originalSet(key, value); } // Simulate old stored event without time information + const stored: StoredEvent = JSON.parse(value); const eventWithoutTime: StoredEvent = { - id: value.id, - event: value.event, + id: stored.id, + event: stored.event, }; - return originalSet(key, eventWithoutTime); + return originalSet(key, JSON.stringify(eventWithoutTime)); }); await store.set('key-1', event); await store.set('key-2', event); const results = await store.getBatched(['key-1', 'key-2']); - + expect(results).toHaveLength(2); expect(results[0]).toEqual(expect.objectContaining(event)); expect(results[1]).toEqual(expect.objectContaining(event)); @@ -352,12 +354,12 @@ describe('EventStore', () => { await exhaustMicrotasks(); expect(setSpy).toHaveBeenCalledTimes(3); - const secondCall = setSpy.mock.calls[1]; + const resavedEvent: StoredEvent = JSON.parse(setSpy.mock.calls[1][1]); - expect(secondCall[1]._time).toBeDefined(); - expect(secondCall[1]._time?.storedAt).toBeLessThanOrEqual(Date.now()); - expect(secondCall[1]._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); - expect(secondCall[1]._time?.ttl).toBe(ttl); + expect(resavedEvent._time).toBeDefined(); + expect(resavedEvent._time?.storedAt).toBeLessThanOrEqual(Date.now()); + expect(resavedEvent._time?.storedAt).toBeGreaterThanOrEqual(Date.now() - 10); + expect(resavedEvent._time?.ttl).toBe(ttl); }); it('should store event when keys expire during getBatched after store being full', async () => { @@ -401,7 +403,7 @@ describe('EventStore', () => { const originalSet = mockStore.set.bind(mockStore); let call = 0; - vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: StoredEvent) => { + vi.spyOn(mockStore, 'set').mockImplementation(async (key: string, value: string) => { // only the seconde set call should fail if (call++ != 1) return originalSet(key, value); return Promise.reject(new Error('Simulated set failure')); diff --git a/lib/event_processor/event_store.ts b/lib/event_processor/event_store.ts index 90ccf9ff6..627848494 100644 --- a/lib/event_processor/event_store.ts +++ b/lib/event_processor/event_store.ts @@ -20,8 +20,6 @@ export type StoredEvent = EventWithId & { }; }; -const identity = (v: T): T => v; - const LOGGER_NAME = 'EventStore'; export const DEFAULT_MAX_EVENTS_IN_STORE = 500; export const DEFAULT_STORE_TTL = 10 * 24 * 60 * 60 * 1000; // 10 days @@ -31,7 +29,7 @@ export const EVENT_STORE_PREFIX = 'optly_event:'; export type EventStoreConfig = { maxSize?: number; ttl?: number, - store: Store, + store: Store, logger?: LoggerFacade, }; @@ -56,9 +54,9 @@ export class EventStore extends AsyncStoreWithBatchedGet implements } = config; if (store.operation === 'sync') { - this.store = new SyncPrefixStore(store, EVENT_STORE_PREFIX, identity, identity); + this.store = new SyncPrefixStore(store, EVENT_STORE_PREFIX, JSON.parse, JSON.stringify); } else { - this.store = new AsyncPrefixStore(store, EVENT_STORE_PREFIX, identity, identity); + this.store = new AsyncPrefixStore(store, EVENT_STORE_PREFIX, JSON.parse, JSON.stringify); } if (logger) { diff --git a/lib/project_config/polling_datafile_manager.spec.ts b/lib/project_config/polling_datafile_manager.spec.ts index b87416186..42bc85c5a 100644 --- a/lib/project_config/polling_datafile_manager.spec.ts +++ b/lib/project_config/polling_datafile_manager.spec.ts @@ -106,7 +106,7 @@ describe('PollingDatafileManager', () => { const repeater = getMockRepeater(); const requestHandler = getMockRequestHandler(); // response promise is pending const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const manager = new PollingDatafileManager({ repeater, @@ -131,7 +131,7 @@ describe('PollingDatafileManager', () => { requestHandler.makeRequest.mockReturnValueOnce(mockResponse); const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const manager = new PollingDatafileManager({ repeater, @@ -155,7 +155,7 @@ describe('PollingDatafileManager', () => { const repeater = getMockRepeater(); const requestHandler = getMockRequestHandler(); const cache = getMockAsyncCache(); - await cache.set('opt-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); + await cache.set('optimizely-datafile-keyThatExists', JSON.stringify({ name: 'keyThatExists' })); const mockResponse = getMockAbortableRequest(); requestHandler.makeRequest.mockReturnValueOnce(mockResponse); @@ -564,7 +564,7 @@ describe('PollingDatafileManager', () => { repeater.execute(0); await expect(manager.onRunning()).resolves.not.toThrow(); - expect(spy).toHaveBeenCalledWith('opt-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); + expect(spy).toHaveBeenCalledWith('optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); }); }); @@ -635,9 +635,9 @@ describe('PollingDatafileManager', () => { } await expect(manager.onRunning()).resolves.not.toThrow(); - expect(spy).toHaveBeenNthCalledWith(1, 'opt-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); - expect(spy).toHaveBeenNthCalledWith(2, 'opt-datafile-keyThatDoesNotExists', '{"foo2": "bar2"}'); - expect(spy).toHaveBeenNthCalledWith(3, 'opt-datafile-keyThatDoesNotExists', '{"foo3": "bar3"}'); + expect(spy).toHaveBeenNthCalledWith(1, 'optimizely-datafile-keyThatDoesNotExists', '{"foo": "bar"}'); + expect(spy).toHaveBeenNthCalledWith(2, 'optimizely-datafile-keyThatDoesNotExists', '{"foo2": "bar2"}'); + expect(spy).toHaveBeenNthCalledWith(3, 'optimizely-datafile-keyThatDoesNotExists', '{"foo3": "bar3"}'); }); it('logs an error if fetch request fails and does not call onUpdate handler', async () => { diff --git a/lib/project_config/polling_datafile_manager.ts b/lib/project_config/polling_datafile_manager.ts index d4f02e37e..135987304 100644 --- a/lib/project_config/polling_datafile_manager.ts +++ b/lib/project_config/polling_datafile_manager.ts @@ -73,7 +73,7 @@ export class PollingDatafileManager extends BaseService implements DatafileManag logger, } = config; this.cache = cache; - this.cacheKey = 'opt-datafile-' + sdkKey; + this.cacheKey = 'optimizely-datafile-' + sdkKey; this.sdkKey = sdkKey; this.datafileAccessToken = datafileAccessToken; this.customHeaders = customHeaders; diff --git a/lib/utils/cache/async_storage_cache.react_native.spec.ts b/lib/utils/cache/async_storage_cache.react_native.spec.ts index f67fca7bf..1ada3e80b 100644 --- a/lib/utils/cache/async_storage_cache.react_native.spec.ts +++ b/lib/utils/cache/async_storage_cache.react_native.spec.ts @@ -20,48 +20,33 @@ import { getDefaultAsyncStorage } from '../import.react_native/@react-native-asy vi.mock('@react-native-async-storage/async-storage'); -type TestData = { - a: number; - b: string; - d: { e: boolean }; -}; - describe('AsyncStorageCache', () => { const asyncStorage = getDefaultAsyncStorage(); - it('should store a stringified value in async storage', async () => { - const cache = new AsyncStorageCache(); + it('should store the value as-is in async storage without serialization', async () => { + const cache = new AsyncStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - await cache.set('key', data); + await cache.set('key', 'value'); - expect(await asyncStorage.getItem('key')).toBe(JSON.stringify(data)); - expect(await cache.get('key')).toEqual(data); + expect(await asyncStorage.getItem('key')).toBe('value'); + expect(await cache.get('key')).toBe('value'); }); it('should return undefined if get is called for a nonexistent key', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); expect(await cache.get('nonexistent')).toBeUndefined(); }); it('should return the value if get is called for an existing key', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key', 'value'); expect(await cache.get('key')).toBe('value'); }); - it('should return the value after json parsing if get is called for an existing key', async () => { - const cache = new AsyncStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - await cache.set('key', data); - - expect(await cache.get('key')).toEqual(data); - }); - it('should remove the key from async storage when remove is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key', 'value'); await cache.remove('key'); @@ -69,7 +54,7 @@ describe('AsyncStorageCache', () => { }); it('should remove all keys from async storage when clear is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); @@ -79,7 +64,7 @@ describe('AsyncStorageCache', () => { }); it('should return all keys when getKeys is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); @@ -87,7 +72,7 @@ describe('AsyncStorageCache', () => { }); it('should return an array of values for an array of keys when getBatched is called', async () => { - const cache = new AsyncStorageCache(); + const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); diff --git a/lib/utils/cache/async_storage_cache.react_native.ts b/lib/utils/cache/async_storage_cache.react_native.ts index 049633fd6..b568edc0b 100644 --- a/lib/utils/cache/async_storage_cache.react_native.ts +++ b/lib/utils/cache/async_storage_cache.react_native.ts @@ -19,21 +19,21 @@ import { AsyncStore } from "./store"; import { getDefaultAsyncStorage } from "../import.react_native/@react-native-async-storage/async-storage"; import { Platform } from '../../platform_support'; -export class AsyncStorageCache implements AsyncStore { +export class AsyncStorageCache implements AsyncStore { public readonly operation = 'async'; private asyncStorage = getDefaultAsyncStorage(); - async get(key: string): Promise { + async get(key: string): Promise { const value = await this.asyncStorage.getItem(key); - return value ? JSON.parse(value) : undefined; + return value ?? undefined; } async remove(key: string): Promise { return this.asyncStorage.removeItem(key); } - async set(key: string, val: V): Promise { - return this.asyncStorage.setItem(key, JSON.stringify(val)); + async set(key: string, val: string): Promise { + return this.asyncStorage.setItem(key, val); } async clear(): Promise { @@ -44,9 +44,9 @@ export class AsyncStorageCache implements AsyncStore { return [... await this.asyncStorage.getAllKeys()]; } - async getBatched(keys: string[]): Promise[]> { + async getBatched(keys: string[]): Promise[]> { const items = await this.asyncStorage.multiGet(keys); - return items.map(([key, value]) => value ? JSON.parse(value) : undefined); + return items.map(([key, value]) => value ?? undefined); } } diff --git a/lib/utils/cache/local_storage_cache.browser.spec.ts b/lib/utils/cache/local_storage_cache.browser.spec.ts index 1556c8966..8e190462c 100644 --- a/lib/utils/cache/local_storage_cache.browser.spec.ts +++ b/lib/utils/cache/local_storage_cache.browser.spec.ts @@ -17,51 +17,38 @@ import { describe, it, expect, beforeEach } from 'vitest'; import { LocalStorageCache } from './local_storage_cache.browser'; -type TestData = { - a: number; - b: string; - d: { e: boolean }; -} - describe('LocalStorageCache', () => { beforeEach(() => { localStorage.clear(); }); - it('should store a stringified value in local storage', () => { - const cache = new LocalStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - cache.set('key', data); - expect(localStorage.getItem('key')).toBe(JSON.stringify(data)); + it('should store the value as-is in local storage without serialization', () => { + const cache = new LocalStorageCache(); + cache.set('key', 'value'); + expect(localStorage.getItem('key')).toBe('value'); + expect(cache.get('key')).toBe('value'); }); it('should return undefined if get is called for a nonexistent key', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); expect(cache.get('nonexistent')).toBeUndefined(); }); it('should return the value if get is called for an existing key', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key', 'value'); expect(cache.get('key')).toBe('value'); }); - it('should return the value after json parsing if get is called for an existing key', () => { - const cache = new LocalStorageCache(); - const data = { a: 1, b: '2', d: { e: true } }; - cache.set('key', data); - expect(cache.get('key')).toEqual(data); - }); - it('should remove the key from local storage when remove is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key', 'value'); cache.remove('key'); expect(localStorage.getItem('key')).toBeNull(); }); it('should remove all keys from local storage when clear is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(localStorage.length).toBe(2); @@ -70,14 +57,14 @@ describe('LocalStorageCache', () => { }); it('should return all keys when getKeys is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(cache.getKeys().sort()).toEqual(['key1', 'key2']); }); it('should return an array of values for an array of keys when getBatched is called', () => { - const cache = new LocalStorageCache(); + const cache = new LocalStorageCache(); cache.set('key1', 'value1'); cache.set('key2', 'value2'); expect(cache.getBatched(['key1', 'key2'])).toEqual(['value1', 'value2']); diff --git a/lib/utils/cache/local_storage_cache.browser.ts b/lib/utils/cache/local_storage_cache.browser.ts index 3e5ede910..8b9b4124d 100644 --- a/lib/utils/cache/local_storage_cache.browser.ts +++ b/lib/utils/cache/local_storage_cache.browser.ts @@ -18,16 +18,15 @@ import { Maybe } from "../type"; import { SyncStore } from "./store"; import { Platform } from '../../platform_support'; -export class LocalStorageCache implements SyncStore { +export class LocalStorageCache implements SyncStore { public readonly operation = 'sync'; - public set(key: string, value: V): void { - localStorage.setItem(key, JSON.stringify(value)); + public set(key: string, value: string): void { + localStorage.setItem(key, value); } - public get(key: string): Maybe { - const value = localStorage.getItem(key); - return value ? JSON.parse(value) : undefined; + public get(key: string): Maybe { + return localStorage.getItem(key) ?? undefined; } public remove(key: string): void { @@ -49,7 +48,7 @@ export class LocalStorageCache implements SyncStore { return keys; } - getBatched(keys: string[]): Maybe[] { + getBatched(keys: string[]): Maybe[] { return keys.map((k) => this.get(k)); } } diff --git a/lib/vuid/vuid_manager_factory.browser.ts b/lib/vuid/vuid_manager_factory.browser.ts index eace086b3..9fde2c706 100644 --- a/lib/vuid/vuid_manager_factory.browser.ts +++ b/lib/vuid/vuid_manager_factory.browser.ts @@ -23,7 +23,7 @@ export const vuidCacheManager = new VuidCacheManager(); export const createVuidManager = (options: VuidManagerOptions = {}): OpaqueVuidManager => { return wrapVuidManager(new DefaultVuidManager({ vuidCacheManager, - vuidCache: options.vuidCache || new LocalStorageCache(), + vuidCache: options.vuidCache || new LocalStorageCache(), enableVuid: options.enableVuid })); }; diff --git a/lib/vuid/vuid_manager_factory.react_native.ts b/lib/vuid/vuid_manager_factory.react_native.ts index 57b2e9d3a..ca0bbef55 100644 --- a/lib/vuid/vuid_manager_factory.react_native.ts +++ b/lib/vuid/vuid_manager_factory.react_native.ts @@ -23,7 +23,7 @@ export const vuidCacheManager = new VuidCacheManager(); export const createVuidManager = (options: VuidManagerOptions = {}): OpaqueVuidManager => { return wrapVuidManager(new DefaultVuidManager({ vuidCacheManager, - vuidCache: options.vuidCache || new AsyncStorageCache(), + vuidCache: options.vuidCache || new AsyncStorageCache(), enableVuid: options.enableVuid })); }; From 07777ce6f62f3af30922e4cb346121fcfd035921 Mon Sep 17 00:00:00 2001 From: Md Junaed Hossain <169046794+junaed-optimizely@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:56:22 +0600 Subject: [PATCH 25/39] [FSSDK-13110] patch release (#1176) * [FSSDK-13110] patch release * [FSSDK-13110] review feedback --- CHANGELOG.md | 5 +++++ lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ebb868e7..5a8d206f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.6.1] - September 18, 2026 + +### Bug Fixes +- Use an updated datafile cache key so the SDK no longer reads a stale or malformed datafile persisted by an older SDK version ([#1175](https://github.com/optimizely/javascript-sdk/pull/1175)) + ## [6.6.0] - September 3, 2026 ### New Features diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 4410ff6c1..202c74b4a 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.6.0'; +export const CLIENT_VERSION = '6.6.1'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index 4f1363743..7d33da914 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.6.0", + "version": "6.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.6.0", + "version": "6.6.1", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index eaeddfa84..714dad1bb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.6.0", + "version": "6.6.1", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From fd652c3e4036a2c6fe48c53929cd2bfcee243ab7 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Tue, 13 Oct 2026 22:19:01 +0600 Subject: [PATCH 26/39] [FSSDK-13250] Support AsyncStorage v3 in React Native (#1178) ## Summary - **AsyncStorage v3 support.** v3 removed `multiGet` in favour of `getMany`, and no longer exports the `AsyncStorageStatic` type. The React Native AsyncStorage import shim now adds a `multiGet` built on `getMany` when the storage doesn't have one. It keeps the requested key order and returns `null` for missing keys. The removed type import is replaced with a local `AsyncStorageCompat` interface. v1/v2 storage is returned unchanged. - **`AsyncStorageCache` now extends `AsyncStoreWithBatchedGet`.** It previously only implemented `AsyncStore`, so `getBatchedAsync` failed its `instanceof` check and read stored events with one `getItem` per key. Its `getBatched`, and therefore `multiGet`, was never called. Failed-event retries now read all stored events in one batched call. - **Wider React Native peer ranges:** - AsyncStorage `<4.0.0` (was `<3.0.0`) - NetInfo `<13.0.0` (was `<12.0.0`) - `react-native-get-random-values` `>=1.11.0 <3.0.0` (was `^1.11.0`) - `fast-text-encoding` and `ua-parser-js` are now written as explicit `<2.0.0` ranges, allowing the same versions as before. `ua-parser-js` 2.x is licensed AGPL-3.0, so it stays excluded. - **Test fix:** a leaked `mockImplementationOnce` in `event_processor_factory.react_native.spec.ts` was making a later test construct a real `AsyncStorageCache`. --------- Co-authored-by: Claude Opus 5.5 --- .../async-storage.ts | 28 ++++- ...ent_processor_factory.react_native.spec.ts | 1 + .../async_storage_cache.react_native.spec.ts | 22 +++- .../cache/async_storage_cache.react_native.ts | 6 +- lib/utils/cache/store.spec.ts | 80 ++++++++++++- .../async-storage.spec.ts | 111 ++++++++++++++++++ .../async-storage.ts | 46 +++++++- package-lock.json | 10 +- package.json | 10 +- 9 files changed, 289 insertions(+), 25 deletions(-) create mode 100644 lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts diff --git a/__mocks__/@react-native-async-storage/async-storage.ts b/__mocks__/@react-native-async-storage/async-storage.ts index 36d3cf85d..6154a1155 100644 --- a/__mocks__/@react-native-async-storage/async-storage.ts +++ b/__mocks__/@react-native-async-storage/async-storage.ts @@ -25,7 +25,7 @@ export default class AsyncStorage { callback?.(undefined, value); return Promise.resolve(value); } - + static setItem( key: string, value: string, @@ -35,7 +35,7 @@ export default class AsyncStorage { callback?.(undefined); return Promise.resolve(); } - + static removeItem( key: string, callback?: (error?: Error, result?: string | null) => void @@ -47,10 +47,28 @@ export default class AsyncStorage { callback?.(undefined, value); return Promise.resolve(value); } - - static clearStore(): Promise { + + static getAllKeys(): Promise { + return Promise.resolve(Object.keys(AsyncStorage.items)); + } + + static clear(): Promise { AsyncStorage.items = {}; return Promise.resolve(); } - + + static multiGet(keys: readonly string[]): Promise<[string, string | null][]> { + return Promise.resolve( + keys.map((key) => [key, AsyncStorage.items[key] ?? null] as [string, string | null]) + ); + } + + static getMany(keys: readonly string[]): Promise> { + const record: Record = {}; + for (const key of keys) { + record[key] = AsyncStorage.items[key] ?? null; + } + return Promise.resolve(record); + } + } diff --git a/lib/event_processor/event_processor_factory.react_native.spec.ts b/lib/event_processor/event_processor_factory.react_native.spec.ts index 2a4c5d170..9a6286fbe 100644 --- a/lib/event_processor/event_processor_factory.react_native.spec.ts +++ b/lib/event_processor/event_processor_factory.react_native.spec.ts @@ -191,6 +191,7 @@ describe('createBatchEventProcessor', () => { expect(() => createBatchEventProcessor({ eventStore })).not.toThrow(); isAsyncStorageAvailable = true; + MockAsyncStorageCache.mockReset(); }); it('wraps the provided eventStore in a SyncPrefixStore if a SyncCache is provided as eventStore', () => { diff --git a/lib/utils/cache/async_storage_cache.react_native.spec.ts b/lib/utils/cache/async_storage_cache.react_native.spec.ts index 1ada3e80b..4a8ed0fec 100644 --- a/lib/utils/cache/async_storage_cache.react_native.spec.ts +++ b/lib/utils/cache/async_storage_cache.react_native.spec.ts @@ -16,6 +16,7 @@ import { vi, describe, it, expect } from 'vitest'; import { AsyncStorageCache } from './async_storage_cache.react_native'; +import { AsyncStoreWithBatchedGet } from './store'; import { getDefaultAsyncStorage } from '../import.react_native/@react-native-async-storage/async-storage'; vi.mock('@react-native-async-storage/async-storage'); @@ -71,11 +72,28 @@ describe('AsyncStorageCache', () => { expect(await cache.getKeys()).toEqual(['key1', 'key2']); }); - it('should return an array of values for an array of keys when getBatched is called', async () => { + it('should be an AsyncStoreWithBatchedGet', () => { + expect(new AsyncStorageCache()).toBeInstanceOf(AsyncStoreWithBatchedGet); + }); + + it('should return an array of values for an array of keys using a single multiGet call when getBatched is called', async () => { const cache = new AsyncStorageCache(); await cache.set('key1', 'value1'); await cache.set('key2', 'value2'); - expect(await cache.getBatched(['key1', 'key2'])).toEqual(['value1', 'value2']); + const multiGetSpy = vi.spyOn(asyncStorage, 'multiGet'); + + expect(await cache.getBatched(['key2', 'key1'])).toEqual(['value2', 'value1']); + expect(multiGetSpy).toHaveBeenCalledOnce(); + expect(multiGetSpy).toHaveBeenCalledWith(['key2', 'key1']); + + multiGetSpy.mockRestore(); + }); + + it('should return undefined for missing keys when getBatched is called', async () => { + const cache = new AsyncStorageCache(); + await cache.set('key1', 'value1'); + + expect(await cache.getBatched(['key1', 'missing'])).toEqual(['value1', undefined]); }); }); diff --git a/lib/utils/cache/async_storage_cache.react_native.ts b/lib/utils/cache/async_storage_cache.react_native.ts index b568edc0b..956cd8745 100644 --- a/lib/utils/cache/async_storage_cache.react_native.ts +++ b/lib/utils/cache/async_storage_cache.react_native.ts @@ -15,11 +15,11 @@ */ import { Maybe } from "../type"; -import { AsyncStore } from "./store"; +import { AsyncStore, AsyncStoreWithBatchedGet } from "./store"; import { getDefaultAsyncStorage } from "../import.react_native/@react-native-async-storage/async-storage"; import { Platform } from '../../platform_support'; -export class AsyncStorageCache implements AsyncStore { +export class AsyncStorageCache extends AsyncStoreWithBatchedGet implements AsyncStore { public readonly operation = 'async'; private asyncStorage = getDefaultAsyncStorage(); @@ -46,7 +46,7 @@ export class AsyncStorageCache implements AsyncStore { async getBatched(keys: string[]): Promise[]> { const items = await this.asyncStorage.multiGet(keys); - return items.map(([key, value]) => value ?? undefined); + return items.map(([, value]) => value ?? undefined); } } diff --git a/lib/utils/cache/store.spec.ts b/lib/utils/cache/store.spec.ts index a99226844..5cb693217 100644 --- a/lib/utils/cache/store.spec.ts +++ b/lib/utils/cache/store.spec.ts @@ -14,8 +14,16 @@ * limitations under the License. */ -import { describe, it, expect } from 'vitest'; -import { SyncPrefixStore, AsyncPrefixStore } from './store'; +import { describe, it, expect, vi } from 'vitest'; +import { + SyncPrefixStore, + AsyncPrefixStore, + SyncStoreWithBatchedGet, + AsyncStoreWithBatchedGet, + getBatchedSync, + getBatchedAsync, +} from './store'; +import { Maybe } from '../type'; import { getMockSyncCache, getMockAsyncCache } from '../../tests/mock/mock_cache'; describe('SyncPrefixStore', () => { @@ -288,4 +296,72 @@ describe('AsyncPrefixStore', () => { expect(values).toEqual(expect.arrayContaining(['value1', 'value2'])); }); }); +}); + +class BatchedSyncStore extends SyncStoreWithBatchedGet { + private data = new Map(); + set(key: string, value: string): void { this.data.set(key, value); } + get(key: string): Maybe { return this.data.get(key); } + remove(key: string): void { this.data.delete(key); } + getKeys(): string[] { return [...this.data.keys()]; } + getBatched(keys: string[]): Maybe[] { return keys.map((key) => this.data.get(key)); } +} + +class BatchedAsyncStore extends AsyncStoreWithBatchedGet { + private data = new Map(); + async set(key: string, value: string): Promise { this.data.set(key, value); } + async get(key: string): Promise> { return this.data.get(key); } + async remove(key: string): Promise { this.data.delete(key); } + async getKeys(): Promise { return [...this.data.keys()]; } + async getBatched(keys: string[]): Promise[]> { return keys.map((key) => this.data.get(key)); } +} + +describe('getBatchedSync', () => { + it('should use getBatched of a SyncStoreWithBatchedGet', () => { + const store = new BatchedSyncStore(); + store.set('key1', 'value1'); + store.set('key2', 'value2'); + const getBatchedSpy = vi.spyOn(store, 'getBatched'); + const getSpy = vi.spyOn(store, 'get'); + + expect(getBatchedSync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getBatchedSpy).toHaveBeenCalledOnce(); + expect(getBatchedSpy).toHaveBeenCalledWith(['key2', 'missing', 'key1']); + expect(getSpy).not.toHaveBeenCalled(); + }); + + it('should fall back to get for each key if the store is not a SyncStoreWithBatchedGet', () => { + const store = getMockSyncCache(); + store.set('key1', 'value1'); + store.set('key2', 'value2'); + const getSpy = vi.spyOn(store, 'get'); + + expect(getBatchedSync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getSpy).toHaveBeenCalledTimes(3); + }); +}); + +describe('getBatchedAsync', () => { + it('should use getBatched of an AsyncStoreWithBatchedGet', async () => { + const store = new BatchedAsyncStore(); + await store.set('key1', 'value1'); + await store.set('key2', 'value2'); + const getBatchedSpy = vi.spyOn(store, 'getBatched'); + const getSpy = vi.spyOn(store, 'get'); + + expect(await getBatchedAsync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getBatchedSpy).toHaveBeenCalledOnce(); + expect(getBatchedSpy).toHaveBeenCalledWith(['key2', 'missing', 'key1']); + expect(getSpy).not.toHaveBeenCalled(); + }); + + it('should fall back to get for each key if the store is not an AsyncStoreWithBatchedGet', async () => { + const store = getMockAsyncCache(); + await store.set('key1', 'value1'); + await store.set('key2', 'value2'); + const getSpy = vi.spyOn(store, 'get'); + + expect(await getBatchedAsync(store, ['key2', 'missing', 'key1'])).toEqual(['value2', undefined, 'value1']); + expect(getSpy).toHaveBeenCalledTimes(3); + }); }); \ No newline at end of file diff --git a/lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts b/lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts new file mode 100644 index 000000000..8a77e3977 --- /dev/null +++ b/lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts @@ -0,0 +1,111 @@ +/** + * Copyright 2025, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { vi, describe, it, expect } from 'vitest'; +import { ensureMultiGet } from './async-storage'; + +describe('ensureMultiGet', () => { + it('should preserve multiGet when already present (v1/v2)', () => { + const multiGet = vi.fn(); + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + multiGet, + }; + + const result = ensureMultiGet(storage); + + expect(result.multiGet).toBe(multiGet); + }); + + it('should construct multiGet from getMany when multiGet is absent (v3)', async () => { + const items: Record = { a: '1', b: '2' }; + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn((keys: readonly string[]) => { + const record: Record = {}; + for (const key of keys) { record[key] = items[key] ?? null; } + return Promise.resolve(record); + }), + }; + + const result = ensureMultiGet(storage); + + expect(result.multiGet).toBeDefined(); + + const pairs = await result.multiGet(['b', 'missing', 'a']); + expect(pairs).toEqual([ + ['b', '2'], + ['missing', null], + ['a', '1'], + ]); + }); + + it('should not modify the original storage when constructing multiGet (v3)', () => { + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn(), + }; + + const result = ensureMultiGet(storage); + + expect(result).not.toBe(storage); + expect('multiGet' in storage).toBe(false); + expect(Object.getPrototypeOf(result)).toBe(storage); + expect(result.getItem).toBe(storage.getItem); + expect(result.setItem).toBe(storage.setItem); + expect(result.removeItem).toBe(storage.removeItem); + expect(result.getAllKeys).toBe(storage.getAllKeys); + expect(result.clear).toBe(storage.clear); + }); + + it('should return pairs in the requested key order regardless of getMany record order', async () => { + const items: Record = { x: 'vx', y: 'vy', z: 'vz' }; + const storage = { + getItem: vi.fn(), + setItem: vi.fn(), + removeItem: vi.fn(), + getAllKeys: vi.fn(), + clear: vi.fn(), + getMany: vi.fn((keys: readonly string[]) => { + const record: Record = {}; + const reversed = [...keys].reverse(); + for (const key of reversed) { record[key] = items[key] ?? null; } + return Promise.resolve(record); + }), + }; + + const result = ensureMultiGet(storage); + const pairs = await result.multiGet(['z', 'x', 'y']); + + expect(pairs).toEqual([ + ['z', 'vz'], + ['x', 'vx'], + ['y', 'vy'], + ]); + }); +}); diff --git a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts b/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts index dcf394ae0..83881b334 100644 --- a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts +++ b/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts @@ -14,15 +14,55 @@ * limitations under the License. */ -import type { AsyncStorageStatic } from '@react-native-async-storage/async-storage' import { Platform } from '../../../platform_support'; +export interface AsyncStorageCompat { + getItem(key: string): Promise; + setItem(key: string, value: string): Promise; + removeItem(key: string): Promise; + getAllKeys(): Promise; + clear(): Promise; + multiGet(keys: readonly string[]): Promise; +} + +interface RawAsyncStorage { + getItem(key: string): Promise; + setItem(key: string, value: string): Promise; + removeItem(key: string): Promise; + getAllKeys(): Promise; + clear(): Promise; + multiGet?(keys: readonly string[]): Promise; + getMany?(keys: readonly string[]): Promise>; +} + export const MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE = 'Module not found: @react-native-async-storage/async-storage'; -export const getDefaultAsyncStorage = (): AsyncStorageStatic => { +type RawAsyncStorageWithGetMany = RawAsyncStorage & Required>; + +// Returns a wrapper with the original as its prototype, so the shared AsyncStorage object is not mutated. +export const ensureMultiGet = (storage: RawAsyncStorage): AsyncStorageCompat => { + if (storage.multiGet || !storage.getMany) { + return storage as AsyncStorageCompat; + } + + return Object.create(storage, { + multiGet: { + value: async function( + this: RawAsyncStorageWithGetMany, + keys: readonly string[], + ): Promise<[string, string | null][]> { + const record = await this.getMany(keys); + return keys.map((key: string) => [key, record[key] ?? null] as [string, string | null]); + }, + }, + }); +}; + +export const getDefaultAsyncStorage = (): AsyncStorageCompat => { try { // eslint-disable-next-line @typescript-eslint/no-var-requires - return require('@react-native-async-storage/async-storage').default; + const storage = require('@react-native-async-storage/async-storage').default; + return ensureMultiGet(storage); } catch (e) { throw new Error(MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE); } diff --git a/package-lock.json b/package-lock.json index 7d33da914..df7474636 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,11 +61,11 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@react-native-async-storage/async-storage": ">=1.0.0 <3.0.0", - "@react-native-community/netinfo": ">=5.0.0 <12.0.0", - "fast-text-encoding": "^1.0.6", - "react-native-get-random-values": "^1.11.0", - "ua-parser-js": "^1.0.38" + "@react-native-async-storage/async-storage": ">=1.0.0 <4.0.0", + "@react-native-community/netinfo": ">=5.0.0 <13.0.0", + "fast-text-encoding": ">=1.0.6 <2.0.0", + "react-native-get-random-values": ">=1.11.0 <3.0.0", + "ua-parser-js": ">=1.0.38 <2.0.0" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { diff --git a/package.json b/package.json index 714dad1bb..6edfd1dfc 100644 --- a/package.json +++ b/package.json @@ -147,11 +147,11 @@ "webpack": "^5.94.0" }, "peerDependencies": { - "@react-native-async-storage/async-storage": ">=1.0.0 <3.0.0", - "@react-native-community/netinfo": ">=5.0.0 <12.0.0", - "fast-text-encoding": "^1.0.6", - "react-native-get-random-values": "^1.11.0", - "ua-parser-js": "^1.0.38" + "@react-native-async-storage/async-storage": ">=1.0.0 <4.0.0", + "@react-native-community/netinfo": ">=5.0.0 <13.0.0", + "fast-text-encoding": ">=1.0.6 <2.0.0", + "react-native-get-random-values": ">=1.11.0 <3.0.0", + "ua-parser-js": ">=1.0.38 <2.0.0" }, "peerDependenciesMeta": { "@react-native-async-storage/async-storage": { From f308ecb1cfb3908f25c6877d13546a4f278f495a Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Fri, 16 Oct 2026 02:49:50 +0600 Subject: [PATCH 27/39] [FSSDK-13287] Make React Native polyfills optional and isolate optional requires (#1179) ## Summary - **Polyfill packages are optional.** `fast-text-encoding` and `react-native-get-random-values` are loaded if installed. Both keep an existing global, so a native `TextEncoder` (Hermes in RN 0.74+) or an app's own polyfill (for example `react-native-quick-crypto`, imported in the app's entry file before the SDK) is used instead. If `TextEncoder` or `crypto.getRandomValues` is still missing, `index.react_native.ts` throws at import with an error that names the package to install. - **Optional import shims in `lib/import.react_native/`.** There is one shim per optional package, named after the package: `fast-text-encoding.ts`, `react-native-get-random-values.ts` and `@react-native-async-storage/async-storage.ts`. Each one: - does its `require` inside `try/catch` while the module loads; - exports `isAvailable` plus the package's exports that the SDK uses, under the same names, which are `undefined` if the package is missing; - never throws. The importer decides what a missing package means. - **Shims are built as separate files.** Rollup builds each shim to the same path under `dist/import.react_native/`, and the main React Native bundles load them by relative path. A small `resolveId` plugin keeps the shim imports out of the main bundles. The main bundles no longer contain any optional `require`, and the node, browser and universal bundles are unchanged. - **AsyncStorage:** the compat helper (`ensureMultiGet`, which adds `multiGet` on v3) is merged into the async-storage shim. The shim exports the package's `default`, with `multiGet` added. The "Module not found" check moved to `AsyncStorageCache`. The CJS bundles read shim default exports through Rollup's `esModule` interop, applied only to shim imports. - **Build check:** a Rollup plugin fails the build unless every built shim contains exactly one `require()`, of its own package. That catches imports of other packages, `tslib` helpers (from `async`/`await`), and code shared between shims. - **README:** `lib/import.react_native/README.md` explains the Metro bug behind this setup, how the shims avoid it, and the rules for writing a shim. ### Why the shims are separate files Metro before 0.82.5 (React Native 0.78 and older) drops an optional dependency that isn't installed from the module's dependency map, without adjusting the indices in the module's code. Every later `require` in that module then loads the wrong module. With all of the SDK's React Native code in one module: - With `fast-text-encoding` missing, `require("fast-text-encoding")` silently loaded `react-native-get-random-values`. - The `getRandomValues` check then reported "install react-native-get-random-values" even though it was installed. - A missing async-storage would have shifted netinfo and both polyfill `require`s. A shim's only dependency is its own package, so a missing package can't shift anything else, and the main bundle's shim `require`s always resolve. The shim does its `require` while the module loads for a second reason: on old Metro, a failed `require` called later is reported as a fatal error instead of being thrown to the `catch`. Metro 0.82.5 fixed the bug. ### Compatibility Existing apps already install both polyfill packages, because the old code imported them unconditionally. With everything installed, nothing changes. A missing optional package is only tolerated at build time when Metro's `allowOptionalDependencies` is on, which React Native's and Expo's default Metro configs do. --------- Co-authored-by: Claude Opus 5.5 --- ...ent_processor_factory.react_native.spec.ts | 28 +--- .../async-storage.spec.ts | 73 +++++++--- .../async-storage.ts | 46 ++++--- lib/import.react_native/README.md | 125 ++++++++++++++++++ lib/import.react_native/fast-text-encoding.ts | 31 +++++ .../react-native-get-random-values.ts | 31 +++++ lib/index.react_native.ts | 23 +++- ...onfig_manager_factory.react_native.spec.ts | 22 +-- .../async_storage_cache.react_native.spec.ts | 4 +- .../cache/async_storage_cache.react_native.ts | 11 +- rollup.config.mjs | 98 +++++++++++++- vitest.browser.config.mts | 1 + 12 files changed, 409 insertions(+), 84 deletions(-) rename lib/{utils => }/import.react_native/@react-native-async-storage/async-storage.spec.ts (51%) rename lib/{utils => }/import.react_native/@react-native-async-storage/async-storage.ts (60%) create mode 100644 lib/import.react_native/README.md create mode 100644 lib/import.react_native/fast-text-encoding.ts create mode 100644 lib/import.react_native/react-native-get-random-values.ts diff --git a/lib/event_processor/event_processor_factory.react_native.spec.ts b/lib/event_processor/event_processor_factory.react_native.spec.ts index 9a6286fbe..8261e9851 100644 --- a/lib/event_processor/event_processor_factory.react_native.spec.ts +++ b/lib/event_processor/event_processor_factory.react_native.spec.ts @@ -55,26 +55,11 @@ vi.mock('@react-native-community/netinfo', () => { }); let isAsyncStorageAvailable = true; -// Mock Node.js module loader to simulate missing @react-native-async-storage/async-storage -vi.hoisted(() => { - mockRequireNetInfo(); -}); - -function mockRequireNetInfo() { - // Dynamically import module synchronously in Node environment - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { Module } = require('module'); - const M: any = Module; - - M._load_original = M._load; - M._load = (uri: string, parent: string) => { - if (uri === '@react-native-async-storage/async-storage') { - if (isAsyncStorageAvailable) return {}; - throw new Error("Module not found: @react-native-async-storage/async-storage"); - } - return M._load_original(uri, parent); - }; -} +// Simulate a missing @react-native-async-storage/async-storage +vi.mock('../import.react_native/@react-native-async-storage/async-storage', () => ({ + get isAvailable() { return isAsyncStorageAvailable; }, + get default() { return isAsyncStorageAvailable ? {} : undefined; }, +})); import { createForwardingEventProcessor, createBatchEventProcessor } from './event_processor_factory.react_native'; import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; @@ -83,7 +68,6 @@ import { getOpaqueBatchEventProcessor } from './event_processor_factory'; import { AsyncStore, AsyncPrefixStore, SyncStore, SyncPrefixStore } from '../utils/cache/store'; import { AsyncStorageCache } from '../utils/cache/async_storage_cache.react_native'; import { EVENT_STORE_PREFIX, EventStore } from './event_store'; -import { MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE } from '../utils/import.react_native/@react-native-async-storage/async-storage'; describe('createForwardingEventProcessor', () => { const mockGetForwardingEventProcessor = vi.mocked(getForwardingEventProcessor); @@ -159,7 +143,7 @@ describe('createBatchEventProcessor', () => { it('should throw error if @react-native-async-storage/async-storage is not available', async () => { isAsyncStorageAvailable = false; - const { AsyncStorageCache } = await vi.importActual< + const { AsyncStorageCache, MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE } = await vi.importActual< typeof import('../utils/cache/async_storage_cache.react_native') >('../utils/cache/async_storage_cache.react_native'); diff --git a/lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts b/lib/import.react_native/@react-native-async-storage/async-storage.spec.ts similarity index 51% rename from lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts rename to lib/import.react_native/@react-native-async-storage/async-storage.spec.ts index 8a77e3977..8d0d614a8 100644 --- a/lib/utils/import.react_native/@react-native-async-storage/async-storage.spec.ts +++ b/lib/import.react_native/@react-native-async-storage/async-storage.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2025, Optimizely + * Copyright 2025-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,10 +15,45 @@ */ import { vi, describe, it, expect } from 'vitest'; -import { ensureMultiGet } from './async-storage'; +import Module from 'module'; -describe('ensureMultiGet', () => { - it('should preserve multiGet when already present (v1/v2)', () => { +// The shim requires the package when it loads, so each case loads a fresh copy of the shim with the +// package's require replaced by `load`. vi.mock does not intercept the shim's plain require. +const loadShimWith = async (load: () => unknown) => { + const M = Module as unknown as { _load: (request: string, ...rest: unknown[]) => unknown }; + const originalLoad = M._load; + M._load = function (this: unknown, request: string, ...rest: unknown[]) { + if (request === '@react-native-async-storage/async-storage') return load(); + return originalLoad.call(this, request, ...rest); + }; + try { + vi.resetModules(); + return await import('./async-storage'); + } finally { + M._load = originalLoad; + } +}; + +const loadShimWithStorage = (storage: unknown) => loadShimWith(() => ({ default: storage })); + +describe('@react-native-async-storage/async-storage shim', () => { + it('should export isAvailable as false and an undefined default when the package is not installed', async () => { + const shim = await loadShimWith(() => { + throw new Error('Cannot find module'); + }); + + expect(shim.isAvailable).toBe(false); + expect(shim.default).toBeUndefined(); + }); + + it('should export an undefined default when the package has no default export', async () => { + const shim = await loadShimWithStorage(undefined); + + expect(shim.isAvailable).toBe(true); + expect(shim.default).toBeUndefined(); + }); + + it('should export the package default as-is when multiGet is present (v1/v2)', async () => { const multiGet = vi.fn(); const storage = { getItem: vi.fn(), @@ -29,9 +64,11 @@ describe('ensureMultiGet', () => { multiGet, }; - const result = ensureMultiGet(storage); + const shim = await loadShimWithStorage(storage); - expect(result.multiGet).toBe(multiGet); + expect(shim.isAvailable).toBe(true); + expect(shim.default).toBe(storage); + expect(shim.default?.multiGet).toBe(multiGet); }); it('should construct multiGet from getMany when multiGet is absent (v3)', async () => { @@ -49,11 +86,11 @@ describe('ensureMultiGet', () => { }), }; - const result = ensureMultiGet(storage); + const result = (await loadShimWithStorage(storage)).default; - expect(result.multiGet).toBeDefined(); + expect(result?.multiGet).toBeDefined(); - const pairs = await result.multiGet(['b', 'missing', 'a']); + const pairs = await result?.multiGet(['b', 'missing', 'a']); expect(pairs).toEqual([ ['b', '2'], ['missing', null], @@ -61,7 +98,7 @@ describe('ensureMultiGet', () => { ]); }); - it('should not modify the original storage when constructing multiGet (v3)', () => { + it('should not modify the original storage when constructing multiGet (v3)', async () => { const storage = { getItem: vi.fn(), setItem: vi.fn(), @@ -71,16 +108,16 @@ describe('ensureMultiGet', () => { getMany: vi.fn(), }; - const result = ensureMultiGet(storage); + const result = (await loadShimWithStorage(storage)).default; expect(result).not.toBe(storage); expect('multiGet' in storage).toBe(false); expect(Object.getPrototypeOf(result)).toBe(storage); - expect(result.getItem).toBe(storage.getItem); - expect(result.setItem).toBe(storage.setItem); - expect(result.removeItem).toBe(storage.removeItem); - expect(result.getAllKeys).toBe(storage.getAllKeys); - expect(result.clear).toBe(storage.clear); + expect(result?.getItem).toBe(storage.getItem); + expect(result?.setItem).toBe(storage.setItem); + expect(result?.removeItem).toBe(storage.removeItem); + expect(result?.getAllKeys).toBe(storage.getAllKeys); + expect(result?.clear).toBe(storage.clear); }); it('should return pairs in the requested key order regardless of getMany record order', async () => { @@ -99,8 +136,8 @@ describe('ensureMultiGet', () => { }), }; - const result = ensureMultiGet(storage); - const pairs = await result.multiGet(['z', 'x', 'y']); + const result = (await loadShimWithStorage(storage)).default; + const pairs = await result?.multiGet(['z', 'x', 'y']); expect(pairs).toEqual([ ['z', 'vz'], diff --git a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts b/lib/import.react_native/@react-native-async-storage/async-storage.ts similarity index 60% rename from lib/utils/import.react_native/@react-native-async-storage/async-storage.ts rename to lib/import.react_native/@react-native-async-storage/async-storage.ts index 83881b334..0a34784ec 100644 --- a/lib/utils/import.react_native/@react-native-async-storage/async-storage.ts +++ b/lib/import.react_native/@react-native-async-storage/async-storage.ts @@ -1,11 +1,11 @@ /** - * Copyright 2024, Optimizely + * Copyright 2024-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,9 @@ * limitations under the License. */ -import { Platform } from '../../../platform_support'; +import { Platform } from '../../platform_support'; + +// Optional import shim; see ../README.md. export interface AsyncStorageCompat { getItem(key: string): Promise; @@ -35,37 +37,43 @@ interface RawAsyncStorage { getMany?(keys: readonly string[]): Promise>; } -export const MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE = 'Module not found: @react-native-async-storage/async-storage'; - type RawAsyncStorageWithGetMany = RawAsyncStorage & Required>; -// Returns a wrapper with the original as its prototype, so the shared AsyncStorage object is not mutated. -export const ensureMultiGet = (storage: RawAsyncStorage): AsyncStorageCompat => { +// AsyncStorage v3 replaced multiGet with getMany. Returns a wrapper with the original as its prototype, +// so the shared AsyncStorage object is not mutated. +// multiGet avoids async/await, which would compile to a tslib helper import. +const ensureMultiGet = (storage: RawAsyncStorage): AsyncStorageCompat => { if (storage.multiGet || !storage.getMany) { return storage as AsyncStorageCompat; } return Object.create(storage, { multiGet: { - value: async function( + value: function( this: RawAsyncStorageWithGetMany, keys: readonly string[], ): Promise<[string, string | null][]> { - const record = await this.getMany(keys); - return keys.map((key: string) => [key, record[key] ?? null] as [string, string | null]); + return this.getMany(keys).then((record) => + keys.map((key: string) => [key, record[key] ?? null] as [string, string | null]) + ); }, }, }); }; -export const getDefaultAsyncStorage = (): AsyncStorageCompat => { - try { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const storage = require('@react-native-async-storage/async-storage').default; - return ensureMultiGet(storage); - } catch (e) { - throw new Error(MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE); - } -}; +export let isAvailable = true; + +// The package's default export, with multiGet added when it is missing (v3). +let AsyncStorage: AsyncStorageCompat | undefined; + +try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + const storage: RawAsyncStorage | undefined = require('@react-native-async-storage/async-storage').default; + AsyncStorage = storage ? ensureMultiGet(storage) : undefined; +} catch (e) { + isAvailable = false; +} + +export default AsyncStorage; export const __platforms: Platform[] = ['__universal__']; diff --git a/lib/import.react_native/README.md b/lib/import.react_native/README.md new file mode 100644 index 000000000..af5893935 --- /dev/null +++ b/lib/import.react_native/README.md @@ -0,0 +1,125 @@ +# React Native optional import shims + +Each file in this directory loads one optional React Native dependency (a peer dependency the app may not have installed) and tells the rest of the SDK whether it is available. + +The shims are not bundled into the main SDK bundle. Rollup builds each one to the same path under `dist/import.react_native/`, and the main React Native bundles `require` it by relative path (see `rollup.config.mjs`). The rest of this section explains why. + +## Why the shims are separate modules + +### How Metro connects a `require` to a module + +1. **Every file in an app's bundle is a module with a numeric ID.** +2. **When Metro transforms a module, each `require('some-package')` becomes a local index.** Metro lists the module's `require`s in order of appearance and rewrites each one to `_$$_REQUIRE(_dependencyMap[i])`. These indices are fixed at transform time, before Metro checks whether the packages are installed. +3. **When Metro writes the bundle, it gives each module a dependency map.** That's an array mapping local index → module ID, passed as an argument to the module's definition: + + ```js + // the module's code, as transformed: + _$$_REQUIRE(_dependencyMap[16], "fast-text-encoding") + _$$_REQUIRE(_dependencyMap[17], "react-native-get-random-values") + + // the module's definition in the bundle: id 538, then its dependency map + __d(function (...) { /* module code */ }, 538, [76, 27, /* ... */, 541, 547, 556], "…/index.react_native.min.js"); + ``` + +### The bug in Metro before 0.82.5 + +A `require` inside `try/catch` is an *optional dependency*, as long as the app's Metro config has `allowOptionalDependencies` on (React Native's and Expo's defaults turn it on). If the package isn't installed, Metro doesn't fail the build. + +Metro 0.82.4 and older also **removes the missing dependency from the module's dependency map**, so the array closes the gap. The module's code still uses the original indices, so every `require` after the missing one shifts by one. + +This used to hit the SDK when all of its React Native code was one Rollup bundle, meaning one Metro module. Its dependency map ended with: + +| Index | Dependency | +|---|---| +| 14 | `@react-native-async-storage/async-storage` (optional) | +| 15 | `@react-native-community/netinfo` | +| 16 | `fast-text-encoding` (optional) | +| 17 | `react-native-get-random-values` (optional) | + +With `fast-text-encoding` not installed, index 16 got `react-native-get-random-values`'s module ID and index 17 pointed past the end of the array: + +- **`require("fast-text-encoding")` silently loaded `react-native-get-random-values`.** No error was thrown, no `TextEncoder` was set up, and decisions failed later. +- **`require("react-native-get-random-values")` became `require(undefined)`,** which throws "Requiring unknown module". The SDK then reported "install react-native-get-random-values" even though that package was installed. +- **A missing async-storage would have shifted netinfo and both polyfill `require`s.** + +How `require(undefined)` fails also depends on timing: +- **While a module is loading:** the error is thrown to the caller, so a `try/catch` around the `require` catches it. +- **Any other time** (for example a `require` inside a function called later): Metro's loader catches the error itself and reports it as a fatal error. That's a red box in dev and usually a crash in release. The caller's `catch` never sees it. + +Metro 0.82.5 fixed the bug by keeping a `null` placeholder for a missing dependency. Requiring `null` throws "Cannot find module", wherever it happens. + +**Who's affected:** apps on React Native 0.78 or older, and on 0.79 or 0.80 if their Metro is below 0.82.5. Apps with every optional package installed aren't affected, because nothing gets removed. + +### How the shims avoid it + +- **Each optional `require` is alone in its own module.** A shim's dependency map has a single entry: its package. If the package is missing, the map is empty and the `require` becomes `require(undefined)`. There is no other `require` in the module that could shift. +- **Each shim does its `require` while the module loads.** The `require(undefined)` error is then thrown to the shim's `try/catch`, which sets `isAvailable = false`. On Metro 0.82.5 and later the `require` throws "Cannot find module", with the same result. +- **The main bundle loads shims by relative path,** for example `require("./import.react_native/fast-text-encoding.js")`. Those files always exist, so the main bundle's dependency map never has a missing entry, and none of its `require`s can shift. + +The rules below keep those guarantees. + +## Rules for a shim + +### One file per optional dependency, named after the package + +Two optional `require`s in one module could shift each other, as described above, so each optional package gets its own shim. The file path is the package name plus `.ts`. A scoped package goes in a folder named after its scope. + +| Package | Shim | +|---|---| +| `fast-text-encoding` | `fast-text-encoding.ts` | +| `react-native-get-random-values` | `react-native-get-random-values.ts` | +| `@react-native-async-storage/async-storage` | `@react-native-async-storage/async-storage.ts` | + +A test goes next to its shim as `.spec.ts`. Spec files are not built as shims. + +### Exports: `isAvailable`, plus what the SDK uses from the package + +- **`isAvailable`:** `true` if the package loaded, `false` if its `require` threw. +- **The package's exports, under the same names:** if the package isn't installed they are `undefined`. A shim may adapt a value as long as it keeps the package's shape. For example, the async-storage shim adds `multiGet` on AsyncStorage v3. +- **Only the exports the SDK uses:** this isn't required for correctness. Re-exporting more would still be one `require`. It just keeps the shims small. +- **Packages loaded only for side effects:** polyfills like `fast-text-encoding` only need `isAvailable`. +- **A shim can use `export default` when the package has a default export,** as the async-storage shim does. This works because of a setting in `rollup.config.mjs`: + - Shims are built as CommonJS. A default export becomes `exports.default`, and the file is marked with `__esModule`. + - In the main CJS bundles, Rollup by default treats a default import from an external CommonJS module as the whole `module.exports`. `import AsyncStorage from '…/async-storage'` would then get the shim's exports object instead of the storage. + - `rollup.config.mjs` therefore sets `interop: 'esModule'` for shim imports, so the CJS bundles read `exports.default`. + - Shims are only built as CommonJS; the ESM main bundle imports the same CommonJS files. It doesn't need the setting: the app's bundler (Metro, or webpack) reads `exports.default` for a default import from a CommonJS module marked with `__esModule`. +- **Never throw.** A shim catches the `require` error, sets `isAvailable = false`, and leaves its exports `undefined`. The importer decides what a missing package means. For example, `index.react_native.ts` throws if `TextEncoder` is still missing after the polyfill shims run, and `AsyncStorageCache` throws "Module not found" when there's no AsyncStorage. + +### Exactly one `require` in the built file + +The optional `require` must be the only `require` in the built shim (`dist/import.react_native/.js`). Any other `require` in the module could shift when the optional package is missing. + +**The build enforces this.** The `rn-import-shim-check` plugin in `rollup.config.mjs` fails the build if a built shim contains any `require` other than its own package's. The package is taken from the shim's name, so the check also enforces the naming convention. + +- **Wrap the `require` directly in `try/catch`.** Metro only treats a `require` as optional when it is directly inside a `try` block. Without that, a missing package fails the app's build. +- **Run it at module load, not later in a function.** Only then is a failed `require` thrown to the shim's `catch`. Later, Metro before 0.82.5 reports it as a fatal error instead (see "The bug in Metro before 0.82.5"). +- **Type-only imports are fine.** TypeScript removes them, for example `import { Platform } from '../platform_support'`. +- **No other runtime imports, not even of guaranteed packages.** Each of these adds a `require` to the built shim: + - A package import, even of a regular dependency, stays a `require` in the shim. It would only be safe if Metro listed it before the optional `require` in the shim's dependency map, and Metro's inline requires move imports around, so that order can't be relied on. + - SDK code imported by more than one shim goes into a shared file that each of them `require`s. + + SDK code imported by only one shim is copied into it and adds no `require`, so the check allows it. It is a separate copy from the one in the main bundle, though, so any module state is not shared. Keep shims self-contained. +- **No syntax that needs `tslib` helpers.** With the repo's ES6 target, `async`/`await` compiles to a `tslib` `__awaiter` import, which adds a `require('tslib')`. Use `.then()` instead. +- **Export `__platforms`,** as every file in `lib/` does for the platform-isolation check. + +## Template + +```ts +import { Platform } from '../platform_support'; + +export let isAvailable = true; + +// Only the exports the SDK uses, under the package's names. +export let someExport: SomeType | undefined; + +try { + // eslint-disable-next-line @typescript-eslint/no-var-requires + someExport = require('some-package').someExport; +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; +``` + +Importers use a shim through a normal relative import, for example `import { isAvailable, someExport } from './import.react_native/some-package'`. The Rollup plugin turns that into the relative `require` of the built shim. diff --git a/lib/import.react_native/fast-text-encoding.ts b/lib/import.react_native/fast-text-encoding.ts new file mode 100644 index 000000000..0176a74b2 --- /dev/null +++ b/lib/import.react_native/fast-text-encoding.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../platform_support'; + +// Optional import shim; see README.md in this directory. + +export let isAvailable = true; + +try { + // Sets a global TextEncoder if there is none; an existing one is kept. + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('fast-text-encoding'); +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; diff --git a/lib/import.react_native/react-native-get-random-values.ts b/lib/import.react_native/react-native-get-random-values.ts new file mode 100644 index 000000000..d8564a881 --- /dev/null +++ b/lib/import.react_native/react-native-get-random-values.ts @@ -0,0 +1,31 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../platform_support'; + +// Optional import shim; see README.md in this directory. + +export let isAvailable = true; + +try { + // Sets a global crypto.getRandomValues if there is none; an existing one is kept. + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('react-native-get-random-values'); +} catch (e) { + isAvailable = false; +} + +export const __platforms: Platform[] = ['react_native']; diff --git a/lib/index.react_native.ts b/lib/index.react_native.ts index 6914a5f97..e32dac23d 100644 --- a/lib/index.react_native.ts +++ b/lib/index.react_native.ts @@ -13,8 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import 'fast-text-encoding'; -import 'react-native-get-random-values'; +// Optional polyfills: each is loaded if installed and keeps an existing global, so apps can provide +// their own polyfill instead by loading it before the SDK is imported. +import './import.react_native/fast-text-encoding'; +import './import.react_native/react-native-get-random-values'; import { Client, Config } from './shared_types'; import { getOptimizelyInstance, OptimizelyFactoryConfig } from './client_factory'; @@ -22,6 +24,23 @@ import { REACT_NATIVE_JS_CLIENT_ENGINE } from './utils/enums'; import { EventDispatcher } from './event_processor/event_dispatcher/event_dispatcher'; import { BrowserRequestHandler } from './utils/http_request_handler/request_handler.browser'; import { Platform } from './platform_support'; + +// murmurhash needs a global TextEncoder. Newer Hermes provides one; older Hermes and JSC do not. +if (typeof TextEncoder === 'undefined') { + throw new Error( + 'TextEncoder is not available in this environment. Install fast-text-encoding, ' + + 'or load another TextEncoder polyfill before importing the SDK.' + ); +} + +// uuid needs a global crypto.getRandomValues, which React Native does not provide. +if (typeof crypto === 'undefined' || typeof crypto.getRandomValues !== 'function') { + throw new Error( + 'crypto.getRandomValues is not available in this environment. Install react-native-get-random-values, ' + + 'or load another crypto.getRandomValues polyfill before importing the SDK.' + ); +} + /** * Creates an instance of the Optimizely class * @param {Config} config diff --git a/lib/project_config/config_manager_factory.react_native.spec.ts b/lib/project_config/config_manager_factory.react_native.spec.ts index e73440ac0..798f64190 100644 --- a/lib/project_config/config_manager_factory.react_native.spec.ts +++ b/lib/project_config/config_manager_factory.react_native.spec.ts @@ -16,26 +16,12 @@ import { describe, it, expect, beforeEach, vi } from 'vitest'; -vi.hoisted(async () => { - mockRequireAsyncStorage(); -}); - let isAsyncStorageAvailable = true; -function mockRequireAsyncStorage() { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { Module } = require('module'); - const M: any = Module; - - M._load_original = M._load; - M._load = (uri: string, parent: string) => { - if (uri === '@react-native-async-storage/async-storage') { - if (isAsyncStorageAvailable) return { default: {} }; - throw new Error("Module not found: @react-native-async-storage/async-storage"); - } - return M._load_original(uri, parent); - }; -} +vi.mock('../import.react_native/@react-native-async-storage/async-storage', () => ({ + get isAvailable() { return isAsyncStorageAvailable; }, + get default() { return isAsyncStorageAvailable ? {} : undefined; }, +})); vi.mock('./config_manager_factory', () => { return { diff --git a/lib/utils/cache/async_storage_cache.react_native.spec.ts b/lib/utils/cache/async_storage_cache.react_native.spec.ts index 4a8ed0fec..5a32ba2c4 100644 --- a/lib/utils/cache/async_storage_cache.react_native.spec.ts +++ b/lib/utils/cache/async_storage_cache.react_native.spec.ts @@ -17,12 +17,12 @@ import { vi, describe, it, expect } from 'vitest'; import { AsyncStorageCache } from './async_storage_cache.react_native'; import { AsyncStoreWithBatchedGet } from './store'; -import { getDefaultAsyncStorage } from '../import.react_native/@react-native-async-storage/async-storage'; +import AsyncStorage, { AsyncStorageCompat } from '../../import.react_native/@react-native-async-storage/async-storage'; vi.mock('@react-native-async-storage/async-storage'); describe('AsyncStorageCache', () => { - const asyncStorage = getDefaultAsyncStorage(); + const asyncStorage = AsyncStorage as AsyncStorageCompat; it('should store the value as-is in async storage without serialization', async () => { const cache = new AsyncStorageCache(); diff --git a/lib/utils/cache/async_storage_cache.react_native.ts b/lib/utils/cache/async_storage_cache.react_native.ts index 956cd8745..e57247bf2 100644 --- a/lib/utils/cache/async_storage_cache.react_native.ts +++ b/lib/utils/cache/async_storage_cache.react_native.ts @@ -16,9 +16,18 @@ import { Maybe } from "../type"; import { AsyncStore, AsyncStoreWithBatchedGet } from "./store"; -import { getDefaultAsyncStorage } from "../import.react_native/@react-native-async-storage/async-storage"; +import AsyncStorage, { AsyncStorageCompat, isAvailable } from "../../import.react_native/@react-native-async-storage/async-storage"; import { Platform } from '../../platform_support'; +export const MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE = 'Module not found: @react-native-async-storage/async-storage'; + +const getDefaultAsyncStorage = (): AsyncStorageCompat => { + if (!isAvailable || !AsyncStorage) { + throw new Error(MODULE_NOT_FOUND_REACT_NATIVE_ASYNC_STORAGE); + } + return AsyncStorage; +}; + export class AsyncStorageCache extends AsyncStoreWithBatchedGet implements AsyncStore { public readonly operation = 'async'; private asyncStorage = getDefaultAsyncStorage(); diff --git a/rollup.config.mjs b/rollup.config.mjs index fe3df3d85..aeca0502d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -20,7 +20,8 @@ import terser from '@rollup/plugin-terser'; import alias from '@rollup/plugin-alias'; import { createRequire } from 'module'; import { fileURLToPath } from 'url'; -import { dirname, join } from 'path'; +import { readdirSync } from 'fs'; +import { dirname, join, relative, resolve } from 'path'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); @@ -58,6 +59,97 @@ const externalDeps = ['https', 'http', 'url'].concat(Object.keys({ ...dependenci // into the CJS output instead of leaving it as an external dependency. const externalDepsWithoutUuid = externalDeps.filter(dep => dep !== 'uuid'); +// React Native optional import shims (lib/import.react_native) are not bundled into the main bundles. +// Each is shipped as its own module at the same relative location in dist, because Metro before 0.82.5 +// shifts every later require in a module when an optional dependency is missing. +// See lib/import.react_native/README.md. +const BUILD_DIR = join(__dirname, '.build'); +const RN_IMPORT_SHIM_DIR = 'import.react_native'; + +// Shim paths relative to the shim directory, without extension. Shims are named after their package, so +// a scoped package's shim is in a subdirectory, e.g. '@react-native-async-storage/async-storage'. +const listShims = (subdir = '') => + readdirSync(join(__dirname, 'lib', RN_IMPORT_SHIM_DIR, subdir), { withFileTypes: true }).flatMap(entry => { + const path = subdir ? `${subdir}/${entry.name}` : entry.name; + if (entry.isDirectory()) return listShims(path); + return entry.name.endsWith('.ts') && !entry.name.endsWith('.spec.ts') ? [path.replace(/\.ts$/, '')] : []; + }); +const RN_IMPORT_SHIMS = listShims(); + +// Leaves shim imports out of the main bundles and writes them as a path relative to the bundle, e.g. +// import '../../../import.react_native/@react-native-async-storage/async-storage' (from a file deep in .build) +// -> require("./import.react_native/@react-native-async-storage/async-storage.js") (in dist/index.react_native.min.js) +// The bundles are at the root of dist and the shims are built to dist/import.react_native, +// so that path points to the built shim. +// Marking the imports external via the `external` option is not enough: Rollup would resolve them to the +// file in .build and write a path from the bundle back into .build (../.build/import.react_native/...). +// Returning a relative id from resolveId makes Rollup write it exactly as given. +const rnImportShimExternalPlugin = { + name: 'rn-import-shim-external', + resolveId(source, importer) { + if (!importer || !source.startsWith('.')) return null; + const pathInBuild = relative(BUILD_DIR, resolve(dirname(importer), source)).replace(/\.js$/, ''); + if (!pathInBuild.startsWith(`${RN_IMPORT_SHIM_DIR}/`)) return null; + return { id: `./${pathInBuild}.js`, external: true }; + }, +}; + +// Shims are built as CommonJS with __esModule set, so a default import of a shim must read its `default` +// export ('esModule'). Rollup's 'default' interop, used for the other externals, would read the whole module. +const rnImportShimInterop = id => (id && id.startsWith(`./${RN_IMPORT_SHIM_DIR}/`) ? 'esModule' : 'default'); + +// Fails the build unless every built shim contains exactly one require(), of its own package (the shim's +// name). Any other require in a shim could be shifted by the Metro bug when the package is missing. This +// catches imports of other packages, tslib helpers, and code shared between shims (Rollup moves it into a +// shared chunk that the shims require). The shim's own require() is plain code, so Rollup doesn't list it in +// chunk.imports; the generated code is parsed instead, with Rollup's parser. +const rnImportShimCheckPlugin = { + name: 'rn-import-shim-check', + generateBundle(_, bundle) { + // Module names of every require(...) call in an ESTree AST; a call whose argument is not a string is + // listed as ''. + const findRequireCalls = (node, found = []) => { + if (Array.isArray(node)) { + node.forEach(child => findRequireCalls(child, found)); + } else if (node && typeof node.type === 'string') { + if (node.type === 'CallExpression' && node.callee.type === 'Identifier' && node.callee.name === 'require') { + const [arg] = node.arguments; + found.push(arg && arg.type === 'Literal' && typeof arg.value === 'string' ? arg.value : ''); + } + for (const value of Object.values(node)) { + if (value && typeof value === 'object') findRequireCalls(value, found); + } + } + return found; + }; + + for (const chunk of Object.values(bundle)) { + if (chunk.type !== 'chunk') continue; + const required = findRequireCalls(this.parse(chunk.code)); + if (!chunk.isEntry || required.length !== 1 || required[0] !== chunk.name) { + this.error( + `${RN_IMPORT_SHIM_DIR}/${chunk.fileName}: a shim must contain exactly one require(), of its own package` + + ` '${chunk.name}' (found: ${required.join(', ') || 'none'}). See lib/${RN_IMPORT_SHIM_DIR}/README.md.` + ); + } + } + }, +}; + +const rnImportShimsBundle = { + plugins: [rnImportShimCheckPlugin], + external: externalDeps, + input: Object.fromEntries( + RN_IMPORT_SHIMS.map(name => [name, join(BUILD_DIR, RN_IMPORT_SHIM_DIR, `${name}.js`)]) + ), + output: { + exports: 'named', + format: 'cjs', + dir: join('dist', RN_IMPORT_SHIM_DIR), + entryFileNames: '[name].js', + }, +}; + const cjsBundleFor = (platform, opt = {}) => { const { minify, ext } = { minify: true, @@ -68,13 +160,14 @@ const cjsBundleFor = (platform, opt = {}) => { const min = minify ? '.min' : ''; return { - plugins: [aliasPlugin, resolvePluginByPlatform[platform] || resolvePlugin, commonjs()], + plugins: [rnImportShimExternalPlugin, aliasPlugin, resolvePluginByPlatform[platform] || resolvePlugin, commonjs()], external: externalDepsWithoutUuid, input: `.build/index.${platform}.js`, output: { exports: 'named', format: 'cjs', file: `dist/index.${platform}${min}${ext}`, + interop: rnImportShimInterop, plugins: minify ? [terser()] : undefined, sourcemap: true, }, @@ -198,6 +291,7 @@ const bundles = { 'esm-node-min': esmBundleFor('node', { ext: '.mjs' }), 'esm-react-native-min': esmBundleFor('react_native'), 'esm-universal': esmBundleFor('universal'), + 'cjs-react-native-import-shims': rnImportShimsBundle, 'json-schema': jsonSchemaBundle, 'cjs-ua-parser-min': cjsBundleForUAParser(), 'esm-ua-parser-min': esmBundleForUAParser(), diff --git a/vitest.browser.config.mts b/vitest.browser.config.mts index d3d7763c6..4e6095b38 100644 --- a/vitest.browser.config.mts +++ b/vitest.browser.config.mts @@ -165,6 +165,7 @@ export default defineConfig({ ], exclude: [ 'lib/**/*.react_native.spec.ts', + 'lib/import.react_native/**/*.spec.ts', 'lib/**/*.node.spec.ts', 'lib/*.umd.spec.ts' ], From 5a388f5433c3cc55e6e2460279df805f85228e2d Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Mon, 19 Oct 2026 19:40:50 +0600 Subject: [PATCH 28/39] [FSSDK-13287] Add React Native Metro tests for optional dependencies (#1180) ## Summary - **New test suite, `tests/react-native-metro/`:** checks how the SDK behaves in React Native apps when `fast-text-encoding`, `react-native-get-random-values` and `@react-native-async-storage/async-storage` are installed, missing, or replaced by the app's own polyfill or store. - **Two Metro setups:** React Native 0.73 (Metro 0.80, which has the dependency-map bug behind #1179) and React Native 0.87 (fixed Metro). Each is a fixture with `@react-native/metro-config`, `metro` and Babel pinned by committed lockfiles. The `react-native` package isn't needed. - **How a case runs** (`npm run test-rn-metro`): 1. The SDK is packed and installed the way an app installs it. 2. A small test app is bundled with the fixture's real Metro and React Native Metro config, loaded through `loadConfig` as the RN CLI does. React Native's startup module is skipped because it needs native code. `resolveRequest` decides which optional packages exist; packages that need native code resolve to small JS stand-ins. 3. The bundle runs in a fresh Node `vm` context, which has no `TextEncoder` or `crypto`, like older Hermes. Cases that need a native `TextEncoder` add one. 4. The app records which implementation the SDK used, its decisions, the dispatched event UUIDs, and any errors. The runner checks these against each case's expectation and prints a results table. - **Matches app behaviour:** Metro's `require` is part of the bundle, so modules load exactly as in an app. The test app installs a non-throwing `ErrorUtils` handler, as React Native's startup code does, so a failed `require` outside module loading is reported as fatal (the red box) instead of rethrown to the caller. - **CI:** a new `react_native_metro_test` job runs on every PR (Ubuntu, Node 20, about a minute). The device testing for #1179 was done by hand on simulators. This automates the part that broke, Metro's bundling and runtime `require` together with the SDK's optional import shims, on both a buggy and a fixed Metro. `tests/react-native-metro/README.md` explains the setup, how to add a case, and how to update a fixture. --------- Co-authored-by: Claude Opus 5.5 --- .github/workflows/javascript.yml | 17 + .gitignore | 4 + package.json | 1 + tests/react-native-metro/README.md | 54 + tests/react-native-metro/app/datafile.json | 515 ++ tests/react-native-metro/app/index.js | 23 + tests/react-native-metro/app/setup.js | 54 + tests/react-native-metro/app/test.js | 140 + tests/react-native-metro/build.cjs | 44 + tests/react-native-metro/cases.mjs | 121 + .../fixtures/rn-0.73/metro.config.js | 1 + .../fixtures/rn-0.73/package-lock.json | 4742 +++++++++++++++++ .../fixtures/rn-0.73/package.json | 13 + .../fixtures/rn-0.87/metro.config.js | 1 + .../fixtures/rn-0.87/package-lock.json | 2864 ++++++++++ .../fixtures/rn-0.87/package.json | 13 + tests/react-native-metro/metro.config.base.js | 85 + tests/react-native-metro/run.mjs | 254 + .../stubs/async-storage-v2.js | 34 + .../stubs/async-storage-v3.js | 34 + tests/react-native-metro/stubs/netinfo.js | 21 + .../stubs/react-native-get-random-values.js | 31 + 22 files changed, 9066 insertions(+) create mode 100644 tests/react-native-metro/README.md create mode 100644 tests/react-native-metro/app/datafile.json create mode 100644 tests/react-native-metro/app/index.js create mode 100644 tests/react-native-metro/app/setup.js create mode 100644 tests/react-native-metro/app/test.js create mode 100644 tests/react-native-metro/build.cjs create mode 100644 tests/react-native-metro/cases.mjs create mode 100644 tests/react-native-metro/fixtures/rn-0.73/metro.config.js create mode 100644 tests/react-native-metro/fixtures/rn-0.73/package-lock.json create mode 100644 tests/react-native-metro/fixtures/rn-0.73/package.json create mode 100644 tests/react-native-metro/fixtures/rn-0.87/metro.config.js create mode 100644 tests/react-native-metro/fixtures/rn-0.87/package-lock.json create mode 100644 tests/react-native-metro/fixtures/rn-0.87/package.json create mode 100644 tests/react-native-metro/metro.config.base.js create mode 100644 tests/react-native-metro/run.mjs create mode 100644 tests/react-native-metro/stubs/async-storage-v2.js create mode 100644 tests/react-native-metro/stubs/async-storage-v3.js create mode 100644 tests/react-native-metro/stubs/netinfo.js create mode 100644 tests/react-native-metro/stubs/react-native-get-random-values.js diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 7ff3ba050..2ccda8115 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -57,6 +57,23 @@ jobs: npm install npm run test-commonjs + react_native_metro_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 22 + cache-dependency-path: | + ./package-lock.json + ./tests/react-native-metro/fixtures/*/package-lock.json + cache: 'npm' + - name: Run React Native Metro tests + run: | + npm install + npm run test-rn-metro + integration_tests: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master secrets: diff --git a/.gitignore b/.gitignore index 0dbfdca60..5e46a5abb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ local.log **/*.gen.ts .env + +# React Native Metro tests: installed SDK and built bundles +tests/react-native-metro/.sdk/ +tests/react-native-metro/.out/ diff --git a/package.json b/package.json index 6edfd1dfc..a35802d9d 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "test-umd": "node ./scripts/run-umd-tests.js", "test-umd-local": "USE_LOCAL_BROWSER=true node ./scripts/run-umd-tests.js", "test-umd-browserstack": "USE_LOCAL_BROWSER=false node ./scripts/run-umd-tests.js", + "test-rn-metro": "node tests/react-native-metro/run.mjs", "test-mocha": "mocha -r lib/tests/uuid_cjs_shim.js -r ts-node/register -r tsconfig-paths/register -r lib/tests/exit_on_unhandled_rejection.js 'lib/**/*.tests.ts' 'lib/**/*.tests.js'", "test": "npm run test-mocha && npm run test-vitest", "posttest": "npm run lint", diff --git a/tests/react-native-metro/README.md b/tests/react-native-metro/README.md new file mode 100644 index 000000000..9dfd512e1 --- /dev/null +++ b/tests/react-native-metro/README.md @@ -0,0 +1,54 @@ +# React Native Metro tests + +These tests check how the SDK behaves in React Native apps when optional dependencies are installed or missing: `fast-text-encoding`, `react-native-get-random-values` and `@react-native-async-storage/async-storage`. They run on a Metro version with the dependency-map bug (Metro 0.80, React Native 0.73) and on one with the fix (Metro 0.87, React Native 0.87). See `lib/import.react_native/README.md` for the bug and how the SDK's optional import shims avoid it. + +Run them with: + +```sh +npm run test-rn-metro +``` + +To test a specific package or a subset: `node tests/react-native-metro/run.mjs [--sdk ] [--fixture rn-0.73] [--case P2]`. + +## How it works + +For each case, the test app in `app/` is bundled with a real Metro and React Native's own Metro config, then run in Node: + +1. **The SDK is packed and installed** into `.sdk/` the way an app installs it: `npm pack` (which builds it, as `npm publish` does), with its dependencies and without its optional peer dependencies. +2. **The bundle is built** by `build.cjs` with the fixture's Metro, through `metro-config`'s `loadConfig` as the React Native CLI does. `metro.config.base.js` wraps the fixture's `@react-native/metro-config`, so transforms, inline requires, the serializer and React Native's JS polyfills (including `ErrorUtils`) match an app build. It changes two things: + - **React Native's startup module is skipped** (`getModulesRunBeforeMainModule`), because it needs native code. + - **`resolveRequest` decides which optional packages exist.** An installed package resolves to the real `fast-text-encoding` or to a stand-in from `stubs/`, for packages that need native code. A missing package fails to resolve, so Metro handles it as an optional dependency that isn't installed. netinfo always resolves to its stand-in, and bundling `react-native` itself fails the build. +3. **The bundle runs in a fresh Node `vm` context.** It only has standard JS built-ins, so there is no `TextEncoder` or `crypto`, like Hermes before React Native 0.74. Cases with `nativeTextEncoder` add Node's `TextEncoder`. +4. **The app records what happened and `run.mjs` checks it against the case's expectation.** The app records which implementation provides `TextEncoder` and `crypto.getRandomValues`, decisions, dispatched events, and any errors. Decisions must match `EXPECTED_DECISIONS` in `cases.mjs` exactly, so failed decisions don't pass. In failure cases, every recorded error must be the expected one. + +Metro's `require` is part of the bundle (`metro-runtime`), so the bundle's modules are loaded by the same code as in an app. Two things make the run behave like an app: + +- **`app/setup.js` installs a non-throwing `ErrorUtils` handler.** React Native's startup code replaces the polyfill's handler, which rethrows, with one that reports the error (red box or fatal) and returns. Without it, a failed `require` outside module loading would be rethrown to the caller instead of reported as fatal, and the test couldn't tell the two apart. The test treats a recorded fatal error as the red box. +- **The SDK is loaded on a later tick (`app/index.js`),** when no module is loading, as app code does after startup. + +## Files + +| Path | Purpose | +|---|---| +| `run.mjs` | Packs and installs the SDK, builds the bundles, runs and checks every case, prints a results table | +| `cases.mjs` | The cases and their expected results | +| `build.cjs` | Builds one bundle with a fixture's Metro | +| `metro.config.base.js` | Metro config shared by the fixtures | +| `app/` | The test app: `index.js` (entry), `setup.js` (error handler, custom polyfills), `test.js` (the test), `datafile.json` | +| `stubs/` | Stand-ins for netinfo, async-storage (v2 with `multiGet`, v3 with `getMany`) and `react-native-get-random-values` | +| `fixtures/rn-0.73`, `fixtures/rn-0.87` | The Metro setup of each React Native version: `@react-native/metro-config`, `metro`, `metro-config`, `@babel/core`, `@babel/runtime` and `fast-text-encoding`, pinned by the committed lockfiles | + +`.sdk/` and `.out/` (the bundles) are generated and not committed. + +## Adding a case + +Add an entry to `CASES` in `cases.mjs`. `modules` sets which optional packages are installed, `runtime` sets what the app does at runtime, and `expect` is one of: +- `works`: which implementation of `TextEncoder` and `getRandomValues` the SDK must use; +- `fatal`: the error reported while the SDK loads; +- `caught`: the error thrown to the app's code. + +The comment at the top of `cases.mjs` lists every option. + +## Updating a fixture + +Change the versions in the fixture's `package.json` to what that React Native version uses, then run `npm install` in the fixture folder and commit the updated lockfile. A fixture only needs React Native's Metro setup, not the `react-native` package. diff --git a/tests/react-native-metro/app/datafile.json b/tests/react-native-metro/app/datafile.json new file mode 100644 index 000000000..5bc8ccf4f --- /dev/null +++ b/tests/react-native-metro/app/datafile.json @@ -0,0 +1,515 @@ +{ + "accountId": "24535200037", + "projectId": "5088239376138240", + "revision": "21", + "attributes": [ + { + "id": "7001", + "key": "age" + } + ], + "audiences": [ + { + "name": "age_22", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4001" + }, + { + "name": "age_60", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4002" + }, + { + "name": "age_90", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4003" + }, + { + "name": "age_94", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4004" + }, + { + "name": "age_95", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4005" + }, + { + "name": "age_96", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4006" + }, + { + "name": "age_97", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]", + "id": "4007" + }, + { + "id": "$opt_dummy_audience", + "name": "Optimizely-Generated Audience for Backwards Compatibility", + "conditions": "[\"or\", {\"match\": \"exact\", \"name\": \"$opt_dummy_attribute\", \"type\": \"custom_attribute\", \"value\": \"$opt_dummy_value\"}]" + } + ], + "version": "4", + "events": [ + { + "id": "90000001", + "key": "purchase", + "experimentIds": [] + } + ], + "integrations": [], + "anonymizeIP": true, + "botFiltering": false, + "typedAudiences": [ + { + "name": "age_22", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 22 + } + ] + ] + ], + "id": "4001" + }, + { + "name": "age_60", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 60 + } + ] + ] + ], + "id": "4002" + }, + { + "name": "age_90", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 90 + } + ] + ] + ], + "id": "4003" + }, + { + "name": "age_94", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 94 + } + ] + ] + ], + "id": "4004" + }, + { + "name": "age_95", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 95 + } + ] + ] + ], + "id": "4005" + }, + { + "name": "age_96", + "conditions": [ + "and", + [ + "or", + [ + "or", + { + "match": "le", + "name": "age", + "type": "custom_attribute", + "value": 96 + } + ] + ] + ], + "id": "4006" + } + ], + "variables": [], + "environmentKey": "production", + "sdkKey": "sdk_key", + "featureFlags": [ + { + "id": "1001", + "key": "flag_1", + "rolloutId": "rollout-371334-671741182375276", + "experimentIds": [ + "2001", + "2002", + "2003" + ], + "variables": [ + { + "id": "6001", + "key": "integer_variable", + "type": "integer", + "defaultValue": "0" + } + ] + }, + { + "id": "1002", + "key": "flag_2", + "rolloutId": "rollout-374517-931741182375293", + "experimentIds": [ + "2004" + ], + "variables": [] + } + ], + "rollouts": [ + { + "id": "rollout-371334-671741182375276", + "experiments": [ + { + "id": "3001", + "key": "delivery_1", + "status": "Running", + "layerId": "9300001480454", + "variations": [ + { + "id": "5004", + "key": "variation_4", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "4" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5004", + "endOfRange": 1500 + } + ], + "forcedVariations": {}, + "audienceIds": [ + "4001" + ], + "audienceConditions": [ + "or", + "4001" + ] + }, + { + "id": "3002", + "key": "delivery_2", + "status": "Running", + "layerId": "9300001480455", + "variations": [ + { + "id": "5005", + "key": "variation_5", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "5" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5005", + "endOfRange": 4000 + } + ], + "forcedVariations": {}, + "audienceIds": [ + "4002" + ], + "audienceConditions": [ + "or", + "4002" + ] + }, + { + "id": "3003", + "key": "delivery_3", + "status": "Running", + "layerId": "9300001495996", + "variations": [ + { + "id": "5006", + "key": "variation_6", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "6" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5006", + "endOfRange": 8000 + } + ], + "forcedVariations": {}, + "audienceIds": [ + "4003" + ], + "audienceConditions": [ + "or", + "4003" + ] + }, + { + "id": "default-rollout-id", + "key": "default-rollout-key", + "status": "Running", + "layerId": "rollout-371334-671741182375276", + "variations": [ + { + "id": "5007", + "key": "variation_7", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "7" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5007", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceIds": [], + "audienceConditions": [] + } + ] + }, + { + "id": "rollout-374517-931741182375293", + "experiments": [ + { + "id": "default-rollout-374517-931741182375293", + "key": "default-rollout-374517-931741182375293", + "status": "Running", + "layerId": "rollout-374517-931741182375293", + "variations": [ + { + "id": "1177722", + "key": "off", + "featureEnabled": false, + "variables": [] + } + ], + "trafficAllocation": [ + { + "entityId": "1177722", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceIds": [], + "audienceConditions": [] + } + ] + } + ], + "experiments": [ + { + "id": "2001", + "key": "exp_1", + "status": "Running", + "layerId": "9300001480444", + "variations": [ + { + "id": "5001", + "key": "variation_1", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "1" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5001", + "endOfRange": 5000 + }, + { + "entityId": "5001", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceIds": [ + "4001" + ], + "audienceConditions": [ + "or", + "4001" + ] + }, + { + "id": "2002", + "key": "exp_2", + "status": "Running", + "layerId": "9300001480448", + "variations": [ + { + "id": "5002", + "key": "variation_2", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "2" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5002", + "endOfRange": 5000 + }, + { + "entityId": "5002", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceConditions": [ + "or", + "4002" + ] + }, + { + "id": "2003", + "key": "exp_3", + "status": "Running", + "layerId": "9300001480451", + "variations": [ + { + "id": "5003", + "key": "variation_3", + "featureEnabled": true, + "variables": [ + { + "id": "6001", + "value": "3" + } + ] + } + ], + "trafficAllocation": [ + { + "entityId": "5003", + "endOfRange": 5000 + }, + { + "entityId": "5003", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceIds": [], + "audienceConditions": [ + "or", + "4003" + ], + "cmab": { + "attributes": [ + "7001" + ] + } + }, + { + "id": "2004", + "key": "exp_4", + "status": "Running", + "layerId": "9300001497754", + "variations": [ + { + "id": "5100", + "key": "variation_flag_2", + "featureEnabled": true, + "variables": [] + } + ], + "trafficAllocation": [ + { + "entityId": "5100", + "endOfRange": 5000 + }, + { + "entityId": "5100", + "endOfRange": 10000 + } + ], + "forcedVariations": {}, + "audienceIds": [], + "audienceConditions": [] + } + ], + "groups": [] +} diff --git a/tests/react-native-metro/app/index.js b/tests/react-native-metro/app/index.js new file mode 100644 index 000000000..5439ee5e4 --- /dev/null +++ b/tests/react-native-metro/app/index.js @@ -0,0 +1,23 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Bundle entry. setup.js runs first, as an app's entry would run its polyfills. The test runs on a later +// tick, like app code after startup, so the SDK is loaded when no other module is loading (as in an app). +import './setup'; + +setTimeout(() => { + require('./test').run(); +}, 0); diff --git a/tests/react-native-metro/app/setup.js b/tests/react-native-metro/app/setup.js new file mode 100644 index 000000000..0b1cf8259 --- /dev/null +++ b/tests/react-native-metro/app/setup.js @@ -0,0 +1,54 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Runs before the test. __CASE__ and __record are provided by run.mjs. +const testCase = globalThis.__CASE__; +const record = globalThis.__record; + +// React Native's startup code replaces the ErrorUtils polyfill's handler (which rethrows) with one that +// reports the error (red box / fatal) and returns. Do the same, recording the error instead. Without this, +// a failed require outside module loading would be rethrown to the caller instead of reported as fatal. +globalThis.ErrorUtils.setGlobalHandler((error, isFatal) => { + record('reportedError', { message: String((error && error.message) || error), isFatal }); +}); + +// The app's own polyfills, loaded before the SDK. +if (testCase.customTextEncoder && typeof globalThis.TextEncoder === 'undefined') { + globalThis.TextEncoder = class CustomTextEncoder { + get encoding() { + return 'utf-8'; + } + encode(str = '') { + const utf8 = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(utf8.length); + for (let i = 0; i < utf8.length; i++) { + bytes[i] = utf8.charCodeAt(i); + } + return bytes; + } + }; +} + +if (testCase.customGetRandomValues && typeof globalThis.crypto?.getRandomValues !== 'function') { + globalThis.crypto = globalThis.crypto || {}; + // Test only: Math.random is not cryptographically secure. + globalThis.crypto.getRandomValues = function customGetRandomValues(array) { + for (let i = 0; i < array.length; i++) { + array[i] = Math.floor(Math.random() * 256); + } + return array; + }; +} diff --git a/tests/react-native-metro/app/test.js b/tests/react-native-metro/app/test.js new file mode 100644 index 000000000..6265602b6 --- /dev/null +++ b/tests/react-native-metro/app/test.js @@ -0,0 +1,140 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// The test itself. Loads the SDK, decides, tracks, and records what happened for run.mjs to check. +import datafile from './datafile.json'; + +const testCase = globalThis.__CASE__; +const record = globalThis.__record; + +// Which implementation provides each global the SDK uses. +const sources = () => { + const TE = globalThis.TextEncoder; + const getRandomValues = globalThis.crypto && globalThis.crypto.getRandomValues; + return { + textEncoder: !TE ? 'none' + : TE === globalThis.__nativeTextEncoder ? 'native' + : TE.name === 'CustomTextEncoder' ? 'custom' + : 'fast-text-encoding', + getRandomValues: !getRandomValues ? 'none' + : getRandomValues.name === 'customGetRandomValues' ? 'custom' + : 'package', + }; +}; + +class MemoryStore { + constructor() { + this.operation = 'sync'; + this.items = new Map(); + } + set(key, value) { this.items.set(key, value); } + get(key) { return this.items.get(key); } + remove(key) { this.items.delete(key); } + getKeys() { return [...this.items.keys()]; } +} + +const waitFor = (check, timeoutMs) => new Promise((resolve) => { + const start = Date.now(); + const tick = () => { + if (check() || Date.now() - start > timeoutMs) resolve(); + else setTimeout(tick, 20); + }; + tick(); +}); + +const eventUuids = (request) => request.params.visitors.flatMap((visitor) => + visitor.snapshots.flatMap((snapshot) => snapshot.events.map((event) => event.uuid))); + +const recordingDispatcher = (events) => ({ + dispatchEvent: (request) => { + events.push(...eventUuids(request)); + return Promise.resolve({ statusCode: 200 }); + }, +}); + +const failingDispatcher = (events) => ({ + dispatchEvent: (request) => { + events.push(...eventUuids(request)); + return Promise.reject(new Error('intentional dispatch failure')); + }, +}); + +const createClient = (sdk, eventProcessor) => sdk.createInstance({ + projectConfigManager: sdk.createStaticProjectConfigManager({ datafile: JSON.stringify(datafile) }), + eventProcessor, +}); + +async function runCase() { + // Loaded here rather than imported, so the load happens on this tick, outside module loading. + // As in an app, an error while the SDK loads is reported as fatal and require returns undefined. + const sdk = require('@optimizely/optimizely-sdk'); + record('sdk', { loaded: !!sdk, sources: sources() }); + if (!sdk) return; + + const calls = { encode: 0, getRandomValues: 0 }; + const encode = globalThis.TextEncoder.prototype.encode; + globalThis.TextEncoder.prototype.encode = function (...args) { + calls.encode++; + return encode.apply(this, args); + }; + const getRandomValues = globalThis.crypto.getRandomValues.bind(globalThis.crypto); + globalThis.crypto.getRandomValues = (array) => { + calls.getRandomValues++; + return getRandomValues(array); + }; + + // readBack: events are left in the default store by a failing dispatcher, then read back by a second client. + const dispatched = []; + const eventProcessor = sdk.createBatchEventProcessor({ + eventDispatcher: testCase.readBack ? failingDispatcher(dispatched) : recordingDispatcher(dispatched), + eventStore: testCase.customStore ? new MemoryStore() : undefined, + flushInterval: 50, + }); + const client = createClient(sdk, eventProcessor); + await client.onReady(); + + const user = client.createUserContext('user-1'); + const decisions = user.decideAll(); + user.trackEvent('purchase'); + await waitFor(() => dispatched.length > 0, 3000); + record('result', { + decisions: Object.fromEntries(Object.entries(decisions).map(([key, decision]) => [key, decision.variationKey])), + events: dispatched.slice(), + calls, + }); + await client.close(); + + if (testCase.readBack) { + const readBack = []; + const clientB = createClient(sdk, sdk.createBatchEventProcessor({ + eventDispatcher: recordingDispatcher(readBack), + flushInterval: 50, + })); + await clientB.onReady(); + await waitFor(() => readBack.length > 0, 3000); + record('readBack', { events: readBack, storageCalls: [...new Set(globalThis.__asyncStorageCalls || [])] }); + await clientB.close(); + } +} + +export async function run() { + try { + await runCase(); + } catch (e) { + record('caughtError', { message: String((e && e.message) || e) }); + } + globalThis.__done(); +} diff --git a/tests/react-native-metro/build.cjs b/tests/react-native-metro/build.cjs new file mode 100644 index 000000000..eae5d62dd --- /dev/null +++ b/tests/react-native-metro/build.cjs @@ -0,0 +1,44 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Builds one bundle of app/index.js with a fixture's Metro. +// Usage: RN_METRO_TEST_MODULES='{...}' node build.cjs +// Runs in its own process so each bundle gets a fresh Metro config. + +const fs = require('fs'); +const path = require('path'); +const { createRequire } = require('module'); + +const [fixtureArg, outArg] = process.argv.slice(2); +const fixtureDir = fs.realpathSync(fixtureArg); +const fixtureRequire = createRequire(path.join(fixtureDir, 'package.json')); +const Metro = fixtureRequire('metro'); +const { loadConfig } = fixtureRequire('metro-config'); + +(async () => { + // Load through metro-config, as the React Native CLI does; it fills in the rest of the config. + const config = await loadConfig({ cwd: fixtureDir, config: path.join(fixtureDir, 'metro.config.js') }); + await Metro.runBuild(config, { + entry: path.join(fs.realpathSync(__dirname), 'app', 'index.js'), + platform: 'ios', + dev: false, + minify: false, + out: path.resolve(outArg), + }); +})().catch((e) => { + console.error(e && e.stack ? e.stack : e); + process.exit(1); +}); diff --git a/tests/react-native-metro/cases.mjs b/tests/react-native-metro/cases.mjs new file mode 100644 index 000000000..00a103039 --- /dev/null +++ b/tests/react-native-metro/cases.mjs @@ -0,0 +1,121 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Test cases. Every case runs on every fixture. +// +// modules: which optional packages are installed (decides how the bundle is built). +// fastTextEncoding: the real fast-text-encoding package +// getRandomValues: a stand-in for react-native-get-random-values +// asyncStorage: 'v2' (has multiGet), 'v3' (getMany only) or null (not installed) +// runtime: what the app does at runtime. +// nativeTextEncoder: the runtime has a TextEncoder (Hermes in RN 0.74+); otherwise it has none +// customTextEncoder: the app loads its own TextEncoder polyfill before the SDK +// customGetRandomValues: the app loads its own crypto.getRandomValues polyfill before the SDK +// customStore: the event processor gets an in-memory store instead of AsyncStorage +// readBack: events left in the default store are read back by a second client +// expect: one of +// works: { textEncoder, getRandomValues } - which implementation the SDK must end up using +// ('native' | 'fast-text-encoding' | 'package' | 'custom'), plus optional readBack: '' +// fatal: the error reported as fatal while the SDK loads (a red box in an app) +// caught: the error thrown to the app's code + +export const FIXTURES = ['rn-0.73', 'rn-0.87']; + +// decideAll() for 'user-1' with app/datafile.json: flag_1 from its rollout, flag_2 from experiment exp_4. +export const EXPECTED_DECISIONS = { flag_1: 'variation_7', flag_2: 'variation_flag_2' }; + +export const TEXT_ENCODER_ERROR = 'TextEncoder is not available in this environment'; +export const GET_RANDOM_VALUES_ERROR = 'crypto.getRandomValues is not available in this environment'; +export const ASYNC_STORAGE_ERROR = 'Module not found: @react-native-async-storage/async-storage'; + +const BOTH_POLYFILLS = { fastTextEncoding: true, getRandomValues: true, asyncStorage: 'v2' }; + +export const CASES = [ + // Polyfills, on a runtime without TextEncoder or crypto (Hermes before RN 0.74). + { + id: 'P1', description: 'fast-text-encoding and get-random-values installed', + modules: BOTH_POLYFILLS, runtime: {}, + expect: { works: { textEncoder: 'fast-text-encoding', getRandomValues: 'package' } }, + }, + { + id: 'P2', description: 'custom TextEncoder instead of fast-text-encoding', + modules: { ...BOTH_POLYFILLS, fastTextEncoding: false }, runtime: { customTextEncoder: true }, + expect: { works: { textEncoder: 'custom', getRandomValues: 'package' } }, + }, + { + id: 'P3', description: 'custom TextEncoder with fast-text-encoding also installed', + modules: BOTH_POLYFILLS, runtime: { customTextEncoder: true }, + expect: { works: { textEncoder: 'custom', getRandomValues: 'package' } }, + }, + { + id: 'P4', description: 'custom getRandomValues instead of get-random-values', + modules: { ...BOTH_POLYFILLS, getRandomValues: false }, runtime: { customGetRandomValues: true }, + expect: { works: { textEncoder: 'fast-text-encoding', getRandomValues: 'custom' } }, + }, + { + id: 'P5', description: 'neither package, both custom polyfills', + modules: { ...BOTH_POLYFILLS, fastTextEncoding: false, getRandomValues: false }, + runtime: { customTextEncoder: true, customGetRandomValues: true }, + expect: { works: { textEncoder: 'custom', getRandomValues: 'custom' } }, + }, + { + id: 'P6', description: 'no TextEncoder package or polyfill', + modules: { ...BOTH_POLYFILLS, fastTextEncoding: false }, runtime: {}, + expect: { fatal: TEXT_ENCODER_ERROR }, + }, + { + id: 'P7', description: 'no getRandomValues package or polyfill', + modules: { ...BOTH_POLYFILLS, getRandomValues: false }, runtime: {}, + expect: { fatal: GET_RANDOM_VALUES_ERROR }, + }, + { + id: 'P8', description: 'no polyfill packages or polyfills', + modules: { ...BOTH_POLYFILLS, fastTextEncoding: false, getRandomValues: false }, runtime: {}, + expect: { fatal: TEXT_ENCODER_ERROR }, + }, + // Polyfills, on a runtime with a native TextEncoder (Hermes in RN 0.74+). + { + id: 'P9', description: 'native TextEncoder, no fast-text-encoding', + modules: { ...BOTH_POLYFILLS, fastTextEncoding: false }, runtime: { nativeTextEncoder: true }, + expect: { works: { textEncoder: 'native', getRandomValues: 'package' } }, + }, + { + id: 'P10', description: 'native TextEncoder kept when fast-text-encoding is installed', + modules: BOTH_POLYFILLS, runtime: { nativeTextEncoder: true }, + expect: { works: { textEncoder: 'native', getRandomValues: 'package' } }, + }, + // AsyncStorage. + { + id: 'S1', description: 'AsyncStorage v1/v2: stored events read back with multiGet', + modules: BOTH_POLYFILLS, runtime: { readBack: true }, + expect: { works: { textEncoder: 'fast-text-encoding', getRandomValues: 'package' }, readBack: 'multiGet' }, + }, + { + id: 'S2', description: 'AsyncStorage v3: stored events read back through getMany', + modules: { ...BOTH_POLYFILLS, asyncStorage: 'v3' }, runtime: { readBack: true }, + expect: { works: { textEncoder: 'fast-text-encoding', getRandomValues: 'package' }, readBack: 'getMany' }, + }, + { + id: 'S3', description: 'no AsyncStorage, custom event store', + modules: { ...BOTH_POLYFILLS, asyncStorage: null }, runtime: { customStore: true }, + expect: { works: { textEncoder: 'fast-text-encoding', getRandomValues: 'package' } }, + }, + { + id: 'S4', description: 'no AsyncStorage, default event store', + modules: { ...BOTH_POLYFILLS, asyncStorage: null }, runtime: {}, + expect: { caught: ASYNC_STORAGE_ERROR }, + }, +]; diff --git a/tests/react-native-metro/fixtures/rn-0.73/metro.config.js b/tests/react-native-metro/fixtures/rn-0.73/metro.config.js new file mode 100644 index 000000000..86ff626bb --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.73/metro.config.js @@ -0,0 +1 @@ +module.exports = require('../../metro.config.base')(__dirname, require('@react-native/metro-config')); diff --git a/tests/react-native-metro/fixtures/rn-0.73/package-lock.json b/tests/react-native-metro/fixtures/rn-0.73/package-lock.json new file mode 100644 index 000000000..0415b903b --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.73/package-lock.json @@ -0,0 +1,4742 @@ +{ + "name": "rn-metro-test-rn-0.73", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "rn-metro-test-rn-0.73", + "dependencies": { + "@babel/core": "7.29.7", + "@babel/runtime": "7.29.10", + "@react-native/metro-config": "0.73.5", + "fast-text-encoding": "1.0.6", + "metro": "0.80.12", + "metro-config": "0.80.12" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz", + "integrity": "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.7.tgz", + "integrity": "sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", + "@babel/traverse": "^7.29.7", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.29.10.tgz", + "integrity": "sha512-/YY9soQuWa8TURtHXHT+GbklpbAA+dZErxFGHIr6qgDg96xuGWrTAs1+MfjgVJPF0YLQsOVsOYs8lhgsPbOinQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "regexpu-core": "^6.5.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.8.tgz", + "integrity": "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==", + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-plugin-utils": "^7.28.6", + "debug": "^4.4.3", + "lodash.debounce": "^4.0.8", + "resolve": "^1.22.11" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz", + "integrity": "sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.24.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.7.tgz", + "integrity": "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.7.tgz", + "integrity": "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.29.7.tgz", + "integrity": "sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-wrap-function": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.7.tgz", + "integrity": "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.7.tgz", + "integrity": "sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.29.7.tgz", + "integrity": "sha512-iES0Skag9ERIF68aXadpO6dbXa03mNWK3sEqJaMnLNs/eC3l0lkImdfoy6Y09/SfkpawdAB4RjQ7PVA7TcVGdw==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.29.7.tgz", + "integrity": "sha512-j8SrR0zLZrRsC09DlszEx8FpMiwukKffYXMK0d5LmOglO7vGG6sz/BR/20yHqWH+Lnn31JTt2PE3hIWNgM2J6w==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.29.7.tgz", + "integrity": "sha512-r8j8escF+U2FUHo0KOhPUdMzUO+jp9fInva6+ACVAF3Y97Ev+5iNZwiqTghmzNeWwDkOPlYuTcfb1vDaoZKmAQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.29.7.tgz", + "integrity": "sha512-GE1TFSiuFeGsCxmYXZl8HwoPrVlwe4rHPFE8weieGKZqnDORK+Ar3vgWMgW+AOxQ6/2TgLSKx9p6W7O4rC6qgQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/-/plugin-bugfix-safari-rest-destructuring-rhs-array-7.29.7.tgz", + "integrity": "sha512-oBNVCvnO5tND+xSopWvV8WNGfpTfgP4Zr/YXXSj8zfmcPktp5Ku/aZlsIowgSD4fjmgHn6sGmB9APVsU5zOdhA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.29.7.tgz", + "integrity": "sha512-QQt9qKHZ2sg/kivaLr7lnQr8HVrQDdBNSfCsTjiDxRuX/K5ORyKq+Bu8Xr0cDE3Dfkv0cw28Ve0EKyKMvulkOw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", + "@babel/plugin-transform-optional-chaining": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.13.0" + } + }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.29.7.tgz", + "integrity": "sha512-pn6QacGLgvCcwc+syUhKE/qSjV2D1IHDB84RNxWYSt1mW3K/SCtjinZ2p0cETJxAWBjPy3K/1lHwG5BjjPxNlw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-proposal-async-generator-functions": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz", + "integrity": "sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-environment-visitor": "^7.18.9", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-remap-async-to-generator": "^7.18.9", + "@babel/plugin-syntax-async-generators": "^7.8.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", + "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-export-default-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.29.7.tgz", + "integrity": "sha512-p+G5BNXDcy3bOXplhY4HybQ1GxH3i2Tppmdm/3epyRu2VgJJZuUlZ61MqRTg582Q7ZLBdP7fePYvsumSEkMxcQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", + "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-numeric-separator": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz", + "integrity": "sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-numeric-separator": "^7.10.4" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-object-rest-spread": { + "version": "7.20.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", + "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.20.5", + "@babel/helper-compilation-targets": "^7.20.7", + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.20.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-catch-binding": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz", + "integrity": "sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.18.6", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-optional-chaining": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", + "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.20.2", + "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-private-property-in-object": { + "version": "7.21.0-placeholder-for-preset-env.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", + "integrity": "sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-default-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.29.7.tgz", + "integrity": "sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.29.7.tgz", + "integrity": "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-assertions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.29.7.tgz", + "integrity": "sha512-/An1OCBN93thpBAGyfsK2pcf0jvju1SAtKkL2Ny++B5Sy6sqgzXDQH1cZxWbF96Wuk+bn41MDA9bLd4VVAw6rw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.7.tgz", + "integrity": "sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-unicode-sets-regex": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-unicode-sets-regex/-/plugin-syntax-unicode-sets-regex-7.18.6.tgz", + "integrity": "sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-arrow-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.29.7.tgz", + "integrity": "sha512-N7zArUXWzAMzm+/N0uPBeVB3Fam5lMxtUwMmDK5f/IBBS7a7p1qeUoxd/6CckXoxUdgsntq1Dh8xNW06maZbDQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.29.7.tgz", + "integrity": "sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.29.7.tgz", + "integrity": "sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoped-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.29.7.tgz", + "integrity": "sha512-cUSmjh72N+rN4PrkFlN1dJwNCwjVp5d38/CQrEsFggkD10UiFlBFgdH3tv5dNsLuHY+3S8db2xCHjhZcv5WgvA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.29.7.tgz", + "integrity": "sha512-ONyr4+AZhKh8yKWInVxU9AXA9EbsyeLcL6V0dJy6M2/62vuvpGm29zzuymbTpdc451GEpDIdAyPLP3r+P61yKQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.29.7.tgz", + "integrity": "sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-static-block": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.29.7.tgz", + "integrity": "sha512-kibJgmEdX2iMwsHY2tSZNDgj8PwIlCQz7FK9KuGKO8zsuoUwSEhoNnNVp/emKWrbY4HeO6kkXfdMqRKKKXBm2A==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.29.7.tgz", + "integrity": "sha512-qV0OGGBVacduzQHE649JyCneOFI/maT+YKsO+K4Yi3xv2wTPNjM/W2o2gdzMwEAZz7fXNTHAe0NcSg30bIN69g==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-computed-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.29.7.tgz", + "integrity": "sha512-RK7/IyU5phpuCdBAuig5VkzG/EnbDaui5SQGdU9BFrHdV+mV4cUjLMQ9lJDjLNtWHsqtiefpGZUXQP2BiTYMsA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/template": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.29.7.tgz", + "integrity": "sha512-iPX8aD6H9zV5s7ZsqTdNocPN/MGQ5sSMnElKrktxjJRMnB2jN/1p2+R7GkfD6CAYoVFqy5A4XnSIUeGgJzIWpg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-dotall-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.29.7.tgz", + "integrity": "sha512-3qc18hsD2RdZiyJNDNc7HQpv6xbncwh8FYtxNFFzclSyh/trPD9KkVR9BDECUjDLvb7yJVF15GfYUuC+LMkkiQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-keys": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.29.7.tgz", + "integrity": "sha512-6IvRRriEMqnBwD6chtxdLpMYCHWEzN+oL5cyQtjykya19UgzbmKhxmhZgKC/LHxS2nYr9Q/qYPZ5Lr6jOL9+yQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.29.7.tgz", + "integrity": "sha512-2wiIyo2BjtgU7HufSeDnL9L2O7zr8jmhFKuSr65VpRkUiRKRNpb0mdlk56+XPPKoIrfHqzbMuglDvZun0RISsA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-dynamic-import": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.29.7.tgz", + "integrity": "sha512-giOlEm/EFjfjr+te9NsdjkUo2v4f8rS/SXPumRVHAtbNcyNlvtREkU1dZzaIDclNpnaVhlCqRdFKhJBjBikzLg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-explicit-resource-management": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-explicit-resource-management/-/plugin-transform-explicit-resource-management-7.29.7.tgz", + "integrity": "sha512-Rstj7coNz8sE+7Ju7ihpHLI564lsK5pUpNNlvptCIC/16E/S5hbl6n3kESPKdNRmqEWlpn5xpS5Q2dvXBsySLw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-transform-destructuring": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-exponentiation-operator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.29.7.tgz", + "integrity": "sha512-zFpMOTLZBdW5LfObqcSbL6kefg4R4eLdmvS0wbN9M6D5Mym/sKm9toOoWyVOa+xDjvCnuWcHls2YonXwHvH3CQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-export-namespace-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.29.7.tgz", + "integrity": "sha512-24B2nOy2TeJSMheqwPD4DDQOV/elLSIlKxjZt4i05H5AgdPdWR3n18HnNrcJ+j76WJd9gbwb9jPjNYUy6RautA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.29.7.tgz", + "integrity": "sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-flow": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.29.7.tgz", + "integrity": "sha512-zeSIHh0+E1Um1WJRXCFlHQYu2ieJNdivLLjlBEp+dIBu3S51n+SZZmIXjxnItw6pz56Cn+KvK68BIBVsxq2JiQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-function-name": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.29.7.tgz", + "integrity": "sha512-otRWaHXE6fbAGkePvaj/kvs3HsqXfPhlnzwSOlnFgbqCPMd975dW+4wZ00WFBt+/YlBGcJwNrARQTOJOb4ZrIg==", + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-json-strings": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.29.7.tgz", + "integrity": "sha512-RRnE2+eon1rJAq8MnoF1b5kTpY1vU88twHcvcKMrsqP/jxIRqDVs9iJB5fqPuqyeFAW0wJo4MlUIPpQCq/aRsg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-literals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.29.7.tgz", + "integrity": "sha512-DZ/oLP21ZuWx1vKqnoNv6/tvEK48AQOBRai40CX9dTjGluvT/YZCyY3rryDtyUqCEoyNroy5KKPwX2iQCiRvyw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-logical-assignment-operators": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.29.7.tgz", + "integrity": "sha512-A0H91hh6W8MFRkp5TqJmMr39jzGD1A1E1Ysiv2O06Sfbhkapm+XyIzxWCEh5kqwOZ1/8QZ0dY3SeQ7XBqfJd5Q==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-member-expression-literals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.29.7.tgz", + "integrity": "sha512-hl1kwFZCCiDyfH25Xmco9jTrkPgnS9pmOzSG7W5I4SaGbLeqKv417hcU2RKmaxoPEgsoJh7ZPOrnPGq99bHoUg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-amd": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.29.7.tgz", + "integrity": "sha512-fxtQoH3m5ywUSIfaH0FGCzWu4McsYon5bD3K4XnskC7f+OyQMj7rsOMi4NvvmJ83WwBAg4UCe+ov4VZlqEvyew==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.7.tgz", + "integrity": "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-systemjs": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.8.tgz", + "integrity": "sha512-6iSnEK0zlkLKU4heofK/AdmRD4e2SHVpJMtrwnTCzhnaM98ria4rTrOXBBi45BTTYnJtO8txnPsX4fChYXkmeA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-umd": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.29.7.tgz", + "integrity": "sha512-B4UkaTK3QpgCwJnrxKfMPKdo92CN7OKXAlpAAnM3UPu0Q0lCCk57ylA9AJbRy2v8dDKOPAAWcoR6CMyeoHwRCA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.29.7.tgz", + "integrity": "sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-new-target": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.29.7.tgz", + "integrity": "sha512-fEo41GmsOUhOBlw8ioo6zvjX5Xc2Lqkzlyfqbpsk3eB6TReV18uhxZ0esfEokVbY2+PVJAQHNKxER6lGrzNd3A==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.29.7.tgz", + "integrity": "sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-numeric-separator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.29.7.tgz", + "integrity": "sha512-zR7fv/z14OjgHl4AgRtkDBvBMhIzCxqV/qN/2BCRC7LjFwvuzjYe7gDWxC4Wl/SNsLM6SE1IWvRPYMgSJaUvNw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-rest-spread": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.29.7.tgz", + "integrity": "sha512-Ld98jn4c0smUywL57m7SgsHq3OpThOa6LqZJif3G6jYOovPleoFhVrBJ1WegRApSFB2wu4+RelAj9AC9G08Z4A==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-transform-destructuring": "^7.29.7", + "@babel/plugin-transform-parameters": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-object-super": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.29.7.tgz", + "integrity": "sha512-Ea/diGcw0twB5IlZPO5sgET6fJsLJqPABqTuFWIR+iMPGPZJkATEIWx0wa+aEQ5UY1CBQyP/gkAiLEqn1vBiQA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.29.7.tgz", + "integrity": "sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.29.7.tgz", + "integrity": "sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-parameters": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.29.7.tgz", + "integrity": "sha512-ZDOBqV/qLYJI0YElr8DcENEyARsFQeESqWXH6gZlghYXuPPjvweuDhP4VyEi4BlUBlLRFZVjxoZDMjxhLW766g==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.29.7.tgz", + "integrity": "sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.29.7.tgz", + "integrity": "sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-property-literals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.29.7.tgz", + "integrity": "sha512-bOMRLQuI0A5ZqHq3OWJ89/rXpJ/NJrbVhXiP4zwPGMs6kpcVsuTUNjwoE30K0Qm3mf48a/TnRYYD6vPNqcg6jA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.29.7.tgz", + "integrity": "sha512-+1wdDMGNb4UPeY3Q4L5yLiYe6TXPXubs4NjrgRFw13hPRLJfEMw2Q5OXkee6/IfdqePIeW4Jjwe3aBh7SdKz4Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.29.7.tgz", + "integrity": "sha512-WsZulLVBUHXVj2cUcPVx6UE21TpalB6bHbSFErKT0Ib++ax24jjXe73FqlWvdylFOjiuPHYi6VCcgRad1ItN+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-jsx": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.29.8.tgz", + "integrity": "sha512-0UpIXPtdDtMXfnV2OJAVMLpj3H/92vmkA6lpSRakmycJvj3VUy6Xs1dM8tXRugupykr5WB+LpiVl0J8LMVg2mg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regexp-modifiers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regexp-modifiers/-/plugin-transform-regexp-modifiers-7.29.7.tgz", + "integrity": "sha512-mB5Fs0VWrJ42ZCmc8114v60qetdaUVNkj9PmSZRmanCZM3S9hm0CFRLjRmYIsuXav14l2jvZ+4T8iiCGnhj3nQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-reserved-words": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.29.7.tgz", + "integrity": "sha512-5+YhdpVgmfSmwZyLMftfaiffLRMHjzIRHFHHLdibcSyJm2pasMrKHrO3Ptrt2DRshjvpgjEJJ1zVW14WPq/6QA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.29.7.tgz", + "integrity": "sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "babel-plugin-polyfill-corejs2": "^0.4.14", + "babel-plugin-polyfill-corejs3": "^0.13.0", + "babel-plugin-polyfill-regenerator": "^0.6.5", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-shorthand-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.29.7.tgz", + "integrity": "sha512-I+WYbGBAiCn7nA6xBrlgPH+MB7HWb4u8pv5S0Pv7OtwNvIFvCCb24YlttKEeUFVurfBCEaOTnuhlqsb7f0Z5Dg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-spread": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.29.8.tgz", + "integrity": "sha512-4S9ksMGVWUshvgK0mKfvZky7leuG5/uoFVwMpAomJ8bMoDJiNHRVmc1EglwW/CmGVSqqWpEbXm9FmbRit22qoA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-sticky-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.29.7.tgz", + "integrity": "sha512-BCHzNYJGe9l7EpwwDBN/ztlL2NYFFq8hp9ddjtUEM9f2O7S7kKV/lL6Fwo7IF7NSkYhPK2vO+86nIGltA90MsA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-template-literals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.29.7.tgz", + "integrity": "sha512-NCSEJ4sLFU2gqAub45HYh4fus2yQ36rr6ei6vpU7NdoJqCpxvEG8E6eJpscGyXP3VHD2Ny+fSXr04k1hoUrFqA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typeof-symbol": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.29.7.tgz", + "integrity": "sha512-223mNGoTkBiTEWFoK+Q6Go3tueMRclO8vxxxxquNCYuNI4jWOofFKJRRDu6SDrB8Sgo1UEGW9T4GAQ8ZyRso1A==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.29.9.tgz", + "integrity": "sha512-FFwIwzU+7SCOuxxV4YtJql6T9981ZVTm+FHO5GhVsRqCTdy0WwrEZh3l42ARpXruJUDGOptdduHW6Zr7pNPLNg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", + "@babel/plugin-syntax-typescript": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-escapes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.29.7.tgz", + "integrity": "sha512-jCfXxSjf94lf4E0hKE0AByxF6F3/pVFqRdUUNkDJhsY0m1ZKjnN6ZYyMeHNpzflxb/0q5b7t3p+BE+SLF1WOtA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-property-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.29.7.tgz", + "integrity": "sha512-OgZ+zoAJgZLUCunsTRQ5LAjOywDv5zzZ2/hQ5aMw1pGXyY2rtE8/chXYUmu3AlVHKpm10KEdG9aMwbI/K76ZGw==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.29.7.tgz", + "integrity": "sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-sets-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.29.7.tgz", + "integrity": "sha512-BLOhLht9DOJwIxlmp91wHvkXv1lguuHS3/FwUO8HL1H0u8s4hR1gASVFyilu9iGtcTRYqjTZmlsFFeQletntEg==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/preset-env": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.29.7.tgz", + "integrity": "sha512-GYzX36n1nsciIb0uyH0GHwxwtNwPQIcpxSeiVLDtG/B7jB5xXgchnmL1f/jCX5o+pwnaDBtO60ONSJhEBJfxYA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.29.7", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.29.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.29.7", + "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": "^7.29.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.29.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.29.7", + "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", + "@babel/plugin-syntax-import-assertions": "^7.29.7", + "@babel/plugin-syntax-import-attributes": "^7.29.7", + "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", + "@babel/plugin-transform-arrow-functions": "^7.29.7", + "@babel/plugin-transform-async-generator-functions": "^7.29.7", + "@babel/plugin-transform-async-to-generator": "^7.29.7", + "@babel/plugin-transform-block-scoped-functions": "^7.29.7", + "@babel/plugin-transform-block-scoping": "^7.29.7", + "@babel/plugin-transform-class-properties": "^7.29.7", + "@babel/plugin-transform-class-static-block": "^7.29.7", + "@babel/plugin-transform-classes": "^7.29.7", + "@babel/plugin-transform-computed-properties": "^7.29.7", + "@babel/plugin-transform-destructuring": "^7.29.7", + "@babel/plugin-transform-dotall-regex": "^7.29.7", + "@babel/plugin-transform-duplicate-keys": "^7.29.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.29.7", + "@babel/plugin-transform-dynamic-import": "^7.29.7", + "@babel/plugin-transform-explicit-resource-management": "^7.29.7", + "@babel/plugin-transform-exponentiation-operator": "^7.29.7", + "@babel/plugin-transform-export-namespace-from": "^7.29.7", + "@babel/plugin-transform-for-of": "^7.29.7", + "@babel/plugin-transform-function-name": "^7.29.7", + "@babel/plugin-transform-json-strings": "^7.29.7", + "@babel/plugin-transform-literals": "^7.29.7", + "@babel/plugin-transform-logical-assignment-operators": "^7.29.7", + "@babel/plugin-transform-member-expression-literals": "^7.29.7", + "@babel/plugin-transform-modules-amd": "^7.29.7", + "@babel/plugin-transform-modules-commonjs": "^7.29.7", + "@babel/plugin-transform-modules-systemjs": "^7.29.7", + "@babel/plugin-transform-modules-umd": "^7.29.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.29.7", + "@babel/plugin-transform-new-target": "^7.29.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.29.7", + "@babel/plugin-transform-numeric-separator": "^7.29.7", + "@babel/plugin-transform-object-rest-spread": "^7.29.7", + "@babel/plugin-transform-object-super": "^7.29.7", + "@babel/plugin-transform-optional-catch-binding": "^7.29.7", + "@babel/plugin-transform-optional-chaining": "^7.29.7", + "@babel/plugin-transform-parameters": "^7.29.7", + "@babel/plugin-transform-private-methods": "^7.29.7", + "@babel/plugin-transform-private-property-in-object": "^7.29.7", + "@babel/plugin-transform-property-literals": "^7.29.7", + "@babel/plugin-transform-regenerator": "^7.29.7", + "@babel/plugin-transform-regexp-modifiers": "^7.29.7", + "@babel/plugin-transform-reserved-words": "^7.29.7", + "@babel/plugin-transform-shorthand-properties": "^7.29.7", + "@babel/plugin-transform-spread": "^7.29.7", + "@babel/plugin-transform-sticky-regex": "^7.29.7", + "@babel/plugin-transform-template-literals": "^7.29.7", + "@babel/plugin-transform-typeof-symbol": "^7.29.7", + "@babel/plugin-transform-unicode-escapes": "^7.29.7", + "@babel/plugin-transform-unicode-property-regex": "^7.29.7", + "@babel/plugin-transform-unicode-regex": "^7.29.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.29.7", + "@babel/preset-modules": "0.1.6-no-external-plugins", + "babel-plugin-polyfill-corejs2": "^0.4.15", + "babel-plugin-polyfill-corejs3": "^0.14.0", + "babel-plugin-polyfill-regenerator": "^0.6.6", + "core-js-compat": "^3.48.0", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.14.2.tgz", + "integrity": "sha512-coWpDLJ410R781Npmn/SIBZEsAetR4xVi0SxLMXPaMO4lSf1MwnkGYMtkFxew0Dn8B3/CpbpYxN0JCgg8mn67g==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8", + "core-js-compat": "^3.48.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/preset-flow": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.29.7.tgz", + "integrity": "sha512-KYIRV0BuaN68CDdsqFkAD7MU7yipUqQNuNElwATdxaIdpTjhvtY82QvkBJs7zV3Evxj2jFAAZ1iO8nyy0nhjqA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "@babel/plugin-transform-flow-strip-types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/preset-modules": { + "version": "0.1.6-no-external-plugins", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", + "integrity": "sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/preset-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.29.7.tgz", + "integrity": "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "@babel/plugin-syntax-jsx": "^7.29.7", + "@babel/plugin-transform-modules-commonjs": "^7.29.7", + "@babel/plugin-transform-typescript": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/register": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.29.7.tgz", + "integrity": "sha512-AMGJoWuES861riy6pcB0fphE1YXybtQnBYQMuIyPv6mKLiosfa79BKTnAOyx215c/3RJPJpdQwoHZ3earVH7AA==", + "license": "MIT", + "dependencies": { + "clone-deep": "^4.0.1", + "find-cache-dir": "^2.0.0", + "make-dir": "^2.1.0", + "pirates": "^4.0.6", + "source-map-support": "^0.5.16" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.10.tgz", + "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@react-native/babel-plugin-codegen": { + "version": "0.73.4", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.73.4.tgz", + "integrity": "sha512-XzRd8MJGo4Zc5KsphDHBYJzS1ryOHg8I2gOZDAUCGcwLFhdyGu1zBNDJYH2GFyDrInn9TzAbRIf3d4O+eltXQQ==", + "license": "MIT", + "dependencies": { + "@react-native/codegen": "0.73.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/babel-preset": { + "version": "0.73.21", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.73.21.tgz", + "integrity": "sha512-WlFttNnySKQMeujN09fRmrdWqh46QyJluM5jdtDNrkl/2Hx6N4XeDUGhABvConeK95OidVO7sFFf7sNebVXogA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/plugin-proposal-async-generator-functions": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.18.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.0", + "@babel/plugin-proposal-numeric-separator": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.20.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.20.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.18.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-syntax-optional-chaining": "^7.0.0", + "@babel/plugin-transform-arrow-functions": "^7.0.0", + "@babel/plugin-transform-async-to-generator": "^7.20.0", + "@babel/plugin-transform-block-scoping": "^7.0.0", + "@babel/plugin-transform-classes": "^7.0.0", + "@babel/plugin-transform-computed-properties": "^7.0.0", + "@babel/plugin-transform-destructuring": "^7.20.0", + "@babel/plugin-transform-flow-strip-types": "^7.20.0", + "@babel/plugin-transform-function-name": "^7.0.0", + "@babel/plugin-transform-literals": "^7.0.0", + "@babel/plugin-transform-modules-commonjs": "^7.0.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.0.0", + "@babel/plugin-transform-parameters": "^7.0.0", + "@babel/plugin-transform-private-methods": "^7.22.5", + "@babel/plugin-transform-private-property-in-object": "^7.22.11", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0", + "@babel/plugin-transform-runtime": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0", + "@babel/plugin-transform-spread": "^7.0.0", + "@babel/plugin-transform-sticky-regex": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.5.0", + "@babel/plugin-transform-unicode-regex": "^7.0.0", + "@babel/template": "^7.0.0", + "@react-native/babel-plugin-codegen": "0.73.4", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/codegen": { + "version": "0.73.3", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.73.3.tgz", + "integrity": "sha512-sxslCAAb8kM06vGy9Jyh4TtvjhcP36k/rvj2QE2Jdhdm61KvfafCATSIsOfc0QvnduWFcpXUPvAVyYwuv7PYDg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.0", + "flow-parser": "^0.206.0", + "glob": "^7.1.1", + "invariant": "^2.2.4", + "jscodeshift": "^0.14.0", + "mkdirp": "^0.5.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + } + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.73.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.73.1.tgz", + "integrity": "sha512-ewMwGcumrilnF87H4jjrnvGZEaPFCAC4ebraEK+CurDDmwST/bIicI4hrOAv+0Z0F7DEK4O4H7r8q9vH7IbN4g==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@react-native/metro-babel-transformer": { + "version": "0.73.15", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.73.15.tgz", + "integrity": "sha512-LlkSGaXCz+xdxc9819plmpsl4P4gZndoFtpjN3GMBIu6f7TBV0GVbyJAU4GE8fuAWPVSVL5ArOcdkWKSbI1klw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.20.0", + "@react-native/babel-preset": "0.73.21", + "hermes-parser": "0.15.0", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/metro-config": { + "version": "0.73.5", + "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.73.5.tgz", + "integrity": "sha512-3bNWoHzOzP/+qoLJtRhOVXrnxKmSY3i4y5PXyMQlIvvOI/GQbXulPpEZxK/yUrf1MmeXHLLFufFbQWlfDEDoxA==", + "license": "MIT", + "dependencies": { + "@react-native/js-polyfills": "0.73.1", + "@react-native/metro-babel-transformer": "0.73.15", + "metro-config": "^0.80.3", + "metro-runtime": "^0.80.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.12", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.12.tgz", + "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/node": { + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT" + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/ast-types": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.15.2.tgz", + "integrity": "sha512-c27loCv9QkZinsa5ProX751khO9DJl/AcB5c2KNtA6NRvHKS0PgLfcftz72KVq504vB0Gku5s2kUZzDBvQWvHg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/babel-core": { + "version": "7.0.0-bridge.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz", + "integrity": "sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==", + "license": "MIT", + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.17.tgz", + "integrity": "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-define-polyfill-provider": "^0.6.8", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.13.0.tgz", + "integrity": "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.5", + "core-js-compat": "^3.43.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.8.tgz", + "integrity": "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-transform-flow-enums": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz", + "integrity": "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==", + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-flow": "^7.12.1" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.28", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz", + "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.2.tgz", + "integrity": "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw==", + "license": "MIT", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha512-JuG3qI4QOftFsZyOn1qq87fq5grLIyk1JYd5lJmdA+fG7aQ9pA/i3JIJGcO3q0MrRcHlOt1U+ZeHW8Dq9axALQ==", + "license": "MIT", + "dependencies": { + "callsites": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==", + "license": "MIT", + "dependencies": { + "caller-callsite": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001816", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", + "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "license": "MIT", + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.50.0.tgz", + "integrity": "sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==", + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.7" + }, + "engines": { + "node": ">=6.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "license": "MIT", + "dependencies": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/denodeify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", + "integrity": "sha512-KNTihKNmQENUZeKu5fzfpzRqR5S2VMp4gl9RFHiWzj9DfvYQPMJ6XHKNaQxaGCXwPk6y9yme3aUoaiAe+KX+vg==", + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.456", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.456.tgz", + "integrity": "sha512-8hboqI6xesozteFb8aa7OGknvxUtTeRJLz0FoePysUEh/oWbddykIGdgpEJRbPRg/nIMfBf2DFos+H2MtvJl2A==", + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "license": "Apache-2.0" + }, + "node_modules/fast-text-encoding": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", + "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==", + "license": "Apache-2.0" + }, + "node_modules/fb-watchman": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.4.tgz", + "integrity": "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ==", + "license": "MIT", + "dependencies": { + "bser": "2.1.2" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "license": "MIT", + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", + "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", + "license": "MIT" + }, + "node_modules/flow-parser": { + "version": "0.206.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.206.0.tgz", + "integrity": "sha512-HVzoK3r6Vsg+lKvlIZzaWNBVai+FXTX1wdYhz/wVlH13tb/gOdLXmlTqy6odmTBhT5UoWUbq0k8263Qhr9d88w==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.15.0.tgz", + "integrity": "sha512-lLYvAd+6BnOqWdnNbP/Q8xfl8LOGw4wVjfrNd9Gt8eoFzhNBRVD95n4l2ksfMVOoxuVyegs85g83KS9QOsxbVQ==", + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.15.0.tgz", + "integrity": "sha512-Q1uks5rjZlE9RjMMjSUCkGrEIPI5pKJILeCtK1VmTj7U4pf3wVPoo+cxfu+s4cBAPy2JzikIIdCZgBoR6x7U1Q==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.15.0" + } + }, + "node_modules/image-size": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-1.2.1.tgz", + "integrity": "sha512-rH+46sQJ2dlwfjfhCyNx5thzrv+dtmBIhPHk0zgRUukHzZ/kRueTJXoYYsclBaKcSMBWuGbOFXtioLpzTb5euw==", + "license": "MIT", + "dependencies": { + "queue": "6.0.2" + }, + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=16.x" + } + }, + "node_modules/import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", + "license": "MIT", + "dependencies": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "license": "MIT", + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.15.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz", + "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "license": "0BSD" + }, + "node_modules/jscodeshift": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/jscodeshift/-/jscodeshift-0.14.0.tgz", + "integrity": "sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.13.16", + "@babel/parser": "^7.13.16", + "@babel/plugin-proposal-class-properties": "^7.13.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", + "@babel/plugin-proposal-optional-chaining": "^7.13.12", + "@babel/plugin-transform-modules-commonjs": "^7.13.8", + "@babel/preset-flow": "^7.13.13", + "@babel/preset-typescript": "^7.13.0", + "@babel/register": "^7.13.16", + "babel-core": "^7.0.0-bridge.0", + "chalk": "^4.1.2", + "flow-parser": "0.*", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.4", + "neo-async": "^2.5.0", + "node-dir": "^0.1.17", + "recast": "^0.21.0", + "temp": "^0.8.4", + "write-file-atomic": "^2.3.0" + }, + "bin": { + "jscodeshift": "bin/jscodeshift.js" + }, + "peerDependencies": { + "@babel/preset-env": "^7.1.6" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "license": "MIT" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "license": "MIT", + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "license": "BSD-3-Clause", + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/metro": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.80.12.tgz", + "integrity": "sha512-1UsH5FzJd9quUsD1qY+zUG4JY3jo3YEMxbMYH9jT6NK3j4iORhlwTK8fYTfAUBhDKjgLfKjAh7aoazNE23oIRA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "accepts": "^1.3.7", + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "connect": "^3.6.5", + "debug": "^2.2.0", + "denodeify": "^1.2.1", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "hermes-parser": "0.23.1", + "image-size": "^1.0.2", + "invariant": "^2.2.4", + "jest-worker": "^29.6.3", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.80.12", + "metro-cache": "0.80.12", + "metro-cache-key": "0.80.12", + "metro-config": "0.80.12", + "metro-core": "0.80.12", + "metro-file-map": "0.80.12", + "metro-resolver": "0.80.12", + "metro-runtime": "0.80.12", + "metro-source-map": "0.80.12", + "metro-symbolicate": "0.80.12", + "metro-transform-plugins": "0.80.12", + "metro-transform-worker": "0.80.12", + "mime-types": "^2.1.27", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "strip-ansi": "^6.0.0", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.80.12.tgz", + "integrity": "sha512-YZziRs0MgA3pzCkkvOoQRXjIoVjvrpi/yRlJnObyIvMP6lFdtyG4nUGIwGY9VXnBvxmXD6mPY2e+NSw6JAyiRg==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.20.0", + "flow-enums-runtime": "^0.0.6", + "hermes-parser": "0.23.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-babel-transformer/node_modules/hermes-estree": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.23.1.tgz", + "integrity": "sha512-eT5MU3f5aVhTqsfIReZ6n41X5sYn4IdQL0nvz6yO+MMlPxw49aSARHLg/MSehQftyjnrE8X6bYregzSumqc6cg==", + "license": "MIT" + }, + "node_modules/metro-babel-transformer/node_modules/hermes-parser": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.23.1.tgz", + "integrity": "sha512-oxl5h2DkFW83hT4DAUJorpah8ou4yvmweUzLJmmr6YV2cezduCdlil1AvU/a/xSsAFo4WUcNA4GoV5Bvq6JffA==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.23.1" + } + }, + "node_modules/metro-cache": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.80.12.tgz", + "integrity": "sha512-p5kNHh2KJ0pbQI/H7ZBPCEwkyNcSz7OUkslzsiIWBMPQGFJ/xArMwkV7I+GJcWh+b4m6zbLxE5fk6fqbVK1xGA==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "metro-core": "0.80.12" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-cache-key": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.80.12.tgz", + "integrity": "sha512-o4BspKnugg/pE45ei0LGHVuBJXwRgruW7oSFAeSZvBKA/sGr0UhOGY3uycOgWInnS3v5yTTfiBA9lHlNRhsvGA==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-config": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.80.12.tgz", + "integrity": "sha512-4rwOWwrhm62LjB12ytiuR5NgK1ZBNr24/He8mqCsC+HXZ+ATbrewLNztzbAZHtFsrxP4D4GLTGgh96pCpYLSAQ==", + "license": "MIT", + "dependencies": { + "connect": "^3.6.5", + "cosmiconfig": "^5.0.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.6.3", + "metro": "0.80.12", + "metro-cache": "0.80.12", + "metro-core": "0.80.12", + "metro-runtime": "0.80.12" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-core": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.80.12.tgz", + "integrity": "sha512-QqdJ/yAK+IpPs2HU/h5v2pKEdANBagSsc6DRSjnwSyJsCoHlmyJKCaCJ7KhWGx+N4OHxh37hoA8fc2CuZbx0Fw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.80.12" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-file-map": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.80.12.tgz", + "integrity": "sha512-sYdemWSlk66bWzW2wp79kcPMzwuG32x1ZF3otI0QZTmrnTaaTiGyhE66P1z6KR4n2Eu5QXiABa6EWbAQv0r8bw==", + "license": "MIT", + "dependencies": { + "anymatch": "^3.0.3", + "debug": "^2.2.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.6.3", + "micromatch": "^4.0.4", + "node-abort-controller": "^3.1.1", + "nullthrows": "^1.1.1", + "walker": "^1.0.7" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/metro-file-map/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/metro-file-map/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/metro-minify-terser": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.80.12.tgz", + "integrity": "sha512-muWzUw3y5k+9083ZoX9VaJLWEV2Jcgi+Oan0Mmb/fBNMPqP9xVDuy4pOMn/HOiGndgfh/MK7s4bsjkyLJKMnXQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-resolver": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.80.12.tgz", + "integrity": "sha512-PR24gYRZnYHM3xT9pg6BdbrGbM/Cu1TcyIFBVlAk7qDAuHkUNQ1nMzWumWs+kwSvtd9eZGzHoucGJpTUEeLZAw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-runtime": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.80.12.tgz", + "integrity": "sha512-LIx7+92p5rpI0i6iB4S4GBvvLxStNt6fF0oPMaUd1Weku7jZdfkCZzmrtDD9CSQ6EPb0T9NUZoyXIxlBa3wOCw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-source-map": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.80.12.tgz", + "integrity": "sha512-o+AXmE7hpvM8r8MKsx7TI21/eerYYy2DCDkWfoBkv+jNkl61khvDHlQn0cXZa6lrcNZiZkl9oHSMcwLLIrFmpw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.20.0", + "@babel/types": "^7.20.0", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.80.12", + "nullthrows": "^1.1.1", + "ob1": "0.80.12", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.80.12.tgz", + "integrity": "sha512-/dIpNdHksXkGHZXARZpL7doUzHqSNxgQ8+kQGxwpJuHnDhGkENxB5PS2QBaTDdEcmyTMjS53CN1rl9n1gR6fmw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.80.12", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "through2": "^2.0.1", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.80.12.tgz", + "integrity": "sha512-WQWp00AcZvXuQdbjQbx1LzFR31IInlkCDYJNRs6gtEtAyhwpMMlL2KcHmdY+wjDO9RPcliZ+Xl1riOuBecVlPA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.20.0", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.80.12.tgz", + "integrity": "sha512-KAPFN1y3eVqEbKLx1I8WOarHPqDMUa8WelWxaJCNKO/yHCP26zELeqTJvhsQup+8uwB6EYi/sp0b6TGoh6lOEA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.20.0", + "@babel/generator": "^7.20.0", + "@babel/parser": "^7.20.0", + "@babel/types": "^7.20.0", + "flow-enums-runtime": "^0.0.6", + "metro": "0.80.12", + "metro-babel-transformer": "0.80.12", + "metro-cache": "0.80.12", + "metro-cache-key": "0.80.12", + "metro-minify-terser": "0.80.12", + "metro-source-map": "0.80.12", + "metro-transform-plugins": "0.80.12", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/metro/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/metro/node_modules/hermes-estree": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.23.1.tgz", + "integrity": "sha512-eT5MU3f5aVhTqsfIReZ6n41X5sYn4IdQL0nvz6yO+MMlPxw49aSARHLg/MSehQftyjnrE8X6bYregzSumqc6cg==", + "license": "MIT" + }, + "node_modules/metro/node_modules/hermes-parser": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.23.1.tgz", + "integrity": "sha512-oxl5h2DkFW83hT4DAUJorpah8ou4yvmweUzLJmmr6YV2cezduCdlil1AvU/a/xSsAFo4WUcNA4GoV5Bvq6JffA==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.23.1" + } + }, + "node_modules/metro/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "license": "MIT" + }, + "node_modules/node-abort-controller": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", + "license": "MIT" + }, + "node_modules/node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha512-tmPX422rYgofd4epzrNoOXiE8XFZYOcCq1vD7MAXCDO+O+zndlA2ztdKKMa+EeuBG5tHETpr4ml4RGgpqDCCAg==", + "license": "MIT", + "dependencies": { + "minimatch": "^3.0.2" + }, + "engines": { + "node": ">= 0.10.5" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", + "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "license": "MIT" + }, + "node_modules/ob1": { + "version": "0.80.12", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.80.12.tgz", + "integrity": "sha512-VMArClVT6LkhUGpnuEoBuyjG9rzUyEzg4PDkav6wK1cLhOK02gPCYFxoiB4mqVnrMhDpIzJcrGNAMVi9P+hXrw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/queue": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz", + "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==", + "license": "MIT", + "dependencies": { + "inherits": "~2.0.3" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/recast": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.21.5.tgz", + "integrity": "sha512-hjMmLaUXAm1hIuTqOdeYObMslq/q+Xff6QE3Y2P+uoHAg2nmVlLBps2hzh1UJDdMtDTMXOFewK6ky51JQIeECg==", + "license": "MIT", + "dependencies": { + "ast-types": "0.15.2", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/recast/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regenerate": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.5.0.tgz", + "integrity": "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw==", + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.3.0.tgz", + "integrity": "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexpu-core": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.5.3.tgz", + "integrity": "sha512-E8VgUoSK+LMQrLboDxavm76MTBGrQhx9RiNuomRmYnZ10Uw12HrI8fkxOOncktb2hBpzIZ9SV/347euQHG5z+g==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.5.0", + "regenerate-unicode-properties": "^10.3.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.13.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.4.tgz", + "integrity": "sha512-EWV80YgFaVgFrjGCAsV7oybp4GOxbls5RzBg8OB0nKEVXsBJR1JlV8Di1JhCROg3MzTfe1RI8yitIm1eOs68iA==", + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.1.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "license": "MIT", + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/temp": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.4.tgz", + "integrity": "sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==", + "license": "MIT", + "dependencies": { + "rimraf": "~2.6.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser": { + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "license": "MIT" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "license": "BSD-3-Clause" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.1.tgz", + "integrity": "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz", + "integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "license": "MIT" + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "license": "Apache-2.0", + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "license": "ISC", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "node_modules/ws": { + "version": "7.5.13", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", + "integrity": "sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/tests/react-native-metro/fixtures/rn-0.73/package.json b/tests/react-native-metro/fixtures/rn-0.73/package.json new file mode 100644 index 000000000..f729bc581 --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.73/package.json @@ -0,0 +1,13 @@ +{ + "name": "rn-metro-test-rn-0.73", + "private": true, + "description": "Metro setup of React Native 0.73 (Metro 0.80, which drops missing optional dependencies from a module's dependency map).", + "dependencies": { + "@babel/core": "7.29.7", + "@babel/runtime": "7.29.10", + "@react-native/metro-config": "0.73.5", + "fast-text-encoding": "1.0.6", + "metro": "0.80.12", + "metro-config": "0.80.12" + } +} diff --git a/tests/react-native-metro/fixtures/rn-0.87/metro.config.js b/tests/react-native-metro/fixtures/rn-0.87/metro.config.js new file mode 100644 index 000000000..86ff626bb --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.87/metro.config.js @@ -0,0 +1 @@ +module.exports = require('../../metro.config.base')(__dirname, require('@react-native/metro-config')); diff --git a/tests/react-native-metro/fixtures/rn-0.87/package-lock.json b/tests/react-native-metro/fixtures/rn-0.87/package-lock.json new file mode 100644 index 000000000..a4684728e --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.87/package-lock.json @@ -0,0 +1,2864 @@ +{ + "name": "rn-metro-test-rn-0.87", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "rn-metro-test-rn-0.87", + "dependencies": { + "@babel/core": "7.29.7", + "@babel/runtime": "7.29.10", + "@react-native/metro-config": "0.87.1", + "fast-text-encoding": "1.0.6", + "metro": "0.87.1", + "metro-config": "0.87.1" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-annotate-as-pure": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.29.7.tgz", + "integrity": "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-create-class-features-plugin": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.29.7.tgz", + "integrity": "sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", + "@babel/traverse": "^7.29.7", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-create-regexp-features-plugin": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.29.10.tgz", + "integrity": "sha512-/YY9soQuWa8TURtHXHT+GbklpbAA+dZErxFGHIr6qgDg96xuGWrTAs1+MfjgVJPF0YLQsOVsOYs8lhgsPbOinQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "regexpu-core": "^6.5.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-define-polyfill-provider": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.6.8.tgz", + "integrity": "sha512-47UwBLPpQi1NoWzLuHNjRoHlYXMwIJoBf7MFou6viC/sIHWYygpvr0B6IAyh5sBdA2nr2LPIRww8lfaUVQINBA==", + "license": "MIT", + "dependencies": { + "@babel/helper-compilation-targets": "^7.28.6", + "@babel/helper-plugin-utils": "^7.28.6", + "debug": "^4.4.3", + "lodash.debounce": "^4.0.8", + "resolve": "^1.22.11" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.29.7.tgz", + "integrity": "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.29.7.tgz", + "integrity": "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-remap-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.29.7.tgz", + "integrity": "sha512-16AMiW26DbXWBbr3B8wNozKM0ydMLB892vaOaJW/fPJdnT8vJk5sdkQcU/isqUxyCE0cEoa8wZOcbgDuC4b6Og==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-wrap-function": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.29.7.tgz", + "integrity": "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.29.7", + "@babel/helper-optimise-call-expression": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.29.7.tgz", + "integrity": "sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-wrap-function": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.29.7.tgz", + "integrity": "sha512-iES0Skag9ERIF68aXadpO6dbXa03mNWK3sEqJaMnLNs/eC3l0lkImdfoy6Y09/SfkpawdAB4RjQ7PVA7TcVGdw==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.10.tgz", + "integrity": "sha512-EMCx3AGZ3WfAl6ht7AyQoPm2Lh+BGYEMdc4Q6Hf7uSCDOZFuLq44qNwL+iaim8VlyYhRAo4X43+weadK8ZB4Yg==", + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-proposal-export-default-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.29.7.tgz", + "integrity": "sha512-p+G5BNXDcy3bOXplhY4HybQ1GxH3i2Tppmdm/3epyRu2VgJJZuUlZ61MqRTg582Q7ZLBdP7fePYvsumSEkMxcQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-export-default-from": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.29.7.tgz", + "integrity": "sha512-foag0BB37ROhdeIX9O8G0jX7hw0UekJc04cHMrYLOnrErsnBKqJGHJ8eDRpoCFZBvEPPygmmtw4qyU97qa4oOw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-flow": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.29.7.tgz", + "integrity": "sha512-ajMX6QPcyomotqwpzhkYGxcK2i/us0rs1Qo9QvUpa+Fca0FTmqrzKrctoIYLMxcOhGZldGT/BAVkRGTWBiR8gQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-generator-functions": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.29.7.tgz", + "integrity": "sha512-d98gXZkgswvkyohMBABkhm3GeXhYj8psWfwQ2C7gtfrKGTykQa/iOIi+JJhwMjPlZ6Vm2XN+DCf3Es1EoG4ZLA==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-async-to-generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.29.7.tgz", + "integrity": "sha512-pcUb2SS+RMo9TWVBwKGI5ShtoG7R+zBsFmCKDa6fe8c+hPr3XJlZgoE5j6i8W7gDjhyvy+85vmYexanvXh3d1w==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-remap-async-to-generator": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-block-scoping": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.29.7.tgz", + "integrity": "sha512-ONyr4+AZhKh8yKWInVxU9AXA9EbsyeLcL6V0dJy6M2/62vuvpGm29zzuymbTpdc451GEpDIdAyPLP3r+P61yKQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-class-properties": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.29.7.tgz", + "integrity": "sha512-GtcpjFvanPfzNQi3eTitsCqtRRmmqzpy/A+yhTR1HaZo1Ly3EA8ZXxlPyHdR8/IuRMYc3E4wdGBewB2QKQjAaA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-classes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.29.7.tgz", + "integrity": "sha512-qV0OGGBVacduzQHE649JyCneOFI/maT+YKsO+K4Yi3xv2wTPNjM/W2o2gdzMwEAZz7fXNTHAe0NcSg30bIN69g==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-replace-supers": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-destructuring": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.29.7.tgz", + "integrity": "sha512-iPX8aD6H9zV5s7ZsqTdNocPN/MGQ5sSMnElKrktxjJRMnB2jN/1p2+R7GkfD6CAYoVFqy5A4XnSIUeGgJzIWpg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-flow-strip-types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.29.7.tgz", + "integrity": "sha512-wRHeUjUjCZnMHmiO5bRgjFLcoEh7JyTdByOW11ahhwNa4V0bmeGEaIvt51yq0zQp2yWIpqfxXXPyUP6GFJZHOQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-flow": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-for-of": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.29.7.tgz", + "integrity": "sha512-zeSIHh0+E1Um1WJRXCFlHQYu2ieJNdivLLjlBEp+dIBu3S51n+SZZmIXjxnItw6pz56Cn+KvK68BIBVsxq2JiQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-modules-commonjs": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.29.7.tgz", + "integrity": "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.29.7.tgz", + "integrity": "sha512-vuFoLwr4qnv2xbZ16SQd6uPcH5FNrLHhk/Jzo++0XJFcaDsr4gjJVg6j398oMHiC+83k/GiBzviwF5KBJkPUtQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.29.7.tgz", + "integrity": "sha512-idmp1dFaekP9GbcMvG24Kvw2BfhFZjHnNJCkV4WuIY4PskJzwI3f1N5OdgYke38T7rftO6ERulFRn2cFeZwRkg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-catch-binding": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.29.7.tgz", + "integrity": "sha512-sLsyndxK2VwX6yNUOakMb7Sh553ZTe/vVM1XJ+9Z5aW1ytsc8xOIwmyk05NNjN60vkc5/KqoTH6hB4V41LJhng==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-optional-chaining": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.29.7.tgz", + "integrity": "sha512-6GM1dhvK3gNODkXcEcMCOLEDCLSoZ/sBbro2Ax8HURyasQ4NshagQixkRFdh5niI6E4gmA/jYI/4aT7rRos3ZQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-methods": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.29.7.tgz", + "integrity": "sha512-/6Rz4DK1ETDEM/bWHsPHcaEe7ZaT1EqSXjtSP/L0DijOYuaUhiRiOKcwpZ8P7zR4xXEHc2ITdiCgBm9Tpyv9ug==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-private-property-in-object": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.29.7.tgz", + "integrity": "sha512-+BNo06dnrzdNNqCm1X6YUaVv0DKk8Q+JYcoZfOkLhYWNCXzlwTSRq8zGWayT1csjcpNXV9CQTBRRbmTLZac5cA==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-display-name": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.29.7.tgz", + "integrity": "sha512-+1wdDMGNb4UPeY3Q4L5yLiYe6TXPXubs4NjrgRFw13hPRLJfEMw2Q5OXkee6/IfdqePIeW4Jjwe3aBh7SdKz4Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.29.7.tgz", + "integrity": "sha512-WsZulLVBUHXVj2cUcPVx6UE21TpalB6bHbSFErKT0Ib++ax24jjXe73FqlWvdylFOjiuPHYi6VCcgRad1ItN+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/plugin-syntax-jsx": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-regenerator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.29.8.tgz", + "integrity": "sha512-0UpIXPtdDtMXfnV2OJAVMLpj3H/92vmkA6lpSRakmycJvj3VUy6Xs1dM8tXRugupykr5WB+LpiVl0J8LMVg2mg==", + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.29.7.tgz", + "integrity": "sha512-xmAscdE/AsqRW7vutbPNoUmu/nF5SrLKPs7aoJgEjo35lLKA/Bc0i2rMv/hr1+Y0o1bQCiVtith3u2vdgRL39Q==", + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "babel-plugin-polyfill-corejs2": "^0.4.14", + "babel-plugin-polyfill-corejs3": "^0.13.0", + "babel-plugin-polyfill-regenerator": "^0.6.5", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-typescript": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.29.9.tgz", + "integrity": "sha512-FFwIwzU+7SCOuxxV4YtJql6T9981ZVTm+FHO5GhVsRqCTdy0WwrEZh3l42ARpXruJUDGOptdduHW6Zr7pNPLNg==", + "license": "MIT", + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.29.7", + "@babel/helper-create-class-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", + "@babel/plugin-syntax-typescript": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-unicode-regex": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.29.7.tgz", + "integrity": "sha512-7D/x/23/d/3VqZ0QA+LGbZMlGwZjztBygSWWWsfTPoQ1oQ6Q1P6Mr3d0kk42XabyUVw+fha3LqdRsFqeKqvCyA==", + "license": "MIT", + "dependencies": { + "@babel/helper-create-regexp-features-plugin": "^7.29.7", + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.10.tgz", + "integrity": "sha512-NpugTzbKgGrNe45Ui32cN8vCFFMxVtP/9rtfwv0nP5FRDAjvYBxJcLVpYA9mr1jxP6cnIT7x9LUzuDTbWYYNRA==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.10.tgz", + "integrity": "sha512-B3lYAs2nkKskbgQ1nfy8Ma9ao9Q1rntTAQHrzzyDuj+TSO+X3le6PfWwqDvodsb+OumE10eMFfuMCTQSQ5iuIQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.9", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@react-native/babel-plugin-codegen": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-plugin-codegen/-/babel-plugin-codegen-0.87.1.tgz", + "integrity": "sha512-DfnyLAHG7jH4pqeID7ib6AeD6gG8T+KvM3c/w/yEa5ONkfRcHvTC8JMIRdhUqs4ruA+8xbYcNVQzewYRCPm1Xw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.0", + "@react-native/codegen": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/babel-preset": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/babel-preset/-/babel-preset-0.87.1.tgz", + "integrity": "sha512-EN1oo8IqsJgq++na/buq6hYsdZJY5A8+URohSA620eGz5a+322WOAcBuvcYZTeovYwR2NegvpPk5h+QVk8iUMw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/plugin-proposal-export-default-from": "^7.24.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-syntax-export-default-from": "^7.24.7", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-transform-async-generator-functions": "^7.25.4", + "@babel/plugin-transform-async-to-generator": "^7.24.7", + "@babel/plugin-transform-block-scoping": "^7.25.0", + "@babel/plugin-transform-class-properties": "^7.25.4", + "@babel/plugin-transform-classes": "^7.25.4", + "@babel/plugin-transform-destructuring": "^7.24.8", + "@babel/plugin-transform-flow-strip-types": "^7.25.2", + "@babel/plugin-transform-for-of": "^7.24.7", + "@babel/plugin-transform-modules-commonjs": "^7.24.8", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", + "@babel/plugin-transform-optional-catch-binding": "^7.24.7", + "@babel/plugin-transform-optional-chaining": "^7.24.8", + "@babel/plugin-transform-private-methods": "^7.24.7", + "@babel/plugin-transform-private-property-in-object": "^7.24.7", + "@babel/plugin-transform-react-display-name": "^7.24.7", + "@babel/plugin-transform-react-jsx": "^7.25.2", + "@babel/plugin-transform-react-jsx-self": "^7.24.7", + "@babel/plugin-transform-react-jsx-source": "^7.24.7", + "@babel/plugin-transform-regenerator": "^7.24.7", + "@babel/plugin-transform-runtime": "^7.24.7", + "@babel/plugin-transform-typescript": "^7.25.2", + "@babel/plugin-transform-unicode-regex": "^7.24.7", + "@react-native/babel-plugin-codegen": "0.87.1", + "babel-plugin-syntax-hermes-parser": "0.36.1", + "babel-plugin-transform-flow-enums": "^0.0.2", + "react-refresh": "^0.14.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/codegen": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/codegen/-/codegen-0.87.1.tgz", + "integrity": "sha512-qbaqEdlUfj2vRgvWTpMoNgHnEqAhAYJLUrpGkb0WC9n0kdtqUvgigpz4bDktZwolM9BemXwgGFgyiAnbs3t0xw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/parser": "^7.29.0", + "hermes-parser": "0.36.1", + "invariant": "^2.2.4", + "nullthrows": "^1.1.1", + "tinyglobby": "^0.2.15", + "yargs": "^17.6.2" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/js-polyfills": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/js-polyfills/-/js-polyfills-0.87.1.tgz", + "integrity": "sha512-L9yKwEJCq7e8RjhthMUht2CP/CPnBR134h9xHkJ0XOO15QOWBAOqSZltTZG/wiokidqePvK+exMsRinuFLsN9w==", + "license": "MIT", + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@react-native/metro-babel-transformer": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-babel-transformer/-/metro-babel-transformer-0.87.1.tgz", + "integrity": "sha512-9qPN7DIBA2ldpTVeEObRuIf0ihF9iphBR17rOyuFu8UnhbzHpoLDHCqnjnOm6P21TY8GU6JgaqmD4rhtUCOFeQ==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@react-native/babel-preset": "0.87.1", + "hermes-parser": "0.36.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + }, + "peerDependencies": { + "@babel/core": "*" + } + }, + "node_modules/@react-native/metro-config": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/@react-native/metro-config/-/metro-config-0.87.1.tgz", + "integrity": "sha512-oHgFFZpWDElw/ZO7YmNsTproNtHL0Ty/PWAR7Lf7YjuT7HuY11RyihQ4Kh/YseepHi/9vMBe8QNFqJCB8eMNZg==", + "license": "MIT", + "dependencies": { + "@react-native/js-polyfills": "0.87.1", + "@react-native/metro-babel-transformer": "0.87.1", + "metro-config": "^0.87.0", + "metro-runtime": "^0.87.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.12", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.12.tgz", + "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/node": { + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "license": "MIT" + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-plugin-polyfill-corejs2": { + "version": "0.4.17", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.17.tgz", + "integrity": "sha512-aTyf30K/rqAsNwN76zYrdtx8obu0E4KoUME29B1xj+B3WxgvWkp943vYQ+z8Mv3lw9xHXMHpvSPOBxzAkIa94w==", + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.28.6", + "@babel/helper-define-polyfill-provider": "^0.6.8", + "semver": "^6.3.1" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-corejs3": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.13.0.tgz", + "integrity": "sha512-U+GNwMdSFgzVmfhNm8GJUX88AadB3uo9KpJqS3FaqNIPKgySuvMb+bHPsOmmuWyIcuqZj/pzt1RUIUZns4y2+A==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.5", + "core-js-compat": "^3.43.0" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-polyfill-regenerator": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.6.8.tgz", + "integrity": "sha512-M762rNHfSF1EV3SLtnCJXFoQbbIIz0OyRwnCmV0KPC7qosSfCO0QLTSuJX3ayAebubhE6oYBAYPrBA5ljowaZg==", + "license": "MIT", + "dependencies": { + "@babel/helper-define-polyfill-provider": "^0.6.8" + }, + "peerDependencies": { + "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" + } + }, + "node_modules/babel-plugin-syntax-hermes-parser": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-hermes-parser/-/babel-plugin-syntax-hermes-parser-0.36.1.tgz", + "integrity": "sha512-ycduwJbvdvIMmVvlAZqGggS+pm5Eu4Bk9pcV9Sm2Z4PJNRVsKkv0g7vHj+LeuC1gHTeF67sJXFOq61IlqCa2hA==", + "license": "MIT", + "dependencies": { + "hermes-parser": "0.36.1" + } + }, + "node_modules/babel-plugin-transform-flow-enums": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-flow-enums/-/babel-plugin-transform-flow-enums-0.0.2.tgz", + "integrity": "sha512-g4aaCrDDOsWjbm0PUUeVnkcVd6AKJsVc/MbnPhEotEpkeJQP6b8nzewohQi7+QS8UyPehOhGWn0nOwjvWpmMvQ==", + "license": "MIT", + "dependencies": { + "@babel/plugin-syntax-flow": "^7.12.1" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.28", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.28.tgz", + "integrity": "sha512-br0LOmjJqr6Rt4AEkadbcNf67Zpo7EPwKsWbjnRrJIa1QYFHQBqM4C7F2WTbV8ahTEcg1Eo+Y0aWjjORInYFyA==", + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.29.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.29.3.tgz", + "integrity": "sha512-1R4kiYKXGViqEN0CnoDrXc1StD9niAwu+j2dukWzrD4bJgsD4lDmEp0CRbc6E/vYJIfTHwPmwyaKtVSudICdPA==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.26", + "caniuse-lite": "^1.0.30001813", + "electron-to-chromium": "^1.5.439", + "node-releases": "^2.0.57", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.2.tgz", + "integrity": "sha512-V2o8YS2EhrKMO9AumnkK0ynynfFlsajpYupwq7S46H5mhcanwxDkNTw3K67wPIcKTH1ffkA4vhMOtAc7gRmPZw==", + "license": "MIT", + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001816", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001816.tgz", + "integrity": "sha512-+8Yx7BXCoqk6IF8yTicjfUR6D/ldJzdlsodlEOiOSPmhK844WIgk67/zIQaGAOxNkZyyvBlrRFnLvqKIoqbAFw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/content-type": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz", + "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "license": "MIT" + }, + "node_modules/core-js-compat": { + "version": "3.50.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.50.0.tgz", + "integrity": "sha512-XGpFGbMLHwSt74YLTKho7Ib242qi6O8MSX+sRokV4oz7iKXvQWGYZthjIhjRGMxjzVkAubBO512dKGYcefmX3Q==", + "license": "MIT", + "dependencies": { + "browserslist": "^4.28.7" + }, + "engines": { + "node": ">=6.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/electron-to-chromium": { + "version": "1.5.456", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.456.tgz", + "integrity": "sha512-8hboqI6xesozteFb8aa7OGknvxUtTeRJLz0FoePysUEh/oWbddykIGdgpEJRbPRg/nIMfBf2DFos+H2MtvJl2A==", + "license": "ISC" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/error-stack-parser": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz", + "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==", + "license": "MIT", + "dependencies": { + "stackframe": "^1.3.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/exponential-backoff": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.3.tgz", + "integrity": "sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==", + "license": "Apache-2.0" + }, + "node_modules/fast-text-encoding": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz", + "integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==", + "license": "Apache-2.0" + }, + "node_modules/fb-watchman": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.4.tgz", + "integrity": "sha512-tGQtaoYisPDriJBN0mT5yZSyNETnJGA1gTYxaVRAE5KUO3LI9kPUc9WIu8JXcxaIci+faIKlzXqXyPgrmubtBQ==", + "license": "MIT", + "dependencies": { + "bser": "2.1.2" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/flow-enums-runtime": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/flow-enums-runtime/-/flow-enums-runtime-0.0.6.tgz", + "integrity": "sha512-3PYnM29RFXwvAN6Pc/scUfkI7RwhQ/xqyLUyPNlXUp9S40zI8nup9tUSrTLSVnWGBN38FNiGWbwZOB6uR4OGdw==", + "license": "MIT" + }, + "node_modules/flow-estree": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-estree/-/flow-estree-0.331.0.tgz", + "integrity": "sha512-FVLYkSL/ITb/QXBEQvNWPjPooRGswuUtGOwrH+puSlMDneNkxy640+FZsk/TfKL+b7Wbw/Fg9FTUv2bMQDpj2w==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/flow-parser": { + "version": "0.331.0", + "resolved": "https://registry.npmjs.org/flow-parser/-/flow-parser-0.331.0.tgz", + "integrity": "sha512-vEZcHIlnKeN8JSVtYFczj8sWJfHIJOkz+YG00O/oul/Bete+t1ZhTi+O6JRRLFYvGW+yJkZ0YgL16iStnbkUqQ==", + "license": "MIT", + "dependencies": { + "flow-estree": "0.331.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hermes-estree": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.36.1.tgz", + "integrity": "sha512-guv1nQ6IJ7S83NRFPWc3SA7IBZrdNC9kapwOq6uXvF4wP+sDCgjzQbKPCoyYmoyZRzztF/n/c36l/rccCZSiCw==", + "license": "MIT" + }, + "node_modules/hermes-parser": { + "version": "0.36.1", + "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.36.1.tgz", + "integrity": "sha512-GApNk4zLHi2UWoWZZkx7LNCOSzLSc5lB55pZ/PhK7ycFeg7u5LcF88p/WbpIi1XUDtE0MpHE3uRR3u3KB7TjSQ==", + "license": "MIT", + "dependencies": { + "hermes-estree": "0.36.1" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, + "node_modules/is-core-module": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.17.0.tgz", + "integrity": "sha512-J/vG0zBCbIKOQFfufSwyXdMrsohyJIUNkrnmo6WZGzoM7tr/lsbfW5b2BvisL6zsyMzK9UxV9L6c7AoFbyXHOA==", + "license": "MIT", + "dependencies": { + "hasown": "^2.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsc-safe-url": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/jsc-safe-url/-/jsc-safe-url-0.2.4.tgz", + "integrity": "sha512-0wM3YBWtYePOjfyXQH5MWQ8H7sdk5EXSwZvmSLKk2RboVQ2Bu239jycHDz5J/8Blf3K0Qnoy2b6xD+z10MFB+Q==", + "license": "0BSD" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", + "license": "MIT" + }, + "node_modules/lodash.throttle": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz", + "integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" + }, + "node_modules/metro": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro/-/metro-0.87.1.tgz", + "integrity": "sha512-1oyLU9elM7hPAsKIqKooEekwxiuWr27+MZBhUROPhzcbXhMDxK64GPF/hCXwBZVp1F89ODavCrBmJtLx9WtBoQ==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.0", + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "accepts": "^2.0.0", + "connect": "^3.6.5", + "debug": "^4.4.0", + "error-stack-parser": "^2.0.6", + "flow-enums-runtime": "^0.0.6", + "flow-parser": "0.331.0", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "jsc-safe-url": "^0.2.2", + "lodash.throttle": "^4.1.1", + "metro-babel-transformer": "0.87.1", + "metro-cache": "0.87.1", + "metro-cache-key": "0.87.1", + "metro-config": "0.87.1", + "metro-core": "0.87.1", + "metro-file-map": "0.87.1", + "metro-resolver": "0.87.1", + "metro-runtime": "0.87.1", + "metro-source-map": "0.87.1", + "metro-symbolicate": "0.87.1", + "metro-transform-plugins": "0.87.1", + "metro-transform-worker": "0.87.1", + "mime-types": "^3.0.1", + "nullthrows": "^1.1.1", + "serialize-error": "^2.1.0", + "source-map": "^0.5.6", + "throat": "^5.0.0", + "ws": "^7.5.10", + "yargs": "^17.6.2" + }, + "bin": { + "metro": "src/cli.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-babel-transformer": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-babel-transformer/-/metro-babel-transformer-0.87.1.tgz", + "integrity": "sha512-orvRIGpb0yK1yMbk5YP3dhVKjmoxUkRB9fdltGJxNppEqus/1tFpNuf9KnGFR3Qjg0izoUrJ4z6WgoBvdkXPrA==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "flow-enums-runtime": "^0.0.6", + "flow-parser": "0.331.0", + "metro-cache-key": "0.87.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-cache": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-cache/-/metro-cache-0.87.1.tgz", + "integrity": "sha512-juNPaj0Xi5tkLp8imXqvbSnEIijwKG36m7OiFFVJMqEkiURwAjkMFVek3/xpix1+LVQqO7kjVp3PvuvIM61mKQ==", + "license": "MIT", + "dependencies": { + "exponential-backoff": "^3.1.1", + "flow-enums-runtime": "^0.0.6", + "https-proxy-agent": "^7.0.5", + "metro-core": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-cache-key": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-cache-key/-/metro-cache-key-0.87.1.tgz", + "integrity": "sha512-scqVVPMA2c+RVO12I3wyMDp5xCkRPLsyrcG4Qc3xfU5JR0EW/0sz2tjty+5UjMUtG09uiM1KYQ8HjWg7OQXHtw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-config": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-config/-/metro-config-0.87.1.tgz", + "integrity": "sha512-NmkDlc/qZAdo5gTkVTuO2AKE/khemRKRH5IA+SKfqUBJigI5GqZ5TOXhmEokhlkAqzjt8dyzKhzI6FHvXoXaTQ==", + "license": "MIT", + "dependencies": { + "connect": "^3.6.5", + "flow-enums-runtime": "^0.0.6", + "jest-validate": "^29.7.0", + "metro": "0.87.1", + "metro-cache": "0.87.1", + "metro-core": "0.87.1", + "metro-runtime": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-core": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-core/-/metro-core-0.87.1.tgz", + "integrity": "sha512-xizzky/4+c/Mkznege8OW05j7bSdM39VPoEps61Se4+hf32UQujmbvLvIE9+UnP6kNEPVomk0Fw8NsBK9iRQmw==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "lodash.throttle": "^4.1.1", + "metro-resolver": "0.87.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-file-map": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-file-map/-/metro-file-map-0.87.1.tgz", + "integrity": "sha512-9sPuNCojC3pS4vj+ZPY7FXmHGpdJeckXuKXQrDAfJvZc60AF8owRFTkI8XdwlwrmPIB2w++KraK9FMEXvC4wJw==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fb-watchman": "^2.0.0", + "flow-enums-runtime": "^0.0.6", + "graceful-fs": "^4.2.4", + "invariant": "^2.2.4", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-minify-terser": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-minify-terser/-/metro-minify-terser-0.87.1.tgz", + "integrity": "sha512-YK4k1oO1wV48hfE+Nbw2rJCnAgeabzrgT/xH5ha5n9gbK4p3HYFC898cERUiyTl9vRh58CNTiXRc88f7y6PfKg==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "terser": "^5.15.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-resolver": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-resolver/-/metro-resolver-0.87.1.tgz", + "integrity": "sha512-FXH/brY69wT6sPxaSW8BhMmDGD/6irmBr/cL4rUi+VWwqR3pbvdcfUOfyjcHucgQ7pe5IW3xJY21eHKLVKNumQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-runtime": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-runtime/-/metro-runtime-0.87.1.tgz", + "integrity": "sha512-kjeuSvInsM6OzBjkCQsWxnkrKZFMKtnkCl38oXWRI9lDGs2L9hGs9Tak9sQYJ9h3gtDujneB7wZio+irgqJKDw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.25.0", + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-source-map": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-source-map/-/metro-source-map-0.87.1.tgz", + "integrity": "sha512-Bqpm0PBGdy53pigIJb4HRF7QxD2pUOdgSmVh/4AWbP635kSCv+Y6ltVxUZgSnzS/QbSmzyCGijmRPlXMj2/qHw==", + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-symbolicate": "0.87.1", + "nullthrows": "^1.1.1", + "ob1": "0.87.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-symbolicate": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-symbolicate/-/metro-symbolicate-0.87.1.tgz", + "integrity": "sha512-rcGvwabrg0lbXGRGRKl14PY3My3+dkno2jZYhdJEuH2DmjTtTkV5bYwgto4JtV/Lbe+sXE6GO1UGg654430uow==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6", + "invariant": "^2.2.4", + "metro-source-map": "0.87.1", + "nullthrows": "^1.1.1", + "source-map": "^0.5.6", + "vlq": "^1.0.0" + }, + "bin": { + "metro-symbolicate": "src/index.js" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-transform-plugins": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-transform-plugins/-/metro-transform-plugins-0.87.1.tgz", + "integrity": "sha512-qMiJ/x+VfqumFJJSefKS6nj8uojzC29b2/aK8vlMuFABIqGjDucICEOXd2Yt6k/XMFAgAcaJvShUOT0HLyYaPw==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/template": "^7.28.6", + "@babel/traverse": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/metro-transform-worker": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/metro-transform-worker/-/metro-transform-worker-0.87.1.tgz", + "integrity": "sha512-VOzs3OV405FuOLYdAhqA2wsn1F9lvueDVxMDLvCKaQ44U+yknIqphJ9eMjjsGwLDZiJq9sW3DMLhjD27JxQgqQ==", + "license": "MIT", + "dependencies": { + "@babel/core": "^7.25.2", + "@babel/generator": "^7.29.1", + "@babel/parser": "^7.29.0", + "@babel/types": "^7.29.0", + "flow-enums-runtime": "^0.0.6", + "metro": "0.87.1", + "metro-babel-transformer": "0.87.1", + "metro-cache": "0.87.1", + "metro-cache-key": "0.87.1", + "metro-minify-terser": "0.87.1", + "metro-source-map": "0.87.1", + "metro-transform-plugins": "0.87.1", + "nullthrows": "^1.1.1" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz", + "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==", + "license": "MIT", + "dependencies": { + "content-type": "^2.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "license": "MIT" + }, + "node_modules/node-releases": { + "version": "2.0.59", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.59.tgz", + "integrity": "sha512-5qr2okC4ItAI0hG5SaV0HoYMpnM/Y6+Oqr7AmPYy/2uEoGvS+GbSKLeRxSS1uAdu59yz0ouzcuXievSgg///WA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/nullthrows": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", + "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", + "license": "MIT" + }, + "node_modules/ob1": { + "version": "0.87.1", + "resolved": "https://registry.npmjs.org/ob1/-/ob1-0.87.1.tgz", + "integrity": "sha512-i8iA8uij0g1YQzS8uOJPSRCgwDjO9warIHUAu1Fqj877Wc3wlfxDYBioYWgKTBF2+URVJttyDWSEpmd99nlvtQ==", + "license": "MIT", + "dependencies": { + "flow-enums-runtime": "^0.0.6" + }, + "engines": { + "node": "^22.13.0 || ^24.3.0 || >= 26.0.0" + } + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/react-refresh": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", + "integrity": "sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regenerate": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.5.0.tgz", + "integrity": "sha512-1s+CxXjJ71i7LNVy8nYwg47XV4y6lAnOEhsMtSKq3WpmPfhl9LuKlTqKIn/3yUpE8lBz+W+TT88Bxyhnr0U4yw==", + "license": "MIT" + }, + "node_modules/regenerate-unicode-properties": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-10.3.0.tgz", + "integrity": "sha512-9ns8odR8e9q3otKeHj3DE80jZYKg6zVeZKE+zQmRKXFoVUcuiTGeO6iusDhPRoIQQPVPRvH+SfBhrTud4eczuw==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.4.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexpu-core": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.5.3.tgz", + "integrity": "sha512-E8VgUoSK+LMQrLboDxavm76MTBGrQhx9RiNuomRmYnZ10Uw12HrI8fkxOOncktb2hBpzIZ9SV/347euQHG5z+g==", + "license": "MIT", + "dependencies": { + "regenerate": "^1.5.0", + "regenerate-unicode-properties": "^10.3.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.13.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.2.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "license": "MIT" + }, + "node_modules/regjsparser": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.13.4.tgz", + "integrity": "sha512-EWV80YgFaVgFrjGCAsV7oybp4GOxbls5RzBg8OB0nKEVXsBJR1JlV8Di1JhCROg3MzTfe1RI8yitIm1eOs68iA==", + "license": "BSD-2-Clause", + "dependencies": { + "jsesc": "~3.1.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.13", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.13.tgz", + "integrity": "sha512-Dj/cW9zBV2aRj6XzCxuGIs3ESZKv02jixne3q6jFZYZ3/Tg09gHHviSMDL4kObh9pqSahdRHEnDoaP2gn8YLhA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.17.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackframe": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz", + "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/terser": { + "version": "5.51.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.51.2.tgz", + "integrity": "sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==", + "license": "BSD-2-Clause", + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "license": "MIT" + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.1.tgz", + "integrity": "sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", + "license": "MIT", + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.2.1.tgz", + "integrity": "sha512-JQ84qTuMg4nVkx8ga4A16a1epI9H6uTXAknqxkGF/aFfRLw1xC/Bp24HNLaZhHSkWd3+84t8iXnp1J0kYcZHhg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.2.0.tgz", + "integrity": "sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.4.tgz", + "integrity": "sha512-t8wonIOdQyOjtPd2VktlBu6QjTVTks6v8bSi7kd0r2Vll8TK1JYDZtRRdbmCHOAMphkZgrzK+L+vXK4pyZ8t4A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vlq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.1.tgz", + "integrity": "sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==", + "license": "MIT" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/ws": { + "version": "7.5.13", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.13.tgz", + "integrity": "sha512-rsKI6xDBFVf4r/x8XyChGK04QR/XHroxs/jUcoWvtEZM8TPU/X/uIY9B1CsSzYws9ZJb/6bbBu7dPhFW00CAoA==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + } + } +} diff --git a/tests/react-native-metro/fixtures/rn-0.87/package.json b/tests/react-native-metro/fixtures/rn-0.87/package.json new file mode 100644 index 000000000..2497bab0c --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.87/package.json @@ -0,0 +1,13 @@ +{ + "name": "rn-metro-test-rn-0.87", + "private": true, + "description": "Metro setup of React Native 0.87 (Metro 0.87, with the fix from Metro 0.82.5).", + "dependencies": { + "@babel/core": "7.29.7", + "@babel/runtime": "7.29.10", + "@react-native/metro-config": "0.87.1", + "fast-text-encoding": "1.0.6", + "metro": "0.87.1", + "metro-config": "0.87.1" + } +} diff --git a/tests/react-native-metro/metro.config.base.js b/tests/react-native-metro/metro.config.base.js new file mode 100644 index 000000000..b61796381 --- /dev/null +++ b/tests/react-native-metro/metro.config.base.js @@ -0,0 +1,85 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Metro config shared by the fixtures. Each fixture's metro.config.js passes in its own +// @react-native/metro-config, so bundles are built the way that React Native version builds an app. +// Which optional packages are installed is set per bundle through RN_METRO_TEST_MODULES (see build.cjs). + +const fs = require('fs'); +const path = require('path'); + +const ROOT = fs.realpathSync(__dirname); +const STUBS = path.join(ROOT, 'stubs'); +const SDK_DIR = path.join(ROOT, '.sdk'); + +module.exports = (fixtureDir, { getDefaultConfig, mergeConfig }) => { + const projectRoot = fs.realpathSync(fixtureDir); + const modules = JSON.parse(process.env.RN_METRO_TEST_MODULES || '{}'); + + // Optional packages: a file to resolve to when "installed", null when missing. A missing package fails + // to resolve, so Metro handles it like a package that isn't installed. + const optionalPackages = { + 'fast-text-encoding': modules.fastTextEncoding + ? require.resolve('fast-text-encoding', { paths: [projectRoot] }) + : null, + 'react-native-get-random-values': modules.getRandomValues + ? path.join(STUBS, 'react-native-get-random-values.js') + : null, + '@react-native-async-storage/async-storage': modules.asyncStorage + ? path.join(STUBS, `async-storage-${modules.asyncStorage}.js`) + : null, + }; + + return mergeConfig(getDefaultConfig(projectRoot), { + watchFolders: [path.join(ROOT, 'app'), STUBS, SDK_DIR], + reporter: { update: () => {} }, + resolver: { + useWatchman: false, + // app/, stubs/ and .sdk/ are outside the fixture; packages their transformed code needs (such as + // @babel/runtime helpers added by React Native's Babel preset) come from the fixture's node_modules. + nodeModulesPaths: [path.join(projectRoot, 'node_modules')], + resolveRequest(context, moduleName, platform) { + if (Object.prototype.hasOwnProperty.call(optionalPackages, moduleName)) { + const filePath = optionalPackages[moduleName]; + if (!filePath) { + throw new Error(`[rn-metro-test] '${moduleName}' is not installed in this case`); + } + return { type: 'sourceFile', filePath }; + } + if (moduleName === '@react-native-community/netinfo') { + return { type: 'sourceFile', filePath: path.join(STUBS, 'netinfo.js') }; + } + if (moduleName === 'react-native' || moduleName.startsWith('react-native/')) { + throw new Error(`[rn-metro-test] '${moduleName}' needs native code and must not be bundled`); + } + if (moduleName === '@optimizely/optimizely-sdk') { + // Resolve the SDK the way an app does (package.json fields, exports), from the install in .sdk. + return context.resolveRequest( + { ...context, originModulePath: path.join(SDK_DIR, 'index.js') }, + moduleName, + platform, + ); + } + return context.resolveRequest(context, moduleName, platform); + }, + }, + serializer: { + // React Native's startup module (InitializeCore / setup-env) needs native code. Its JS polyfills, + // including ErrorUtils, are still bundled through getPolyfills. + getModulesRunBeforeMainModule: () => [], + }, + }); +}; diff --git a/tests/react-native-metro/run.mjs b/tests/react-native-metro/run.mjs new file mode 100644 index 000000000..42b277502 --- /dev/null +++ b/tests/react-native-metro/run.mjs @@ -0,0 +1,254 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Runs every case in cases.mjs on every fixture: bundles the test app with the fixture's Metro and runs +// the bundle in a fresh Node vm context. See README.md. +// +// Usage: node tests/react-native-metro/run.mjs [--sdk ] [--fixture ] [--case ] +// --sdk SDK package to test. Default: `npm pack` of this repo (which builds it, as `npm publish` does). +// --fixture only run this fixture. --case: only run this case. Both can be repeated. + +import { execFileSync, spawnSync } from 'child_process'; +import fs from 'fs'; +import os from 'os'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import vm from 'vm'; +import { CASES, EXPECTED_DECISIONS, FIXTURES } from './cases.mjs'; + +const ROOT = fs.realpathSync(path.dirname(fileURLToPath(import.meta.url))); +const REPO_ROOT = path.resolve(ROOT, '../..'); +const SDK_DIR = path.join(ROOT, '.sdk'); +const OUT_DIR = path.join(ROOT, '.out'); +const CASE_TIMEOUT_MS = 15000; +const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/; + +const args = process.argv.slice(2); +const argValues = (name) => args.flatMap((arg, i) => (arg === name ? [args[i + 1]] : [])); +const run = (cmd, cmdArgs, cwd) => { + try { + return execFileSync(cmd, cmdArgs, { cwd, stdio: ['ignore', 'pipe', 'pipe'] }).toString(); + } catch (e) { + throw new Error(`${cmd} ${cmdArgs.join(' ')} failed in ${cwd}:\n${e.stdout}\n${e.stderr}`); + } +}; + +// Installs the SDK package into .sdk the way an app would, with its dependencies and without its +// (optional) peer dependencies. +function installSdk() { + let tarball = argValues('--sdk')[0]; + if (tarball) { + tarball = path.resolve(tarball); + } else { + // npm pack runs the package's prepare script (the build), as npm publish does. + const packDir = fs.mkdtempSync(path.join(os.tmpdir(), 'rn-metro-test-')); + const name = run('npm', ['pack', '--silent', '--pack-destination', packDir], REPO_ROOT).trim().split('\n').pop(); + tarball = path.join(packDir, name); + } + fs.rmSync(SDK_DIR, { recursive: true, force: true }); + fs.mkdirSync(SDK_DIR, { recursive: true }); + fs.writeFileSync(path.join(SDK_DIR, 'package.json'), JSON.stringify({ + name: 'rn-metro-test-sdk', + private: true, + dependencies: { '@optimizely/optimizely-sdk': `file:${tarball}` }, + }, null, 2)); + fs.writeFileSync(path.join(SDK_DIR, 'index.js'), ''); + run('npm', ['install', '--omit=peer', '--omit=dev', '--ignore-scripts', '--no-package-lock', '--no-audit', '--no-fund', '--silent'], SDK_DIR); + return tarball; +} + +function installFixture(fixture) { + const dir = path.join(ROOT, 'fixtures', fixture); + if (!fs.existsSync(path.join(dir, 'node_modules'))) { + console.log(`Installing fixture ${fixture}...`); + run('npm', ['ci', '--no-audit', '--no-fund', '--silent'], dir); + } +} + +// Builds one bundle per distinct set of installed modules; returns { file } or { error }. +const bundles = new Map(); +function buildBundle(fixture, modules) { + const key = `${fixture}:${JSON.stringify(modules)}`; + if (!bundles.has(key)) { + const out = path.join(OUT_DIR, fixture, `bundle-${bundles.size}.js`); + fs.mkdirSync(path.dirname(out), { recursive: true }); + const result = spawnSync(process.execPath, [path.join(ROOT, 'build.cjs'), path.join(ROOT, 'fixtures', fixture), out], { + env: { ...process.env, RN_METRO_TEST_MODULES: JSON.stringify(modules) }, + encoding: 'utf8', + }); + bundles.set(key, result.status === 0 ? { file: out } : { error: (result.stderr || result.stdout || '').trim() }); + } + return bundles.get(key); +} + +// Errors thrown from the bundle's timers or promises surface here; they belong to the case being run. +let currentRecords = null; +const recordUncaught = (error) => { + if (!currentRecords) throw error; + currentRecords.uncaught.push(String((error && error.message) || error)); +}; +process.on('uncaughtException', recordUncaught); +process.on('unhandledRejection', recordUncaught); + +async function runBundle(file, runtime) { + const records = { reportedError: [], caughtError: [], sdk: [], result: [], readBack: [], uncaught: [], logs: [] }; + currentRecords = records; + let done; + const finished = new Promise((resolve) => { done = resolve; }); + const timers = new Set(); + const log = (...items) => records.logs.push(items.map(String).join(' ')); + + const context = { + console: { log, info: log, warn: log, error: log, debug: log, trace: log }, + setTimeout: (fn, ms, ...rest) => { + const timer = setTimeout(() => { timers.delete(timer); fn(...rest); }, ms); + timers.add(timer); + return timer; + }, + clearTimeout: (timer) => { timers.delete(timer); clearTimeout(timer); }, + setInterval: (fn, ms, ...rest) => { + const timer = setInterval(fn, ms, ...rest); + timers.add(timer); + return timer; + }, + clearInterval: (timer) => { timers.delete(timer); clearInterval(timer); }, + queueMicrotask, + __CASE__: runtime, + __record: (type, data) => { (records[type] = records[type] || []).push(data); }, + __done: () => done(), + }; + // A fresh context only has standard JS built-ins: no TextEncoder or crypto, like Hermes before RN 0.74. + if (runtime.nativeTextEncoder) { + context.TextEncoder = TextEncoder; + context.__nativeTextEncoder = TextEncoder; + } + vm.createContext(context); + + const timeout = setTimeout(() => { records.timedOut = true; done(); }, CASE_TIMEOUT_MS); + try { + vm.runInContext(fs.readFileSync(file, 'utf8'), context, { filename: file }); + } catch (e) { + recordUncaught(e); + done(); + } + await finished; + clearTimeout(timeout); + await new Promise((resolve) => setTimeout(resolve, 50)); + for (const timer of timers) { + clearTimeout(timer); + clearInterval(timer); + } + currentRecords = null; + return records; +} + +// Returns a list of problems; empty if the case behaved as expected. +function check(testCase, records) { + const { expect } = testCase; + const problems = []; + const fatal = records.reportedError.filter((e) => e.isFatal); + const nonFatal = records.reportedError.filter((e) => !e.isFatal); + const sdk = records.sdk[0]; + const result = records.result[0]; + + if (records.timedOut) problems.push('timed out'); + if (records.uncaught.length) problems.push(`uncaught error: ${records.uncaught.join(' | ')}`); + if (nonFatal.length) problems.push(`reported error: ${nonFatal.map((e) => e.message).join(' | ')}`); + + if (expect.works) { + if (fatal.length) problems.push(`fatal error: ${fatal.map((e) => e.message).join(' | ')}`); + if (records.caughtError.length) problems.push(`error: ${records.caughtError.map((e) => e.message).join(' | ')}`); + if (!sdk || !sdk.loaded) { + problems.push('SDK did not load'); + } else { + for (const [name, source] of Object.entries(expect.works)) { + if (sdk.sources[name] !== source) problems.push(`${name}: expected ${source}, got ${sdk.sources[name]}`); + } + } + if (!result) { + problems.push('no result'); + } else { + if (JSON.stringify(result.decisions) !== JSON.stringify(EXPECTED_DECISIONS)) { + problems.push(`decisions: expected ${JSON.stringify(EXPECTED_DECISIONS)}, got ${JSON.stringify(result.decisions)}`); + } + if (result.events.length === 0) problems.push('no events dispatched'); + if (!result.events.every((uuid) => UUID_V4.test(uuid))) problems.push(`invalid event UUIDs: ${result.events.join(', ')}`); + if (result.calls.encode === 0) problems.push('TextEncoder.encode was not called'); + if (result.calls.getRandomValues === 0) problems.push('crypto.getRandomValues was not called'); + } + if (expect.readBack) { + const readBack = records.readBack[0]; + if (!readBack || readBack.events.length === 0) problems.push('stored events were not read back'); + else if (!readBack.storageCalls.includes(expect.readBack)) { + problems.push(`expected AsyncStorage.${expect.readBack}, calls: ${readBack.storageCalls.join(', ')}`); + } + } + } else if (expect.fatal) { + // Every fatal error must be the expected one, so an unexpected one (such as a shifted require) can't hide. + if (!fatal.length || !fatal.every((e) => e.message.includes(expect.fatal))) { + problems.push(`expected fatal "${expect.fatal}", got: ${fatal.map((e) => e.message).join(' | ') || 'none'}`); + } + if (sdk && sdk.loaded) problems.push('SDK loaded'); + if (records.caughtError.length) problems.push(`error thrown to the app: ${records.caughtError.map((e) => e.message).join(' | ')}`); + } else if (expect.caught) { + if (!records.caughtError.length || !records.caughtError.every((e) => e.message.includes(expect.caught))) { + problems.push(`expected error "${expect.caught}", got: ${records.caughtError.map((e) => e.message).join(' | ') || 'none'}`); + } + if (fatal.length) problems.push(`fatal error: ${fatal.map((e) => e.message).join(' | ')}`); + } + return problems; +} + +const describeExpect = ({ expect }) => (expect.works + ? `works (TextEncoder: ${expect.works.textEncoder}, getRandomValues: ${expect.works.getRandomValues}` + + `${expect.readBack ? `, read back via ${expect.readBack}` : ''})` + : expect.fatal ? `fatal: ${expect.fatal}` : `error: ${expect.caught}`); + +async function main() { + const fixtures = argValues('--fixture').length ? argValues('--fixture') : FIXTURES; + const cases = argValues('--case').length ? CASES.filter((c) => argValues('--case').includes(c.id)) : CASES; + + const tarball = installSdk(); + console.log(`SDK under test: ${tarball}`); + fs.rmSync(OUT_DIR, { recursive: true, force: true }); + + const rows = []; + for (const fixture of fixtures) { + installFixture(fixture); + for (const testCase of cases) { + const bundle = buildBundle(fixture, testCase.modules); + const problems = bundle.error + ? [`bundle failed: ${bundle.error.split('\n').slice(0, 3).join(' ')}`] + : check(testCase, await runBundle(bundle.file, testCase.runtime)); + rows.push({ fixture, testCase, problems }); + console.log(`${problems.length ? '✗' : '✓'} ${fixture} ${testCase.id} ${testCase.description}`); + for (const problem of problems) console.log(` ${problem}`); + } + } + + console.log('\n| Fixture | Case | Setup | Expected | Result |\n|---|---|---|---|---|'); + for (const { fixture, testCase, problems } of rows) { + console.log(`| ${fixture} | ${testCase.id} | ${testCase.description} | ${describeExpect(testCase)} | ${problems.length ? `✗ ${problems.join('; ')}` : '✓'} |`); + } + const failed = rows.filter((row) => row.problems.length).length; + console.log(`\n${rows.length - failed} passed, ${failed} failed`); + process.exitCode = failed ? 1 : 0; +} + +main().catch((e) => { + console.error(e && e.stack ? e.stack : e); + process.exit(1); +}); diff --git a/tests/react-native-metro/stubs/async-storage-v2.js b/tests/react-native-metro/stubs/async-storage-v2.js new file mode 100644 index 000000000..3b276c43b --- /dev/null +++ b/tests/react-native-metro/stubs/async-storage-v2.js @@ -0,0 +1,34 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// In-memory stand-in for @react-native-async-storage/async-storage v1/v2, which has multiGet. +// Method calls are recorded in globalThis.__asyncStorageCalls. +const items = new Map(); +const calls = (globalThis.__asyncStorageCalls = globalThis.__asyncStorageCalls || []); + +const AsyncStorage = { + getItem: (key) => { calls.push('getItem'); return Promise.resolve(items.has(key) ? items.get(key) : null); }, + setItem: (key, value) => { calls.push('setItem'); items.set(key, value); return Promise.resolve(); }, + removeItem: (key) => { calls.push('removeItem'); items.delete(key); return Promise.resolve(); }, + getAllKeys: () => { calls.push('getAllKeys'); return Promise.resolve([...items.keys()]); }, + clear: () => { calls.push('clear'); items.clear(); return Promise.resolve(); }, + multiGet: (keys) => { + calls.push('multiGet'); + return Promise.resolve(keys.map((key) => [key, items.has(key) ? items.get(key) : null])); + }, +}; + +module.exports = { __esModule: true, default: AsyncStorage }; diff --git a/tests/react-native-metro/stubs/async-storage-v3.js b/tests/react-native-metro/stubs/async-storage-v3.js new file mode 100644 index 000000000..fbf918811 --- /dev/null +++ b/tests/react-native-metro/stubs/async-storage-v3.js @@ -0,0 +1,34 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// In-memory stand-in for @react-native-async-storage/async-storage v3, which replaced multiGet with getMany. +// Method calls are recorded in globalThis.__asyncStorageCalls. +const items = new Map(); +const calls = (globalThis.__asyncStorageCalls = globalThis.__asyncStorageCalls || []); + +const AsyncStorage = { + getItem: (key) => { calls.push('getItem'); return Promise.resolve(items.has(key) ? items.get(key) : null); }, + setItem: (key, value) => { calls.push('setItem'); items.set(key, value); return Promise.resolve(); }, + removeItem: (key) => { calls.push('removeItem'); items.delete(key); return Promise.resolve(); }, + getAllKeys: () => { calls.push('getAllKeys'); return Promise.resolve([...items.keys()]); }, + clear: () => { calls.push('clear'); items.clear(); return Promise.resolve(); }, + getMany: (keys) => { + calls.push('getMany'); + return Promise.resolve(Object.fromEntries(keys.map((key) => [key, items.has(key) ? items.get(key) : null]))); + }, +}; + +module.exports = { __esModule: true, default: AsyncStorage }; diff --git a/tests/react-native-metro/stubs/netinfo.js b/tests/react-native-metro/stubs/netinfo.js new file mode 100644 index 000000000..c7e4194a0 --- /dev/null +++ b/tests/react-native-metro/stubs/netinfo.js @@ -0,0 +1,21 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Stand-in for @react-native-community/netinfo, which needs native code. +module.exports = { + addEventListener: () => () => {}, + fetch: () => Promise.resolve({ isConnected: true, isInternetReachable: true }), +}; diff --git a/tests/react-native-metro/stubs/react-native-get-random-values.js b/tests/react-native-metro/stubs/react-native-get-random-values.js new file mode 100644 index 000000000..c07c849bd --- /dev/null +++ b/tests/react-native-metro/stubs/react-native-get-random-values.js @@ -0,0 +1,31 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Stand-in for react-native-get-random-values, which needs native code. Like the real package, it only +// sets crypto.getRandomValues when there is none. +if (typeof global.crypto !== 'object') { + global.crypto = {}; +} + +if (typeof global.crypto.getRandomValues !== 'function') { + // Test only: Math.random is not cryptographically secure. + global.crypto.getRandomValues = function getRandomValues(array) { + for (let i = 0; i < array.length; i++) { + array[i] = Math.floor(Math.random() * 256); + } + return array; + }; +} From 11bd17192e6729f53efd95a70f656661bfda380a Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 28 Oct 2026 21:42:01 +0600 Subject: [PATCH 29/39] [FSSDK-13343] Skip the default browser event store when localStorage is unavailable (#1184) ## Summary - **localStorage check:** new `isLocalStorageAvailable()` in `lib/utils/env/browser.ts`. It returns `false` when reading the `localStorage` global throws (a `ReferenceError` where it isn't defined, such as SSR, or a `SecurityError` where storage is blocked, such as disabled cookies or sandboxed iframes) or when the global is `null`. - **Browser batch event processor:** `createBatchEventProcessor` only builds its default `LocalStorageCache`-backed `EventStore` when localStorage is available. Otherwise it runs without an event store and adds a Warn startup log: `localStorage is not available, events will not be persisted.` A user-provided `eventStore` is used exactly as before, whether or not localStorage is available. - **Startup logs from platform factories:** `getBatchEventProcessor` accepts a `startupLogs` option and puts those logs before its own, without changing the caller's array. The option is on the internal `BatchEventProcessorFactoryOptions` only; the public `BatchEventProcessorOptions` is unchanged. Before this change, the browser factory always created a `LocalStorageCache` event store. Where localStorage can't be accessed, every store operation threw. With no event store, events are still batched and dispatched; failed events just aren't persisted for retry across page loads. Co-authored-by: Claude Opus 5.5 --- .../event_processor_factory.browser.spec.ts | 74 ++++++++++++++++++- .../event_processor_factory.browser.ts | 51 +++++++++---- .../event_processor_factory.spec.ts | 30 ++++++++ .../event_processor_factory.ts | 3 +- lib/message/error_message.ts | 2 + lib/utils/env/browser.spec.ts | 66 +++++++++++++++++ lib/utils/env/browser.ts | 32 ++++++++ 7 files changed, 242 insertions(+), 16 deletions(-) create mode 100644 lib/utils/env/browser.spec.ts create mode 100644 lib/utils/env/browser.ts diff --git a/lib/event_processor/event_processor_factory.browser.spec.ts b/lib/event_processor/event_processor_factory.browser.spec.ts index 61c6c483c..01c035854 100644 --- a/lib/event_processor/event_processor_factory.browser.spec.ts +++ b/lib/event_processor/event_processor_factory.browser.spec.ts @@ -55,6 +55,13 @@ vi.mock('../utils/cache/local_storage_cache.browser', () => { return { LocalStorageCache: vi.fn() }; }); +vi.mock('../utils/env/browser', () => { + return { + isLocalStorageAvailable: vi.fn().mockReturnValue(true), + __platforms: ['browser'], + }; +}); + vi.mock('./event_store', () => { return { DEFAULT_MAX_EVENTS_IN_STORE: 500, @@ -88,11 +95,15 @@ vi.mock('../utils/cache/store', () => { import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; -import { SyncPrefixStore } from '../utils/cache/store'; +import { Store, SyncPrefixStore } from '../utils/cache/store'; +import { EventWithId } from './batch_event_processor'; +import { isLocalStorageAvailable } from '../utils/env/browser'; import { default as browserDefaultEventDispatcher, default as defaultEventDispatcher } from './event_dispatcher/default_dispatcher.browser'; import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; -import { extractEventProcessor, FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, getOpaqueBatchEventProcessor } from './event_processor_factory'; +import { extractEventProcessor, FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, getOpaqueBatchEventProcessor, getPrefixEventStore } from './event_processor_factory'; import { createBatchEventProcessor, createForwardingEventProcessor } from './event_processor_factory.browser'; +import { LogLevel } from '../logging/logger'; +import { EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE } from 'error_message'; import { EventStore } from './event_store'; describe('createForwardingEventProcessor', () => { @@ -126,12 +137,71 @@ describe('createBatchEventProcessor', () => { const MockLocalStorageCache = vi.mocked(LocalStorageCache); const MockSyncPrefixStore = vi.mocked(SyncPrefixStore); const MockEventStore = vi.mocked(EventStore); + const mockIsLocalStorageAvailable = vi.mocked(isLocalStorageAvailable); + const mockGetPrefixEventStore = vi.mocked(getPrefixEventStore); beforeEach(() => { mockGetOpaqueBatchEventProcessor.mockClear(); MockLocalStorageCache.mockClear(); MockSyncPrefixStore.mockClear(); MockEventStore.mockClear(); + mockIsLocalStorageAvailable.mockClear(); + mockIsLocalStorageAvailable.mockReturnValue(true); + mockGetPrefixEventStore.mockClear(); + }); + + it('does not use any eventStore and adds a warning startup log if no eventStore is provided and localStorage is not available', () => { + mockIsLocalStorageAvailable.mockReturnValue(false); + + const processor = createBatchEventProcessor({ storeTtl: 60_000 }); + + expect(Object.is(processor, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].eventStore).toBe(undefined); + expect(MockEventStore).not.toHaveBeenCalled(); + expect(MockLocalStorageCache).not.toHaveBeenCalled(); + + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([{ + level: LogLevel.Warn, + message: EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE, + params: [], + }]); + }); + + it('does not add any startup log if localStorage is available', () => { + mockIsLocalStorageAvailable.mockReturnValue(true); + + createBatchEventProcessor({}); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([]); + }); + + it('does not add any startup log if an eventStore is provided and localStorage is not available', () => { + mockIsLocalStorageAvailable.mockReturnValue(false); + + createBatchEventProcessor({ eventStore: { operation: 'sync' } as Store }); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].startupLogs).toEqual([]); + }); + + it('uses the provided eventStore wrapped with getPrefixEventStore regardless of localStorage availability', () => { + const providedStore = { operation: 'sync' } as Store; + const prefixStore = {} as Store; + mockGetPrefixEventStore.mockReturnValue(prefixStore); + + mockIsLocalStorageAvailable.mockReturnValue(true); + const processor1 = createBatchEventProcessor({ eventStore: providedStore }); + + expect(Object.is(processor1, mockGetOpaqueBatchEventProcessor.mock.results[0].value)).toBe(true); + expect(mockGetPrefixEventStore).toHaveBeenNthCalledWith(1, providedStore); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[0][0].eventStore).toBe(prefixStore); + + mockIsLocalStorageAvailable.mockReturnValue(false); + const processor2 = createBatchEventProcessor({ eventStore: providedStore }); + + expect(Object.is(processor2, mockGetOpaqueBatchEventProcessor.mock.results[1].value)).toBe(true); + expect(mockGetPrefixEventStore).toHaveBeenNthCalledWith(2, providedStore); + expect(mockGetOpaqueBatchEventProcessor.mock.calls[1][0].eventStore).toBe(prefixStore); + + expect(MockEventStore).not.toHaveBeenCalled(); + expect(MockLocalStorageCache).not.toHaveBeenCalled(); }); it('uses an EventStore instance with AsyncStorageCache and correct options if no eventStore is provided', () => { diff --git a/lib/event_processor/event_processor_factory.browser.ts b/lib/event_processor/event_processor_factory.browser.ts index e55436236..5aa7278a1 100644 --- a/lib/event_processor/event_processor_factory.browser.ts +++ b/lib/event_processor/event_processor_factory.browser.ts @@ -13,22 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE } from 'error_message'; +import { LogLevel } from '../logging/logger'; +import { Platform } from '../platform_support'; +import { StartupLog } from '../service'; +import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; +import { Store } from '../utils/cache/store'; +import { isLocalStorageAvailable } from '../utils/env/browser'; +import { EventWithId } from './batch_event_processor'; +import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; import { EventDispatcher } from './event_dispatcher/event_dispatcher'; -import { EventProcessor } from './event_processor'; +import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; import { - getOpaqueBatchEventProcessor, BatchEventProcessorOptions, - OpaqueEventProcessor, - wrapEventProcessor, + FAILED_EVENT_RETRY_INTERVAL, getForwardingEventProcessor, + getOpaqueBatchEventProcessor, getPrefixEventStore, + OpaqueEventProcessor, + wrapEventProcessor, } from './event_processor_factory'; -import defaultEventDispatcher from './event_dispatcher/default_dispatcher.browser'; -import sendBeaconEventDispatcher from './event_dispatcher/send_beacon_dispatcher.browser'; -import { LocalStorageCache } from '../utils/cache/local_storage_cache.browser'; -import { FAILED_EVENT_RETRY_INTERVAL } from './event_processor_factory'; import { DEFAULT_MAX_EVENTS_IN_STORE, EventStore } from './event_store'; -import { Platform } from '../platform_support'; + export const DEFAULT_EVENT_BATCH_SIZE = 10; export const DEFAULT_EVENT_FLUSH_INTERVAL = 1_000; export const EVENT_MAX_RETRIES_BROWSER = 2; @@ -39,15 +45,33 @@ export const createForwardingEventProcessor = ( return wrapEventProcessor(getForwardingEventProcessor(eventDispatcher)); }; -export const createBatchEventProcessor = ( - options: BatchEventProcessorOptions = {} -): OpaqueEventProcessor => { - const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : new EventStore({ +const getDefaultEventStore = ( + options: BatchEventProcessorOptions, + startupLogs: StartupLog[], +): Store | undefined => { + if (!isLocalStorageAvailable()) { + startupLogs.push({ + level: LogLevel.Warn, + message: EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE, + params: [], + }); + return undefined; + } + + return new EventStore({ store: new LocalStorageCache(), maxSize: options.batchSize ? Math.max(options.batchSize * 2, DEFAULT_MAX_EVENTS_IN_STORE) : DEFAULT_MAX_EVENTS_IN_STORE, ttl: options.storeTtl, }); +}; + +export const createBatchEventProcessor = ( + options: BatchEventProcessorOptions = {} +): OpaqueEventProcessor => { + const startupLogs: StartupLog[] = []; + const eventStore = options.eventStore ? getPrefixEventStore(options.eventStore) : + getDefaultEventStore(options, startupLogs); return getOpaqueBatchEventProcessor({ eventDispatcher: options.eventDispatcher || defaultEventDispatcher, @@ -63,6 +87,7 @@ export const createBatchEventProcessor = ( failedEventRetryInterval: FAILED_EVENT_RETRY_INTERVAL, eventStore, storeTtl: options.storeTtl, + startupLogs, }); }; diff --git a/lib/event_processor/event_processor_factory.spec.ts b/lib/event_processor/event_processor_factory.spec.ts index d7105fa75..73ec65870 100644 --- a/lib/event_processor/event_processor_factory.spec.ts +++ b/lib/event_processor/event_processor_factory.spec.ts @@ -352,6 +352,36 @@ describe('getBatchEventProcessor', () => { }])); }); + it('includes the provided startupLogs along with its own startup logs', () => { + const providedLog = { + level: LogLevel.Warn, + message: 'provided startup log %s', + params: ['param'], + }; + + const options = { + eventDispatcher: getMockEventDispatcher(), + defaultBatchSize: 77, + defaultFlushInterval: 12345, + startupLogs: [providedLog], + }; + + const processor = getBatchEventProcessor(options); + + expect(Object.is(processor, MockBatchEventProcessor.mock.instances[0])).toBe(true); + + const startupLogs = MockBatchEventProcessor.mock.calls[0][0].startupLogs; + expect(startupLogs).toEqual(expect.arrayContaining([ + providedLog, + { + level: LogLevel.Warn, + message: 'Invalid batchSize %s, defaulting to %s', + params: [undefined, 77], + }, + ])); + expect(options.startupLogs).toEqual([providedLog]); + }); + it('does not use a failedEventRepeater if failedEventRetryInterval is not provided', () => { const options = { eventDispatcher: getMockEventDispatcher(), diff --git a/lib/event_processor/event_processor_factory.ts b/lib/event_processor/event_processor_factory.ts index 77d54326b..14b07f2af 100644 --- a/lib/event_processor/event_processor_factory.ts +++ b/lib/event_processor/event_processor_factory.ts @@ -77,6 +77,7 @@ export type BatchEventProcessorFactoryOptions = Omit { @@ -109,7 +110,7 @@ export const getBatchEventProcessor = ( } } : undefined; - const startupLogs: StartupLog[] = []; + const startupLogs: StartupLog[] = [...(options.startupLogs ?? [])]; const { defaultFlushInterval, defaultBatchSize } = options; diff --git a/lib/message/error_message.ts b/lib/message/error_message.ts index 20433e153..b9790a671 100644 --- a/lib/message/error_message.ts +++ b/lib/message/error_message.ts @@ -102,6 +102,8 @@ export const PROMISE_NOT_ALLOWED = "Promise value is not allowed in sync operati export const SERVICE_NOT_RUNNING = "%s not running"; export const EVENT_STORE_FULL = 'Event store is full. Not saving event with id %d.'; export const LOCAL_HOLDOUT_MISSING_INCLUDED_RULES = 'Local holdout "%s" is missing or has empty "includedRules"; skipping.'; +export const EVENT_STORE_LOCAL_STORAGE_NOT_AVAILABLE = + 'localStorage is not available, events will not be persisted.'; export const messages: string[] = []; diff --git a/lib/utils/env/browser.spec.ts b/lib/utils/env/browser.spec.ts new file mode 100644 index 000000000..85fc4e5aa --- /dev/null +++ b/lib/utils/env/browser.spec.ts @@ -0,0 +1,66 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { it, describe, expect, beforeEach, afterEach } from 'vitest'; +import { isLocalStorageAvailable } from './browser'; + +describe('isLocalStorageAvailable', () => { + let originalDescriptor: PropertyDescriptor | undefined; + + const mockLocalStorageGetter = (get: () => unknown) => { + Object.defineProperty(globalThis, 'localStorage', { get, configurable: true }); + }; + + beforeEach(() => { + originalDescriptor = Object.getOwnPropertyDescriptor(globalThis, 'localStorage'); + }); + + afterEach(() => { + if (originalDescriptor) { + Object.defineProperty(globalThis, 'localStorage', originalDescriptor); + } else { + Reflect.deleteProperty(globalThis, 'localStorage'); + } + }); + + it('should return true when localStorage global can be accessed', () => { + mockLocalStorageGetter(() => ({})); + + expect(isLocalStorageAvailable()).toBe(true); + }); + + it('should return false when localStorage is null', () => { + mockLocalStorageGetter(() => null); + + expect(isLocalStorageAvailable()).toBe(false); + }); + + it('should return false when localStorage is not defined', () => { + mockLocalStorageGetter(() => { + throw new ReferenceError('localStorage is not defined'); + }); + + expect(isLocalStorageAvailable()).toBe(false); + }); + + it('should return false when accessing localStorage throws a SecurityError', () => { + mockLocalStorageGetter(() => { + throw new DOMException('The operation is insecure.', 'SecurityError'); + }); + + expect(isLocalStorageAvailable()).toBe(false); + }); +}); diff --git a/lib/utils/env/browser.ts b/lib/utils/env/browser.ts new file mode 100644 index 000000000..dd1048111 --- /dev/null +++ b/lib/utils/env/browser.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Platform } from '../../platform_support'; + +/** + * Checks whether localStorage exists and is accessible. Referencing it throws a + * ReferenceError where it is not defined (e.g. SSR) and a SecurityError where + * storage is blocked (e.g. cookies disabled, sandboxed iframes). + */ +export const isLocalStorageAvailable = (): boolean => { + try { + return !!localStorage; + } catch { + return false; + } +}; + +export const __platforms: Platform[] = ['browser']; From 8941c2c96d9852162bf20bbe20bfd705dd94c953 Mon Sep 17 00:00:00 2001 From: Alex Yong <96444887+alexjoeyyong@users.noreply.github.com> Date: Thu, 29 Oct 2026 13:40:39 -0400 Subject: [PATCH 30/39] [AI-FSSDK] [FSSDK-12958] Continue rule evaluation after local holdout hit (#1181) * [AI-FSSDK] [FSSDK-12958] Continue rule evaluation after local holdout hit * [AI-FSSDK] [FSSDK-12958] Test decision error discards local holdout events * [AI-FSSDK] [FSSDK-12958] Drop deprecated DecisionObj.holdout; test legacy holdout events --- lib/core/decision_service/index.spec.ts | 283 +++++++++++++++++++++--- lib/core/decision_service/index.ts | 68 +++--- lib/optimizely/index.spec.ts | 153 ++++++++++++- lib/optimizely/index.ts | 31 +-- 4 files changed, 448 insertions(+), 87 deletions(-) diff --git a/lib/core/decision_service/index.spec.ts b/lib/core/decision_service/index.spec.ts index 77e942e0a..67dff42c6 100644 --- a/lib/core/decision_service/index.spec.ts +++ b/lib/core/decision_service/index.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2025, Optimizely + * Copyright 2025-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -2212,6 +2212,11 @@ describe('DecisionService', () => { return datafile; }; + const globalHit = (config: ProjectConfig) => ({ + experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], + variation: config.variationIdMap['holdout_variation_running_id'], + }); + it('should return holdout variation immediately when excludeTargetedDeliveries is false', async () => { const { decisionService } = getDecisionService(); const config = createProjectConfig(JSON.stringify(getExcludeTDDatafile(false))); @@ -2281,10 +2286,7 @@ describe('DecisionService', () => { experiment: config.experimentKeyMap['delivery_1'], variation: config.variationIdMap['5004'], decisionSource: DECISION_SOURCES.ROLLOUT, - holdout: { - experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], - variation: config.variationIdMap['holdout_variation_running_id'], - }, + holdouts: [globalHit(config)], }); const reasonStrings = variation.reasons.map((r: any) => typeof r === 'string' ? r : r[0]); @@ -2317,10 +2319,7 @@ describe('DecisionService', () => { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, - holdout: { - experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], - variation: config.variationIdMap['holdout_variation_running_id'], - }, + holdouts: [globalHit(config)], }); }); @@ -2353,10 +2352,7 @@ describe('DecisionService', () => { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, - holdout: { - experiment: config.holdoutIdMap && config.holdoutIdMap['holdout_running_id'], - variation: config.variationIdMap['holdout_variation_running_id'], - }, + holdouts: [globalHit(config)], }); }); }); @@ -3076,6 +3072,11 @@ describe('DecisionService', () => { return datafile; }; + const localHit = (config: ProjectConfig) => ({ + experiment: config.holdoutIdMap!['local_holdout_id'], + variation: config.variationIdMap['local_holdout_variation_id'], + }); + beforeEach(() => { mockBucket.mockReset(); }); @@ -3118,12 +3119,10 @@ describe('DecisionService', () => { expect(value[0].result.experiment?.id).toBe('global_holdout_id'); }); - it('local holdout hit branch: user bucketed into local holdout for experiment rule returns holdout variation; audience and traffic not evaluated for that rule', async () => { - // exp_1 has id '2001' + it('local holdout hit on an experiment rule excludes the user from that rule only; with no other rule serving the decision is null with the hit recorded', async () => { const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); const { decisionService } = getDecisionService(); - // bucket returns holdout variation when evaluating the local holdout mockBucket.mockImplementation((params: BucketerParams) => { if (params.experimentId === 'local_holdout_id') { return { result: 'local_holdout_variation_id', reasons: [] }; @@ -3135,10 +3134,68 @@ describe('DecisionService', () => { const feature = config.featureKeyMap['flag_1']; const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - // Should return holdout decision for the local holdout - expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); - expect(value[0].result.experiment?.id).toBe('local_holdout_id'); - expect(value[0].result.variation?.id).toBe('local_holdout_variation_id'); + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: null, + variation: null, + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [hit], + }); + expect(mockBucket.mock.calls.some(([p]) => p.experimentId === '2001')).toBe(false); + }); + + it('local holdout hit on an experiment rule continues to the next experiment rule, which serves', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + if (params.experimentId === '2002') { + return { result: '5002', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['2002'], + variation: config.variationIdMap['5002'], + decisionSource: DECISION_SOURCES.FEATURE_TEST, + holdouts: [hit], + }); + }); + + it('local holdout hit on an experiment rule continues to a delivery rule when no later experiment serves', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3001') { + return { result: '5004', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.ROLLOUT); + expect(value[0].result.experiment?.id).toBe('3001'); + expect(value[0].result.variation?.id).toBe('5004'); + expect(value[0].result.holdouts).toEqual([localHit(config)]); }); it('local holdout miss branch: user not bucketed into local holdout falls through to regular rule evaluation', async () => { @@ -3202,31 +3259,188 @@ describe('DecisionService', () => { expect(value[0].result.experiment?.id).toBe('2001'); }); - it('local holdout applies to delivery rules (rollouts) as well as experiment rules', async () => { - // delivery_1 has id '3001' + it('local holdout hit on a delivery rule continues to the next delivery rule, not straight to everyone else', async () => { const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('3001'))); const { decisionService } = getDecisionService(); - // bucket returns null for all experiments and the local holdout variation for delivery rule mockBucket.mockImplementation((params: BucketerParams) => { if (params.experimentId === 'local_holdout_id') { return { result: 'local_holdout_variation_id', reasons: [] }; } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + if (params.experimentId === 'default-rollout-id') { + return { result: '5007', reasons: [] }; + } return { result: null, reasons: [] }; }); - // No audience attributes → experiments won't match, falls through to rollout - const user = new OptimizelyUserContext({ - optimizely: {} as any, - userId: 'user1', - attributes: { age: 15 }, // satisfies 4001 used by delivery_1 + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const hit = localHit(config); + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['3002'], + variation: config.variationIdMap['5005'], + decisionSource: DECISION_SOURCES.ROLLOUT, + holdouts: [hit], }); + }); + + it('one local holdout targeting two rules records a hit for each rule', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001', ['2001', '3001']))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); const feature = config.featureKeyMap['flag_1']; const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - // Should be a holdout decision from the local holdout targeting the delivery rule - expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); - expect(value[0].result.experiment?.id).toBe('local_holdout_id'); + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([localHit(config), localHit(config)]); + }); + + it('holdouts list is ordered by evaluation: experiment-rule hits before delivery-rule hits, and holdout is the first entry', async () => { + const datafile = makeLocalHoldoutDatafile('2002'); + (datafile as any).localHoldouts.push({ + ...(datafile as any).localHoldouts[0], + id: 'local_holdout_2_id', + key: 'local_holdout_2', + includedRules: ['3001'], + variations: [{ id: 'local_holdout_2_variation_id', key: 'local_holdout_2_variation', variables: [] }], + trafficAllocation: [{ entityId: 'local_holdout_2_variation_id', endOfRange: 10000 }], + }); + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_2_id') { + return { result: 'local_holdout_2_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const expHit = localHit(config); + const deliveryHit = { + experiment: config.holdoutIdMap!['local_holdout_2_id'], + variation: config.variationIdMap['local_holdout_2_variation_id'], + }; + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([expHit, deliveryHit]); + }); + + it('global excludeTargetedDeliveries holdout hit is listed before local delivery-rule hits', async () => { + const datafile = makeLocalHoldoutDatafile('3001'); + (datafile as any).holdouts = [{ + id: 'global_holdout_id', + key: 'global_holdout', + status: 'Running', + includedFlags: [], + excludedFlags: [], + excludeTargetedDeliveries: true, + audienceIds: [], + audienceConditions: [], + variations: [{ id: 'global_holdout_var_id', key: 'global_holdout_var', variables: [] }], + trafficAllocation: [{ entityId: 'global_holdout_var_id', endOfRange: 10000 }], + }]; + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'global_holdout_id') { + return { result: 'global_holdout_var_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === '3002') { + return { result: '5005', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + const globalHit = { + experiment: config.holdoutIdMap!['global_holdout_id'], + variation: config.variationIdMap['global_holdout_var_id'], + }; + expect(value[0].result.experiment?.id).toBe('3002'); + expect(value[0].result.holdouts).toEqual([globalHit, localHit(config)]); + }); + + it('when several local holdouts match one rule only the first is recorded', async () => { + const datafile = makeLocalHoldoutDatafile('2001'); + (datafile as any).localHoldouts.push({ + ...(datafile as any).localHoldouts[0], + id: 'local_holdout_2_id', + key: 'local_holdout_2', + variations: [{ id: 'local_holdout_2_variation_id', key: 'local_holdout_2_variation', variables: [] }], + trafficAllocation: [{ entityId: 'local_holdout_2_variation_id', endOfRange: 10000 }], + }); + const config = createProjectConfig(JSON.stringify(datafile)); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === 'local_holdout_id') { + return { result: 'local_holdout_variation_id', reasons: [] }; + } + if (params.experimentId === 'local_holdout_2_id') { + return { result: 'local_holdout_2_variation_id', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1' }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result.holdouts).toEqual([localHit(config)]); + }); + + it('user with no local holdout hit gets no holdout fields on the decision', async () => { + const config = createProjectConfig(JSON.stringify(makeLocalHoldoutDatafile('2001'))); + const { decisionService } = getDecisionService(); + + mockBucket.mockImplementation((params: BucketerParams) => { + if (params.experimentId === '2001') { + return { result: '5001', reasons: [] }; + } + return { result: null, reasons: [] }; + }); + + const user = new OptimizelyUserContext({ optimizely: {} as any, userId: 'user1', attributes: { age: 15 } }); + const feature = config.featureKeyMap['flag_1']; + const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); + + expect(value[0].result).toEqual({ + experiment: config.experimentIdMap['2001'], + variation: config.variationIdMap['5001'], + decisionSource: DECISION_SOURCES.FEATURE_TEST, + }); }); it('forced decision beats a 100% traffic local holdout: forced decision takes precedence over local holdout', async () => { @@ -3288,10 +3502,9 @@ describe('DecisionService', () => { const feature = config.featureKeyMap['flag_1']; const value = await decisionService.resolveVariationsForFeatureList('async', config, [feature], user, {}).get(); - // Local holdout applies normally even with excludeTargetedDeliveries set - expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.HOLDOUT); - expect(value[0].result.experiment?.id).toBe('local_holdout_id'); - expect(value[0].result.variation?.id).toBe('local_holdout_variation_id'); + expect(value[0].result.decisionSource).toBe(DECISION_SOURCES.ROLLOUT); + expect(value[0].result.variation).toBeNull(); + expect(value[0].result.holdouts).toEqual([localHit(config)]); }); }); }); diff --git a/lib/core/decision_service/index.ts b/lib/core/decision_service/index.ts index a7cfc3783..552f84d50 100644 --- a/lib/core/decision_service/index.ts +++ b/lib/core/decision_service/index.ts @@ -126,12 +126,14 @@ export interface DecisionObj { variation: Variation | null; decisionSource: DecisionSource; cmabUuid?: string; - holdout?: { - experiment: Holdout; - variation: Variation; - }; + holdouts?: HoldoutHit[]; } +export type HoldoutHit = { + experiment: Holdout; + variation: Variation; +}; + interface DecisionServiceOptions { userProfileService?: UserProfileService; userProfileServiceAsync?: UserProfileServiceAsync; @@ -970,7 +972,7 @@ export class DecisionService { // getGlobalHoldouts() returns holdouts with includedRules == null/undefined. const globalHoldouts = getGlobalHoldouts(configObj); - let appliedHoldout : DecisionObj['holdout'] | undefined = undefined; + let appliedGlobalHoldout: HoldoutHit | undefined = undefined; for (const holdout of globalHoldouts) { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); @@ -980,7 +982,7 @@ export class DecisionService { if (holdout.excludeTargetedDeliveries) { this.logger?.info(TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key); decideReasons.push([TARGETED_DELIVERY_EXCLUDED_FROM_HOLDOUT, holdout.key]); - appliedHoldout = { + appliedGlobalHoldout = { experiment: holdout, variation: holdoutDecision.result.variation } @@ -994,7 +996,7 @@ export class DecisionService { } } - const experimentDecision: Value = appliedHoldout ? + const experimentDecision: Value = appliedGlobalHoldout ? Value.of(op, { reasons: decideReasons, result: { @@ -1005,9 +1007,13 @@ export class DecisionService { }) : this.getVariationForFeatureExperiment(op, configObj, feature, user, decideOptions, userProfileTracker); return experimentDecision.then((experimentDecision) => { + const holdouts: HoldoutHit[] = appliedGlobalHoldout ? [appliedGlobalHoldout] : []; + holdouts.push(...(experimentDecision.result.holdouts ?? [])); + if (experimentDecision.error || experimentDecision.result.variation !== null) { return Value.of(op, { ...experimentDecision, + result: { ...experimentDecision.result, ...(holdouts.length ? { holdouts } : {}) }, reasons: [...decideReasons, ...experimentDecision.reasons], }); } @@ -1017,6 +1023,7 @@ export class DecisionService { const rolloutDecision = this.getVariationForRollout(configObj, feature, user); decideReasons.push(...rolloutDecision.reasons); const rolloutDecisionResult = rolloutDecision.result; + holdouts.push(...(rolloutDecisionResult.holdouts ?? [])); const userId = user.getUserId(); if (rolloutDecisionResult.variation) { @@ -1027,12 +1034,8 @@ export class DecisionService { decideReasons.push([USER_NOT_IN_ROLLOUT, userId, feature.key]); } - if (appliedHoldout) { - rolloutDecisionResult.holdout = appliedHoldout; - } - return Value.of(op, { - result: rolloutDecisionResult, + result: { ...rolloutDecisionResult, ...(holdouts.length ? { holdouts } : {}) }, reasons: decideReasons, }); }); @@ -1091,7 +1094,7 @@ export class DecisionService { }); } - return this.traverseFeatureExperimentList(op, configObj, feature, 0, user, [], decideOptions, userProfileTracker); + return this.traverseFeatureExperimentList(op, configObj, feature, 0, user, [], [], decideOptions, userProfileTracker); } private traverseFeatureExperimentList( @@ -1101,6 +1104,7 @@ export class DecisionService { fromIndex: number, user: OptimizelyUserContext, decideReasons: DecisionReason[], + holdouts: HoldoutHit[], decideOptions: DecideOptionsMap, userProfileTracker?: UserProfileTracker, ): Value { @@ -1111,6 +1115,7 @@ export class DecisionService { experiment: null, variation: null, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); @@ -1119,7 +1124,7 @@ export class DecisionService { const experiment = getExperimentFromId(configObj, experimentIds[fromIndex], this.logger); if (!experiment) { return this.traverseFeatureExperimentList( - op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); } const experimentResponse = this.getVariationFromExperimentRule( @@ -1129,12 +1134,11 @@ export class DecisionService { return experimentResponse.then((experimentResponse) => { decideReasons.push(...experimentResponse.reasons); - // If a local holdout was hit, return the holdout decision directly (preserves holdout as experiment). if (experimentResponse.holdoutDecision) { - return Value.of(op, { - result: experimentResponse.result, - reasons: decideReasons, - }); + const { experiment: holdout, variation } = experimentResponse.result; + holdouts.push({ experiment: holdout as Holdout, variation: variation as Variation }); + return this.traverseFeatureExperimentList( + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); } if (experimentResponse.error) { @@ -1144,6 +1148,7 @@ export class DecisionService { experiment, variation: null, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); @@ -1151,7 +1156,7 @@ export class DecisionService { if(!experimentResponse.result.variationKey) { return this.traverseFeatureExperimentList( - op, configObj, feature, fromIndex + 1, user, decideReasons, decideOptions, userProfileTracker); + op, configObj, feature, fromIndex + 1, user, decideReasons, holdouts, decideOptions, userProfileTracker); } const variationKey = experimentResponse.result.variationKey; @@ -1166,6 +1171,7 @@ export class DecisionService { experiment, variation, decisionSource: DECISION_SOURCES.FEATURE_TEST, + ...(holdouts.length ? { holdouts } : {}), }, reasons: decideReasons, }); @@ -1230,36 +1236,30 @@ export class DecisionService { }; } + const holdouts: HoldoutHit[] = []; let index = 0; while (index < rolloutRules.length) { const deliveryRuleResponse = this.getVariationFromDeliveryRule(configObj, feature.key, rolloutRules, index, user); decideReasons.push(...deliveryRuleResponse.reasons); - // If a local holdout was hit for this delivery rule, use its decision object directly. if (deliveryRuleResponse.holdoutDecision) { - return { - reasons: decideReasons, - result: deliveryRuleResponse.result, - } + const { experiment: holdout, variation } = deliveryRuleResponse.result; + holdouts.push({ experiment: holdout as Holdout, variation: variation as Variation }); + index++; + continue; } - const variation = deliveryRuleResponse.result; const skipToEveryoneElse = deliveryRuleResponse.skipToEveryoneElse; if (variation) { - // if (decisionVariation.localHoldoutDecision) { - // return { - // result: decisionVariation.localHoldoutDecision, - // reasons: decideReasons, - // }; - // } const rolloutRule = configObj.experimentIdMap[rolloutRules[index].id]; const decisionObj = { experiment: rolloutRule, variation: variation, - decisionSource: DECISION_SOURCES.ROLLOUT + decisionSource: DECISION_SOURCES.ROLLOUT, + ...(holdouts.length ? { holdouts } : {}), }; return { result: decisionObj, @@ -1274,6 +1274,7 @@ export class DecisionService { experiment: null, variation: null, decisionSource: DECISION_SOURCES.ROLLOUT, + ...(holdouts.length ? { holdouts } : {}), }; return { @@ -1641,7 +1642,6 @@ export class DecisionService { const holdoutDecision = this.getVariationForHoldout(configObj, holdout, user); decideReasons.push(...holdoutDecision.reasons); if (holdoutDecision.result.variation) { - // Signal the caller to use the holdout decision directly, preserving the holdout as experiment. return Value.of(op, { result: holdoutDecision.result, reasons: decideReasons, diff --git a/lib/optimizely/index.spec.ts b/lib/optimizely/index.spec.ts index 07f31dcc1..de52df270 100644 --- a/lib/optimizely/index.spec.ts +++ b/lib/optimizely/index.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2024-2025, Optimizely + * Copyright 2024-2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -873,7 +873,7 @@ describe('Optimizely', () => { }); }); - it('should dispatch separate holdout impression when decisionObj.holdout is populated', async () => { + it('should dispatch separate holdout impression when decisionObj.holdouts is populated', async () => { const processSpy = vi.spyOn(eventProcessor, 'process'); const notificationSpyLocal = vi.fn(); optimizely.notificationCenter.addNotificationListener( @@ -893,10 +893,10 @@ describe('Optimizely', () => { variation: rolloutVariation, experiment: rolloutExperiment, decisionSource: DECISION_SOURCES.ROLLOUT, - holdout: { + holdouts: [{ experiment: holdoutExperiment, variation: holdoutVariation, - }, + }], }, reasons: [], }]); @@ -932,6 +932,151 @@ describe('Optimizely', () => { }) ); }); + + describe('local holdouts', () => { + const makeLocalHoldout = (id: string, includedRules: string[]) => ({ + ...JSON.parse(JSON.stringify(holdoutData[0])), + id, + key: `${id}_key`, + includedRules, + variations: [{ id: `${id}_var`, key: `${id}_var_key`, variables: [], featureEnabled: false }], + trafficAllocation: [{ entityId: `${id}_var`, endOfRange: 10000 }], + }); + + const setup = (localHoldouts: any[], sendFlagDecisions = true, cmabService: any = {}, globalHoldouts: any[] = []) => { + const datafile: any = getDecisionTestDatafile(); + datafile.holdouts = globalHoldouts; + datafile.localHoldouts = localHoldouts; + datafile.sendFlagDecisions = sendFlagDecisions; + datafile.experiments.find((e: any) => e.key === 'exp_3').cmab.trafficAllocation = 10000; + const eventProcessor = getForwardingEventProcessor({ + dispatchEvent: vi.fn(() => Promise.resolve({ statusCode: 200 })), + }); + const processSpy = vi.spyOn(eventProcessor, 'process'); + const optimizely = new Optimizely({ + clientEngine: 'node-sdk', + projectConfigManager: getMockProjectConfigManager({ + initConfig: createProjectConfig(JSON.stringify(datafile)), + }), + eventProcessor, + jsonSchemaValidator, + logger, + odpManager, + disposable: true, + cmabService, + }); + const holdoutEvents = () => processSpy.mock.calls + .map((call: any) => call[0] as ImpressionEvent) + .filter((event) => event.ruleType === 'holdout'); + return { optimizely, processSpy, holdoutEvents }; + }; + + const makeUser = (optimizely: any, attributes = {}) => + new OptimizelyUserContext({ optimizely, userId: 'test_user', attributes }); + + it('should send one holdout impression per held-out rule', async () => { + const { optimizely, holdoutEvents } = setup([ + makeLocalHoldout('lh_exp', ['2001']), + makeLocalHoldout('lh_delivery', ['3001']), + ]); + + const decision = await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(decision.ruleKey).toBe('default-rollout-key'); + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_exp_key', 'lh_delivery_key']); + expect(holdoutEvents().every((e) => e.enabled === false)).toBe(true); + }); + + it('should send two holdout impressions when one local holdout targets two held-out rules', async () => { + const { optimizely, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001', '3001'])]); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_key', 'lh_key']); + }); + + it('should send the holdout impression for a delivery-rule hit when sendFlagDecisions is false', async () => { + const { optimizely, processSpy, holdoutEvents } = setup([makeLocalHoldout('lh', ['3001'])], false); + + const decision = await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(decision.ruleKey).toBe('default-rollout-key'); + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['lh_key']); + expect(processSpy).toHaveBeenCalledOnce(); + }); + + it('should not send local holdout impressions when DISABLE_DECISION_EVENT is used', async () => { + const { optimizely, processSpy } = setup([makeLocalHoldout('lh', ['2001', '3001'])]); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', [OptimizelyDecideOption.DISABLE_DECISION_EVENT]); + + expect(processSpy).not.toHaveBeenCalled(); + }); + + it('should return an error decision and send no impressions when a later rule errors after a local holdout hit', async () => { + const cmabService = { getDecision: vi.fn().mockRejectedValue(new Error('cmab fetch failed')) }; + const { optimizely, processSpy } = setup([makeLocalHoldout('lh', ['2001'])], true, cmabService); + const user = new OptimizelyUserContext({ optimizely, userId: 'tester', attributes: { country: 'BD', age: 80 } }); + + const decision = await optimizely.decideAsync(user, 'flag_1', [OptimizelyDecideOption.INCLUDE_REASONS]); + + expect(cmabService.getDecision).toHaveBeenCalledOnce(); + expect(decision.variationKey).toBeNull(); + expect(decision.enabled).toBe(false); + expect(decision.ruleKey).toBeNull(); + expect(decision.reasons).toContain('Failed to fetch CMAB data for experiment exp_3.'); + expect(decision.reasons.some((r) => r.includes('lh_key'))).toBe(true); + expect(processSpy).not.toHaveBeenCalled(); + }); + + it('should skip the held-out rule and send no holdout impression for isFeatureEnabled', () => { + const { optimizely, processSpy, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001'])]); + + const enabled = optimizely.isFeatureEnabled('flag_1', 'test_user', { age: 15 }); + + expect(enabled).toBe(true); + expect(holdoutEvents()).toEqual([]); + expect(processSpy).toHaveBeenCalledOnce(); + expect((processSpy.mock.calls[0][0] as ImpressionEvent).ruleKey).toBe('exp_2'); + }); + + const excludeTDGlobalHoldout = () => ({ + ...JSON.parse(JSON.stringify(holdoutData[0])), + id: 'global_td', + key: 'global_td_key', + excludeTargetedDeliveries: true, + }); + + it('should send the global excludeTargetedDeliveries hit before local delivery-rule hits for decide', async () => { + const { optimizely, holdoutEvents } = setup( + [makeLocalHoldout('lh_delivery', ['3001'])], true, {}, [excludeTDGlobalHoldout()], + ); + + await optimizely.decideAsync(makeUser(optimizely), 'flag_1', []); + + expect(holdoutEvents().map((e) => e.ruleKey)).toEqual(['global_td_key', 'lh_delivery_key']); + }); + + it('should send no holdout impression from legacy APIs for a local hit or an excludeTargetedDeliveries bypass', () => { + const { optimizely, holdoutEvents } = setup( + [makeLocalHoldout('lh_delivery', ['3001'])], true, {}, [excludeTDGlobalHoldout()], + ); + + optimizely.isFeatureEnabled('flag_1', 'test_user', {}); + optimizely.getFeatureVariable('flag_1', 'integer_variable', 'test_user', {}); + optimizely.getAllFeatureVariables('flag_1', 'test_user', {}); + + expect(holdoutEvents()).toEqual([]); + }); + + it('should send no holdout impression from getFeatureVariable for a local experiment-rule hit', () => { + const { optimizely, holdoutEvents } = setup([makeLocalHoldout('lh', ['2001'])]); + + optimizely.getFeatureVariable('flag_1', 'integer_variable', 'test_user', { age: 15 }); + + expect(holdoutEvents()).toEqual([]); + }); + }); }); it('should flush eventProcessor and odpManager on flushImmediately()', async () => { diff --git a/lib/optimizely/index.ts b/lib/optimizely/index.ts index c7277ba65..0d194b08e 100644 --- a/lib/optimizely/index.ts +++ b/lib/optimizely/index.ts @@ -1542,20 +1542,23 @@ export default class Optimizely extends BaseService implements Client { decisionEventDispatched = true; } - if (decisionObj.holdout && !options[OptimizelyDecideOption.DISABLE_DECISION_EVENT]) { - const holdoutDecisionObj: DecisionObj = { - experiment: decisionObj.holdout.experiment, - variation: decisionObj.holdout.variation, - decisionSource: DECISION_SOURCES.HOLDOUT, - }; - this.sendImpressionEvent( - holdoutDecisionObj, - key, - userId, - decision.getFeatureEnabledFromVariation(holdoutDecisionObj), - attributes, - ); - decisionEventDispatched = true; + const holdoutHits = decisionObj.holdouts ?? []; + if (!options[OptimizelyDecideOption.DISABLE_DECISION_EVENT]) { + for (const hit of holdoutHits) { + const holdoutDecisionObj: DecisionObj = { + experiment: hit.experiment, + variation: hit.variation, + decisionSource: DECISION_SOURCES.HOLDOUT, + }; + this.sendImpressionEvent( + holdoutDecisionObj, + key, + userId, + decision.getFeatureEnabledFromVariation(holdoutDecisionObj), + attributes, + ); + decisionEventDispatched = true; + } } const shouldIncludeReasons = options[OptimizelyDecideOption.INCLUDE_REASONS]; From 711e727cf1e9ac9668c5e571bb9d12a242d43a97 Mon Sep 17 00:00:00 2001 From: Jae Kim <45045038+jaeopt@users.noreply.github.com> Date: Tue, 3 Nov 2026 08:46:42 -0800 Subject: [PATCH 31/39] [AI-FSSDK] [FSSDK-13375] prepare for release javascript-sdk v6.7.0 (#1185) --- CHANGELOG.md | 15 +++++++++++++++ lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a8d206f6..97b1ffe56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.7.0] - November 3, 2026 + +### Changed + +**Local Holdouts: rule evaluation continues after a holdout hit**: +When a user matches a local holdout on a rule, the SDK now excludes the user from that rule only +and continues evaluating the remaining rules, instead of returning the holdout variation and skipping +the rest of the flag. Each local holdout hit sends its own holdout impression event (using the +existing event format), regardless of `sendFlagDecisions`. Global holdouts are unchanged. + +- Continue rule evaluation after local holdout hit ([#1181](https://github.com/optimizely/javascript-sdk/pull/1181)) +- Skip the default browser event store when localStorage is unavailable ([#1184](https://github.com/optimizely/javascript-sdk/pull/1184)) +- Make React Native polyfills optional and isolate optional requires ([#1179](https://github.com/optimizely/javascript-sdk/pull/1179)) +- Support AsyncStorage v3 in React Native ([#1178](https://github.com/optimizely/javascript-sdk/pull/1178)) + ## [6.6.1] - September 18, 2026 ### Bug Fixes diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 202c74b4a..4beef2f60 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.6.1'; +export const CLIENT_VERSION = '6.7.0'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index df7474636..b6dbe29ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.6.1", + "version": "6.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.6.1", + "version": "6.7.0", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index a35802d9d..8bdece775 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.6.1", + "version": "6.7.0", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From 95422f58a23a15cbbd864e6ad396ae61acd5177c Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Fri, 6 Nov 2026 21:04:27 +0600 Subject: [PATCH 32/39] [FSSDK-13402] Replace rollup with rolldown (#1172) ## Summary - This replaces `rollup` with `rolldown` which has functionalities of most of the rollup plugins we use built-in, and much faster bundling time. --- .github/workflows/javascript.yml | 14 +- lib/import.react_native/README.md | 13 +- package-lock.json | 514 +++++++++++++---------- package.json | 15 +- rollup.config.mjs => rolldown.config.mjs | 260 ++++++------ scripts/run-cjs-example.js | 37 +- tests/react-native-metro/run.mjs | 2 +- 7 files changed, 472 insertions(+), 383 deletions(-) rename rollup.config.mjs => rolldown.config.mjs (58%) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 2ccda8115..b67e4da8c 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -46,16 +46,22 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Set up Node + - name: Set up Node 20 (build) uses: actions/setup-node@v3 with: - node-version: '18' + node-version: 20 cache-dependency-path: ./package-lock.json cache: 'npm' - - name: Run CommonJS example + - name: Build and pack SDK run: | npm install - npm run test-commonjs + npm pack + - name: Set up Node 18 (runtime test) + uses: actions/setup-node@v3 + with: + node-version: '18' + - name: Run CommonJS example + run: npm run test-commonjs -- --skip-build react_native_metro_test: runs-on: ubuntu-latest diff --git a/lib/import.react_native/README.md b/lib/import.react_native/README.md index af5893935..2819dc66f 100644 --- a/lib/import.react_native/README.md +++ b/lib/import.react_native/README.md @@ -2,7 +2,7 @@ Each file in this directory loads one optional React Native dependency (a peer dependency the app may not have installed) and tells the rest of the SDK whether it is available. -The shims are not bundled into the main SDK bundle. Rollup builds each one to the same path under `dist/import.react_native/`, and the main React Native bundles `require` it by relative path (see `rollup.config.mjs`). The rest of this section explains why. +The shims are not bundled into the main SDK bundle. Rolldown builds each one to the same path under `dist/import.react_native/`, and the main React Native bundles `require` it by relative path (see `rolldown.config.mjs`). The rest of this section explains why. ## Why the shims are separate modules @@ -78,18 +78,17 @@ A test goes next to its shim as `.spec.ts`. Spec files are not built as sh - **The package's exports, under the same names:** if the package isn't installed they are `undefined`. A shim may adapt a value as long as it keeps the package's shape. For example, the async-storage shim adds `multiGet` on AsyncStorage v3. - **Only the exports the SDK uses:** this isn't required for correctness. Re-exporting more would still be one `require`. It just keeps the shims small. - **Packages loaded only for side effects:** polyfills like `fast-text-encoding` only need `isAvailable`. -- **A shim can use `export default` when the package has a default export,** as the async-storage shim does. This works because of a setting in `rollup.config.mjs`: +- **A shim can use `export default` when the package has a default export,** as the async-storage shim does: - Shims are built as CommonJS. A default export becomes `exports.default`, and the file is marked with `__esModule`. - - In the main CJS bundles, Rollup by default treats a default import from an external CommonJS module as the whole `module.exports`. `import AsyncStorage from '…/async-storage'` would then get the shim's exports object instead of the storage. - - `rollup.config.mjs` therefore sets `interop: 'esModule'` for shim imports, so the CJS bundles read `exports.default`. - - Shims are only built as CommonJS; the ESM main bundle imports the same CommonJS files. It doesn't need the setting: the app's bundler (Metro, or webpack) reads `exports.default` for a default import from a CommonJS module marked with `__esModule`. + - In the main CJS bundles, Rolldown wraps a `require` of an external CommonJS module in its `__toESM` helper, which reads `exports.default` for a default import when the module is marked with `__esModule`. `import AsyncStorage from '…/async-storage'` therefore gets the storage, not the shim's exports object. (Rollup needed `interop: 'esModule'` for this; Rolldown needs no setting.) + - Shims are only built as CommonJS; the ESM main bundle imports the same CommonJS files. The app's bundler (Metro, or webpack) reads `exports.default` for a default import from a CommonJS module marked with `__esModule`. - **Never throw.** A shim catches the `require` error, sets `isAvailable = false`, and leaves its exports `undefined`. The importer decides what a missing package means. For example, `index.react_native.ts` throws if `TextEncoder` is still missing after the polyfill shims run, and `AsyncStorageCache` throws "Module not found" when there's no AsyncStorage. ### Exactly one `require` in the built file The optional `require` must be the only `require` in the built shim (`dist/import.react_native/.js`). Any other `require` in the module could shift when the optional package is missing. -**The build enforces this.** The `rn-import-shim-check` plugin in `rollup.config.mjs` fails the build if a built shim contains any `require` other than its own package's. The package is taken from the shim's name, so the check also enforces the naming convention. +**The build enforces this.** The `rn-import-shim-check` plugin in `rolldown.config.mjs` fails the build if a built shim contains any `require` other than its own package's. The package is taken from the shim's name, so the check also enforces the naming convention. - **Wrap the `require` directly in `try/catch`.** Metro only treats a `require` as optional when it is directly inside a `try` block. Without that, a missing package fails the app's build. - **Run it at module load, not later in a function.** Only then is a failed `require` thrown to the shim's `catch`. Later, Metro before 0.82.5 reports it as a fatal error instead (see "The bug in Metro before 0.82.5"). @@ -122,4 +121,4 @@ try { export const __platforms: Platform[] = ['react_native']; ``` -Importers use a shim through a normal relative import, for example `import { isAvailable, someExport } from './import.react_native/some-package'`. The Rollup plugin turns that into the relative `require` of the built shim. +Importers use a shim through a normal relative import, for example `import { isAvailable, someExport } from './import.react_native/some-package'`. The `rn-import-shim-external` plugin in `rolldown.config.mjs` turns that into the relative `require` of the built shim. diff --git a/package-lock.json b/package-lock.json index b6dbe29ae..20094c47e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,10 +17,6 @@ "devDependencies": { "@react-native-async-storage/async-storage": "^2", "@react-native-community/netinfo": "^11.3.2", - "@rollup/plugin-alias": "^6.0.0", - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^0.4.4", "@types/chai": "^4.2.11", "@types/mocha": "^5.2.7", "@types/nise": "^1.4.0", @@ -44,8 +40,7 @@ "nock": "11.9.1", "nyc": "^15.0.1", "prettier": "^1.19.1", - "promise-polyfill": "8.1.0", - "rollup": "^4.55.1", + "rolldown": "^1.2.16", "sinon": "^2.3.1", "ts-loader": "^9.3.1", "ts-node": "^10.9.2", @@ -1704,6 +1699,16 @@ "node": ">= 8" } }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -2073,122 +2078,268 @@ } } }, - "node_modules/@rollup/plugin-alias": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-6.0.0.tgz", - "integrity": "sha512-tPCzJOtS7uuVZd+xPhoy5W4vThe6KWXNmsFCNktaAh5RTqcLiSfT4huPQIXkgJ6YCOjJHvecOAzQxLFhPxKr+g==", + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", + "integrity": "sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=20.19.0" - }, - "peerDependencies": { - "rollup": ">=4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-commonjs": { - "version": "29.0.0", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-29.0.0.tgz", - "integrity": "sha512-U2YHaxR2cU/yAiwKJtJRhnyLk7cifnQw0zUpISsocBDoHDJn+HTV74ABqnwr5bEgWUwFZC9oFL6wLe21lHu5eQ==", + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz", + "integrity": "sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "commondir": "^1.0.1", - "estree-walker": "^2.0.2", - "fdir": "^6.2.0", - "is-reference": "1.2.1", - "magic-string": "^0.30.3", - "picomatch": "^4.0.2" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=16.0.0 || 14 >= 14.17" - }, - "peerDependencies": { - "rollup": "^2.68.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-node-resolve": { - "version": "16.0.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-16.0.3.tgz", - "integrity": "sha512-lUYM3UBGuM93CnMPG1YocWu7X802BrNF3jW2zny5gQyLQgRFJhV1Sq0Zi74+dh/6NBx1DxFC4b4GXg9wUCG5Qg==", + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz", + "integrity": "sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@rollup/pluginutils": "^5.0.1", - "@types/resolve": "1.20.2", - "deepmerge": "^4.2.2", - "is-module": "^1.0.0", - "resolve": "^1.22.1" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.78.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/plugin-terser": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", - "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz", + "integrity": "sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "serialize-javascript": "^6.0.1", - "smob": "^1.0.0", - "terser": "^5.17.4" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" } }, - "node_modules/@rollup/pluginutils": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.3.0.tgz", - "integrity": "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==", + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz", + "integrity": "sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0", - "estree-walker": "^2.0.2", - "picomatch": "^4.0.2" - }, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" - }, - "peerDependenciesMeta": { - "rollup": { - "optional": true - } + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz", + "integrity": "sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz", + "integrity": "sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz", + "integrity": "sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz", + "integrity": "sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz", + "integrity": "sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" } }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz", + "integrity": "sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz", + "integrity": "sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz", + "integrity": "sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz", + "integrity": "sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz", + "integrity": "sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.55.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.55.1.tgz", @@ -2820,13 +2971,6 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/resolve": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", - "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/semver": { "version": "7.7.1", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", @@ -5241,16 +5385,6 @@ "dev": true, "license": "MIT" }, - "node_modules/deepmerge": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", - "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/deepmerge-ts": { "version": "7.1.5", "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-7.1.5.tgz", @@ -6020,13 +6154,6 @@ "node": ">=4.0" } }, - "node_modules/estree-walker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", - "dev": true, - "license": "MIT" - }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -6514,16 +6641,6 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/geckodriver": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-6.1.0.tgz", @@ -6872,19 +6989,6 @@ "node": ">=8" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -7208,22 +7312,6 @@ "node": ">=8" } }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-docker": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", @@ -7274,13 +7362,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", - "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", - "dev": true, - "license": "MIT" - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -7311,16 +7392,6 @@ "node": ">=8" } }, - "node_modules/is-reference": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "*" - } - }, "node_modules/is-running": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", @@ -9771,13 +9842,6 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "license": "MIT" - }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", @@ -10091,13 +10155,6 @@ "asap": "~2.0.6" } }, - "node_modules/promise-polyfill": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.1.0.tgz", - "integrity": "sha512-OzSf6gcCUQ01byV4BgwyUCswlaQQ6gzXc23aLQWhicvfX9kfsUiUhgt3CCQej8jDnl8/PhGF31JdHX2/MzF3WA==", - "dev": true, - "license": "MIT" - }, "node_modules/propagate": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", @@ -10586,27 +10643,6 @@ "dev": true, "license": "ISC" }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -10679,6 +10715,40 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rolldown": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.16.tgz", + "integrity": "sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.16", + "@rolldown/binding-android-arm64": "1.2.16", + "@rolldown/binding-darwin-arm64": "1.2.16", + "@rolldown/binding-darwin-x64": "1.2.16", + "@rolldown/binding-freebsd-x64": "1.2.16", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.16", + "@rolldown/binding-linux-arm64-gnu": "1.2.16", + "@rolldown/binding-linux-arm64-musl": "1.2.16", + "@rolldown/binding-linux-ppc64-gnu": "1.2.16", + "@rolldown/binding-linux-s390x-gnu": "1.2.16", + "@rolldown/binding-linux-x64-gnu": "1.2.16", + "@rolldown/binding-linux-x64-musl": "1.2.16", + "@rolldown/binding-openharmony-arm64": "1.2.16", + "@rolldown/binding-win32-arm64-msvc": "1.2.16", + "@rolldown/binding-win32-x64-msvc": "1.2.16" + } + }, "node_modules/rollup": { "version": "4.55.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.55.1.tgz", @@ -11179,13 +11249,6 @@ "npm": ">= 3.0.0" } }, - "node_modules/smob": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", - "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", - "dev": true, - "license": "MIT" - }, "node_modules/socks": { "version": "2.8.7", "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz", @@ -11541,19 +11604,6 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/tapable": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.0.tgz", diff --git a/package.json b/package.json index 8bdece775..dffdf21f3 100644 --- a/package.json +++ b/package.json @@ -73,11 +73,11 @@ "posttest": "npm run lint", "test-ci": "npm run test", "prebuild": "npm run clean", - "build": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && cp dist/index.browser.d.ts dist/index.d.ts", - "build:win": "npm run validate-platform-isolation && npm run genmsg && tsc && rollup -c rollup.config.mjs && copy dist\\index.browser.d.ts dist\\index.d.ts", - "build-browser-umd": "tsc && rollup -c rollup.config.mjs --config-umd", + "build": "npm run validate-platform-isolation && npm run genmsg && tsc && rolldown -c rolldown.config.mjs && cp dist/index.browser.d.ts dist/index.d.ts", + "build:win": "npm run validate-platform-isolation && npm run genmsg && tsc && rolldown -c rolldown.config.mjs && copy dist\\index.browser.d.ts dist\\index.d.ts", + "build-browser-umd": "npm run genmsg && tsc && rolldown -c rolldown.config.mjs -- --config-umd", "coveralls": "nyc --reporter=lcov npm test", - "prepare": "npm run build", + "prepack": "npm run build", "prepublishOnly": "npm test", "genmsg": "./scripts/generate-messages.js ./lib/message/error_message.ts ./lib/message/log_message.ts", "test-typescript": "node ./scripts/run-ts-example.js", @@ -107,10 +107,6 @@ "devDependencies": { "@react-native-async-storage/async-storage": "^2", "@react-native-community/netinfo": "^11.3.2", - "@rollup/plugin-alias": "^6.0.0", - "@rollup/plugin-commonjs": "^29.0.0", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-terser": "^0.4.4", "@types/chai": "^4.2.11", "@types/mocha": "^5.2.7", "@types/nise": "^1.4.0", @@ -134,8 +130,7 @@ "nock": "11.9.1", "nyc": "^15.0.1", "prettier": "^1.19.1", - "promise-polyfill": "8.1.0", - "rollup": "^4.55.1", + "rolldown": "^1.2.16", "sinon": "^2.3.1", "ts-loader": "^9.3.1", "ts-node": "^10.9.2", diff --git a/rollup.config.mjs b/rolldown.config.mjs similarity index 58% rename from rollup.config.mjs rename to rolldown.config.mjs index aeca0502d..8ea0c7c7a 100644 --- a/rollup.config.mjs +++ b/rolldown.config.mjs @@ -14,10 +14,6 @@ * limitations under the License. */ -import commonjs from '@rollup/plugin-commonjs'; -import nodeResolve from '@rollup/plugin-node-resolve'; -import terser from '@rollup/plugin-terser'; -import alias from '@rollup/plugin-alias'; import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { readdirSync } from 'fs'; @@ -29,29 +25,11 @@ const __dirname = dirname(__filename); const require = createRequire(import.meta.url); const { dependencies, peerDependencies } = require('./package.json'); -const resolvePlugin = nodeResolve(); - -const resolvePluginNode = nodeResolve({ - exportConditions: ['node'], -}); - -const resolvePluginBrowser = nodeResolve({ - browser: true, - exportConditions: ['browser'], -}); - -const resolvePluginByPlatform = { - node: resolvePluginNode, - browser: resolvePluginBrowser, +const aliasEntries = { + 'error_message': join(__dirname, '.build/message/error_message.gen.js'), + 'log_message': join(__dirname, '.build/message/log_message.gen.js'), }; -const aliasPlugin = alias({ - entries: [ - { find: 'error_message', replacement: join(__dirname, '.build/message/error_message.gen.js') }, - { find: 'log_message', replacement: join(__dirname, '.build/message/log_message.gen.js') }, - ] -}); - const externalDeps = ['https', 'http', 'url'].concat(Object.keys({ ...dependencies, ...peerDependencies } || {})); // uuid@13 is ESM-only and does not provide a CommonJS export. @@ -59,6 +37,16 @@ const externalDeps = ['https', 'http', 'url'].concat(Object.keys({ ...dependenci // into the CJS output instead of leaving it as an external dependency. const externalDepsWithoutUuid = externalDeps.filter(dep => dep !== 'uuid'); +// Every bundle sets the output syntax target, matching tsconfig.json's target (ES6). The input is already ES6 +// (compiled by tsc), but Rolldown's minifier defaults to the newest syntax and would rewrite compiled code back +// into later syntax, e.g. `a == null ? void 0 : a.b` into `a?.b` (ES2020). Rolldown doesn't read the target from +// tsconfig.json. +const transform = { target: 'es2015' }; + +// CJS and UMD outputs set `strict: true`. Rolldown otherwise adds "use strict" only when the source has the +// directive, and tsc's ES module output has none (modules are always strict), so the bundles would run in sloppy +// mode. The Rollup bundles were strict. + // React Native optional import shims (lib/import.react_native) are not bundled into the main bundles. // Each is shipped as its own module at the same relative location in dist, because Metro before 0.82.5 // shifts every later require in a module when an optional dependency is missing. @@ -81,9 +69,13 @@ const RN_IMPORT_SHIMS = listShims(); // -> require("./import.react_native/@react-native-async-storage/async-storage.js") (in dist/index.react_native.min.js) // The bundles are at the root of dist and the shims are built to dist/import.react_native, // so that path points to the built shim. -// Marking the imports external via the `external` option is not enough: Rollup would resolve them to the -// file in .build and write a path from the bundle back into .build (../.build/import.react_native/...). -// Returning a relative id from resolveId makes Rollup write it exactly as given. +// Marking the imports external via the `external` option is not enough: the bundler would resolve them to +// the file in .build and write a path from the bundle back into .build (../.build/import.react_native/...). +// Returning a relative id from resolveId makes the bundler write it exactly as given. +// +// Shims are built as CommonJS with __esModule set, so a default import of a shim must read its `default` +// export. Rolldown's CJS interop for externals (__toESM) already does that for modules with __esModule set, +// so no per-import interop override is needed (Rollup needed `output.interop: 'esModule'` for these). const rnImportShimExternalPlugin = { name: 'rn-import-shim-external', resolveId(source, importer) { @@ -94,15 +86,11 @@ const rnImportShimExternalPlugin = { }, }; -// Shims are built as CommonJS with __esModule set, so a default import of a shim must read its `default` -// export ('esModule'). Rollup's 'default' interop, used for the other externals, would read the whole module. -const rnImportShimInterop = id => (id && id.startsWith(`./${RN_IMPORT_SHIM_DIR}/`) ? 'esModule' : 'default'); - // Fails the build unless every built shim contains exactly one require(), of its own package (the shim's // name). Any other require in a shim could be shifted by the Metro bug when the package is missing. This -// catches imports of other packages, tslib helpers, and code shared between shims (Rollup moves it into a -// shared chunk that the shims require). The shim's own require() is plain code, so Rollup doesn't list it in -// chunk.imports; the generated code is parsed instead, with Rollup's parser. +// catches imports of other packages, tslib helpers, and code shared between shims (the bundler moves it into +// a shared chunk that the shims require). The shim's own require() is plain code, so it isn't listed in +// chunk.imports; the generated code is parsed instead, with the bundler's parser. const rnImportShimCheckPlugin = { name: 'rn-import-shim-check', generateBundle(_, bundle) { @@ -137,149 +125,180 @@ const rnImportShimCheckPlugin = { }; const rnImportShimsBundle = { - plugins: [rnImportShimCheckPlugin], - external: externalDeps, input: Object.fromEntries( RN_IMPORT_SHIMS.map(name => [name, join(BUILD_DIR, RN_IMPORT_SHIM_DIR, `${name}.js`)]) ), output: { exports: 'named', format: 'cjs', + strict: true, dir: join('dist', RN_IMPORT_SHIM_DIR), entryFileNames: '[name].js', }, + plugins: [rnImportShimCheckPlugin], + transform, + external: externalDeps, }; -const cjsBundleFor = (platform, opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; +// Every bundle sets `platform` explicitly. Rolldown otherwise defaults it to 'node' for cjs output and +// 'browser' for other formats, and always adds that platform's export condition, even when conditionNames +// is set. A browser cjs bundle would then resolve the 'node' condition and pull Node-only builds of bundled +// deps (e.g. uuid's dist-node, which requires node:crypto). `platform` also sets the default mainFields, +// and only 'browser' applies the package.json `browser` field's file mappings (aliasFields). +const rolldownPlatformFor = (platform) => { + switch (platform) { + case 'node': + return 'node'; + case 'browser': + return 'browser'; + default: + return 'neutral'; + } +}; +// Resolution on top of each platform's defaults. Rolldown adds 'import'/'require' (by import kind) and +// 'default' to conditionNames on every platform. +// - node, browser: the platform defaults are used as is ('node' or 'browser' plus 'module' conditions; +// mainFields ['main', 'module'] for node, ['browser', 'module', 'main'] and `browser` field mappings +// for browser). +// - react_native: resolves like Metro, which reads the `react-native` and `browser` fields (entry points +// and file mappings, `react-native` first) and the 'react-native' condition. +// - neutral (universal and the platform-independent bundles): unlike node and browser, the platform +// doesn't add the 'module' condition (it only has 'import'/'require' and 'default'), and its mainFields +// default is empty, so a package without an `exports` map would not resolve at all. 'module' and +// ['module', 'main'] match Rollup's plain nodeResolve(), which these bundles used. +const resolveForPlatform = (platform) => { + const base = { alias: aliasEntries }; + switch (platform) { + case 'node': + case 'browser': + return base; + case 'react_native': + return { + ...base, + conditionNames: ['react-native', 'module'], + mainFields: ['react-native', 'browser', 'module', 'main'], + aliasFields: [['react-native'], ['browser']], + }; + default: + return { ...base, conditionNames: ['module'], mainFields: ['module', 'main'] }; + } +}; + +const cjsBundleFor = (platform, opt = {}) => { + const { minify = true, ext = '.js' } = opt; const min = minify ? '.min' : ''; return { - plugins: [rnImportShimExternalPlugin, aliasPlugin, resolvePluginByPlatform[platform] || resolvePlugin, commonjs()], - external: externalDepsWithoutUuid, - input: `.build/index.${platform}.js`, + input: `./.build/index.${platform}.js`, output: { exports: 'named', format: 'cjs', + strict: true, file: `dist/index.${platform}${min}${ext}`, - interop: rnImportShimInterop, - plugins: minify ? [terser()] : undefined, sourcemap: true, + minify, }, - } -}; - -const esmBundleFor = (platform, opt) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, + plugins: [rnImportShimExternalPlugin], + transform, + platform: rolldownPlatformFor(platform), + resolve: resolveForPlatform(platform), + external: externalDepsWithoutUuid, }; +}; +const esmBundleFor = (platform, opt = {}) => { + const { minify = true, ext = '.js' } = opt; const min = minify ? '.min' : ''; return { ...cjsBundleFor(platform), external: externalDeps, - output: [ - { - format: 'es', - file: `dist/index.${platform}.es${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - ], - } + output: { + format: 'es', + file: `dist/index.${platform}.es${min}${ext}`, + sourcemap: true, + minify, + }, + }; }; const cjsBundleForUAParser = (opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - + const { minify = true, ext = '.js' } = opt; const min = minify ? '.min' : ''; return { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: externalDepsWithoutUuid, - input: `.build/odp/ua_parser/ua_parser.js`, + input: `./.build/odp/ua_parser/ua_parser.js`, output: { exports: 'named', format: 'cjs', + strict: true, file: `dist/ua_parser${min}${ext}`, - plugins: minify ? [terser()] : undefined, sourcemap: true, + minify, }, + transform, + platform: rolldownPlatformFor('neutral'), + resolve: resolveForPlatform('neutral'), + external: externalDepsWithoutUuid, }; }; const esmBundleForUAParser = (opt = {}) => { - const { minify, ext } = { - minify: true, - ext: '.js', - ...opt, - }; - + const { minify = true, ext = '.js' } = opt; const min = minify ? '.min' : ''; return { ...cjsBundleForUAParser(), external: externalDeps, - output: [ - { - format: 'es', - file: `dist/ua_parser.es${min}${ext}`, - plugins: minify ? [terser()] : undefined, - sourcemap: true, - }, - ], + output: { + format: 'es', + file: `dist/ua_parser.es${min}${ext}`, + sourcemap: true, + minify, + }, }; }; +const jsonSchemaBundle = { + input: './.build/utils/json_schema_validator/index.js', + output: { + exports: 'named', + format: 'cjs', + strict: true, + file: 'dist/optimizely.json_schema_validator.min.js', + sourcemap: true, + minify: true, + }, + transform, + platform: rolldownPlatformFor('neutral'), + resolve: resolveForPlatform('neutral'), + external: ['json-schema'], +}; + const umdBundle = { - plugins: [ - aliasPlugin, - resolvePluginBrowser, - commonjs(), - ], - input: '.build/index.browser.js', + input: './.build/index.browser.js', output: [ { name: 'optimizelySdk', format: 'umd', + strict: true, file: 'dist/optimizely.browser.umd.js', exports: 'named', }, { name: 'optimizelySdk', format: 'umd', + strict: true, file: 'dist/optimizely.browser.umd.min.js', exports: 'named', - plugins: [terser()], + minify: true, sourcemap: true, }, ], -}; - -// A separate bundle for json schema validator. -const jsonSchemaBundle = { - plugins: [aliasPlugin, resolvePlugin, commonjs()], - external: ['json-schema'], - input: '.build/utils/json_schema_validator/index.js', - output: { - exports: 'named', - format: 'cjs', - file: 'dist/optimizely.json_schema_validator.min.js', - plugins: [terser()], - sourcemap: true, - }, + transform, + platform: rolldownPlatformFor('browser'), + resolve: resolveForPlatform('browser'), }; const bundles = { @@ -300,18 +319,15 @@ const bundles = { // Collect all --config-* options and return the matching bundle configs // Builds all bundles if no --config-* option given -// --config-cjs will build all three cjs-* bundles -// --config-umd will build only the umd bundle +// --config-cjs will build all cjs-* bundles +// --config-umd will build only the umd bundle (both the plain and minified outputs) // --config-umd --config-json will build both umd and the json-schema bundles -export default args => { - const patterns = Object.keys(args) - .filter(arg => arg.startsWith('config-')) - .map(arg => arg.replace(/config-/, '')); +const patterns = process.argv + .filter(arg => arg.startsWith('--config-')) + .map(arg => arg.replace(/^--config-/, '')); - // default to matching all bundles - if (!patterns.length) patterns.push(/.*/); +if (!patterns.length) patterns.push(/.*/); - return Object.entries(bundles) - .filter(([name, config]) => patterns.some(pattern => name.match(pattern))) - .map(([name, config]) => config); -}; +export default Object.entries(bundles) + .filter(([name]) => patterns.some(pattern => name.match(pattern))) + .map(([, config]) => config); diff --git a/scripts/run-cjs-example.js b/scripts/run-cjs-example.js index fa213d54c..60d275549 100644 --- a/scripts/run-cjs-example.js +++ b/scripts/run-cjs-example.js @@ -53,16 +53,39 @@ function runQuiet(command, cwd) { } } +// The tarball `npm pack` creates for the current package version, e.g. +// @optimizely/optimizely-sdk@6.7.0 -> optimizely-optimizely-sdk-6.7.0.tgz. +// Only this exact file is used, so a leftover archive of another version is never tested (or deleted). +function findTarball() { + const { name, version } = require(path.join(rootDir, 'package.json')); + const fileName = `${name.replace(/^@/, '').replace(/\//g, '-')}-${version}.tgz`; + const tarballPath = path.join(rootDir, fileName); + if (!fs.existsSync(tarballPath)) { + console.error(`SDK tarball ${fileName} not found. Run \`npm pack\` first.`); + process.exit(1); + } + return tarballPath; +} + function main() { + const skipBuild = process.argv.includes('--skip-build'); + console.log('=== Building SDK and Running CommonJS Example ===\n'); - console.log('Installing SDK dependencies...'); - run('npm install', rootDir); + let tarballPath; + + if (skipBuild) { + console.log('Skipping build (--skip-build), using existing tarball...'); + tarballPath = findTarball(); + } else { + console.log('Installing SDK dependencies...'); + run('npm install', rootDir); - console.log('\nPacking SDK tarball...'); - const packOutput = runQuiet('npm pack', rootDir); - const tarballPath = path.join(rootDir, packOutput); - console.log(`Created: ${packOutput}`); + console.log('\nPacking SDK tarball...'); + const packOutput = runQuiet('npm pack', rootDir); + tarballPath = path.join(rootDir, packOutput); + console.log(`Created: ${packOutput}`); + } console.log('\nInstalling SDK tarball in cjs-example...'); run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); @@ -72,7 +95,7 @@ function main() { console.log('\nCleaning up tarball...'); fs.unlinkSync(tarballPath); - console.log(`Removed: ${packOutput}`); + console.log(`Removed: ${path.basename(tarballPath)}`); console.log('\n=== Example completed successfully! ===\n'); } diff --git a/tests/react-native-metro/run.mjs b/tests/react-native-metro/run.mjs index 42b277502..e011d697f 100644 --- a/tests/react-native-metro/run.mjs +++ b/tests/react-native-metro/run.mjs @@ -53,7 +53,7 @@ function installSdk() { if (tarball) { tarball = path.resolve(tarball); } else { - // npm pack runs the package's prepare script (the build), as npm publish does. + // npm pack runs the package's prepack script (the build), as npm publish does. const packDir = fs.mkdtempSync(path.join(os.tmpdir(), 'rn-metro-test-')); const name = run('npm', ['pack', '--silent', '--pack-destination', packDir], REPO_ROOT).trim().split('\n').pop(); tarball = path.join(packDir, name); From 525e71d788d2a4d931213e22787870b67ad97546 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Fri, 6 Nov 2026 22:58:13 +0600 Subject: [PATCH 33/39] [FSSDK-13413] Run browser tests with Vitest 5 (#1186) ## Summary Vitest browser mode is not stable in version 3. It fails frequently in CI, is very slow and also requires hacky modification to files in node_modules. This PR runs the tests using vitest@5 in a separate subproject. The root project stays on Vitest 3 so the Node tests keep running on Node 18. - Add `tests/browser`, a standalone Vitest 5 project that runs the same browser and UMD spec files from `lib/` in real browsers, locally or on BrowserStack. It has its own `package.json`/lockfile, configs and runner (`run.js`). - Point CI's `browser_tests` job at it. The job now uses Node 22 (Vitest 5 needs 22.12+), installs root deps, runs `npm ci` in `tests/browser`, then `npm run test-browser`. Matrix and secrets are unchanged. - Run the UMD tests in CI again (`npm run test-umd` in `tests/browser`, as a step in the same job). It builds the UMD bundle and tests it in the same browsers, and runs even if the browser tests fail. The old UMD job was commented out. - Make the `backoff_retry_runner` cancel test deterministic. It depended on how many microtask ticks an `await` takes, which differs on Safari 15. It now uses `ConstantBackoff(100)` and stops the last iteration 10ms short of the retry, so the cancel lands while the retry is waiting on a fake timer. The expected count is still 6. Changes needed for the same specs to pass on Vitest 5 (details in `tests/browser/README.md` and comments in `vitest.shared.mts`): - **`isolate: true`.** With shared iframes, a module loaded unmocked by one file stays unmocked for later files under Vitest 5. - **`browser.importMapMocks: false`.** Always mock by request interception, as Vitest 3 does and as old browsers require. - **`clearMocks: false` + `vitest3-compat.setup.ts`.** Vitest 5 defaults `clearMocks` to true, and `vi.restoreAllMocks()` no longer resets `vi.fn()` mocks. The specs rely on the Vitest 3 behavior of both. - **Polyfills for `Array.prototype.at`, `findLast(Index)` and `Object.hasOwn`**, injected into both the orchestrator page (`browser.orchestratorScripts`) and the test iframe. Vitest 5's browser runtime calls them, and Edge 89/90 and Firefox 91 lack them. Without the polyfills, those runs hang until the connect timeout. `lib/` doesn't use these functions, so the polyfills can't hide an SDK issue today. - **Oxc target set to the oldest tested browsers instead of `es2015`.** Vite 8 replaces esbuild with Oxc, and Vitest 5's mock modules use top-level `await` and string export names, which can't be compiled down to ES2015. Dependencies are still compiled to ES2015 via Rolldown. - **`lightningcss` is replaced by an empty local stub** (`tests/browser/stubs/lightningcss`, via `overrides`). It is MPL-2.0, which license policy doesn't allow. Vite 8 depends on it but only loads it lazily for `css.transformer: 'lightningcss'` or CSS minification in production builds, neither of which happens under Vitest. If anything ever loads it, the stub throws a clear error. This also removes its 11 platform binaries. - **No viewport patch.** Vitest 5 falls back to classic WebDriver's `setWindowSize`. - **UMD plugin and console capture use `transformIndexHtml`.** Patching the response doesn't reach the tester page under Vitest 5. - **Tunnels start without `force: true`, with a unique `localIdentifier`.** Runs can go in parallel, one per browser. - **Small runner fixes.** - Tunnel startup errors now fail the run with exit 1. Previously they were swallowed and the run exited 0 with no tests run. - `USE_LOCAL_BROWSER` is passed to Vitest when credentials are missing. - Extra arguments are passed through to Vitest (e.g. `--reporter=verbose `). - Set `WDIO_LOG_LEVEL` to see webdriverio's commands. Type tests (`*.test-d.ts`) are not run in this project. They run `tsc` in Node, and the root `npm test` already covers them. --------- Co-authored-by: Claude Opus 5.5 --- .github/workflows/javascript.yml | 28 +- .../executor/backoff_retry_runner.spec.ts | 10 +- tests/browser/README.md | 36 + tests/browser/console-capture-plugin.ts | 37 + tests/browser/legacy-polyfills-plugin.ts | 102 + tests/browser/package-lock.json | 4343 +++++++++++++++++ tests/browser/package.json | 27 + tests/browser/run.js | 293 ++ tests/browser/stubs/lightningcss/index.js | 25 + tests/browser/stubs/lightningcss/package.json | 8 + tests/browser/umd-plugin.ts | 37 + tests/browser/vitest.browser.config.mts | 35 + tests/browser/vitest.shared.mts | 206 + tests/browser/vitest.umd.config.mts | 28 + tests/browser/vitest3-compat.setup.ts | 27 + 15 files changed, 5232 insertions(+), 10 deletions(-) create mode 100644 tests/browser/README.md create mode 100644 tests/browser/console-capture-plugin.ts create mode 100644 tests/browser/legacy-polyfills-plugin.ts create mode 100644 tests/browser/package-lock.json create mode 100644 tests/browser/package.json create mode 100644 tests/browser/run.js create mode 100644 tests/browser/stubs/lightningcss/index.js create mode 100644 tests/browser/stubs/lightningcss/package.json create mode 100644 tests/browser/umd-plugin.ts create mode 100644 tests/browser/vitest.browser.config.mts create mode 100644 tests/browser/vitest.shared.mts create mode 100644 tests/browser/vitest.umd.config.mts create mode 100644 tests/browser/vitest3-compat.setup.ts diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index b67e4da8c..e1d5d6339 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -107,17 +107,33 @@ jobs: TEST_BROWSER: ${{ matrix.browser }} steps: - uses: actions/checkout@v3 + # Runs the browser tests with Vitest 5 from tests/browser (see its README). + # Needs Node 22.23.4+ (Vitest 5 / webdriverio); the root project stays on Vitest 3 for Node 18. - name: Set up Node uses: actions/setup-node@v3 with: - node-version: 20 + node-version: 22 cache: 'npm' - cache-dependency-path: ./package-lock.json - - name: Browser tests - ${{ matrix.browser }} + cache-dependency-path: | + ./package-lock.json + ./tests/browser/package-lock.json + - name: Install SDK dependencies working-directory: . - run: | - npm install - npm run test-browser + run: npm install + - name: Install browser test dependencies + id: browser-deps + working-directory: ./tests/browser + run: npm ci + - name: Browser tests - ${{ matrix.browser }} + working-directory: ./tests/browser + run: npm run test-browser + # Builds the UMD bundle (root build-browser-umd) and tests it in the same browsers. + # Runs even if the browser tests failed, so both results are reported, but not + # if installing dependencies failed (browser-deps is skipped if the SDK install fails). + - name: UMD tests - ${{ matrix.browser }} + if: ${{ !cancelled() && steps.browser-deps.outcome == 'success' }} + working-directory: ./tests/browser + run: npm run test-umd # crossbrowser_and_umd_unit_tests: # runs-on: ubuntu-latest diff --git a/lib/utils/executor/backoff_retry_runner.spec.ts b/lib/utils/executor/backoff_retry_runner.spec.ts index a1dd1f3a3..62a73d80b 100644 --- a/lib/utils/executor/backoff_retry_runner.spec.ts +++ b/lib/utils/executor/backoff_retry_runner.spec.ts @@ -1,6 +1,7 @@ import { vi, describe, it, expect, beforeEach, afterEach } from 'vitest'; import { runWithRetry } from './backoff_retry_runner'; import { advanceTimersByTime } from '../../tests/testUtils'; +import { ConstantBackoff } from '../repeater/repeater'; const exhaustMicrotasks = async (loop = 100) => { for(let i = 0; i < loop; i++) { @@ -116,18 +117,19 @@ describe('runWithRetry', () => { throw new Error('error'); }; - const { result, cancelRetry } = runWithRetry(task, undefined, 100); + const { result, cancelRetry } = runWithRetry(task, new ConstantBackoff(100), 100); for(let i = 0; i < 5; i++) { await exhaustMicrotasks(); - await advanceTimersByTime(0); + // the last iteration stops 10ms short, so the next retry is still waiting on its backoff + await advanceTimersByTime(i < 4 ? 100 : 90); } - + cancelRetry(); for(let i = 0; i < 100; i++) { await exhaustMicrotasks(); - await advanceTimersByTime(0); + await advanceTimersByTime(100); } try { diff --git a/tests/browser/README.md b/tests/browser/README.md new file mode 100644 index 000000000..a59b5592d --- /dev/null +++ b/tests/browser/README.md @@ -0,0 +1,36 @@ +# Browser and UMD tests on Vitest 5 + +Runs the same browser and UMD spec files as the root setup (`npm run test-browser` / `npm run test-umd`), but with Vitest 5 instead of Vitest 3. It's a separate project because the root has to stay on Vitest 3 for Node 18. The root setup is unchanged and still works. + +Requires Node 22.23.4+, 24.22.1+ or 26.12.1+ (the minimums of the locked webdriverio packages; Vitest 5 itself needs 22.12+). + +```sh +cd tests/browser +npm install + +npm run test-browser-local # Chrome on this machine +TEST_BROWSER=firefox npm run test-browser-local # a different local browser +npm run test-umd-local # builds the UMD bundle in the repo root first + +npm run test-browser # BrowserStack if credentials are set, local otherwise +npm run test-umd +``` + +Same environment variables as the root setup: `TEST_BROWSER`, `USE_LOCAL_BROWSER`, `BROWSERSTACK_USERNAME` / `BROWSERSTACK_ACCESS_KEY`, `VITEST_REQUEST_LOGGER`, `VITEST_CONSOLE_CAPTURE`. Same browser matrix as the root setup (see `BROWSER_CONFIGS` in `run.js`). + +Runs can go in parallel, for example one terminal per browser: each run starts its own BrowserStack Local tunnel with a unique identifier. (The root scripts start the tunnel with `force: true`, which kills other tunnels, so they can't run alongside each other or this project.) + +Extra arguments go to Vitest, for example `node run.js browser --reporter=verbose ../../lib/core/bucketer/index.spec.ts`. + +## Differences from the root (Vitest 3) setup + +- No viewport patch. Vitest 5 falls back to classic WebDriver when BiDi is off. +- Each spec file runs in its own iframe (`isolate: true`). Shared iframes break `vi.mock` under Vitest 5. +- Modules are always mocked by request interception (`browser.importMapMocks: false`), the same way Vitest 3 does it and the way old browsers must. +- `clearMocks: false` plus `vitest3-compat.setup.ts` keep the Vitest 3 mock-reset behavior the specs rely on. +- Source is compiled for the oldest tested browsers, not ES2015, because Vitest 5's mock modules can't be compiled down to ES2015. Dependencies are still compiled to ES2015. +- `legacy-polyfills-plugin.ts` adds `Array.prototype.at`, `findLast`/`findLastIndex` and `Object.hasOwn` to both pages Vitest loads (the orchestrator page and the test iframe). Vitest 5's browser runtime calls them, and Edge 89/90 and Firefox 91 don't have them; without the polyfills the run hangs until it times out. The SDK code under test sees the polyfills too (`lib/` doesn't use these functions today). +- `lightningcss` is replaced by an empty stub (`stubs/lightningcss`, wired in through `overrides` in `package.json`). It's MPL-2.0, which our license policy doesn't allow. Vite 8 depends on it but only loads it for `css.transformer: 'lightningcss'` or CSS minification in production builds, neither of which happens here. If something ever loads it, the stub throws an error saying so. +- Type tests (`*.test-d.ts`) are skipped. The root `npm test` already runs them. + +See the comments in `vitest.shared.mts` for details. diff --git a/tests/browser/console-capture-plugin.ts b/tests/browser/console-capture-plugin.ts new file mode 100644 index 000000000..6786c8111 --- /dev/null +++ b/tests/browser/console-capture-plugin.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import type { Plugin } from 'vite'; +import { consoleCapturePlugin as rootConsoleCapturePlugin } from '../../vitest/console-capture-plugin'; + +// Vitest 5 version of the root vitest/console-capture-plugin.ts. Reuses its +// /__vitest_console__ endpoint, but injects vitest/public/console-capture.js +// through transformIndexHtml, because the root plugin's response patching +// doesn't reach the tester page under Vitest 5. (The root plugin skips pages +// that already include the script, so it is never added twice.) +export function consoleCapturePlugin(): Plugin { + return { + ...(rootConsoleCapturePlugin() as unknown as Plugin), + transformIndexHtml() { + return [ + { + tag: 'script', + attrs: { src: '/console-capture.js' }, + injectTo: 'head-prepend', + }, + ]; + }, + }; +} diff --git a/tests/browser/legacy-polyfills-plugin.ts b/tests/browser/legacy-polyfills-plugin.ts new file mode 100644 index 000000000..23954da84 --- /dev/null +++ b/tests/browser/legacy-polyfills-plugin.ts @@ -0,0 +1,102 @@ +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import type { Plugin } from 'vite'; + +// Vitest 5's in-browser runtime (the tester page and the pre-bundled vitest +// runtime) calls a few built-ins that the oldest browsers we test don't have: +// +// Array/String/TypedArray.prototype.at Chromium 92, Firefox 90, Safari 15.4 +// Object.hasOwn Chromium 93, Firefox 92, Safari 15.4 +// Array.prototype.findLast(Index) Chromium 97, Firefox 104, Safari 15.4 +// +// Without them the runtime throws before it can report back, and the run hangs +// until it times out (seen on Edge 89 and 90). Vitest 3 didn't depend on these, so the +// root setup doesn't need this. +// +// The polyfills go into both pages Vitest loads: the orchestrator page (via +// `browser.orchestratorScripts`, see legacyPolyfillsOrchestratorScript) and the +// test iframe (via this plugin's transformIndexHtml). They run before any other +// script, so the SDK code under test also sees them. The SDK source (lib/) doesn't use any of +// these today. If it starts to, tests on these old browsers would no longer +// catch it. +const POLYFILLS = ` +(function () { + function define(target, name, value) { + if (target && !target[name]) { + Object.defineProperty(target, name, { value: value, writable: true, configurable: true }); + } + } + + function at(index) { + var length = this.length; + var i = Math.trunc(index) || 0; + if (i < 0) i += length; + return i < 0 || i >= length ? undefined : this[i]; + } + + function findLast(predicate, thisArg) { + for (var i = this.length - 1; i >= 0; i--) { + if (predicate.call(thisArg, this[i], i, this)) return this[i]; + } + return undefined; + } + + function findLastIndex(predicate, thisArg) { + for (var i = this.length - 1; i >= 0; i--) { + if (predicate.call(thisArg, this[i], i, this)) return i; + } + return -1; + } + + var typedArrayPrototype = Object.getPrototypeOf(Int8Array.prototype); + + define(Array.prototype, 'at', at); + define(String.prototype, 'at', at); + define(typedArrayPrototype, 'at', at); + define(Array.prototype, 'findLast', findLast); + define(Array.prototype, 'findLastIndex', findLastIndex); + define(typedArrayPrototype, 'findLast', findLast); + define(typedArrayPrototype, 'findLastIndex', findLastIndex); + define(Object, 'hasOwn', function (object, key) { + return Object.prototype.hasOwnProperty.call(Object(object), key); + }); +})(); +`; + +// For `browser.orchestratorScripts`. The orchestrator page doesn't go through +// transformIndexHtml. A classic script (not a module) runs while the page is +// parsed, before Vitest's module scripts. +export const legacyPolyfillsOrchestratorScript = { + id: 'legacy-polyfills.js', + content: POLYFILLS, + type: 'text/javascript', +}; + +// Adds the polyfills to the test iframe page +export function legacyPolyfillsPlugin(): Plugin { + return { + name: 'legacy-polyfills', + transformIndexHtml() { + return [ + { + tag: 'script', + children: POLYFILLS, + injectTo: 'head-prepend', + }, + ]; + }, + }; +} diff --git a/tests/browser/package-lock.json b/tests/browser/package-lock.json new file mode 100644 index 000000000..2380e26d2 --- /dev/null +++ b/tests/browser/package-lock.json @@ -0,0 +1,4343 @@ +{ + "name": "optimizely-sdk-browser-tests", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "optimizely-sdk-browser-tests", + "devDependencies": { + "@vitest/browser": "5.1.0", + "@vitest/browser-webdriverio": "5.0.0", + "browserstack-local": "^1.5.16", + "lightningcss": "file:./stubs/lightningcss", + "vitest": "5.1.0", + "webdriverio": "^9.23.0" + }, + "engines": { + "node": "^22.23.4 || ^24.22.1 || >=26.12.1" + } + }, + "node_modules/@blazediff/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@blazediff/core/-/core-1.10.0.tgz", + "integrity": "sha512-AOQff0zgR7cGsZL+4E7hVkmujoPUpm0J9xzWGWZj5wCjd3gmxESXAPfKyuzs93VdpQNFhHlBhfOjrcZ+XTERtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.156.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", + "integrity": "sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@promptbook/utils": { + "version": "0.69.5", + "resolved": "https://registry.npmjs.org/@promptbook/utils/-/utils-0.69.5.tgz", + "integrity": "sha512-xm5Ti/Hp3o4xHrsK9Yy3MS6KbDxYbq485hDsFvxqaNA7equHLPdo8H8faTitTeb14QCDfLW4iwCxdVYu5sn6YQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/webgptorg/promptbook/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "CC-BY-4.0", + "dependencies": { + "spacetrim": "0.11.59" + } + }, + "node_modules/@puppeteer/browsers": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.13.2.tgz", + "integrity": "sha512-5EUZSUIc37H6aIXyWO0Z4y8NlF8NnjgmqeQgOGiswAU7pY0HOo16ho4+alIWmSfdZnjqBRawMsP3I5YqLSn6kw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.4.3", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.5.0", + "semver": "^7.7.4", + "tar-fs": "^3.1.1", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.16.tgz", + "integrity": "sha512-ia3DwAs0OsMGS7+IConptSiyk9pEXkOx/AbJ2n/lAGxH3QkWQus1t8d7gnAT38FCU2sQu8lUbeR6AiZFv4JxaA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.16.tgz", + "integrity": "sha512-kx5wBiMB6E7TEvpl2B9gjLU004BkvEm2Dr941BFjx/SontPwSzNuQUIoVKxHHoSjpFIfHMmcguyLOtyn0hObRg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.16.tgz", + "integrity": "sha512-qslZrXnKJU4cUpjoAmtAo/KQM9e2IRMlmpig6Zpwj+8KWxW8v+nkAf9216Bsek9lOC1jvg2yCjygCFo2f83msQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.16.tgz", + "integrity": "sha512-FdF+y48ND13eAyM2mQn+85kvAqNlvRWROy2rhgA463X/0Gv4vGtazZtfaF1mRBLscYvtOlh4QnLjOWiFzX69OQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.16.tgz", + "integrity": "sha512-ddjqFM5e95AgLbUPtKIS7V1KTVlA0RUgCVr5mn+/IEhsdy3pr+Vuj/HZ7nlMN2FyxIwUktOH1LEPIQXO1v9y1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.16.tgz", + "integrity": "sha512-tHdKWbFkFBI687iim3LIyIvyL7j66VvQYkDPss5Stn/qyE2tWkR1YD0dXmXPFKKqT/o5ZEJVsaRsWS2meQwGOA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.16.tgz", + "integrity": "sha512-FJiLGAblPBMlBEdbOqw6kW6QcXDWAf/oJu7gYs9ZJZwmg+K+/zjFLxPTIY9izJUzxzc24FHvmseyA0IvJSl17w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.16.tgz", + "integrity": "sha512-hrJpblMsrQ58U9veWpbXzkhV5zStunds6HWLprqq1qauvgBr1E6P+24kLj6lSLI9vjRn/RYpjprhkHQPKGWpNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.16.tgz", + "integrity": "sha512-qJd/dC6j6CwLG9/s/RP2nb1RZ0GIgj7Ioj7x/SYa3RzjVrlzrmH0fhIOpfvqQDeIsdP0loi+kHaMhJzY1PBIaA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.16.tgz", + "integrity": "sha512-Vx7Xg5uUJuNcujJjI70OICaH0EYj80BtOLZTSN7uOYg8QOLlyKnaG0IW7Fn/J0IpJsaKzmDKMhOQv1JBM9m9vg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.16.tgz", + "integrity": "sha512-TNKhgE3uJTsTzatUSSYt0Kgo+Oa2uSlSjz4r1aEIea7HX6ULBym4fAlYUhG1i6pjNf2njfCUAfKwr6C3E9Xg1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.16.tgz", + "integrity": "sha512-7chXdpjXZ8qG0+mIxECN3cT9kvhZ3/oZhMX6Pp876P7CDrIy8nJswva6Mq357JR7eYXfuskwZxMeV1SzoZdHrA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.16.tgz", + "integrity": "sha512-Kwjt+7uNTJK5/MDkGWGVO2KQPnj8yAV75dMpfwyHZrJSXWHrniOB0aUEWlVYf3H1hOqFLIStLdM5QXq6bnKmOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.16.tgz", + "integrity": "sha512-/LH6WfjDRXXJz/p5xl4TmU+jpcnwcxbKEQBW/GZE0JHfN0lGIyTtsUEGaQ/q/GikkGJ2yLKe6pwm7AnEWO8pdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.16.tgz", + "integrity": "sha512-1lv1KvX0Z871zfk7vw+dnXMMnHNyDwMzWG8Kv3HxDXMOhzCX4SHc7HK319fInP0i+0p9D8brkfzL7pJOaGl+tw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz", + "integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.5.tgz", + "integrity": "sha512-mQkU2jY8jJEF7YHjHvsQO8+3ughTL1mcnn96igfhONmR+fUPSKIkefQYpSe8bsly2Ep7oQbn/6VG5/9/0qcArQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/which/-/which-2.0.2.tgz", + "integrity": "sha512-113D3mDkZDjo+EeUEHCFy0qniNc1ZpecGiAU7WSo7YDoSzolZIQKpYFHrPpjkB2nuyahcKfrmLXeQlh7gqJYdw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vitest/browser": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.1.0.tgz", + "integrity": "sha512-2sjGVAC/Rs8Jwv+xxBgklNG2g1LGyNgcFMBw71AcfBstLz25UGv1+fVvvZ+z8IfSuNg3nipERijnFtoEIdRDEA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@blazediff/core": "1.10.0", + "@vitest/mocker": "5.1.0", + "@vitest/ui": "5.1.0", + "@vitest/utils": "5.1.0", + "magic-string": "^1.4.3", + "pngjs": "^7.0.0", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0", + "ws": "^8.22.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/browser-webdriverio": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@vitest/browser-webdriverio/-/browser-webdriverio-5.0.0.tgz", + "integrity": "sha512-faotr4XiQrpK7yK+GTSWTA2pYSPFMZZA+fXx0rtKh9mvAjCMBM0Q2UJ5NIv6o5Oqkn2CASIrKnePaC/37judJA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/browser": "^5.0.0" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "^5.0.0", + "webdriverio": "*" + }, + "peerDependenciesMeta": { + "webdriverio": { + "optional": false + } + } + }, + "node_modules/@vitest/mocker": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.0.tgz", + "integrity": "sha512-5umB9/jlWcqVS6fsrFmv5Gdnpu6wAUio/lEOwAmvB7v+lFo/IW2B9FhAD0p19GCULTgMzLCdUmuCDCnAzWgppQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.31", + "@vitest/spy": "5.1.0", + "estree-walker": "^3.0.3", + "magic-string": "^1.4.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9 || ^3.0.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-5.1.0.tgz", + "integrity": "sha512-IRx5mc30CrFzyMNni6SZKQ1r53kv049Mcvvk0WbWcD6PUz/bFjG4zYv0KosQAeonPpGp5WxqYBMqdSOfJfvVWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.0.tgz", + "integrity": "sha512-2DPO5OMHWKrBngC+fCmTQqemNF0gidRhp3lxbBmRhW+M1XJrfgPpqNqWVevXtn2f2ufD5ZaR1B6B641aAlcX5A==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/ui": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-5.1.0.tgz", + "integrity": "sha512-00S3x4NRmqIBUiTVWF9/xLaA9EP9KeKv0+1sBO7e2Y4luBISlW+2ttnhlk/zjbTqEvVhJWCCo7MXzu6zNbefqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "5.1.0", + "fflate": "^0.8.3", + "flatted": "^3.4.4", + "pathe": "^2.0.3", + "sirv": "^3.0.2", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "vitest": "5.1.0" + } + }, + "node_modules/@vitest/utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-5.1.0.tgz", + "integrity": "sha512-V+qgCwkvVw+s1t1S5TaoBHsLi5Sz/YmohCMoOu0mZ8ZQst2bKhRYARAQucWpVg8D0mv0x5MHcWXY5QdOsoiGBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "5.1.0", + "convert-source-map": "^2.0.0", + "tinyrainbow": "^3.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@wdio/config": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/config/-/config-9.33.1.tgz", + "integrity": "sha512-pKVSbXQPmBN4V5RuLMky5DqxZEIPl96Mz//C4QO3QVuTHuVBGvGEkEg5NjwFiLUZTSZCdhEm35wGVwo49GGZeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "deepmerge-ts": "^8.0.0", + "glob": "^10.2.2", + "import-meta-resolve": "^4.0.0", + "jiti": "^2.6.1" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/logger": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/logger/-/logger-9.33.1.tgz", + "integrity": "sha512-f2H2lK283MW/ATsWNyE8pEEeIOXUMlpzkVrdbjCYL0lEvj5FEdZG3s+0hnst2R5CM4YWoPj7CIJa1HaSw1W6zQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^5.1.2", + "loglevel": "^1.6.0", + "loglevel-plugin-prefix": "^0.8.4", + "safe-regex2": "^5.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/protocols": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.33.1.tgz", + "integrity": "sha512-UxXXF//bE8j/vERbPh8ENgFODnJdxeGH27eX8yOIRbuRiRXPBqRBiJ0dLWFseFGC+kteSZKBjMDGszKYSPnN2Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/repl": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-9.33.1.tgz", + "integrity": "sha512-Hc3dEV+HqDeuY9wNY6m2dDnaSmMErYKJhEYSlaQCTCq5DBesw3vzf4dBX43X6FCwPiDjh5ZQXYDV+yt4P9/WJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/repl/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@wdio/repl/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/types": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/types/-/types-9.33.1.tgz", + "integrity": "sha512-2DbbcxiErZR/w0+ssuFmlOLMRsl+/Mktde6HvmBFQR+B7K0PIO3mt4l65oL+EYc6MgLHcKVFhPPCf/2KN+dUdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@wdio/types/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@wdio/types/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@wdio/utils": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-9.33.1.tgz", + "integrity": "sha512-NEjrHeJmxdxBPJWb0XfaTtGNm19TWAFzyAZuefht0gPSFWVY1yymU3vcVonzZ+jzhCwpfeeFeCHeoOXD9JxLTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@puppeteer/browsers": "^2.13.2", + "@wdio/logger": "9.33.1", + "@wdio/types": "9.33.1", + "decamelize": "^6.0.0", + "deepmerge-ts": "^8.0.0", + "edgedriver": "^6.3.1", + "geckodriver": "^6.1.1", + "get-port": "^7.0.0", + "import-meta-resolve": "^4.0.0", + "locate-app": "^2.2.24", + "mitt": "^3.0.1", + "safaridriver": "^1.0.0", + "split2": "^4.2.0", + "wait-port": "^1.1.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/@zip.js/zip.js": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.24.0.tgz", + "integrity": "sha512-WlaVKzdqBK+RF3bdiXZWbdCnvGB6PdO4IHC1mn/2Yfl3bASgqUNegnU3+PNg61iecwoPfUi5BgLUPqBukXpyWw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=18.0.0" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dev": true, + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/ansi-regex": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.5.0.tgz", + "integrity": "sha512-zhvbbbdt1kbw7EJ9OQoxmQcuaNR9P5kTj7e/YdmOSU10aHWbycofJxA6jKfoEy3vlLdctOF9ZHaxLtmSm998wQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/archiver": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-8.0.0.tgz", + "integrity": "sha512-fV1orZfsnPn9BaSByR/qE67rJCLJEy2Ox5bq7nJh+jquWaNh6Sfec75kJ2T6PtdGUbPQlrVoSVCEOa5SdiTQ1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.4", + "buffer-crc32": "^1.0.0", + "is-stream": "^4.0.0", + "lazystream": "^1.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0", + "readdir-glob": "^3.0.0", + "tar-stream": "^3.0.0", + "zip-stream": "^7.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/b4a": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.9.0.tgz", + "integrity": "sha512-dpfcF9fDNR6++cthXR67iyhgqWy9CBouAvIWhIntzBG6cvK/cnIPiZQjBwi/ZqjjBEDGfoNDtmB0kTjroOJ3pQ==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "react-native-b4a": "*" + }, + "peerDependenciesMeta": { + "react-native-b4a": { + "optional": true + } + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/bare-buffer": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/bare-buffer/-/bare-buffer-3.7.1.tgz", + "integrity": "sha512-cIjZnSO+y89ykVX9x96OVnA6tGORBn7vGJ/e3PCbBHMEyfMNG/ixzOS0lLa6saMlWcs69bSKjxFyDwjK152OMg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "bare": ">=1.20.0" + } + }, + "node_modules/bare-events": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz", + "integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==", + "dev": true, + "license": "Apache-2.0", + "peerDependencies": { + "bare-abort-controller": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + } + } + }, + "node_modules/bare-fs": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.8.4.tgz", + "integrity": "sha512-MPC2eyrpbk3A873sK4y6rk+Iv4o2enxTjHZ8zH3HO0mjrpm5XjnguY2XmfidIsDV6vnjpbMBKUAJpV0ISD2SsQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.5.4", + "bare-path": "^3.0.0", + "bare-stream": "^2.6.4", + "bare-url": "^2.2.2", + "fast-fifo": "^1.3.2" + }, + "engines": { + "bare": ">=1.28.0" + }, + "peerDependencies": { + "bare-buffer": "*" + }, + "peerDependenciesMeta": { + "bare-buffer": { + "optional": true + } + } + }, + "node_modules/bare-path": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.1.2.tgz", + "integrity": "sha512-ZyKbsuuqK6Ag0K8pX6V5Txq6XeJRvY+wXucnFGRjiyVYP9YWDpIQugk/b+enRYrEYBJaqLzghRQpXPMR7341Nw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/bare-stream": { + "version": "2.13.4", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.4.tgz", + "integrity": "sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.8.1", + "streamx": "^2.25.0", + "teex": "^1.0.1" + }, + "peerDependencies": { + "bare-abort-controller": "*", + "bare-buffer": "*", + "bare-events": "*" + }, + "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + }, + "bare-buffer": { + "optional": true + }, + "bare-events": { + "optional": true + } + } + }, + "node_modules/bare-url": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.5.6.tgz", + "integrity": "sha512-iqkXHkW65De+BT14nHLiBFbNuJ/DdMrZaVNJ1IXPctpK6b1olUJ5Qmy8QBvwROajTiGztso2n82kFEvCsNG7Rg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-buffer": "^3.0.0", + "bare-path": "^3.0.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.3.1.tgz", + "integrity": "sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true, + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/browserstack-local": { + "version": "1.5.16", + "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.5.16.tgz", + "integrity": "sha512-WExfBqEId4t0pmJqmskrdV26OUXxcWEu3ciEbPV6RWY1ZoiofoV5+vEJT7fNXqghxA7iqDiIorsegPpvuxWdOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^6.0.2", + "https-proxy-agent": "^5.0.1", + "is-running": "^2.1.0", + "tree-kill": "^1.2.2" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-crc32": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-1.0.0.tgz", + "integrity": "sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/chai": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cheerio": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.2.0.tgz", + "integrity": "sha512-WDrybc/gKFpTYQutKIK6UvfcuxijIZfMfXaYm8NMsPQxSYvf+13fXUJ4rztGGbJcBQ/GF55gvrZ0Bc0bj/mqvg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "encoding-sniffer": "^0.2.1", + "htmlparser2": "^10.1.0", + "parse5": "^7.3.0", + "parse5-htmlparser2-tree-adapter": "^7.1.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^7.19.0", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=20.18.1" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } + }, + "node_modules/compress-commons": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-7.0.1.tgz", + "integrity": "sha512-g0S8KAD8qf4+V//pr3BfB1aBnARLXNz2Gx+jmHU0LEriUuoQUOPOulVquHKTJ8+EAIIO7fhseNDr9wK5Q9FKBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "crc32-stream": "^7.0.1", + "is-stream": "^4.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/crc-32": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", + "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "crc32": "bin/crc32.njs" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/crc32-stream": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-7.0.1.tgz", + "integrity": "sha512-IBWsY8xznyQrcHn8h4bC8/4ErNke5elzgG8GcqF4RFPw6aHkWWRc7Tgw6upjaTX/CT/yQgqYENkxYsTYN+hW2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cross-spawn/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/cross-spawn/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-shorthand-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/css-shorthand-properties/-/css-shorthand-properties-1.1.2.tgz", + "integrity": "sha512-C2AugXIpRGQTxaCW0N7n5jD/p5irUmCrwl03TrnMFBHDbdq44CFWR2zO7rK9xPN4Eo3pUxC4vQzQgbIpzrD1PQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/css-value": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/css-value/-/css-value-0.0.1.tgz", + "integrity": "sha512-FUV3xaJ63buRLgHrLQVlVgQnQdR4yqdLGaDu7g8CQcWjInDfM9plBTPI9FRfpahju1UBSaMckeb2/46ApS/V1Q==", + "dev": true + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-6.0.1.tgz", + "integrity": "sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deepmerge-ts": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/deepmerge-ts/-/deepmerge-ts-8.0.2.tgz", + "integrity": "sha512-uqbvqLUMrc6p0MO+WBRtTxY55hmyh94WRwI5a++PZe54X+bfVh59FSN7uWCBCW1CCVjzjnrwzfI8zidE2obMMw==", + "dev": true, + "funding": [ + { + "type": "ko-fi", + "url": "https://ko-fi.com/rebeccastevens" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/deepmerge-ts" + } + ], + "license": "BSD-3-Clause", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/edge-paths": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/edge-paths/-/edge-paths-3.0.5.tgz", + "integrity": "sha512-sB7vSrDnFa4ezWQk9nZ/n0FdpdUuC6R1EOrlU3DL+bovcNFK28rqu2emmAUjujYEJTWIgQGqgVVWUZXMnc8iWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/which": "^2.0.1", + "which": "^2.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/shirshak55" + } + }, + "node_modules/edge-paths/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/edge-paths/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/edgedriver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/edgedriver/-/edgedriver-6.3.1.tgz", + "integrity": "sha512-wCL/Ydgt0DPkWecjhhPj2/lnDxsGeHLPKeJYKKMTNol+ULFVg4WaTvxoB19GU4tieM6LSA3vZEdZxmDC0DwIpQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "^9.29.1", + "@zip.js/zip.js": "^2.8.11", + "decamelize": "^6.0.1", + "edge-paths": "^3.0.5", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "which": "^6.0.1" + }, + "bin": { + "edgedriver": "bin/edgedriver.js" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/edgedriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/edgedriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/encoding-sniffer": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.1.tgz", + "integrity": "sha512-5gvq20T6vfpekVtqrYQsSCFZ1wEg5+wW0/QaZMWkFr6BqD3NfKs0rLCx4rrVlSWJeZb5NBJgVLswK/w2MWU+Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.2.tgz", + "integrity": "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==", + "dev": true, + "license": "MIT" + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/events-universal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz", + "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "bare-events": "^2.7.0" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "dev": true, + "license": "MIT" + }, + "node_modules/flatted": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz", + "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==", + "dev": true, + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/geckodriver": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/geckodriver/-/geckodriver-6.1.1.tgz", + "integrity": "sha512-/AcCyc9o9o6hUbudaSJM2iOtXbxSLqQPOb4GrPvEN40cjraUeaX/j5kH3mSgwiroyMn7qzx2wM61AQ2XY8j3sA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@wdio/logger": "^9.18.0", + "@zip.js/zip.js": "^2.8.11", + "decamelize": "^6.0.1", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.6", + "modern-tar": "^0.7.3" + }, + "bin": { + "geckodriver": "bin/geckodriver.js" + }, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/geckodriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/geckodriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-port": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-7.2.0.tgz", + "integrity": "sha512-afP4W205ONCuMoPBqcR6PSXnzX35KTcJygfJfcp+QY+uwm3p20p1YczWXhlICIzGMCxYBQcySEcOgsJcrkyobg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/htmlfy": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/htmlfy/-/htmlfy-0.8.1.tgz", + "integrity": "sha512-xWROBw9+MEGwxpotll0h672KCaLrKKiCYzsyN8ZgL9cQbVumFnyvsk2JqiB9ELAV1GLj1GG/jxZUjV9OZZi/yQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/htmlparser2": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-10.1.0.tgz", + "integrity": "sha512-VTZkM9GWRAtEpveh7MSF6SjjrpNVNNVJfFup7xTY3UpFtm67foy9HDVXneLtFVt4pMz5kZtgNcvCniNFb1hlEQ==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.2.2", + "entities": "^7.0.1" + } + }, + "node_modules/htmlparser2/node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/import-meta-resolve": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-4.2.0.tgz", + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.6.tgz", + "integrity": "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-running": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", + "integrity": "sha512-mjJd3PujZMl7j+D395WTIO5tU5RIDBfVSRtRR4VOJou3H66E38UjbjvDGh3slJzPuolsb+yQFqwHNNdyp5jg3w==", + "dev": true, + "license": "BSD" + }, + "node_modules/is-stream": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-4.0.1.tgz", + "integrity": "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/isexe": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-4.0.0.tgz", + "integrity": "sha512-FFUtZMpoZ8RqHS3XeXEmHWLA4thH+ZxCv2lOiPIn1Xc7CxrqhWzNSDzD+/chS/zbYezmiwWLdQC09JdQKmthOw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=20" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jiti": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/jszip": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.2.tgz", + "integrity": "sha512-3l+rb15IOWtUhU0H5MFqES/T6Kh7abYwjosBey/vD6hDt8zoEffkSC5Ws5SGtgVw3gBx2NEbhTeSW1+kWkpyTQ==", + "dev": true, + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lazystream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", + "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "readable-stream": "^2.0.5" + }, + "engines": { + "node": ">= 0.6.3" + } + }, + "node_modules/lazystream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/lazystream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lazystream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "immediate": "~3.0.5" + } + }, + "node_modules/lightningcss": { + "resolved": "stubs/lightningcss", + "link": true + }, + "node_modules/locate-app": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/locate-app/-/locate-app-2.5.0.tgz", + "integrity": "sha512-xIqbzPMBYArJRmPGUZD9CzV9wOqmVtQnaAn3wrj3s6WYW0bQvPI7x+sPYUGmDTYMHefVK//zc6HEYZ1qnxIK+Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/hejny/locate-app/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "Apache-2.0", + "dependencies": { + "@promptbook/utils": "0.69.5", + "type-fest": "4.26.0", + "userhome": "1.0.1" + } + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.zip": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", + "integrity": "sha512-C7IOaBBK/0gMORRBd8OETNx3kmOkgIWIPvyDpZSCTwUrpYmgZwJkjZeOD8ww4xbOUOs4/attY+pciKvadNfFbg==", + "dev": true, + "license": "MIT" + }, + "node_modules/loglevel": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.2.tgz", + "integrity": "sha512-HgMmCqIJSAKqo68l0rS2AanEWfkxaZ5wNiEFb5ggm08lDs9Xl2KxBlX3PTcaD2chBM1gXAYf491/M2Rv8Jwayg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/loglevel-plugin-prefix": { + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/loglevel-plugin-prefix/-/loglevel-plugin-prefix-0.8.4.tgz", + "integrity": "sha512-WpG9CcFAOjz/FtNht+QJeGpvVl/cdR6P0z6OcXSkr8wFJOsV2GRj2j10JLfjuA4aYkcKCNIEqRGCyTife9R8/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/magic-string": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "dev": true, + "license": "MIT" + }, + "node_modules/modern-tar": { + "version": "0.7.7", + "resolved": "https://registry.npmjs.org/modern-tar/-/modern-tar-0.7.7.tgz", + "integrity": "sha512-t9VmxaqrmANnEOBhpSDI6HD192Ge48k8vmWqQQL7hSFEqHEYwZbbsu49+aKLWZeRvFs3j1pMhXOqqF4kPlvjkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/netmask": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.1.1.tgz", + "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/obug": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true, + "license": "(MIT AND Zlib)" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.1.0.tgz", + "integrity": "sha512-ruw5xyKs6lrpo9x9rCZqZZnIUntICjQAd0Wsmp396Ul9lN/h+ifgVV1x1gZHi8euej6wTfpqX8j+BFQxF0NS/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "domhandler": "^5.0.3", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "dev": true, + "license": "MIT", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5/node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pngjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-7.0.0.tgz", + "integrity": "sha512-LKWqWJRhstyYo9pGvgor/ivk2w94eSjE3RGVuzLGlr3NmD8bf7RcYGze1mNdEHRP6TRP6rMuDHk5t44hnTRyow==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.19.0" + } + }, + "node_modules/postcss": { + "version": "8.5.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "nanoid": "^3.3.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/query-selector-shadow-dom": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/query-selector-shadow-dom/-/query-selector-shadow-dom-1.0.1.tgz", + "integrity": "sha512-lT5yCqEBgfoMYpf3F2xQRK7zEr1rhIIZuceDK6+xRkJQ4NMbHTwXqk4NkwDwQMNqXgG9r9fyHnzwNVs6zV5KRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.8.0.tgz", + "integrity": "sha512-2jhTTU3Eilp/2DMT71gbcoqC35eQHasMJH0RHkYxwlxIv3+FR6Y5xAFZIwEGLxKkjZYEFlsiMNIdwUqjK2lLHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/readdir-glob": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/readdir-glob/-/readdir-glob-3.0.0.tgz", + "integrity": "sha512-AhNB2KgKeVJr16nK9LLZbJNWnYoT23ZrumNKFDebHBdkC8KHSqWo871JAUhoWC/RtjEVdqNMFpM6qrwRbaUqpw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^10.2.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/yqnn" + } + }, + "node_modules/readdir-glob/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/readdir-glob/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/readdir-glob/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resq": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resq/-/resq-1.11.0.tgz", + "integrity": "sha512-G10EBz+zAAy3zUd/CDoBbXRL6ia9kOo3xRHrMDsHljI0GDkhYlyjwoCx5+3eCC4swi1uCoZQhskuJkj7Gp57Bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^2.0.1" + } + }, + "node_modules/ret": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.1.tgz", + "integrity": "sha512-Z/nyvABwcRnRD2mMP7Kz6G1dFZZqX1mNErOnxF42OCQKE07b9k9hK9SQxHL3LFEZUdzQaLM4dId1E/E6Vm4WhA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/rgb2hex": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/rgb2hex/-/rgb2hex-0.2.5.tgz", + "integrity": "sha512-22MOP1Rh7sAo1BZpDG6R5RFYzR2lYEgwq7HEmyW2qcsOqR2lQKmn+O//xV3YG/0rrhMC6KVX2hU+ZXuaw9a5bw==", + "dev": true, + "license": "MIT" + }, + "node_modules/rolldown": { + "version": "1.2.16", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.16.tgz", + "integrity": "sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@oxc-project/types": "=0.156.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.16", + "@rolldown/binding-android-arm64": "1.2.16", + "@rolldown/binding-darwin-arm64": "1.2.16", + "@rolldown/binding-darwin-x64": "1.2.16", + "@rolldown/binding-freebsd-x64": "1.2.16", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.16", + "@rolldown/binding-linux-arm64-gnu": "1.2.16", + "@rolldown/binding-linux-arm64-musl": "1.2.16", + "@rolldown/binding-linux-ppc64-gnu": "1.2.16", + "@rolldown/binding-linux-s390x-gnu": "1.2.16", + "@rolldown/binding-linux-x64-gnu": "1.2.16", + "@rolldown/binding-linux-x64-musl": "1.2.16", + "@rolldown/binding-openharmony-arm64": "1.2.16", + "@rolldown/binding-win32-arm64-msvc": "1.2.16", + "@rolldown/binding-win32-x64-msvc": "1.2.16" + } + }, + "node_modules/safaridriver": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/safaridriver/-/safaridriver-1.0.1.tgz", + "integrity": "sha512-jkg4434cYgtrIF2AeY/X0Wmd2W73cK5qIEFE3hDrrQenJH/2SDJIXGvPAigfvQTcE9+H31zkiNHbUqcihEiMRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-regex2": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.1.2.tgz", + "integrity": "sha512-tAtCGFPPP02VroDVzp4daGi6bC7jWG+41D47GKf18FeH/ubvKQHT9VmhAkvtjNOmJwqtApzWeUpEhkyEYULvmw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "MIT", + "dependencies": { + "ret": "~0.5.0" + }, + "bin": { + "safe-regex2": "bin/safe-regex2.js" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-error": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-12.0.0.tgz", + "integrity": "sha512-ZYkZLAvKTKQXWuh5XpBw7CdbSzagarX39WyZ2H07CDLC5/KfsRGlIXV8d4+tfqX1M7916mRqR1QfNHSij+c9Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^4.31.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/serialize-error/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sirv": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz", + "integrity": "sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.10", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.10.tgz", + "integrity": "sha512-e0VyvkVTwVYViNovRkZ9aodhxVlyoMn7eJhVUPxZ+eK9P/7CBkxvvsBOHqFPEH416726W8tLXXXjKwqgTErrCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^10.1.1", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/spacetrim": { + "version": "0.11.59", + "resolved": "https://registry.npmjs.org/spacetrim/-/spacetrim-0.11.59.tgz", + "integrity": "sha512-lLYsktklSRKprreOm7NXReW8YiX2VBjbgmXYEziOoGf/qsJqAEACaDvoTtUOycwjpaSh+bT8eu0KrJn7UNxiCg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://buymeacoffee.com/hejny" + }, + { + "type": "github", + "url": "https://github.com/hejny/spacetrim/blob/main/README.md#%EF%B8%8F-contributing" + } + ], + "license": "Apache-2.0" + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/std-env": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", + "dev": true, + "license": "MIT" + }, + "node_modules/streamx": { + "version": "2.28.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.1.tgz", + "integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "events-universal": "^1.0.0", + "fast-fifo": "^1.3.2", + "text-decoder": "^1.1.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.3.tgz", + "integrity": "sha512-/hU4AXnIdZu+Gvl1pk0oI5f5HxWsCJRtY2aFaJdk9VvyL48DWU6iU5WAIPG+wIi1YvWA6eTJvIviP/tMAZZNwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^4.0.1", + "bare-path": "^3.0.0" + } + }, + "node_modules/tar-stream": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.2.2.tgz", + "integrity": "sha512-+8NeqHRjQWH9nYlwo2gamAMImZCVzI4UoEgDpWorBt9OEfppiZn+uSkskzQKPWIZyji/C8fpWO7u69G0DX0tbg==", + "dev": true, + "license": "MIT", + "dependencies": { + "b4a": "^1.9.0", + "bare-fs": "^4.8.2", + "fast-fifo": "^1.3.2", + "streamx": "^2.28.1" + } + }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "streamx": "^2.12.5" + } + }, + "node_modules/text-decoder": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz", + "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/tinybench": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz", + "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/tinyexec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyrainbow": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-3.2.0.tgz", + "integrity": "sha512-LgO3D9yZJjApUiuUfl9iFAwrtaX4+lok3wJIqttGoKCHlWUqHqbQpnxCf82L8FjgKsh4iGo78hqJwgL8F6To2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.9.1.tgz", + "integrity": "sha512-a4Ux9VKuIMHsOS7ENbEq6hK2ZGYIT27Rtl0E4eD9KqwxhKiQeMZE/9xb3IdYwWaSOyIBQLExhQgXDTYoiCxnWA==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-fest": { + "version": "4.26.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.26.0.tgz", + "integrity": "sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici": { + "version": "7.30.2", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.2.tgz", + "integrity": "sha512-mLyPQnHwUxaM/rideoK/+KL8DaAJLRl4aBCfmX444aCSLnIaomqPLtNRe2jdCYcsk5wZzXrDIQC8ZeYNRAYyIA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/urlpattern-polyfill": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.1.0.tgz", + "integrity": "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/userhome": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/userhome/-/userhome-1.0.1.tgz", + "integrity": "sha512-5cnLm4gseXjAclKowC4IjByaGsjtAoV6PrOQOljplNB54ReUYJP8HdAFq2muHinSDAh09PPX/uXDPfdxRHvuSA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.6.tgz", + "integrity": "sha512-UI7dK29NnS54Fk+mmo7o+jI6U8Fp7hDl+X5Q1k45WH+d4dSlbLVUETGQ+hfkNgvLQGyoElPj837nZyv4MBc0VA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.32", + "rolldown": "~1.2.16", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1 || ^0.8.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitest": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.0.tgz", + "integrity": "sha512-MzmNFnrwa8v8lF1bLxw3UJ4EREwVOVb75VqJZmUDRjJ6EluK/x9th7qTbaeDk41WxE1GxWqmTXcdsfobfH5sOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/mocker": "5.1.0", + "chai": "^6.3.0", + "es-module-lexer": "^2.3.2", + "expect-type": "^1.4.0", + "magic-string": "^1.4.3", + "obug": "^3.0.0", + "picomatch": "^4.0.7", + "std-env": "^4.3.0", + "tinybench": "^6.2.2", + "tinyexec": "^1.3.1", + "tinyglobby": "^0.2.17", + "why-is-node-running": "3.2.1" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^22.12.0 || ^24.0.0 || >=26.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^22.0.0 || >=24.0.0", + "@vitest/browser-playwright": "5.1.0", + "@vitest/browser-preview": "5.1.0", + "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", + "@vitest/coverage-istanbul": "5.1.0", + "@vitest/coverage-v8": "5.1.0", + "@vitest/ui": "5.1.0", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + } + }, + "node_modules/wait-port": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/wait-port/-/wait-port-1.1.0.tgz", + "integrity": "sha512-3e04qkoN3LxTMLakdqeWth8nih8usyg+sf1Bgdf9wwUkp05iuK1eSY/QpLvscT/+F/gA89+LpUmmgBtesbqI2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "commander": "^9.3.0", + "debug": "^4.3.4" + }, + "bin": { + "wait-port": "bin/wait-port.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/wait-port/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wait-port/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/webdriver": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-9.33.1.tgz", + "integrity": "sha512-STNxxNM42RhKWEenG/BmoN3lXgMI9R51vZ/9z1sSo/1uY8p/JL2gDGuMIvIzjuVRduy9puStom0judPEShQx7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.1.0", + "@types/ws": "^8.5.3", + "@wdio/config": "9.33.1", + "@wdio/logger": "9.33.1", + "@wdio/protocols": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "deepmerge-ts": "^8.0.0", + "https-proxy-agent": "^7.0.6", + "undici": "^6.27.0", + "ws": "^8.21.0" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + } + }, + "node_modules/webdriver/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/webdriver/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/webdriver/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/webdriver/node_modules/undici": { + "version": "6.29.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.29.1.tgz", + "integrity": "sha512-EvRlUt/QqAEvXdQeRMYUfwOQsfzpDztykrG2owGEE/rBOBoYv9uF39ZzsNDh4lTFHhTr2XOZjKkYgueD12ZmGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/webdriver/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/webdriverio": { + "version": "9.33.1", + "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-9.33.1.tgz", + "integrity": "sha512-AsS8PlYshbyf2OLkYJsULNf6G/9tGkcra1a+Qju57Lt+SN36a+S8odRaJpvkoqnsEtjJBdXAa9bcNWCe1+DeqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "^20.11.30", + "@types/sinonjs__fake-timers": "^8.1.5", + "@wdio/config": "9.33.1", + "@wdio/logger": "9.33.1", + "@wdio/protocols": "9.33.1", + "@wdio/repl": "9.33.1", + "@wdio/types": "9.33.1", + "@wdio/utils": "9.33.1", + "archiver": "^8.0.0", + "aria-query": "^5.3.0", + "cheerio": "^1.0.0-rc.12", + "css-shorthand-properties": "^1.1.1", + "css-value": "^0.0.1", + "grapheme-splitter": "^1.0.4", + "htmlfy": "^0.8.1", + "is-plain-obj": "^4.1.0", + "jszip": "^3.10.1", + "lodash.clonedeep": "^4.5.0", + "lodash.zip": "^4.2.0", + "query-selector-shadow-dom": "^1.0.1", + "resq": "^1.11.0", + "rgb2hex": "0.2.5", + "serialize-error": "^12.0.0", + "urlpattern-polyfill": "^10.0.0", + "webdriver": "9.33.1" + }, + "engines": { + "node": ">=18.20.8 <19 || >=20.20.2 <21 || >=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1" + }, + "peerDependencies": { + "puppeteer-core": ">=22.x <=24.x" + }, + "peerDependenciesMeta": { + "puppeteer-core": { + "optional": true + } + } + }, + "node_modules/webdriverio/node_modules/@types/node": { + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/webdriverio/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/which": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/which/-/which-6.0.1.tgz", + "integrity": "sha512-oGLe46MIrCRqX7ytPUf66EAYvdeMIZYn3WaocqqKZAxrBpkqHfL/qvTyJ/bTk5+AqHCjXmrv3CEWgy368zhRUg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^4.0.0" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, + "node_modules/why-is-node-running": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", + "dev": true, + "license": "MIT", + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=20.11" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.22.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.1.tgz", + "integrity": "sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/yauzl/node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/zip-stream": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-7.0.5.tgz", + "integrity": "sha512-dSvYKdvLsAHCDqPOhIwk/q5CvuWtTB3Dgpoe0uVEFjTzIOAmsQpprX25InCvrvJsirEbu1OHyy67n/kAj1Sw/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "compress-commons": "^7.0.0", + "normalize-path": "^3.0.0", + "readable-stream": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "stubs/lightningcss": { + "version": "0.0.0-stub", + "dev": true, + "license": "Apache-2.0" + } + } +} diff --git a/tests/browser/package.json b/tests/browser/package.json new file mode 100644 index 000000000..90e1ca06f --- /dev/null +++ b/tests/browser/package.json @@ -0,0 +1,27 @@ +{ + "name": "optimizely-sdk-browser-tests", + "private": true, + "description": "Runs the SDK browser and UMD spec files (../../lib) in real browsers using Vitest 5. Kept separate from the root project, which stays on Vitest 3 for Node 18 support.", + "engines": { + "node": "^22.23.4 || ^24.22.1 || >=26.12.1" + }, + "scripts": { + "test-browser": "node ./run.js browser", + "test-browser-local": "USE_LOCAL_BROWSER=true node ./run.js browser", + "test-browser-browserstack": "USE_LOCAL_BROWSER=false node ./run.js browser", + "test-umd": "node ./run.js umd", + "test-umd-local": "USE_LOCAL_BROWSER=true node ./run.js umd", + "test-umd-browserstack": "USE_LOCAL_BROWSER=false node ./run.js umd" + }, + "devDependencies": { + "@vitest/browser": "5.1.0", + "@vitest/browser-webdriverio": "5.0.0", + "browserstack-local": "^1.5.16", + "lightningcss": "file:./stubs/lightningcss", + "vitest": "5.1.0", + "webdriverio": "^9.23.0" + }, + "overrides": { + "lightningcss": "$lightningcss" + } +} diff --git a/tests/browser/run.js b/tests/browser/run.js new file mode 100644 index 000000000..d2f4d77da --- /dev/null +++ b/tests/browser/run.js @@ -0,0 +1,293 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Runs the browser or UMD spec files with Vitest 5. +// Usage: node run.js [extra vitest args...] +// e.g. node run.js browser --reporter=verbose ../../lib/core/bucketer/index.spec.ts +// +// Same flow as the root scripts/run-browser-tests.js and scripts/run-umd-tests.js, +// minus the Vitest viewport patch, which Vitest 5 doesn't need. + +const { execSync, execFileSync } = require('child_process'); +const fs = require('fs'); +const path = require('path'); +const browserstack = require('browserstack-local'); + +const MODES = { + browser: { label: 'browser', config: 'vitest.browser.config.mts' }, + umd: { label: 'UMD', config: 'vitest.umd.config.mts' }, +}; + +const mode = MODES[process.argv[2]]; +// Passed through to vitest unchanged, e.g. a reporter or specific spec files +const extraVitestArgs = process.argv.slice(3); +// Vitest's CLI script. Running it with node (no shell) passes the arguments +// through exactly, and works the same on Windows, where npx is a .cmd file. +const vitestCli = path.join( + path.dirname(require.resolve('vitest/package.json')), + require('vitest/package.json').bin.vitest +); +if (!mode) { + console.error(`Usage: node run.js <${Object.keys(MODES).join('|')}>`); + process.exit(1); +} + +const projectDir = __dirname; +const repoRoot = path.resolve(projectDir, '../..'); + +// Browser configurations grouped by browser name +const BROWSER_CONFIGS = { + chrome: [ + { name: 'chrome-102-windows', browserVersion: '102', os: 'Windows', osVersion: '11' }, + { name: 'chrome-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, + ], + firefox: [ + { name: 'firefox-91-windows', browserVersion: '91', os: 'Windows', osVersion: '11' }, + { name: 'firefox-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, + ], + edge: [ + { name: 'edge-89-windows', browserVersion: '89', os: 'Windows', osVersion: '11' }, + { name: 'edge-latest-windows', browserVersion: 'latest', os: 'Windows', osVersion: '11' }, + ], + safari: [ + { name: 'safari-monterey', os: 'OS X', osVersion: 'Monterey' }, + { name: 'safari-sequoia', os: 'OS X', osVersion: 'Sequoia' }, + ] +}; + +// Determine if we should use local browser or BrowserStack +// Priority: USE_LOCAL_BROWSER env var, then check for BrowserStack credentials +let useLocalBrowser = process.env.USE_LOCAL_BROWSER === 'true'; + +if (!useLocalBrowser) { + const username = process.env.BROWSERSTACK_USERNAME || process.env.BROWSER_STACK_USERNAME; + const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; + + console.log('\n' + '='.repeat(80)); + console.log('BrowserStack Credentials Check:'); + console.log('='.repeat(80)); + console.log(`BROWSERSTACK_USERNAME: ${username ? '✓ Available' : '✗ Not found'}`); + console.log(`BROWSERSTACK_ACCESS_KEY: ${accessKey ? '✓ Available' : '✗ Not found'}`); + console.log('='.repeat(80) + '\n'); + + if (!username || !accessKey) { + console.log('BrowserStack credentials not found - falling back to local browser mode'); + useLocalBrowser = true; + } +} + +let bs_local = null; + +function startTunnel(localIdentifier) { + const accessKey = process.env.BROWSERSTACK_ACCESS_KEY || process.env.BROWSER_STACK_ACCESS_KEY; + + console.log(`Starting BrowserStack Local tunnel with identifier: ${localIdentifier}...`); + bs_local = new browserstack.Local(); + const bsLocalArgs = { + key: accessKey, + // No `force: true` here: it kills every other BrowserStack Local tunnel on + // the machine, which breaks runs going in parallel. The unique + // localIdentifier keeps parallel tunnels apart. + forceLocal: true, + // Enable verbose logging to debug tunnel issues + verbose: true, + localIdentifier: localIdentifier, + }; + + return new Promise((resolve, reject) => { + bs_local.start(bsLocalArgs, (error) => { + if (error) { + console.error('Error starting BrowserStack Local:', error); + reject(error); + } else { + console.log('BrowserStack Local tunnel started successfully'); + console.log(`BrowserStack Local PID: ${bs_local.pid}`); + console.log(`Local Identifier: ${localIdentifier}`); + // Wait for tunnel to fully establish and register with BrowserStack + console.log('Waiting for tunnel to establish...'); + setTimeout(() => { + console.log('Tunnel ready!'); + resolve(); + }, 10000); + } + }); + }); +} + +function stopTunnel() { + if (!bs_local) { + return Promise.resolve(); + } + + return new Promise((resolve) => { + bs_local.stop(() => { + console.log('BrowserStack Local tunnel stopped'); + resolve(); + }); + }); +} + +// Builds the UMD bundle in the repo root and copies it to vitest/public/dist/, +// where the umd plugin's '; - if (body.includes('') && !body.includes('console-capture.js')) { - body = body.replace('', `${scriptTag}\n`); - res.setHeader('content-length', Buffer.byteLength(body)); - } - } - - // Restore original methods and send response - res.write = originalWrite; - res.end = originalEnd; - res.end(body, ...args); - }; - - next(); - }); - - }, - }; -} diff --git a/vitest/umd-plugin.ts b/vitest/umd-plugin.ts deleted file mode 100644 index 9c285b835..000000000 --- a/vitest/umd-plugin.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright 2025, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import type { Plugin } from 'vitest/config'; -import type { IncomingMessage, ServerResponse } from 'http'; - -export function umdPlugin(): Plugin { - return { - name: 'umd-plugin', - enforce: 'pre' as const, - configureServer(server) { - // Add middleware to inject umd script into HTML responses - server.middlewares.use((_req: IncomingMessage, res: ServerResponse, next: () => void) => { - const originalWrite = res.write; - const originalEnd = res.end; - const chunks: any[] = []; - - // @ts-ignore - res.write = function(chunk: any, ..._args: any[]) { - chunks.push(Buffer.from(chunk)); - return true; - }; - - // @ts-ignore - res.end = function(chunk: any, ...args: any[]) { - if (chunk) { - chunks.push(Buffer.from(chunk)); - } - - const buffer = Buffer.concat(chunks); - let body = buffer.toString('utf8'); - - // Inject console-capture script into HTML responses - if (res.getHeader('content-type')?.toString().includes('text/html')) { - const scriptTag = ''; - if (body.includes('')) { - body = body.replace('', `${scriptTag}\n`); - res.setHeader('content-length', Buffer.byteLength(body)); - } - } - - // Restore original methods and send response - res.write = originalWrite; - res.end = originalEnd; - res.end(body, ...args); - }; - - next(); - }); - - }, - }; -} From 77957f470c6f6992a14e95d9ae7147784798b225 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Sat, 14 Nov 2026 00:21:10 +0600 Subject: [PATCH 35/39] [FSSDK-13432] Don't treat the first invalid datafile from datafileManager as fatal (#1188) ## Summary - `ProjectConfigManagerImpl` no longer fails to start on the first invalid datafile from the `datafileManager`. Startup now fails only after `MAX_INVALID_DATAFILE_EMIT` (3) invalid datafiles arrive before a valid one. A valid datafile within that limit starts the manager as usual. - An invalid datafile with no `datafileManager` is still a fatal init error, as before. - `jsonSchemaValidator` and `datafileManager` are now `private`. A single bad response, such as a truncated or corrupted payload, used to stop the SDK from starting even though the next poll would have returned a valid datafile. --- .../project_config_manager.spec.ts | 76 ++++++++++++++++--- lib/project_config/project_config_manager.ts | 19 +++-- 2 files changed, 80 insertions(+), 15 deletions(-) diff --git a/lib/project_config/project_config_manager.spec.ts b/lib/project_config/project_config_manager.spec.ts index 8fb63dc98..8fd998ab4 100644 --- a/lib/project_config/project_config_manager.spec.ts +++ b/lib/project_config/project_config_manager.spec.ts @@ -1,5 +1,5 @@ /** - * Copyright 2019-2020, 2022, 2024, Optimizely + * Copyright 2019-2020, 2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import { resolvablePromise } from '../utils/promise/resolvablePromise'; import { getMockDatafileManager } from '../tests/mock/mock_datafile_manager'; import { wait } from '../tests/testUtils'; +import { MAX_INVALID_DATAFILE_EMIT } from './project_config_manager'; + describe('ProjectConfigManagerImpl', () => { describe('a logger is passed in the constructor', () => { it('should set name on the logger passed into the constructor', () => { @@ -201,14 +203,14 @@ describe('ProjectConfigManagerImpl', () => { describe('when datafile is invalid', () => { it('should reject onRunning() with the same error if datafileManager.onRunning() rejects', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.reject(new Error('test error')) }); - const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); await expect(manager.onRunning()).rejects.toThrow('DatafileManager failed to start, reason: test error'); }); it('should resolve onRunning() if datafileManager.onUpdate() is fired and should update config', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); @@ -217,7 +219,7 @@ describe('ProjectConfigManagerImpl', () => { it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); const listener = vi.fn(); manager.onUpdate(listener); @@ -230,20 +232,52 @@ describe('ProjectConfigManagerImpl', () => { it('should return undefined from getConfig() before onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); expect(manager.getConfig()).toBeUndefined(); }); it('should return the correct config from getConfig() after onRunning() resolves', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); - const manager = new ProjectConfigManagerImpl({ datafile: JSON.stringify({}), datafileManager }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); manager.start(); datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); await expect(manager.onRunning()).resolves.not.toThrow(); expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); }); + + it('should reject onRunning() and onTerminated() if datafileManger emits invalid datafile \ + MAX_INVALID_DATAFILE_EMIT times before running', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + await expect(manager.onRunning()).rejects.toThrow(); + await expect(manager.onTerminated()).rejects.toThrow(); + }); + + it('should resolve onRunning and update config when datafileManager emits valid datafile before \ + emitting invalid datafile MAX_INVALID_DATAFILE_EMIT times', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafile: 'ab', datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT - 1; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); + + await expect(manager.onRunning()).resolves.not.toThrow(); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + }); }); }); @@ -255,16 +289,40 @@ describe('ProjectConfigManagerImpl', () => { await expect(manager.onRunning()).rejects.toThrow('DatafileManager failed to start, reason: test error'); }); - it('should reject onRunning() and onTerminated if datafileManager emits an invalid datafile in the first onUpdate', async () => { + it('should reject onRunning() and onTerminated() if datafileManger emits invalid datafile \ + MAX_INVALID_DATAFILE_EMIT times before running', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); - datafileManager.pushUpdate('foo'); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + await expect(manager.onRunning()).rejects.toThrow(); await expect(manager.onTerminated()).rejects.toThrow(); }); - it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired', async () => { + it('should resolve onRunning and update config when datafile manger emits valid datafile before \ + emitting inbalid datafile MAX_INVALID_DATAFILE_EMIT times', async () => { + const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); + const manager = new ProjectConfigManagerImpl({ datafileManager }); + manager.start(); + + for(let i = 0; i < MAX_INVALID_DATAFILE_EMIT - 1; i++) { + // emit invalid datafile + datafileManager.pushUpdate('ab'); + } + + datafileManager.pushUpdate(JSON.stringify(testData.getTestProjectConfig())); + + await expect(manager.onRunning()).resolves.not.toThrow(); + expect(manager.getConfig()).toEqual(createProjectConfig(JSON.stringify(testData.getTestProjectConfig()))); + }); + + it('should resolve onRunning(), update config and call onUpdate listeners if datafileManager.onUpdate() is fired \ + with valid datafile on the first call', async () => { const datafileManager = getMockDatafileManager({ onRunning: Promise.resolve() }); const manager = new ProjectConfigManagerImpl({ datafileManager }); manager.start(); diff --git a/lib/project_config/project_config_manager.ts b/lib/project_config/project_config_manager.ts index 0985c5c3a..0c11aa31d 100644 --- a/lib/project_config/project_config_manager.ts +++ b/lib/project_config/project_config_manager.ts @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022, 2024, Optimizely + * Copyright 2019-2022, 2024, 2026, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,13 +56,16 @@ export interface ProjectConfigManager extends Service { export const LOGGER_NAME = 'ProjectConfigManager'; +export const MAX_INVALID_DATAFILE_EMIT = 3; + export class ProjectConfigManagerImpl extends BaseService implements ProjectConfigManager { private datafile?: string; private projectConfig?: ProjectConfig; private optimizelyConfig?: OptimizelyConfig; - public jsonSchemaValidator?: Transformer; - public datafileManager?: DatafileManager; + private jsonSchemaValidator?: Transformer; + private datafileManager?: DatafileManager; private eventEmitter: EventEmitter<{ update: ProjectConfig }> = new EventEmitter(); + private datafileManagerInvalidEmit = 0; constructor(config: ProjectConfigManagerConfig) { super(); @@ -170,14 +173,18 @@ export class ProjectConfigManagerImpl extends BaseService implements ProjectConf } catch (err) { this.logger?.error(err); + if (!fromConfig) { + this.datafileManagerInvalidEmit++; + } + // if the state is starting and no datafileManager is provided, we cannot recover. // If the state is starting and the datafileManager has emitted a datafile, // that means a datafile was not provided in config or an invalid datafile was provided, // otherwise the state would have already been set to running synchronously. - // If the first datafile emitted by the datafileManager is invalid, + // If MAX_INVALID_DATAFILE_EMIT number of datafiles emitted by the datafileManager is invalid, // we consider this to be an initialization error as well. - const fatalError = (this.isStarting() && !this.datafileManager) || - (this.isStarting() && !fromConfig); + const fatalError = this.isStarting() + && (!this.datafileManager || this.datafileManagerInvalidEmit >= MAX_INVALID_DATAFILE_EMIT); if (fatalError) { this.handleInitError(new Error(GOT_INVALID_DATAFILE)); } From bd3ea3a649295e40296365ac977c7c3c6b854485 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Tue, 17 Nov 2026 22:30:45 +0600 Subject: [PATCH 36/39] [FSSDK-13442] Settle the close promise after client init failure (#1189) ## Summary After a failed init, `close()` and `onTerminated()` never settled. The failure handler only rejected `startPromise`, and `stop()` does nothing once the client is `Failed`, so awaiting `close()` hung (e.g. with an invalid datafile). - On start failure, reject `stopPromise` with the init error and stop the child services (config manager, event processor, ODP manager) through a shared `stopChildServices()` helper. - `onReady()` clears its timeout in `onRunning().finally()`. Before, a failed init left the timer pending until the timeout (30 s by default), keeping a Node process alive. - Remove the `onReady()` cleanup tasks and `INSTANCE_CLOSED`. `close()` during start already rejects `onRunning()` via `stop()`, so they were redundant. `onReady()` rejects with the same errors as before. `close()` while the client is still starting still resolves. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- lib/optimizely/index.spec.ts | 143 +++++++++++++++++++++++++++++++++- lib/optimizely/index.tests.js | 2 +- lib/optimizely/index.ts | 62 ++++++++------- 3 files changed, 176 insertions(+), 31 deletions(-) diff --git a/lib/optimizely/index.spec.ts b/lib/optimizely/index.spec.ts index de52df270..2b60e3b75 100644 --- a/lib/optimizely/index.spec.ts +++ b/lib/optimizely/index.spec.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; import Optimizely from '.'; import { getMockProjectConfigManager } from '../tests/mock/mock_project_config_manager'; import * as jsonSchemaValidator from '../utils/json_schema_validator'; @@ -32,6 +32,10 @@ import { ImpressionEvent } from '../event_processor/event_builder/user_event'; import { OptimizelyDecideOption } from '../shared_types'; import { NOTIFICATION_TYPES, DECISION_NOTIFICATION_TYPES } from '../notification_center/type'; import { ODP_MANAGER_MISSING } from 'error_message'; +import { resolvablePromise } from '../utils/promise/resolvablePromise'; +import { ServiceState, SERVICE_STOPPED_BEFORE_RUNNING } from '../service'; +import { sprintf } from '../utils/fns'; +import { ProjectConfigManager } from '../project_config/project_config_manager'; const holdoutData = [ @@ -134,6 +138,143 @@ describe('Optimizely', () => { expect(odpManager!.setLogger).toHaveBeenCalledWith(odpManagerChildLogger); }); + describe('start failure', () => { + const getFailingProjectConfigManager = (err: Error) => { + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + onRunning.reject(err); + return getMockProjectConfigManager({ onRunning: onRunning.promise }); + }; + + const getSpiedChildServices = (projectConfigManager: ProjectConfigManager) => { + const eventProcessor = getForwardingEventProcessor(eventDispatcher); + const odpManager = extractOdpManager(createOdpManager({}))!; + + // spy on projectConfigManager.stop only if it is not already a spy + if (!vi.isMockFunction(projectConfigManager.stop)) { + vi.spyOn(projectConfigManager, 'stop'); + } + vi.spyOn(eventProcessor, 'stop'); + vi.spyOn(odpManager, 'stop'); + + return { projectConfigManager, eventProcessor, odpManager }; + }; + + const createClient = ( + projectConfigManager: ProjectConfigManager, + eventProcessor = getForwardingEventProcessor(eventDispatcher), + odpManager = extractOdpManager(createOdpManager({})), + ) => new Optimizely({ + clientEngine: 'node-sdk', + projectConfigManager, + jsonSchemaValidator, + logger, + eventProcessor, + odpManager, + cmabService: {} as any, + }); + + // The onReady() tests below use fake timers and never advance past the timeout, + // so the timeout can't fire. If onReady() waited for it instead of rejecting + // with the start error right away, the test would time out. + afterEach(() => { + vi.useRealTimers(); + }); + + it('should reject onReady() immediately with the start error if start has already failed', async () => { + vi.useFakeTimers(); + const err = new Error('config failed'); + const client = createClient(getFailingProjectConfigManager(err)); + + await expect(client.onRunning()).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + + await expect(client.onReady({ timeout: 30000 })).rejects.toBe(err); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onReady() immediately with the start error if start fails while onReady() is waiting', async () => { + vi.useFakeTimers(); + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + const client = createClient(getMockProjectConfigManager({ onRunning: onRunning.promise })); + + const readyPromise = client.onReady({ timeout: 30000 }); + await vi.advanceTimersByTimeAsync(500); + + const err = new Error('config failed'); + onRunning.reject(err); + + await expect(readyPromise).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onReady() immediately if close() is called while onReady() is waiting', async () => { + vi.useFakeTimers(); + const onRunning = resolvablePromise(); + const client = createClient(getMockProjectConfigManager({ onRunning: onRunning.promise })); + + const readyPromise = client.onReady({ timeout: 30000 }); + await vi.advanceTimersByTimeAsync(500); + + const closePromise = client.close(); + + await expect(readyPromise).rejects.toThrow(sprintf(SERVICE_STOPPED_BEFORE_RUNNING, 'Client')); + await expect(closePromise).resolves.toBeUndefined(); + expect(client.getState()).toBe(ServiceState.Terminated); + expect(vi.getTimerCount()).toBe(0); + }); + + it('should reject onTerminated() and close() with the start error', async () => { + const err = new Error('config failed'); + const client = createClient(getFailingProjectConfigManager(err)); + + await expect(client.onRunning()).rejects.toBe(err); + await expect(client.onTerminated()).rejects.toBe(err); + await expect(client.close()).rejects.toBe(err); + expect(client.getState()).toBe(ServiceState.Failed); + }); + + it('should stop the child services', async () => { + const err = new Error('config failed'); + const { projectConfigManager, eventProcessor, odpManager } = + getSpiedChildServices(getFailingProjectConfigManager(err)); + + const client = createClient(projectConfigManager, eventProcessor, odpManager); + + await expect(client.onRunning()).rejects.toBe(err); + + expect(projectConfigManager.stop).toHaveBeenCalledOnce(); + expect(eventProcessor.stop).toHaveBeenCalledOnce(); + expect(odpManager.stop).toHaveBeenCalledOnce(); + }); + + it('should resolve close() and stop each child service once if close() is called while starting', async () => { + // child services reject onRunning() when stopped before running + const onRunning = resolvablePromise(); + onRunning.promise.catch(() => {}); + const mockConfigManager = getMockProjectConfigManager({ onRunning: onRunning.promise }); + vi.spyOn(mockConfigManager, 'stop').mockImplementation(() => { + onRunning.reject(new Error('stopped before running')); + }); + + const { projectConfigManager, eventProcessor, odpManager } = getSpiedChildServices(mockConfigManager); + + const client = createClient(projectConfigManager, eventProcessor, odpManager); + expect(client.getState()).toBe(ServiceState.Starting); + + await expect(client.close()).resolves.toBeUndefined(); + await expect(client.onRunning()).rejects.toThrow(); + expect(client.getState()).toBe(ServiceState.Terminated); + + // stopped by stop() only, not again by the start failure handler + expect(projectConfigManager.stop).toHaveBeenCalledOnce(); + expect(eventProcessor.stop).toHaveBeenCalledOnce(); + expect(odpManager.stop).toHaveBeenCalledOnce(); + }); + }); + describe('decideAsync', () => { it('should return an error decision with correct reasons if decisionService returns error', async () => { const projectConfig = createProjectConfig(JSON.stringify(getDecisionTestDatafile())); diff --git a/lib/optimizely/index.tests.js b/lib/optimizely/index.tests.js index d1ea1b8b3..a63d327a1 100644 --- a/lib/optimizely/index.tests.js +++ b/lib/optimizely/index.tests.js @@ -47,7 +47,7 @@ import { SERVICE_STOPPED_BEFORE_RUNNING } from 'error_message'; -import { ONREADY_TIMEOUT, INSTANCE_CLOSED } from './'; +import { ONREADY_TIMEOUT } from './'; import { AUDIENCE_EVALUATION_RESULT_COMBINED, USER_NOT_IN_EXPERIMENT, diff --git a/lib/optimizely/index.ts b/lib/optimizely/index.ts index 0d194b08e..b403b99ab 100644 --- a/lib/optimizely/index.ts +++ b/lib/optimizely/index.ts @@ -60,7 +60,7 @@ import { NODE_CLIENT_ENGINE, CLIENT_VERSION, } from '../utils/enums'; -import { Fn, Maybe, OpType } from '../utils/type'; +import { Maybe, OpType } from '../utils/type'; import { resolvablePromise } from '../utils/promise/resolvablePromise'; import { NOTIFICATION_TYPES, DecisionNotificationType, DECISION_NOTIFICATION_TYPES, ActivateListenerPayload } from '../notification_center/type'; @@ -113,7 +113,6 @@ type StringInputs = Partial>; type DecisionReasons = (string | number)[]; -export const INSTANCE_CLOSED = 'Instance closed'; export const ONREADY_TIMEOUT = 'onReady timeout expired after %s ms'; export const INVALID_IDENTIFIER = 'Invalid identifier'; export const INVALID_ATTRIBUTES = 'Invalid attributes'; @@ -142,8 +141,6 @@ export type OptimizelyOptions = { } export default class Optimizely extends BaseService implements Client { - private cleanupTasks: Map = new Map(); - private nextCleanupTaskId = 0; private clientEngine: string; private clientVersion: string; private errorNotifier?: ErrorNotifier; @@ -277,12 +274,32 @@ export default class Optimizely extends BaseService implements Client { this.odpManager?.setVuid(vuid); } }).catch((err) => { - this.state = ServiceState.Failed; this.errorReporter.report(err); - this.startPromise.reject(err); + this.handleStartFailure(err); }); } + private handleStartFailure(err: Error): void { + // If stop() was called while starting, the child services reject their onRunning() + // promises as a result. stop() is responsible for settling the stopPromise in that case. + if (this.isDone()) { + return; + } + + this.state = ServiceState.Failed; + this.startPromise.reject(err); + // stop() is a no-op once the client has failed, so the stopPromise must be settled + // here, otherwise close() / onTerminated() would never settle. + this.stopPromise.reject(err); + this.stopChildServices(); + } + + private stopChildServices(): void { + this.projectConfigManager.stop(); + this.eventProcessor?.stop(); + this.odpManager?.stop(); + } + /** * Returns the project configuration retrieved from projectConfigManager * @return {projectConfig.ProjectConfig} @@ -1300,14 +1317,9 @@ export default class Optimizely extends BaseService implements Client { } this.state = ServiceState.Stopping; - - this.projectConfigManager.stop(); - this.eventProcessor?.stop(); - this.odpManager?.stop(); + this.stopChildServices(); this.notificationCenter.clearAllNotificationListeners(); - this.cleanupTasks.forEach((onClose) => onClose()); - Promise.all([ this.projectConfigManager.onTerminated(), this.eventProcessor ? this.eventProcessor.onTerminated() : Promise.resolve(), @@ -1357,26 +1369,18 @@ export default class Optimizely extends BaseService implements Client { const timeoutPromise = resolvablePromise(); - const cleanupTaskId = this.nextCleanupTaskId++; - - const onReadyTimeout = () => { - this.cleanupTasks.delete(cleanupTaskId); + const readyTimeout = setTimeout(() => { timeoutPromise.reject(new Error( sprintf(ONREADY_TIMEOUT, timeoutValue) )); - }; - - const readyTimeout = setTimeout(onReadyTimeout, timeoutValue); - - this.cleanupTasks.set(cleanupTaskId, () => { - clearTimeout(readyTimeout); - timeoutPromise.reject(new Error(INSTANCE_CLOSED)); - }); - - return Promise.race([this.onRunning().then(() => { - clearTimeout(readyTimeout); - this.cleanupTasks.delete(cleanupTaskId); - }), timeoutPromise]); + }, timeoutValue); + + // onRunning() settles in every case that should end the wait, including + // close() before the client is running, which rejects it via stop(). + return Promise.race([ + this.onRunning().finally(() => clearTimeout(readyTimeout)), + timeoutPromise, + ]); } //============ decide ============// From d3a143820959a4ce1f644cbd4513f9e656fe8b2d Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Thu, 19 Nov 2026 23:31:37 +0600 Subject: [PATCH 37/39] [FSSDK-13450] prepare for release 6.7.1 (#1190) --- CHANGELOG.md | 6 ++++++ lib/utils/enums/index.ts | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97b1ffe56..cc1969182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [6.7.1] - November 19, 2026 + +### Bug Fixes +- Don't fail SDK initialization on the first invalid datafile from the datafile manager; startup now fails only after 3 invalid datafiles arrive before a valid one ([#1188](https://github.com/optimizely/javascript-sdk/pull/1188)) +- Settle the `close()` and `onTerminated()` promises after client initialization fails, and clear the `onReady()` timeout so a failed init no longer keeps a Node process alive ([#1189](https://github.com/optimizely/javascript-sdk/pull/1189)) + ## [6.7.0] - November 3, 2026 ### Changed diff --git a/lib/utils/enums/index.ts b/lib/utils/enums/index.ts index 4beef2f60..e7adcd9f0 100644 --- a/lib/utils/enums/index.ts +++ b/lib/utils/enums/index.ts @@ -44,7 +44,7 @@ export const CONTROL_ATTRIBUTES = { export const JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk'; export const NODE_CLIENT_ENGINE = 'node-sdk'; export const REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk'; -export const CLIENT_VERSION = '6.7.0'; +export const CLIENT_VERSION = '6.7.1'; /* * Represents the source of a decision for feature management. When a feature diff --git a/package-lock.json b/package-lock.json index 49d80d051..cf46beecf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.7.0", + "version": "6.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@optimizely/optimizely-sdk", - "version": "6.7.0", + "version": "6.7.1", "license": "Apache-2.0", "dependencies": { "decompress-response": "^7.0.0", diff --git a/package.json b/package.json index d87aa4e3d..d6bce9084 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/optimizely-sdk", - "version": "6.7.0", + "version": "6.7.1", "description": "JavaScript SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "main": "./dist/index.node.min.js", "browser": "./dist/index.browser.es.min.js", From df9f59a4ad701e74474c172a691cc26f38ccb6d7 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 25 Nov 2026 19:40:22 +0600 Subject: [PATCH 38/39] [FSSDK-13494] Override vitest's tinypool to 2.x (#1192) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Dev dependency updates. None of these packages are part of the published SDK. - **tinypool 1.1.1 → 2.2.0** (via vitest): add an npm `overrides` entry forcing vitest's `tinypool` to `^2.2.0`. 1.1.1 has a prototype pollution advisory. - **vitest `^3.2.4` → `^3.2.7`**: also updates `@vitest/expect`, `mocker`, `pretty-format`, `runner`, `snapshot`, `spy` and `utils` to 3.2.7, and `tinyspy` 4.0.4 → 4.0.6. `estree-walker` is now hoisted instead of nested under `@vitest/mocker`. - **shell-quote 1.8.3 → 1.12.0** (transitive, through `react-native` → `react-devtools-core`, within the existing `^1.6.1` range): lockfile-only update. Every vitest 3 release, including 3.2.7, the latest, depends on `tinypool: ^1.1.1`, so tinypool 2 can't be reached through the lockfile alone. An override is the only way to get it while the root project stays on vitest 3 for Node 18 support. vitest 4 and later don't depend on tinypool at all, but they need a newer Node. Co-authored-by: Claude Opus 5.5 --- package-lock.json | 166 +++++++++++++++++++++++----------------------- package.json | 7 +- 2 files changed, 89 insertions(+), 84 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf46beecf..f67e77129 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "tslib": "^2.8.1", "typescript": "^4.7.4", "vite": "^6.4.1", - "vitest": "^3.2.4", + "vitest": "^3.2.7", "webpack": "^5.94.0" }, "engines": { @@ -2976,15 +2976,15 @@ "license": "ISC" }, "node_modules/@vitest/expect": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", - "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", + "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" }, @@ -3060,47 +3060,10 @@ "node": ">= 14.16" } }, - "node_modules/@vitest/mocker": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz", - "integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@vitest/spy": "3.2.4", - "estree-walker": "^3.0.3", - "magic-string": "^0.30.17" - }, - "funding": { - "url": "https://opencollective.com/vitest" - }, - "peerDependencies": { - "msw": "^2.4.9", - "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" - }, - "peerDependenciesMeta": { - "msw": { - "optional": true - }, - "vite": { - "optional": true - } - } - }, - "node_modules/@vitest/mocker/node_modules/estree-walker": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/estree": "^1.0.0" - } - }, "node_modules/@vitest/pretty-format": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", - "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", + "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", "dev": true, "license": "MIT", "dependencies": { @@ -3111,13 +3074,13 @@ } }, "node_modules/@vitest/runner": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz", - "integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", + "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/utils": "3.2.4", + "@vitest/utils": "3.2.7", "pathe": "^2.0.3", "strip-literal": "^3.0.0" }, @@ -3126,13 +3089,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz", - "integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", + "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.2.4", + "@vitest/pretty-format": "3.2.7", "magic-string": "^0.30.17", "pathe": "^2.0.3" }, @@ -3141,9 +3104,9 @@ } }, "node_modules/@vitest/spy": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", - "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", + "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -3154,13 +3117,13 @@ } }, "node_modules/@vitest/utils": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", - "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", + "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", "dev": true, "license": "MIT", "dependencies": { - "@vitest/pretty-format": "3.2.4", + "@vitest/pretty-format": "3.2.7", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" }, @@ -4846,6 +4809,16 @@ "node": ">=4.0" } }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -8829,9 +8802,9 @@ } }, "node_modules/shell-quote": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", - "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.12.0.tgz", + "integrity": "sha512-PcByqNyT/38F2kDNi006HAMRJaULuBzq/FOsw3qdZvX/GA9W/jamDaRskgHjubHiftXK5sIFxLNkvrXUwcof6Q==", "dev": true, "license": "MIT", "peer": true, @@ -9337,13 +9310,13 @@ } }, "node_modules/tinypool": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", - "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.2.0.tgz", + "integrity": "sha512-jBrmx4lYmaC9k/mgPbylxs7kBUxHtD8256up+HjLaDFfXScKJQyil+SWXSvhAtT7XHo+yTVlpB81PGmHP8oLSQ==", "dev": true, "license": "MIT", "engines": { - "node": "^18.0.0 || >=20.0.0" + "node": "^20.0.0 || >=22.0.0" } }, "node_modules/tinyrainbow": { @@ -9357,9 +9330,9 @@ } }, "node_modules/tinyspy": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.4.tgz", - "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", "dev": true, "license": "MIT", "engines": { @@ -9794,20 +9767,20 @@ } }, "node_modules/vitest": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz", - "integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", + "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/expect": "3.2.4", - "@vitest/mocker": "3.2.4", - "@vitest/pretty-format": "^3.2.4", - "@vitest/runner": "3.2.4", - "@vitest/snapshot": "3.2.4", - "@vitest/spy": "3.2.4", - "@vitest/utils": "3.2.4", + "@vitest/expect": "3.2.7", + "@vitest/mocker": "3.2.7", + "@vitest/pretty-format": "^3.2.7", + "@vitest/runner": "3.2.7", + "@vitest/snapshot": "3.2.7", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", "chai": "^5.2.0", "debug": "^4.4.1", "expect-type": "^1.2.1", @@ -9837,8 +9810,8 @@ "@edge-runtime/vm": "*", "@types/debug": "^4.1.12", "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", - "@vitest/browser": "3.2.4", - "@vitest/ui": "3.2.4", + "@vitest/browser": "3.2.7", + "@vitest/ui": "3.2.7", "happy-dom": "*", "jsdom": "*" }, @@ -9877,6 +9850,33 @@ "assertion-error": "^2.0.1" } }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", + "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, "node_modules/vitest/node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", diff --git a/package.json b/package.json index d6bce9084..c5e0bf1bf 100644 --- a/package.json +++ b/package.json @@ -130,9 +130,14 @@ "tslib": "^2.8.1", "typescript": "^4.7.4", "vite": "^6.4.1", - "vitest": "^3.2.4", + "vitest": "^3.2.7", "webpack": "^5.94.0" }, + "overrides": { + "vitest": { + "tinypool": "^2.2.0" + } + }, "peerDependencies": { "@react-native-async-storage/async-storage": ">=1.0.0 <4.0.0", "@react-native-community/netinfo": ">=5.0.0 <13.0.0", From 7ab324aa1fc1562c53d46cfd055d072c7e7a5fb3 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Mon, 30 Nov 2026 19:59:28 +0600 Subject: [PATCH 39/39] [FSSDK-13494] Harden npm supply chain (#1193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Reduces the risk of a compromised npm package or GitHub Action running in CI or ending up in a published release. - **npm:** `.npmrc` refuses versions published less than 7 days ago, git and URL dependencies, and unknown config keys. `allowScripts` in each `package.json` lists which dependencies may run install scripts. These settings need npm 12, so a shared setup action (`.github/actions/setup-node-npm`) installs it and applies them to every npm command in CI. - **Workflows:** every job uses that action and `npm ci`. Release and GHR backfill skip the npm cache, and release verifies registry signatures before building. Checkouts don't keep credentials on disk, and the Coveralls action is pinned to a commit SHA. Tests still run on Node 18–24 (jobs install with npm 12, then switch Node to run tests). Nothing changes for SDK users. --------- Co-authored-by: Claude Opus 5.5 --- .github/actions/setup-node-npm/action.yml | 57 +++++++ .github/workflows/ghr_backfill.yml | 15 +- .github/workflows/integration_test.yml | 5 +- .github/workflows/javascript.yml | 155 ++++++++++-------- .github/workflows/lint_markdown.yml | 4 +- .github/workflows/release.yml | 20 ++- .npmrc | 23 +++ .nvmrc | 1 + examples/node-commonjs/.npmrc | 1 + examples/node-commonjs/package.json | 7 + examples/typescript/.npmrc | 1 + examples/typescript/package-lock.json | 8 +- examples/typescript/package.json | 12 ++ package.json | 16 ++ scripts/README.md | 9 + scripts/pick-npm-version.js | 92 +++++++++++ scripts/run-cjs-example.js | 13 +- scripts/run-ts-example.js | 2 +- tests/browser/.npmrc | 1 + tests/browser/package.json | 17 ++ .../fixtures/rn-0.73/.npmrc | 1 + .../fixtures/rn-0.73/package.json | 15 ++ .../fixtures/rn-0.87/.npmrc | 1 + .../fixtures/rn-0.87/package.json | 12 ++ 24 files changed, 398 insertions(+), 90 deletions(-) create mode 100644 .github/actions/setup-node-npm/action.yml create mode 100644 .npmrc create mode 100644 .nvmrc create mode 120000 examples/node-commonjs/.npmrc create mode 120000 examples/typescript/.npmrc create mode 100755 scripts/pick-npm-version.js create mode 120000 tests/browser/.npmrc create mode 120000 tests/react-native-metro/fixtures/rn-0.73/.npmrc create mode 120000 tests/react-native-metro/fixtures/rn-0.87/.npmrc diff --git a/.github/actions/setup-node-npm/action.yml b/.github/actions/setup-node-npm/action.yml new file mode 100644 index 000000000..e7e221066 --- /dev/null +++ b/.github/actions/setup-node-npm/action.yml @@ -0,0 +1,57 @@ +name: Set up Node.js and npm +description: > + Installs the latest release of the Node.js version in .nvmrc and npm 12, and + applies the repo's .npmrc supply-chain settings to every npm command in the + job, including the ones run in sub-projects. Jobs that test on another Node + version install and build with this first, then switch Node with + actions/setup-node only to run the tests. + +inputs: + cache: + description: "Package manager to cache downloads for ('npm'), or '' for no cache. The release and GHR backfill jobs use '' so a cache can't affect what gets published." + required: false + default: npm + cache-dependency-path: + description: Lockfile(s) the cache key is computed from. + required: false + default: package-lock.json + +runs: + using: composite + steps: + # .nvmrc gives only the major version. check-latest picks its newest + # release, so CI gets Node.js patches without the file changing. + # By default setup-node also enables the npm cache when package.json's + # devEngines names npm, even with cache: ''. package-manager-cache: false + # turns that off, so only cache: npm enables it. + - name: Set up Node.js (version from .nvmrc) + uses: actions/setup-node@v7 + with: + node-version-file: .nvmrc + check-latest: true + cache: ${{ inputs.cache }} + package-manager-cache: false + cache-dependency-path: ${{ inputs.cache-dependency-path }} + + - name: Install npm and apply the repo's npm settings + shell: bash + env: + # Installs the newest npm of this major version that is at least + # min-release-age days old (see scripts/pick-npm-version.js). + NPM_MAJOR: '12' + run: | + NPM_VERSION=$(node "$GITHUB_WORKSPACE/scripts/pick-npm-version.js" "$NPM_MAJOR") + npm install -g "npm@${NPM_VERSION}" + # Sub-projects read the repo's .npmrc through symlinks. The user config + # also covers projects created during the job, such as + # tests/react-native-metro/.sdk. + cat "$GITHUB_WORKSPACE/.npmrc" >> ~/.npmrc + # In CI, an install script nobody approved or denied fails the install + # instead of only printing a warning. + echo "strict-allow-scripts=true" >> ~/.npmrc + # Forces the public registry even if an .npmrc sets another one. Env + # vars override every .npmrc, but not --registry flags or + # @scope:registry settings (with a lockfile, a scoped registry fails + # the install: allow-remote blocks the mismatched URL). + echo "npm_config_registry=https://registry.npmjs.org/" >> "$GITHUB_ENV" + echo "Node $(node --version), npm $(npm --version)" diff --git a/.github/workflows/ghr_backfill.yml b/.github/workflows/ghr_backfill.yml index fe0141b73..bbbfd79a3 100644 --- a/.github/workflows/ghr_backfill.yml +++ b/.github/workflows/ghr_backfill.yml @@ -35,14 +35,16 @@ jobs: packages: write steps: - name: Checkout branch - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: persist-credentials: false - - name: Set up Node - uses: actions/setup-node@v4 + # No npm cache, so nothing from an earlier run can affect what gets + # published to GHR (same as release.yml). + - name: Set up Node and npm + uses: ./.github/actions/setup-node-npm with: - node-version: 18 + cache: '' - name: Configure GitHub Package Registry auth run: echo "//npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}" >> ~/.npmrc @@ -71,7 +73,10 @@ jobs: # npm pack writes the tarball filename to stdout and notices/errors to # stderr; keep stderr visible so pack failures (auth/404/network) show # in the logs. pipefail (set above) makes a failed pack abort the job. - tarball=$(npm pack "${pkg}@${v}" --registry "$npm_registry" | tail -n1) + # --min-release-age=0 overrides the repo's .npmrc age limit. These are + # our own published versions, and one that just reached npm (e.g. its + # GHR publish failed) must still be copyable. + tarball=$(npm pack "${pkg}@${v}" --registry "$npm_registry" --min-release-age=0 | tail -n1) scripts/publish.sh "$gpr_registry" "$tarball" rm -f "$tarball" echo "::endgroup::" diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 70b391e18..05f725b9e 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -15,13 +15,16 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 with: # You should create a personal access token and store it in your repository token: ${{ secrets.CI_USER_TOKEN }} repository: 'optimizely/travisci-tools' path: 'home/runner/travisci-tools' ref: 'master' + # Don't leave the PAT on disk. The trigger scripts call the GitHub API + # with curl and the token from env, not through git. + persist-credentials: false - name: set SDK Branch if PR env: HEAD_REF: ${{ github.head_ref }} diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 52aba18d8..cc144f195 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -6,6 +6,14 @@ on: pull_request: branches: [ master ] +# Every job installs and builds with the Node version in .nvmrc and npm 12 from +# .github/actions/setup-node-npm, which also applies the .npmrc supply-chain +# settings. Jobs that test other Node versions switch Node only to +# run the tests. +# +# Checkouts use persist-credentials: false so the token isn't left on disk for +# later steps. No job runs authenticated git commands after checkout. + jobs: lint_markdown_files: uses: optimizely/javascript-sdk/.github/workflows/lint_markdown.yml@master @@ -13,72 +21,66 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 with: - node-version: 16 - cache-dependency-path: ./package-lock.json - cache: 'npm' + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci - name: Run linting - working-directory: . - run: | - npm install - npm run lint + run: npm run lint typescript_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 with: - node-version: 20 - cache-dependency-path: ./package-lock.json - cache: 'npm' + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + with: + cache-dependency-path: | + package-lock.json + examples/typescript/package-lock.json + - name: Install dependencies + run: npm ci - name: Run TypeScript example - working-directory: . - run: | - npm install - npm run test-typescript + run: npm run test-typescript commonjs_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node 20 (build) - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 with: - node-version: 20 - cache-dependency-path: ./package-lock.json - cache: 'npm' - - name: Build and pack SDK + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Build, pack, and install the SDK in the example run: | - npm install + npm ci npm pack + npm run test-commonjs -- --skip-build --skip-run - name: Set up Node 18 (runtime test) - uses: actions/setup-node@v3 + uses: actions/setup-node@v7 with: - node-version: '18' + node-version: 18 - name: Run CommonJS example - run: npm run test-commonjs -- --skip-build + working-directory: examples/node-commonjs + run: npm start react_native_metro_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + - uses: ./.github/actions/setup-node-npm with: - node-version: 22 cache-dependency-path: | - ./package-lock.json - ./tests/react-native-metro/fixtures/*/package-lock.json - cache: 'npm' + package-lock.json + tests/react-native-metro/fixtures/*/package-lock.json + - name: Install dependencies + run: npm ci - name: Run React Native Metro tests - run: | - npm install - npm run test-rn-metro + run: npm run test-rn-metro integration_tests: uses: optimizely/javascript-sdk/.github/workflows/integration_test.yml@master @@ -106,19 +108,17 @@ jobs: USE_LOCAL_BROWSER: 'false' TEST_BROWSER: ${{ matrix.browser }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false # Browser and UMD tests run from tests/browser (see its README), which needs Node 22.23.4+. - - name: Set up Node - uses: actions/setup-node@v3 + - uses: ./.github/actions/setup-node-npm with: - node-version: 22 - cache: 'npm' cache-dependency-path: | - ./package-lock.json - ./tests/browser/package-lock.json + package-lock.json + tests/browser/package-lock.json - name: Install SDK dependencies - working-directory: . - run: npm install + run: npm ci - name: Install browser test dependencies id: browser-deps working-directory: ./tests/browser @@ -137,40 +137,52 @@ jobs: generate_messages_test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Node - uses: actions/setup-node@v3 + - uses: actions/checkout@v7 with: - node-version: 20 - cache-dependency-path: ./package-lock.json - cache: 'npm' + persist-credentials: false + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci - name: Test generate-messages script - run: | - npm install - node scripts/test-generate-messages.js + run: node scripts/test-generate-messages.js unit_tests: runs-on: ubuntu-latest strategy: matrix: node: ['18', '20', '22', '24'] + env: + # The Coveralls action, for the Coveralls Parallel step below and the + # finish job. It's a third-party action, so it's pinned to a full commit + # SHA: a tag can be moved to other code (as in the 2025 + # tj-actions/changed-files attack), and both steps get the GITHUB_TOKEN. + # GitHub's own actions (actions/*) use tags. Nothing updates the pin + # automatically. To upgrade, use the commit SHA of the new release tag and + # update the version comment. + # `uses:` doesn't accept ${{ }} expressions, so the steps can't read this + # env var. They reuse the value through the YAML anchor &coveralls-action. + COVERALLS_ACTION: &coveralls-action coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false + # Install with the Node version in .nvmrc and npm 12, then run the tests on + # the matrix version. + - uses: ./.github/actions/setup-node-npm + - name: Install dependencies + run: npm ci - name: Set up Node ${{ matrix.node }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v7 with: node-version: ${{ matrix.node }} - cache: 'npm' - cache-dependency-path: ./package-lock.json + check-latest: true - name: Unit tests - working-directory: . - run: | - npm install - npm run coveralls + run: npm run coveralls + # The pinned Coveralls action from this job's env (see the comment there). - name: Coveralls Parallel - uses: coverallsapp/github-action@master + uses: *coveralls-action with: - github-token: ${{ secrets.GITHUB_TOKEN }} + github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: ./coverage/lcov.info flag-name: run-${{ matrix.node }} # This is a parallel build so need this @@ -184,11 +196,12 @@ jobs: needs: unit_tests runs-on: ubuntu-latest steps: + # The pinned Coveralls action from the unit_tests job's env (see the + # comment there). - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: *coveralls-action with: github-token: ${{ secrets.github_token }} path-to-lcov: ./coverage/lcov.info parallel-finished: true base-path: . - \ No newline at end of file diff --git a/.github/workflows/lint_markdown.yml b/.github/workflows/lint_markdown.yml index af23e15a4..ca7071786 100644 --- a/.github/workflows/lint_markdown.yml +++ b/.github/workflows/lint_markdown.yml @@ -6,7 +6,9 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 + with: + persist-credentials: false - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b79c33b8..d8b7c680f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,17 +18,18 @@ jobs: environment: npm steps: - name: Checkout branch - uses: actions/checkout@v4 + uses: actions/checkout@v7 with: persist-credentials: false - - name: Setup Node - uses: actions/setup-node@v4 + # The Node version in .nvmrc and npm 12 (new enough for OIDC trusted + # publishing), with the .npmrc supply-chain settings. cache: '' means no + # npm cache, so nothing from an earlier run (e.g. a pull request) can + # affect what gets published. + - name: Set up Node and npm + uses: ./.github/actions/setup-node-npm with: - node-version: 22 - - - name: Upgrade npm for OIDC support - run: npm install -g npm@latest + cache: '' # Configure auth for GHR only. npm registry auth is handled by OIDC # (no .npmrc token entry needed — omitting registry-url from setup-node @@ -41,6 +42,11 @@ jobs: - name: Install dependencies run: npm ci --ignore-scripts + # Don't build the published artifact from packages whose registry + # signatures don't verify. + - name: Verify package signatures + run: npm audit signatures + # Test, build, and pack a single tarball. Both registries publish this # same artifact, so npm and GHR receive byte-identical bytes and the test # suite runs only once. --ignore-scripts on pack avoids a rebuild. diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..d22c988d1 --- /dev/null +++ b/.npmrc @@ -0,0 +1,23 @@ +# Supply-chain settings. They need npm 12, which package.json asks for in +# "devEngines": older versions print a warning on every npm command, and ignore +# some or all of these settings. CI installs npm 12: see +# .github/actions/setup-node-npm. +# +# npm only reads the .npmrc in the project's own folder, so every sub-project +# (tests/browser, examples/*, tests/react-native-metro/fixtures/*) has an +# .npmrc that is a symlink to this file. Add one for any new package.json. + +# Don't install a version published less than 7 days ago. Malicious versions +# are usually found and unpublished within that time. +min-release-age=7 + +# No dependencies from git repositories or tarball URLs, only from the registry. +allow-git=none +allow-remote=none + +# Treat unknown keys in .npmrc files as errors instead of ignoring them, so a +# typo can't silently turn off one of the settings above. +strict-npmrc=true + +# Install scripts of dependencies only run if they are approved in the +# "allowScripts" field of package.json (npm approve-scripts / npm deny-scripts). diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..2bd5a0a98 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22 diff --git a/examples/node-commonjs/.npmrc b/examples/node-commonjs/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/examples/node-commonjs/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/examples/node-commonjs/package.json b/examples/node-commonjs/package.json index ef436bad9..a9f0f78a0 100644 --- a/examples/node-commonjs/package.json +++ b/examples/node-commonjs/package.json @@ -5,5 +5,12 @@ "description": "CommonJS example for Optimizely SDK - verifies CJS compatibility", "scripts": { "start": "node index.js" + }, + "devEngines": { + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } } } diff --git a/examples/typescript/.npmrc b/examples/typescript/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/examples/typescript/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/examples/typescript/package-lock.json b/examples/typescript/package-lock.json index 907f416c9..eed17a12f 100644 --- a/examples/typescript/package-lock.json +++ b/examples/typescript/package-lock.json @@ -13,7 +13,9 @@ } }, "node_modules/@types/node": { - "version": "20.19.28", + "version": "20.19.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.43.tgz", + "integrity": "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA==", "dev": true, "license": "MIT", "dependencies": { @@ -22,6 +24,8 @@ }, "node_modules/typescript": { "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true, "license": "Apache-2.0", "bin": { @@ -34,6 +38,8 @@ }, "node_modules/undici-types": { "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "dev": true, "license": "MIT" } diff --git a/examples/typescript/package.json b/examples/typescript/package.json index bbe7c0bdb..b16930297 100644 --- a/examples/typescript/package.json +++ b/examples/typescript/package.json @@ -12,5 +12,17 @@ "devDependencies": { "@types/node": "^20.0.0", "typescript": "^4.7.4" + }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } } } diff --git a/package.json b/package.json index c5e0bf1bf..57727a5f5 100644 --- a/package.json +++ b/package.json @@ -85,6 +85,18 @@ "engines": { "node": ">=18.0.0" }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } + }, "keywords": [ "optimizely" ], @@ -170,5 +182,9 @@ ], "nyc": { "temp-dir": "coverage/raw" + }, + "allowScripts": { + "esbuild": false, + "fsevents": false } } diff --git a/scripts/README.md b/scripts/README.md index 43906185c..7d71ce7a5 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -123,6 +123,15 @@ Tests cover: - Multi-platform file imports (strictest rules) - `__platforms` extraction +## pick-npm-version.js + +Prints the newest npm release of a major version that is at least a minimum number of days old. CI uses it to choose the npm it installs, because the npm that comes with Node.js doesn't support the `min-release-age` setting in `.npmrc`. If you don't pass a minimum age, the script uses the `min-release-age` value from the repo's `.npmrc`, or 7 days if `.npmrc` doesn't set it. Pre-releases and deprecated versions are skipped. + +```bash +node scripts/pick-npm-version.js 12 # minimum age from min-release-age in .npmrc +node scripts/pick-npm-version.js 12 10 # at least 10 days old +``` + --- See [../docs/PLATFORM_ISOLATION.md](../docs/PLATFORM_ISOLATION.md) for detailed documentation on platform isolation rules. diff --git a/scripts/pick-npm-version.js b/scripts/pick-npm-version.js new file mode 100755 index 000000000..94c7fd989 --- /dev/null +++ b/scripts/pick-npm-version.js @@ -0,0 +1,92 @@ +#!/usr/bin/env node + +/** + * Copyright 2026, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Prints the newest npm .x release that is at least days old. +// +// CI installs npm using the npm that comes with Node.js, which doesn't support the +// min-release-age setting in .npmrc, so this applies the same rule to npm itself. The +// minimum age defaults to min-release-age in the repo's .npmrc, or 7 days if that +// isn't set. Pre-releases and +// deprecated versions are skipped. +// +// Usage: node scripts/pick-npm-version.js [min-age-days] + +const fs = require('fs'); +const path = require('path'); + +const REGISTRY = 'https://registry.npmjs.org'; +const DAY_MS = 24 * 60 * 60 * 1000; +// Used if .npmrc has no min-release-age, so a missing setting doesn't let CI +// install an npm release published minutes ago. +const DEFAULT_MIN_AGE_DAYS = 7; + +function readMinReleaseAge() { + const npmrc = fs.readFileSync(path.join(__dirname, '..', '.npmrc'), 'utf8'); + const match = npmrc.match(/^\s*min-release-age\s*=\s*(\d+)\s*$/m); + if (!match) { + console.error(`min-release-age is not set in .npmrc; using ${DEFAULT_MIN_AGE_DAYS} days.`); + return DEFAULT_MIN_AGE_DAYS; + } + return Number(match[1]); +} + +function compareVersions(a, b) { + const pa = a.split('.').map(Number); + const pb = b.split('.').map(Number); + for (let i = 0; i < 3; i++) { + if (pa[i] !== pb[i]) { + return pa[i] - pb[i]; + } + } + return 0; +} + +async function main() { + const [majorArg, minAgeArg] = process.argv.slice(2); + if (!/^\d+$/.test(majorArg || '') || (minAgeArg !== undefined && !/^\d+$/.test(minAgeArg))) { + console.error('Usage: node scripts/pick-npm-version.js [min-age-days]'); + process.exit(2); + } + const major = Number(majorArg); + const minAgeDays = minAgeArg !== undefined ? Number(minAgeArg) : readMinReleaseAge(); + const cutoff = Date.now() - minAgeDays * DAY_MS; + + // The full metadata document: the abbreviated one has no publish times. + const response = await fetch(`${REGISTRY}/npm`, { headers: { accept: 'application/json' } }); + if (!response.ok) { + throw new Error(`GET ${REGISTRY}/npm failed: ${response.status} ${response.statusText}`); + } + const { versions, time } = await response.json(); + + const candidates = Object.keys(versions) + .filter((version) => /^\d+\.\d+\.\d+$/.test(version) && Number(version.split('.')[0]) === major) + .filter((version) => !versions[version].deprecated) + .filter((version) => time[version] && Date.parse(time[version]) <= cutoff) + .sort(compareVersions); + + if (candidates.length === 0) { + console.error(`No npm ${major}.x release is at least ${minAgeDays} day(s) old.`); + process.exit(1); + } + console.log(candidates[candidates.length - 1]); +} + +main().catch((error) => { + console.error(error.message); + process.exit(1); +}); diff --git a/scripts/run-cjs-example.js b/scripts/run-cjs-example.js index 60d275549..7717a9fd9 100644 --- a/scripts/run-cjs-example.js +++ b/scripts/run-cjs-example.js @@ -67,8 +67,13 @@ function findTarball() { return tarballPath; } +// Options: +// --skip-build use the tarball an earlier `npm pack` created instead of installing and packing +// --skip-run install the SDK in the example but don't run it. CI installs with Node 22 (and the +// pinned npm), then switches Node and runs `npm start` in examples/node-commonjs. function main() { const skipBuild = process.argv.includes('--skip-build'); + const skipRun = process.argv.includes('--skip-run'); console.log('=== Building SDK and Running CommonJS Example ===\n'); @@ -90,14 +95,16 @@ function main() { console.log('\nInstalling SDK tarball in cjs-example...'); run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); - console.log('\nRunning cjs-example...'); - run('npm start', exampleDir); + if (!skipRun) { + console.log('\nRunning cjs-example...'); + run('npm start', exampleDir); + } console.log('\nCleaning up tarball...'); fs.unlinkSync(tarballPath); console.log(`Removed: ${path.basename(tarballPath)}`); - console.log('\n=== Example completed successfully! ===\n'); + console.log(skipRun ? '\n=== SDK installed in cjs-example (not run: --skip-run) ===\n' : '\n=== Example completed successfully! ===\n'); } main(); diff --git a/scripts/run-ts-example.js b/scripts/run-ts-example.js index ee1c7255d..824ac791b 100755 --- a/scripts/run-ts-example.js +++ b/scripts/run-ts-example.js @@ -111,7 +111,7 @@ async function main() { console.log(`Created: ${packOutput}`); console.log('\nInstalling ts-example devDependencies...'); - run('npm install', exampleDir); + run('npm ci', exampleDir); console.log('\nInstalling SDK tarball in ts-example...'); run(`npm install --no-save --no-package-lock ${tarballPath}`, exampleDir); diff --git a/tests/browser/.npmrc b/tests/browser/.npmrc new file mode 120000 index 000000000..cba44bb38 --- /dev/null +++ b/tests/browser/.npmrc @@ -0,0 +1 @@ +../../.npmrc \ No newline at end of file diff --git a/tests/browser/package.json b/tests/browser/package.json index 218f55578..8e67c27c5 100644 --- a/tests/browser/package.json +++ b/tests/browser/package.json @@ -5,6 +5,18 @@ "engines": { "node": "^22.23.4 || ^24.22.1 || >=26.12.1" }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.23.4 || ^24.22.1 || >=26.12.1", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } + }, "scripts": { "test-browser": "node ./run.js browser", "test-browser-local": "USE_LOCAL_BROWSER=true node ./run.js browser", @@ -23,5 +35,10 @@ }, "overrides": { "lightningcss": "$lightningcss" + }, + "allowScripts": { + "edgedriver": false, + "geckodriver": false, + "fsevents": false } } diff --git a/tests/react-native-metro/fixtures/rn-0.73/.npmrc b/tests/react-native-metro/fixtures/rn-0.73/.npmrc new file mode 120000 index 000000000..02b5a689b --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.73/.npmrc @@ -0,0 +1 @@ +../../../../.npmrc \ No newline at end of file diff --git a/tests/react-native-metro/fixtures/rn-0.73/package.json b/tests/react-native-metro/fixtures/rn-0.73/package.json index f729bc581..efae91af4 100644 --- a/tests/react-native-metro/fixtures/rn-0.73/package.json +++ b/tests/react-native-metro/fixtures/rn-0.73/package.json @@ -9,5 +9,20 @@ "fast-text-encoding": "1.0.6", "metro": "0.80.12", "metro-config": "0.80.12" + }, + "allowScripts": { + "fsevents": false + }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } } } diff --git a/tests/react-native-metro/fixtures/rn-0.87/.npmrc b/tests/react-native-metro/fixtures/rn-0.87/.npmrc new file mode 120000 index 000000000..02b5a689b --- /dev/null +++ b/tests/react-native-metro/fixtures/rn-0.87/.npmrc @@ -0,0 +1 @@ +../../../../.npmrc \ No newline at end of file diff --git a/tests/react-native-metro/fixtures/rn-0.87/package.json b/tests/react-native-metro/fixtures/rn-0.87/package.json index 2497bab0c..ee934b75c 100644 --- a/tests/react-native-metro/fixtures/rn-0.87/package.json +++ b/tests/react-native-metro/fixtures/rn-0.87/package.json @@ -9,5 +9,17 @@ "fast-text-encoding": "1.0.6", "metro": "0.87.1", "metro-config": "0.87.1" + }, + "devEngines": { + "runtime": { + "name": "node", + "version": "^22.22.2 || ^24.15.0 || >=26.0.0", + "onFail": "warn" + }, + "packageManager": { + "name": "npm", + "version": ">=12.0.0", + "onFail": "warn" + } } }