diff --git a/.github/workflows/alfa-release.yml b/.github/workflows/alfa-release.yml deleted file mode 100644 index 463c1a984f..0000000000 --- a/.github/workflows/alfa-release.yml +++ /dev/null @@ -1,238 +0,0 @@ -# DEPRECATED: Use .github/actions/wrapper/action.yml instead. - -# Create a release for the Alfa repos. -# -# WARNING! This workflow pushes to main which **does** trigger other workflow (build, scan, …) -# WARNING! Therefore, there is a risk of creating infinite workflow loops if this workflow is -# WARNING! called from another automated workflow. -# WARNING! Therefore, only ever call this workflow from manual ones (only accepting workflow_dispatch -# WARNING! trigger) to avoid problems. -name: Create a new release (generic workflow) - -# This workflow creates and publish a new release of an Alfa repo. -# -# This workflow is intended to work on Alfa repos sharing the same structure for code and release. -# Namely: -# * TypeScript (or ECMAScript) mono-repo, with yarn workspaces in `/alfa-*` -# * Default branch on `main` -# * Relying on the `yarn install` / `yarn build` / `yarn test` cycle. -# * Using node_modules for dependencies resolution. -# * Using changeset for storing local changes as they happen. -# * Sharing version number between all packages (`fixed` in changeset config). -# * One CHANGELOG.md per workspace (this is part of changeset) -# * One top-level CHANGELOG.md -# * One `yarn alfa-changelog` command to update the top-level changelog. -# * Packages published on the Github registry (may be public or restricted). -# -# This workflow is likely to fail on any repository that does not have the same structure. -# Use at your own judgement call. - -# The github.token of workflows calling this needs -# permissions: -# contents: write <- update the repo with new changelog, … -# packages: write <- actually publish the packages. -# id-token: write <- generate provenance statements, only for public packages. - -on: - workflow_call: - inputs: - # Authentication of the user who will commit the changes - # This user must be able to bypass branch protections as it will commit directly to main. - user-name: - required: true - type: string - user-email: - required: true - type: string - generate-documentation: - required: false - type: boolean - default: false - public: - required: false - type: boolean - default: true # Most Alfa repos are public. - npm-publish: - required: false - type: boolean - default: false - secrets: - token: - description: "A PAT for the user who will commit. Need to have the repo:write permission." - required: true - npm-token: - description: "Token for NPM publication, must be set up if inputs.npm-publish is true." - required: false - -defaults: - run: - shell: bash - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - name: Are we called from `main`? - # New releases should only be created from the main branch of the repo. - # If this workflow is somehow called from another branch, crash. - if: github.ref_name != 'main' - run: exit 1 - - - uses: actions/checkout@v5 - with: - # Only this step needs to be done with the upgraded token, all other actions steps can be done - # with the regular token generated by Github - token: ${{ secrets.token }} - - uses: actions/setup-node@v5 - with: - node-version: 20 - cache: yarn - registry-url: "https://npm.pkg.github.com" - scope: "@siteimprove" - - name: Configure token for Alfa packages - run: > - yarn config set - npmScopes.siteimprove.npmAuthToken - ${{ github.token }} - - - name: Install dependencies - run: yarn install --immutable - - - name: Install Playwright browsers if needed - # https://playwright.dev/docs/ci-intro - # This is very dirty hacks! We should let callers opt-in for extra setup instead. - run: | - [[ ! -d packages/alfa-playwright ]] || yarn workspace @siteimprove/alfa-playwright playwright install - yarn playwright install || true - - - name: Build toolchain if needed - run: | - [[ ! -d packages/alfa-toolchain ]] || yarn build packages/alfa-toolchain - - - name: Build global changelog - run: yarn alfa-changelog - env: - GITHUB_TOKEN: ${{ github.token }} - - - name: Gather changes and update packages - run: yarn changeset version - env: - GITHUB_TOKEN: ${{ github.token }} - - name: Get new version - # This is needed to push the correct git tag - id: new - run: | - echo "version=$(grep \"version\": */alfa-*/package.json | cut -d\" -f 4 | sort -u)" >> $GITHUB_OUTPUT - - - name: Run post version scripts - # yarn is deliberately low on lifecycle scripts and does not include a postversion one. - # See https://yarnpkg.com/advanced/lifecycle-scripts - # We therefore do it manually and rely on yarn workspaces ignoring non-existent scripts. - # We also name our script differently to avoid problems in case npm is ever used and - # triggers the hooks. - run: yarn workspaces foreach --all --no-private --topological-dev run alfa-postversion - - - name: Hack around toplevel dependencies - # https://github.com/changesets/changesets/issues/1229 - # Need to unescape the sed string to interpret ${VERSION} and re-escape it again. - run: sed -i 's/workspace:^[0-9\.]*/workspace:^'${VERSION}'/' package.json - env: - # Passing it as a variable rather than inline hardens against script injection. - # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - VERSION: ${{ steps.new.outputs.version }} - - - name: Update lockfile - # Cross-workspaces references need to be updated. - run: yarn install --no-immutable && yarn dedupe - - name: Verify changes - run: yarn build && yarn test - - - name: Set up git config - # We need a user able to bypass branch protection (i.e. admin on the repo). - run: | - git config --local core.filemode false - git config --local user.name "${{ inputs.user-name }}" - git config --local user.email "${{ inputs.user-email }}" - - - name: Generate documentation - if: inputs.generate-documentation - run: | - yarn extract - yarn document - git add docs/api - - - name: Commit and push changes - # If we made it thus far, we can commit the changes - # We need to take care to **not** commit .yarnrc.yml which has been updated with a token. - run: | - # Removed individual changesets, all changelog (global and local), all package.json (new version number), lockfile - git add .changeset/ CHANGELOG.md **/CHANGELOG.md package.json **/package.json yarn.lock - git commit -m ${VERSION} - git tag --annotate ${VERSION} --message=${VERSION} - git push --follow-tags - env: - # Passing it as a variable rather than inline hardens against script injection. - # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - VERSION: v${{ steps.new.outputs.version }} - - - name: Pack packages - # We use yarn for preparing the packs, but npm for actually uploading them and publishing them. - # This is because npm poorly handles the "workspace:" protocol which yarn supports. - # On the other hand, npm is more flexible in its options for overwriting config file, - # and can generate provenance statements. - # - # It seems that in some cases npm builds its metadata from the package.json file, and not from the - # tarball, and thus adds wrong dependencies to "workspace:…" versions that do not exist. - # Packing in a separate directory forces npm to use the tarball for metadata. - # - # This was witnessed with npm 10.7.0 in the CI/CD pipeline, but could not be reproduced - # locally with the same npm version. npm may change its behaviour, in which case we - # could switch do simply use npm for pack+publish, i.e. do - # yarn workspaces foreach exec npm publish - # Alternatively, if yarn let us overwrite @siteimprove:registry in the CLI, and generate provenance - # statements, we could use yarn for the whole process: - # yarn workspaces foreach run npm publish - run: | - mkdir ${{ github.workspace }}/artifacts - yarn workspaces foreach --all --no-private --topological-dev pack --out ${{ github.workspace }}/artifacts/%s-%v.tgz - - - name: Set token for npm publication (Github package registry) - run: npm config set //npm.pkg.github.com/:_authToken=${{ github.token }} - - name: Make npm release (Github Packages Registry / public) - if: inputs.public - run: > - for package in ${{ github.workspace }}/artifacts/@siteimprove-*.tgz; do - npm publish ${package} --tolerate-republish --provenance --tag latest; - done - - name: Make npm release (Github Packages Registry / private) - if: ${{ ! inputs.public }} - run: > - for package in ${{ github.workspace }}/artifacts/@siteimprove-*.tgz; do - npm publish ${package} --tolerate-republish --tag latest; - done - - - - name: Set token for npm publication (npm registry) - if: inputs.npm-publish - run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.npm-token }} - - name: Make npm release (npm Packages Registry) - # Overwrite the registry with a CLI option, thus leaving the package.json files untouched. - if: inputs.npm-publish - run: > - for package in ${{ github.workspace }}/artifacts/@siteimprove-*.tgz; do - npm publish ${package} --tolerate-republish --provenance --tag latest --@siteimprove:registry="https://registry.npmjs.org/"; - done - - - name: Make Github release - run: > - gh release create ${VERSION} - --prerelease - --verify-tag - --title ${VERSION} - --notes "[Changelog for this release](CHANGELOG.md)" - env: - GH_TOKEN: ${{ github.token }} - # Passing it as a variable rather than inline hardens against script injection. - # See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - VERSION: v${{ steps.new.outputs.version }} diff --git a/config/package-clusters.json b/config/package-clusters.json index 1e76de2dd6..c4a28e4377 100644 --- a/config/package-clusters.json +++ b/config/package-clusters.json @@ -130,7 +130,6 @@ "@siteimprove/alfa-rng", "@siteimprove/alfa-string", "@siteimprove/alfa-test", - "@siteimprove/alfa-test-deprecated", "@siteimprove/alfa-time" ] }, diff --git a/config/validate-structure.json b/config/validate-structure.json index bbac6bb3a5..6f509c1a7c 100644 --- a/config/validate-structure.json +++ b/config/validate-structure.json @@ -11,7 +11,6 @@ "allowedExternalDeps": { "@siteimprove/alfa-compatibility": ["browserslist"], "@siteimprove/alfa-test": ["vitest"], - "@siteimprove/alfa-test-deprecated": ["chalk"], "@siteimprove/alfa-toolchain": [ "@changesets/assemble-release-plan", "@changesets/config", diff --git a/config/vitest.config.ts b/config/vitest.config.ts index 6170345f49..eeb95e6278 100644 --- a/config/vitest.config.ts +++ b/config/vitest.config.ts @@ -3,7 +3,6 @@ import { coverageConfigDefaults, defineConfig } from "vitest/config"; export default defineConfig({ test: { include: ["packages/alfa-*/test/**/*.spec.ts?(x)"], - exclude: ["packages/alfa-test-deprecated"], typecheck: { enabled: true, checker: "tsc", @@ -24,7 +23,7 @@ export default defineConfig({ reportsDirectory: "./docs/coverage", include: ["packages/alfa-*/**/*.{js,jsx,ts,tsx}"], exclude: [ - "packages/alfa-test*/**", + "packages/alfa-test/**", "**/config/**", "**/docs/**", "**/scripts/**", diff --git a/docs/dependency-graph.dot b/docs/dependency-graph.dot index b68cca5821..d32e694154 100644 --- a/docs/dependency-graph.dot +++ b/docs/dependency-graph.dot @@ -357,9 +357,6 @@ digraph "dependency-graph-Alfa" { "@siteimprove/alfa-string" [ label = "alfa-string"; ]; - "@siteimprove/alfa-test-deprecated" [ - label = "alfa-test-deprecated"; - ]; "@siteimprove/alfa-rectangle" [ label = "alfa-rectangle"; ]; @@ -387,9 +384,6 @@ digraph "dependency-graph-Alfa" { "@siteimprove/alfa-string" -> "exit_other" [ style = "invis"; ]; - "@siteimprove/alfa-test-deprecated" -> "exit_other" [ - style = "invis"; - ]; "@siteimprove/alfa-rectangle" -> "exit_other" [ style = "invis"; ]; @@ -1117,9 +1111,6 @@ digraph "dependency-graph-Alfa" { "exit_Accessibility Conformance Testing" -> "exit_Alfa" [ style = "invis"; ]; - "exit_other" -> "exit_Alfa" [ - style = "invis"; - ]; "exit_Understanding the web" -> "exit_Alfa" [ style = "invis"; ]; @@ -2504,6 +2495,12 @@ digraph "dependency-graph-Alfa" { lhead = "cluster_other"; ltail = "cluster_Understanding the web"; ]; + "exit_Understanding the web" -> "name_other" [ + style = "invis"; + color = "#ff4600"; + lhead = "cluster_other"; + ltail = "cluster_Understanding the web"; + ]; "exit_other" -> "name_Comparison" [ style = "solid"; color = "#1700ff"; diff --git a/docs/dependency-graph.svg b/docs/dependency-graph.svg index fde42494f0..8eb95c6810 100644 --- a/docs/dependency-graph.svg +++ b/docs/dependency-graph.svg @@ -100,23 +100,23 @@ @siteimprove/alfa-test - -alfa-test + +alfa-test @siteimprove/alfa-rng - -alfa-rng + +alfa-rng - + @siteimprove/alfa-test->@siteimprove/alfa-rng - - + + @@ -126,10 +126,10 @@ other - + exit_Comparison->name_other - - + + @@ -140,7 +140,7 @@ Logic - + exit_Comparison->name_Logic @@ -162,7 +162,7 @@ - + @siteimprove/alfa-callback->@siteimprove/alfa-mapper @@ -171,7 +171,7 @@ - + exit_Alternatives->name_other @@ -185,7 +185,7 @@ Type definitions - + exit_Alternatives->name_Type definitions @@ -220,7 +220,7 @@ Comparison - + exit_Alternatives->name_Comparison @@ -236,7 +236,7 @@ Hash tables - + exit_Alternatives->name_Hash tables @@ -251,7 +251,7 @@ Serialization - + exit_Alternatives->name_Serialization @@ -260,7 +260,7 @@ - + exit_Alternatives->name_Logic @@ -302,7 +302,7 @@ - + @siteimprove/alfa-foldable->@siteimprove/alfa-reducer @@ -322,7 +322,7 @@ - + @siteimprove/alfa-hash->@siteimprove/alfa-encoding @@ -346,7 +346,7 @@ - + @siteimprove/alfa-monad->@siteimprove/alfa-mapper @@ -359,7 +359,7 @@ - + @siteimprove/alfa-monad->@siteimprove/alfa-applicative @@ -372,7 +372,7 @@ - + @siteimprove/alfa-monad->@siteimprove/alfa-functor @@ -395,7 +395,7 @@ - + @siteimprove/alfa-refinement->@siteimprove/alfa-predicate @@ -409,14 +409,14 @@ - + @siteimprove/alfa-thunk->@siteimprove/alfa-mapper - + @siteimprove/alfa-thunk->@siteimprove/alfa-reducer @@ -431,15 +431,15 @@ - + exit_Logic->name_other - - + + - + exit_Logic->name_Type definitions @@ -449,7 +449,7 @@ - + exit_Logic->name_Comparison @@ -461,10 +461,10 @@ Collections - + exit_Logic->name_Collections - - + + @@ -492,42 +492,42 @@ Built ins - + @siteimprove/alfa-branched->name_Built ins - - + + @siteimprove/alfa-list - -alfa-list + +alfa-list - + @siteimprove/alfa-branched->@siteimprove/alfa-list - - + + @siteimprove/alfa-collection - -alfa-collection + +alfa-collection - + @siteimprove/alfa-branched->@siteimprove/alfa-collection - - + + - + exit_Accessibility Conformance Testing->name_other - - + + @@ -537,7 +537,7 @@ - + exit_Accessibility Conformance Testing->name_Type definitions @@ -548,7 +548,7 @@ - + exit_Accessibility Conformance Testing->name_Comparison @@ -556,14 +556,14 @@ - + exit_Accessibility Conformance Testing->name_Hash tables - + exit_Accessibility Conformance Testing->name_Serialization @@ -574,7 +574,7 @@ - + exit_Accessibility Conformance Testing->name_Logic @@ -587,7 +587,7 @@ - + exit_Accessibility Conformance Testing->name_Collections @@ -612,7 +612,7 @@ Alternatives - + exit_Accessibility Conformance Testing->name_Alternatives @@ -631,7 +631,7 @@ Computations - + exit_Accessibility Conformance Testing->name_Computations @@ -644,7 +644,7 @@ Performance measurements - + exit_Accessibility Conformance Testing->name_Performance measurements @@ -656,7 +656,7 @@ Understanding the web - + exit_Accessibility Conformance Testing->name_Understanding the web @@ -686,7 +686,7 @@ - + exit_other->name_Type definitions @@ -698,7 +698,7 @@ - + exit_other->name_Comparison @@ -706,21 +706,21 @@ - + exit_other->name_Hash tables - + exit_other->name_Serialization - + exit_other->name_Logic @@ -728,7 +728,7 @@ - + exit_other->name_Collections @@ -736,7 +736,7 @@ - + exit_other->name_Alternatives @@ -753,13 +753,12 @@ - - + exit_Understanding the web->name_other - - + + @@ -798,8 +797,9 @@ + - + exit_Understanding the web->name_Type definitions @@ -816,7 +816,7 @@ - + exit_Understanding the web->name_Comparison @@ -842,7 +842,7 @@ - + exit_Understanding the web->name_Hash tables @@ -855,7 +855,7 @@ - + exit_Understanding the web->name_Serialization @@ -881,7 +881,7 @@ - + exit_Understanding the web->name_Logic @@ -909,7 +909,7 @@ - + exit_Understanding the web->name_Collections @@ -963,7 +963,7 @@ - + exit_Understanding the web->name_Alternatives @@ -998,7 +998,7 @@ - + exit_Understanding the web->name_Computations @@ -1011,7 +1011,7 @@ Graphs - + exit_Understanding the web->name_Graphs @@ -1036,23 +1036,23 @@ @siteimprove/alfa-map - -alfa-map + +alfa-map - + @siteimprove/alfa-map->name_Built ins - - + + - + @siteimprove/alfa-map->@siteimprove/alfa-collection - - + + @@ -1062,28 +1062,28 @@ - + @siteimprove/alfa-map->@siteimprove/alfa-bits - - + + - + @siteimprove/alfa-applicative->@siteimprove/alfa-mapper - + @siteimprove/alfa-applicative->@siteimprove/alfa-functor - + exit_Collections->name_other @@ -1099,7 +1099,7 @@ - + exit_Collections->name_Type definitions @@ -1143,7 +1143,7 @@ - + exit_Collections->name_Comparison @@ -1166,7 +1166,7 @@ - + exit_Collections->name_Hash tables @@ -1184,7 +1184,7 @@ - + exit_Collections->name_Serialization @@ -1201,7 +1201,7 @@ - + exit_Collections->name_Logic @@ -1229,7 +1229,7 @@ - + exit_Collections->name_Alternatives @@ -1246,9 +1246,9 @@ - + exit_Collections->name_Computations - + @@ -1274,7 +1274,7 @@ - + @siteimprove/alfa-array->@siteimprove/alfa-iterable @@ -1282,7 +1282,7 @@ - + @siteimprove/alfa-functor->@siteimprove/alfa-mapper @@ -1303,7 +1303,7 @@ - + @siteimprove/alfa-earl->@siteimprove/alfa-json-ld @@ -1317,7 +1317,7 @@ - + @siteimprove/alfa-either->@siteimprove/alfa-option @@ -1336,7 +1336,7 @@ - + @siteimprove/alfa-future->@siteimprove/alfa-thenable @@ -1345,45 +1345,45 @@ - + @siteimprove/alfa-list->@siteimprove/alfa-map - - + + - + @siteimprove/alfa-list->name_Built ins - + - + @siteimprove/alfa-list->@siteimprove/alfa-collection - - + + @siteimprove/alfa-set - -alfa-set + +alfa-set - + @siteimprove/alfa-list->@siteimprove/alfa-set - - + + - + @siteimprove/alfa-list->@siteimprove/alfa-bits - - + + @@ -1401,7 +1401,7 @@ - + @siteimprove/alfa-performance->@siteimprove/alfa-emitter @@ -1414,17 +1414,17 @@ - + @siteimprove/alfa-record->name_Built ins - - + + - + @siteimprove/alfa-record->@siteimprove/alfa-list - - + + @@ -1435,7 +1435,7 @@ - + @siteimprove/alfa-result->@siteimprove/alfa-option @@ -1450,50 +1450,50 @@ @siteimprove/alfa-sequence - -alfa-sequence + +alfa-sequence - + @siteimprove/alfa-sequence->@siteimprove/alfa-map - - + + - + @siteimprove/alfa-sequence->name_Built ins - - + + - + @siteimprove/alfa-sequence->@siteimprove/alfa-collection - - + + - + @siteimprove/alfa-sequence->@siteimprove/alfa-set - - + + @siteimprove/alfa-string - -alfa-string + +alfa-string - + @siteimprove/alfa-string->@siteimprove/alfa-test - - + + @@ -1506,21 +1506,21 @@ @siteimprove/alfa-tuple - -alfa-tuple + +alfa-tuple - + @siteimprove/alfa-tuple->name_Built ins - - + + - + exit_Type definitions->name_other - - + + @@ -1549,20 +1549,20 @@ - + @siteimprove/alfa-fnv->@siteimprove/alfa-hash - + exit_Performance measurements->name_other - - + + - + exit_Performance measurements->name_Type definitions @@ -1573,7 +1573,7 @@ - + exit_Performance measurements->name_Serialization @@ -1588,14 +1588,14 @@ - + @siteimprove/alfa-continuation->@siteimprove/alfa-callback - + @siteimprove/alfa-continuation->@siteimprove/alfa-mapper @@ -1603,15 +1603,15 @@ - + @siteimprove/alfa-collection->name_Built ins - - + + - + exit_Computations->name_other @@ -1621,7 +1621,7 @@ - + exit_Computations->name_Type definitions @@ -1651,25 +1651,25 @@ - + exit_Computations->name_Comparison - + exit_Computations->name_Serialization - + exit_Computations->name_Logic - + exit_Computations->name_Collections @@ -1693,7 +1693,7 @@ - + exit_Serialization->name_Logic @@ -1701,7 +1701,7 @@ - + exit_Serialization->name_Alternatives @@ -1714,36 +1714,36 @@ @siteimprove/alfa-slice - -alfa-slice + +alfa-slice - + @siteimprove/alfa-slice->name_Built ins - - + + - + @siteimprove/alfa-slice->@siteimprove/alfa-collection - - + + @siteimprove/alfa-cache - -alfa-cache + +alfa-cache - + @siteimprove/alfa-cache->@siteimprove/alfa-test - - + + @@ -1764,48 +1764,48 @@ @siteimprove/alfa-math - -alfa-math + +alfa-math - + @siteimprove/alfa-math->@siteimprove/alfa-test - - + + - + exit_Graphs->name_other - + exit_Graphs->name_Comparison - + exit_Graphs->name_Hash tables - + exit_Graphs->name_Serialization - + exit_Graphs->name_Collections @@ -1821,25 +1821,25 @@ - + @siteimprove/alfa-set->@siteimprove/alfa-map - - + + - + @siteimprove/alfa-set->name_Built ins - - + + - + @siteimprove/alfa-set->@siteimprove/alfa-collection - - + + @@ -1848,7 +1848,7 @@ - + exit_Infrastructure->@siteimprove/alfa-device @@ -1860,7 +1860,7 @@ HTML - + exit_Infrastructure->name_HTML @@ -1888,31 +1888,31 @@ - + @siteimprove/alfa-http->@siteimprove/alfa-url - + exit_Hash tables->name_other - + exit_Hash tables->name_Comparison - + exit_Hash tables->name_Serialization - + exit_Hash tables->name_Logic @@ -1923,14 +1923,14 @@ - + exit_Tooling->name_other - - + + - + exit_Tooling->name_Collections @@ -1938,7 +1938,7 @@ - + exit_Tooling->name_Alternatives @@ -1948,28 +1948,28 @@ @siteimprove/alfa-flags - -alfa-flags + +alfa-flags - + @siteimprove/alfa-flags->@siteimprove/alfa-map - - + + - + @siteimprove/alfa-flags->name_Built ins - - + + @siteimprove/alfa-parser - -alfa-parser + +alfa-parser @@ -1981,7 +1981,7 @@ - + @siteimprove/alfa-selective->@siteimprove/alfa-either @@ -1995,7 +1995,7 @@ - + @siteimprove/alfa-lazy->@siteimprove/alfa-trampoline @@ -2012,7 +2012,7 @@ - + exit_HTML->@siteimprove/alfa-device @@ -2024,7 +2024,7 @@ CSS syntax - + exit_HTML->name_CSS syntax @@ -2039,7 +2039,7 @@ - + @siteimprove/alfa-css-feature->@siteimprove/alfa-css @@ -2048,15 +2048,15 @@ @siteimprove/alfa-rectangle - -alfa-rectangle + +alfa-rectangle - + @siteimprove/alfa-rectangle->@siteimprove/alfa-test - - + + @@ -2068,21 +2068,21 @@ - + @siteimprove/alfa-tree->@siteimprove/alfa-sequence - - + + - + @siteimprove/alfa-tree->@siteimprove/alfa-flags - - + + - + @siteimprove/alfa-json-ld->@siteimprove/alfa-json @@ -2111,7 +2111,7 @@ - + @siteimprove/alfa-style->@siteimprove/alfa-selector @@ -2125,7 +2125,7 @@ - + @siteimprove/alfa-style->@siteimprove/alfa-cascade @@ -2138,7 +2138,7 @@ - + @siteimprove/alfa-table->@siteimprove/alfa-dom @@ -2148,7 +2148,7 @@ - + exit_CSS syntax->@siteimprove/alfa-device @@ -2159,7 +2159,7 @@ - + exit_CSS->@siteimprove/alfa-device @@ -2167,7 +2167,7 @@ - + exit_CSS->name_HTML @@ -2176,7 +2176,7 @@ - + exit_CSS->name_CSS syntax @@ -2188,7 +2188,7 @@ - + @siteimprove/alfa-cascade->@siteimprove/alfa-selector @@ -2197,23 +2197,23 @@ @siteimprove/alfa-affine - -alfa-affine + +alfa-affine - + @siteimprove/alfa-affine->@siteimprove/alfa-test - - + + - + @siteimprove/alfa-affine->@siteimprove/alfa-math - - + + @@ -2224,20 +2224,20 @@ - + @siteimprove/alfa-aria->@siteimprove/alfa-device - + @siteimprove/alfa-aria->name_HTML - + @siteimprove/alfa-aria->name_CSS @@ -2251,7 +2251,7 @@ - + @siteimprove/alfa-eaa->@siteimprove/alfa-act @@ -2273,7 +2273,7 @@ - + @siteimprove/alfa-painting-order->@siteimprove/alfa-style @@ -2287,7 +2287,7 @@ - + @siteimprove/alfa-wcag->@siteimprove/alfa-act @@ -2303,7 +2303,7 @@ - + @siteimprove/alfa-web->@siteimprove/alfa-http @@ -2313,39 +2313,32 @@ @siteimprove/alfa-time - -alfa-time + +alfa-time - + @siteimprove/alfa-time->@siteimprove/alfa-test - - + + - - -@siteimprove/alfa-test-deprecated - -alfa-test-deprecated - - - + name_Accessibility Conformance Testing Accessibility Conformance Testing - + @siteimprove/alfa-rules alfa-rules - + @siteimprove/alfa-rules->@siteimprove/alfa-act @@ -2353,67 +2346,67 @@ - + @siteimprove/alfa-rules->@siteimprove/alfa-eaa - + @siteimprove/alfa-rules->@siteimprove/alfa-wcag - + @siteimprove/alfa-compatibility alfa-compatibility - + @siteimprove/alfa-xpath alfa-xpath - + @siteimprove/alfa-xpath->name_HTML - + name_Infrastructure Infrastructure - + @siteimprove/alfa-generator alfa-generator - + @siteimprove/alfa-generator->@siteimprove/alfa-mapper - + @siteimprove/alfa-generator->@siteimprove/alfa-reducer - + name_Synchronous Synchronous @@ -2421,7 +2414,7 @@ - + name_Asynchronous Asynchronous @@ -2430,14 +2423,14 @@ - + @siteimprove/alfa-promise alfa-promise - + @siteimprove/alfa-network alfa-network @@ -2445,19 +2438,19 @@ - + @siteimprove/alfa-network->@siteimprove/alfa-graph - + name_Tooling Tooling - + @siteimprove/alfa-toolchain alfa-toolchain diff --git a/packages/alfa-test-deprecated/CHANGELOG.md b/packages/alfa-test-deprecated/CHANGELOG.md deleted file mode 100644 index 2e5934c211..0000000000 --- a/packages/alfa-test-deprecated/CHANGELOG.md +++ /dev/null @@ -1,257 +0,0 @@ -# @siteimprove/alfa-test - -## 0.108.2 - -## 0.108.1 - -## 0.108.0 - -## 0.107.0 - -## 0.106.1 - -## 0.106.0 - -## 0.105.0 - -### Patch Changes - -- **Added:** Test coverage data is now included in all packages, as well as at global level. ([#1878](https://github.com/Siteimprove/alfa/pull/1878)) - -## 0.104.1 - -## 0.104.0 - -## 0.103.3 - -## 0.103.2 - -## 0.103.1 - -## 0.103.0 - -## 0.102.0 - -## 0.101.0 - -## 0.100.1 - -## 0.100.0 - -## 0.99.0 - -## 0.98.0 - -## 0.97.0 - -## 0.96.0 - -## 0.95.0 - -### Minor Changes - -- **Breaking:** The `alfa-test` package is now called `alfa-test-deprecated` and a new `alfa-test` package was added. ([#1692](https://github.com/Siteimprove/alfa/pull/1692)) - - Consumers can either migrate by replacing references to `alfa-test` with `alfa-test-deprecated` or they can attempt to use `alfa-test` which builds on [Vitest](https://vitest.dev). - -## 0.94.1 - -## 0.94.0 - -## 0.93.8 - -## 0.93.7 - -## 0.93.6 - -## 0.93.5 - -## 0.93.4 - -## 0.93.3 - -## 0.93.2 - -## 0.93.1 - -## 0.93.0 - -## 0.92.0 - -### Minor Changes - -- **Changed:** Alfa packages are now (also) published on the npmjs registry. ([`5b924adf304b6f809f4c8b9d5a2f4a8950d5b10b`](https://github.com/Siteimprove/alfa/commit/5b924adf304b6f809f4c8b9d5a2f4a8950d5b10b)) - -## 0.91.2 - -## 0.91.1 - -## 0.91.0 - -### Minor Changes - -- **Changed:** Dummy minor version to experiment with publish flow, use the previous or next minor version instead. ([`2a62d8a43e294ee56c18315c8fad29fbdc18c0df`](https://github.com/Siteimprove/alfa/commit/2a62d8a43e294ee56c18315c8fad29fbdc18c0df)) - -## 0.90.1 - -## 0.90.0 - -## 0.89.3 - -### Patch Changes - -- **Fixed:** Dummy release to test workflow ([`a3090826646a63d07a394a794aed54515fcac95f`](https://github.com/Siteimprove/alfa/commit/a3090826646a63d07a394a794aed54515fcac95f)) - -## 0.89.2 - -### Patch Changes - -- **Changed:** Trying to fix a problem in generating provenance statements ([#1674](https://github.com/Siteimprove/alfa/pull/1674)) - -## 0.89.1 - -### Patch Changes - -- **Added:** Trying to publish Alfa packages on the npm registry ([#1673](https://github.com/Siteimprove/alfa/pull/1673)) - -## 0.89.0 - -## 0.88.0 - -### Minor Changes - -- **Fixed:** The publish flow was updated to a new version. ([`a2f19cf9a6c7c72b8bf085597e4f1a95ac3e4eb2`](https://github.com/Siteimprove/alfa/commit/a2f19cf9a6c7c72b8bf085597e4f1a95ac3e4eb2)) - - Some 0.87.\* versions were generating uninstallable package. This should be fixed now. - -## 0.87.12 - -## 0.87.11 - -## 0.87.10 - -## 0.87.7 - -## 0.87.6 - -## 0.87.5 - -## 0.87.4 - -## 0.87.3 - -## 0.87.2 - -## 0.87.1 - -## 0.87.0 - -## 0.86.2 - -## 0.86.1 - -## 0.86.0 - -### Minor Changes - -- **Breaking:** TS resolution has been changed to `Node16`, target to `es2022`. ([#1636](https://github.com/Siteimprove/alfa/pull/1636)) - -- **Breaking:** Alfa is now distributed as ESM rather than CJS modules; projects using it must be ESM or use dynamic `import()`. ([#1636](https://github.com/Siteimprove/alfa/pull/1636)) - - ⚠️ This is the last of a series of changes on the internal structure and build process of distributed packages that was started with v0.85.0. - -## 0.85.1 - -## 0.85.0 - -### Minor Changes - -- **Breaking:** The .js files are now built in the `dist` folder rather than in `src`. ([#1628](https://github.com/Siteimprove/alfa/pull/1628)) - - ⚠️ This is the first of a series of changes on the internal structure and build process of distributed packages. It is probably better to not use this version and wait until more of these internal changes have been done to jump directly to the final result. We are internally releasing these changes for validation purpose only. - - This should not impact consumers, the `package.json` files should be set correctly to consume these files. - -## 0.84.0 - -## 0.83.1 - -## 0.83.0 - -## 0.82.0 - -### Minor Changes - -- **Breaking:** Node 18 is no longer supported. ([#1618](https://github.com/Siteimprove/alfa/pull/1618)) - -## 0.81.0 - -### Patch Changes - -- **Added:** Each package now contains its internal dependency graph in its `docs` directory. ([#1610](https://github.com/Siteimprove/alfa/pull/1610)) - -## 0.80.0 - -## 0.79.1 - -## 0.79.0 - -## 0.78.2 - -## 0.78.1 - -## 0.78.0 - -## 0.77.0 - -## 0.76.0 - -## 0.75.2 - -## 0.75.1 - -## 0.75.0 - -## 0.74.0 - -## 0.73.0 - -## 0.72.0 - -## 0.71.1 - -## 0.71.0 - -## 0.70.0 - -### Minor Changes - -- **Added:** Test can now accept a `Controller` to generate random tests. ([#1514](https://github.com/Siteimprove/alfa/pull/1514)) - - See the [README](./README.md) for more information. - -## 0.69.0 - -## 0.68.0 - -## 0.67.0 - -## 0.66.0 - -## 0.65.1 - -## 0.65.0 - -## 0.64.0 - -## 0.63.3 - -## 0.63.2 - -## 0.63.1 - -## 0.63.0 - -## 0.62.2 - -## 0.62.1 diff --git a/packages/alfa-test-deprecated/README.md b/packages/alfa-test-deprecated/README.md deleted file mode 100644 index ec0928f7ce..0000000000 --- a/packages/alfa-test-deprecated/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# Alfa test - -Thanks to the referential transparency ensured by [ADR 6](../../docs/architecture/decisions/adr-006.md), unit test of Alfa code is usually very easy, simply comparing the actual result with the expected one (often as their serialisation), without need for complex setup, mocks, or other test tricks. - -We're therefore implementing a very lightweight wrapper for tests. - -```typescript -import { test } from "@siteimprove/alfa-test"; - -test("My test", (t) => { - const actual = …; - - t.deepEqual(actual.toJSON(), { type: …, …}) -}); -``` - -## Property testing - -Sometimes, it is convenient to generate random tests with random values. The `alfa-test` library is offering test controller to handle that. - -- The `assertion` function that is passed to `test(name, assertion)` receives additional `rng` and `seed` parameters. The `rng` is a function `() => number`. The `seed` was used to initialize the Random Number Generator, can be used for better displaying errors and for re-playability. -- The `test` function itself accepts an optional `Controller` object which can be used to set the `seed` for the RNG, or to change the number of `iterations` to run the test (default to 1 since most tests are not random tests). The `Controller` object also accepts a `wrapper` function of type `(iteration: number, rng: RNG) => RNG` that can be used to turn the random numbers into useful data, or for introspection. - -The provided `rng` function is guaranteed to generate the same sequence of numbers on sequential calls, if the same seed is provided by the controller. If no seed is provided, a random one will be used. - -By default, each test is only run once. Use the `Controller` object to change the number of iterations. - -Tests that make use of the RNG are encouraged to print the seed in their error message in order to allow re-playability and investigation by feeding the failing seed back to the test. - -For re-playability, use the `Controller` parameter to select the seed to use (which guarantees the exact same sequence of numbers is produced), and to introspect on fine details by wrapping the RNG, e.g., - -```typescript -/** - * Return a random string between "0" and "100" (inclusive). - * Print the generated number, as well as the iteration number (use for debugging). - */ -function wrapper(rng: RNG, iteration: number): RNG { - return () => { - const res = rng(); - console.log(`On iteration ${iteration}, I generated ${res}`); - return `${res * 100}`; - }; -} - -test( - "Sum computes the sum of two numbers represented as strings", - (t, rng, seed) => { - // These use the post-wrapper RNG. - const a = rng(); - const b = rng(); - // Print the seed in error message to allow introspection. - const actual = sum(a, b, `Failed with seed ${seed}`); - - t.deepEqual(actual, `${a + b}`); - }, - { - wrapper, - iterations: 100, - // Set the seed for debugging, if you want to replay the same sequence of numbers. - seed: 1234, - }, -); -``` diff --git a/packages/alfa-test-deprecated/config/api-extractor.json b/packages/alfa-test-deprecated/config/api-extractor.json deleted file mode 100644 index 7c547d46a6..0000000000 --- a/packages/alfa-test-deprecated/config/api-extractor.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - "extends": "../../../config/api-extractor.json", - "mainEntryPointFilePath": "/dist/index.d.ts" -} diff --git a/packages/alfa-test-deprecated/docs/coverage/base.css b/packages/alfa-test-deprecated/docs/coverage/base.css deleted file mode 100644 index f418035b46..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/packages/alfa-test-deprecated/docs/coverage/block-navigation.js b/packages/alfa-test-deprecated/docs/coverage/block-navigation.js deleted file mode 100644 index 530d1ed2ba..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/block-navigation.js +++ /dev/null @@ -1,87 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selector that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - if ( - document.getElementById('fileSearch') === document.activeElement && - document.activeElement != null - ) { - // if we're currently focused on the search input, we don't want to navigate - return; - } - - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/packages/alfa-test-deprecated/docs/coverage/coverage-summary.json b/packages/alfa-test-deprecated/docs/coverage/coverage-summary.json deleted file mode 100644 index ef1ae37df9..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/coverage-summary.json +++ /dev/null @@ -1,2 +0,0 @@ -{"total": {"lines":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"},"statements":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"},"functions":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"},"branches":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":"Unknown"}} -} diff --git a/packages/alfa-test-deprecated/docs/coverage/favicon.png b/packages/alfa-test-deprecated/docs/coverage/favicon.png deleted file mode 100644 index c1525b811a..0000000000 Binary files a/packages/alfa-test-deprecated/docs/coverage/favicon.png and /dev/null differ diff --git a/packages/alfa-test-deprecated/docs/coverage/index.html b/packages/alfa-test-deprecated/docs/coverage/index.html deleted file mode 100644 index 1659fe3370..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - Code coverage report for All files - - - - - - - - - -
-
-

