diff --git a/.github/config.yml b/.github/config.yml new file mode 100644 index 0000000..489e39b --- /dev/null +++ b/.github/config.yml @@ -0,0 +1,19 @@ +# Configuration for welcome - https://github.com/behaviorbot/welcome + +# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome + +# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome +# Comment to be posted to on PRs from first time contributors in your repository +newPRWelcomeComment: > + Thanks for opening this pull request, a maintainer will get back to you shortly! + In the meantime, please check out the [contributing guidelines](../tree/master/CONTRIBUTING.md). + +# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot + +# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic +# Anything higher than this threshold will be marked as toxic and commented on +sentimentBotToxicityThreshold: .7 + +# *Required* Comment to reply with +sentimentBotReplyComment: > + Please be respectful of other users. cc/ @rvalitov diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3f374e0..7d54779 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,23 +5,36 @@ version: 2 updates: - - package-ecosystem: "npm" # See documentation for possible values - directory: "/" # Location of package manifests + - package-ecosystem: "npm" + directory: "/" schedule: - interval: "monthly" - ignore: - # No need to update the UIKit, I guess - - dependency-name: "uikit" + interval: "weekly" + day: "sunday" + time: "17:00" + timezone: "Europe/Paris" groups: + prod-dependencies: + dependency-type: "production" + update-types: + - "minor" + - "patch" + patterns: + - "*" dev-dependencies: + dependency-type: "development" + update-types: + - "minor" + - "patch" patterns: - "*" - package-ecosystem: "github-actions" directory: "/" schedule: - # Check for updates to GitHub Actions - interval: "monthly" + interval: "weekly" + day: "sunday" + time: "17:00" + timezone: "Europe/Paris" groups: actions-deps: patterns: diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..e21c5bf --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,18 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 14 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# 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: > + This issue was automatically closed due to inactivity. diff --git a/.github/workflows/codacy-coverage-reporter.yml b/.github/workflows/codacy-coverage-reporter.yml deleted file mode 100644 index 2336a1f..0000000 --- a/.github/workflows/codacy-coverage-reporter.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Codacy Coverage Reporter - -on: - # Runs on pushes targeting the default branch - push: - branches: [ "main" ] - - # Allows you to run this workflow manually from the Actions tab - # eslint-disable-next-line yml/no-empty-mapping-value - workflow_dispatch: - -# Default to bash -defaults: - run: - shell: bash - -env: - NODE_VERSION: 23.x - -jobs: - # Build job - build: - runs-on: ${{ vars.UBUNTU_VERSION }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Install Node.js dependencies - run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" - - name: Run test coverage - run: npm run coverage - - name: Run codacy-coverage-reporter - uses: codacy/codacy-coverage-reporter-action@master - with: - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - # or - # api-token: ${{ secrets.CODACY_API_TOKEN }} - coverage-reports: ./coverage/lcov.info - # or a comma-separated list for multiple reports - # coverage-reports: , - diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml index 51149e8..1db3cce 100644 --- a/.github/workflows/codacy.yml +++ b/.github/workflows/codacy.yml @@ -6,16 +6,17 @@ # For more information on Codacy Analysis CLI in general, see # https://github.com/codacy/codacy-analysis-cli. -name: Codacy +name: Codacy Security Scan on: push: - branches: [ "main" ] + branches: ["master", "main"] pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '22 11 * * 0' + branches: ["master", "main"] + + # Allows you to run this workflow manually from the Actions tab + # eslint-disable-next-line yml/no-empty-mapping-value + workflow_dispatch: permissions: contents: read @@ -25,20 +26,22 @@ jobs: permissions: contents: read # for actions/checkout to fetch code security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - #actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status name: Codacy Security Scan runs-on: ${{ vars.UBUNTU_VERSION }} steps: # Checkout the repository to the GitHub Actions runner - name: Checkout code - uses: actions/checkout@main + uses: actions/checkout@v4 # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@master + uses: codacy/codacy-analysis-cli-action@v4.4.5 with: - verbose: true + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true output: results.sarif format: sarif # Adjust severity of non-security issues @@ -49,24 +52,33 @@ jobs: # Upload the SARIF file generated in the previous step - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@main + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif - codacy-analysis-cli: - name: Codacy Analysis CLI + codacy-coverage-reporter: + name: Codacy Coverage Reporter runs-on: ${{ vars.UBUNTU_VERSION }} - if: github.event_name == 'push' steps: - - name: Checkout code - uses: actions/checkout@main - - - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@master + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4.1.0 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + - name: Install Node.js dependencies + run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true" + - name: Test coverage + run: npm run coverage + - name: Codacy coverage reporter + uses: codacy/codacy-coverage-reporter-action@v1.3.0 with: - verbose: true project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} # or # api-token: ${{ secrets.CODACY_API_TOKEN }} - upload: true - max-allowed-issues: 2147483647 + coverage-reports: coverage/lcov.info + # or a comma-separated list for multiple reports + # coverage-reports: , diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 0e9e416..bbd3422 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -12,6 +12,7 @@ permissions: jobs: dependency-review: + name: Dependency Review runs-on: ${{ vars.UBUNTU_VERSION }} steps: - name: 'Checkout Repository' diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 1f933dc..78dc641 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -34,6 +34,7 @@ env: jobs: # Build job build: + name: Build runs-on: ${{ vars.UBUNTU_VERSION }} steps: @@ -75,6 +76,7 @@ jobs: # Deployment job deploy: + name: Deploy environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index e25e811..2ede222 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -6,9 +6,9 @@ name: SonarCloud analysis on: push: - branches: ["main"] + branches: ["master", "main"] pull_request: - branches: ["main"] + branches: ["master", "main"] types: [opened, synchronize, reopened] # eslint-disable-next-line yml/no-empty-mapping-value @@ -31,7 +31,7 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@master + uses: actions/setup-node@v4.1.0 with: node-version: ${{ env.NODE_VERSION }} cache: 'npm' diff --git a/.github/workflows/tests.js.yml b/.github/workflows/tests.js.yml index 321a437..4a5fd11 100644 --- a/.github/workflows/tests.js.yml +++ b/.github/workflows/tests.js.yml @@ -20,6 +20,8 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ node-version: [ latest, 23.x, 22.x, 21, 20.x ] + name: Node.js ${{ matrix.node-version }} + steps: - name: Install Hugo CLI run: | @@ -32,7 +34,7 @@ jobs: with: submodules: recursive - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@master + uses: actions/setup-node@v4.1.0 with: node-version: ${{ matrix.node-version }} cache: 'npm' @@ -42,6 +44,7 @@ jobs: # Make a Lighthouse Report Lighthouse: + name: Lighthouse Report needs: Build if: ${{ github.actor != 'dependabot[bot]' }} runs-on: ${{ vars.UBUNTU_VERSION }} @@ -91,6 +94,8 @@ jobs: run: hugo server & # Wait till the server warms up - run: sleep 15 + - name: Disable AppArmor for Chrome + run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns - name: Run Lighthouse Desktop run: npm run lighthouse-desktop - name: Run Lighthouse Mobile @@ -101,7 +106,7 @@ jobs: run: npm run screenshot:desktop - name: Upload Lighthouse Report id: lighthouseUploadReport - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: Lighthouse-report path: | @@ -118,8 +123,8 @@ jobs: desktop.jpg uploadMethod: imgbb apiKey: '${{ secrets.IMGBB_API_KEY }}' - # Images will be automatically deleted after 30 days - expiration: 86400 + # Images will be automatically deleted after 7 days + expiration: 604800 - name: Publish info uses: peter-evans/create-or-update-comment@v4 with: @@ -135,6 +140,7 @@ jobs: # Make screenshots of the resulting page Screenshots: + name: Screenshots needs: Build if: ${{ github.actor != 'dependabot[bot]' }} runs-on: ${{ vars.UBUNTU_VERSION }} @@ -174,11 +180,13 @@ jobs: run: | hugo \ --minify + - name: Disable AppArmor for Chrome + run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns - name: Make screenshots run: npm run screenshot - name: Upload files as artifacts id: upload-files-artifacts - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v4 with: name: Screenshots path: | @@ -190,131 +198,33 @@ jobs: with: # Device viewport sizes https://blisk.io/devices path: | - 320x568.jpg - 568x320.jpg 360x780.jpg 780x360.jpg - 375x812.jpg - 812x375.jpg - 390x844.jpg - 844x390.jpg - 430x932.jpg - 932x430.jpg 768x1024.jpg 1024x768.jpg - 810x1080.jpg - 1080x810.jpg - 834x1112.jpg - 1112x834.jpg - 1024x1366.jpg - 1366x1024.jpg - 1440x900.jpg - 2304x1440.jpg 1280x800.jpg - 1366x768.jpg - 2560x1440.jpg 1920x1080.jpg - 3200x1800.jpg - 2048x1152.jpg uploadMethod: imgbb apiKey: '${{ secrets.IMGBB_API_KEY }}' - # Images will be automatically deleted after 30 days - expiration: 86400 + # Images will be automatically deleted after 7 days + expiration: 604800 - name: Publish the images uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body: | - #### Screenshots - -
- Smartphones - - #### iPhone 5 (320x568) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![iPhone 5 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[0]}}) | ![iPhone 5 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[1]}}) | - - #### Honor 20 Pro (360x780) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![Honor 20 Pro portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[2]}}) | ![Honor 20 Pro portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[3]}}) | - - #### iPhone X (375x812) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![iPhone X portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[4]}}) | ![iPhone X portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[5]}}) | - - #### iPhone 12/13 Pro (390x844) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![iPhone 12 Pro portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[6]}}) | ![iPhone 12 Pro portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[7]}}) | - - #### iPhone 14/15 Pro Max (430x932) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![iPhone 14 Pro Max portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[8]}}) | ![iPhone 14 Pro Max portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[9]}}) | - -
- -
- Tablets + #### Screenshots - #### iPad Mini 4 / Pro 9 (768x1024) - - | Portrait Mode | Landscape Mode | + | Phone Portrait Mode (360x780) | Phone Landscape Mode (780x360) | |----|----| - | ![iPad Mini portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[10]}}) | ![iPad Mini portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[11]}}) | - - #### iPad 10 (810x1080) - - | Portrait Mode | Landscape Mode | - |----|----| - | ![iPad 10 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[12]}}) | ![iPad 10 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[13]}}) | - - #### iPad Pro 10 (834x1112) + | ![Phone Portrait Mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[0]}}) | ![Phone Landscape Mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[1]}}) | - | Portrait Mode | Landscape Mode | + | iPad Portrait Mode (768x1024) | iPad Landscape Mode (1024x768) | |----|----| - | ![iPad Pro 10 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[14]}}) | ![iPad Pro 10 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[15]}}) | - - #### iPad Pro 12 (1024x1366) + | ![iPad Portrait Mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[2]}}) | ![iPad Landscape Mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[3]}}) | - | Portrait Mode | Landscape Mode | + | Laptop-S 1280x800 | Desktop 1920x1080 | |----|----| - | ![iPad Pro 12 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[16]}}) | ![iPad Pro 12 portrait mode screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[17]}}) | - -
- -
- Notebooks + | ![Laptop-S 1280x800 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[4]}}) | ![Desktop 1920x1080 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[5]}}) | - | MacBook Air 13.3"/15.4" (1440x900) | MacBook 12" (2304x1440) | - |----|----| - | ![MacBook Air 13.3" screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[18]}}) | ![MacBook 12" screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[19]}}) | - - | Laptop-S 1280x800 | Laptop-M 1366x768 | - |----|----| - | ![Laptop-S 1280x800 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[20]}}) | ![Laptop-M 1366x768 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[21]}}) | - -
- -
- Desktop - - | 2560x1440 | 1920x1080 | - |----|----| - | ![2560x1440 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[22]}}) | ![1920x1080 screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[23]}}) | - - | iMac Pro Retina 5K 27" (3200x1800) | iMac Retina 4K 21.5" (2048x1152) | - |----|----| - | ![iMac Pro Retina 5K 27" screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[24]}}) | ![iMac Retina 4K 21.5" screenshot](${{(fromJson(steps.upload-files-imgbb.outputs.urls))[25]}}) | - -
- [Full ZIP](${{ steps.upload-files-artifacts.outputs.artifact-url }}) diff --git a/.idea/sonarlint.xml b/.idea/sonarlint.xml new file mode 100644 index 0000000..79e0325 --- /dev/null +++ b/.idea/sonarlint.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index 6e88b69..6a2354d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -34,12 +34,12 @@ module.exports = { coverageProvider: "v8", // A list of reporter names that Jest uses when writing coverage reports - // coverageReporters: [ - // "json", - // "text", - // "lcov", - // "clover" - // ], + coverageReporters: [ + // "json", + // "text", + "lcov", + // "clover" + ], // An object that configures minimum threshold enforcement for coverage results // coverageThreshold: undefined, @@ -106,7 +106,13 @@ module.exports = { // projects: undefined, // Use this configuration option to add custom reporters to Jest - // reporters: undefined, + reporters: [ + 'default', + ['jest-sonar', { + outputDirectory: 'coverage', + outputName: 'test-report.xml' + }] + ], // Automatically reset mock state before every test // resetMocks: false, diff --git a/package-lock.json b/package-lock.json index a281e71..ab910a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "globals": "^15.14.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-sonar": "^0.2.16", "lighthouse": "^12.3.0", "markdownlint-cli": "^0.44.0", "npm-package-json-lint": "^8.0.0", @@ -31,11 +32,12 @@ "postcss": "^8.5.1", "postcss-cli": "^11.0.0", "remark-cli": "^12.0.1", - "remark-lint-list-item-indent": "^4.0.1", - "remark-preset-lint-consistent": "^6.0.1", - "remark-preset-lint-recommended": "^7.0.1", - "stylelint": "^16.14.1", - "stylelint-config-standard": "^37.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-preset-lint-consistent": "^6.0.0", + "remark-preset-lint-recommended": "^7.0.0", + "sort-package-json": "^2.12.0", + "stylelint": "^16.12.0", + "stylelint-config-standard": "^36.0.1", "uikit": "3.21.16" }, "engines": { @@ -4587,6 +4589,16 @@ "node": ">=6" } }, + "node_modules/detect-indent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-7.0.1.tgz", + "integrity": "sha512-Mc7QhQ8s+cLrnUfU/Ji94vG/r8M26m8f++vyres4ZoojaRDpZ1eSIh/EpzLNwlWuvzSZ3UbDFspjFvTDXe6e/g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + } + }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -5735,6 +5747,16 @@ "node": ">= 14" } }, + "node_modules/git-hooks-list": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/git-hooks-list/-/git-hooks-list-3.1.0.tgz", + "integrity": "sha512-LF8VeHeR7v+wAbXqfgRlTSX/1BJR9Q1vEMR8JAz1cEg6GX07+zyj3sAdDvYjj/xnlIfVuGgj4qBei1K3hKH+PA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/fisker/git-hooks-list?sponsor=1" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -7356,6 +7378,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-sonar": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/jest-sonar/-/jest-sonar-0.2.16.tgz", + "integrity": "sha512-ES6Z9BbIVDELtbz+/b6pv41B2qOfp38cQpoCLqei21FtlkG/GzhyQ0M3egEIM+erpJOkpRKM8Tc8/YQtHdiTXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "4.3.0", + "strip-ansi": "6.0.1" + } + }, + "node_modules/jest-sonar/node_modules/entities": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz", + "integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -12742,6 +12788,59 @@ "node": ">= 14" } }, + "node_modules/sort-object-keys": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sort-object-keys/-/sort-object-keys-1.1.3.tgz", + "integrity": "sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sort-package-json": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/sort-package-json/-/sort-package-json-2.12.0.tgz", + "integrity": "sha512-/HrPQAeeLaa+vbAH/znjuhwUluuiM/zL5XX9kop8UpDgjtyWKt43hGDk2vd/TBdDpzIyzIHVUgmYofzYrAQjew==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-indent": "^7.0.1", + "detect-newline": "^4.0.0", + "get-stdin": "^9.0.0", + "git-hooks-list": "^3.0.0", + "is-plain-obj": "^4.1.0", + "semver": "^7.6.0", + "sort-object-keys": "^1.1.3", + "tinyglobby": "^0.2.9" + }, + "bin": { + "sort-package-json": "cli.js" + } + }, + "node_modules/sort-package-json/node_modules/detect-newline": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-4.0.1.tgz", + "integrity": "sha512-qE3Veg1YXzGHQhlA6jzebZN2qVf6NX+A7m7qlhCGG30dJixrAQhYOsJjsnBjJkCSmuOPpCk30145fr8FV0bzog==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/sort-package-json/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -13119,9 +13218,9 @@ } }, "node_modules/stylelint-config-recommended": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-15.0.0.tgz", - "integrity": "sha512-9LejMFsat7L+NXttdHdTq94byn25TD+82bzGRiV1Pgasl99pWnwipXS5DguTpp3nP1XjvLXVnEJIuYBfsRjRkA==", + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-14.0.1.tgz", + "integrity": "sha512-bLvc1WOz/14aPImu/cufKAZYfXs/A/owZfSMZ4N+16WGXLoX5lOir53M6odBxvhgmgdxCVnNySJmZKx73T93cg==", "dev": true, "funding": [ { @@ -13138,13 +13237,13 @@ "node": ">=18.12.0" }, "peerDependencies": { - "stylelint": "^16.13.0" + "stylelint": "^16.1.0" } }, "node_modules/stylelint-config-standard": { - "version": "37.0.0", - "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-37.0.0.tgz", - "integrity": "sha512-+6eBlbSTrOn/il2RlV0zYGQwRTkr+WtzuVSs1reaWGObxnxLpbcspCUYajVQHonVfxVw2U+h42azGhrBvcg8OA==", + "version": "36.0.1", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-36.0.1.tgz", + "integrity": "sha512-8aX8mTzJ6cuO8mmD5yon61CWuIM4UD8Q5aBcWKGSf6kg+EC3uhB+iOywpTK4ca6ZL7B49en8yanOFtUW0qNzyw==", "dev": true, "funding": [ { @@ -13158,13 +13257,13 @@ ], "license": "MIT", "dependencies": { - "stylelint-config-recommended": "^15.0.0" + "stylelint-config-recommended": "^14.0.1" }, "engines": { "node": ">=18.12.0" }, "peerDependencies": { - "stylelint": "^16.13.0" + "stylelint": "^16.1.0" } }, "node_modules/stylelint/node_modules/@csstools/selector-specificity": { @@ -13584,6 +13683,48 @@ "node": ">=0.10.0" } }, + "node_modules/tinyglobby": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.10.tgz", + "integrity": "sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.2.tgz", + "integrity": "sha512-KnhMXsKSPZlAhp7+IjUkRZKPb4fUyccpDrdFXbi4QL1qkmFh9kVY09Yox+n4MaOb3lHZ1Tv829C3oaaXoMYPDQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tldts": { "version": "6.1.66", "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.66.tgz", diff --git a/package.json b/package.json index f7b0303..9186f1c 100644 --- a/package.json +++ b/package.json @@ -1,38 +1,35 @@ { "name": "website-not-found-page-generator", - "title": "404 Page for Missing Website (Domain)", - "description": "Generates a \"not found domain\" compact responsive page for hosting providers when a domain or website is suspended, deleted or unavailable.", "version": "1.0.0", + "description": "Generates a \"not found domain\" compact responsive page for hosting providers when a domain or website is suspended, deleted or unavailable.", + "homepage": "https://github.com/walitoff/website-not-found", + "bugs": { + "url": "https://github.com/walitoff/website-not-found/issues" + }, "repository": { "type": "git", "url": "git+https://github.com/walitoff/website-not-found.git" }, - "author": "Ramil Valitov (https://github.com/rvalitov)", "license": "GPL-3.0", - "bugs": { - "url": "https://github.com/walitoff/website-not-found/issues" - }, - "homepage": "https://github.com/walitoff/website-not-found", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, + "author": "Ramil Valitov (https://github.com/rvalitov)", "scripts": { - "lint": "eslint .", - "lint:fix": "eslint --fix .", - "json": "jsonlint -q ./*.json", - "package": "npx npm-package-json-lint .", "build": "npx cpy ./node_modules/uikit/dist/css/uikit.min.css ./src/assets --flat && npx cpy ./node_modules/uikit/dist/js/uikit.min.js ./src/assets --flat && cd ./src && hugo --minify --environment production", - "start-server": "cd ./src && hugo server --environment production", + "coverage": "jest --coverage", + "jest": "jest", + "json": "jsonlint -q ./*.json", "lighthouse-desktop": "npx lighthouse http://localhost:1313/ --no-enable-error-reporting --output-path=./desktop --output=html --output=json --config-path=./lr-desktop-config.js --chrome-flags=\"--no-sandbox --headless --disable-gpu --disable-dev-shm-usage\"", "lighthouse-mobile": "npx lighthouse http://localhost:1313/ --no-enable-error-reporting --output-path=./mobile --output=html --output=json --config-path=./lr-mobile-config.js --chrome-flags=\"--no-sandbox --headless --disable-gpu --disable-dev-shm-usage\"", - "markdownlint": "markdownlint --config .markdownlint.json \"src/**/*.md\" \"*.md\"", + "lint": "eslint .", + "lint:fix": "eslint --fix .", "markdown": "remark . --frail", "markdown:fix": "remark . --frail --output", - "jest": "jest", - "coverage": "jest --coverage", + "markdownlint": "markdownlint --config .markdownlint.json \"src/**/*.md\" \"*.md\"", + "package": "npx npm-package-json-lint .", "screenshot": "pageres ./src/public/index.html 320x568 568x320 360x780 780x360 375x812 812x375 390x844 844x390 430x932 932x430 768x1024 1024x768 810x1080 1080x810 834x1112 1112x834 1024x1366 1366x1024 1440x900 2304x1440 1280x800 1366x768 2560x1440 1920x1080 3200x1800 2048x1152 --overwrite --format=jpg --crop --filename=\"<%= size %>\"", - "screenshot:mobile": "pageres ./mobile.report.html 800x1000 --overwrite --format=jpg --crop --filename=\"mobile\"", "screenshot:desktop": "pageres ./desktop.report.html 800x1000 --overwrite --format=jpg --crop --filename=\"desktop\"", + "screenshot:mobile": "pageres ./mobile.report.html 800x1000 --overwrite --format=jpg --crop --filename=\"mobile\"", + "sort": "sort-package-json ./package.json", + "start-server": "cd ./src && hugo server --environment production", "stylelint": "stylelint -f verbose \"src/**/*.css\"", "stylelint:fix": "stylelint \"src/**/*.css\" --fix", "test": "npm run lint && npm run stylelint && npm run markdown && npm run markdownlint && npm run package && npm run json && npm run jest" @@ -57,6 +54,7 @@ "globals": "^15.14.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jest-sonar": "^0.2.16", "lighthouse": "^12.3.0", "markdownlint-cli": "^0.44.0", "npm-package-json-lint": "^8.0.0", @@ -66,11 +64,16 @@ "postcss": "^8.5.1", "postcss-cli": "^11.0.0", "remark-cli": "^12.0.1", - "remark-lint-list-item-indent": "^4.0.1", - "remark-preset-lint-consistent": "^6.0.1", - "remark-preset-lint-recommended": "^7.0.1", - "stylelint": "^16.14.1", - "stylelint-config-standard": "^37.0.0", + "remark-lint-list-item-indent": "^4.0.0", + "remark-preset-lint-consistent": "^6.0.0", + "remark-preset-lint-recommended": "^7.0.0", + "sort-package-json": "^2.12.0", + "stylelint": "^16.12.0", + "stylelint-config-standard": "^36.0.1", "uikit": "3.21.16" - } + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "title": "404 Page for Missing Website (Domain)" } diff --git a/sonar-project.properties b/sonar-project.properties index 2a66acd..9463e13 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -5,9 +5,16 @@ sonar.organization=walitoff sonar.projectName=Website Not Found #sonar.projectVersion=1.0 - # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. -#sonar.sources=. +# Defaults to . +sonar.sources=src +sonar.verbose=true +sonar.exclusions=**/public/**/*, **/resources/_gen/**/*, **/*.min.js, **/*.min.css +sonar.tests=tests +# Within the directories defined by sonar.tests, subset of files that will be considered as tests +sonar.test.inclusions=**/*.test.js +sonar.javascript.lcov.reportPaths=coverage/lcov.info +sonar.testExecutionReportPaths=coverage/test-report.xml # Encoding of the source code. Default is default system encoding -#sonar.sourceEncoding=UTF-8 +sonar.sourceEncoding=UTF-8