gscan 4.25.0 → 4.25.3

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.
package/app/index.js CHANGED
@@ -4,7 +4,7 @@ const hbs = require('express-hbs');
4
4
  const multer = require('multer');
5
5
  const server = require('@tryghost/server');
6
6
  const config = require('@tryghost/config');
7
- const errors = require('@tryghost/ignition-errors');
7
+ const errors = require('@tryghost/errors');
8
8
  const gscan = require('../lib');
9
9
  const fs = require('fs-extra');
10
10
  const logRequest = require('./middlewares/log-request');
@@ -1,7 +1,7 @@
1
1
  // NOTE: this middleware was extracted from Ghost core validation for theme uploads
2
2
  // might be useful to unify this logic in the future if it's extracted to separate module
3
3
  const path = require('path');
4
- const errors = require('@tryghost/ignition-errors');
4
+ const errors = require('@tryghost/errors');
5
5
 
6
6
  const checkFileExists = function checkFileExists(fileData) {
7
7
  return !!(fileData.mimetype && fileData.path);
package/lib/checker.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const Promise = require('bluebird');
2
2
  const _ = require('lodash');
3
3
  const requireDir = require('require-dir');
4
- const errors = require('@tryghost/ignition-errors');
4
+ const errors = require('@tryghost/errors');
5
5
  const versions = require('./utils').versions;
6
6
 
7
7
  // An object containing helpers as keys and their labs flag as values
@@ -92,7 +92,7 @@ const checkZip = async function checkZip(path, options) {
92
92
  return theme;
93
93
  }
94
94
  } catch (error) {
95
- if (!errors.utils.isIgnitionError(error)) {
95
+ if (!errors.utils.isGhostError(error)) {
96
96
  throw new errors.ValidationError({
97
97
  message: 'Failed to check zip file',
98
98
  help: 'Your zip file might be corrupted, try unzipping and zipping again.',
package/lib/read-zip.js CHANGED
@@ -4,7 +4,7 @@ const Promise = require('bluebird');
4
4
  const os = require('os');
5
5
  const glob = require('glob');
6
6
  const {extract} = require('@tryghost/zip');
7
- const errors = require('@tryghost/ignition-errors');
7
+ const errors = require('@tryghost/errors');
8
8
  const uuid = require('uuid');
9
9
  const _ = require('lodash');
10
10
 
@@ -8,7 +8,7 @@ const prevDocsBaseUrlRegEx = new RegExp(prevDocsBaseUrl, 'g');
8
8
 
9
9
  const previousKnownHelpers = previousSpec.knownHelpers;
10
10
  const previousTemplates = previousSpec.templates;
11
- const previousRules = previousSpec.rules;
11
+ const previousRules = _.cloneDeep(previousSpec.rules);
12
12
 
13
13
  // assign new or overwrite existing knownHelpers, templates, or rules here:
14
14
  let knownHelpers = [];
package/lib/specs/v4.js CHANGED
@@ -8,7 +8,7 @@ const prevDocsBaseUrlRegEx = new RegExp(prevDocsBaseUrl, 'g');
8
8
 
9
9
  const previousKnownHelpers = previousSpec.knownHelpers;
10
10
  const previousTemplates = previousSpec.templates;
11
- const previousRules = previousSpec.rules;
11
+ const previousRules = _.cloneDeep(previousSpec.rules);
12
12
 
13
13
  function cssCardRule(cardName, className) {
14
14
  return {
@@ -192,7 +192,7 @@ let rules = {
192
192
  level: 'warning',
193
193
  rule: 'The <code>{{@product}}</code> data helper should be replaces with <code>{{#get "tiers"}}</code>',
194
194
  details: oneLineTrim`The <code>{{@product}}</code> data helper has been deprecated in favor of <code>{{#get "tiers"}}</code><br>
195
- The <code>{{@product}}</code> data helper was removed in Ghost v5 and should not be used.
195
+ The <code>{{@product}}</code> data helper will be removed in Ghost v5 and should not be used.
196
196
  Find more information about the <code>{{#get "tiers"}}</code> property <a href="${docsBaseUrl}helpers/tiers/" target=_blank>here</a>.`,
197
197
  helper: '{{@product}}'
198
198
  },
@@ -200,7 +200,7 @@ let rules = {
200
200
  level: 'warning',
201
201
  rule: 'The <code>{{@products}}</code> data helper should be replaces with <code>{{#get "tiers"}}</code>',
202
202
  details: oneLineTrim`The <code>{{@products}}</code> data helper has been deprecated in favor of <code>{{#get "tiers"}}</code><br>
203
- The <code>{{@products}}</code> data helper was removed in Ghost v5 and should not be used.
203
+ The <code>{{@products}}</code> data helper will be removed in Ghost v5 and should not be used.
204
204
  Find more information about the <code>{{#get "tiers"}}</code> property <a href="${docsBaseUrl}helpers/tiers/" target=_blank>here</a>.`,
205
205
  helper: '{{@products}}'
206
206
  },
@@ -320,7 +320,11 @@ templates = _.union(previousTemplates, templates);
320
320
  // as well as adding any new rule to the spec.
321
321
  // Furthermore, replace the usage of the old doc URLs that we're linking to, with the
322
322
  // new version.
323
- rules = _.each(_.merge({}, previousRules, rules), function replaceDocsUrl(value) {
323
+ delete previousRules['GS002-DISQUS-ID'];
324
+ delete previousRules['GS002-ID-HELPER'];
325
+
326
+ rules = _.merge({}, previousRules, rules);
327
+ rules = _.each(rules, function replaceDocsUrl(value) {
324
328
  value.details = value.details.replace(prevDocsBaseUrlRegEx, docsBaseUrl);
325
329
  });
326
330
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "4.25.0",
3
+ "version": "4.25.3",
4
4
  "description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
5
5
  "keywords": [
6
6
  "ghost",
@@ -43,11 +43,11 @@
43
43
  "@sentry/node": "6.19.2",
44
44
  "@tryghost/config": "0.2.2",
45
45
  "@tryghost/debug": "0.1.11",
46
- "@tryghost/ignition-errors": "0.1.8",
47
- "@tryghost/logging": "2.1.0",
46
+ "@tryghost/errors": "1.2.7",
47
+ "@tryghost/logging": "2.1.1",
48
48
  "@tryghost/pretty-cli": "1.2.24",
49
49
  "@tryghost/server": "0.1.4",
50
- "@tryghost/zip": "1.1.20",
50
+ "@tryghost/zip": "1.1.22",
51
51
  "bluebird": "3.7.2",
52
52
  "chalk": "4.1.2",
53
53
  "common-tags": "1.8.2",