Skip to content

Add JavaScript Web Project Scaffolding - #43

Open
kumarswamynaidu09 wants to merge 4 commits into
Abhiix0:mainfrom
kumarswamynaidu09:main
Open

Add JavaScript Web Project Scaffolding#43
kumarswamynaidu09 wants to merge 4 commits into
Abhiix0:mainfrom
kumarswamynaidu09:main

Conversation

@kumarswamynaidu09

Copy link
Copy Markdown

Summary

Adds JavaScript web project scaffolding to Spawn as a new web-js template.

The new template supports four project types:

  • Vanilla JavaScript
  • Express
  • React (Vite)
  • Next.js

Framework selection follows the same pattern as the existing Backend API template.

Changes

  • Added WebJSTemplate with framework and extras support.

  • Added starter files and package.json generation for all four frameworks.

  • Registered the new web-js template in registry.py.

  • Added optional support for:

    • ESLint
    • Prettier
    • GitHub Actions
  • get_dependencies() returns no Python dependencies.

  • post_install() automatically runs npm install when Node.js and npm are available.

Fixes

  • Fixed CSS template formatting errors caused by unescaped {} characters in style.css, App.css, and globals.css.
  • Fixed Windows npm installation failures by passing the resolved npm.cmd path to subprocess.run().
  • Added FileNotFoundError handling so npm installation failures do not abort project creation.

Testing

Verified generation for all four supported frameworks.

Tests confirm:

  • All starter files generate successfully.
  • CSS/JS/JSX templates render without format_map() errors.
  • Generated package.json files are valid JSON.
  • npm installation behavior works correctly when npm is missing, fails to launch, exits unsuccessfully, or resolves to a platform-specific executable path.

Impact

This expands Spawn's scaffolding capabilities to JavaScript web development while keeping the existing template and CLI architecture unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant