gscan 4.30.0 → 4.31.2

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.
@@ -17,9 +17,9 @@ const checkDeprecations = function checkDeprecations(theme, options) {
17
17
 
18
18
  _.each(ruleSet, function (check, ruleCode) {
19
19
  _.each(theme.files, function (themeFile) {
20
- const template = themeFile.file.match(/[^/\\]+\.hbs$/);
20
+ const template = themeFile.file.match(/^.+\.hbs$/);
21
21
  const skipTemplateCheck = check.notValidIn && check.notValidIn.match(template);
22
- let css = themeFile.file.match(/\.css/);
22
+ let css = themeFile.file.match(/\.css$/);
23
23
  let cssDeprecations;
24
24
 
25
25
  if (template && !check.css && !skipTemplateCheck) {
@@ -16,7 +16,7 @@ const checkCommentID = function checkCommentID(theme, options) {
16
16
  });
17
17
  _.each(ruleSet, function (check, ruleCode) {
18
18
  _.each(theme.files, function (themeFile) {
19
- var template = themeFile.file.match(/[^/\\]+.hbs$/);
19
+ var template = themeFile.file.match(/\.hbs$/);
20
20
 
21
21
  if (template) {
22
22
  if (themeFile.content.match(check.regex)) {
@@ -114,7 +114,7 @@ const checkTemplatesCompile = function checkTemplatesCompile(theme, options) {
114
114
  });
115
115
 
116
116
  _.each(theme.files, function (themeFile) {
117
- let templateTest = themeFile.file.match(/^[^/\\]+.hbs$/);
117
+ let templateTest = themeFile.file.match(/(?<!partials\/.+?)\.hbs$/);
118
118
 
119
119
  if (templateTest) {
120
120
  processFile(linter, themeFile);
@@ -17,7 +17,7 @@ module.exports = function checkUsage(theme, options) {
17
17
  });
18
18
  _.each(ruleSet, function (check, ruleCode) {
19
19
  _.each(theme.files, function (themeFile) {
20
- var template = themeFile.file.match(/[^/\\]+.hbs$/);
20
+ var template = themeFile.file.match(/\.hbs$/);
21
21
  const validApi = check.validInAPI ? check.validInAPI.includes(targetApiVersion) : true;
22
22
  if (template) {
23
23
  if (validApi && themeFile.content.match(check.regex)) {
@@ -78,7 +78,7 @@ const checkTemplatesCompile = function checkTemplatesCompile(theme, options) {
78
78
  });
79
79
 
80
80
  _.each(theme.files, function (themeFile) {
81
- let templateTest = themeFile.file.match(/^[^/\\]+.hbs$/);
81
+ let templateTest = themeFile.file.match(/(?<!partials\/.+?)\.hbs$/);
82
82
 
83
83
  if (templateTest) {
84
84
  processFile(linter, themeFile);
@@ -123,7 +123,7 @@ const ruleImplementations = {
123
123
  result.customThemeSettings = new Set();
124
124
  },
125
125
  eachFile: ({file, theme, log, result}) => {
126
- let templateTest = file.file.match(/^[^/\\]+.hbs$/);
126
+ let templateTest = file.file.match(/(?<!partials\/.+?)\.hbs$/);
127
127
 
128
128
  if (templateTest) {
129
129
  parseWithAST({file, theme, rules: {
package/lib/read-zip.js CHANGED
@@ -15,7 +15,7 @@ const resolveBaseDir = (zipPath) => {
15
15
 
16
16
  if (!err && !_.isEmpty(matches)) {
17
17
  debug('Found matches', matches);
18
- matchedPath = matches[0].replace(/index.hbs$/, '');
18
+ matchedPath = matches[0].replace(/index\.hbs$/, '');
19
19
  zipPath = path.join(zipPath, matchedPath).replace(/\/$/, '');
20
20
  }
21
21
 
@@ -27,8 +27,8 @@ let rules = {
27
27
  },
28
28
  'GS010-PJ-GHOST-CARD-ASSETS-NOT-PRESENT': {
29
29
  level: 'warning',
30
- rule: '<code>"card_assets"</code> will default to <code>true</code> in <code>package.json</code>',
31
- details: oneLineTrim`The <code>"card_assets"</code> property is enabled by default if not explicitly set.<br>
30
+ rule: '<code>"card_assets"</code> will now be included by default, including bookmark and gallery cards.',
31
+ details: oneLineTrim`The <code>"card_assets"</code> property is enabled by default and set to <code>true</code> (include all) if not explicitly set.<br>
32
32
  Find more information about the <code>card_assets</code> property <a href="${docsBaseUrl}content/#editor-cards" target=_blank>here</a>.`
33
33
  },
34
34
  'GS090-NO-AUTHOR-HELPER-IN-POST-CONTEXT': {
@@ -78,10 +78,10 @@ let rules = {
78
78
  'GS090-NO-PRICE-DATA-CURRENCY-GLOBAL': {
79
79
  level: 'error',
80
80
  fatal: true,
81
- rule: 'Replace <code>@price.currency</code> with <code>{{#get "tiers"}}</code> and <code>{{currency}}</code> or <code>{{#foreach @member.subscriptions}}</code> and <code>{{plan.currency}}</code>',
81
+ rule: 'Replace <code>{{@price.currency}}</code> with <code>{{#get "tiers"}}</code> and <code>{{currency}}</code> or <code>{{#foreach @member.subscriptions}}</code> and <code>{{plan.currency}}</code>',
82
82
  details: oneLineTrim`There is no longer a global <code>@price</code> object. You need to use either <code>{{#get "tiers"}}</code> to fetch all tiers and use the <code>{{currency}}</code> property of a tier<br>
83
83
  or use <code>{{#foreach @member.subscriptions}}</code> to fetch an individual member's subscriptions, and use the <code>{{plan.currency}}</code> property from the subscription.<br>
84
- Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}members/price/" target=_blank>here</a>.`
84
+ Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}helpers/price/" target=_blank>here</a>.`
85
85
  },
86
86
  'GS090-NO-PRICE-DATA-CURRENCY-CONTEXT': {
87
87
  level: 'error',
@@ -89,13 +89,13 @@ let rules = {
89
89
  rule: 'Replace <code>{{@price.currency}}</code> with <code>{{currency}}</code> or <code>{{plan.currency}}</code>',
90
90
  details: oneLineTrim`There is no longer a global <code>@price</code> object. Instead the <code>{{currency}}</code> property can be used inside <code>{{#get "tiers"}}</code><br>
91
91
  or <code>{{plan.currency}}</code> can be used inside <code>{{#foreach @member.subscriptions}}</code><br>
92
- Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}members/price/" target=_blank>here</a>.`
92
+ Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}helpers/price/" target=_blank>here</a>.`
93
93
  },
94
94
  'GS090-NO-PRICE-DATA-MONTHLY-YEARLY': {
95
95
  level: 'error',
96
96
  fatal: true,
97
- rule: 'Replace <code>{{@price.monthly}}</code> and <code>{{@price.yearly}}</code> with <code>{{#get "tiers"}}</code> and <code>{{monthly_price}}</code> or <code>{{yearly_price}}</code>',
98
- details: oneLineTrim`There is no longer a global <code>@price</code> object. You need to use <code>{{#get "tiers"}}</code> to fetch all the tiers and get access to the <code>{{monthly_price}}</code> or <code>{{yearly_price}}</code> for each tier<br>
97
+ rule: 'Replace <code>{{@price.monthly}}</code> and <code>{{@price.yearly}}</code> with <code>{{price monthly_price currency=currency}}</code> and <code>{{price yearly_price currency=currency}}</code> after fetching tier data with <code>{{#get "tiers"}}</code>',
98
+ details: oneLineTrim`There is no longer a global <code>@price</code> object. You need to use <code>{{#get "tiers"}}</code> to fetch all the tiers and get access to the <code>{{price monthly_price currency=currency}}</code> or <code>{{price yearly_price currency=currency}}</code> for each tier<br>
99
99
  Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}helpers/price/" target=_blank>here</a>.`
100
100
  },
101
101
  'GS090-NO-TIER-PRICE-AS-OBJECT': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "4.30.0",
3
+ "version": "4.31.2",
4
4
  "description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
5
5
  "keywords": [
6
6
  "ghost",
@@ -41,13 +41,13 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@sentry/node": "6.19.7",
44
- "@tryghost/config": "0.2.2",
45
- "@tryghost/debug": "0.1.11",
46
- "@tryghost/errors": "1.2.12",
47
- "@tryghost/logging": "2.1.8",
44
+ "@tryghost/config": "0.2.9",
45
+ "@tryghost/debug": "0.1.17",
46
+ "@tryghost/errors": "1.2.14",
47
+ "@tryghost/logging": "2.2.3",
48
48
  "@tryghost/pretty-cli": "1.2.28",
49
- "@tryghost/server": "0.1.4",
50
- "@tryghost/zip": "1.1.25",
49
+ "@tryghost/server": "0.1.21",
50
+ "@tryghost/zip": "1.1.26",
51
51
  "bluebird": "3.7.2",
52
52
  "chalk": "4.1.2",
53
53
  "common-tags": "1.8.2",