fix(playground): fix report version (#3614)
parent
6872ed8310
commit
8a86c0cc9f
|
@ -24,7 +24,7 @@ const parserPaths = parsers.map(stripLanguageDirectory);
|
||||||
|
|
||||||
if (isPullRequest) {
|
if (isPullRequest) {
|
||||||
const pkg = require("../../package.json");
|
const pkg = require("../../package.json");
|
||||||
pkg.prVersion = `pr-${process.env.REVIEW_ID}`;
|
pkg.version = `999.999.999-pr.${process.env.REVIEW_ID}`;
|
||||||
pipe(JSON.stringify(pkg, null, 2)).to("package.json");
|
pipe(JSON.stringify(pkg, null, 2)).to("package.json");
|
||||||
shell.exec("node scripts/build/build.js");
|
shell.exec("node scripts/build/build.js");
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,10 +85,11 @@ window.onload = function() {
|
||||||
prettierVersion = message.data.version;
|
prettierVersion = message.data.version;
|
||||||
|
|
||||||
var link = document.createElement("a");
|
var link = document.createElement("a");
|
||||||
var match = prettierVersion.match(/^pr-(\d+)$/);
|
var match = prettierVersion.match(/^\d+\.\d+\.\d+-pr.(\d+)$/);
|
||||||
if (match) {
|
if (match) {
|
||||||
link.href = "https://github.com/prettier/prettier/pull/" + match[1];
|
link.href = "https://github.com/prettier/prettier/pull/" + match[1];
|
||||||
link.textContent = "PR #" + match[1];
|
link.textContent = "PR #" + match[1];
|
||||||
|
prettierVersion = "pr-" + match[1];
|
||||||
} else {
|
} else {
|
||||||
if (prettierVersion.match(/\.0$/)) {
|
if (prettierVersion.match(/\.0$/)) {
|
||||||
link.href =
|
link.href =
|
||||||
|
|
|
@ -103,7 +103,7 @@ self.onmessage = function(message) {
|
||||||
doc: doc,
|
doc: doc,
|
||||||
ast: ast,
|
ast: ast,
|
||||||
formatted2: formatted2,
|
formatted2: formatted2,
|
||||||
version: prettier.prVersion || prettier.version
|
version: prettier.version
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue