gscan 4.30.0 → 4.31.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.
@@ -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
 
@@ -78,7 +78,7 @@ 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
84
  Find more information about the <code>{{price}}</code> helper <a href="${docsBaseUrl}members/price/" target=_blank>here</a>.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "4.30.0",
3
+ "version": "4.31.0",
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.7",
44
44
  "@tryghost/config": "0.2.2",
45
45
  "@tryghost/debug": "0.1.11",
46
- "@tryghost/errors": "1.2.12",
47
- "@tryghost/logging": "2.1.8",
46
+ "@tryghost/errors": "1.2.13",
47
+ "@tryghost/logging": "2.2.2",
48
48
  "@tryghost/pretty-cli": "1.2.28",
49
49
  "@tryghost/server": "0.1.4",
50
- "@tryghost/zip": "1.1.25",
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",