Skip to content

Commit 180e4b3

Browse files
committed
Build: Add dist/wordpress/posts to Git
This makes changes easier to review in Git, and also has the benefit of securing the SRI directives into Git, per issue jquery#40. I considered commiting the sri-directives.json file to Git, but encountered three issues: - The file is minified (although grunt-sri has a 'pretty' option). - The file is over 3MB, which means GitHub will refuse both viewing and diffing of the file. - The JSON file is not authoritive, because it is not deployed. Instead, it is only using during the build process to stage the hashes whilst building the HTML includes, which is what we do deploy. Comitting these to Git is much easier. The files are much smaller, and thus easy to view and review via GitHub. It also has the benefit of allowing review and testing of much more than just the SRI hashes. * Move 'sri-generate' and 'build-index' from deploy/build to a new 'prepare' step. * Add 'npm run prepare' as shortcut for 'grunt prepare' so that grunt-cli does not have to be globally intalled. * Add 'git-status' task for testing that the working copy is clean. * Add 'npm test' (grunt test) that runs prepare + git-status, mainly for CI. Fixes jquery#40.
1 parent 6a8777e commit 180e4b3

File tree

11 files changed

+1338
-2
lines changed

11 files changed

+1338
-2
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/node_modules/
2-
/dist/
2+
/dist/resources/
33
/config.js*

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "8"

Gruntfile.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,39 @@ grunt.registerTask( "ensure-wordpress-config", function() {
433433
} );
434434
} );
435435

436+
437+
grunt.registerTask( "git-status", function () {
438+
var done = this.async();
439+
// Are there unstaged changes?
440+
require( "child_process" ).exec( "git ls-files --modified", function ( err, stdout, stderr ) {
441+
var ret = err || stderr || stdout;
442+
if ( ret ) {
443+
grunt.log.error( "Found modified files:" );
444+
grunt.log.error( "" );
445+
grunt.log.error( ret );
446+
grunt.log.error( "" );
447+
grunt.log.error( "Use 'npm run prepare' to apply these changes." );
448+
} else {
449+
grunt.log.ok( "All clear!" );
450+
done();
451+
}
452+
} );
453+
} );
454+
436455
grunt.registerTask( "sri-generate", ["ensure-dist-resources", "sri:generate"] );
437456

457+
// The "npm test" command is run in CI.
458+
// It confirms that the preparation step was run (if needed).
459+
grunt.registerTask( "test", ["prepare", "git-status"] );
460+
461+
// The "npm run prepare" command must be run to update wordpress pages
462+
// See also https://github.com/jquery/codeorigin.jquery.com/issues/40.
463+
grunt.registerTask( "prepare", ["sri-generate", "build-index"] );
464+
438465
// The "grunt deploy" command is automatically invoked on git-commit by the server that
439466
// will deploy the WordPress site.
440467
// Task tree: "deploy" > "wordpress-deploy" > "build-wordpress" > "build".
441-
grunt.registerTask( "build", ["sri-generate", "build-index"] );
468+
grunt.registerTask( "build", [] );
442469
grunt.registerTask( "deploy", ["ensure-wordpress-config", "wordpress-deploy", "reload-listings"] );
443470

444471
};

