├── README.md ├── index.js └── package.json /README.md: -------------------------------------------------------------------------------- 1 | ## Introduction 2 | 3 | The `community-health-files` package is designed to automate the creation and management of essential files like `CODE_OF_CONDUCT.md`, `BUG_REPORT.yml`, and `SECURITY.md` for open-source projects. 4 | 5 | This package is designed to offer a streamlined and efficient workflow for managing community health files, such as contributing guidelines, security policies, and codes of conduct, in a structured and easily accessible manner. 6 | 7 | This documentation will guide you through the process of setting up, configuring, and using the project effectively. We encourage contributions from the community, whether it's through code, documentation improvements, or sharing ideas. 8 | 9 | --- 10 | 11 | ## Features 12 | 13 | - **Community Health Files**: Automatically sets up essential files like `CODE_OF_CONDUCT.md`, `SECURITY.md`, and `BUG_REPORT.yml`. 14 | - **Customizable Security Policy**: Allows you to define a contact/email for reporting security vulnerabilities. 15 | - **Easy Configuration**: The setup process is streamlined, with a few steps for customization. 16 | - **Flexible**: You can adjust, extend, or update the policies to meet your project's specific needs. 17 | 18 | --- 19 | 20 | ## Installation 21 | 22 | Run the setup script and provide the necessary details when prompted. 23 | 24 | ```bash 25 | npx community-health-files 26 | ``` 27 | 28 | ### Prerequisites 29 | 30 | Before installing, ensure you have the following software installed on your machine: 31 | 32 | - **Node.js** (>= 14.x.x) 33 | - **npm** (>= 6.x.x) 34 | 35 | --- 36 | 37 | ## Configuration / Customization 38 | 39 | ### CONTRIBUTING.md file 40 | 41 | 1. Update the URLs here according to your organization or specific use case: 42 | 43 | ```bash 44 | 45 | 46 | [sponsor_platform]: https://github.com 47 | [author]: https://github.com 48 | [readme]: https://github.com 49 | [support]: https://github.com 50 | [coc]: https://github.com 51 | ``` 52 | 53 | 2. Additionally, update the text _`"Sponsor platform name"`_ to reflect the name of the specific sponsor platform you will be mentioning. 54 | 55 | 📝 _Note: You can find both of it on the path `docs/CONTRIBUTING.md`_ 56 | 57 | ### Customizing config.yml file 58 | 59 | Please provide a description of your organization in place of `"WRITE_ABOUT_YOUR_ORGANIZATION"`. 60 | 61 | 📝 _Note: The path to `config.yml` is `.github/ISSUE_TEMPLATE/config.yml`._ 62 | 63 | ### Code of Conduct 64 | 65 | You can edit the _`CODE_OF_CONDUCT.md`_ file to tailor the rules of behavior and enforcement guidelines for your project's community. The default code of conduct is based on a **standard template** but can be customized to fit your specific requirements. 66 | 67 | ### SUPPORT.md 68 | 69 | Update the URLs here according to your organization or specific use case: 70 | 71 | ```bash 72 | 73 | 74 | [author]: https://github.com 75 | [coc]: https://github.com 76 | [chat]: https://github.com 77 | [dicussion]: https://github.com 78 | [contributing]: https://github.com 79 | [xy]: https://xyproblem.info 80 | [cs]: https://codesandbox.io 81 | [sb]: https://stackblitz.com 82 | ``` 83 | 84 | _Note: The path to `SUPPORT.md` is `docs/SUPPORT.md`._ 85 | 86 | ### Updating the FUNDING.yml File 87 | 88 | If you chose to skip the funding options during the installation process, you can still add or update the funding information in the _`.github/FUNDING.yml`_ file later. Here’s how to do it: 89 | 90 | 1. Navigate to the _`.github/FUNDING.yml`_ in your project. 91 | 92 | 2. **Format your funding information**: 93 | 94 | - Use the following format to specify your funding sources: 95 | 96 | ```yaml 97 | github: [username1, username2] 98 | patreon: username 99 | tidelift: package/name 100 | custom: ["https://link1.com", "https://link2.com"] 101 | ``` 102 | 103 | - Replace the placeholders with your actual funding information: 104 | - `github`: List your GitHub sponsors' usernames in square brackets, separated by commas. 105 | - `patreon`: Enter your Patreon username. 106 | - `tidelift`: Specify your Tidelift package. 107 | - `custom`: Include any additional funding links you wish to add in an array format. 108 | 109 | 3. **Example**: 110 | 111 | Here’s an example of how the file may look after editing: 112 | 113 | ```yaml 114 | github: [octocat, surftocat] 115 | patreon: octocat 116 | tidelift: npm/octo-package 117 | custom: ["https://www.paypal.me/octocat", "https://octocat.com"] 118 | ``` 119 | 120 | By following these steps, you can ensure that your funding options are up to date and easily accessible to your project's supporters. 121 | 122 | --- 123 | 124 | ## ✨ Support my work ✨ 125 | 126 | If you find this package helpful, please consider supporting me by **[adding a star ⭐ to the repository](https://github.com/lassiecoder/community-health-files)**. Your support helps me improve and continue providing valuable open-source software. 127 | 128 | Thank you! :) 129 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const fs = require("fs"); 4 | const path = require("path"); 5 | const readline = require("readline"); 6 | 7 | // Create readline interface for input 8 | const rl = readline.createInterface({ 9 | input: process.stdin, 10 | output: process.stdout 11 | }); 12 | 13 | function askQuestion(query, isMandatory = false) { 14 | return new Promise((resolve) => { 15 | const ask = () => { 16 | rl.question(query, (answer) => { 17 | if (isMandatory && !answer) { 18 | console.log( 19 | "\n 🚨 This question is mandatory. Please provide an answer. \n" 20 | ); 21 | ask(); // Ask again if the answer is empty and the question is mandatory 22 | } else { 23 | resolve(answer); // Resolve with the answer, even if it's empty for non-mandatory questions 24 | } 25 | }); 26 | }; 27 | ask(); // Start asking 28 | }); 29 | } 30 | 31 | // Define folder structure 32 | const githubFolder = path.join(process.cwd(), ".github"); 33 | const discussionTemplateFolder = path.join(githubFolder, "DISCUSSION_TEMPLATE"); 34 | const issueTemplateFolder = path.join(githubFolder, "ISSUE_TEMPLATE"); 35 | 36 | const pullRequestTemplate = path.join(githubFolder, "PULL_REQUEST_TEMPLATE.md"); 37 | const fundingTemplate = path.join(githubFolder, "FUNDING.yml"); 38 | const securityTemplate = path.join(githubFolder, "SECURITY.md"); 39 | 40 | const docsFolder = path.join(process.cwd(), "docs"); 41 | const contributingTemplate = path.join(docsFolder, "CONTRIBUTING.md"); 42 | const governanceTemplate = path.join(docsFolder, "GOVERNANCE.md"); 43 | const supportTemplate = path.join(docsFolder, "SUPPORT.md"); 44 | const codeOfConductTemplate = path.join(docsFolder, "CODE_OF_CONDUCT.md"); 45 | 46 | const files = { 47 | // files related to DISCUSSION_TEMPLATE 48 | announcements: path.join(discussionTemplateFolder, "ANNOUNCEMENTS.yml"), 49 | ideas: path.join(discussionTemplateFolder, "IDEAS.yml"), 50 | 51 | // files related to ISSUE_TEMPLATE 52 | bugReport: path.join(issueTemplateFolder, "BUG_REPORT.yml"), 53 | featureRequest: path.join(issueTemplateFolder, "FEATURE_REQUEST.md"), 54 | enhancementRequest: path.join(issueTemplateFolder, "ENHANCEMENT_REQUEST.yml"), 55 | question: path.join(issueTemplateFolder, "QUESTION.md"), 56 | config: path.join(issueTemplateFolder, "config.yml") 57 | }; 58 | 59 | // Ensure the necessary folders exist 60 | if (!fs.existsSync(githubFolder)) { 61 | fs.mkdirSync(githubFolder); 62 | } 63 | if (!fs.existsSync(discussionTemplateFolder)) { 64 | fs.mkdirSync(discussionTemplateFolder); 65 | } 66 | if (!fs.existsSync(issueTemplateFolder)) { 67 | fs.mkdirSync(issueTemplateFolder); 68 | } 69 | if (!fs.existsSync(docsFolder)) { 70 | fs.mkdirSync(docsFolder); 71 | } 72 | 73 | // Function to create files with content 74 | async function createFiles() { 75 | // Message to the user 76 | console.log("\n=========================================="); 77 | console.log(" [❗] – Questions are mandatory "); 78 | console.log("==========================================\n"); 79 | // Get user inputs for templates 80 | const authorName = await askQuestion( 81 | "❗ What is the repository owner's name?\n➜ ", 82 | true 83 | ); 84 | console.log("\n·················································· \n"); 85 | const projectLicense = await askQuestion( 86 | "❗ What is the project license? (e.g., MIT, Apache, GPL):\n➜ ", 87 | true 88 | ); 89 | console.log("\n·················································· \n"); 90 | const bugAssignee = await askQuestion( 91 | "❗ Whom would you like to assign the raised bugs to?\n➜ ", 92 | true 93 | ); 94 | console.log("\n·················································· \n"); 95 | const enhancementAssignee = await askQuestion( 96 | "❗ Who should be assigned the enhancement requests?\n➜ ", 97 | true 98 | ); 99 | console.log("\n·················································· \n"); 100 | const featureAssignee = await askQuestion( 101 | "❗ To whom would you like to assign the feature requests?\n➜ ", 102 | true 103 | ); 104 | console.log("\n·················································· \n"); 105 | const questionAssignee = await askQuestion( 106 | "❗ Who will be responsible for addressing questions related to the project?\n➜ ", 107 | true 108 | ); 109 | console.log("\n·················································· \n"); 110 | const orgName = await askQuestion( 111 | "❗ What is your organization name?\n➜ ", 112 | true 113 | ); 114 | console.log("\n·················································· \n"); 115 | const socialMedia = await askQuestion( 116 | "❗ What is your social media URL to connect?\n➜ ", 117 | true 118 | ); 119 | console.log("\n·················································· \n"); 120 | const email = await askQuestion( 121 | "❗ Please provide the email address for developers and contributors to contact you:\n➜ ", 122 | true 123 | ); 124 | console.log("\n·················································· \n"); 125 | const githubUsername = await askQuestion( 126 | "Please provide the GitHub username(s) for funding (comma separated) or leave blank if none:\n➜ ", 127 | false 128 | ); 129 | console.log("\n·················································· \n"); 130 | const patreonUsername = await askQuestion( 131 | "Enter the Patreon username for funding (leave blank if none):\n➜ ", 132 | false 133 | ); 134 | console.log("\n·················································· \n"); 135 | const tideliftPackage = await askQuestion( 136 | "Enter the Tidelift package name (e.g., npm/package-name) for funding (leave blank if none):\n➜ ", 137 | false 138 | ); 139 | console.log("\n·················································· \n"); 140 | const customFunding = await askQuestion( 141 | "Enter any custom funding URLs (comma separated) or leave blank if none:\n➜ ", 142 | false 143 | ); 144 | 145 | // Close the readline interface 146 | rl.close(); 147 | 148 | // Process the inputs 149 | const githubUsers = githubUsername.split(",").map((user) => user.trim()); 150 | const customUrls = customFunding.split(",").map((url) => url.trim()); 151 | 152 | // Content for announcements.yml 153 | const announcementsContent = `title: "[General] " 154 | labels: ["General Introduction"] 155 | body: 156 | - type: markdown 157 | attributes: 158 | value: | 159 | introduce yourself! 160 | - type: textarea 161 | id: improvements 162 | attributes: 163 | label: Top 3 improvements 164 | description: "What are the top 3 improvements we could make to this project?" 165 | value: | 166 | 1. 167 | 2. 168 | 3. 169 | ... 170 | render: bash 171 | validations: 172 | required: true 173 | - type: markdown 174 | attributes: 175 | value: | 176 | ## How to connect 177 | here are few connection way 178 | - type: input 179 | id: has-id 180 | attributes: 181 | label: Suggestions 182 | description: A description about suggestions to help you 183 | validations: 184 | required: true 185 | - type: dropdown 186 | id: download 187 | attributes: 188 | label: Which area of this project could be most improved? 189 | options: 190 | - Documentation 191 | - Pull request review time 192 | - Bug fix time 193 | - Release cadence 194 | validations: 195 | required: true 196 | - type: checkboxes 197 | attributes: 198 | label: Check that box! 199 | options: 200 | - label: This one! 201 | required: true 202 | - label: I won't stop you if you check this one, too 203 | - type: markdown 204 | attributes: 205 | value: | 206 | ### The thrilling conclusion 207 | _to our template_ 208 | `; 209 | 210 | // Content for announcements.yml 211 | const ideasContent = `title: "[Ideas] " 212 | labels: ["Share your Idea"] 213 | body: 214 | - type: textarea 215 | id: idea 216 | attributes: 217 | label: Idea highlight 218 | description: "What are the idea we could make to this project?" 219 | value: 220 | render: bash 221 | validations: 222 | required: true 223 | 224 | - type: dropdown 225 | id: improvement 226 | attributes: 227 | label: Which area of this project could be most improved? 228 | options: 229 | - Documentation 230 | - Pull request review time 231 | - Bug fix time 232 | - Release cadence 233 | validations: 234 | required: true 235 | 236 | - type: input 237 | id: id 238 | attributes: 239 | label: email 240 | description: your contact number 241 | validations: 242 | required: false 243 | 244 | - type: checkboxes 245 | attributes: 246 | label: Check that box! 247 | options: 248 | - label: Read Code of conduct! 249 | required: true 250 | - label: I won't stop you if you check this one, too 251 | 252 | - type: markdown 253 | attributes: 254 | value: | 255 | ### Thanks 256 | _we will contact you_ **soon** 257 | `; 258 | 259 | // Content for BUG_REPORT.yml 260 | const bugReportContent = `name: Bug Report 261 | description: File a bug report to help us improve. 262 | title: "[🐛]:" 263 | labels: ["bug", "invalid"] 264 | projects: ["abcdkbd"] 265 | assignees: 266 | - "${bugAssignee}" 267 | 268 | body: 269 | - type: textarea 270 | id: problem 271 | attributes: 272 | label: What happened? 273 | description: | 274 | Please provide as much info as possible. 275 | placeholder: Tell us what you see! 276 | value: A bug happened 277 | validations: 278 | required: true 279 | 280 | - type: textarea 281 | id: expected 282 | attributes: 283 | label: What did you expect to happen? 284 | description: | 285 | Please provide expected result/output. 286 | placeholder: Tell us what is expected ! 287 | validations: 288 | required: true 289 | 290 | - type: textarea 291 | id: additional 292 | attributes: 293 | label: Anything else we need to know? 294 | description: | 295 | Please provide other details if it is necessary. 296 | placeholder: Software version and device details! 297 | validations: 298 | required: false 299 | 300 | - type: dropdown 301 | id: browsers 302 | attributes: 303 | label: What browsers are you seeing the problem on? 304 | multiple: true 305 | options: 306 | - Firefox 307 | - Chrome 308 | - Safari 309 | - Microsoft Edge 310 | - Other 311 | 312 | - type: textarea 313 | id: logs 314 | attributes: 315 | label: Relevant log output 316 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 317 | render: shell 318 | validations: 319 | required: false 320 | 321 | - type: input 322 | id: contact 323 | attributes: 324 | label: Contact Details 325 | description: How can we get in touch with you if we need more info? 326 | placeholder: ex. email@example.com 327 | validations: 328 | required: false 329 | 330 | - type: checkboxes 331 | id: terms 332 | attributes: 333 | label: Code of Conduct 334 | description: By submitting this issue, you agree to follow our Code of Conduct 335 | options: 336 | - label: I agree to follow this project's Code of Conduct 337 | required: true 338 | `; 339 | 340 | // Content for FEATURE_REQUEST.md 341 | const featureRequestContent = `--- 342 | name: Feature request 343 | about: "Suggest a feature for this project" 344 | title: [❇️] 345 | labels: ["enhancement"] 346 | assignees: ["${featureAssignee}"] 347 | --- 348 | 349 | **Is your feature request related to a problem? Please describe.** 350 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 351 | 352 | **Describe the solution you'd like** 353 | A clear and concise description of what you want to happen. 354 | 355 | **Describe alternatives you've considered** 356 | A clear and concise description of any alternative solutions or features you've considered. 357 | 358 | **Additional context** 359 | Add any other context or screenshots about the feature request here. 360 | `; 361 | 362 | // Content for ENHANCEMENT_REQUEST.yml 363 | const enhancementRequestContent = `name: Enhancement Tracking Issue 364 | description: Provide supporting details for a feature in development 365 | title: "[🪡]:" 366 | labels: [enhancement] 367 | assignees: 368 | - "${enhancementAssignee}" 369 | body: 370 | - type: textarea 371 | id: feature 372 | attributes: 373 | label: What would you like to be added? 374 | description: | 375 | Feature requests are unlikely to make progress as issues. 376 | validations: 377 | required: true 378 | 379 | - type: textarea 380 | id: rationale 381 | attributes: 382 | label: Why is this needed? 383 | validations: 384 | required: true 385 | `; 386 | 387 | // Content for QUESTION.md 388 | const questionContent = `--- 389 | name: Question 390 | about: Use this template to ask a question about the project 391 | title: ❓ 392 | labels: question 393 | assignees: ${questionAssignee} 394 | --- 395 | 396 | ## Question 397 | 398 | State your question 399 | 400 | ## Sample Code 401 | 402 | Please include relevant code snippets or files that provide context for your question. 403 | `; 404 | 405 | // Content for config.yml 406 | const configContent = `blank_issues_enabled: false 407 | contact_links: 408 | - name: GitHub Community Support 409 | url: https://github.com/orgs/community/discussions 410 | about: Please ask and answer questions here. 411 | - name: "${orgName}" 412 | url: "${socialMedia}" 413 | about: "WRITE_ABOUT_YOUR_ORGANIZATION" 414 | `; 415 | 416 | // Content for PULL_REQUEST_TEMPLATE.md 417 | const pullRequestTemplateContent = `# Pull Request Template 418 | 419 | ## Description 420 | 421 | Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. 422 | 423 | Fixes # (issue) 424 | 425 | ## Type of change 426 | 427 | Please delete options that are not relevant. 428 | 429 | - [ ] Bug fix (non-breaking change which fixes an issue) 430 | - [ ] New feature (non-breaking change which adds functionality) 431 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 432 | - [ ] This change requires a documentation update 433 | 434 | ## How Has This Been Tested? 435 | 436 | Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration 437 | 438 | - [ ] Test A 439 | - [ ] Test B 440 | 441 | **Test Configuration**: 442 | 443 | - Browser: 444 | - Device: 445 | - Toolchain: 446 | 447 | ## Checklist 448 | 449 | - [ ] My code follows the style guidelines of this project 450 | - [ ] I have performed a self-review of my own code 451 | - [ ] I have commented my code, particularly in hard-to-understand areas 452 | - [ ] I have made corresponding changes to the documentation 453 | - [ ] My changes generate no new warnings 454 | - [ ] I have added tests that prove my fix is effective or that my feature works 455 | - [ ] New and existing unit tests pass locally with my changes 456 | - [ ] Any dependent changes have been merged and published in downstream modules 457 | - [ ] I have checked my code and corrected any misspellings 458 | `; 459 | 460 | // Content for FUNDING.yml 461 | const fundingTemplateContent = ` 462 | github: [${githubUsers.join(", ")}] 463 | patreon: ${patreonUsername} 464 | tidelift: ${tideliftPackage} 465 | custom: ${JSON.stringify(customUrls)} 466 | `; 467 | 468 | // Content for SECURITY.md 469 | const securityTemplateContent = `# Security Policy 470 | 471 | ## Scope 472 | 473 | Keeping users safe and secure is a top priority for us.We welcome the contribution of external security researchers. 474 | 475 | If you believe you’ve found a security or vulnerability issue in the repo we encourage you to notify us. 476 | 477 | There are no hard and fast rules to determine if a bug is worth reporting as a security issue or a “regular” issue. 478 | When in doubt, please do send us a report. 479 | 480 | ## How to submit a report 481 | 482 | Security issues can be reported by sending an email us to [${email}](mailto:${email}). 483 | 484 | The team will acknowledge your email within 48 hours. You will receive a more detailed response within 96 hours. 485 | 486 | We will create a maintainer security advisory on GitHub to discuss internally, and when needed, invite you to the advisory. 487 | 488 | ## Purpose 489 | 490 | - Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our services 491 | - Only interact with accounts you own or with explicit permission of the account holder. If you do encounter Personally Identifiable Information (PII) contact us immediately, 492 | do not proceed with access, and immediately purge any local information 493 | - Provide us with a reasonable amount of time to resolve vulnerabilities prior to any disclosure to the public or a third-party 494 | - We will consider activities conducted consistent with this policy to constitute “authorized” conduct and will not pursue civil action or initiate a complaint to law enforcement. 495 | We will help to the extent we can if legal action is initiated by a third party against you 496 | 497 | Please submit a report to us before engaging in conduct that may be inconsistent with or unaddressed by this policy. 498 | 499 | ## Preferences 500 | 501 | - Please provide detailed reports with reproducible steps and a clearly defined impact 502 | - Submit one vulnerability per report 503 | - Social engineering (such as phishing, vishing, smishing) is prohibited 504 | `; 505 | 506 | // Content for CONTRIBUTING.md 507 | const contributingTemplateContent = `# Contributing 508 | 509 | This article explains how to contribute to the project. Please read through the following guidelines. 510 | 511 | Write something nice and instructive as an intro. Talk about what kind of contributions you are interested in. 512 | 513 | > Welcome! We love receiving contributions from our community, so thanks for stopping by! There are many ways to contribute, including submitting bug reports, improving documentation, submitting feature requests, reviewing new submissions, or contributing code that can be incorporated into the project. 514 | 515 | ## Summary 516 | 517 | > [!Note] 518 | > Before participating in our community, please read our [Code Of Conduct][coc]. 519 | > By interacting with this repository, organization, or community you agree to abide by its terms. 520 | 521 | This document describes our development process. Following these guidelines shows that you respect the time and effort of the developers managing this project. In return, you will be shown respect in addressing your issue, reviewing your changes, and incorporating your contributions. 522 | 523 | ## Contributions 524 | 525 | There are several ways to contribute, not just by writing code. If you have questions, see [support][support]. 526 | 527 | ### Financial support 528 | 529 | It's possible to support us financially by becoming a backer or sponsor through [Sponsor platform name][sponsor_platform] platforms. 530 | 531 | ### Improve docs 532 | 533 | As a user, you’re perfect for helping us improve our docs. Typo corrections, error fixes, better explanations, new examples, etc. 534 | 535 | ### Improve issues 536 | 537 | Some issues lack information, aren’t reproducible, or are just incorrect. You can help by trying to make them easier to resolve. Existing issues might benefit from your unique experience or opinions. 538 | 539 | ### Write code 540 | 541 | Code contributions are very welcome. 542 | It’s probably a good idea to first post a question or open an issue to report a bug or suggest a new feature before creating a pull request. 543 | 544 | ## Submitting an issue 545 | 546 | - The issue tracker is for issues. Use discussions for support. 547 | - Search the issue tracker (including closed issues) before opening a new issue. 548 | - Ensure you’re using the latest version of our packages. 549 | - Use a clear and descriptive title. 550 | - Include as much information as possible: steps to reproduce the issue, error message, version, operating system, etc. 551 | - The more time you put into an issue, the better we will be able to help you. 552 | - The best issue report is a proper reproduction step to prove it. 553 | 554 | ## Development Process 555 | 556 | What is your development process? 557 | 558 | > [!Tip] 559 | > This project follows the basic git flow. 560 | 561 | Check and follow the [README][readme] file and run the project on your local environment. 562 | 563 | Talk about branches people should work on. Specifically, where is the starting point? \`main\`, \`feature\`, \`hotfix\`, \`task\`, etc. 564 | 565 | ### Testing 566 | 567 | If you add code, you need to add tests! We’ve learned the hard way that code without tests is undependable. If your pull request reduces our test coverage because it lacks tests, it will be rejected. 568 | 569 | Provide instructions for adding new tests. Provide instructions for running tests. 570 | 571 | \`\`\`sh 572 | npm run test 573 | \`\`\` 574 | 575 | ### Style Guidelines 576 | 577 | Run the command below: 578 | 579 | \`\`\`sh 580 | npm run lint 581 | \`\`\` 582 | 583 | ### Code Formatting 584 | 585 | Use a code formatter in your IDE, and add Prettier and other useful extensions in your IDE. 586 | 587 | ### Git Commit Guidelines 588 | 589 | Below are the guidelines for your commit messages. 590 | 591 | - Add a clear message and keep it within 50 characters. 592 | - Prefix the message with a feature or issue number from the issue page. 593 | 594 | ### Submitting a pull request 595 | 596 | - Run \`npm test\` locally to build, format, and test your changes. 597 | - Non-trivial changes are often best discussed in an issue first to prevent unnecessary work. 598 | - For ambitious tasks, get your work in front of the community for feedback as soon as possible. 599 | - New features should be accompanied by tests and documentation. 600 | - Don’t include unrelated changes. 601 | - Test before submitting code by running \`npm test\`. 602 | - Write a convincing description of why we should land your pull request: it’s your job to convince us. 603 | 604 | ## Pull Request Process 605 | 606 | When you are ready to generate a pull request, either for preliminary review or for consideration of merging into the project, you must first push your local topic branch back up to GitHub: 607 | 608 | \`\`\`sh 609 | git push origin feature/branch-name 610 | \`\`\` 611 | 612 | ### Submitting the PR 613 | 614 | Once you've committed and pushed all of your changes to GitHub, go to the page for your fork on GitHub, select your development branch, and click the pull request button. 615 | If you need to make any adjustments to your pull request, just push the updates to your branch. Your pull request will automatically track the changes on your development branch and update. 616 | 617 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. 618 | 2. Update the \`README.md\` with details of changes to the interface. This includes new environment variables, exposed ports, useful file locations, and container parameters. 619 | 3. Increase the version numbers in any example files and the \`README.md\` to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 620 | 4. You may merge the Pull Request once you have the sign-off of two other developers. If you don’t have permission to do that, request the second reviewer to merge it for you. 621 | 622 | ### Review Process 623 | 624 | The core team reviews Pull Requests regularly in a weekly triage meeting held in a public domain. The schedule is announced in weekly status updates. 625 | Our Reviewer will provide constructive feedback by writing Review Comments (RC). The Pull Requester must address all RC in time. 626 | 627 | After feedback has been given, we expect responses within two weeks. If no activity is shown within this time, we may close the pull request. 628 | For larger commits, we prefer a +1 from someone on the core team or another contributor. Please note if you reviewed the code or tested locally. 629 | 630 | ### Addressing Feedback 631 | 632 | Once a PR has been submitted, your changes will be reviewed, and constructive feedback may be provided. Feedback is not meant as an attack but helps ensure high-quality code. Changes will be approved once required feedback has been addressed. 633 | 634 | If a maintainer asks you to "rebase" your PR, that means a lot of code has changed, and you need to update your fork to make merging easier. 635 | 636 | To update your forked repository, follow these steps: 637 | 638 | ### Fetch upstream master and merge with your repo's main branch 639 | 640 | \`\`\`sh 641 | git fetch upstream 642 | git checkout main 643 | git merge upstream/main 644 | \`\`\` 645 | 646 | #### If there were any new commits, rebase your development branch 647 | 648 | \`\`\`sh 649 | git checkout feature/branch-name 650 | git rebase main 651 | \`\`\` 652 | 653 | If too much code has changed, you may need to resolve merge conflicts manually. 654 | 655 | Once your new branch has no conflicts and works correctly, override your old branch using this command: 656 | 657 | \`\`\`sh 658 | git push origin feature/branch-name 659 | \`\`\` 660 | 661 | ## Community 662 | 663 | We have a mailing list, Slack channel, and IRC channel. Links are provided below: 664 | 665 | - You can help answer questions our users have here: 666 | - You can help build and design our website here: 667 | - You can help write blog posts about the project by: 668 | - You can help with newsletters and internal communications by: 669 | 670 | ## Resources 671 | 672 | - [How to contribute to open source](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github) 673 | - [Making your first contribution](https://www.freecodecamp.org/news/how-to-make-your-first-open-source-contribution/) 674 | - [Using pull requests](https://docs.github.com/en/pull-requests) 675 | - [GitHub help](https://help.github.com) 676 | - [Commit message guidelines](https://github.com/joelparkerhenderson/git-commit-message), [Commit guidelines](https://medium.com/@sharmapriyanka84510/commit-guidelines-f41b23f0bf4a) 677 | 678 | ## License 679 | 680 | ${projectLicense} 681 | 682 | ## Author 683 | 684 | © ${authorName} 685 | 686 | 687 | 688 | [sponsor_platform]: https://github.com 689 | [author]: https://github.com 690 | [readme]: https://github.com 691 | [support]: https://github.com 692 | [coc]: https://github.com 693 | `; 694 | 695 | // Content for GOVERNANCE.md 696 | const governanceTemplateContent = `# Governance 697 | 698 | To ensure clarity and transparency in our project's management, we encourage you to add a **GOVERNANCE** section. This file should outline how decisions are made, detail the roles within the project, and provide guidance on the governance structure. It can include information about: 699 | 700 | - **Project Roles**: Define the responsibilities of contributors, maintainers, and other key participants. 701 | - **Decision-Making Process**: Explain how decisions are made regarding features, bug fixes, and other significant changes to the project. 702 | - **Community Involvement**: Describe how community members can engage in discussions and contribute to the decision-making process. 703 | 704 | By clearly outlining these aspects, you can foster a more inclusive environment where contributors feel valued and informed. 705 | `; 706 | 707 | // Content for SUPPORT.md 708 | const supportTemplateContent = `# Support 709 | 710 | This article explains where to get help with remark. 711 | Please read through the following guidelines. 712 | 713 | > [!Note] 714 | > before participating in our community, please read our [code of conduct][coc]. 715 | > By interacting with this repository, organization, or community you agree to abide by its terms. 716 | 717 | ## Asking quality questions 718 | 719 | Questions can go to [GitHub discussions][dicussion]. 720 | 721 | Help us help you! 722 | 723 | Spend time framing questions and add links and resources. 724 | Spending the extra time up front can help save everyone time in the long run. 725 | 726 | > [!Tip] 727 | > Here are some tips 728 | 729 | - [Talk to us][chat]! 730 | - Don’t fall for the [XY problem][xy] 731 | - Search to find out if a similar question has been asked 732 | - Try to define what you need help with: 733 | - Is there something in particular you want to do? 734 | - What problem are you encountering and what steps have you taken to try and fix it? 735 | - Is there a concept you don’t understand? 736 | - Provide sample code, such as a [CodeSandbox][cs] or [StackBlitz][sb] or a small video, if possible 737 | - Screenshots can help, but if there’s important text such as code or error messages in them, please also provide those as text 738 | - The more time you put into asking your question, the better we can help you 739 | 740 | ## Contributions 741 | 742 | See [\`contributing.md\`][contributing] on how to contribute. 743 | 744 | ## License 745 | 746 | © ${authorName} 747 | 748 | 749 | 750 | [author]: https://github.com 751 | [coc]: https://github.com 752 | [chat]: https://github.com 753 | [dicussion]: https://github.com 754 | [contributing]: https://github.com 755 | [xy]: https://xyproblem.info 756 | [cs]: https://codesandbox.io 757 | [sb]: https://stackblitz.com 758 | `; 759 | 760 | // Content for CODE_OF_CONDUCT.md 761 | const codeOfConductTemplateContent = `# Contributor Covenant Code of Conduct 762 | 763 | **Table of Contents:** 764 | 765 | - [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct) 766 | - [Summary](#summary) 767 | - [Our Pledge](#our-pledge) 768 | - [Our Standards](#our-standards) 769 | - [Enforcement Responsibilities](#enforcement-responsibilities) 770 | - [Scope](#scope) 771 | - [Enforcement](#enforcement) 772 | - [Enforcement Guidelines](#enforcement-guidelines) 773 | - [1. Correction](#1-correction) 774 | - [2. Warning](#2-warning) 775 | - [3. Temporary Ban](#3-temporary-ban) 776 | - [4. Permanent Ban](#4-permanent-ban) 777 | - [Attribution](#attribution) 778 | 779 | **Version**: 1.0.0 780 | 781 | ## Summary 782 | 783 | As contributors and maintainers of this projects, we will respect everyone who contributes by posting issues, updating documentation, submitting pull requests, providing feedback in comments, and any other activities. 784 | 785 | Communication regarding the projects through any channel must be constructive and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. Courtesy and respect shall be extended to everyone involved in this project. Our experiences as individuals differs widely, and as such contributors are expected to be respectful of differing viewpoints and ideas. 786 | 787 | We expect all contributors to uphold our standards of conduct. If any member of the community violates this code of conduct, the Embedded Artistry team and project maintainers will take action. We reserve the right to remove issues, comments, and PRs that do not comply with our conduct standards. Repeated or significant offenses will result in blocked accounts and disassociation with our projects and the Embedded Artistry community. 788 | 789 | If you are subject to or witness unacceptable behavior, or have any other concerns, please email us at [${email}](mailto:${email}). 790 | 791 | ## Our Pledge 792 | 793 | We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. 794 | 795 | We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. 796 | 797 | ## Our Standards 798 | 799 | Examples of behavior that contributes to a positive environment for our community include: 800 | 801 | - Demonstrating empathy and kindness toward other people 802 | - Being respectful of differing opinions, viewpoints, and experiences 803 | - Giving and gracefully accepting constructive feedback 804 | - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience 805 | - Focusing on what is best not just for us as individuals, but for the overall community 806 | 807 | Examples of unacceptable behavior include: 808 | 809 | - The use of sexualized language or imagery, and sexual attention or advances of any kind 810 | - Trolling, insulting or derogatory comments, and personal or political attacks 811 | - Public or private harassment 812 | - Publishing others' private information, such as a physical or email address, without their explicit permission 813 | - Other conduct which could reasonably be considered inappropriate in a professional setting 814 | 815 | ## Enforcement Responsibilities 816 | 817 | Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. 818 | 819 | Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. 820 | 821 | ## Scope 822 | 823 | This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. 824 | 825 | ## Enforcement 826 | 827 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [_this email_][contact]. All complaints will be reviewed and investigated promptly and fairly. 828 | 829 | All community leaders are obligated to respect the privacy and security of the reporter of any incident. 830 | 831 | ## Enforcement Guidelines 832 | 833 | > [!CAUTION] 834 | > Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: 835 | 836 | ### 1. Correction 837 | 838 | **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. 839 | 840 | **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. 841 | 842 | ### 2. Warning 843 | 844 | **Community Impact**: A violation through a single incident or series of actions. 845 | 846 | **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. 847 | 848 | ### 3. Temporary Ban 849 | 850 | **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. 851 | 852 | **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. 853 | 854 | ### 4. Permanent Ban 855 | 856 | **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. 857 | 858 | **Consequence**: A permanent ban from any sort of public interaction within the community. 859 | 860 | ## Attribution 861 | 862 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at . 863 | 864 | Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). 865 | 866 | 867 | For answers to common questions about this code of conduct see the FAQ at . Translations are available at . 868 | 869 | [homepage]: https://www.contributor-covenant.org 870 | [contact]: mailto:${email} 871 | `; 872 | 873 | // Write content to files 874 | fs.writeFileSync(files.announcements, announcementsContent); 875 | fs.writeFileSync(files.ideas, ideasContent); 876 | 877 | fs.writeFileSync(files.bugReport, bugReportContent); 878 | fs.writeFileSync(files.featureRequest, featureRequestContent); 879 | fs.writeFileSync(files.enhancementRequest, enhancementRequestContent); 880 | fs.writeFileSync(files.question, questionContent); 881 | fs.writeFileSync(files.config, configContent); 882 | 883 | fs.writeFileSync(pullRequestTemplate, pullRequestTemplateContent); 884 | fs.writeFileSync(fundingTemplate, fundingTemplateContent); 885 | fs.writeFileSync(securityTemplate, securityTemplateContent); 886 | 887 | fs.writeFileSync(contributingTemplate, contributingTemplateContent); 888 | fs.writeFileSync(governanceTemplate, governanceTemplateContent); 889 | fs.writeFileSync(supportTemplate, supportTemplateContent); 890 | fs.writeFileSync(codeOfConductTemplate, codeOfConductTemplateContent); 891 | 892 | const repoLink = "https://github.com/lassiecoder/community-health-files"; 893 | 894 | console.log( 895 | "\n⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆" 896 | ); 897 | console.log("\n"); 898 | console.log("Community health files setup has been done successfully! ✅"); 899 | console.log("\n"); 900 | console.log( 901 | `If you appreciate my efforts, please consider supporting me by ⭐ my repository on GitHub: ${repoLink}` 902 | ); 903 | console.log("\n"); 904 | console.log( 905 | "⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆⋆⋅☆⋅⋆\n" 906 | ); 907 | } 908 | 909 | // Execute file creation 910 | createFiles().catch((err) => console.error(err)); 911 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "community-health-files", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test-local": "chmod +x index.js", 7 | "npm-login": "npm login", 8 | "npm-publish": "npm publish" 9 | }, 10 | "keywords": [ 11 | "npx community-health-files", 12 | "community-health-files", 13 | "github community-health-files", 14 | "community health files", 15 | "open source community health files", 16 | "github community health files", 17 | "open source projects management", 18 | "community profiles", 19 | "default community health file", 20 | "open source guides", 21 | "gitHub support package", 22 | "package for moderating your community", 23 | "community management and moderation", 24 | "npm i community-health-files" 25 | ], 26 | "author": "Priyanka Sharma ", 27 | "license": "MIT", 28 | "description": "This package is designed to offer a streamlined and efficient workflow for managing community health files, such as contributing guidelines, security policies, and codes of conduct, in a structured and easily accessible manner.", 29 | "bin": { 30 | "community-health-files": "./index.js" 31 | } 32 | } 33 | --------------------------------------------------------------------------------