Skip to content

Commit

Permalink
makefile update, remove dev flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Ujstor committed Dec 16, 2024
1 parent f970444 commit adac587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
12 changes: 2 additions & 10 deletions cmd/program/program.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,18 +828,11 @@ func (p *Project) CreateViteReactProject(projectPath string) error {
fmt.Println("failed to change into project directory: %w", err)
}

// Configure npm to prefer offline and use cache
configCmd := exec.Command("npm", "config", "set", "prefer-offline", "true")
if err := configCmd.Run(); err != nil {
fmt.Println("Warning: Failed to set npm offline preference:", err)
}

// the interactive vite command will not work as we can't interact with it
fmt.Println("Running create-vite (using cache if available)...")
fmt.Println("Installing create-vite (using cache if available)...")
cmd := exec.Command("npm", "create", "vite@latest", "frontend", "--",
"--template", "react-ts",
"--prefer-offline",
"--no-audit",
"--no-fund")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down Expand Up @@ -895,9 +888,8 @@ func (p *Project) CreateViteReactProject(projectPath string) error {
// Handle Tailwind configuration if selected
if p.AdvancedOptions[string(flags.Tailwind)] {
fmt.Println("Installing Tailwind dependencies (using cache if available)...")
cmd := exec.Command("npm", "install", "-D",
cmd := exec.Command("npm", "install",
"--prefer-offline",
"--no-audit",
"--no-fund",
"tailwindcss", "postcss", "autoprefixer")
cmd.Stdout = os.Stdout
Expand Down
2 changes: 1 addition & 1 deletion cmd/template/framework/files/makefile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ build:{{- if and .AdvancedOptions.tailwind (not .AdvancedOptions.react) }} tailw
# Run the application
run:
@go run cmd/api/main.go{{- if .AdvancedOptions.react }} &
@npm install --prefix ./frontend
@npm install --prefer-offline --no-fund --prefix ./frontend
@npm run dev --prefix ./frontend
{{- end }}

Expand Down

0 comments on commit adac587

Please sign in to comment.