Skip to content

Commit

Permalink
chore(storefront): Start debugging storefront version on BaseBody.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Feb 12, 2024
1 parent 220da0b commit 8169917
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/storefront/src/lib/layouts/BaseBody.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
import * as url from 'node:url';
import { join as joinPath } from 'node:path';
import { readFileSync } from 'node:fs';
import '@@sf/assets/reset.css';
import '@@sf/assets/base.css';
import '@@sf/assets/forms.css';
Expand All @@ -7,6 +10,15 @@ import '@@sf/assets/tooltip.css';
// import 'uno.css';
import Picture from '@@sf/components/Picture.astro';
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const pkgJson = readFileSync(joinPath(__dirname, '../../../package.json'), 'utf-8');
const {
name: pkgName,
version: pkgVersion,
} = JSON.parse(pkgJson);
const getInlineVersionLog = () => {
return `console.log('%c${pkgName} v${pkgVersion}', 'font-weight:bold')`;
};
const { settings } = Astro.locals.routeContext;
---

Expand All @@ -28,4 +40,5 @@ const { settings } = Astro.locals.routeContext;
hasImg={false}
/>
}
<script is:inline set:html={getInlineVersionLog()} />
</body>

0 comments on commit 8169917

Please sign in to comment.