gscan 4.26.1 → 4.29.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.
package/lib/specs/v4.js CHANGED
@@ -24,7 +24,7 @@ function cssCardRule(cardName, className) {
24
24
  }
25
25
 
26
26
  // assign new or overwrite existing knownHelpers, templates, or rules here:
27
- let knownHelpers = ['match'];
27
+ let knownHelpers = ['match', 'tiers'];
28
28
  let templates = [];
29
29
  let rules = {
30
30
  // New rules
@@ -149,7 +149,7 @@ let rules = {
149
149
  },
150
150
  'GS001-DEPR-SITE-LANG': {
151
151
  level: 'warning',
152
- rule: 'The <code>{{@site.lang}}</code> helper should be replaced with <code>{{@site.locale}}</code>',
152
+ rule: 'Replace <code>{{@site.lang}}</code> with <code>{{@site.locale}}</code>',
153
153
  details: oneLineTrim`Replace <code>{{@site.lang}}</code> helper with <code>{{@site.locale}}</code>.<br>
154
154
  The <code>{{@site.lang}}</code> helper will be removed in next version of Ghost and should not be used.
155
155
  Find more information about the <code>@site</code> property <a href="${docsBaseUrl}helpers/site/" target=_blank>here</a>.`,
@@ -182,7 +182,7 @@ let rules = {
182
182
  },
183
183
  'GS090-NO-PRODUCTS-HELPER': {
184
184
  level: 'warning',
185
- rule: 'The <code>{{products}}</code> helper should be replaces with <code>{{tiers}}</code>',
185
+ rule: 'Replace <code>{{products}}</code> with <code>{{tiers}}</code>',
186
186
  details: oneLineTrim`The <code>{{products}}</code> helper has been deprecated in favor of <code>{{tiers}}</code><br>
187
187
  The <code>{{products}}</code> helper will be removed in Ghost v5 and should not be used.
188
188
  Find more information about the <code>{{tiers}}</code> property <a href="${docsBaseUrl}helpers/tiers/" target=_blank>here</a>.`,
@@ -190,7 +190,7 @@ let rules = {
190
190
  },
191
191
  'GS090-NO-PRODUCT-DATA-HELPER': {
192
192
  level: 'warning',
193
- rule: 'The <code>{{@product}}</code> data helper should be replaces with <code>{{#get "tiers"}}</code>',
193
+ rule: 'Replace <code>{{@product}}</code> 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
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>.`,
@@ -198,7 +198,7 @@ let rules = {
198
198
  },
199
199
  'GS090-NO-PRODUCTS-DATA-HELPER': {
200
200
  level: 'warning',
201
- rule: 'The <code>{{@products}}</code> data helper should be replaces with <code>{{#get "tiers"}}</code>',
201
+ rule: 'Replace <code>{{@products}}</code> 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
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>.`,
@@ -331,5 +331,6 @@ rules = _.each(rules, function replaceDocsUrl(value) {
331
331
  module.exports = {
332
332
  knownHelpers: knownHelpers,
333
333
  templates: templates,
334
- rules: rules
334
+ rules: rules,
335
+ defaultPackageJSON: previousSpec.defaultPackageJSON
335
336
  };
@@ -1,22 +1,13 @@
1
- /**
2
- * Copy of Ghost defaults for https://github.com/TryGhost/Ghost/blob/e25f1df0ae551c447da0d319bae06eadf9665444/core/frontend/services/theme-engine/config/defaults.json
3
- */
4
- const defaultConfig = {
5
- posts_per_page: 5,
6
- card_assets: {
7
- exclude: ['bookmark', 'gallery']
8
- }
9
- };
10
-
11
1
  /**
12
2
  * Extracts the package.json JSON content. Note that this function never throws,
13
3
  * even when there is a JSON parsing error.
14
4
  * This function uses the default `config` property to match Ghost implementation.
15
5
  * @param {Object} theme The theme to extract package.json from.
6
+ * @param {Object} defaultConfig JSON matching the default theme configuration for the checked Ghost version
16
7
  * @returns {Object} The content of the package.json file, or `null` if
17
8
  * something happened (no file, JSON parsing error...).
18
9
  */
19
- function getJSON(theme) {
10
+ function getJSON(theme, defaultConfig) {
20
11
  let packageJSON = theme.files.find(item => item.file === 'package.json');
21
12
  if (packageJSON && packageJSON.content) {
22
13
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "4.26.1",
3
+ "version": "4.29.0",
4
4
  "description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
5
5
  "keywords": [
6
6
  "ghost",
@@ -14,7 +14,7 @@
14
14
  "url": "git@github.com:TryGhost/gscan.git"
15
15
  },
16
16
  "engines": {
17
- "node": "^12.22.1 || ^14.17.0 || ^16.13.0"
17
+ "node": "^14.17.0 || ^16.13.0"
18
18
  },
19
19
  "bugs": {
20
20
  "url": "https://github.com/TryGhost/gscan/issues"
@@ -40,26 +40,26 @@
40
40
  "gscan": "./bin/cli.js"
41
41
  },
42
42
  "dependencies": {
43
- "@sentry/node": "6.19.3",
43
+ "@sentry/node": "6.19.7",
44
44
  "@tryghost/config": "0.2.2",
45
45
  "@tryghost/debug": "0.1.11",
46
- "@tryghost/errors": "1.2.7",
47
- "@tryghost/logging": "2.1.2",
48
- "@tryghost/pretty-cli": "1.2.24",
46
+ "@tryghost/errors": "1.2.12",
47
+ "@tryghost/logging": "2.1.8",
48
+ "@tryghost/pretty-cli": "1.2.27",
49
49
  "@tryghost/server": "0.1.4",
50
- "@tryghost/zip": "1.1.22",
50
+ "@tryghost/zip": "1.1.25",
51
51
  "bluebird": "3.7.2",
52
52
  "chalk": "4.1.2",
53
53
  "common-tags": "1.8.2",
54
- "express": "4.17.3",
54
+ "express": "4.18.1",
55
55
  "express-hbs": "2.4.0",
56
- "fs-extra": "10.0.1",
57
- "glob": "7.2.0",
56
+ "fs-extra": "10.1.0",
57
+ "glob": "7.2.3",
58
58
  "lodash": "4.17.21",
59
59
  "multer": "1.4.4",
60
60
  "pluralize": "8.0.0",
61
61
  "require-dir": "1.2.0",
62
- "semver": "7.3.5",
62
+ "semver": "7.3.7",
63
63
  "uuid": "8.3.2",
64
64
  "validator": "13.0.0"
65
65
  },
@@ -67,11 +67,11 @@
67
67
  "eslint": "8.1.0",
68
68
  "eslint-plugin-ghost": "2.1.0",
69
69
  "istanbul": "0.4.5",
70
- "mocha": "9.0.2",
70
+ "mocha": "10.0.0",
71
71
  "nodemon": "2.0.7",
72
72
  "rewire": "6.0.0",
73
73
  "should": "13.2.3",
74
- "sinon": "13.0.0"
74
+ "sinon": "14.0.0"
75
75
  },
76
76
  "files": [
77
77
  "lib",