Skip to content

Commit 0d93394

Browse files
api-clients-generation-pipeline[bot]jirikuncarci.datadog-api-spec
authored
typescript: make version.ts generated (#220)
* dynamic version file * Regenerate client from commit 89a8fcc of spec repo Co-authored-by: Jiri Kuncar <[email protected]> Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 75e9311 commit 0d93394

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev11",
7-
"regenerated": "2021-07-14 09:09:02.529056",
8-
"spec_repo_commit": "f0a4221"
7+
"regenerated": "2021-07-14 13:00:30.295886",
8+
"spec_repo_commit": "89a8fcc"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-07-14 09:10:15.078678",
13-
"spec_repo_commit": "f0a4221"
12+
"regenerated": "2021-07-14 13:01:44.610020",
13+
"spec_repo_commit": "89a8fcc"
1414
}
1515
}
1616
}

.generator/templates/http/http.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { userAgent } from '../../../version';
1+
import { userAgent } from '../../../userAgent';
22
{{#platforms}}
33
{{#node}}
44
// TODO: evaluate if we can easily get rid of this library

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ package-lock.json
55

66
examples
77

8+
# version.ts file is generated by prebuild script
9+
version.ts
10+
811
*.js
912
*.js.map
1013
*.d.ts

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
}
3939
},
4040
"scripts": {
41+
"prebuild": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > version.ts",
4142
"build": "tsc",
4243
"check-licenses": "node bin/check-licenses.js",
4344
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",

packages/datadog-api-client-v1/http/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { userAgent } from "../../../version";
1+
import { userAgent } from "../../../userAgent";
22
// TODO: evaluate if we can easily get rid of this library
33
import FormData from "form-data";
44
import URLParse from "url-parse";

packages/datadog-api-client-v2/http/http.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { userAgent } from "../../../version";
1+
import { userAgent } from "../../../userAgent";
22
// TODO: evaluate if we can easily get rid of this library
33
import FormData from "form-data";
44
import URLParse from "url-parse";

version.ts renamed to userAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import * as os from "os";
2+
import { version } from "./version";
23

3-
export const version = "1.0.0-beta.4+dev"
44
export const userAgent = `datadog-api-client-typescript/${version} (node ${process.versions.node}; os ${os.type()}; arch ${os.arch()})`

0 commit comments

Comments
 (0)