Add `nx add solid` to configure Solid in an existing project

Open
#681 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python, typescript, vite

Research direction

Start with nexy/modules/cli/commands/add.py and compare its file-writing behavior with nx add vercel from issue #671; then read the shared web templates under nexy/modules/cli/templates/_shared/web/ and issue #660. Implementing this spans CLI behavior, config and package edits, Vite settings, tests, and documentation. Done means the command preserves existing settings, is idempotent, and a generated project builds and serves a Solid route in development and production.

Written by the indexing model from the issue text.

Description

enhancement

Problem

Adding Solid to an existing Nexy project is manual. A developer has to edit nexyconfig.py, install the Solid packages, write vite.config.ts, and decide whether the project needs client-side rendering. A small mistake gives an unstyled page or a failed server render, with no clear error.

Proposed solution

Add nx add solid (also available as nexy add solid) that configures Solid in an existing project:

  • Add from nexy.frontend import solid and useFF = solid() to nexyconfig.py without removing other settings.
  • Add solid-js and vite-plugin-solid with the versions from nexy/modules/cli/templates/_shared/web/package.json.jinja2 to package.json.
  • Write or update vite.config.ts with the Solid plugin from nexy/modules/cli/templates/_shared/web/vite.config.ts.jinja2, preserving edits the developer already made, including the ssr: true option when useCSR is on.
  • Set useCSR only for the mode the project needs, and respect the one framework rule from issue #660.
  • Print every file changed, skip files that already have the wanted content, and leave the project unchanged on a second run, like nx add vercel.

Acceptance criteria:

  • Running the command twice produces no further changes.
  • Existing nexyconfig.py, package.json, and vite.config.ts settings are preserved.
  • A generated project builds and serves a Solid route in dev and production.
  • Tests cover the config edit, package list, Vite config, conflict handling, and idempotency.
  • The CLI reference and a dedicated docs page describe the command.

Alternative solutions

Keep the manual setup in the docs only, or extend nx new --framework solid. Both help new projects but do not help someone who already has a project and wants Solid added later.

Additional context

The command should follow the file writing behavior of nx add vercel (issue #671): data describing the generated files, no framework dependency added to the core, and no overwrite of a file the developer owns. The relevant templates are under nexy/modules/cli/templates/_shared/web/; the current add command is nexy/modules/cli/commands/add.py.

Validation

  • I have searched existing issues and this is not a duplicate.
  • I would be willing to help implement this feature.
Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.