Skip to content

Commit 86b9857

Browse files
authored
Fix internal lib error by removing path alias (#749)
1 parent 04ed25d commit 86b9857

File tree

11 files changed

+18
-17
lines changed

11 files changed

+18
-17
lines changed

.changeset/sixty-mice-brush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-next': patch
3+
---
4+
5+
Fix internal lib error by removing path alias.

packages/browser/src/browser/__tests__/integration.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-floating-promises */
22
import { cdnSettingsKitchenSink } from '../../test-helpers/fixtures/cdn-settings'
33
import { createMockFetchImplementation } from '../../test-helpers/fixtures/create-fetch-method'
4-
import { Context } from '@/core/context'
5-
import { Plugin } from '@/core/plugin'
4+
import { Context } from '../../core/context'
5+
import { Plugin } from '../../core/plugin'
66
import { JSDOM } from 'jsdom'
77
import { Analytics, InitOptions } from '../../core/analytics'
88
import { LegacyDestination } from '../../plugins/ajs-destination'
@@ -17,7 +17,7 @@ import { PriorityQueue } from '../../lib/priority-queue'
1717
import { getCDN, setGlobalCDNUrl } from '../../lib/parse-cdn'
1818
import { clearAjsBrowserStorage } from '../../test-helpers/browser-storage'
1919
import { parseFetchCall } from '../../test-helpers/fetch-parse'
20-
import { ActionDestination } from '@/plugins/remote-loader'
20+
import { ActionDestination } from '../../plugins/remote-loader'
2121

2222
let fetchCalls: ReturnType<typeof parseFetchCall>[] = []
2323

@@ -208,7 +208,7 @@ describe('Initialization', () => {
208208
})
209209

210210
it('calls page if initialpageview is set', async () => {
211-
jest.mock('@/core/analytics')
211+
jest.mock('../../core/analytics')
212212
const mockPage = jest.fn().mockImplementation(() => Promise.resolve())
213213
Analytics.prototype.page = mockPage
214214

@@ -218,7 +218,7 @@ describe('Initialization', () => {
218218
})
219219

220220
it('does not call page if initialpageview is not set', async () => {
221-
jest.mock('@/core/analytics')
221+
jest.mock('../../core/analytics')
222222
const mockPage = jest.fn()
223223
Analytics.prototype.page = mockPage
224224
await AnalyticsBrowser.load({ writeKey }, { initialPageview: false })

packages/browser/src/browser/__tests__/query-string.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('queryString', () => {
100100
})
101101

102102
it('applies query string logic if window.location.hash is present in different formats', async () => {
103-
jest.mock('@/core/analytics')
103+
jest.mock('../../core/analytics')
104104
const mockQueryString = jest
105105
.fn()
106106
.mockImplementation(() => Promise.resolve())

packages/browser/src/browser/__tests__/standalone-analytics.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const register = jest.fn()
1717
const addSourceMiddleware = jest.fn()
1818
const on = jest.fn()
1919

20-
jest.mock('@/core/analytics', () => ({
20+
jest.mock('../../core/analytics', () => ({
2121
Analytics: (_: unknown, options?: InitOptions): unknown => ({
2222
track,
2323
identify,

packages/browser/src/core/buffer/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '..'
88
import { Analytics } from '../../analytics'
99
import { Context } from '../../context'
10-
import { sleep } from '@/lib/sleep'
10+
import { sleep } from '../../../lib/sleep'
1111
import { User } from '../../user'
1212

1313
describe('PreInitMethodCallBuffer', () => {

packages/browser/src/lib/merged-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JSONObject, Options } from '@/core/events/interfaces'
1+
import { JSONObject, Options } from '../core/events/interfaces'
22
import { LegacySettings } from '../browser'
33

44
/**

packages/browser/src/plugins/ajs-destination/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Integrations, JSONObject } from '@/core/events'
1+
import { Integrations, JSONObject } from '../../core/events'
22
import { Alias, Facade, Group, Identify, Page, Track } from '@segment/facade'
33
import { Analytics, InitOptions } from '../../core/analytics'
44
import { LegacySettings } from '../../browser'

packages/browser/src/plugins/page-enrichment/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Analytics } from '@/core/analytics'
1+
import { Analytics } from '../../../core/analytics'
22
import { pageEnrichment, pageDefaults } from '..'
33

44
let ajs: Analytics

packages/browser/src/plugins/page-enrichment/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Context } from '@/core/context'
2-
import type { Plugin } from '@/core/plugin'
1+
import type { Context } from '../../core/context'
2+
import type { Plugin } from '../../core/plugin'
33

44
interface PageDefault {
55
[key: string]: unknown

packages/browser/tsconfig.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
"resolveJsonModule": true,
88
"lib": ["es2020", "DOM", "DOM.Iterable"],
99
"baseUrl": "./src",
10-
"paths": {
11-
"@/*": ["./*"]
12-
},
1310
"keyofStringsOnly": true
1411
},
1512
"exclude": ["node_modules", "dist"]

0 commit comments

Comments
 (0)