Browse Source

Avoid jQuery, use NPM instead of Yarn (#151)

pull/153/head
Ned Zimmerman 6 years ago committed by GitHub
parent
commit
9d5f10e728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      .travis.yml
  2. 6
      assets/scripts/customizer.js
  3. 10
      assets/scripts/routes/catalog.js
  4. 4
      assets/scripts/routes/common.js
  5. 14
      dist/mix-manifest.json
  6. 2
      dist/scripts/aldine.js
  7. 2
      dist/scripts/call-to-action.js
  8. 2
      dist/scripts/catalog-admin.js
  9. 2
      dist/scripts/customizer.js
  10. 2
      dist/scripts/page-section.js
  11. 2
      dist/styles/aldine.css
  12. 2
      dist/styles/editor.css
  13. 8291
      package-lock.json
  14. 43
      package.json
  15. 10451
      yarn.lock

14
.travis.yml

@ -28,17 +28,15 @@ cache:
before_install: before_install:
- composer self-update - composer self-update
- source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION - source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION
- export PATH=$HOME/.yarn/bin:$PATH && travis_retry curl -o- -L https://yarnpkg.com/install.sh
| bash
install: install:
- node -v && yarn -V - node -v
- travis_retry yarn - npm install
- composer install -o --prefer-dist --no-interaction - composer install -o --prefer-dist --no-interaction
script: script:
- yarn run test - npm run test
- yarn run build - npm run build
- yarn run rmdist - npm run rmdist
- yarn run "build:production" - npm run "build:production"
- composer test - composer test
before_deploy: before_deploy:
- export TRAVIS_PROJECT_SLUG="$(basename $TRAVIS_BUILD_DIR)" - export TRAVIS_PROJECT_SLUG="$(basename $TRAVIS_BUILD_DIR)"

6
assets/scripts/customizer.js

@ -1,9 +1,7 @@
import $ from 'jquery';
wp.customize( 'blogname', value => { wp.customize( 'blogname', value => {
value.bind( to => $( '.home .entry-title' ).text( to ) ); value.bind( to => document.querySelector( '.home .entry-title' ).textContent = to );
} ); } );
wp.customize( 'blogdescription', value => { wp.customize( 'blogdescription', value => {
value.bind( to => $( '.home .entry-description' ).text( to ) ); value.bind( to => document.querySelector( '.home .entry-description' ).textContent = to );
} ); } );

10
assets/scripts/routes/catalog.js

@ -137,15 +137,15 @@ export default {
let $grid = $( '.books' ); let $grid = $( '.books' );
$grid.isotope( { $grid.isotope( {
itemSelector: '.book', itemSelector: '.book',
getSortData: { getSortData: {
title: '.book__title a', title: '.book__title a',
subject: '[data-subject]', subject: '[data-subject]',
latest: '[data-date-published]', latest: '[data-date-published]',
}, },
sortAscending: { sortAscending: {
title: true, title: true,
subject: false, subject: false,
latest: false, latest: false,
}, },
} ); } );
let licenses = document.querySelector( '.license-filters' ); let licenses = document.querySelector( '.license-filters' );

4
assets/scripts/routes/common.js

@ -30,7 +30,7 @@ export default {
.attr( 'title', PB_A11y.decrease_label ); .attr( 'title', PB_A11y.decrease_label );
Cookies.set( 'a11y-root-larger-fontsize', '1', { Cookies.set( 'a11y-root-larger-fontsize', '1', {
expires: 365, expires: 365,
path: '/', path: '/',
} ); } );
return false; return false;
} else { } else {
@ -43,7 +43,7 @@ export default {
.attr( 'title', PB_A11y.increase_label ); .attr( 'title', PB_A11y.increase_label );
Cookies.set( 'a11y-root-larger-fontsize', '0', { Cookies.set( 'a11y-root-larger-fontsize', '0', {
expires: 365, expires: 365,
path: '/', path: '/',
} ); } );
return false; return false;
} }

14
dist/mix-manifest.json vendored

@ -1,9 +1,9 @@
{ {
"/scripts/aldine.js": "/scripts/aldine.js?id=e222d7e1e1c71c6bdb98", "/scripts/aldine.js": "/scripts/aldine.js?id=e7092457ba2f022d10dd",
"/styles/aldine.css": "/styles/aldine.css?id=24f3730caf58fbb43e07", "/styles/aldine.css": "/styles/aldine.css?id=49380422939b00103dd9",
"/styles/editor.css": "/styles/editor.css?id=e96b3d10ea63fa07d09b", "/styles/editor.css": "/styles/editor.css?id=0471100c6ede7a8c5c99",
"/scripts/customizer.js": "/scripts/customizer.js?id=0a52a1e0117b2902b145", "/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=eadd19411c87b21e88d7",
"/scripts/catalog-admin.js": "/scripts/catalog-admin.js?id=4ee1f7f0640e28791cf2", "/scripts/page-section.js": "/scripts/page-section.js?id=c83fb9af2087d5248257",
"/scripts/page-section.js": "/scripts/page-section.js?id=2f9e970e43107c0ba14a", "/scripts/customizer.js": "/scripts/customizer.js?id=5897af2d5bac7237fb6e",
"/scripts/call-to-action.js": "/scripts/call-to-action.js?id=e74f1ea59f6ead88509d" "/scripts/call-to-action.js": "/scripts/call-to-action.js?id=be9a6239a2f608b28c10"
} }

2
dist/scripts/aldine.js vendored

File diff suppressed because one or more lines are too long

2
dist/scripts/call-to-action.js vendored

@ -1 +1 @@
!function(t){var n={};function e(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return t[l].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,l){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:l})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=1)}({1:function(t,n,e){t.exports=e("eL/z")},"eL/z":function(t,n){tinymce.create("tinymce.plugins.aldine_call_to_action",{init:function(t,n){t.addButton("aldine_call_to_action",{title:aldine.call_to_action.title,icon:"icon dashicons-flag",onclick:function(){t.windowManager.open({title:aldine.call_to_action.title,body:[{type:"textbox",name:"text",label:aldine.call_to_action.text,value:aldine.call_to_action.title},{type:"textbox",name:"link",label:aldine.call_to_action.link,value:"#"}],onsubmit:function(n){t.insertContent('[aldine_call_to_action text="'+n.data.text+'" link="'+n.data.link+'"]')}})}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}}); !function(t){var n={};function e(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return t[l].call(i.exports,i,i.exports,e),i.l=!0,i.exports}e.m=t,e.c=n,e.d=function(t,n,l){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:l})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s=1)}({1:function(t,n,e){t.exports=e("eL/z")},"eL/z":function(t,n){tinymce.create("tinymce.plugins.aldine_call_to_action",{init:function(t,n){t.addButton("aldine_call_to_action",{title:aldine.call_to_action.title,icon:"icon dashicons-flag",onclick:function(){t.windowManager.open({title:aldine.call_to_action.title,body:[{type:"textbox",name:"text",label:aldine.call_to_action.text,value:aldine.call_to_action.title},{type:"textbox",name:"link",label:aldine.call_to_action.link,value:"#"}],onsubmit:function(n){t.insertContent('[aldine_call_to_action text="'+n.data.text+'" link="'+n.data.link+'"]')}})}})},createControl:function(t,n){return null}}),tinymce.PluginManager.add("aldine_call_to_action",tinymce.plugins.aldine_call_to_action)}});

2
dist/scripts/catalog-admin.js vendored

File diff suppressed because one or more lines are too long

2
dist/scripts/customizer.js vendored

File diff suppressed because one or more lines are too long

2
dist/scripts/page-section.js vendored

@ -1 +1 @@
!function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}({4:function(e,t,n){e.exports=n("BNyP")},BNyP:function(e,t){tinymce.create("tinymce.plugins.aldine_page_section",{init:function(e,t){e.addButton("aldine_page_section",{title:aldine.page_section.title,icon:"icon dashicons-layout",onclick:function(){e.windowManager.open({title:aldine.page_section.title,body:[{type:"textbox",name:"title",label:aldine.page_section.title_label,value:aldine.page_section.title},{type:"listbox",name:"variant",label:"Variant",values:[{text:aldine.page_section.standard,value:""},{text:aldine.page_section.accent,value:"accent"},{text:aldine.page_section.bordered,value:"bordered"},{text:aldine.page_section.borderless,value:"borderless"}],value:""}],onsubmit:function(t){e.insertContent('[aldine_page_section title="'+t.data.title+'" variant="'+t.data.variant+'"]<p>Insert your page section content here.</p>[/aldine_page_section]')}})}})},createControl:function(e,t){return null}}),tinymce.PluginManager.add("aldine_page_section",tinymce.plugins.aldine_page_section)}}); !function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=4)}({4:function(e,t,n){e.exports=n("BNyP")},BNyP:function(e,t){tinymce.create("tinymce.plugins.aldine_page_section",{init:function(e,t){e.addButton("aldine_page_section",{title:aldine.page_section.title,icon:"icon dashicons-layout",onclick:function(){e.windowManager.open({title:aldine.page_section.title,body:[{type:"textbox",name:"title",label:aldine.page_section.title_label,value:aldine.page_section.title},{type:"listbox",name:"variant",label:"Variant",values:[{text:aldine.page_section.standard,value:""},{text:aldine.page_section.accent,value:"accent"},{text:aldine.page_section.bordered,value:"bordered"},{text:aldine.page_section.borderless,value:"borderless"}],value:""}],onsubmit:function(t){e.insertContent('[aldine_page_section title="'+t.data.title+'" variant="'+t.data.variant+'"]<p>Insert your page section content here.</p>[/aldine_page_section]')}})}})},createControl:function(e,t){return null}}),tinymce.PluginManager.add("aldine_page_section",tinymce.plugins.aldine_page_section)}});

