GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — package.json file already exists in target directory · Issue #701 · fastify/fastify-cli

package.json file already exists in target directory #701

New issue
Copy link
New issue
Copy link
Open
Open
package.json file already exists in target directory#701
Copy link
Labels
feature requestNew feature to be added

Description

@jebarpg
jebarpg
opened on Jan 27, 2024
Issue body actions

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.25.2

Plugin version

No response

Node.js version

21.6.1

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

Clear Linux OS installed version 40410

Description

fastify generate should update the package.json file and not error out that the package.json file already exists. Basically there should be a check for the file and if it exists then read it into a json object then work with adding new key,values that are needed for the generated typescript or javascript project boilerplate. This should be done for the tsconfig.json as well. The npm pkg can be used for this as well npm pkg set
See: https://docs.npmjs.com/cli/v7/commands/npm-pkg

Steps to Reproduce

I run
bun init
to generate a package.json file and tsconfig.json file
then I run
fastify generate --lang=ts .
to generate a typescript project in the current directory and get the error:
a package.json file already exists in target directory

Expected Behavior

No response

Activity

  1. Eomm commented on Jan 28, 2024

    @Eomm
    Eomm
    on Jan 28, 2024
    Member
    More actions

    fastify generate should update the package.json file and not error out that the package.json file already exists.

    Yeah, it is not supported now.

    Would you like to send a Pull Request to address this issue? Remember to add unit tests.

  2. Eomm
    added
    feature requestNew feature to be added
    on Jan 28, 2024
  3. 10xLaCroixDrinker commented on Mar 9, 2024

    @10xLaCroixDrinker
    10xLaCroixDrinker
    on Mar 9, 2024
    Contributor
    More actions

    This does work if you use the --integrate flag since #261

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestNew feature to be added

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.