dist/wordpress/posts/page/color.html

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<script>{
2+
"title": "jQuery Color - All Versions"
3+
}</script>
4+
5+
<h2>jQuery Color - Git Builds</h2>
6+
<p>UNSTABLE, NOT FOR PRODUCTION</p>
7+
8+
<ul>
9+
<li>
10+
jQuery Color git build -
11+
<a href="/color/jquery.color-git.js">uncompressed</a>
12+
</li>
13+
<li>
14+
jQuery Color SVG Color Names git build -
15+
<a href="/color/jquery.color.svg-names-git.js">uncompressed</a>
16+
</li>
17+
<li>
18+
jQuery Color With Names (last two together) git build -
19+
<a href="/color/jquery.color.plus-names-git.js">uncompressed</a>
20+
</li>
21+
</ul>
22+
23+
24+
<h2>jQuery Color - All Versions</h2>
25+
<h3>2.1.2</h3>
26+
<ul>
27+
<li>jQuery Color 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color-2.1.2.js' data-hash='sha256-1Cn7TdfHiMcEbTuku97ZRSGt2b3SvZftEIn68UMgHC8='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color-2.1.2.min.js' data-hash='sha256-H28SdxWrZ387Ldn0qogCzFiUDDxfPiNIyJX7BECQkDE='>minified</a></li>
28+
<li>jQuery Color SVG Color Names 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.2.js' data-hash='sha256-E2JKbykmVrPiZ51IgKcRqp5juspPiXvB0A8taY4xwsU='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.2.min.js' data-hash='sha256-oa16jcB6Q9iq6S2bWsgcNkMbyILcfm/0wLc7Ee0xhSc='>minified</a></li>
29+
<li>jQuery Color With Names (last two together) 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.2.js' data-hash='sha256-MyufSJPYmyLJzomPsAOszwxMNH2iQOeZXhMAKfh04P8='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.2.min.js' data-hash='sha256-Wp3wC/dKYQ/dCOUD7VUXXp4neLI5t0uUEF1pg0dFnAE='>minified</a></li>
30+
</ul>
31+
32+
<h3>2.1.1</h3>
33+
<ul>
34+
<li>jQuery Color 2.1.1 - <a class='open-sri-modal' href='/color/jquery.color-2.1.1.js' data-hash='sha256-ZiqnJALh4PA4acld9MaqQv2lQr5Ip+Zx74CRA5xuZVw='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color-2.1.1.min.js' data-hash='sha256-yFxZer7P3ip6wQY4SQ07p2hoI9z8nHJG2jP4VG8nxGY='>minified</a></li>
35+
<li>jQuery Color SVG Color Names 2.1.1 - <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.1.js' data-hash='sha256-6Qln3sB8jZ7jX9ki8Ywp1ah4PvbVq8hrycmGMKlXqxY='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.1.min.js' data-hash='sha256-L+KCAg1TQnabPZgoVwaJvEtKxXMFZ2b1kpg/Y/wCe8A='>minified</a></li>
36+
<li>jQuery Color With Names (last two together) 2.1.1 - <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.1.js' data-hash='sha256-YNrWrC9kAbpnKJjMon7MC7nkgt3erTzOydprgzH9jUM='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.1.min.js' data-hash='sha256-ugCxe6U54Ok3JzLl29OgrvhXROKbQ2wornwrtpY5bP0='>minified</a></li>
37+
</ul>
38+
39+
<h3>2.1.0</h3>
40+
<ul>
41+
<li>jQuery Color 2.1.0 - <a class='open-sri-modal' href='/color/jquery.color-2.1.0.js' data-hash='sha256-Xjpy+9ekY336rkyjeSr/tG3CcJ4ylo5w4IXkV3SKEPY='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color-2.1.0.min.js' data-hash='sha256-TxWsEVcRj77h2c3+OVr/1FjarMR2Uq9s+n8SlR/JvoQ='>minified</a></li>
42+
<li>jQuery Color SVG Color Names 2.1.0 - <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.0.js' data-hash='sha256-93xU2YX6GL6jaIt9t9blTwV7ZVfCdltpMepHu7DA0/U='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.0.min.js' data-hash='sha256-TFJ+6+7LiXbWZHY3TzoABUf8ovErG9WcVfzqonC9jME='>minified</a></li>
43+
<li>jQuery Color With Names (last two together) 2.1.0 - <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.0.js' data-hash='sha256-MiTS7NBfoRaGpRx+E4FvjX8AHMrTlXq+7XzChmsmEgU='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.0.min.js' data-hash='sha256-fHgDvpwuDJBgbjdgGFh7parMJSSjtN4bnO51NHFS2mk='>minified</a></li>
44+
</ul>
45+
46+
<h3>2.0.0</h3>
47+
<ul>
48+
<li>jQuery Color 2.0.0 - <a class='open-sri-modal' href='/color/jquery.color-2.0.0.js' data-hash='sha256-hRFuS0HsrefVZFKfz5LqQQ/Z2Qx8Y6ssVj2V2UqRRPA='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color-2.0.0.min.js' data-hash='sha256-horzbtYxoj8wa4pBjHzjQDXmNtc/FHedTOjCK8Z998o='>minified</a></li>
49+
<li>jQuery Color SVG Color Names 2.0.0 - <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.0.0.js' data-hash='sha256-WhCekbfhla+O1jzIVcx1vKpfXiVf5YlKkN5+qgOXYuo='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.0.0.min.js' data-hash='sha256-zKVqUMK8BqjAz0/6qXsiss6E4ZSKmdF8EcFZ4Ti/wY4='>minified</a></li>
50+
<li>jQuery Color With Names (last two together) 2.0.0 - <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.0.0.js' data-hash='sha256-vZVumKdXTp8HnSg2e6icqF+Lv9/tLrargPWMyHKCDtI='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.0.0.min.js' data-hash='sha256-GLDPB8cPkxhnNU9oPvP5WarDQLsk4TEIg5cXENAvBOI='>minified</a></li>
51+
</ul>
52+