2
dist/styles/aldine.css vendored

File diff suppressed because one or more lines are too long

2
dist/styles/editor.css vendored

File diff suppressed because one or more lines are too long

8291
package-lock.json generated

File diff suppressed because it is too large Load Diff

43
package.json

@ -3,9 +3,13 @@
"version": "1.5.0", "version": "1.5.0",
"author": "Pressbooks (Book Oven Inc.) <code@pressbooks.com>", "author": "Pressbooks (Book Oven Inc.) <code@pressbooks.com>",
"homepage": "https://github.com/pressbooks/pressbooks-aldine/", "homepage": "https://github.com/pressbooks/pressbooks-aldine/",
"description": "description": "Aldine is the default theme for the home page of Pressbooks networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher.",
"Aldine is the default theme for the home page of Pressbooks networks. It is named for the Aldine Press, founded by Aldus Manutius in 1494, who is regarded by many as the world’s first publisher.", "keywords": [
"keywords": ["publishing", "catalog", "pressbooks", "default-theme"], "publishing",
"catalog",
"pressbooks",
"default-theme"
],
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",
@ -17,11 +21,14 @@
"licenses": [ "licenses": [
{ {
"type": "GPL-3.0-or-later", "type": "GPL-3.0-or-later",
"url": "url": "https://github.com/pressbooks/pressbooks-aldine/tree/master/LICENSE.md"
"https://github.com/pressbooks/pressbooks-aldine/tree/master/LICENSE.md"
} }
], ],
"browserslist": ["last 2 versions", "android 4", "opera 12"], "browserslist": [
"last 2 versions",
"android 4",
"opera 12"
],
"eslintConfig": { "eslintConfig": {
"extends": "./node_modules/pressbooks-build-tools/config/eslint.js", "extends": "./node_modules/pressbooks-build-tools/config/eslint.js",
"globals": { "globals": {
@ -31,26 +38,22 @@
"tinymce": true "tinymce": true
} }
}, },
"eslintIgnore": [
"assets/scripts/catalog-admin.js"
],
"stylelint": { "stylelint": {
"extends": "./node_modules/pressbooks-build-tools/config/stylelint.js" "extends": "./node_modules/pressbooks-build-tools/config/stylelint.js"
}, },
"scripts": { "scripts": {
"build": "build": "cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"cross-env NODE_ENV=development webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "build:production": "cross-env NODE_ENV=production webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"build:production": "build:profile": "cross-env NODE_ENV=production webpack --progress --profile --json --config=node_modules/laravel-mix/setup/webpack.config.js",
"cross-env NODE_ENV=production webpack --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "start": "cross-env NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"build:profile":
"cross-env NODE_ENV=production webpack --progress --profile --json --config=node_modules/laravel-mix/setup/webpack.config.js",
"start":
"cross-env NODE_ENV=development webpack --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"rmdist": "rimraf dist", "rmdist": "rimraf dist",
"lint": "npm run -s lint:scripts && npm run -s lint:styles", "lint": "npm run -s lint:scripts && npm run -s lint:styles",
"lint:scripts": "lint:scripts": "cross-env NODE_ENV=development node_modules/eslint/bin/eslint.js \"assets/scripts/**/*.js\"",
"cross-env NODE_ENV=development node_modules/eslint/bin/eslint.js \"assets/scripts/*.js\"", "lint:styles": "cross-env NODE_ENV=development node_modules/stylelint/bin/stylelint.js \"assets/styles/**/*.scss\" --syntax scss",
"lint:styles": "test": "npm run -s lint"
"cross-env NODE_ENV=development node_modules/stylelint/bin/stylelint.js \"assets/styles/**/*.scss\" --syntax scss",
"test": "npm run -s lint",
"install": "npm run -s build:production"
}, },
"engines": { "engines": {
"node": ">= 6.9.4" "node": ">= 6.9.4"

10451
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save