diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index f6e5abe..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', - parserOptions: { - ecmaVersion: 2020, - sourceType: 'module', - }, - env: { - node: true, - browser: true, - commonjs: true, - }, - settings: {}, - extends: ['plugin:@typescript-eslint/recommended', 'eslint:recommended'], - rules: { - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/explicit-function-return-type': 'off', - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-var-requires': 'off', - indent: ['error', 4, { SwitchCase: 1 }], - 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 2 }], - 'no-useless-escape': 'off', - }, -}; diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 2b03105..5433e0b 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ github: permafrost-dev +custom: https://permafrost.dev/open-source diff --git a/.github/codecov.yml b/.github/codecov.yml index 7259276..37b0e91 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,6 +1,6 @@ codecov: branch: main - require_ci_to_pass: yes + require_ci_to_pass: true coverage: status: @@ -8,14 +8,13 @@ coverage: default: informational: true target: auto - # this allows a 10% drop from the previous base commit coverage threshold: 20% patch: default: informational: true precision: 2 round: up - range: "40...80" + range: "70...100" parsers: javascript: @@ -33,12 +32,13 @@ comment: require_changes: true ignore: + - ".husky/" - "build/" - "dist/" + - "coverage/" - "src/index.ts" - "src/index-standalone.ts" - - ".eslintrc.js" - - "jest.config.js" + - "eslint.config.js" - "prettier.config.js" - - "rollup.config.js" - - "rollup.standalone-config.js" + - "vite.config.js" + - "vite.config.standalone.js" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e5bcc00..8c7c556 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,14 +4,14 @@ updates: - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "daily" + interval: "weekly" labels: - "dependencies" - package-ecosystem: "npm" directory: "/" schedule: - interval: "daily" + interval: "weekly" allow: - dependency-type: "direct" commit-message: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d961a66..559e093 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -1,22 +1,8 @@ -# 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: [ main ] - #pull_request: - # # The branches below must be a subset of the branches above - # branches: [ main ] + push: + branches: [ main ] schedule: - cron: '24 2 * * 1' @@ -29,39 +15,18 @@ jobs: fail-fast: false matrix: language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - name: Checkout repository uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v3 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. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - # 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@v3 - # ℹ️ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 7dcca24..cafca6f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -10,23 +10,23 @@ jobs: runs-on: ubuntu-latest if: ${{ github.actor == 'dependabot[bot]' }} steps: - + - name: Dependabot metadata id: metadata uses: dependabot/fetch-metadata@v2 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Auto-merge Dependabot PRs for semver-minor updates - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} + + - name: Dependabot auto-merge minor & patch updates + if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - - name: Auto-merge Dependabot PRs for semver-patch updates - if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + + - name: Dependabot auto-merge actions major updates (if compat >= 90%) + if: ${{steps.metadata.outputs.package-ecosystem == 'github_actions' && steps.metadata.outputs.update-type == 'version-update:semver-major' && steps.metadata.outputs.compatibility-score >= 90}} run: gh pr merge --auto --merge "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + GH_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b529592..2ba9035 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,17 +5,16 @@ on: branches: - main pull_request: - branches: - - main + pull_request_target: + jobs: tests: runs-on: ubuntu-latest - strategy: fail-fast: true matrix: - node-version: [14, 16] + node-version: [20, 22] steps: - name: Checkout repository @@ -28,31 +27,18 @@ jobs: with: node-version: ${{ matrix.node-version }} - - name: Get yarn cache directory path - id: npm-cache-dir-path - run: echo "::set-output name=dir::$(npm config get cache)" - - - name: Cache dependencies - uses: actions/cache@v4.1.2 - id: npm-cache + - uses: oven-sh/setup-bun@v2 with: - path: ${{ steps.npm-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node-${{ matrix.node-version }}-npm- + bun-version: latest - name: Install dependencies - run: npm install - - - name: Run the tests - run: npm run test + run: bun install - name: Run the tests with coverage - run: npm run test -- --coverage --coverageReporters json + run: bun run test:coverage - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4.6.0 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - files: coverage/coverage-final.json - + files: coverage/coverage.json diff --git a/.gitignore b/.gitignore index 3db9af7..39dd1c5 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.vscode /node_modules /dist +/dist-temp* /coverage package-lock.json diff --git a/.husky/pre-commit b/.husky/pre-commit index 3199e8e..015c708 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,3 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" npm run lint:staged diff --git a/.npmignore b/.npmignore index a50a8c9..967f7e3 100644 --- a/.npmignore +++ b/.npmignore @@ -1,28 +1,28 @@ +/.coverage /.git /.github +/.husky /.vscode /build /coverage /node_modules /src /tests +/dist-temp* .editorconfig .eslintrc.js .gitattributes +.markdownlint.json .prettierignore .prettierrc -jest.config.js +bun.lockb +eslint.config.js package-lock.json +prettier.config.js SECURITY.md tsconfig.json -*.sh -_*.txt +vite.config.js +vite.config.standalone.js *.ignored -rollup.vue?-config.js -examples -rollup.*.js -.markdownlint.json -/.husky -prettier.config.js -rollup.config.mjs -rollup.standalone-config.mjs +*.log +*.sh diff --git a/.prettierignore b/.prettierignore index 10706c5..f503ebf 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,7 +1,9 @@ -node_modules/* -dist/* +.coverage/* build/* -*.yml -*.yaml +dist-temp* +dist/* +node_modules/* *.ignore *.ignored +*.yaml +*.yml diff --git a/LICENSE b/LICENSE index 455d443..c63a11a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ The MIT License (MIT) -Copyright © 2021 Permafrost Development +Copyright © 2024 Permafrost Software Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index a5b0ed2..900e6f4 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,8 @@ The preferred way to use this package is to load it via CDN, which must be done The `axios` library must be loaded prior to loading `alpinejs-ray` and `Alpine`: ```html - - +