Tech-Talk-FS / create-fso-stack

0 stars 0 forks source link

Research: Vite create method #1

Open IrwinJames-FS opened 13 hours ago

IrwinJames-FS commented 13 hours ago

Find a cli command option that will create a vite project without needing to interact with vite cli interface.

BradleyMatera commented 13 hours ago

Automating Vite Project Creation Without CLI Prompts

Edit or Add Comments for Finalizing the Product

Below, you’ll find specific commands for each package manager, along with templates tailored for different JavaScript frameworks. Feel free to edit or add comments on each command example to clarify or refine for your needs.

Plan: Close this issue out with final cmd decided

Pros: Automating Vite project setup saves time and boosts efficiency, especially in scripting and CI/CD workflows. Using non-interactive commands ensures consistency and eliminates manual input errors.

Cons: Limited customization during setup might require additional configuration steps later, especially for projects needing tailored setups.

Commands for Non-Interactive Vite Project Setup [Delete/Add AS NEEDED]

1. Creating a Vite Project with npm

To create a new Vite project using npm without any interactive prompts:

npm create vite@latest my-project -- --template react

Explanation:

Source: Vite Official Guide - npm Command

2. Creating a Vite Project with yarn

If you prefer using yarn:

yarn create vite my-project --template react

Explanation:

Source: Yarn Guide - Vite Template Usage

3. Creating a Vite Project with pnpm

For pnpm users:

pnpm create vite my-project -- --template react

Explanation:

Source: PNPM Documentation - Template Setup

4. Using the Vue Template

To create a Vite project with a Vue template using npm:

npm create vite@latest my-vue-app -- --template vue

Explanation:

Source: Vue CLI - Vite Integration

5. Additional Template Options

Vite supports a range of templates. Here are some additional commands for different frameworks:

Vanilla JavaScript Template:

npm create vite@latest my-vanilla-app -- --template vanilla

TypeScript with React:

npm create vite@latest my-react-ts-app -- --template react-ts

Svelte Template:

npm create vite@latest my-svelte-app -- --template svelte

Explanation: Each command follows the same structure with my-app-name as the project name and the appropriate --template option for the desired framework.

Sources

  1. Vite Official Guide - npm Command
    Provides an overview and usage instructions for creating a Vite project using npm commands.

  2. Yarn Guide - Vite Template Usage
    Outlines how to use Yarn for initializing projects, including setting up a Vite project with templates.

  3. PNPM Documentation - Template Setup
    Describes how to use pnpm to create projects, with specific instructions for creating a Vite project.

  4. Vue CLI - Vite Integration
    Details integrating Vue with Vite and using Vite's CLI for non-interactive project setups.

  5. Vite Template Documentation
    Explains Vite's supported templates and their setup, offering examples across various frameworks.

Summary of Commands

Framework Command
React (npm) npm create vite@latest my-project -- --template react
React (yarn) yarn create vite my-project --template react
React (pnpm) pnpm create vite my-project -- --template react
Vue npm create vite@latest my-vue-app -- --template vue
Vanilla JS npm create vite@latest my-vanilla-app -- --template vanilla
React TS npm create vite@latest my-react-ts-app -- --template react-ts
Svelte npm create vite@latest my-svelte-app -- --template svelte

For more details, refer to the Vite Documentation.

This non-interactive setup is efficient and adaptable to various workflows, allowing automated project creation without manual intervention.

Bradley Matera

Web Developer | Student
GitHub
LinkedIn
Email