Skip to content

Do not automatically add package.json #18

Closed as not planned
Closed as not planned

Description

@mymx2

pr: mymx2/starter-gradle#71

see workflow job

   2 files changed, 13 insertions(+)
   create mode 100644 package.json
   create mode 100644 pnpm-lock.yaml

see workflows/auto-fix-lockfile.yml

Activity

  1. fengmk2 commented on Mar 22, 2026

    @fengmk2
    Member

    Do you only need node and pnpm under https://github.com/mymx2/starter-gradle/tree/main/docs? If so, I need to look into supporting the default directory path for executing vp install.
    Because setup-vp defaults to executing in the root directory, it automatically adds package.json.

  2. self-assigned this
    on Mar 22, 2026
  3. mymx2 commented on Mar 22, 2026

    @mymx2
    Author

    Yes, the project only needs a Node environment and doesn’t require automatically adding a package.json file.

  4. mymx2 commented on Jul 8, 2026

    @mymx2
    Author

    run-install defaults to true, so vp install runs in the workspace root regardless of whether a manifest exists there.
    I think defaulting to false would be more appropriate because:
    Principle of least surprise — An action named "setup" should set up the tool, not also install project dependencies. Comparable actions like actions/setup-node and actions/setup-java don't auto-install dependencies either.
    Non-destructive by default — With the current default, vp install creates files on disk (package.json, pnpm-lock.yaml) even when no manifest exists. This is a side effect that can pollute repositories and lead to unintended commits.
    Easy opt-in — Users who want the convenience can simply add run-install: true. The current behavior of requiring an explicit run-install: false in every workflow is error-prone and easy to miss.
    Of course, this is a breaking change, so it would need to be part of a major version bump. Just wanted to share the feedback — happy to hear your thoughts.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions