chore(ISSUE_TEMPLATE): add template for integration issue (#4722)

Ref: https://blog.github.com/2018-05-02-issue-template-improvements/

![image](https://user-images.githubusercontent.com/8341033/41692826-e7b98d06-7534-11e8-9b51-54a04c097681.png)

So that people would know what kind of info we need to know to understand issues like #4720.
master
Ika 2018-06-22 12:37:52 +08:00 committed by GitHub
parent cbef0105e9
commit 5cfaba6a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 91 additions and 54 deletions

View File

@ -1,46 +0,0 @@
<!--
BEFORE SUBMITTING AN ISSUE:
1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues
A large number of opened issues are duplicates of existing issues.
If someone has already opened an issue for what you are experiencing,
you do not need to open a new issue — please add a 👍 reaction to the
existing issue instead.
2. We get a lot of requests for adding options, but Prettier is
built on the principle of being opinionated about code formatting.
This means we have a very high bar for adding new options.
Find out more: https://prettier.io/docs/en/option-philosophy.html
3. If your issue is with a prettier editor extension or add-on, please open the
issue in the repo for that extension or add-on, instead of this repo.
For ugly or incorrect code issues: Please use the below template.
Tip! Don't write this stuff manually.
1. Go to https://prettier.io/playground
2. Paste your code and set options
3. Press the "Report issue" button in the lower right
-->
**Prettier 1.13.5**
[Playground link](https://prettier.io/playground/#.....)
```sh
# Options (if any):
--single-quote
```
**Input:**
```jsx
// code snippet
```
**Output:**
```jsx
// code snippet
```
**Expected behavior:**

46
.github/ISSUE_TEMPLATE/formatting.md vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: ✨ Formatting
about: Issues for ugly or incorrect code
---
<!--
BEFORE SUBMITTING AN ISSUE:
1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues
A large number of opened issues are duplicates of existing issues.
If someone has already opened an issue for what you are experiencing,
you do not need to open a new issue — please add a 👍 reaction to the
existing issue instead.
2. We get a lot of requests for adding options, but Prettier is
built on the principle of being opinionated about code formatting.
This means we have a very high bar for adding new options.
Find out more: https://prettier.io/docs/en/option-philosophy.html
Tip! Don't write this stuff manually.
1. Go to https://prettier.io/playground
2. Paste your code and set options
3. Press the "Report issue" button in the lower right
-->
**Prettier 1.13.5**
[Playground link](https://prettier.io/playground/#.....)
```sh
# Options (if any):
--single-quote
```
**Input:**
```jsx
// code snippet
```
**Output:**
```jsx
// code snippet
```
**Expected behavior:**

32
.github/ISSUE_TEMPLATE/integration.md vendored Normal file
View File

@ -0,0 +1,32 @@
---
name: ⚙ Integration
about: Issues for API, CLI, etc.
---
<!--
BEFORE SUBMITTING AN ISSUE:
1. Search for your issue on GitHub: https://github.com/prettier/prettier/issues
A large number of opened issues are duplicates of existing issues.
If someone has already opened an issue for what you are experiencing,
you do not need to open a new issue — please add a 👍 reaction to the
existing issue instead.
2. If your issue is with a prettier editor extension or add-on, please open the
issue in the repo for that extension or add-on, instead of this repo.
-->
**Environments:**
- Prettier Version: 1.13.5
- Running Prettier via: <!-- CLI, Node.js API, Browser API, etc. -->
- Runtime: <!-- Node.js v6, Chrome v67, etc. -->
- Operating System: <!-- Windows, Linux, macOS, etc. -->
**Steps to reproduce:**
<!-- shell script, js code, or a link to the minimal reproducible repository -->
**Expected behavior:**
**Actual behavior:**

View File

@ -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}`)
);
}

View File

@ -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