evidence icon indicating copy to clipboard operation
evidence copied to clipboard

Progress logs for templated pages

Open phukon opened this issue 1 year ago • 9 comments

Description

#1852

Implement feature as a Vite plugin to count markdown files in the pages directory and compare them with the number of pages built during the Vite build process. This will provide the build progression percentage specifically for templated pages.

phukon avatar Apr 08 '24 00:04 phukon

⚠️ No Changeset found

Latest commit: d81f93fc53bcf852577c6a167a9abf9b61889150

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Apr 08 '24 00:04 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2024 1:16pm

vercel[bot] avatar Apr 08 '24 00:04 vercel[bot]

Deploy Preview for evidence-development-workspace ready!

Name Link
Latest commit d81f93fc53bcf852577c6a167a9abf9b61889150
Latest deploy log https://app.netlify.com/sites/evidence-development-workspace/deploys/661ba694b40e8b0008df6621
Deploy Preview https://deploy-preview-1859--evidence-development-workspace.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 08 '24 00:04 netlify[bot]

Epic, thank you!

mcrascal avatar Apr 08 '24 01:04 mcrascal

[wip]

Goal: Forked childprocess tracks the progess on each template file (route) Used blessed for the terminal ui

After the modules are transformed, the childprocess's stdout is shown on the terminal, while the parent's stdout is redirected to log file in /tmp so that the logs from the parent doesn't ruin the UI. Happens at the very last stage of the build process.

Should I progress further or is it complicating a very trivial thing?

https://github.com/evidence-dev/evidence/assets/60285613/ac60935b-92e0-408a-a688-25d3626f0512

phukon avatar Apr 12 '24 13:04 phukon

Should I progress further or is it complicating a very trivial thing?

My instinct is this is a lot of additional LoC and some more deps for a useful, but not essential feature.

Is there a simpler approach we can run using something like fs or chokidar - existing dep?

If it makes it easier, I'm not sure it's essential to know "percentage complete" vs just the number of pages built so far

archiewood avatar Apr 12 '24 22:04 archiewood

Deploy Preview for next-docs-evidence ready!

Name Link
Latest commit d81f93fc53bcf852577c6a167a9abf9b61889150
Latest deploy log https://app.netlify.com/sites/next-docs-evidence/deploys/661ba6944d6e790008fc750e
Deploy Preview https://deploy-preview-1859--next-docs-evidence.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 13 '24 11:04 netlify[bot]

  • Routes for template pages are constructed.
  • A single chokidar watcher is set with depth calculated from the routes.
  • Rollup's buildEnd hook was ineffective, so a 60sec countdown is created to return control from the plugin to the caller so the build proceeds.

https://github.com/evidence-dev/evidence/assets/60285613/3fe879a8-f77c-4894-b039-6235d5223960

phukon avatar Apr 13 '24 22:04 phukon

Big fan of this feature - overall this PR looks good, but I don't think the plugin connector is the best place to land it. Need to think on this a bit more to figure out where to slot it

ItsMeBrianD avatar Jun 17 '24 15:06 ItsMeBrianD

I've logged this as an issue in #2258, I'm going to close this until it can be re-addressed in that issue, but this is a great feature and we appreciate the submission!

ItsMeBrianD avatar Jul 22 '24 18:07 ItsMeBrianD