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

Synchronize package version with constant #41

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"lint": "eslint src/ __tests__/",
"pretest": "npm run build",
"test": "jest",
"version": "echo \"export const Version = '$npm_package_version'\" > src/version.ts && git add src/version.ts && npm run build",
"prepublishOnly": "npm run build",
"postpublish": "npm publish --ignore-scripts --@planetscale:registry='https://npm.pkg.github.com'"
},
Expand Down
5 changes: 2 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { format } from './sanitization.js'
export { format } from './sanitization.js'
export { hex } from './text.js'
import { decode } from './text.js'

const PACKAGE_VERSION = '0.5.0'
import { Version } from './version.js'

type ReqInit = Pick<RequestInit, 'method' | 'headers'> & {
body: string
Expand Down Expand Up @@ -180,7 +179,7 @@ async function postJSON<T>(config: Config, url: string | URL, body = {}): Promis
body: JSON.stringify(body),
headers: {
'Content-Type': 'application/json',
'User-Agent': `database-js/${PACKAGE_VERSION}`,
'User-Agent': `database-js/${Version}`,
Authorization: `Basic ${auth}`
}
})
Expand Down
1 change: 1 addition & 0 deletions src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const Version = '0.6.0'