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. 14
      dist/mix-manifest.json
  4. 2
      dist/scripts/aldine.js
  5. 2
      dist/scripts/call-to-action.js
  6. 2
      dist/scripts/catalog-admin.js
  7. 2
      dist/scripts/customizer.js
  8. 2
      dist/scripts/page-section.js
  9. 2
      dist/styles/aldine.css
  10. 2
      dist/styles/editor.css
  11. 8305
      package-lock.json
  12. 43
      package.json
  13. 10451
      yarn.lock

14
.travis.yml

@ -28,17 +28,15 @@ cache:
before_install:
- composer self-update
- 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:
- node -v && yarn -V
- travis_retry yarn
- node -v
- npm install
- composer install -o --prefer-dist --no-interaction
script:
- yarn run test
- yarn run build
- yarn run rmdist
- yarn run "build:production"
- npm run test
- npm run build
- npm run rmdist
- npm run "build:production"
- composer test
before_deploy:
- export TRAVIS_PROJECT_SLUG="$(basename $TRAVIS_BUILD_DIR)"

6
assets/scripts/customizer.js

@ -1,9 +1,7 @@
import $ from 'jquery';
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 => {
value.bind( to => $( '.home .entry-description' ).text( to ) );
value.bind( to => document.querySelector( '.home .entry-description' ).textContent = to );
} );

14
dist/mix-manifest.json vendored

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

8305
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",
"author": "Pressbooks (Book Oven Inc.) <code@pressbooks.com>",
"homepage": "https://github.com/pressbooks/pressbooks-aldine/",
"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.",
"keywords": ["publishing", "catalog", "pressbooks", "default-theme"],
"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.",
"keywords": [
"publishing",
"catalog",
"pressbooks",
"default-theme"
],
"private": true,
"repository": {
"type": "git",
@ -17,11 +21,14 @@
"licenses": [
{
"type": "GPL-3.0-or-later",
"url":
"https://github.com/pressbooks/pressbooks-aldine/tree/master/LICENSE.md"
"url": "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": {
"extends": "./node_modules/pressbooks-build-tools/config/eslint.js",
"globals": {
@ -31,26 +38,22 @@
"tinymce": true
}
},
"eslintIgnore": [
"assets/scripts/catalog-admin.js"
],
"stylelint": {
"extends": "./node_modules/pressbooks-build-tools/config/stylelint.js"
},
"scripts": {
"build":
"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: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",
"build": "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: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",
"lint": "npm run -s lint:scripts && npm run -s lint:styles",
"lint:scripts":
"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",
"test": "npm run -s lint",
"install": "npm run -s build:production"
"lint:scripts": "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",
"test": "npm run -s lint"
},
"engines": {
"node": ">= 6.9.4"

10451
yarn.lock

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