gscan 4.10.2 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  const _ = require('lodash');
2
2
  const spec = require('../specs');
3
3
  const versions = require('../utils').versions;
4
+ const {getPackageJSON} = require('../utils');
4
5
 
5
6
  const checkKoenigCssClasses = function checkKoenigCssClasses(theme, options) {
6
7
  const checkVersion = _.get(options, 'checkVersion', versions.default);
@@ -9,8 +10,13 @@ const checkKoenigCssClasses = function checkKoenigCssClasses(theme, options) {
9
10
  // CASE: 050-koenig-css-classes checks only needs `rules` that start with `GS050-`
10
11
  const ruleRegex = /GS050-.*/g;
11
12
 
13
+ // Following the introduction of card assets, we disable certain rules
14
+ // when it's enabled by the theme.
15
+ const packageJson = getPackageJSON(theme);
16
+ const cardAssetsEnabled = packageJson && packageJson.config && packageJson.config.card_assets === true;
17
+
12
18
  ruleSet = _.pickBy(ruleSet.rules, function (rule, ruleCode) {
13
- if (ruleCode.match(ruleRegex)) {
19
+ if (ruleCode.match(ruleRegex) && (!cardAssetsEnabled || !rule.cardAsset)) {
14
20
  return rule;
15
21
  }
16
22
  });
package/lib/specs/v2.js CHANGED
@@ -451,7 +451,8 @@ let rules = {
451
451
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#image-size-implementations" target=_blank>here</a>.`,
452
452
  regex: /\.kg-width-wide/g,
453
453
  className: '.kg-width-wide',
454
- css: true
454
+ css: true,
455
+ cardAsset: true
455
456
  },
456
457
  'GS050-CSS-KGWF': {
457
458
  level: 'error',
@@ -460,7 +461,8 @@ let rules = {
460
461
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#image-size-implementations" target=_blank>here</a>.`,
461
462
  regex: /\.kg-width-full/g,
462
463
  className: '.kg-width-full',
463
- css: true
464
+ css: true,
465
+ cardAsset: true
464
466
  },
465
467
  'GS050-CSS-KGGC': {
466
468
  level: 'error',
@@ -469,7 +471,8 @@ let rules = {
469
471
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#gallery-card" target=_blank>here</a>.`,
470
472
  regex: /\.kg-gallery-container/g,
471
473
  className: '.kg-gallery-container',
472
- css: true
474
+ css: true,
475
+ cardAsset: true
473
476
  },
474
477
  'GS050-CSS-KGGR': {
475
478
  level: 'error',
@@ -478,7 +481,8 @@ let rules = {
478
481
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#gallery-card" target=_blank>here</a>.`,
479
482
  regex: /\.kg-gallery-row/g,
480
483
  className: '.kg-gallery-row',
481
- css: true
484
+ css: true,
485
+ cardAsset: true
482
486
  },
483
487
  'GS050-CSS-KGGI': {
484
488
  level: 'error',
@@ -487,7 +491,8 @@ let rules = {
487
491
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#gallery-card" target=_blank>here</a>.`,
488
492
  regex: /\.kg-gallery-image/g,
489
493
  className: '.kg-gallery-image',
490
- css: true
494
+ css: true,
495
+ cardAsset: true
491
496
  },
492
497
  'GS050-CSS-KGBM': {
493
498
  level: 'error',
@@ -496,7 +501,8 @@ let rules = {
496
501
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
497
502
  regex: /\.kg-bookmark-card/g,
498
503
  className: '.kg-bookmark-card',
499
- css: true
504
+ css: true,
505
+ cardAsset: true
500
506
  },
501
507
  'GS050-CSS-KGBMCO': {
502
508
  level: 'error',
@@ -505,7 +511,8 @@ let rules = {
505
511
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
506
512
  regex: /\.kg-bookmark-container/g,
507
513
  className: '.kg-bookmark-container',
508
- css: true
514
+ css: true,
515
+ cardAsset: true
509
516
  },
510
517
  'GS050-CSS-KGBMCON': {
511
518
  level: 'error',
@@ -514,7 +521,8 @@ let rules = {
514
521
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
515
522
  regex: /\.kg-bookmark-content/g,
516
523
  className: '.kg-bookmark-content',
517
- css: true
524
+ css: true,
525
+ cardAsset: true
518
526
  },
519
527
  'GS050-CSS-KGBMTI': {
520
528
  level: 'error',
@@ -523,7 +531,8 @@ let rules = {
523
531
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
524
532
  regex: /\.kg-bookmark-title/g,
525
533
  className: '.kg-bookmark-title',
526
- css: true
534
+ css: true,
535
+ cardAsset: true
527
536
  },
528
537
  'GS050-CSS-KGBMDE': {
529
538
  level: 'error',
@@ -532,7 +541,8 @@ let rules = {
532
541
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
533
542
  regex: /\.kg-bookmark-description/g,
534
543
  className: '.kg-bookmark-description',
535
- css: true
544
+ css: true,
545
+ cardAsset: true
536
546
  },
537
547
  'GS050-CSS-KGBMME': {
538
548
  level: 'error',
@@ -541,7 +551,8 @@ let rules = {
541
551
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
542
552
  regex: /\.kg-bookmark-metadata/g,
543
553
  className: '.kg-bookmark-metadata',
544
- css: true
554
+ css: true,
555
+ cardAsset: true
545
556
  },
546
557
  'GS050-CSS-KGBMIC': {
547
558
  level: 'error',
@@ -550,7 +561,8 @@ let rules = {
550
561
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
551
562
  regex: /\.kg-bookmark-icon/g,
552
563
  className: '.kg-bookmark-icon',
553
- css: true
564
+ css: true,
565
+ cardAsset: true
554
566
  },
555
567
  'GS050-CSS-KGBMAU': {
556
568
  level: 'error',
@@ -559,7 +571,8 @@ let rules = {
559
571
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
560
572
  regex: /\.kg-bookmark-author/g,
561
573
  className: '.kg-bookmark-author',
562
- css: true
574
+ css: true,
575
+ cardAsset: true
563
576
  },
564
577
  'GS050-CSS-KGBMPU': {
565
578
  level: 'error',
@@ -568,7 +581,8 @@ let rules = {
568
581
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
569
582
  regex: /\.kg-bookmark-publisher/g,
570
583
  className: '.kg-bookmark-publisher',
571
- css: true
584
+ css: true,
585
+ cardAsset: true
572
586
  },
573
587
  'GS050-CSS-KGBMTH': {
574
588
  level: 'error',
@@ -577,7 +591,8 @@ let rules = {
577
591
  Find out more about required theme changes for the Koenig editor <a href="${docsBaseUrl}editor/#bookmark-card" target=_blank>here</a>.`,
578
592
  regex: /\.kg-bookmark-thumbnail/g,
579
593
  className: '.kg-bookmark-thumbnail',
580
- css: true
594
+ css: true,
595
+ cardAsset: true
581
596
  },
582
597
  // Updated v1 rules
583
598
  'GS001-DEPR-AC': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "4.10.2",
3
+ "version": "4.11.0",
4
4
  "description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
5
5
  "keywords": [
6
6
  "ghost",
@@ -44,13 +44,13 @@
44
44
  "@tryghost/config": "0.2.0",
45
45
  "@tryghost/debug": "0.1.9",
46
46
  "@tryghost/ignition-errors": "0.1.8",
47
- "@tryghost/logging": "1.0.0",
47
+ "@tryghost/logging": "1.0.1",
48
48
  "@tryghost/pretty-cli": "1.2.22",
49
49
  "@tryghost/server": "0.1.0",
50
50
  "@tryghost/zip": "1.1.18",
51
51
  "bluebird": "3.7.2",
52
52
  "chalk": "4.1.2",
53
- "common-tags": "1.8.1",
53
+ "common-tags": "1.8.2",
54
54
  "express": "4.17.1",
55
55
  "express-hbs": "2.4.0",
56
56
  "fs-extra": "9.1.0",