chore(ISSUE_TEMPLATE): add template for integration issue (#4722)
Ref: https://blog.github.com/2018-05-02-issue-template-improvements/  So that people would know what kind of info we need to know to understand issues like #4720.
This commit is contained in:
5 files changed
+91
-54
No files matched your search
@@ -1,20 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
const execa = require("execa");
|
||||
const { readFileSync, writeFileSync } = require("fs");
|
||||
const { logPromise, readJson, writeJson } = require("../utils");
|
||||
const { logPromise, readJson, writeJson, processFile } = require("../utils");
|
||||
|
||||
async function bump({ version }) {
|
||||
const pkg = await readJson("package.json");
|
||||
pkg.version = version;
|
||||
await writeJson("package.json", pkg, { spaces: 2 });
|
||||
|
||||
// Update .github/ISSUE_TEMPLATE.MD
|
||||
const issueFile = ".github/ISSUE_TEMPLATE.md";
|
||||
const issueTempl = readFileSync(issueFile, "utf-8");
|
||||
writeFileSync(
|
||||
issueFile,
|
||||
issueTempl.replace(/^\*\*Prettier .*?\*\*$/m, `**Prettier ${version}**`)
|
||||
// Update github issue templates
|
||||
processFile(".github/ISSUE_TEMPLATE/formatting.md", content =>
|
||||
content.replace(/^(\*\*Prettier ).*?(\*\*)$/m, `$1${version}$2`)
|
||||
);
|
||||
processFile(".github/ISSUE_TEMPLATE/integration.md", content =>
|
||||
content.replace(/^(- Prettier Version: ).*?$/m, `$1${version}`)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,9 +70,15 @@ function writeJson(filename, content) {
|
||||
fs.writeFileSync(filename, JSON.stringify(content, null, 2) + "\n");
|
||||
}
|
||||
|
||||
function processFile(filename, fn) {
|
||||
const content = fs.readFileSync(filename, "utf-8");
|
||||
fs.writeFileSync(filename, fn(content));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
runYarn,
|
||||
logPromise,
|
||||
processFile,
|
||||
readJson,
|
||||
writeJson,
|
||||
waitForEnter
|
||||
|
||||
Reference in new issue
Block a user