gscan 6.0.1 → 6.1.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/checker.js CHANGED
@@ -32,6 +32,7 @@ function loadChecks() {
32
32
  * @param {string} [options.themeName] name of the checked theme
33
33
  * @param {Object=} [options.labs] object containing boolean flags for enabled labs features
34
34
  * @param {boolean} [options.skipChecks] flag to allow reading theme without incurring check costs
35
+ * @param {Object=} [options.limits] zip extraction size limits
35
36
  * @returns {Promise<Object>}
36
37
  */
37
38
  const check = async function checkAll(themePath, options = {}) {
@@ -105,7 +106,7 @@ const checkZip = async function checkZip(path, options) {
105
106
 
106
107
  try {
107
108
  const readZip = require('./read-zip');
108
- ({path: extractedZipPath} = await readZip(zip));
109
+ ({path: extractedZipPath} = await readZip(zip, {limits: options.limits}));
109
110
  return await check(extractedZipPath, Object.assign({themeName: zip.name}, options));
110
111
  } catch (error) {
111
112
  if (!errors.utils.isGhostError(error)) {
package/lib/read-theme.js CHANGED
@@ -11,6 +11,9 @@ const ignore = [
11
11
  '.DS_Store',
12
12
  '.git',
13
13
  '.svn',
14
+ '.claude',
15
+ 'CLAUDE.md',
16
+ 'AGENTS.md',
14
17
  'Thumbs.db',
15
18
  '.yarn-cache'
16
19
  ];
package/lib/read-zip.js CHANGED
@@ -7,6 +7,10 @@ const {extract} = require('@tryghost/zip');
7
7
  const errors = require('@tryghost/errors');
8
8
  const _ = require('lodash');
9
9
 
10
+ const isKnownZipError = (err) => {
11
+ return errors.utils.isGhostError(err);
12
+ };
13
+
10
14
  const resolveBaseDir = async (zipPath) => {
11
15
  let matches = [];
12
16
 
@@ -25,12 +29,17 @@ const resolveBaseDir = async (zipPath) => {
25
29
  return zipPath;
26
30
  };
27
31
 
28
- const readZip = (zip) => {
32
+ const readZip = (zip, options = {}) => {
29
33
  const tempUuid = randomUUID();
30
34
  const tempPath = os.tmpdir() + '/' + tempUuid;
35
+ const extractOptions = {};
36
+
37
+ if (options.limits) {
38
+ extractOptions.limits = options.limits;
39
+ }
31
40
 
32
41
  debug('Reading Zip', zip.path, 'into', tempPath);
33
- return extract(zip.path, tempPath)
42
+ return extract(zip.path, tempPath, extractOptions)
34
43
  .then(async () => {
35
44
  let resolvedPath = await resolveBaseDir(tempPath);
36
45
  zip.origPath = tempPath;
@@ -41,6 +50,10 @@ const readZip = (zip) => {
41
50
  }).catch((err) => {
42
51
  debug('Zip extraction error', err);
43
52
 
53
+ if (isKnownZipError(err)) {
54
+ throw err;
55
+ }
56
+
44
57
  throw new errors.ValidationError({
45
58
  message: 'Failed to read zip file',
46
59
  help: 'Your zip file might be corrupted, try unzipping and zipping again.',
package/lib/specs/v6.js CHANGED
@@ -8,7 +8,7 @@ const previousTemplates = previousSpec.templates;
8
8
  const previousRules = previousSpec.rules;
9
9
 
10
10
  // assign new or overwrite existing knownHelpers, templates, or rules here:
11
- let knownHelpers = ['split', 'json', 'color_to_rgba', 'contrast_text_color', 'raw', 'search'];
11
+ let knownHelpers = ['split', 'json', 'color_to_rgba', 'contrast_text_color', 'raw', 'search', 'social_accounts'];
12
12
  let templates = [];
13
13
  let rules = {
14
14
  'GS090-NO-LIMIT-ALL-IN-GET-HELPER': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gscan",
3
- "version": "6.0.1",
3
+ "version": "6.1.0",
4
4
  "description": "Scans Ghost themes looking for errors, deprecations, features and compatibility",
5
5
  "keywords": [
6
6
  "ghost",
@@ -43,15 +43,15 @@
43
43
  "gscan": "./bin/cli.js"
44
44
  },
45
45
  "dependencies": {
46
- "@sentry/node": "10.48.0",
47
- "@tryghost/config": "2.0.3",
48
- "@tryghost/debug": "2.0.3",
49
- "@tryghost/errors": "3.0.3",
50
- "@tryghost/logging": "4.0.3",
46
+ "@sentry/node": "10.52.0",
47
+ "@tryghost/config": "2.2.0",
48
+ "@tryghost/debug": "2.2.0",
49
+ "@tryghost/errors": "3.2.1",
50
+ "@tryghost/logging": "4.2.1",
51
51
  "@tryghost/nql": "0.12.10",
52
- "@tryghost/pretty-cli": "3.0.3",
53
- "@tryghost/server": "2.0.3",
54
- "@tryghost/zip": "3.0.3",
52
+ "@tryghost/pretty-cli": "3.2.0",
53
+ "@tryghost/server": "2.2.1",
54
+ "@tryghost/zip": "3.3.1",
55
55
  "chalk": "5.6.2",
56
56
  "express": "5.2.1",
57
57
  "express-handlebars": "8.0.1",
@@ -59,23 +59,23 @@
59
59
  "handlebars": "4.7.9",
60
60
  "lodash": "4.18.1",
61
61
  "multer": "2.1.1",
62
- "semver": "7.7.4",
62
+ "semver": "7.8.0",
63
63
  "validator": "^13.0.0"
64
64
  },
65
65
  "devDependencies": {
66
- "@eslint/compat": "2.0.5",
66
+ "@eslint/compat": "2.1.0",
67
67
  "@eslint/eslintrc": "3.3.5",
68
68
  "@eslint/js": "10.0.1",
69
69
  "@tryghost/pro-ship": "1.0.8",
70
- "@vitest/coverage-v8": "4.1.4",
71
- "eslint": "10.2.0",
70
+ "@vitest/coverage-v8": "4.1.5",
71
+ "eslint": "10.3.0",
72
72
  "eslint-plugin-ghost": "3.5.0",
73
73
  "nodemon": "3.1.14",
74
- "vitest": "4.1.4"
74
+ "vitest": "4.1.5"
75
75
  },
76
76
  "resolutions": {
77
77
  "node-loggly-bulk": "4.0.2",
78
- "node-loggly-bulk/axios": "1.15.0",
78
+ "node-loggly-bulk/axios": "1.16.0",
79
79
  "**/handlebars": "4.7.9"
80
80
  },
81
81
  "files": [