Skip to content

Commit 398e858

Browse files
authored
feat: scripts to bump otel-web + session-recorder versions; add version script command (#155)
* feat: script to update version (otel-web) * feat: script to update version (session-recorder) * feat: add version script * docs: add changeset
1 parent 7ec128c commit 398e858

8 files changed

Lines changed: 42 additions & 34 deletions

File tree

.changeset/six-bees-play.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@hyperdx/otel-web-session-recorder': patch
3+
'@hyperdx/otel-web': patch
4+
'@hyperdx/browser': patch
5+
---
6+
7+
feat: scripts to bump otel-web + session-recorder versions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"ci:build": "npx nx run-many --target=build",
1414
"ci:unit": "npx nx run-many --target=ci:unit",
1515
"ci:lint": "npx nx run-many --target=ci:lint",
16+
"version": "changeset version && npx nx run-many --target=postversion",
1617
"release": "npx nx run-many --target=build && yarn changeset publish && git push --follow-tags",
1718
"prepare": "husky install"
1819
},

packages/otel-web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
"scripts": {
66
"start": "npm-run-all -s compile start:_execute",
77
"start:_execute": "node utils/devServer/runDevServer.js",
8+
"prebuild": "npm run postversion",
89
"build": "npm-run-all -s compile:*",
910
"compile": "npm-run-all -s compile:*",
1011
"compile:browser": "rollup -c",
1112
"compile:tsc": "tsc --build tsconfig.cjs.json tsconfig.esm.json",
13+
"postversion": "node ./scripts/version-update.mjs",
1214
"test:unit:watch": "karma start",
1315
"test:unit:ci": "nyc karma start --single-run --no-auto-watch --browsers ChromeHeadless",
1416
"test:unit:ci-node": "env TS_NODE_TRANSPILE_ONLY=true nyc mocha",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { readFileSync, writeFileSync } from 'fs';
2+
import { resolve } from 'path';
3+
4+
// This script is ran when the root package is updated (which happens before child packages)
5+
const packageJsonUrl = resolve(process.cwd(), 'package.json');
6+
const packageJson = JSON.parse(readFileSync(packageJsonUrl));
7+
8+
const content = `
9+
// this is an autogenerated file, see scripts/version-update.js
10+
export const VERSION = '${packageJson.version}';
11+
`;
12+
13+
const fileUrl = resolve(process.cwd(), 'src', 'version.ts');
14+
writeFileSync(fileUrl, content);

packages/otel-web/src/version.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
/*
2-
Copyright 2023 Splunk Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
16-
171
// this is an autogenerated file, see scripts/version-update.js
18-
export const VERSION = '0.16.2-20';
2+
export const VERSION = '0.16.2-next.1';

packages/session-recorder/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
"version": "0.16.2-next.0",
44
"description": "HyperDX distribution OpenTelemetry-based session recording",
55
"scripts": {
6+
"prebuild": "npm run postversion",
67
"build": "npm-run-all -s compile:*",
78
"compile": "npm-run-all -s compile:*",
89
"compile:browser": "rollup -c",
910
"compile:tsc": "tsc --build tsconfig.cjs.json tsconfig.esm.json",
1011
"otlp:compile": "npm-run-all otlp:compile:pbjs otlp:compile:pbts",
1112
"otlp:compile:pbjs": "pbjs -t static-module -w es6 --no-comments -o src/LogsProto.js --force-number opentelemetry-proto/opentelemetry/proto/common/v1/common.proto opentelemetry-proto/opentelemetry/proto/resource/v1/resource.proto opentelemetry-proto/opentelemetry/proto/logs/v1/logs.proto",
1213
"otlp:compile:pbts": "pbjs -t static-module --force-number opentelemetry-proto/opentelemetry/proto/common/v1/common.proto opentelemetry-proto/opentelemetry/proto/resource/v1/resource.proto opentelemetry-proto/opentelemetry/proto/logs/v1/logs.proto | pbts -o src/LogsProto.d.ts -",
14+
"postversion": "node ./scripts/version-update.mjs",
1315
"protoc": "protoc --plugin=../../node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=useOptionals=all --ts_proto_opt= --ts_proto_out=./src opentelemetry-proto/opentelemetry/proto/logs/v1/logs.proto --proto_path=./opentelemetry-proto --ts_proto_opt=forceLong=number --ts_proto_opt=esModuleInterop=true",
1416
"test": "jest"
1517
},
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { readFileSync, writeFileSync } from 'fs';
2+
import { resolve } from 'path';
3+
4+
// This script is ran when the root package is updated (which happens before child packages)
5+
const packageJsonUrl = resolve(process.cwd(), 'package.json');
6+
const packageJson = JSON.parse(readFileSync(packageJsonUrl));
7+
8+
const content = `
9+
// this is an autogenerated file, see scripts/version-update.js
10+
export const VERSION = '${packageJson.version}';
11+
`;
12+
13+
const fileUrl = resolve(process.cwd(), 'src', 'version.ts');
14+
writeFileSync(fileUrl, content);
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
1-
/*
2-
Copyright 2023 Splunk Inc.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
16-
171
// this is an autogenerated file, see scripts/version-update.js
18-
export const VERSION = '0.16.2-20';
2+
export const VERSION = '0.16.2-next.0';

0 commit comments

Comments
 (0)