dist/wordpress/posts/page/index.html

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
<script>{
2+
"title": "jQuery CDN - Latest Stable Versions"
3+
}</script>
4+
5+
<h2>jQuery Core</h2>
6+
<p>
7+
Showing the latest stable release in each major branch.
8+
<a href="/jquery/">See all versions of jQuery Core</a>.
9+
</p>
10+
11+
<h3>jQuery 3.x</h3>
12+
<ul>
13+
<li>jQuery Core 3.3.1 - <a class='open-sri-modal' href='/jquery-3.3.1.js' data-hash='sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60='>uncompressed</a>, <a class='open-sri-modal' href='/jquery-3.3.1.min.js' data-hash='sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8='>minified</a>, <a class='open-sri-modal' href='/jquery-3.3.1.slim.js' data-hash='sha256-fNXJFIlca05BIO2Y5zh1xrShK3ME+/lYZ0j+ChxX2DA='>slim</a>, <a class='open-sri-modal' href='/jquery-3.3.1.slim.min.js' data-hash='sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E='>slim minified</a></li>
14+
</ul>
15+
<h3>jQuery 2.x</h3>
16+
<ul>
17+
<li>jQuery Core 2.2.4 - <a class='open-sri-modal' href='/jquery-2.2.4.js' data-hash='sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI='>uncompressed</a>, <a class='open-sri-modal' href='/jquery-2.2.4.min.js' data-hash='sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44='>minified</a></li>
18+
</ul>
19+
<h3>jQuery 1.x</h3>
20+
<ul>
21+
<li>jQuery Core 1.12.4 - <a class='open-sri-modal' href='/jquery-1.12.4.js' data-hash='sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU='>uncompressed</a>, <a class='open-sri-modal' href='/jquery-1.12.4.min.js' data-hash='sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ='>minified</a></li>
22+
</ul>
23+
24+
<h3>jQuery Migrate</h3>
25+
<ul>
26+
<li>jQuery Migrate 3.0.1 - <a class='open-sri-modal' href='/jquery-migrate-3.0.1.js' data-hash='sha256-VvnF+Zgpd00LL73P2XULYXEn6ROvoFaa/vbfoiFlZZ4='>uncompressed</a>, <a class='open-sri-modal' href='/jquery-migrate-3.0.1.min.js' data-hash='sha256-F0O1TmEa4I8N24nY0bya59eP6svWcshqX1uzwaWC4F4='>minified</a></li>
27+
</ul>
28+
29+
<h2>jQuery UI</h2>
30+
<p>
31+
Showing the latest stable release for the current and legacy release families.
32+
<a href="/ui/">See all versions of jQuery UI</a>.
33+
</p>
34+
35+
<h3>jQuery UI 1.12</h3>
36+
<ul>
37+
<li>jQuery UI 1.12.1 - <a class='open-sri-modal' href='/ui/1.12.1/jquery-ui.js' data-hash='sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30='>uncompressed</a>, <a class='open-sri-modal' href='/ui/1.12.1/jquery-ui.min.js' data-hash='sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU='>minified</a></li>
38+
<li>Themes:
39+
<a href="/ui/1.12.1/themes/base/jquery-ui.css">base</a>
40+
<a href="/ui/1.12.1/themes/black-tie/jquery-ui.css">black-tie</a>
41+
<a href="/ui/1.12.1/themes/blitzer/jquery-ui.css">blitzer</a>
42+
<a href="/ui/1.12.1/themes/cupertino/jquery-ui.css">cupertino</a>
43+
<a href="/ui/1.12.1/themes/dark-hive/jquery-ui.css">dark-hive</a>
44+
<a href="/ui/1.12.1/themes/dot-luv/jquery-ui.css">dot-luv</a>
45+
<a href="/ui/1.12.1/themes/eggplant/jquery-ui.css">eggplant</a>
46+
<a href="/ui/1.12.1/themes/excite-bike/jquery-ui.css">excite-bike</a>
47+
<a href="/ui/1.12.1/themes/flick/jquery-ui.css">flick</a>
48+
<a href="/ui/1.12.1/themes/hot-sneaks/jquery-ui.css">hot-sneaks</a>
49+
<a href="/ui/1.12.1/themes/humanity/jquery-ui.css">humanity</a>
50+
<a href="/ui/1.12.1/themes/le-frog/jquery-ui.css">le-frog</a>
51+
<a href="/ui/1.12.1/themes/mint-choc/jquery-ui.css">mint-choc</a>
52+
<a href="/ui/1.12.1/themes/overcast/jquery-ui.css">overcast</a>
53+
<a href="/ui/1.12.1/themes/pepper-grinder/jquery-ui.css">pepper-grinder</a>
54+
<a href="/ui/1.12.1/themes/redmond/jquery-ui.css">redmond</a>
55+
<a href="/ui/1.12.1/themes/smoothness/jquery-ui.css">smoothness</a>
56+
<a href="/ui/1.12.1/themes/south-street/jquery-ui.css">south-street</a>
57+
<a href="/ui/1.12.1/themes/start/jquery-ui.css">start</a>
58+
<a href="/ui/1.12.1/themes/sunny/jquery-ui.css">sunny</a>
59+
<a href="/ui/1.12.1/themes/swanky-purse/jquery-ui.css">swanky-purse</a>
60+
<a href="/ui/1.12.1/themes/trontastic/jquery-ui.css">trontastic</a>
61+
<a href="/ui/1.12.1/themes/ui-darkness/jquery-ui.css">ui-darkness</a>
62+
<a href="/ui/1.12.1/themes/ui-lightness/jquery-ui.css">ui-lightness</a>
63+
<a href="/ui/1.12.1/themes/vader/jquery-ui.css">vader</a>
64+
</li>
65+
</ul>
66+
67+
<h3>jQuery UI 1.11</h3>
68+
<ul>
69+
<li>jQuery UI 1.11.4 - <a class='open-sri-modal' href='/ui/1.11.4/jquery-ui.js' data-hash='sha256-DI6NdAhhFRnO2k51mumYeDShet3I8AKCQf/tf7ARNhI='>uncompressed</a>, <a class='open-sri-modal' href='/ui/1.11.4/jquery-ui.min.js' data-hash='sha256-xNjb53/rY+WmG+4L6tTl9m6PpqknWZvRt0rO1SRnJzw='>minified</a></li>
70+
<li>Themes:
71+
<a href="/ui/1.11.4/themes/black-tie/jquery-ui.css">black-tie</a>
72+
<a href="/ui/1.11.4/themes/blitzer/jquery-ui.css">blitzer</a>
73+
<a href="/ui/1.11.4/themes/cupertino/jquery-ui.css">cupertino</a>
74+
<a href="/ui/1.11.4/themes/dark-hive/jquery-ui.css">dark-hive</a>
75+
<a href="/ui/1.11.4/themes/dot-luv/jquery-ui.css">dot-luv</a>
76+
<a href="/ui/1.11.4/themes/eggplant/jquery-ui.css">eggplant</a>
77+
<a href="/ui/1.11.4/themes/excite-bike/jquery-ui.css">excite-bike</a>
78+
<a href="/ui/1.11.4/themes/flick/jquery-ui.css">flick</a>
79+
<a href="/ui/1.11.4/themes/hot-sneaks/jquery-ui.css">hot-sneaks</a>
80+
<a href="/ui/1.11.4/themes/humanity/jquery-ui.css">humanity</a>
81+
<a href="/ui/1.11.4/themes/le-frog/jquery-ui.css">le-frog</a>
82+
<a href="/ui/1.11.4/themes/mint-choc/jquery-ui.css">mint-choc</a>
83+
<a href="/ui/1.11.4/themes/overcast/jquery-ui.css">overcast</a>
84+
<a href="/ui/1.11.4/themes/pepper-grinder/jquery-ui.css">pepper-grinder</a>
85+
<a href="/ui/1.11.4/themes/redmond/jquery-ui.css">redmond</a>
86+
<a href="/ui/1.11.4/themes/smoothness/jquery-ui.css">smoothness</a>
87+
<a href="/ui/1.11.4/themes/south-street/jquery-ui.css">south-street</a>
88+
<a href="/ui/1.11.4/themes/start/jquery-ui.css">start</a>
89+
<a href="/ui/1.11.4/themes/sunny/jquery-ui.css">sunny</a>
90+
<a href="/ui/1.11.4/themes/swanky-purse/jquery-ui.css">swanky-purse</a>
91+
<a href="/ui/1.11.4/themes/trontastic/jquery-ui.css">trontastic</a>
92+
<a href="/ui/1.11.4/themes/ui-darkness/jquery-ui.css">ui-darkness</a>
93+
<a href="/ui/1.11.4/themes/ui-lightness/jquery-ui.css">ui-lightness</a>
94+
<a href="/ui/1.11.4/themes/vader/jquery-ui.css">vader</a>
95+
</li>
96+
</ul>
97+
98+
<h2>jQuery Mobile</h2>
99+
<p>
100+
Showing the latest stable release for jQuery Mobile.
101+
<a href="/mobile/">See all versions of jQuery Mobile</a>.
102+
</p>
103+
<ul>
104+
<li>
105+
jQuery Mobile 1.4.5 -
106+
<a href="/mobile/1.4.5/jquery.mobile-1.4.5.js">uncompressed</a>,
107+
<a href="/mobile/1.4.5/jquery.mobile-1.4.5.min.js">minified</a>,
108+
<a href="/mobile/1.4.5/jquery.mobile-1.4.5.min.css">theme</a>
109+
(<a href="/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css">structure only</a>)
110+
</li>
111+
112+
</ul>
113+
114+
<h2>jQuery Color</h2>
115+
<p>
116+
Showing the latest stable release for jQuery Color.
117+
<a href="/color/">See all versions of jQuery Color</a>.
118+
</p>
119+
<ul>
120+
<li>jQuery Color 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color-2.1.2.js' data-hash='sha256-1Cn7TdfHiMcEbTuku97ZRSGt2b3SvZftEIn68UMgHC8='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color-2.1.2.min.js' data-hash='sha256-H28SdxWrZ387Ldn0qogCzFiUDDxfPiNIyJX7BECQkDE='>minified</a></li>
121+
<li>jQuery Color SVG Color Names 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.2.js' data-hash='sha256-E2JKbykmVrPiZ51IgKcRqp5juspPiXvB0A8taY4xwsU='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.svg-names-2.1.2.min.js' data-hash='sha256-oa16jcB6Q9iq6S2bWsgcNkMbyILcfm/0wLc7Ee0xhSc='>minified</a></li>
122+
<li>jQuery Color With Names (last two together) 2.1.2 - <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.2.js' data-hash='sha256-MyufSJPYmyLJzomPsAOszwxMNH2iQOeZXhMAKfh04P8='>uncompressed</a>, <a class='open-sri-modal' href='/color/jquery.color.plus-names-2.1.2.min.js' data-hash='sha256-Wp3wC/dKYQ/dCOUD7VUXXp4neLI5t0uUEF1pg0dFnAE='>minified</a></li>
123+
</ul>
124+
125+
126+
<h2>QUnit</h2>
127+
<p>
128+
Showing the latest stable release for QUnit.
129+
<a href="/qunit/">See all versions of QUnit</a>.
130+
</p>
131+
132+
<ul>
133+
<li>
134+
QUnit 2.6.2 -
135+
<a class='open-sri-modal' href='/qunit/qunit-2.6.2.js' data-hash='sha256-72OhbBvECs6Z5vG0GfPqiyYvTf8vhdEVHKQcacIcIeM='>uncompressed</a>,
136+
<a href="/qunit/qunit-2.6.2.css">theme</a>
137+
</li>
138+
139+
</ul>
140+
141+
<h2>PEP</h2>
142+
<p>
143+
Showing the latest stable release for PEP.
144+
<a href="/pep/">See all versions of PEP</a>.
145+
</p>
146+
147+
<ul>
148+
<li>
149+
PEP 0.4.3 -
150+
<a href="/pep/0.4.3/pep.js">uncompressed</a>,
151+
<a href="/pep/0.4.3/pep.min.js">minified</a>
152+
</li>
153+
154+
</ul>

0 commit comments

Comments
 (0)