{"id":13470952,"url":"https://github.com/TryGhost/gscan","last_synced_at":"2025-03-26T12:32:14.727Z","repository":{"id":21658602,"uuid":"24979466","full_name":"TryGhost/gscan","owner":"TryGhost","description":"Ghost theme scanner - checks for errors and feature support","archived":false,"fork":false,"pushed_at":"2024-10-29T22:35:09.000Z","size":4514,"stargazers_count":75,"open_issues_count":35,"forks_count":56,"subscribers_count":19,"default_branch":"main","last_synced_at":"2024-10-30T00:54:53.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gscan.ghost.org","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TryGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"tryghost","open_collective":"ghost"}},"created_at":"2014-10-09T08:05:01.000Z","updated_at":"2024-10-28T03:38:56.000Z","dependencies_parsed_at":"2023-07-25T00:03:26.618Z","dependency_job_id":"adc12b5a-3d30-4867-b8a7-3345d84f7e76","html_url":"https://github.com/TryGhost/gscan","commit_stats":{"total_commits":1593,"total_committers":63,"mean_commits":"25.285714285714285","dds":0.7664783427495292,"last_synced_commit":"5d52a65f1412eb1a24424095e456dc7a64390253"},"previous_names":["erisds/ghost-theme-check"],"tags_count":206,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TryGhost","download_url":"https://codeload.github.com/TryGhost/gscan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245187783,"owners_count":20574658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:00:37.752Z","updated_at":"2025-03-26T12:32:14.722Z","avatar_url":"https://github.com/TryGhost.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tryghost","https://opencollective.com/ghost"],"categories":["Tools","JavaScript","others"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gscan.ghost.org/\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/TryGhost/gscan/main/app/public/logo-gscan-black.png\" width=\"216px\" alt=\"Ghost\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nGScan is a tool for validating Ghost themes. It produces detailed reports of issues where themes need to be modified in order to be compatible with a specific version.\n\nIt is actively capable of dealing with the current and last major versions of Ghost (so at the time of writing v4, v3, v2 and v1).\n\nGScan works on a system of rules. Each rule has a way to check whether it passes or fails and has help content which describes how to fix it. Each rule is also marked with an error level:\n\n- Errors: issues that will cause your theme to not work properly. These must be fixed.\n- Warnings: these are usually related to deprecated features. These should be fixed.\n- Recommendations: these are advisories about best practice. Fixing these will improve your theme.\n- Features: detected features which may impact on compatibility. Nothing to do!\n\nIn addition, an **error** can be marked as **fatal**. A **fatal error** means, left unchecked a Ghost publication would throw 500 errors on certain pages because of the detected out-of-date or erroneous code.\n\n## Usage\n\nThere are 4 ways to use gscan to validate your theme:\n\n### 1. Inside Ghost\n\nGscan is pre-installed in Ghost. If there are theme errors, Ghost will show them on boot in the console logs and in the UI (Ghost Admin).\n\n### 2. Web usage\n\nVisit https://gscan.ghost.org and upload your zip to our online version of Gscan.\n\n### 3. CLI usage\n\nInstall using yarn / npm:\n\n`yarn global add gscan` /  `npm install -g gscan`\n\nTo run a local directory through the checks:\n\n`gscan /path/to/theme/directory`\n\nTo run a local zip file through the checks:\n\n`gscan /path/to/theme.zip -z`\n\nBy default, GScan scans themes for the latest Ghost version compatibility. You can also specify a Ghost version by using the following parameters (for Ghost 1.0, 2.0, 3.0, 4.0 and 5.0):\n\n`--v1` or `-1`\n`--v2` or `-2`\n`--v3` or `-3`\n`--v4` or `-4` or `--canary`\n`--v5` or `-5`\n\nUse the `--canary` parameter to check for the upcoming Ghost version.\n\nExamples:\n\n`gscan /path/to/theme.zip -z1` - scan a theme in a zip file for Ghost 1.0 compatibility\n`gscan /path/to/theme/directory --v2` - can a theme in a directory for Ghost 2.0 compatibility\n`gscan /path/to/theme/directory --canary` - scan a theme for the upcoming version of Ghost\n\n### 4. Lib usage\n\nInstall using yarn/npm and then:\n\n```js\nvar gscan = require('gscan');\n\ngscan.checkZip({\n    path: 'path-to-zip',\n    // if you need to check the theme for a different\n    // major Ghost version, you can pass it. Currently\n    // v1, v2, v3, v4 and canary (v5) are supported. Default is\n    // the latest Ghost version 4.0:\n    // checkVersion: 'v4',\n    name: 'my-theme'\n}).then(function (result) {\n    console.log(result);\n}).catch(function(err) {\n    console.log(err);\n});\n```\n\n## Development\n\n### Run in browser (for zip uploads)\n\n- Either dev mode: `yarn dev`\n- Or standard server: `yarn start`\n- View: http://localhost:2369\n\n### Run on command line\n\n- zip file: `./bin/cli.js -z /path/to/your/theme.zip`\n- directory: `./bin/cli.js /path/to/directory`\n\n### Publish\n\n(Core team only)\n\n- `yarn ship`\n\n### Tools\nWhen developing new rules or testing gscan following tools are great to have in the toolbelt:\n- [astexplorer](https://astexplorer.net) - absolutely awesome Handlebars AST fiddler, helpful when testing out new ideas and exploring what's possible through AST parser;\n\n## To Do\n\n- Support for running the checks against a GitHub repository\n- Many, many more checks\n- Detailed advice for each check/result\n- Compatibility report\n- Feature listing\n\n# Copyright \u0026 License\n\nCopyright (c) 2013-2025 Ghost Foundation - Released under the [MIT license](LICENSE). Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our [trademark policy](https://ghost.org/trademark/) for info on acceptable usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTryGhost%2Fgscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTryGhost%2Fgscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTryGhost%2Fgscan/lists"}