Skip to content

Rename user scripts which use pre and post hooks and explicitly call them from other scripts which use them #3248

@trivikr

Description

@trivikr

Is your feature request related to a problem? Please describe.

In AWS SDK for JavaScript (v3), we user scripts pre hooks which are not supported by modern package managers like yarn berry.

In particular, we intentionally don't support arbitrary pre and post hooks for user-defined scripts (such as prestart). This behavior, inherited from npm, caused scripts to be implicit rather than explicit, obfuscating the execution flow. It also led to surprising executions with yarn serve also running yarn preserve.

Describe the solution you'd like

Rename user scripts which use pre and post hooks to what they do and explicitly call them where required in user scripts.

For example:

  • pretest:all will be removed as build:all exists.
  • pretest:e2e will be renamed to build:e2e.

Describe alternatives you've considered

Explicitly calling commands under pre hook in npm scripts.

Additional context

We noticed this issue while attempting to bump yarn to berry in #3235 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions