@shopify/theme-check-node
Advanced tools
Comparing version
@@ -23,2 +23,3 @@ "use strict"; | ||
const theme_check_docs_updater_1 = require("@shopify/theme-check-docs-updater"); | ||
const liquid_html_parser_1 = require("@shopify/liquid-html-parser"); | ||
const promises_1 = __importDefault(require("node:fs/promises")); | ||
@@ -98,2 +99,14 @@ const node_path_1 = __importDefault(require("node:path")); | ||
])); | ||
const docDefinitions = new Map(theme | ||
.filter((file) => (0, theme_check_common_1.isSnippet)(file.uri)) | ||
.map((file) => [ | ||
node_path_1.default.relative(vscode_uri_1.URI.file(root).toString(), file.uri), | ||
(0, theme_check_common_1.memo)(async () => { | ||
const ast = file.ast; | ||
if (!(0, liquid_html_parser_1.isLiquidHtmlNode)(ast)) { | ||
return undefined; | ||
} | ||
return (0, theme_check_common_1.getSnippetDefinition)(ast, node_path_1.default.basename(file.uri, '.liquid')); | ||
}), | ||
])); | ||
const offenses = await (0, theme_check_common_1.check)(theme, config, { | ||
@@ -108,3 +121,4 @@ fs: NodeFileSystem_1.NodeFileSystem, | ||
getBlockSchema: async (name) => { var _a; return (_a = blockSchemas.get(name)) === null || _a === void 0 ? void 0 : _a(); }, | ||
getAppBlockSchema: async (name) => { var _a; return (_a = blockSchemas.get(name)) === null || _a === void 0 ? void 0 : _a(); }, // cheating... but TODO | ||
getAppBlockSchema: async (name) => { var _a; return (_a = blockSchemas.get(name)) === null || _a === void 0 ? void 0 : _a(); }, | ||
getDocDefinition: async (relativePath) => { var _a; return (_a = docDefinitions.get(relativePath)) === null || _a === void 0 ? void 0 : _a(); }, | ||
}); | ||
@@ -111,0 +125,0 @@ return { |
{ | ||
"name": "@shopify/theme-check-node", | ||
"version": "3.13.1", | ||
"version": "3.14.0", | ||
"main": "dist/index.js", | ||
@@ -36,4 +36,4 @@ "types": "dist/index.d.ts", | ||
"dependencies": { | ||
"@shopify/theme-check-common": "3.13.1", | ||
"@shopify/theme-check-docs-updater": "3.13.1", | ||
"@shopify/theme-check-common": "3.14.0", | ||
"@shopify/theme-check-docs-updater": "3.14.0", | ||
"glob": "^8.0.3", | ||
@@ -40,0 +40,0 @@ "vscode-uri": "^3.0.7", |
60265
1.3%1189
1.19%+ Added
+ Added
- Removed
- Removed