jquery / codeorigin.jquery.com

jQuery CDN
https://releases.jquery.com
Other
57 stars 605 forks source link

Publish machine-readable file list and SRI data to resources/ #76

Closed Krinkle closed 2 years ago

Krinkle commented 2 years ago

Let "wordpress-deploy" upload this to the site, which the gw-resources plugin exposes via addresses like https://releases.jquery.com/resources/foo.

See https://github.com/jquery/api.jquery.com/ for an example of this.

Local test plan:

nobody$ npm ci
nobody$ cp config-sample.json config.json

nobody$ ./node_modules/.bin/grunt sri
nobody$ less resources/sri-directives.json
  {"@cdn/color/2.2.0/jquery.color.js":{"hashes":{"sha256":"gvMJWDH...

nobody$ ./node_modules/.bin/grunt build-index build-resources
nobody$ less dist/wordpress/resources/sri-directives.json
  {"@cdn/color/2.2.0/jquery.color.js":{"hashes":{"sha256":"gvMJWDH...
nobody$ less dist/wordpress/resources/cdn.json
  { "jquery": [ [ "3", { "latestStable": {
  "filename": "jquery-3.6.0.js", ...

Closes #40.

Krinkle commented 2 years ago

This is mainly to help me implement a "Verify reproducible builds" job in CI for QUnit, for which I'd otherwise need to either guess at filenames or scrape HTML (ref https://github.com/qunitjs/qunit/issues/1560).