This commit is contained in:
Ethan Arrowood 2021-04-29 12:56:19 -06:00
Родитель 0d0be7d93f
Коммит 9eb8eaf8f6
7 изменённых файлов: 110 добавлений и 18 удалений

18
.github/ISSUE_TEMPLATE/update-fiddle-task.md поставляемый
Просмотреть файл

@ -1,18 +0,0 @@
---
name: update fiddle task
about: A template detailing an update fiddle task
title: 'Update fiddle: %title%'
labels: 'Task, Status: Ready'
assignees: ''
---
<!-- replace all %title% with the title of the fiddle. for example "communication/two-processes/asynchronous-messages" -->
> This task issue is mainly for organizational and tracking purposes. Please refer to the related parent issue for details.
Template: [%title%](https://github.com/electron/electron/docs/fiddles/%title%)
Rel: #6
Refer to related issue for further details.

2
generate-issues/.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1,2 @@
node_modules
.env

1
generate-issues/.npmrc Normal file
Просмотреть файл

@ -0,0 +1 @@
package-lock=false

17
generate-issues/README.md Normal file
Просмотреть файл

@ -0,0 +1,17 @@
# generate issues
This script was used to generate the _update fiddle_ issues.
Committing to source control for future reference.
## running the script
> this will only work for maintainers of the electron-cse-hackoverflow-engagement repo.
>
> this script is not easily-reversable. Make sure you know what you are doing before running it!
1. Generate a [GitHub Personal Access Token](https://github.com/settings/tokens/new) and grant it repo access
2. Add the token to an environment variable called `gh_pat` within an **.env** file
3. Run the script using node v16: `node index.js`
Reach out to @Ethan-Arrowood (msft internal: @etarrowo) for more information.

42
generate-issues/fiddles Normal file
Просмотреть файл

@ -0,0 +1,42 @@
media/screenshot/take-screenshot
menus/shortcuts
menus/customize-menus
features/drag-and-drop
features/keyboard-shortcuts/interception-from-main
features/keyboard-shortcuts/local
features/keyboard-shortcuts/global
features/macos-dark-mode
features/macos-dock-menu
features/notifications/renderer
features/notifications/main
features/offscreen-rendering
features/online-detection/renderer
features/online-detection/main
features/progress-bar
features/recent-documents
features/represented-file
native-ui/drag-and-drop
native-ui/dialogs/open-file-or-directory
native-ui/dialogs/information-dialog
native-ui/dialogs/error-dialog
native-ui/dialogs/save-dialog
native-ui/external-links-file-manager
native-ui/external-links-file-manager/external-links
native-ui/external-links-file-manager/path-in-file-manager
native-ui/notifications
native-ui/notifications/notification-with-image
native-ui/notifications/basic-notification
native-ui/tray
quick-start
screen/fit-screen
system/clipboard/copy
system/clipboard/paste
system/protocol-handler/launch-app-from-URL-in-another-app
system/system-app-user-information/app-information
system/system-information/get-version-information
windows/crashes-and-hangs
windows/manage-windows/create-frameless-window
windows/manage-windows/new-window
windows/manage-windows/manage-window-state
windows/manage-windows/frameless-window
windows/manage-windows/window-events

35
generate-issues/index.js Normal file
Просмотреть файл

@ -0,0 +1,35 @@
'use strict';
import dotenv from 'dotenv'
import { promises as fs } from 'fs'
import undici from 'undici'
dotenv.config()
const gh_pat = process.env.gh_pat
const fiddles = await fs.readFile('fiddles', { encoding: 'utf-8' })
const createIssues = fiddles.split('\n').map(fiddle => undici.request(
'https://api.github.com/repos/microsoft/electron-cse-hackoverflow-engagement/issues',
{
method: 'POST',
headers: [
'user-agent', 'undici',
'authorization', `token ${gh_pat}`
],
body: JSON.stringify({
title: `Update fiddle ${fiddle}`,
labels: ['Status: Ready', 'Task'],
body: `
Template: [${fiddle}](https://github.com/electron/electron/docs/fiddles/${fiddle})
Rel: #6
> This task is for organizational and tracking purposes. Refer to the linked 'Rel:' issues for further details.
`
})
}
))
await Promise.all(createIssues)

Просмотреть файл

@ -0,0 +1,13 @@
{
"name": "generate-issues",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"author": "Ethan-Arrowood",
"license": "MIT",
"dependencies": {
"dotenv": "^8.2.0",
"undici": "^3.3.6"
}
}