From 54c2041ddce3da32b662293c861169cae99fd3cb Mon Sep 17 00:00:00 2001 From: Jonathan Young Date: Mon, 4 Nov 2024 02:02:05 -0800 Subject: [PATCH] 2024.11.04 --- .github/CODEOWNERS | 1 - .github/ISSUE_TEMPLATE/bug_report.yml | 48 --------------- .github/ISSUE_TEMPLATE/config.yml | 5 -- .github/ISSUE_TEMPLATE/feature_request.yml | 38 ------------ .github/ISSUE_TEMPLATE/other.yml | 19 ------ .github/dependabot.yml | 8 --- .github/pull_request_template.md | 19 ------ .github/stale.yml | 20 ------ .github/workflows/Ci.yml | 39 ------------ .github/workflows/UpdateDirectory.js | 71 ---------------------- .github/workflows/UpdateDirectory.yml | 38 ------------ .github/workflows/UploadCoverageReport.yml | 45 -------------- .gitpod.yml | 11 ---- .husky/pre-commit | 5 -- vitest.config.ts | 11 ---- 15 files changed, 378 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml delete mode 100644 .github/ISSUE_TEMPLATE/other.yml delete mode 100644 .github/dependabot.yml delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/stale.yml delete mode 100644 .github/workflows/Ci.yml delete mode 100644 .github/workflows/UpdateDirectory.js delete mode 100644 .github/workflows/UpdateDirectory.yml delete mode 100644 .github/workflows/UploadCoverageReport.yml delete mode 100644 .gitpod.yml delete mode 100755 .husky/pre-commit delete mode 100644 vitest.config.ts diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 41d34b9a9f..0000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @raklaptudirm @appgurueu diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 6a4de4e591..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Bug report -description: 'Create a report to help us improve' -title: '[BUG]: ' -labels: ['bug'] -body: - - type: markdown - attributes: - value: '### Before you open an issue, please verify if a similar one already exists or has been closed before. More details about the process of contributing can be found in [CONTRIBUTING.md](https://github.com/TheAlgorithms/JavaScript/blob/master/CONTRIBUTING.md).' - - type: textarea - id: description - attributes: - label: Description - description: Explain what the problem is. - validations: - required: true - - type: textarea - id: expectedbhv - attributes: - label: Expected Behavior - description: Describe what was the expected behavior. - validations: - required: true - - type: textarea - id: actualbhv - attributes: - label: Actual Behavior - description: Describe what actually happens. - validations: - required: true - - type: textarea - id: steps - attributes: - label: Steps to reproduce (if applicable) - description: List steps to reproduce the behavior. - placeholder: | - 1. - 2. - 3. - 4. - validations: - required: false - - type: textarea - id: extra_information - attributes: - label: Additional information - description: Is there anything else we should know about this bug report? - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index fe511fee04..0000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Discord community - url: https://the-algorithms.com/discord/ - about: Have any questions or found any bugs? Contact us via our Discord community. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index f785578cb6..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Feature request -description: 'Suggest features, propose improvements, discuss new ideas' -title: '[FEATURE]: ' -labels: ['enhancement'] -body: - - type: markdown - attributes: - value: | - ## This issue template is not for requesting new algorithms. For new algorithms, PRs should be opened directly. - ## Make sure your issue isn't a duplicate and you follow our [contributing guidelines](https://github.com/TheAlgorithms/JavaScript/blob/master/CONTRIBUTING.md) - - type: textarea - id: description - attributes: - label: Motivation - description: Describe what is the motivation behind this feature. - validations: - required: true - - type: textarea - id: examples - attributes: - label: Examples - description: If possible, provide examples of how this feature can be used. - validations: - required: false - - type: textarea - id: workarounds - attributes: - label: Possible workarounds - description: If possible, describes possible workarounds to this feature. - validations: - required: false - - type: textarea - id: extra_information - attributes: - label: Additional information - description: Is there anything else we should know about this feature request? - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/other.yml b/.github/ISSUE_TEMPLATE/other.yml deleted file mode 100644 index 0ae3fb4534..0000000000 --- a/.github/ISSUE_TEMPLATE/other.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Other issue -description: Use this for any other issues. Do NOT create blank issues -title: "[OTHER]: " -labels: ["awaiting triage"] -body: - - type: textarea - id: description - attributes: - label: What would you like to share? - description: Provide a clear and concise explanation of your issue. - validations: - required: true - - type: textarea - id: extrainfo - attributes: - label: Additional information - description: Is there anything else we should know about this issue? - validations: - required: false diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 15e494ec86..0000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Keep GitHub Actions up to date with Dependabot... -# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "daily" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index bcb4e6bbaa..0000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,19 +0,0 @@ -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/) [know more](https://www.gitpod.io/docs/pull-requests/) - -### Describe your change: - -- [ ] Add an algorithm? -- [ ] Fix a bug or typo in an existing algorithm? -- [ ] Documentation change? - -### Checklist: - -- [ ] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Javascript/blob/master/CONTRIBUTING.md). -- [ ] This pull request is all my own work -- I have not plagiarized. -- [ ] I know that pull requests will not be merged if they fail the automated tests. -- [ ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms. -- [ ] All new JavaScript files are placed inside an existing directory. -- [ ] All filenames should use the UpperCamelCase (PascalCase) style. There should be no spaces in filenames. - **Example:**`UserProfile.js` is allowed but `userprofile.js`,`Userprofile.js`,`user-Profile.js`,`userProfile.js` are not -- [ ] All new algorithms have a URL in their comments that points to Wikipedia or another similar explanation. -- [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`. diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 9692a0a677..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Number of days of inactivity before an issue becomes stale (2 weeks) -daysUntilStale: 14 -# Number of days of inactivity before a stale issue is closed (a week) -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - bug - - help wanted - - OK to merge -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: > - Please reopen this issue once you commit the changes requested or - make improvements on the code. Thank you for your contributions. diff --git a/.github/workflows/Ci.yml b/.github/workflows/Ci.yml deleted file mode 100644 index 99e8f7831f..0000000000 --- a/.github/workflows/Ci.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Continuous Integration - -on: - push: - branches: - - master - pull_request: - -jobs: - build: - name: Code style and tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: ๐Ÿ“ฆ Install dependencies - run: npm ci - - - name: ๐Ÿงช Run all tests - run: npm run test - - - name: ๐Ÿ’„ Code style - run: npm run check-style - - codespell: - name: Check for spelling errors - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: codespell-project/actions-codespell@master - with: - # file types to ignore - skip: "*.json,*.yml,DIRECTORY.md" - ignore_words_list: "ba,esy,yse,falsy" diff --git a/.github/workflows/UpdateDirectory.js b/.github/workflows/UpdateDirectory.js deleted file mode 100644 index 925b92b781..0000000000 --- a/.github/workflows/UpdateDirectory.js +++ /dev/null @@ -1,71 +0,0 @@ -import path from 'path' -import fs from 'fs' -import { globby } from 'globby' - -function pathPrefix (i) { - const res = ' '.repeat(i) - return res + '*' -} - -function printPath (oldPath, newPath, output) { - const oldParts = oldPath.split(path.sep) - const newParts = newPath.split(path.sep) - - for (let i = 0; i < newParts.length; ++i) { - const newPart = newParts[i] - if (i + 1 > oldParts.length || oldParts[i] !== newPart) { - if (newPart) { - output.push(`${pathPrefix(i)} **${newPart.replace('_', ' ')}**`) - } - } - } - - return newPath -} - -function pathsToMarkdown (filePaths) { - const output = [] - - let oldPath = '' - filePaths.sort(function (a, b) { - if (a.toLowerCase() < b.toLowerCase()) return -1 - if (a.toLowerCase() > b.toLowerCase()) return 1 - return 0 - }) - - for (let filepath of filePaths) { - let filename = path.basename(filepath) - filepath = path.dirname(filepath) - - if (filepath !== oldPath) { - oldPath = printPath(oldPath, filepath, output) - } - - let indent = filepath.split(path.sep).length - - // prepare the markdown-esque prefix to the file's line - const prefix = pathPrefix(indent) - - // remove extension from filename - const name = path.basename(filename, ".js") - const url = path.join(filepath, filename) - - output.push(`${prefix} [${name}](${url})`) - } - - return output.join('\n') -} - -// get paths of all .js files - excluding node_modules, the .github folder, tests and config stuff -globby([ - '**/*.js', - '!(node_modules|.github)/**/*', - "!**/test/**/*", - '!**/*.test.js', - '!**/*.manual-test.js', - '!vitest.config.ts' -]) - // create markdown content - .then(pathsToMarkdown) - // write markdown to file - .then(markdown => fs.writeFileSync('DIRECTORY.md', markdown + '\n', { encoding: 'utf8' })) diff --git a/.github/workflows/UpdateDirectory.yml b/.github/workflows/UpdateDirectory.yml deleted file mode 100644 index 437ab55b91..0000000000 --- a/.github/workflows/UpdateDirectory.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This GitHub Action updates the DIRECTORY.md file (if needed) when doing a git push -name: Update Directory - -on: - push: - branches-ignore: - "master" - -jobs: - updateDirectory: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: ๐Ÿ“ฆ Install dependencies - run: npm ci - - - name: ๐Ÿ—„๏ธ Create Directory from JS files - run: node .github/workflows/UpdateDirectory.js - - - name: Configure Github Action - run: | - git config --global user.name "$GITHUB_ACTOR" - git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - name: ๐Ÿค“ Commit & push new Directory (if needed) - run: | - if [[ `git status --porcelain` ]]; then - git commit -am "Updated Documentation in README.md" - git push - else - echo "NO CHANGES DETECTED" - fi diff --git a/.github/workflows/UploadCoverageReport.yml b/.github/workflows/UploadCoverageReport.yml deleted file mode 100644 index 3f8fee4256..0000000000 --- a/.github/workflows/UploadCoverageReport.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: UploadCoverageReport - -'on': - workflow_dispatch: - push: - branches: - - master - pull_request: - -env: - REPORT_PATH: "coverage/coverage-final.json" - -jobs: - UploadCoverageReport: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - name: Install dependencies - run: npm ci - - - name: Generate coverage report - run: npm test -- --coverage - - - name: Upload coverage to codecov (tokenless) - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository - uses: codecov/codecov-action@v4 - with: - files: "${{ env.REPORT_PATH }}" - fail_ci_if_error: true - - - name: Upload coverage to codecov (with token) - if: "! github.event.pull_request.head.repo.fork " - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: "${{ env.REPORT_PATH }}" - fail_ci_if_error: true -... diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 3f6c645c7c..0000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,11 +0,0 @@ -github: - prebuilds: - addBadge: true - addComment: false - addCheck: false - master: true - branches: true - pullRequestsFromForks: true - -tasks: - - init: npm install diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100755 index 037dbe870a..0000000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - -npm run check-style -npm run test diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index 05f33b84f5..0000000000 --- a/vitest.config.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { defineConfig } from 'vitest/config' - -export default defineConfig({ - test: { - globals: true, - restoreMocks: true, - coverage: { - reporter: ['text', 'json', 'html'] - } - } -})