diff --git a/package-lock.json b/package-lock.json index 26fa40f67..44baa4ad3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,20 +11,20 @@ "examples/classic-remix", "examples/custom-cart-method", "examples/express", + "examples/gtm", "examples/infinite-scroll", "examples/legacy-customer-account-flow", "examples/metaobjects", "examples/multipass", - "examples/sitemap", "examples/partytown", + "examples/sitemap", "examples/subscriptions", "examples/third-party-queries-caching", - "examples/gtm", "packages/cli", "packages/create-hydrogen", - "packages/hydrogen", "packages/hydrogen-codegen", "packages/hydrogen-react", + "packages/hydrogen", "packages/mini-oxygen", "packages/remix-oxygen", "templates/skeleton" @@ -36,7 +36,7 @@ "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "^2.26.0", "@playwright/test": "^1.40.1", - "@shopify/cli": "^3.69.4", + "@shopify/cli": "~3.69.4", "@types/eslint": "^8.4.10", "cross-env": "^7.0.3", "eslint": "^8.20.0", @@ -30930,6 +30930,7 @@ "peerDependencies": { "@graphql-codegen/cli": "^5.0.2", "@remix-run/dev": "^2.1.0", + "@shopify/hydrogen": "^2024.10.0", "@shopify/hydrogen-codegen": "^0.3.2", "@shopify/mini-oxygen": "^3.1.0", "graphql-config": "^5.0.3", @@ -30942,6 +30943,9 @@ "@remix-run/dev": { "optional": true }, + "@shopify/hydrogen": { + "optional": true + }, "@shopify/hydrogen-codegen": { "optional": true }, @@ -31198,7 +31202,7 @@ }, "packages/create-hydrogen": { "name": "@shopify/create-hydrogen", - "version": "5.0.10", + "version": "5.0.11", "license": "MIT", "dependencies": { "@ast-grep/napi": "0.11.0" @@ -33440,9 +33444,6 @@ "engines": { "node": ">=18.0.0" }, - "peerDependencies": { - "vite": "^5.1.0" - }, "peerDependenciesMeta": { "vite": { "optional": true @@ -33511,7 +33512,7 @@ } }, "templates/skeleton": { - "version": "2024.10.0", + "version": "2024.10.1", "dependencies": { "@remix-run/react": "^2.13.1", "@remix-run/server-runtime": "^2.13.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 1eeaf8f7f..c62b63a1a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -56,6 +56,7 @@ "@graphql-codegen/cli": "^5.0.2", "@remix-run/dev": "^2.1.0", "@shopify/hydrogen-codegen": "^0.3.2", + "@shopify/hydrogen": "^2024.10.0", "@shopify/mini-oxygen": "^3.1.0", "graphql-config": "^5.0.3", "vite": "^5.1.0" @@ -70,6 +71,9 @@ "@shopify/hydrogen-codegen": { "optional": true }, + "@shopify/hydrogen": { + "optional": true + }, "@shopify/mini-oxygen": { "optional": true }, diff --git a/packages/cli/src/commands/hydrogen/deploy.ts b/packages/cli/src/commands/hydrogen/deploy.ts index 0a5f2a1ad..0b46b3a64 100644 --- a/packages/cli/src/commands/hydrogen/deploy.ts +++ b/packages/cli/src/commands/hydrogen/deploy.ts @@ -55,6 +55,7 @@ import {prepareDiffDirectory} from '../../lib/template-diff.js'; import {getProjectPaths, isClassicProject} from '../../lib/remix-config.js'; import {packageManagers} from '../../lib/package-managers.js'; import {setupResourceCleanup} from '../../lib/resource-cleanup.js'; +import {importLocal} from '../../lib/import-utils.js'; const DEPLOY_OUTPUT_FILE_HANDLE = 'h2_deploy_log.json'; @@ -469,6 +470,8 @@ export async function runDeploy( const metadataHydrogenVersion = await getHydrogenVersion({appPath: root}); + outputInfo(`Hydrogen version: ${metadataHydrogenVersion}`); + const config: DeploymentConfig = { assetsDir, bugsnag: true, @@ -686,6 +689,18 @@ Continue?`.value, export async function getHydrogenVersion({appPath}: {appPath: string}) { const {root} = getProjectPaths(appPath); + type HydrogenType = typeof import('@shopify/hydrogen'); + const {LIB_VERSION} = await importLocal( + '@shopify/hydrogen', + root, + ).catch(() => { + return undefined; + }); + + outputInfo(`Hydrogen version NEW: ${LIB_VERSION}`); + + // separate + let packageJson: PackageJson | undefined; const nodeModulesHydrogenPath = joinPath( root, diff --git a/packages/hydrogen/src/index.ts b/packages/hydrogen/src/index.ts index a42253d7b..7de6f767f 100644 --- a/packages/hydrogen/src/index.ts +++ b/packages/hydrogen/src/index.ts @@ -172,3 +172,5 @@ export { } from './createHydrogenContext'; export {getSitemapIndex, getSitemap} from './sitemap/sitemap'; + +export {LIB_VERSION} from './version';