All files

-
- -
- Unknown% - Statements - 0/0 -
- - -
- Unknown% - Branches - 0/0 -
- - -
- Unknown% - Functions - 0/0 -
- - -
- Unknown% - Lines - 0/0 -
- - -
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

- -
-
-
- - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
-
-
-
- - - - - - - - \ No newline at end of file diff --git a/packages/alfa-test-deprecated/docs/coverage/prettify.css b/packages/alfa-test-deprecated/docs/coverage/prettify.css deleted file mode 100644 index b317a7cda3..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/packages/alfa-test-deprecated/docs/coverage/prettify.js b/packages/alfa-test-deprecated/docs/coverage/prettify.js deleted file mode 100644 index b3225238f2..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/packages/alfa-test-deprecated/docs/coverage/sort-arrow-sprite.png b/packages/alfa-test-deprecated/docs/coverage/sort-arrow-sprite.png deleted file mode 100644 index 6ed68316eb..0000000000 Binary files a/packages/alfa-test-deprecated/docs/coverage/sort-arrow-sprite.png and /dev/null differ diff --git a/packages/alfa-test-deprecated/docs/coverage/sorter.js b/packages/alfa-test-deprecated/docs/coverage/sorter.js deleted file mode 100644 index 4ed70ae5ac..0000000000 --- a/packages/alfa-test-deprecated/docs/coverage/sorter.js +++ /dev/null @@ -1,210 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - function onFilterInput() { - const searchValue = document.getElementById('fileSearch').value; - const rows = document.getElementsByTagName('tbody')[0].children; - - // Try to create a RegExp from the searchValue. If it fails (invalid regex), - // it will be treated as a plain text search - let searchRegex; - try { - searchRegex = new RegExp(searchValue, 'i'); // 'i' for case-insensitive - } catch (error) { - searchRegex = null; - } - - for (let i = 0; i < rows.length; i++) { - const row = rows[i]; - let isMatch = false; - - if (searchRegex) { - // If a valid regex was created, use it for matching - isMatch = searchRegex.test(row.textContent); - } else { - // Otherwise, fall back to the original plain text search - isMatch = row.textContent - .toLowerCase() - .includes(searchValue.toLowerCase()); - } - - row.style.display = isMatch ? '' : 'none'; - } - } - - // loads the search box - function addSearchBox() { - var template = document.getElementById('filterTemplate'); - var templateClone = template.content.cloneNode(true); - templateClone.getElementById('fileSearch').oninput = onFilterInput; - template.parentElement.appendChild(templateClone); - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSearchBox(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/packages/alfa-test-deprecated/docs/dependency-graph.dot b/packages/alfa-test-deprecated/docs/dependency-graph.dot deleted file mode 100644 index e80df0b500..0000000000 --- a/packages/alfa-test-deprecated/docs/dependency-graph.dot +++ /dev/null @@ -1,147 +0,0 @@ -digraph "dependency-graph-@siteimprove/alfa-test-deprecated" { - compound = true; - "src/format.ts"; - "src/rng.ts"; - "src/types.ts"; - "src/stack.ts"; - "src/test.ts"; - subgraph "cluster_src" { - color = "#000000"; - label = ""; - "exit_src" [ - style = "invis"; - ]; - subgraph "cluster_src" { - color = "#000000"; - label = ""; - "name_src" [ - penwidth = 5; - shape = "rectangle"; - color = "#ff0000"; - label = "src"; - ]; - "exit_src" [ - style = "invis"; - ]; - "src/test.ts" [ - label = "test.ts"; - ]; - "src/rng.ts" [ - label = "rng.ts"; - ]; - "src/index.ts" [ - label = "index.ts"; - color = "#ff0000"; - penwidth = 5; - ]; - "src/format.ts" [ - label = "format.ts"; - ]; - "src/stack.ts" [ - label = "stack.ts"; - ]; - "src/types.ts" [ - label = "types.ts"; - ]; - "src/test.ts" -> "exit_src" [ - style = "invis"; - ]; - "src/rng.ts" -> "exit_src" [ - style = "invis"; - ]; - "src/index.ts" -> "exit_src" [ - style = "invis"; - ]; - "src/format.ts" -> "exit_src" [ - style = "invis"; - ]; - "src/stack.ts" -> "exit_src" [ - style = "invis"; - ]; - "src/types.ts" -> "exit_src" [ - style = "invis"; - ]; - } - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - "exit_src" -> "exit_src" [ - style = "invis"; - ]; - } - "src/test.ts" -> "src/format.ts" [ - style = "invis"; - ]; - "src/test.ts" -> "src/format.ts" [ - style = "solid"; - color = "black"; - ]; - "src/test.ts" -> "src/rng.ts" [ - style = "invis"; - ]; - "src/test.ts" -> "src/rng.ts" [ - style = "solid"; - color = "black"; - ]; - "src/test.ts" -> "src/types.ts" [ - style = "invis"; - ]; - "src/test.ts" -> "src/types.ts" [ - style = "dotted"; - color = "black"; - ]; - "src/index.ts" -> "src/format.ts" [ - style = "invis"; - ]; - "src/index.ts" -> "src/format.ts" [ - style = "solid"; - color = "black"; - ]; - "src/index.ts" -> "src/rng.ts" [ - style = "invis"; - ]; - "src/index.ts" -> "src/rng.ts" [ - style = "solid"; - color = "black"; - ]; - "src/index.ts" -> "src/stack.ts" [ - style = "invis"; - ]; - "src/index.ts" -> "src/stack.ts" [ - style = "solid"; - color = "black"; - ]; - "src/index.ts" -> "src/test.ts" [ - style = "invis"; - ]; - "src/index.ts" -> "src/test.ts" [ - style = "solid"; - color = "black"; - ]; - "src/index.ts" -> "src/types.ts" [ - style = "invis"; - ]; - "src/index.ts" -> "src/types.ts" [ - style = "solid"; - color = "black"; - ]; - "src/format.ts" -> "src/stack.ts" [ - style = "invis"; - ]; - "src/format.ts" -> "src/stack.ts" [ - style = "solid"; - color = "black"; - ]; -} \ No newline at end of file diff --git a/packages/alfa-test-deprecated/docs/dependency-graph.svg b/packages/alfa-test-deprecated/docs/dependency-graph.svg deleted file mode 100644 index e261052202..0000000000 --- a/packages/alfa-test-deprecated/docs/dependency-graph.svg +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - -dependency-graph-@siteimprove/alfa-test-deprecated - - -cluster_src - - - -cluster_src - - - - -src/format.ts - -format.ts - - - -src/stack.ts - -stack.ts - - - - -src/format.ts->src/stack.ts - - - - - - - -src/rng.ts - -rng.ts - - - - -src/types.ts - -types.ts - - - - - -src/test.ts - -test.ts - - - - -src/test.ts->src/format.ts - - - - - - -src/test.ts->src/rng.ts - - - - - - -src/test.ts->src/types.ts - - - - - - - - - - - - -name_src - -src - - - -src/index.ts - -index.ts - - - - -src/index.ts->src/format.ts - - - - - - -src/index.ts->src/rng.ts - - - - - - -src/index.ts->src/types.ts - - - - - - -src/index.ts->src/stack.ts - - - - - - -src/index.ts->src/test.ts - - - - - - diff --git a/packages/alfa-test-deprecated/package.json b/packages/alfa-test-deprecated/package.json deleted file mode 100644 index d6fd072584..0000000000 --- a/packages/alfa-test-deprecated/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/package", - "name": "@siteimprove/alfa-test-deprecated", - "homepage": "https://alfa.siteimprove.com", - "version": "0.108.2", - "license": "MIT", - "description": "A simple test library sitting on top of the built-in Node.js assert module", - "repository": { - "type": "git", - "url": "github:Siteimprove/alfa", - "directory": "packages/alfa-test-deprecated" - }, - "bugs": "https://github.com/siteimprove/alfa/issues", - "engines": { - "node": ">=20.0.0" - }, - "type": "module", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "dist/**/*.js", - "dist/**/*.d.ts" - ], - "dependencies": { - "@types/node": "^25.0.2", - "chalk": "^5.6.2" - }, - "publishConfig": { - "access": "public", - "registry": "https://npm.pkg.github.com/" - } -} diff --git a/packages/alfa-test-deprecated/src/format.ts b/packages/alfa-test-deprecated/src/format.ts deleted file mode 100644 index 88f7a593f5..0000000000 --- a/packages/alfa-test-deprecated/src/format.ts +++ /dev/null @@ -1,56 +0,0 @@ -/// - -import * as assert from "assert"; -import chalk from "chalk"; -import * as path from "path"; - -import { stack } from "./stack.js"; - -/** - * @internal - */ -export function format(name: string, error: Error): string { - const [callsite] = stack(error); - - const [file, line, column] = - callsite.type === "native" - ? ["native", -1, -1] - : [ - path.relative(process.cwd(), callsite.file), - callsite.line, - callsite.column, - ]; - - let message: string; - - if (error instanceof assert.AssertionError) { - message = error.generatedMessage ? "" : `\n${error.message}\n`; - - error = new assert.AssertionError({ - actual: error.actual, - expected: error.expected, - operator: error.operator, - }); - - error.message = - message + - "\n" + - error.message.replace( - "Input A expected to strictly deep-equal input B:\n", - "", - ); - - message += error.message; - } else { - message = error.stack ?? error.message; - } - - const output = ` -${chalk.underline(`${file}(${line},${column}):`)} ${chalk.bold( - name.trim().replace(/\s+/g, " "), - )} -${message} - `; - - return `${output.trim()}\n`; -} diff --git a/packages/alfa-test-deprecated/src/index.ts b/packages/alfa-test-deprecated/src/index.ts deleted file mode 100644 index d4db0da991..0000000000 --- a/packages/alfa-test-deprecated/src/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./format.js"; -export * from "./rng.js"; -export * from "./stack.js"; -export * from "./test.js"; -export * from "./types.js"; diff --git a/packages/alfa-test-deprecated/src/rng.ts b/packages/alfa-test-deprecated/src/rng.ts deleted file mode 100644 index 1b13fe43f5..0000000000 --- a/packages/alfa-test-deprecated/src/rng.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @public - */ -export type RNG = () => T; - -/** - * PRNG taken from - * {@link https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript} - * - * @internal - */ -export function seedableRNG(seed: number): RNG { - return function () { - let t = (seed += 0x6d2b79f5); - t = Math.imul(t ^ (t >>> 15), t | 1); - t ^= t + Math.imul(t ^ (t >>> 7), t | 61); - return ((t ^ (t >>> 14)) >>> 0) / 4294967296; - }; -} - -/** - * @public - */ -export interface Controller { - iterations: number; - wrapper: (rng: RNG, iteration: number) => RNG; - seed?: number; -} - -/** - * @internal - */ -export const defaultController: Controller = { - iterations: 1, - wrapper: (rng, iteration: number) => rng, -}; diff --git a/packages/alfa-test-deprecated/src/stack.ts b/packages/alfa-test-deprecated/src/stack.ts deleted file mode 100644 index 31de6274c0..0000000000 --- a/packages/alfa-test-deprecated/src/stack.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @internal - */ -export function* stack(error: Error): Iterable { - const frames = error - .stack!.split("\n") - .slice(1) - .map((frame) => frame.trim()); - - for (let i = 0, n = frames.length; i < n; i++) { - const frame = frames[i]; - - // If the frame doesn't contain a location reference, skip the frame. - if (!/(\d+:\d+)/.test(frame)) { - continue; - } - - // If the next frame contains a source mapping for the current frame as - // indicated by an arrow, skip the frame. - if (i + 1 < n && frames[i + 1].startsWith("->")) { - continue; - } - - // Sanitize the frame and split it on colons. This will group the frame into - // 3 separate parts: The file, the line, and the column. - const parts = frame - .replace("(", "") - .replace(")", "") - .replace("->", "") - .split(":") - .map((part) => part.trim()); - - // The part containing the file may contain other things as well that we - // need to remove so we grab everything from the last space character and - // cut off the rest. - parts[0] = parts[0].substring(parts[0].lastIndexOf(" ") + 1); - - const [file, line, column] = parts; - - yield { - type: file.startsWith("internal") ? "internal" : "user", - file, - line: +line, - column: +column, - }; - } -} - -type Frame = Frame.Native | Frame.Internal | Frame.User; - -namespace Frame { - export interface Native { - type: "native"; - } - - export interface Internal { - type: "internal"; - file: string; - line: number; - column: number; - } - - export interface User { - type: "user"; - file: string; - line: number; - column: number; - } -} diff --git a/packages/alfa-test-deprecated/src/test.ts b/packages/alfa-test-deprecated/src/test.ts deleted file mode 100644 index ce35da3661..0000000000 --- a/packages/alfa-test-deprecated/src/test.ts +++ /dev/null @@ -1,103 +0,0 @@ -/// - -import * as assert from "assert"; - -import { format } from "./format.js"; -import { - type Controller, - defaultController, - type RNG, - seedableRNG, -} from "./rng.js"; -import type { Assertions } from "./types.js"; - -/** - * @internal - */ -export interface Notifier { - error(message: string): void; -} - -const defaultNotifier: Notifier = { - error: (message) => { - process.stderr.write(`${message}\n`); - process.exit(1); - }, -}; - -// This is not super robust, but sufficient in our use case. -// Take care before using it elsewhere. -function isNotifier(value: unknown): value is Notifier { - return typeof value === "object" && value !== null && "error" in value; -} - -/** - * @public - */ -export async function test( - name: string, - assertion: ( - assert: Assertions, - rng: RNG, - seed: number, - ) => void | Promise, - controller?: Partial>, -): Promise; - -/** - * @internal - */ -export async function test( - name: string, - assertion: ( - assert: Assertions, - rng: RNG, - seed: number, - ) => void | Promise, - notifier: Notifier, - controller?: Partial>, -): Promise; - -export async function test( - name: string, - assertion: ( - assert: Assertions, - rng: RNG, - seed: number, - ) => void | Promise, - notifierOrController?: Notifier | Partial>, - controller?: Partial>, -): Promise { - const notifier: Notifier = isNotifier(notifierOrController) - ? notifierOrController - : defaultNotifier; - // If the controlled is not overwritten, then T should be number. - const fullController = { - ...defaultController, - ...controller, - ...notifierOrController, - } as Controller; - // "error" may have been copied over from the notifier. - if ("error" in fullController) { - delete fullController.error; - } - - const seed = fullController.seed ?? Math.random(); - const rng = seedableRNG(seed); - - try { - for (let i = 0; i < fullController.iterations; i++) { - await assertion( - "strict" in assert ? assert.strict : assert, - // eta-expansion ensures that the wrapper is evaluated on each call of - // the rng, not just once per iteration. - () => fullController.wrapper(rng, i)(), - seed, - ); - } - } catch (err) { - const error = err as Error; - - notifier.error(`${format(name, error)}\n`); - } -} diff --git a/packages/alfa-test-deprecated/src/tsconfig.json b/packages/alfa-test-deprecated/src/tsconfig.json deleted file mode 100644 index 99a20740d6..0000000000 --- a/packages/alfa-test-deprecated/src/tsconfig.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "../tsconfig.json", - "compilerOptions": { "outDir": "../dist" }, - "files": [ - "./format.ts", - "./index.ts", - "./rng.ts", - "./stack.ts", - "./test.ts", - "./types.ts" - ] -} diff --git a/packages/alfa-test-deprecated/src/types.ts b/packages/alfa-test-deprecated/src/types.ts deleted file mode 100644 index d16b779e98..0000000000 --- a/packages/alfa-test-deprecated/src/types.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @public - */ -export interface Assertions { - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_value_message} - */ - (value: T, message?: string): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message} - */ - equal(actual: T, expected: T, message?: string): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message} - */ - notEqual(actual: T, expected: T, message?: string): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message} - */ - deepEqual(actual: T, expected: T, message?: string): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_notdeepequal_actual_expected_message} - */ - notDeepEqual(actual: T, expected: T, message?: string): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_fail_message} - */ - fail(message?: string): never; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_rejects_block_error_message} - */ - rejects( - block: Function | Promise, - error?: RegExp | Function | Object | Error, - message?: string, - ): void; - - /** - * {@link https://nodejs.org/api/assert.html#assert_assert_throws_block_error_message} - */ - throws( - block: Function, - error?: RegExp | Function | Object | Error, - message?: string, - ): void; -} diff --git a/packages/alfa-test-deprecated/test/test.spec.ts b/packages/alfa-test-deprecated/test/test.spec.ts deleted file mode 100644 index b6aabc3f9d..0000000000 --- a/packages/alfa-test-deprecated/test/test.spec.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { test } from "../dist/test.js"; - -test("Can test a failing block", async (t) => { - let failed = false; - - await test( - "Failing test", - (t) => { - t.equal(true, false); - }, - { - error: (message) => { - failed = true; - }, - }, - ); - - t(failed); -}); - -test("Can test a passing block", async (t) => { - let passed = true; - - await test( - "Passing test", - (t) => { - t.equal(true, true); - }, - { - error: (message) => { - passed = false; - }, - }, - ); - - t(passed); -}); - -test("Can test a block throwing errors", async (t) => { - let failed = false; - - await test( - "Erroring test", - (t) => { - throw Error("You shall not pass"); - }, - { - error: (message) => { - failed = true; - }, - }, - ); - - t(failed); -}); diff --git a/packages/alfa-test-deprecated/test/tsconfig.json b/packages/alfa-test-deprecated/test/tsconfig.json deleted file mode 100644 index 4ecf7bf4dd..0000000000 --- a/packages/alfa-test-deprecated/test/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": ".", - "lib": ["DOM", "ESNext"] - }, - "files": ["./test.spec.ts"], - "references": [{ "path": "../src" }] -} diff --git a/packages/alfa-test-deprecated/tsconfig.json b/packages/alfa-test-deprecated/tsconfig.json deleted file mode 100644 index 398e0fba97..0000000000 --- a/packages/alfa-test-deprecated/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/tsconfig", - "extends": "../tsconfig.json", - "files": [], - "references": [{ "path": "./src" }, { "path": "./test" }] -} diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 4b510d4dab..995a958e77 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -71,7 +71,6 @@ { "path": "alfa-style" }, { "path": "alfa-table" }, { "path": "alfa-test" }, - { "path": "alfa-test-deprecated" }, { "path": "alfa-thenable" }, { "path": "alfa-thunk" }, { "path": "alfa-time" }, diff --git a/yarn.lock b/yarn.lock index 58d9c281a4..c1227a659c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2455,15 +2455,6 @@ __metadata: languageName: unknown linkType: soft -"@siteimprove/alfa-test-deprecated@workspace:packages/alfa-test-deprecated": - version: 0.0.0-use.local - resolution: "@siteimprove/alfa-test-deprecated@workspace:packages/alfa-test-deprecated" - dependencies: - "@types/node": "npm:^25.0.2" - chalk: "npm:^5.6.2" - languageName: unknown - linkType: soft - "@siteimprove/alfa-test@workspace:^, @siteimprove/alfa-test@workspace:packages/alfa-test": version: 0.0.0-use.local resolution: "@siteimprove/alfa-test@workspace:packages/alfa-test"