Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

feat: bump aegir and add types #111

Merged
merged 4 commits into from
Feb 8, 2021
Merged

Conversation

acolytec3
Copy link
Contributor

@vasco-santos js-libp2p-crypto was proving to be too big a push for me to do at once so thought I'd take a stab at a more manageable types upgrade so have attempted to follow the patterns linked in previous PRs around adding types via aegir/tsdoc. I've made some minor updates to address typescript specific type safety concerns.

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @acolytec3 ! It was good to start with a simplest module 👍🏼

Left some feedback so that we can have this merged

src/index.js Outdated Show resolved Hide resolved
.gitignore Outdated
@@ -34,7 +34,6 @@ build
node_modules

lib
dist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dist should be ignored. The dist folder will be created on the release script for publishing but should not be part of the repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in this case, do we leave the package.json pointing to dist/src/index.d.ts even though it's no longer included in my PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will be created in the release and what is shipped to npm will include the dist folder

src/index.js Outdated
@@ -6,8 +6,7 @@ const mafmt = require('mafmt')
const { EventEmitter } = require('events')
const debug = require('debug')

const log = debug('libp2p:bootstrap')
log.error = debug('libp2p:bootstrap:error')
const error = debug('libp2p:bootstrap:error')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For keeping consistent with other libp2p repos, I suggest changing this to:

const debug = require('debug')
const log = Object.assign(debug('libp2p:bootstrap'), {
  error: debug('libp2p:bootstrap:error')
})

What do you think? We currently do not use the the normal log, but perhaps we should log when the bootstrap starts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense. I added a log message to the start method in my latest commit.

@acolytec3
Copy link
Contributor Author

@vasco-santos I think I've addressed all the questions. One thing I wasn't sure about is whether I should still include the emitted types in my PR or leave that out since it sounds like that's part of a separate release process. Do those get added when you do the version bump on npm?

@vasco-santos
Copy link
Member

One thing I wasn't sure about is whether I should still include the emitted types in my PR or leave that out since it sounds like that's part of a separate release process. Do those get added when you do the version bump on npm?

Yes, when we run the release script, this will use https://github.com/ipfs/aegir#releasing which on build will create the types in the dist folder. As a result, they will be included in npm and will be fetched when libp2p-bootstrap is installed, but will not exist in this repo

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for getting this @acolytec3

@vasco-santos vasco-santos merged commit 269b807 into libp2p:master Feb 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants