Skip to content

Commit

Permalink
chore: consolidate tracked map into metrics part of interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Jun 17, 2023
1 parent b5a6240 commit db5f99c
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 327 deletions.
1 change: 0 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"packages/peer-record":"5.0.4",
"packages/peer-store":"8.2.1",
"packages/stream-multiplexer-mplex":"8.0.4",
"packages/tracked-map":"3.0.3",
"packages/transport-tcp":"7.0.3",
"packages/transport-webrtc":"2.0.10",
"packages/transport-websockets":"6.0.3",
Expand Down
1 change: 0 additions & 1 deletion .release-please.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"packages/peer-record": {},
"packages/peer-store": {},
"packages/stream-multiplexer-mplex": {},
"packages/tracked-map": {},
"packages/transport-tcp": {},
"packages/transport-webrtc": {},
"packages/transport-websockets": {},
Expand Down
9 changes: 8 additions & 1 deletion packages/interface-compliance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build"
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main"
},
"dependencies": {
"@libp2p/interface": "^0.0.1",
Expand Down
18 changes: 16 additions & 2 deletions packages/interface/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
"types": "./dist/src/metrics/index.d.ts",
"import": "./dist/src/metrics/index.js"
},
"./metrics/tracked-map": {
"types": "./dist/src/metrics/tracked-map.d.ts",
"import": "./dist/src/metrics/tracked-map.js"
},
"./peer-discovery": {
"types": "./dist/src/peer-discovery/index.d.ts",
"import": "./dist/src/peer-discovery/index.js"
Expand Down Expand Up @@ -143,7 +147,14 @@
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"build": "aegir build"
"build": "aegir build",
"test": "aegir test",
"test:chrome": "aegir test -t browser --cov",
"test:chrome-webworker": "aegir test -t webworker",
"test:firefox": "aegir test -t browser -- --browser firefox",
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
"test:node": "aegir test -t node --cov",
"test:electron-main": "aegir test -t electron-main"
},
"dependencies": {
"@multiformats/multiaddr": "^12.1.3",
Expand All @@ -155,7 +166,10 @@
"uint8arraylist": "^2.4.3"
},
"devDependencies": {
"aegir": "^39.0.10"
"@types/sinon": "^10.0.15",
"aegir": "^39.0.10",
"sinon": "^15.1.2",
"sinon-ts": "^1.0.0"
},
"typedoc": {
"entryPoint": "./src/index.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Metric, Metrics } from '@libp2p/interface/metrics'
import type { Metric, Metrics } from './index.js'

export interface TrackedMapInit {
name: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'aegir/chai'
import { stubInterface } from 'sinon-ts'
import { trackedMap } from '../src/index.js'
import type { Metric, Metrics } from '@libp2p/interface/metrics'
import { trackedMap } from '../../src/metrics/tracked-map.js'
import type { Metric, Metrics } from '../../src/metrics/index.js'
import type { SinonStubbedInstance } from 'sinon'

describe('tracked-map', () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/interface/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"outDir": "dist"
},
"include": [
"src"
"src",
"test"
]
}
1 change: 0 additions & 1 deletion packages/libp2p/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@
"@libp2p/peer-id-factory": "^2.0.0",
"@libp2p/peer-record": "^5.0.0",
"@libp2p/peer-store": "^8.0.0",
"@libp2p/tracked-map": "^3.0.0",
"@libp2p/utils": "^3.0.0",
"@multiformats/mafmt": "^12.1.2",
"@multiformats/multiaddr": "^12.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p/src/transport-manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CodeError } from '@libp2p/interface/errors'
import { FaultTolerance } from '@libp2p/interface/transport'
import { logger } from '@libp2p/logger'
import { trackedMap } from '@libp2p/tracked-map'
import { trackedMap } from '@libp2p/interface/metrics/tracked-map'
import { codes } from './errors.js'
import type { Libp2pEvents, AbortOptions } from '@libp2p/interface'
import type { Connection } from '@libp2p/interface/connection'
Expand Down
3 changes: 0 additions & 3 deletions packages/libp2p/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@
{
"path": "../stream-multiplexer-mplex"
},
{
"path": "../tracked-map"
},
{
"path": "../transport-tcp"
},
Expand Down
6 changes: 0 additions & 6 deletions packages/tracked-map/.gitignore

This file was deleted.

139 changes: 0 additions & 139 deletions packages/tracked-map/CHANGELOG.md

This file was deleted.

4 changes: 0 additions & 4 deletions packages/tracked-map/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions packages/tracked-map/LICENSE-APACHE

This file was deleted.

19 changes: 0 additions & 19 deletions packages/tracked-map/LICENSE-MIT

This file was deleted.

63 changes: 0 additions & 63 deletions packages/tracked-map/README.md

This file was deleted.

Loading

0 comments on commit db5f99c

Please sign in to comment.