Repository navigation
Blog tooling: make theme preview commands work in Windows shells (#28) - #40
Conversation
Replace POSIX inline environment assignments in blog/package.json with a portable Node launcher () so theme preview and dev server scripts work across Windows (cmd/PowerShell) and POSIX shells. Enforce strict output cleanup confinement, preserve child exit codes, and document preview startup and teardown in blog/README.md.
|
@rajarshikarmakarx is attempting to deploy a commit to the idrissihafez-3729's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
✅ Before and after are both described. Thanks for making the change reviewable. |
HafidIdrissi
left a comment
There was a problem hiding this comment.
Thanks @rajarshikarmakarx. I read #28, CONTRIBUTING.md, the complete three-file diff at 5c0a6f5d0eff73163ee42c15c8c861713d9449cc, package scripts and Eleventy configuration. The Node launcher preserves the configured theme/base/output/ports, confines cleanup to the two existing preview destinations and invokes Node directly rather than using shell-only environment assignment. Keep this PR limited to #28.
Please complete the focused validation before approval:
- The failing Before / after evidence check has a concrete formatting cause: both headings have leading spaces (
## Before,## After). I read the workflow and failing job log; its section matcher requires#at column one. Remove the leading spaces from those heading lines while keeping the useful text under each. Saving the description reruns this check; no waiver or screenshot is needed for this tooling change. - Your description reports Fedora/Linux runs but says all platforms were verified. Record the actual Node/npm versions, exact commands and outcomes, and mark Windows validation as not performed until observed. From
blog/in a disposable checkout, runnpm ci, bothnpm run preview:sunroomandnpm run preview:press,npm run dev:press(port 8089, then Ctrl+C), and the normalnpm run build. Validate the same preview commands through Windows' default npm shell/PowerShell, ideally with spaces in the checkout path. Confirm the correct isolated outputs/base links, normal production output and clean server shutdown without leaving the test-owned process running. - Include a focused reproducible launcher check (standard-library Node tests are sufficient): verify environment/arguments, nonzero child exit propagation and refusal of an invalid
--cleanpath before any deletion/child launch. Use temporary sentinel files, never personal files. This covers the behavior introduced by the wrapper rather than relying on a generic cross-platform claim. Report any skipped checks honestly and request a Windows tester if needed.
Current CI run https://github.com/HafidIdrissi/Crewlo/actions/runs/38607431825 and Build blog run https://github.com/HafidIdrissi/Crewlo/actions/runs/38607432508 require maintainer Approve and run. No workflow files changed, and the connector cannot approve execution. The Vercel authorization bot message is separate from these Actions checks. I have not run npm, Windows shells or a browser locally; the Linux checks above are your reported evidence.
|
CI status correction for unchanged head This resolves only the execution wait in review 5524228939. The Before/After evidence check still fails; the description's indented headings and requested actual preview/Windows/launcher-validation record remain unchanged. That review stays the reference, with no additional scope or repeated test request. CI results are separate from author-reported Linux checks; I have not run tests or a browser locally. |
- Add script to package.json using Node.js built-in test runner - Expand with coverage for environment/argument passing, non-zero exit code propagation, and invalid path security checks
|
Hi, thanks for the detailed review! I've completed the requested follow-ups:
Environment: Fedora Linux 44, Node.js Windows PowerShell/default npm shell validation has not been performed locally, so Windows execution remains unverified. The changes remain scoped to this issue. Please let me know if a Windows-specific test run is required before approval. Thanks! |
|
Update: Windows validation completed. In addition to my Fedora Linux testing, I ran the same validation on a Windows machine using Windows PowerShell, Node.js
The Windows checkout path contained a space. I've updated the PR description with the environment details and validation results. The dependency installation also reported 12 npm audit findings (3 moderate, 9 high); no automatic audit fixes were applied. |
HafidIdrissi
left a comment
There was a problem hiding this comment.
Reviewed the complete four-file patch at 81fbf26 and the revised Before/After and validation sections. I independently validated this revision on Windows build 26200, Node v24.21.0: npm ci --ignore-scripts completed; npm run test:launcher passed 3/3; both preview builds and the normal production build completed successfully. npm run dev:press served HTTP 200 on localhost:8089, entered watch mode and stopped via Ctrl+C; no listener remained. I also copied the exact launcher into an isolated fixture whose path contains spaces and used a synthetic Eleventy child to assert forwarded theme/preview/base/output variables, serve/port arguments, working directory, and preservation of child exit code 23. The repository's --help test alone does not prove environment forwarding; the independent fixture supplies that evidence. Cleanup remains confined to the two expected preview paths, and the invalid-path sentinel test passes. Existing Crewlo templates retain their current link/theme behavior; this review does not claim to redesign those templates. The author separately reports Windows and Fedora checks. Installation reports 12 existing audit findings; no dependency versions or lockfile are changed here. The new head's workflow runs required approval, which I have now supplied; final merge must await the current CI/build results. Vercel's separate authorization failure remains visible and has not been bypassed.
|
Thanks for the thorough review and for independently validating the Windows behavior, especially the environment forwarding and exit-code handling. Appreciate the detailed feedback — learned a lot from this review! |
Summary
Replace POSIX-only inline environment assignments in
blog/package.jsonwith a portable Node.js launcher (blog/scripts/run-theme.mjs) so theme preview and development server scripts work across Windows (cmd/PowerShell) and POSIX shells.The launcher preserves the configured theme, port, base URL, and isolated preview output directories. It also restricts cleanup to the permitted preview destinations and propagates child-process exit codes.
What changed and why?
blog/package.jsonwith a portable Node.js launcher.blog/scripts/run-theme.test.mjsand thenpm run test:launcherscript to test the launcher.blog/README.mdwith theme preview, development server, and shutdown instructions.Before
BLOG_THEME=press eleventy --serve --port=8089are not supported by the default Windows Command Prompt shell and can fail in Windows-based npm scripts.After
node scripts/run-theme.mjswith the appropriate configuration.blog/README.mdexplains how to start previews and development servers and stop them usingCtrl+C.Example:
How I tested it
Fedora Linux validation
Environment
v24.21.011.19.0Commands and results
npm ci— installed project dependencies.npm run preview:sunroom— succeeded; generated output in../docs/blog-preview-sunroom, with the corresponding base links verified.npm run preview:press— succeeded; generated output in../docs/blog-preview-press, with the corresponding base links verified.npm run dev:press— Eleventy started athttp://localhost:8089/, entered watch mode, and shut down afterCtrl+C.npm run build— normal production blog build succeeded.npm run test:launcher— 3 tests passed, 0 failed.Windows PowerShell validation
Environment
v24.18.011.16.0C:\Users\<username with spaces>\downloads\crewlo(contains a space).Commands and results
npm ci— completed successfully.npm run test:launcher— 3 tests passed, 0 failed.npm run preview:sunroom— succeeded; generated output in../docs/blog-preview-sunroom.npm run preview:press— succeeded; generated output in../docs/blog-preview-press.npm run build— completed successfully, including the postbuild sitemap step.npm run dev:press— started successfully, entered watch mode, and reportedhttp://localhost:8089/.The Windows dependency installation reported 12 npm audit findings (3 moderate, 9 high). No automatic audit fixes were applied.
Automated launcher tests
Scope
This PR addresses issue #28 only. It does not intentionally change the production blog base URL or generated archive content.
Checklist