Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
benwolfram committed Nov 27, 2024
1 parent 1940ddb commit 03902d7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -70,6 +71,9 @@
"@shopify/hydrogen-codegen": {
"optional": true
},
"@shopify/hydrogen": {
"optional": true
},
"@shopify/mini-oxygen": {
"optional": true
},
Expand Down
15 changes: 15 additions & 0 deletions packages/cli/src/commands/hydrogen/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -469,6 +470,8 @@ export async function runDeploy(

const metadataHydrogenVersion = await getHydrogenVersion({appPath: root});

outputInfo(`Hydrogen version: ${metadataHydrogenVersion}`);

const config: DeploymentConfig = {
assetsDir,
bugsnag: true,
Expand Down Expand Up @@ -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<HydrogenType>(
'@shopify/hydrogen',
root,
).catch(() => {
return undefined;
});

outputInfo(`Hydrogen version NEW: ${LIB_VERSION}`);

// separate

let packageJson: PackageJson | undefined;
const nodeModulesHydrogenPath = joinPath(
root,
Expand Down
2 changes: 2 additions & 0 deletions packages/hydrogen/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,5 @@ export {
} from './createHydrogenContext';

export {getSitemapIndex, getSitemap} from './sitemap/sitemap';

export {LIB_VERSION} from './version';

0 comments on commit 03902d7

Please sign in to comment.