The repo for Purrform's main BigCommerce store.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add read more links for health conditions in Diet Builder and update configuration files

+84 -56
+1 -1
.eslintignore
··· 1 1 /assets/js/bundle.js 2 2 /assets/dist 3 - config.json 4 3 stencil.conf.js 5 4 webpack.conf.js 5 + *.json
+4 -4
.eslintrc
··· 1 1 { 2 2 "parser": "babel-eslint", 3 3 "rules": { 4 - "indent": [ 5 - 2, 6 - 4 7 - ], 4 + "indent": [2, 4], 8 5 "no-alert": 0, 9 6 "consistent-return": 0, 7 + "function-paren-newline": 0, 10 8 "max-len": 0, 11 9 "import/first": 0, 12 10 "no-mixed-operators": 0, ··· 24 22 "prefer-destructuring": 0, 25 23 "import/no-named-as-default": 0, 26 24 "import/no-named-as-default-member": 0, 25 + "import/extensions": "off", 26 + "import/no-extraneous-dependencies": "off", 27 27 "import/prefer-default-export": "off" 28 28 }, 29 29 "globals": {
+3 -1
.prettierignore
··· 1 - *.html 1 + *.html 2 + .eslintrc 3 + stencil.config.cjs
+5 -1
assets/js/theme/custom/diet-builder.js
··· 113 113 'A chronic gastrointestinal condition caused by inflammation of the stomach or intestinal lining, resulting in vomiting, diarrhoea, weight loss, and reduced appetite.', 114 114 recommended: 115 115 'Plain rabbit, turkey, or quail are recommended due to their low allergenic potential. Chicken and beef may aggravate digestive inflammation in affected cats.', 116 + readMoreUrl: 117 + 'https://www.purrform.co.uk/blog/what-is-digestibility-and-why-is-it-so-important/', 116 118 }, 117 119 'Stage 1 CKD': { 118 120 explanation: ··· 127 129 'Conditions causing discomfort, pain, straining to urinate, or inappropriate urination, often influenced by hydration levels and urinary concentration.', 128 130 recommended: 129 131 'All Purrform products are naturally high in moisture, which helps support urinary health. Adding water to food can further increase fluid intake and help maintain healthy urine dilution.', 132 + readMoreUrl: 133 + 'https://www.purrform.co.uk/blog/-will-purrform-raw-diet-help-prevent-utis/', 130 134 }, 131 135 'Dental disease': { 132 136 explanation: ··· 149 153 recommended: 150 154 'Feeding lean, high-quality proteins can help promote healthy weight loss while maintaining muscle mass and supporting overall metabolic health.', 151 155 readMoreUrl: 152 - 'https://www.purrform.co.uk/blog/just-what-is-the-raw-meat-diet-anyway/', 156 + 'https://www.purrform.co.uk/blog/will-purrform-raw-diet-help-with-weight-loss/', 153 157 }, 154 158 }; 155 159
+1 -1
config.json
··· 1 1 { 2 - "name": "diet-builder - blog links", 2 + "name": "diet-builder - new links", 3 3 "version": "6.10.0", 4 4 "template_engine": "handlebars_v4", 5 5 "meta": {
+22 -23
stencil.conf.cjs
··· 1 - var webpack = require('webpack'); 1 + /* eslint-disable no-console */ 2 + 3 + const webpack = require('webpack'); 2 4 3 5 /** 4 6 * Watch options for the core watcher 5 7 * @type {{files: string[], ignored: string[]}} 6 8 */ 7 - var watchOptions = { 9 + const watchOptions = { 8 10 // If files in these directories change, reload the page. 9 - files: [ 10 - '/templates', 11 - '/lang', 12 - ], 11 + files: ['/templates', '/lang', '/assets/scss'], 13 12 14 - //Do not watch files in these directories 15 - ignored: [ 16 - '/assets/scss', 17 - '/assets/less', 18 - '/assets/css', 19 - '/assets/dist', 20 - ] 13 + // Do not watch files in these directories 14 + ignored: ['/assets/less', '/assets/css', '/assets/dist'], 21 15 }; 22 16 23 17 /** 24 18 * Watch any custom files and trigger a rebuild 25 19 */ 26 20 function development() { 27 - var devConfig = require('./webpack.dev.js'); 21 + const devConfig = require('./webpack.dev.js'); 28 22 29 23 // Rebuild the bundle once at bootup 30 24 webpack(devConfig).watch({}, (err, stats) => { ··· 33 27 } 34 28 35 29 if (stats.hasErrors()) { 36 - console.error(stats.toString({ all: false, errors: true, colors: true })); 30 + console.error( 31 + stats.toString({ all: false, errors: true, colors: true }), 32 + ); 37 33 } 38 34 39 35 if (stats.hasWarnings()) { 40 - console.error(stats.toString({ all: false, warnings: true, colors: true })); 36 + console.warn( 37 + stats.toString({ all: false, warnings: true, colors: true }), 38 + ); 41 39 } 42 40 43 41 process.send('reload'); ··· 48 46 * Hook into the `stencil bundle` command and build your files before they are packaged as a .zip 49 47 */ 50 48 function production() { 51 - var prodConfig = require('./webpack.prod.js'); 49 + const prodConfig = require('./webpack.prod.js'); 52 50 53 51 webpack(prodConfig).run((err, stats) => { 54 52 if (err) { 55 53 console.error(err.message, err.details); 56 54 process.exit(1); 57 - return; 58 55 } 59 - 60 56 if (stats.hasErrors()) { 61 - console.error(stats.toString({ all: false, errors: true, colors: true })); 57 + console.error( 58 + stats.toString({ all: false, errors: true, colors: true }), 59 + ); 62 60 process.exit(1); 63 - return; 64 61 } 65 62 66 63 if (stats.hasWarnings()) { 67 - console.error(stats.toString({ all: false, warnings: true, colors: true })); 64 + console.warn( 65 + stats.toString({ all: false, warnings: true, colors: true }), 66 + ); 68 67 } 69 68 70 69 process.send('done'); ··· 73 72 74 73 if (process.send) { 75 74 // running as a forked worker 76 - process.on('message', message => { 75 + process.on('message', (message) => { 77 76 if (message === 'development') { 78 77 development(); 79 78 }
+41 -21
webpack.common.js
··· 1 - const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin, 2 - { CleanWebpackPlugin } = require('clean-webpack-plugin'), 3 - LodashPlugin = require('lodash-webpack-plugin'), 4 - path = require('path'), 5 - webpack = require('webpack'); 1 + const BundleAnalyzerPlugin = 2 + require('webpack-bundle-analyzer').BundleAnalyzerPlugin; 3 + const { CleanWebpackPlugin } = require('clean-webpack-plugin'); 4 + const LodashPlugin = require('lodash-webpack-plugin'); 5 + const path = require('path'); 6 + const webpack = require('webpack'); 6 7 7 8 // Common configuration, with extensions in webpack.dev.js and webpack.prod.js. 8 9 module.exports = { ··· 27 28 'lodash', // Tree-shake lodash 28 29 ], 29 30 presets: [ 30 - ['@babel/preset-env', { 31 - loose: true, // Enable "loose" transformations for any plugins in this preset that allow them 32 - modules: false, // Don't transform modules; needed for tree-shaking 33 - useBuiltIns: 'entry', 34 - corejs: '^3.6.5', 35 - }], 31 + [ 32 + '@babel/preset-env', 33 + { 34 + loose: true, // Enable "loose" transformations for any plugins in this preset that allow them 35 + modules: false, // Don't transform modules; needed for tree-shaking 36 + useBuiltIns: 'entry', 37 + corejs: '^3.6.5', 38 + }, 39 + ], 36 40 ], 37 41 }, 38 42 }, 39 43 }, 40 44 { 41 - test: require.resolve("jquery"), 42 - loader: "expose-loader", 45 + test: require.resolve('jquery'), 46 + loader: 'expose-loader', 43 47 options: { 44 - exposes: ["$"], 48 + exposes: ['$'], 45 49 }, 46 50 }, 47 51 ], ··· 63 67 watch: false, 64 68 }), 65 69 new LodashPlugin(), // Complements babel-plugin-lodash by shrinking its cherry-picked builds further. 66 - new webpack.ProvidePlugin({ // Provide jquery automatically without explicit import 70 + new webpack.ProvidePlugin({ 71 + // Provide jquery automatically without explicit import 67 72 $: 'jquery', 68 73 jQuery: 'jquery', 69 74 'window.jQuery': 'jquery', ··· 74 79 }), 75 80 ], 76 81 resolve: { 77 - fallback: { "url": require.resolve("url/") }, 82 + fallback: { url: require.resolve('url/') }, 78 83 alias: { 79 - jquery: path.resolve(__dirname, 'node_modules/jquery/dist/jquery.min.js'), 80 - jstree: path.resolve(__dirname, 'node_modules/jstree/dist/jstree.min.js'), 81 - lazysizes: path.resolve(__dirname, 'node_modules/lazysizes/lazysizes.min.js'), 82 - 'slick-carousel': path.resolve(__dirname, 'node_modules/slick-carousel/slick/slick.min.js'), 83 - 'svg-injector': path.resolve(__dirname, 'node_modules/svg-injector/dist/svg-injector.min.js'), 84 + jquery: path.resolve( 85 + __dirname, 86 + 'node_modules/jquery/dist/jquery.min.js', 87 + ), 88 + jstree: path.resolve( 89 + __dirname, 90 + 'node_modules/jstree/dist/jstree.min.js', 91 + ), 92 + lazysizes: path.resolve( 93 + __dirname, 94 + 'node_modules/lazysizes/lazysizes.min.js', 95 + ), 96 + 'slick-carousel': path.resolve( 97 + __dirname, 98 + 'node_modules/slick-carousel/slick/slick.min.js', 99 + ), 100 + 'svg-injector': path.resolve( 101 + __dirname, 102 + 'node_modules/svg-injector/dist/svg-injector.min.js', 103 + ), 84 104 }, 85 105 }, 86 106 };
+2 -2
webpack.dev.js
··· 1 - const { merge } = require('webpack-merge'), 2 - commonConfig = require('./webpack.common.js'); 1 + const { merge } = require('webpack-merge'); 2 + const commonConfig = require('./webpack.common.js'); 3 3 4 4 module.exports = merge(commonConfig, { 5 5 devtool: 'inline-source-map',
+5 -2
webpack.prod.js
··· 1 - const { merge } = require('webpack-merge'), 2 - commonConfig = require('./webpack.common.js'); 1 + const { merge } = require('webpack-merge'); 2 + const commonConfig = require('./webpack.common.js'); 3 3 4 4 module.exports = merge(commonConfig, { 5 5 devtool: 'source-map', 6 6 mode: 'production', 7 7 optimization: { 8 8 emitOnErrors: false, 9 + }, 10 + performance: { 11 + hints: 'warning', 9 12 }, 10 13 });