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

chore: add version script to all packages #651

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion packages/opentelemetry-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"clean": "rimraf build/*",
"check": "gts check",
"precompile": "tsc --version",
"compile": "tsc -p .",
"version:update": "node scripts/version-update.js",
"compile": "npm run version:update && tsc -p .",
"fix": "gts fix",
"prepare": "npm run compile"
},
Expand Down
47 changes: 47 additions & 0 deletions packages/opentelemetry-base/scripts/version-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const license =
`/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`;

const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '${pjson.version}';
`;

fs.writeFileSync(fileUrl, `${license}${content}`);
2 changes: 1 addition & 1 deletion packages/opentelemetry-core/scripts/version-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/common/version.ts`);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export * from './common/ConsoleLogger';
export * from './common/NoopLogger';
export * from './common/time';
export * from './common/types';
export * from './common/version';
export * from './version';
export * from './context/propagation/B3Format';
export * from './context/propagation/BinaryTraceContext';
export * from './context/propagation/HttpTraceContext';
Expand Down
18 changes: 18 additions & 0 deletions packages/opentelemetry-core/src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.3.1';
3 changes: 2 additions & 1 deletion packages/opentelemetry-exporter-jaeger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"clean": "rimraf build/*",
"check": "gts check",
"precompile": "tsc --version",
"compile": "tsc -p .",
"version:update": "node scripts/version-update.js",
"compile": "npm run version:update && tsc -p .",
"fix": "gts fix",
"prepare": "npm run compile"
},
Expand Down
47 changes: 47 additions & 0 deletions packages/opentelemetry-exporter-jaeger/scripts/version-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const license =
`/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`;

const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '${pjson.version}';
`;

fs.writeFileSync(fileUrl, `${license}${content}`);
18 changes: 18 additions & 0 deletions packages/opentelemetry-exporter-jaeger/src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.3.1';
3 changes: 2 additions & 1 deletion packages/opentelemetry-exporter-prometheus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"clean": "rimraf build/*",
"check": "gts check",
"precompile": "tsc --version",
"compile": "tsc -p .",
"version:update": "node scripts/version-update.js",
"compile": "npm run version:update && tsc -p .",
"fix": "gts fix",
"prepare": "npm run compile"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const license =
`/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`;

const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '${pjson.version}';
`;

fs.writeFileSync(fileUrl, `${license}${content}`);
18 changes: 18 additions & 0 deletions packages/opentelemetry-exporter-prometheus/src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.3.1';
3 changes: 2 additions & 1 deletion packages/opentelemetry-exporter-zipkin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"check": "gts check",
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p ../../",
"precompile": "tsc --version",
"compile": "tsc -p .",
"version:update": "node scripts/version-update.js",
"compile": "npm run version:update && tsc -p .",
"fix": "gts fix",
"prepare": "npm run compile"
},
Expand Down
47 changes: 47 additions & 0 deletions packages/opentelemetry-exporter-zipkin/scripts/version-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const license =
`/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`;

const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '${pjson.version}';
`;

fs.writeFileSync(fileUrl, `${license}${content}`);
18 changes: 18 additions & 0 deletions packages/opentelemetry-exporter-zipkin/src/version.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// this is autogenerated file, see scripts/version-update.js
export const VERSION = '0.3.1';
3 changes: 2 additions & 1 deletion packages/opentelemetry-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"clean": "rimraf build/*",
"check": "gts check",
"precompile": "tsc --version",
"compile": "tsc -p .",
"version:update": "node scripts/version-update.js",
"compile": "npm run version:update && tsc -p .",
"fix": "gts fix",
"prepare": "npm run compile"
},
Expand Down
47 changes: 47 additions & 0 deletions packages/opentelemetry-metrics/scripts/version-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

const license =
`/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
`;

const fs = require('fs');
const path = require('path');

const appRoot = path.resolve(__dirname);
const fileUrl = path.resolve(`${appRoot}/../src/version.ts`);
const packageJsonUrl = path.resolve(`${appRoot}/../package.json`);
const pjson = require(packageJsonUrl);
const content = `
// this is autogenerated file, see scripts/version-update.js
export const VERSION = '${pjson.version}';
`;

fs.writeFileSync(fileUrl, `${license}${content}`);
Loading