Documentation Index
Fetch the complete documentation index at: https://mintlify.com/queaxtra/zvelte/llms.txt
Use this file to discover all available pages before exploring further.
Overview
When you create a new project with Zvelte, the CLI automatically updates yourpackage.json file with project-specific details. This ensures your project starts with clean, appropriate metadata based on your chosen project directory name.
Automatic Updates
TheupdatePackageJson function runs immediately after cloning the template and modifies three key fields in your package.json:
Set to the project directory name using
path.basename(). For example, if you create a project in my-awesome-app, the name field will be set to my-awesome-app.Reset to an empty string, allowing you to add your own project description.
Set to
0.0.1 to indicate this is a fresh project starting at the initial version.How It Works
The update process happens automatically during thecreate command workflow:
Before and After Example
Before (Template Default)
package.json
After (Your Project)
Assuming you created a project with:package.json will be updated to:
package.json
All other fields in the
package.json file remain unchanged, including scripts, dependencies, and devDependencies.Project Name Derivation
The project name is derived from the directory path you provide:- Absolute path:
zvelte create /home/user/projects/my-app→ name:my-app - Relative path:
zvelte create ./awesome-project→ name:awesome-project - Current directory:
zvelte create .→ name:current-directory-name
path.basename() function to extract only the final segment of the path.
Customization
After project creation, you can manually edit yourpackage.json to:
- Add a meaningful description
- Update the version number as your project evolves
- Change the name if needed
- Add additional metadata like author, license, keywords, and repository information
The automatic updates only happen once during project creation. Subsequent runs of Zvelte commands won’t modify your package.json file.