Skip to content

refactor: Consolidate event-processor package into optimizely-sdk #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 67 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
92e3ab7
utils integrated
ozayr-zaviar Mar 2, 2022
37cab7b
logging integrated
ozayr-zaviar Mar 14, 2022
1d5368c
testcases fix
ozayr-zaviar Mar 14, 2022
82b0fa1
revert logging
ozayr-zaviar Mar 25, 2022
2843dcc
utils merged in optimizely sdk
ozayr-zaviar Mar 25, 2022
8574c7e
small changes removed
ozayr-zaviar Mar 25, 2022
f725a21
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar Mar 28, 2022
28905d0
ts config added because jest and mocha use similar declarations
ozayr-zaviar Mar 28, 2022
11518e1
type warning fixed
ozayr-zaviar Mar 28, 2022
d3371ce
more types fixed
ozayr-zaviar Mar 28, 2022
da73e11
fix
ozayr-zaviar Mar 28, 2022
069e501
fix
ozayr-zaviar Mar 28, 2022
bc6d5fb
fix
ozayr-zaviar Mar 28, 2022
3b758bd
type defined
ozayr-zaviar Mar 28, 2022
73e1db8
type fix
ozayr-zaviar Mar 28, 2022
d41146d
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar Apr 12, 2022
550c3ba
headers updated
ozayr-zaviar Apr 12, 2022
39b5d69
fix
ozayr-zaviar Apr 12, 2022
d00a828
correct notification type imported
ozayr-zaviar Apr 12, 2022
c958cda
comment addressed
ozayr-zaviar Apr 12, 2022
c36dee9
headers updated and notification center moved
ozayr-zaviar Apr 13, 2022
19d1ca0
comments addressed
ozayr-zaviar Apr 14, 2022
6622d21
removed Notification center interface
ozayr-zaviar Apr 18, 2022
71f7e14
notification center renamed
ozayr-zaviar Apr 18, 2022
4b9c124
notification type corrected
ozayr-zaviar Apr 18, 2022
9e3d8d4
renamed a conflicting interface
zashraf1985 Apr 19, 2022
bef10a0
removed unused line
zashraf1985 Apr 19, 2022
dcdd371
comments addressed
ozayr-zaviar Apr 21, 2022
4fc4b51
fns exported in same import
ozayr-zaviar Apr 21, 2022
201800e
intergrate logging
ozayr-zaviar Mar 14, 2022
e55fdc0
testcases fix
ozayr-zaviar Mar 14, 2022
0146bf1
logging rollup corrected
ozayr-zaviar Mar 25, 2022
65a3f0a
rollup fixed
ozayr-zaviar Apr 26, 2022
d594c09
fixed some build issues
zashraf1985 Apr 26, 2022
a8e7858
comment addressed
ozayr-zaviar Apr 28, 2022
def50b4
headers updated
ozayr-zaviar Apr 28, 2022
0d088e7
logging path corrected
ozayr-zaviar Apr 28, 2022
0bb709c
Merge branch 'master' into uzair/consolidate-packages
ozayr-zaviar Apr 28, 2022
f352bc6
Merge branch 'uzair/consolidate-packages' into uzair/consolidate-log
ozayr-zaviar Apr 28, 2022
f36baf4
comments addressed
ozayr-zaviar May 5, 2022
aa90124
Merge branch 'uzair/consolidate-packages' into uzair/consolidate-log
ozayr-zaviar May 9, 2022
26f2b0a
event processor consolidated
ozayr-zaviar May 16, 2022
2718f0f
lint fixed
ozayr-zaviar May 18, 2022
673dd95
Merge branch 'master' into uzair/consolidate-event
ozayr-zaviar Aug 4, 2022
3bca0f9
fix
ozayr-zaviar Aug 4, 2022
32d2909
react native event processor seperate package for entry point
ozayr-zaviar Aug 5, 2022
241a869
refactor
ozayr-zaviar Aug 10, 2022
1658fcf
Update rollup.config.js
ozayr-zaviar Aug 10, 2022
19f9cf3
added peer depencies in rollup config
zashraf1985 Aug 10, 2022
7337ddc
Update package.json
ozayr-zaviar Aug 11, 2022
942e564
Merge branch 'uzair/consolidate-event' of github.com:optimizely/javas…
Aug 11, 2022
829e0c2
Update package.json
ozayr-zaviar Aug 11, 2022
7be6d84
Update package.json
ozayr-zaviar Aug 11, 2022
233461f
Update package.json
ozayr-zaviar Aug 11, 2022
63a135d
sinon converted
ozayr-zaviar Aug 12, 2022
6b17765
changes
ozayr-zaviar Aug 16, 2022
01960f1
fix
ozayr-zaviar Aug 16, 2022
a4984fe
Merge branch 'master' into uzair/consolidate-event
ozayr-zaviar Aug 16, 2022
e953869
remove react package
ozayr-zaviar Aug 16, 2022
731e448
Update pendingEventsDispatcher.ts
ozayr-zaviar Aug 16, 2022
9c2afd4
ts fix
ozayr-zaviar Aug 16, 2022
2326aec
Update async-storage.ts
ozayr-zaviar Aug 16, 2022
0c4836b
lint fix
ozayr-zaviar Aug 17, 2022
4eaf85e
type casting
ozayr-zaviar Aug 17, 2022
08a6a56
Update package.json
ozayr-zaviar Aug 17, 2022
1d73745
Update v1EventProcessor.react_native.ts
ozayr-zaviar Aug 17, 2022
03814a8
extra packages removed
ozayr-zaviar Aug 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,073 changes: 5,073 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* Copyright 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.
*/
let items: {[key: string]: string} = {}

