Skip to content

Commit

Permalink
chore: Adds more logging to @buttery/docs development server (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewdecarme authored Nov 29, 2024
1 parent ffd9c56 commit 9a4d3a7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .monoweave/f3bcaaa5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@buttery/docs": patch
---

Adds more logging to the `@buttery/docs` development package
Binary file modified .yarn/install-state.gz
Binary file not shown.
8 changes: 8 additions & 0 deletions packages/buttery-docs/src/cli-scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ export async function dev(options?: Partial<ButteryDocsDevOptions>) {
const config = await getButteryDocsConfig({
prompt: parsedOptions.prompt,
});
LOG.checkpointStart("config & dirs");
const dirs = await getButteryDocsDirectories(config);
LOG.debug(JSON.stringify(dirs, null, 2));
LOG.checkpointEnd("config & dirs");
const viteConfig = getButteryDocsViteConfig(config, dirs);

// Set some constants
Expand Down Expand Up @@ -78,16 +81,21 @@ export async function dev(options?: Partial<ButteryDocsDevOptions>) {
const url = req.originalUrl;

// Load the server-entry file as a module
LOG.debug(`Loading the server entry file "${dirs.app.appEntryServer}"`);
const ssrEntryModule = await vite.ssrLoadModule(dirs.app.appEntryServer);

// create the HTML template
LOG.debug("Generating HTML template...");
const { htmlDev } = generateHTMLTemplate({
cssLinks: [dirs.app.css.tokens, dirs.app.css.docsUI],
jsScripts: [dirs.app.appEntryClient],
Meta,
});
LOG.debug(htmlDev);
LOG.debug("Generating HTML template... done.");

// allow vite to inject the necessary scripts
LOG.debug("Injecting scripts into HTML base");
const htmlTemplate = await vite.transformIndexHtml(url, htmlDev);

const ssrManifest = undefined;
Expand Down

0 comments on commit 9a4d3a7

Please sign in to comment.