Skip to content

Commit b317068

Browse files
authored
[FSSDK-9611] fix relative import paths that goes out of lib (#856)
we are bundling our package, and type definiton of all our dependencies are in dev-dependencies as they should be and therefore not installed when clients install our sdk.compiling our lib files will need those type definitions. so files in our dist must not refer to the lib files, but some of them do refer to the lib files. and consumers are getting missing types as a result. files in /dist was referring to files in /lib because some relative import paths were going out of lib and then back in. as the path strings were preserved in the built files in dist, it was going out of /dist and into /lib. This commit fixes those relative import paths to stay inside /lib
1 parent b85af27 commit b317068

File tree

12 files changed

+53
-23
lines changed

12 files changed

+53
-23
lines changed

lib/core/odp/odp_config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { checkArrayEquality } from '../../../lib/utils/fns';
17+
import { checkArrayEquality } from '../../utils/fns';
1818

1919
export class OdpConfig {
2020
/**

lib/modules/datafile-manager/httpPollingDatafileManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { getLogger } from '../logging';
18-
import { sprintf } from '../../../lib/utils/fns';
18+
import { sprintf } from '../../utils/fns';
1919
import { DatafileManager, DatafileManagerConfig, DatafileUpdate } from './datafileManager';
2020
import EventEmitter, { Disposer } from './eventEmitter';
2121
import { AbortableRequest, Response, Headers } from './http';
@@ -24,7 +24,7 @@ import BackoffController from './backoffController';
2424
import PersistentKeyValueCache from './persistentKeyValueCache';
2525

2626
import { NotificationRegistry } from './../../core/notification_center/notification_registry';
27-
import { NOTIFICATION_TYPES } from '../../../lib/utils/enums';
27+
import { NOTIFICATION_TYPES } from '../../utils/enums';
2828

2929
const logger = getLogger('DatafileManager');
3030

lib/optimizely/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ import {
6969
ODP_USER_KEY,
7070
} from '../utils/enums';
7171

72-
import { BrowserOdpManager } from '../../lib/plugins/odp_manager/index.browser';
73-
7472
const MODULE_NAME = 'OPTIMIZELY';
7573

7674
const DEFAULT_ONREADY_TIMEOUT = 30000;

lib/optimizely_user_context/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
* See the License for the specific language governing permissions and *
1414
* limitations under the License. *
1515
***************************************************************************/
16-
import Optimizely from '../../lib/optimizely';
16+
import Optimizely from '../optimizely';
1717
import {
1818
EventTags,
1919
OptimizelyDecideOption,
2020
OptimizelyDecision,
2121
OptimizelyDecisionContext,
2222
OptimizelyForcedDecision,
2323
UserAttributes,
24-
} from '../../lib/shared_types';
24+
} from '../shared_types';
2525
import { CONTROL_ATTRIBUTES } from '../utils/enums';
2626
import { OptimizelySegmentOption } from '../core/odp/optimizely_segment_option';
2727

lib/plugins/event_processor/forwarding_event_processor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2021-2022, Optimizely
2+
* Copyright 2021-2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
1717
import {
1818
EventProcessor,
1919
ProcessableEvent,
20-
} from '../../../lib/modules/event_processor';
20+
} from '../../modules/event_processor';
2121
import { NotificationSender } from '../../core/notification_center';
2222

2323
import { EventDispatcher } from '../../shared_types';

lib/plugins/event_processor/index.react_native.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2022, Optimizely
2+
* Copyright 2022-2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { LogTierV1EventProcessor, LocalStoragePendingEventsDispatcher } from '../../../lib/modules/event_processor/index.react_native';
17+
import { LogTierV1EventProcessor, LocalStoragePendingEventsDispatcher } from '../../modules/event_processor/index.react_native';
1818

1919
export function createEventProcessor(
2020
...args: ConstructorParameters<typeof LogTierV1EventProcessor>

lib/plugins/event_processor/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2020, 2022, Optimizely
2+
* Copyright 2020, 2022-2023 Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { LogTierV1EventProcessor, LocalStoragePendingEventsDispatcher } from '../../../lib/modules/event_processor';
17+
import { LogTierV1EventProcessor, LocalStoragePendingEventsDispatcher } from '../../modules/event_processor';
1818

1919
export function createEventProcessor(
2020
...args: ConstructorParameters<typeof LogTierV1EventProcessor>

lib/plugins/odp/event_manager/index.browser.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
import { IOdpEventManager, OdpEventManager } from '../../../../lib/core/odp/odp_event_manager';
1+
/**
2+
* Copyright 2023, Optimizely
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { IOdpEventManager, OdpEventManager } from '../../../core/odp/odp_event_manager';
218
import { LogLevel } from '../../../modules/logging';
319
import { OdpEvent } from "../../../core/odp/odp_event";
420

lib/plugins/odp/event_manager/index.node.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1-
import { OdpEvent } from '../../../../lib/core/odp/odp_event';
2-
import { IOdpEventManager, OdpEventManager } from '../../../../lib/core/odp/odp_event_manager';
3-
import { LogLevel } from '../../../../lib/modules/logging';
1+
/**
2+
* Copyright 2023, Optimizely
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { OdpEvent } from '../../../core/odp/odp_event';
18+
import { IOdpEventManager, OdpEventManager } from '../../../core/odp/odp_event_manager';
19+
import { LogLevel } from '../../../modules/logging';
420

521
const DEFAULT_BATCH_SIZE = 10;
622
const DEFAULT_FLUSH_INTERVAL_MSECS = 1000;

lib/plugins/odp_manager/index.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
} from '../../utils/enums';
2929

3030
import { OdpManager } from '../../core/odp/odp_manager';
31-
import { OdpOptions } from '../../../lib/shared_types';
31+
import { OdpOptions } from '../../shared_types';
3232
import { NodeOdpEventApiManager } from '../odp/event_api_manager/index.node';
3333
import { NodeOdpEventManager } from '../odp/event_manager/index.node';
3434
import { OdpSegmentManager } from '../../core/odp/odp_segment_manager';

0 commit comments

Comments
 (0)