Skip to content

Commit 7dd1406

Browse files
committed
update add export script
1 parent 954980d commit 7dd1406

File tree

129 files changed

+730
-744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+730
-744
lines changed

.platform-isolation.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Platform Isolation Configuration
3+
*
4+
* Configures which files should be validated by the platform isolation validator.
5+
*/
6+
7+
module.exports = {
8+
// Base directories to scan for source files
9+
include: [
10+
'lib/**/*.ts',
11+
'lib/**/*.js'
12+
],
13+
14+
// Files and patterns to exclude from validation
15+
exclude: [
16+
// Test files
17+
'**/*.spec.ts',
18+
'**/*.test.ts',
19+
'**/*.tests.ts',
20+
'**/*.test.js',
21+
'**/*.spec.js',
22+
'**/*.tests.js',
23+
'**/*.umdtests.js',
24+
'**/*.test-d.ts',
25+
26+
// Generated files
27+
'**/*.gen.ts',
28+
29+
// Type declaration files
30+
'**/*.d.ts',
31+
32+
// Test directories and mocks
33+
'**/__mocks__/**',
34+
'**/tests/**'
35+
]
36+
};

lib/client_factory.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { InMemoryLruCache } from "./utils/cache/in_memory_lru_cache";
3030
import { transformCache, CacheWithRemove } from "./utils/cache/cache";
3131
import { ConstantBackoff } from "./utils/repeater/repeater";
3232

33-
export const __platforms: Platform[] = ['__universal__'];
3433

3534
export type OptimizelyFactoryConfig = Config & {
3635
requestHandler: RequestHandler;
@@ -97,3 +96,5 @@ export const getOptimizelyInstance = (config: OptimizelyFactoryConfig): Optimize
9796

9897
return new Optimizely(optimizelyOptions);
9998
}
99+
100+
export const __platforms: Platform[] = ['__universal__'];

lib/common_exports.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { Platform } from './platform_support';
1616
* limitations under the License.
1717
*/
1818

19-
export const __platforms: Platform[] = ['__universal__'];
2019

2120
export { createStaticProjectConfigManager } from './project_config/config_manager_factory';
2221

@@ -39,3 +38,5 @@ export {
3938
export { NOTIFICATION_TYPES, DECISION_NOTIFICATION_TYPES } from './notification_center/type';
4039

4140
export { OptimizelyDecideOption } from './shared_types';
41+
42+
export const __platforms: Platform[] = ['__universal__'];

lib/core/audience_evaluator/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { CONDITION_EVALUATOR_ERROR, UNKNOWN_CONDITION_TYPE } from 'error_message
2222
import { AUDIENCE_EVALUATION_RESULT, EVALUATING_AUDIENCE} from 'log_message';
2323
import { LoggerFacade } from '../../logging/logger';
2424

25-
export const __platforms: Platform[] = ['__universal__'];
2625

2726
export class AudienceEvaluator {
2827
private logger?: LoggerFacade;
@@ -122,3 +121,5 @@ export default AudienceEvaluator;
122121
export const createAudienceEvaluator = function(UNSTABLE_conditionEvaluators: unknown, logger?: LoggerFacade): AudienceEvaluator {
123122
return new AudienceEvaluator(UNSTABLE_conditionEvaluators, logger);
124123
};
124+
125+
export const __platforms: Platform[] = ['__universal__'];

lib/core/audience_evaluator/odp_segment_condition_evaluator/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { UNKNOWN_MATCH_TYPE } from 'error_message';
1818
import { LoggerFacade } from '../../../logging/logger';
1919
import { Condition, OptimizelyUserContext } from '../../../shared_types';
2020

21-
export const __platforms: Platform[] = ['__universal__'];
2221

2322
const QUALIFIED_MATCH_TYPE = 'qualified';
2423

@@ -69,3 +68,5 @@ function evaluate(condition: Condition, user: OptimizelyUserContext, logger?: Lo
6968
function qualifiedEvaluator(condition: Condition, user: OptimizelyUserContext): boolean {
7069
return user.isQualifiedFor(condition.value as string);
7170
}
71+
72+
export const __platforms: Platform[] = ['__universal__'];

lib/core/bucketer/bucket_value_generator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import murmurhash from 'murmurhash';
1818
import { INVALID_BUCKETING_ID } from 'error_message';
1919
import { OptimizelyError } from '../../error/optimizly_error';
2020

21-
export const __platforms: Platform[] = ['__universal__'];
2221

2322
const HASH_SEED = 1;
2423
const MAX_HASH_VALUE = Math.pow(2, 32);
@@ -41,3 +40,5 @@ export const generateBucketValue = function(bucketingKey: string): number {
4140
throw new OptimizelyError(INVALID_BUCKETING_ID, bucketingKey, ex.message);
4241
}
4342
};
43+
44+
export const __platforms: Platform[] = ['__universal__'];

lib/core/bucketer/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import { OptimizelyError } from '../../error/optimizly_error';
3030
import { generateBucketValue } from './bucket_value_generator';
3131
import { DecisionReason } from '../decision_service';
3232

33-
export const __platforms: Platform[] = ['__universal__'];
3433

3534
export const USER_NOT_IN_ANY_EXPERIMENT = 'User %s is not in any experiment of group %s.';
3635
export const USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP = 'User %s is not in experiment %s of group %s.';
@@ -211,3 +210,5 @@ export default {
211210
bucket: bucket,
212211
bucketUserIntoExperiment: bucketUserIntoExperiment,
213212
};
213+
214+
export const __platforms: Platform[] = ['__universal__'];

lib/core/condition_tree_evaluator/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { Platform } from './../../platform_support';
1616
* limitations under the License. *
1717
***************************************************************************/
1818

19-
export const __platforms: Platform[] = ['__universal__'];
2019

2120
const AND_CONDITION = 'and';
2221
const OR_CONDITION = 'or';
@@ -133,3 +132,5 @@ function orEvaluator<Leaf>(conditions: ConditionTree<Leaf>, leafEvaluator: LeafE
133132
}
134133
return null;
135134
}
135+
136+
export const __platforms: Platform[] = ['__universal__'];

lib/core/custom_attribute_condition_evaluator/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* See the License for the specific language governing permissions and *
1414
* limitations under the License. *
1515
***************************************************************************/
16-
export const __platforms: Platform[] = ['__universal__'];
1716

1817
import { Platform } from './../../platform_support';
1918
import { Condition, OptimizelyUserContext } from '../../shared_types';
@@ -481,3 +480,5 @@ function semverLessThanOrEqualEvaluator(condition: Condition, user: OptimizelyUs
481480
}
482481
return result <= 0;
483482
}
483+
484+
export const __platforms: Platform[] = ['__universal__'];

lib/core/decision/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { DecisionObj } from '../decision_service';
2222
* @param {DecisionObj} decisionObj Object representing decision
2323
* @returns {string} Experiment key or empty string if experiment is null
2424
*/
25-
export const __platforms: Platform[] = ['__universal__'];
2625

2726

2827
export function getExperimentKey(decisionObj: DecisionObj): string {
@@ -64,3 +63,5 @@ export function getExperimentId(decisionObj: DecisionObj): string | null {
6463
export function getVariationId(decisionObj: DecisionObj): string | null {
6564
return decisionObj.variation?.id ?? null;
6665
}
66+
67+
export const __platforms: Platform[] = ['__universal__'];

0 commit comments

Comments
 (0)