Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deprecate sri-history.json file #3646

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions build/sri-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
*
* When running `npm run release`, this script will execute and
* update sri-history.json with the SRIs of axe{.*}.js.
* @deprecated
*/
var path = require('path');
var fs = require('fs');
var sriToolbox = require('sri-toolbox');

// Check if we should be validating or updating
var validate = process.argv.some(function(arg) {
var validate = process.argv.some(function (arg) {
return arg === '--validate';
});

Expand All @@ -27,11 +28,11 @@ if (typeof axeHistory[axeVersion] !== 'object') {
var versionSRIs = axeHistory[axeVersion];

// List all axe files (including minified and localized axe files)
var axeFiles = fs.readdirSync(root).filter(function(file) {
var axeFiles = fs.readdirSync(root).filter(function (file) {
return file.match(/^axe(\.[a-z.-]+)?\.js$/);
});

axeFiles.forEach(function(axeFile) {
axeFiles.forEach(function (axeFile) {
var axeSource = fs.readFileSync(path.join(root, axeFile), 'utf-8');
var axeIntegrity = sriToolbox.generate({ algorithms: ['sha256'] }, axeSource);

Expand Down