Skip to content

Commit 97baa1b

Browse files
separate web and node exports
1 parent 49a6480 commit 97baa1b

File tree

29 files changed

+47
-61
lines changed

29 files changed

+47
-61
lines changed

packages/config/jest/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function getModuleMapper() {
2222
return {
2323
'^@elbwalker/jest$1': getDirectory('config/jest$1', ''),
2424
'^@elbwalker/types': getDirectory('types', 'src'),
25-
'^@elbwalker/utils': getDirectory('utils'),
25+
'^@elbwalker/utils$1': getDirectory('utils$1'),
2626
'^@elbwalker/walker.js': getDirectory('sources/walkerjs'),
2727
'^@elbwalker/destination-web-(.*)$': getDirectory('destinations/web/$1'),
2828
'^@elbwalker/destination-node-(.*)$': getDirectory('destinations/node/$1'),

packages/destinations/node/etag/src/index.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ describe('Destination node etag', () => {
88
jest.mock('@elbwalker/utils', () => ({
99
...jest.requireActual('@elbwalker/utils'),
1010
getId: () => 1337,
11+
}));
12+
jest.mock('@elbwalker/utils/node', () => ({
13+
...jest.requireActual('@elbwalker/utils/node'),
1114
sendNode: mockSend,
1215
}));
1316

packages/destinations/node/etag/src/push.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { WalkerOS } from '@elbwalker/types';
22
import type { Custom, PushFn } from './types';
3-
import { requestToParameter, sendNode } from '@elbwalker/utils';
3+
import { requestToParameter } from '@elbwalker/utils';
4+
import { sendNode } from '@elbwalker/utils/node';
45
import { getParameters } from '@elbwalker/destination-core-etag';
56

67
export const push: PushFn = async function (pushEvent, config) {

packages/destinations/web/api/src/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { DestinationWebAPI } from '.';
33

44
describe('Destination API', () => {
55
const mockSendWeb = jest.fn();
6-
jest.mock('@elbwalker/utils', () => ({
7-
...jest.requireActual('@elbwalker/utils'),
6+
jest.mock('@elbwalker/utils/web', () => ({
7+
...jest.requireActual('@elbwalker/utils/web'),
88
sendWeb: mockSendWeb,
99
}));
1010

packages/destinations/web/api/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Custom, Destination } from './types';
2-
import { isArray, isDefined, sendWeb } from '@elbwalker/utils';
3-
2+
import { isArray, isDefined } from '@elbwalker/utils';
3+
import { sendWeb } from '@elbwalker/utils/web';
44
// Types
55
export * as DestinationWebAPI from './types';
66

packages/destinations/web/api/src/types/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import type { WalkerOS } from '@elbwalker/types';
2-
import type {
3-
SendDataValue,
4-
SendHeaders,
5-
SendWebTransport,
6-
} from '@elbwalker/utils';
2+
import type { SendDataValue, SendHeaders } from '@elbwalker/utils';
3+
import type { SendWebTransport } from '@elbwalker/utils/web';
4+
75
import type { DestinationWeb } from '@elbwalker/walker.js';
86

97
export interface Destination

packages/destinations/web/etag/src/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ describe('Destination web etag', () => {
88
jest.mock('@elbwalker/utils', () => ({
99
...jest.requireActual('@elbwalker/utils'),
1010
getId: () => 1337,
11+
}));
12+
13+
jest.mock('@elbwalker/utils/web', () => ({
14+
...jest.requireActual('@elbwalker/utils/web'),
1115
sendWebAsFetch: mockSend,
1216
}));
1317

packages/destinations/web/etag/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import type { Custom, Destination } from './types';
22
import type { DestinationCoreEtag } from '@elbwalker/destination-core-etag';
33
import { getParameters } from '@elbwalker/destination-core-etag';
4-
import { requestToParameter, sendWebAsFetch } from '@elbwalker/utils';
4+
import { requestToParameter } from '@elbwalker/utils';
5+
import { sendWebAsFetch } from '@elbwalker/utils/web';
56

67
// Types
78
export * as DestinationWebEtag from './types';

packages/destinations/web/plausible/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { elb, Walkerjs } from '@elbwalker/walker.js';
21
import type { DestinationPlausible } from '.';
2+
import { elb, Walkerjs } from '@elbwalker/walker.js';
33
import { getEvent } from '@elbwalker/utils';
44

55
describe('destination plausible', () => {

packages/sources/walkerjs/src/__tests__/elblayer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { elb, Walkerjs } from '..';
2-
import { mockDataLayer } from '@elbwalker/jest/web.setup';
31
import type { SourceWalkerjs, DestinationWeb, Elb } from '..';
42
import type { WalkerOS } from '@elbwalker/types';
3+
import { mockDataLayer } from '@elbwalker/jest/web.setup';
4+
import { elb, Walkerjs } from '..';
55

66
describe('elbLayer', () => {
77
const w = window;

0 commit comments

Comments
 (0)