Skip to content

Commit

Permalink
Merge branch 'main' of ssh://ssh.github.com:443/PublicisSapient/enabl…
Browse files Browse the repository at this point in the history
…e-a11y into datetimepicker
  • Loading branch information
zoltan-dulac committed Jan 28, 2025
2 parents aaa8de8 + 11b8024 commit 4f73b4f
Show file tree
Hide file tree
Showing 327 changed files with 13,274 additions and 5,807 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/push-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11.0"
node-version: "20.15.0"
cache: "npm"
- name: Install X11 dependencies for robotjs (needed for unit testing on input-mask tests)
run: sudo apt-get install libxtst-dev libpng++-dev xvfb
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.11.0"
node-version: "20.15.0"
cache: "npm"
- name: Set up JDK 11 for x64
uses: actions/setup-java@v4
Expand All @@ -45,12 +45,14 @@ jobs:
architecture: x64
- name: Install Lynx dependency
run: sudo apt install lynx
- name: Install PHP8.1
run: sudo apt install php8.1
- name: Install latest Chrome er.124 to match chromedriver package version
- name: Install PHP
run: sudo apt install php
- name: Install latest Chrome to match chromedriver package version
# Note: you should see if the version of Chrome matches the latest listed on
# https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/
run: |
apt search '^google-chrome.*' \
&& wget -q -O /tmp/chrome.deb http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_126.0.6478.126-1_amd64.deb \
&& wget -q -O /tmp/chrome.deb https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_132.0.6834.110-1_amd64.deb \
&& sudo apt install -y /tmp/chrome.deb --allow-downgrades \
&& rm /tmp/chrome.deb
- name: Log system details
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ tmp
report/*
.idea

# generated css map files
*.css.map

# auto-gen PHP files/logs
php_errors.log

2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
chromedriver_force_download=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.4.0
v20.15.0
55 changes: 55 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports = {
"customSyntax": "postcss-less",
"extends": [ "stylelint-config-standard"],
"ignoreFiles": [
"**/*.js",
"enable-node-libs/**/*.css",
"js/out/**/*.css",
"js/enable-libs/**/*.css"
],
"plugins": ["@double-great/stylelint-a11y"],
"rules": {
"a11y/no-text-align-justify": true,
"alpha-value-notation": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"color-function-notation": null,
"color-hex-length": null,
"comment-empty-line-before": null,
"comment-whitespace-inside": null,
"custom-property-empty-line-before": null,
"custom-property-pattern": null,
"declaration-empty-line-before": null,
"declaration-block-no-duplicate-properties": null,
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"declaration-block-single-line-max-declarations": null,
"font-family-name-quotes": null,
"font-family-no-missing-generic-family-keyword": null,
"function-calc-no-unspaced-operator": null,
"function-name-case": null,
"function-no-unknown": null,
"function-url-quotes": null,
"hue-degree-notation": null,
"import-notation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": null,
"media-feature-range-notation": null,
"media-query-no-invalid": null,
"no-empty-source": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"number-max-precision": null,
"property-no-unknown": null,
"property-no-vendor-prefix": null,
"rule-empty-line-before": null,
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-no-vendor-prefix": null,
"selector-pseudo-element-colon-notation": null,
"shorthand-property-no-redundant-values": null,
"string-no-newline": null,
"value-keyword-case": null,
"value-no-vendor-prefix": null
}
}
14 changes: 13 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"customSyntax": "postcss-less",
"extends": "stylelint-config-standard",
"ignoreFiles": ["**/*.js"],
"ignoreFiles": [
"**/*.js",
"enable-node-libs/**/*.css",
"js/out/**/*.css",
"js/enable-libs/**/*.css"
],
"plugins": ["@double-great/stylelint-a11y"],
"rules": {
"a11y/no-text-align-justify": true,
"alpha-value-notation": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
Expand All @@ -16,18 +23,23 @@
"declaration-block-no-duplicate-properties": null,
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"declaration-block-single-line-max-declarations": null,
"font-family-name-quotes": null,
"font-family-no-missing-generic-family-keyword": null,
"function-calc-no-unspaced-operator": null,
"function-name-case": null,
"function-no-unknown": null,
"function-url-quotes": null,
"hue-degree-notation": null,
"import-notation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": null,
"media-feature-range-notation": null,
"media-query-no-invalid": null,
"no-empty-source": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"number-max-precision": null,
"property-no-unknown": null,
"property-no-vendor-prefix": null,
"rule-empty-line-before": null,
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A place to learn and share with developers what makes web work accessible. This

- nvm: A Node version manager. It allows you to install several versions of node on the same machine and change versions easily.
- [Here are instructions in how to install nvm](https://github.com/nvm-sh/nvm#usage)
- After installing nvm, install a Node version >= 18 using nvm, ideally `nvm install 20.11.0`
- After installing nvm, install a Node version >= 20.15.0 using nvm, ideally `nvm install 20.15.0`
- npm: a Node Package Manager, usually installed alongside Node
- More info: [Downloading and installing Node.js and NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
- Lynx: A text-only browser used for testing for how a website will work without graphics turned on.
Expand Down Expand Up @@ -74,6 +74,17 @@ A place to learn and share with developers what makes web work accessible. This
```sh
git clone [email protected]:PublicisSapient/enable-a11y.git
cd enable-a11y
```

```sh
nvm use
```

This instructs nvm to use the Node version specified in the `.nvmrc` file located in the project root directory.

> Note: If the specified version has not been installed yet, nvm will advise to install it after running the command above.

```sh
npm clean-install
```

Expand Down
6 changes: 6 additions & 0 deletions bin/checkHTML.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ If that does not work, you may need to do a global update of @axe-core/cli:
sudo npm update -g @axe-core/cli
********************************************************************************
* NOTE: If you are seeing this message in GitHub Automated Tests, you need to
* update push-actions.yml to ensure the version of Chrome being downloaded there
* matches the one in your package.json
********************************************************************************
' 1>&2
exit 1;
Expand Down
22 changes: 22 additions & 0 deletions bin/enforceRemFontSize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

i=`find less -name '*.less' -print`

# echo $i
OUTPUT=`grep -v "PX OK" $i | grep -n 'font-size:[^\s\S]*[^@]px;'`
# OUTPUT=`grep -n 'font-size:[^\s\S]*[^@]px;' $i`
# grep -b 'line-height:[^\s\S]*[^0-9];' $i
RET="$?"

if [ "$RET" = "0" ]
then
echo "The following CSS files must be changed so they don't use px units."
echo "Please ensure you change the corresponding LESS files to use the @px mixin."
echo "(e.g. instead of using 'font-size: 12px;', use 'font-size: 12 / @px;')."
echo
echo "$OUTPUT"
echo
exit 1;
fi

exit 0
53 changes: 53 additions & 0 deletions bin/validate-node-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env node

import chalk from 'chalk';
import { execSync } from 'child_process';
import fs from 'fs';
import path from 'path';

async function getRunningVersion() {
const terminalCmd = 'node --version';

try {
return execSync(terminalCmd).toString().trim();
} catch (e) {
console.log(chalk.red(`Node version validation failed while running ${terminalCmd}`), e);
}
}

async function validateVersion() {
const directory = path.resolve();
let runningVersion;

try {
const filePath = path.resolve(directory, '.nvmrc');
const fileMetadata = await fs.promises.stat(filePath);
const fileContent = fs.readFileSync(filePath, "utf8");
let specVersion;

if (fileMetadata) {
specVersion = fileContent.startsWith("v") ? fileContent : `v${fileContent};`
runningVersion = (await getRunningVersion()).trim();

if (runningVersion.trim() !== specVersion.trim()) {
console.log(chalk.red(`Your Node version ${runningVersion} does not match the specified version ${specVersion} \rfound in the .nvmrc file in your project root`) );
console.log('\n-------------\n');
console.log(chalk.red('Run command "nvm use" followed by "npm ci" in your terminal before running "npm run start" again.\n'));
process.exit(1);
}
}


} catch (e) {
if (e.code !== "ENOENT") {
console.log(chalk.red('An unexpected error occurred while validating your Node version.\n'));
console.error(e);
process.exit(1);
}
console.log(chalk.red('Make sure the ".nvmrc" file from the Git repository is present in your project root directory\n'));
console.error(e);
process.exit(1);
}
}

validateVersion();
Loading

0 comments on commit 4f73b4f

Please sign in to comment.