Skip to content

Commit

Permalink
refactor/fix and clean core (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky authored Nov 7, 2022
1 parent 7741b5e commit 409cae4
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 836 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-pots-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@segment/analytics-core': patch
---

Clean up dead code.
7 changes: 5 additions & 2 deletions packages/core-integration-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
Core tests that require AnalyticsBrowser, etc.
This exists because we can't create circular dependencies -- so, for example, installing AnalyticsBrowser as a dev dependency on core.
# Core Integration Tests
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:
- Is a license included in npm pack?
- can you import a module (e.g. is the package.json path correctly to allow consumers to import)?
- are there missing depenndencies in package.json?
3 changes: 1 addition & 2 deletions packages/core-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"packageManager": "yarn@3.2.1",
"devDependencies": {
"@internal/config": "workspace:^",
"@segment/analytics-core": "workspace:^",
"@segment/analytics-next": "workspace:^"
"@segment/analytics-core": "workspace:^"
}
}
236 changes: 0 additions & 236 deletions packages/core-integration-tests/src/plugins/middleware/index.test.ts

This file was deleted.

6 changes: 6 additions & 0 deletions packages/core-integration-tests/src/public-api.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { CoreContext } from '@segment/analytics-core'

it('should be able to import and instantiate some module from core', () => {
// Test the ability to do basic imports
expect(typeof new CoreContext({ type: 'alias' })).toBe('object')
})
2 changes: 2 additions & 0 deletions packages/core-integration-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"extends": "../../tsconfig.json",
"exclude": ["node_modules", "dist"],
"compilerOptions": {
"noUnusedLocals": false,
"noUnusedParameters": false,
"module": "esnext",
"target": "ES5",
"moduleResolution": "node",
Expand Down
Loading

0 comments on commit 409cae4

Please sign in to comment.