Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: programmatically set agentVersion in identify #1240

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor(agentVersion) dynamically set version
Set the current libp2p version as the default AGENT_VERSION
  • Loading branch information
6d7a committed Jun 10, 2022
commit 633198e830345b6285c153108c68b9d0c7e06562
8 changes: 7 additions & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ import { Mplex } from '@libp2p/mplex'
import { NOISE } from '@chainsafe/libp2p-noise'
import { pipe } from 'it-pipe'
import { createFromJSON } from '@libp2p/peer-id-factory'
import { createRequire } from 'module'

const {version} = createRequire(import.meta.url)('./package.json')

/** @type {import('aegir').PartialOptions} */
export default {
build: {
bundlesizeMax: '147kB'
bundlesizeMax: '147kB',
define: {
'process.env.npm_package_version': JSON.stringify(version)
}
},
test: {
before: async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

export const version = '0.0.0'
export const version = process.env.npm_package_version
export const name = 'libp2p'