Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into SEO-Main
  • Loading branch information
majid-paktinat committed Sep 4, 2024
2 parents f745fb1 + 6b0ff4c commit 4180c59
Show file tree
Hide file tree
Showing 52 changed files with 12,072 additions and 6,717 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
api-cache
tmp
.vscode
report/*
.idea

# auto-gen PHP files/logs
Expand Down
15 changes: 6 additions & 9 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@

. "$(dirname "$0")/_/husky.sh"

# This is the code that automatically runs the Prettier formatter on all staged parts of files that are to be committed. It is run after a commit has been triggered, but before the commit is actually made. This ensures that all code that is committed is formatted correctly.
# Check if NODE_ENV is set to production
if [ "$NODE_ENV" = "production" ] || [ "$CI" = "true" ]; then
echo "Skipping pre-commit hook in production environment"
exit 0
fi

# Source: https://prettier.io/docs/en/precommit.html#option-4-git-format-stagedhttpsgithubcomhallettjgit-format-staged

npx git-format-staged -f 'prettier --ignore-unknown --stdin-filepath "{}"' '*.js' '*.jsx' '*.less' '*.md' '*.json' '*.html' '*.php' '*.sh'

# If you have issues when running the npx command in an IDE, you should try running the command in the terminal instead. This issue is due to the PATH values not being set as expected in the IDE in order for npx to be recognized. See https://stackoverflow.com/questions/67115897/vscode-github-desktop-pre-commit-hook-npx-command-not-found for more information.

# Run eslint
npm run eslint && npm run stylelint
npx lint-staged
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ A place to learn and share with developers what makes web work accessible. This
- Axe CLI: Uses a browser webdriver to open pages and run accessibility tests on it.
- pa11y CLI: Uses Puppeteer to run its own headless Chrome browser to run accessibility tests.
- Jest + Puppeteer: Used to run and validate code in unit tests.
- Lighthouse CLI: Uses a browser webdriver to open and run accessibility audits on each page and then provides reports and a summary.

Read [the Enable Code Quality article](https://www.useragentman.com/enable/code-quality.php) for the full details behind the testing tools being used and how.

Expand All @@ -112,6 +113,8 @@ Read [the Enable Code Quality article](https://www.useragentman.com/enable/code-
- Run only the v.Nu tests: `npm run test-vnu`
- Run only the Axe tests: `npm run test-axe`
- Run only the Pa11y tests: `npm run test-pa11y`
- Run only the Lighthouse tests on all URL's: `npm run test-lighthouse`
- Run only the Lighthouse tests on a single URL: `npm run test-lighthouse-url {Valid URL}`
If you are noticing that the jest tests are taking a long time, you might want to run `npm run jest-debug-memory-leak`. If the heap size for each test group increases a lot, there is a memory leak in the tests. More information about that can be found at in the article [Your Jest Tests are Leaking Memory](https://chanind.github.io/javascript/2019/10/12/jest-tests-memory-leak.html) by [David Chanin](https://chanind.github.io/about/)
Expand Down
Binary file added audio/audio-full.mp3
Binary file not shown.
Binary file added audio/audio.mp3
Binary file not shown.
152 changes: 152 additions & 0 deletions audio/audio.vtt
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
WEBVTT
00:00:00.000 --> 00:00:14.640
[Dramatic 1930s Orchestral Music]

00:00:14.640 --> 00:00:21.840
<v The Shadow> Who knows what evil lurks in the hearts of men?

00:00:21.840 --> 00:00:24.400
The Shadow knows!

00:00:24.400 --> 00:00:27.200
[Maniacal Laughter]

00:00:27.200 --> 00:00:40.240
[Dramatic 1930s Orchestral Music]

00:00:40.240 --> 00:00:45.040
<v Announcer> The Shadow, mysterious character who aids the forces of law and order,

00:00:45.040 --> 00:00:49.200
is in reality Lamont Cranston, wealthy young man of outstanding talent.

00:00:49.200 --> 00:00:54.400
As the shadow, Cranston is gifted with hypnotic power to cloud men's minds

00:00:54.400 --> 00:00:58.720
so that they cannot see him. Cranston's friend and companion,

00:00:58.720 --> 00:01:02.800
the lovely Margo Lane, is the only person who knows to whom the voice of the

00:01:02.800 --> 00:01:09.120
invisible Shadow belongs. Today's story: The Voice of Death.

00:01:09.120 --> 00:01:16.880
[Eerie Music]

00:01:16.880 --> 00:01:17.740
<v Annie> Sam.

00:01:17.800 --> 00:01:19.633
<v Sam> Yes, Annie?

00:01:19.634 --> 00:01:22.080
<v Annie> You almost finished reading your paper?

00:01:22.080 --> 00:01:23.149
<v Sam> Yes, Annie.

00:01:23.173 --> 00:01:25.088
<v Annie> Time to go to bed, ain't it?

00:01:25.112 --> 00:01:26.640
<v Sam> Yes, Annie.

00:01:26.640 --> 00:01:31.681
<v Annie> Better make sure all the
windows are shut. Sounds like a real mean storm
coming up.

00:01:31.705 --> 00:01:32.952
<v Sam> Yes, Annie.

00:01:32.985 --> 00:01:35.324
[Sound of a strong wind with meowing in background]

00:01:35.372 --> 00:01:36.567
<v Annie> Sam.

00:01:36.591 --> 00:01:37.733
<v Sam> Yes, Annie.

00:01:37.757 --> 00:01:39.096
<v Annie> Did you hear
that?

00:01:39.120 --> 00:01:40.503
<v Sam> What?

00:01:40.527 --> 00:01:41.840
<v Annie> You hear it?

00:01:41.840 --> 00:01:44.088
Sounded just
like little kittens.

00:01:44.112 --> 00:01:47.200
<v Sam> Yeah. Well, I
wonder where they come from.

00:01:47.200 --> 00:01:50.640
<v Annie> Well, they're poor things, outdoors on a night like this.

00:01:50.640 --> 00:01:53.036
Sam, will you go out and
find them? Go on, will you?

00:01:53.060 --> 00:01:54.880
<v Sam> Now, Annie, you don't...

00:01:54.880 --> 00:01:59.120
<v Annie> Just listen to them little critters. Ain't you got no heart, Sam?

00:01:59.120 --> 00:02:02.188
<v Sam> Oh, all right.
Where's my raincoat now?

00:02:02.212 --> 00:02:03.680
<v Annie> Oh, here you are.

00:02:03.680 --> 00:02:07.360
I'll set up a little box for them by the fire.

00:02:07.360 --> 00:02:10.640
<v Sam> All right, all right. Now stop your crying, kittens. I'm coming.

00:02:10.640 --> 00:02:13.093
<v Annie> Just wait. I'll heat up a bit of milk, too.

00:02:13.213 --> 00:02:16.006
<v Sam> Here kitty, kitty, kitty, kitty!!!

00:02:16.080 --> 00:02:17.761
<v Annie> Do you see them, Sam?

00:02:17.785 --> 00:02:22.088
<v Sam> No, not yet ... Here, kitty, kitty, kitty! Annie, how do you ... ?

00:02:22.112 --> 00:02:25.840
[Sounds of dogs madly growling and tearing something apart]

00:02:25.840 --> 00:02:29.760
<v Annie> Sam, what's wrong? What in the name of all this fooling?

00:02:29.760 --> 00:02:33.401
Sam! Sam, what is it? Sam, what happened?

00:02:33.425 --> 00:02:34.880
[Sounds of dogs madly growling]

00:02:34.880 --> 00:02:38.800
<v Annie> Sam, blood. You're all covered with blood.

00:02:38.800 --> 00:02:43.129
[Another man murmurs something inaudible quietly]

00:02:43.162 --> 00:02:49.760
<v Annie> Sam, how could kittens do... Sam! He's dead.

00:02:49.785 --> 00:02:53.710
[Dramatic music]
Binary file added audio/example.mp3
Binary file not shown.
20 changes: 20 additions & 0 deletions bin/checkHTML.sh
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,22 @@ function runPa11yTests() {
fi
}



function runLighthouseTests() {
#. Download the HTML files if they have not already been downloaded
if ! [ -f tmp/downloaded-urls.txt ]
then
bin/generateSiteMap.sh
downloadHTML
else
: "${DOWNLOADED_URLS:=`cat tmp/downloaded-urls.txt`}"
fi

node bin/lighthouse-accessibility-scan.js
}


#.. let's wipe the tmp directory if it exists
if [ -z "$(ls -A tmp)" ]
then
Expand All @@ -475,6 +491,9 @@ then
elif [ "$1" = "pa11y" ]
then
runPa11yTests
elif [ "$1" = "lighthouse" ]
then
runLighthouseTests
else
#.. Run checks and preparation for tests
bin/generateSiteMap.sh
Expand All @@ -484,6 +503,7 @@ else
runVNUTests
runAXETests
runPa11yTests
runLighthouseTests

#.. Remove temporary files on success
rm tmp/* 2> /dev/null
Expand Down
Loading

0 comments on commit 4180c59

Please sign in to comment.