Skip to content

Commit 409cae4

Browse files
authored
refactor/fix and clean core (#658)
1 parent 7741b5e commit 409cae4

File tree

15 files changed

+19
-836
lines changed

15 files changed

+19
-836
lines changed

.changeset/selfish-pots-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@segment/analytics-core': patch
3+
---
4+
5+
Clean up dead code.
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
Core tests that require AnalyticsBrowser, etc.
2-
This exists because we can't create circular dependencies -- so, for example, installing AnalyticsBrowser as a dev dependency on core.
1+
# Core Integration Tests
2+
This can contain a mix of tests which cover the public API of the package. This can range anywhere from typical integration tests that might stub out the API (which may or may not also be in the package itself), to tests around the specific npm packaged artifact. Examples include:
3+
- Is a license included in npm pack?
4+
- can you import a module (e.g. is the package.json path correctly to allow consumers to import)?
5+
- are there missing depenndencies in package.json?

packages/core-integration-tests/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
"packageManager": "yarn@3.2.1",
1515
"devDependencies": {
1616
"@internal/config": "workspace:^",
17-
"@segment/analytics-core": "workspace:^",
18-
"@segment/analytics-next": "workspace:^"
17+
"@segment/analytics-core": "workspace:^"
1918
}
2019
}

packages/core-integration-tests/src/plugins/middleware/index.test.ts

Lines changed: 0 additions & 236 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { CoreContext } from '@segment/analytics-core'
2+
3+
it('should be able to import and instantiate some module from core', () => {
4+
// Test the ability to do basic imports
5+
expect(typeof new CoreContext({ type: 'alias' })).toBe('object')
6+
})

packages/core-integration-tests/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"extends": "../../tsconfig.json",
33
"exclude": ["node_modules", "dist"],
44
"compilerOptions": {
5+
"noUnusedLocals": false,
6+
"noUnusedParameters": false,
57
"module": "esnext",
68
"target": "ES5",
79
"moduleResolution": "node",

0 commit comments

Comments
 (0)