diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..978bc43f5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [staabm, Arkni] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 478023c77..000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,23 +0,0 @@ - - -### Subject of the issue - - -### Your environment -* version of `jquery-validate`: -* which browser and its version: - -### Steps to reproduce - - -### Expected behaviour - - -### Actual behaviour - diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md new file mode 100644 index 000000000..e0a6968ea --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -0,0 +1,25 @@ +--- +name: Bug report +about: Report something that's broken. Please ensure that you're using the latest version. +labels: ["Type: Bug", "Status: Unverified"] + +--- + +## Your environment +* Version of `jquery-validate`: +* Browser name and version: + +## Current behavior + + + +## Expected behavior + + + +## Live demo + + diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.md b/.github/ISSUE_TEMPLATE/02_feature_request.md new file mode 100644 index 000000000..03feaaf61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Wouldn't it be nice if jquery-validate could ... +labels: ["Type: Feature"] + +--- + +## New feature motivation + + + +## New feature description + + + +## New feature implementation + + diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..ff16301d5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Support Questions & Other + url: https://stackoverflow.com/questions/ask?tags=jquery-validate + about: 'This repository is only for reporting bugs. If you have a question or need help using the library, click:' + - name: Documentation issue + url: https://github.com/jquery-validation/validation-content + about: For documentation issues, open a pull request at the jquery-validation/validation-content repository diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index c6fd0c20b..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,24 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - bug - - "help wanted" - - "MERGE ME" - - "NEEDS REVIEW" -# Ignore issues in a milestone -exemptMilestones: true -# 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/proposal has been automatically marked as idle and stale because it hasn't - had any recent activity. It will be automtically closed if no further activity - occurs. If you think this is wrong, or the problem still persists, just pop - a reply in the comments and one of the maintainers will (try!) to follow up. - - Thank you for contributing :) -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..7b3883f6f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: ci + +on: + push: + pull_request: + +jobs: + linux_tests: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false + + - name: Run tests + run: npm install diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..7ef364fb7 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,72 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "master" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "master" ] + schedule: + - cron: '19 23 * * 1' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..6332ce773 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,39 @@ +# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/actions/stale +name: Mark stale issues and pull requests + +on: + schedule: + - cron: '10 05 * * *' + +jobs: + stale: + + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + + steps: + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + stale-issue-message: > + This issue lacks verification. Please provide a reproduction link. + + Thank you for contributing :) + stale-pr-message: > + This issue/proposal has been automatically marked as idle and stale because it hasn't + had any recent activity. It will be automatically closed if no further activity + occurs. If you think this is wrong, or the problem still persists, just pop + a reply in the comments and one of the maintainers will (try!) to follow up. + + Thank you for contributing :) + stale-issue-label: 'stale' + stale-pr-label: 'stale' + exempt-all-milestones: true + exempt-issue-labels: 'Status: Verified, Type: Feature' + exempt-pr-labels: 'MERGE ME, NEEDS REVIEW' diff --git a/.jscsrc b/.jscsrc index d50b36c38..018d8ca09 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,5 +1,8 @@ { "preset": "jquery", "maximumLineLength": null, - "requireCamelCaseOrUpperCaseIdentifiers": null + "requireCamelCaseOrUpperCaseIdentifiers": null, + "excludeFiles": [ + "test/custom-elements.js" + ] } diff --git a/.jshintignore b/.jshintignore index ffdbea7be..420537ee7 100644 --- a/.jshintignore +++ b/.jshintignore @@ -4,3 +4,4 @@ test/qunit/ dist/ demo/ *.min.js +test/custom-elements.js diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e328e33da..000000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - 6 - -sudo: false - -install: - - npm install - -cache: - directories: - - node_modules diff --git a/Gruntfile.js b/Gruntfile.js index c5fe1df1e..2f4e3ea6c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -107,6 +107,7 @@ grunt.initConfig( { "Gruntfile.js", "lib/**/*.*", "package.json", + "LICENSE.md", "README.md", "src/**/*.*", "test/**/*.*" @@ -114,7 +115,17 @@ grunt.initConfig( { } }, qunit: { - files: "test/index.html" + files: "test/index.html", + options: { + puppeteer: { + args: [ + "--headless", + "--disable-web-security", + "--allow-file-access-from-files" + ] + }, + timeout: 10000 + } }, jshint: { options: { diff --git a/README.md b/README.md index f02786c1c..1515afe5f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ================================ [![release](https://img.shields.io/github/release/jquery-validation/jquery-validation.svg)](https://github.com/jquery-validation/jquery-validation/releases/latest) -[![Build Status](https://secure.travis-ci.org/jquery-validation/jquery-validation.svg)](https://travis-ci.org/jquery-validation/jquery-validation) +[![Build Status](https://github.com/jquery-validation/jquery-validation/actions/workflows/ci.yml/badge.svg)](https://github.com/jquery-validation/jquery-validation/actions/workflows/ci.yml) [![devDependency Status](https://david-dm.org/jquery-validation/jquery-validation/dev-status.svg?theme=shields.io)](https://david-dm.org/jquery-validation/jquery-validation#info=devDependencies) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/jquery-validation/badge?style=rounded)](https://www.jsdelivr.com/package/npm/jquery-validation) @@ -73,6 +73,27 @@ $("#myForm").validate({ }); ``` +## Accessibility +For an invalid field, the default output for the jQuery Validation Plugin is an error message in a `