diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 5451d01..dd28365 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -13,7 +13,7 @@ jobs: # Setup .npmrc file to publish to npm - uses: actions/setup-node@v4 with: - node-version: "18" + node-version: "20" registry-url: "https://registry.npmjs.org" - run: npm ci - run: npm run build diff --git a/package.json b/package.json index 3e0aee0..2f0dbac 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", "lint": "eslint . --ext .ts", "format": "prettier --write \"src/**/*.ts\"", - "prepare": "npm run build", + "prepack": "npm run build", "prepublishOnly": "npm test && npm run lint", "preversion": "npm run lint", "version": "npm run format && git add -A src", diff --git a/shareable/cs-lp-script.liquid b/shareable/cs-lp-script.liquid index d45ad43..943708b 100644 --- a/shareable/cs-lp-script.liquid +++ b/shareable/cs-lp-script.liquid @@ -51,7 +51,6 @@ `; } catch (err) { console.error('Error parsing schema:', err.message); @@ -129,10 +128,8 @@ export function setupLiquidEngine(options: LiquidEngineOptions = {}): Liquid { }); engine.registerFilter('image_url', (image, options = {}) => { - console.log('image_url filter called with:', image, options); if (!image) { - console.log('No image provided, returning placeholder'); return '/placeholder-image.jpg'; } @@ -144,7 +141,6 @@ export function setupLiquidEngine(options: LiquidEngineOptions = {}): Liquid { } else if (image.src) { baseUrl = image.src; } else { - console.log('No valid URL found in image object'); return '/placeholder-image.jpg'; } @@ -320,7 +316,6 @@ export function setupLiquidEngine(options: LiquidEngineOptions = {}): Liquid { if (block.type) { filenameToRender = block.type === '@app' ? 'app-block' : block.type; - console.log(`[Custom Render] Rendering for block type: ${block.type}, using snippet: ${filenameToRender}.liquid`); } else { throw new Error(`[Custom Render] Cannot render block: "block.type" is missing. Block data: ${JSON.stringify(block)}`); } @@ -397,14 +392,6 @@ export function setupLiquidEngine(options: LiquidEngineOptions = {}): Liquid { ...localContextFromParams // Explicit render parameters (highest priority) }; - console.log(`[Custom Render] Rendering ${filePath} with globals:`, { - hasShop: !!renderCtx.shop, - hasProduct: !!renderCtx.product, - hasLocalization: !!renderCtx.localization, - locale: renderCtx.localization?.language?.iso_code, - productTitle: renderCtx.product?.title - }); - try { const html = await this.liquid.renderFile(filePath, renderCtx); return html; diff --git a/src/setup/index.js b/src/setup/index.js index d48770b..beae706 100644 --- a/src/setup/index.js +++ b/src/setup/index.js @@ -393,7 +393,6 @@ const saveDataInObject = (type, path, data, dataType, entryMetaObject, extraData } const getUpdatedProductMetafields = async (currentMetafields, contentType, entry, { ctUid, entryUid, hash }) => { - console.log("🚀 ~ getUpdatedProductMetafields ~ currentMetafields:", currentMetafields) if (!currentMetafields || typeof currentMetafields !== 'object') return; const updatedMetafields = {}; for (const [key, value] of Object.entries(currentMetafields)) { @@ -705,7 +704,6 @@ const getUpdatedMetaobject = async (currentMetaobjects, keyBasedCt, entry, { ctU } currentMetaobjects[type] = updatedMetaobjects[type]; } - console.log("🚀 ~ getUpdatedMetaobject ~ updatedMetaobjects:", JSON.stringify(updatedMetaobjects, null, 4)) return { currentMetaobjects, dataCSLPMapping diff --git a/tsconfig.json b/tsconfig.json index e6b7a2f..2d8b529 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2020", "module": "ESNext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "outDir": "./dist", "rootDir": "./src", "strict": true,