') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - profiq/gitignore · GitHub
Skip to content

Repository files navigation

.gitignore HUB

DeepScan grade

Best .gitignore generator

https://profiq-gitignore-production.glb.edgio.link/

Generate your project-specific .gitignore: Perfectly crafted for your tech stack

Simple webpage and api to generate .gitignore files for your project.

API

Search

Result

  • https://gitignore.profiq.com/api/result?options=<options_list>&remDupl=<remove_duplicates>
  • Generates .gitignore file for given options
  • options_list is a list of technologies separated by comma
  • remove_duplicates is a boolean value that indicates whether to remove duplicate lines from the result, default is true

Development Guidelines

Package Management

  • Use Yarn as the package manager for this project.
  • Make sure to include a yarn.lock file in the project repository.
  • When adding or updating dependencies, use
yarn add

or respetively

yarn upgrade

Installation

  • Clone the project repository using
git clone https://github.com/profiq/gitignore
  • Navigate to the project directory using
cd gitignore
  • Clone Toptal templates using
yarn clone-templates
  • Install project dependencies using
yarn install

Development Workflow

  • Run the project locally using
yarn dev
  • Create a new branch for each feature or bug fix using
git checkout -b <branch-name>
  • Commit changes frequently with descriptive commit messages using
git commit -m "<commit-message>"
  • Push changes to the remote repository using
git push origin <branch-name>
  • Create a pull request for code review and merge into the main branch.
  • On every pull request, the code will be automatically tested and deployed to preview environment.

Testing

  • Write unit tests for all new features and bug fixes.
  • Run tests using
yarn test
  • Make sure all tests pass before merging changes.

Code Style

  • Follow the project's coding conventions and style guide.
  • Use a linter to enforce code style rules.
  • Format code using
yarn format
  • All changed files are also formatted automatically on every commit.

Templates structure

  • For sake of ability to search templates without exact match, techOptions.json file is compiled using update-tech-options/update-list.mjs script run weekly
  • techOptions.json is map with keys being possible keywords for search and values actual technology names
  • To understand the structure of the templates, please check https://github.com/toptal/gitignore
  • To combine templates, patch and stack files and also to deal with link files, the update-tech-options/update-list.mjs script generates also techOptionsFiles.json file where for each technology there is a list of files that should be combined to get the final template

CI/CD Workflows and Deployment

tests

  • runs on PR and push to the main branch
  • tests building the project
  • checks prettier
  • runs unit tests

update-tech-options

  • Runs weekly to update techOptions.json and techOptionsFiles.json files if the template structure changed
  • If the structure of the templates changed, new PR is created

Deploymet

  • The project is deployed to Edgio
  • organization: profiq
  • property: gitignore
  • There are 3 deployment workflows for 3 environments: preview, production and dev, each of them has similar steps:
    • checkout the code
    • get node_modules cache
    • install dependencies
    • clone Toptal templates
    • build and deploy the project to the environment
  • To deploy project locally using Edgio, run
edg build && edg run -p

deploy-preview

  • runs on every PR to deploy the preview environment
  • adds a comment to the PR with the link to the proper preview

deploy-production

deploy-dev

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

4 watching

Forks

Releases

Used by

Contributors

Languages