export default class AsyncStorage {

static getItem(key: string, callback?: (error?: Error, result?: string) => void): Promise<string | null> {
return new Promise(resolve => {
setTimeout(() => resolve(items[key] || null), 1)
})
}

static setItem(key: string, value: string, callback?: (error?: Error) => void): Promise<void> {
return new Promise((resolve) => {
setTimeout(() => {
items[key] = value
resolve()
}, 1)
})
}

static removeItem(key: string, callback?: (error?: Error, result?: string) => void): Promise<string | null> {
return new Promise(resolve => {
setTimeout(() => {
items[key] && delete items[key]
// @ts-ignore
resolve()
}, 1)
})
}

static dumpItems(): {[key: string]: string} {
return items
}

static clearStore(): void {
items = {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright 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.
*/
let localCallback: any

export function addEventListener(callback: any) {
localCallback = callback
}

export function triggerInternetState(isInternetReachable: boolean) {
localCallback({ isInternetReachable })
}
4 changes: 2 additions & 2 deletions packages/optimizely-sdk/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
"transform": {
"^.+\\.tsx?$": "ts-jest"
"^.+\\.(ts|tsx|js|jsx)$": "ts-jest",
},
"testRegex": "(/tests/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
Expand All @@ -10,5 +10,5 @@ module.exports = {
"jsx",
"json",
"node"
],
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2021 Optimizely
* Copyright 2021-2022, Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ import {
EventTags,
ConversionEvent,
ImpressionEvent,
} from '@optimizely/js-sdk-event-processor';
} from '../../modules/event_processor';

import { Event } from '../../shared_types';

Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/core/event_builder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/
import { LoggerFacade } from '../../modules/logging';
import { EventV1 as CommonEventParams } from '@optimizely/js-sdk-event-processor';
import { EventV1 as CommonEventParams } from '../../modules/event_processor';

import fns from '../../utils/fns';
import { CONTROL_ATTRIBUTES, RESERVED_EVENT_KEYWORDS } from '../../utils/enums';
Expand Down
2 changes: 1 addition & 1 deletion packages/optimizely-sdk/lib/index.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
getErrorHandler,
LogLevel
} from './modules/logging';
import { LocalStoragePendingEventsDispatcher } from '@optimizely/js-sdk-event-processor';
import { LocalStoragePendingEventsDispatcher } from '../lib/modules/event_processor';
import configValidator from './utils/config_validator';
import defaultErrorHandler from './plugins/error_handler';
import defaultEventDispatcher from './plugins/event_dispatcher/index.browser';
Expand Down
Loading