Skip to content

Commit

Permalink
Update package version in code file for JS (#7308)
Browse files Browse the repository at this point in the history
Co-authored-by: praveenkuttappan <[email protected]>
  • Loading branch information
praveenkuttappan and praveenkuttappan authored Nov 17, 2023
1 parent 8a5c76e commit 09a9e3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions tools/apiview/parsers/js-api-parser/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ function getReleaseTag(item: ApiItem & {releaseTag?: ReleaseTag}): "alpha" | "be

const apiModel = new ApiModel();
const fileName = process.argv[2];
var versionString = "";
var PackageversionString = "";
if (fileName.includes("_"))
{
versionString = fileName.split("_").pop().replace(".api.json", "");
PackageversionString = fileName.split("_").pop().replace(".api.json", "");
}
apiModel.loadPackage(fileName);

Expand All @@ -139,17 +139,18 @@ for (const modelPackage of apiModel.packages) {
}

var name = apiModel.packages[0].name;
if (versionString != "")
if (PackageversionString != "")
{
name += "(" +versionString + ")";
name += "(" +PackageversionString + ")";
}
var apiViewFile: IApiViewFile = {
Name: name,
Navigation: navigation,
Tokens: builder.tokens,
PackageName: apiModel.packages[0].name,
VersionString: "1.0.5",
Language: "JavaScript"
VersionString: "1.0.7",
Language: "JavaScript",
PackageVersion: PackageversionString
}

writeFile(process.argv[3], JSON.stringify(apiViewFile), err => {
Expand Down
1 change: 1 addition & 0 deletions tools/apiview/parsers/js-api-parser/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export declare interface IApiViewFile {
PackageName: string;
VersionString: string;
Language: string;
PackageVersion: string;
}

export declare interface IApiViewToken {
Expand Down
2 changes: 1 addition & 1 deletion tools/apiview/parsers/js-api-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/ts-genapi",
"version": "1.0.6",
"version": "1.0.7",
"description": "",
"main": "index.js",
"publishConfig": {
Expand Down

0 comments on commit 09a9e3f

Please sign in to comment.