chore(tracker): fix assist build and version ingestion

This commit is contained in:
nick-delirium 2023-10-27 17:00:33 +02:00
parent a62bd95d9d
commit 811dcc8c8c
5 changed files with 11 additions and 9 deletions

Binary file not shown.

View file

@ -15,19 +15,18 @@
"scripts": {
"tsrun": "tsc",
"lint": "eslint src --ext .ts,.js --fix --quiet",
"build": "npm run build-es && npm run build-cjs",
"build-es": "rm -Rf lib && tsc && npm run replace-versions",
"build-cjs": "rm -Rf cjs && tsc --project tsconfig-cjs.json && echo '{ \"type\": \"commonjs\" }' > cjs/package.json && npm run replace-paths && npm run replace-versions",
"build": "bun run replace-pkg-version && bun run build-es && bun run build-cjs",
"build-es": "rm -Rf lib && tsc && bun run replace-req-version",
"build-cjs": "rm -Rf cjs && tsc --project tsconfig-cjs.json && echo '{ \"type\": \"commonjs\" }' > cjs/package.json && bun run replace-paths && bun run replace-req-version",
"replace-paths": "replace-in-files cjs/* --string='@openreplay/tracker' --replacement='@openreplay/tracker/cjs' && replace-in-files cjs/* --string='/lib/' --replacement='/'",
"replace-versions": "npm run replace-pkg-version && npm run replace-req-version",
"replace-pkg-version": "replace-in-files lib/* cjs/* --string='PACKAGE_VERSION' --replacement=$npm_package_version",
"replace-req-version": "replace-in-files lib/* cjs/* --string='REQUIRED_TRACKER_VERSION' --replacement='8.0.0'",
"prepublishOnly": "npm run build",
"replace-pkg-version": "sh pkgver.sh",
"replace-req-version": "replace-in-files lib/* cjs/* --string='REQUIRED_TRACKER_VERSION' --replacement='9.0.0'",
"prepublishOnly": "bun run build",
"prepare": "cd ../../ && husky install tracker/.husky/",
"lint-front": "lint-staged",
"test": "jest --coverage=false",
"test:ci": "jest --coverage=true",
"postversion": "npm run build"
"postversion": "bun run build"
},
"dependencies": {
"csstype": "^3.0.10",

View file

@ -0,0 +1 @@
sed -n 's/.*"version": *"\([^"]*\)".*/export const pkgVersion = "\1";/p' package.json > src/version.ts

View file

@ -13,6 +13,7 @@ import ConfirmWindow from './ConfirmWindow/ConfirmWindow.js'
import { callConfirmDefault, } from './ConfirmWindow/defaults.js'
import type { Options as ConfirmOptions, } from './ConfirmWindow/defaults.js'
import ScreenRecordingState from './ScreenRecordingState.js'
import { pkgVersion, } from './version.js'
// TODO: fully specified strict check with no-any (everywhere)
// @ts-ignore
@ -63,7 +64,7 @@ type Agent = {
export default class Assist {
readonly version = 'PACKAGE_VERSION'
readonly version = pkgVersion
private socket: Socket | null = null
private peer: Peer | null = null

View file

@ -0,0 +1 @@
export const pkgVersion = '6.0.3'