Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-12297 Fix incorrect version in drop down list on harp.gl (#1881)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Stichbury <2533428+nzjony@users.noreply.github.com>
  • Loading branch information
nzjony committed Oct 5, 2020
1 parent 534da2b commit 2817833
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"@types/chai": "^4.2.11",
"@types/express": "^4.17.6",
"@types/fs-extra": "^9.0.1",
"@types/glob": "^7.1.3",
"@types/semver": "^7.3.4",
"@types/stats.js": "^0.17.0",
"@typescript-eslint/eslint-plugin": "^3.4.0",
"@typescript-eslint/parser": "^3.4.0",
Expand All @@ -42,6 +44,7 @@
"node-fetch": "^2.6.1",
"nyc": "^15.0.1",
"prettier": "^1.19.1",
"semver": "^7.3.2",
"three": "^0.120.1",
"ts-mocha": "^7.0.0",
"typedoc": "^0.17.7",
Expand Down
15 changes: 12 additions & 3 deletions scripts/prepare_doc_deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import { execSync } from "child_process";
import { writeFileSync } from "fs";
import { copySync, ensureDirSync, removeSync } from "fs-extra";
import { glob } from "glob";
import { gt } from "semver";

const fetch = require("node-fetch");

Expand Down Expand Up @@ -57,13 +59,20 @@ interface Release {

if (branch !== "master") {
const now = new Date();
const dateString = `${now.getDate()}-${now.getMonth()}-${now.getFullYear()}`;
const mapviewPackage = require("@here/harp-mapview/package.json");
// WARNING, dates are 0 indexed, hence +1
const dateString = `${now.getDate()}-${now.getMonth() + 1}-${now.getFullYear()}`;
const allPackages = glob.sync("@here/*/package.json");
const newRelease: Release = {
date: dateString,
hash: commitHash,
version: mapviewPackage.version
version: ""
};
for (const testPackage of allPackages) {
const mapviewPackage = require(testPackage);
if (newRelease.version === "" || gt(mapviewPackage.version, newRelease.version)) {
newRelease.version = mapviewPackage.version;
}
}

fetch("https://www.harp.gl/releases.json")
.then((res: Response) => {
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@
dependencies:
"@types/node" "*"

"@types/glob@^7.1.1":
"@types/glob@^7.1.1", "@types/glob@^7.1.3":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183"
integrity sha512-SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w==
Expand Down Expand Up @@ -669,6 +669,11 @@
resolved "https://registry.yarnpkg.com/@types/relateurl/-/relateurl-0.2.28.tgz#6bda7db8653fa62643f5ee69e9f69c11a392e3a6"
integrity sha1-a9p9uGU/piZD9e5p6facEaOS46Y=

"@types/semver@^7.3.4":
version "7.3.4"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.4.tgz#43d7168fec6fa0988bb1a513a697b29296721afb"
integrity sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ==

"@types/serve-static@*", "@types/serve-static@^1.13.4":
version "1.13.5"
resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.5.tgz#3d25d941a18415d3ab092def846e135a08bbcf53"
Expand Down

0 comments on commit 2817833

Please sign in to comment.