Skip to content

Add "prepare" as alias to "build" by default #1283

@vmx

Description

@vmx

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

npm allows to point to GitHub repositories for packages. This is useful during development. Usually you would make changes locally and link them. When you then want to share it with others, they also need to go through some linking steps. Pointing to a GitHub repository directly makes sharing easier. Someone can just check it out and do a build as usual, no additional steps needed.

Most projects using Aegir need a build step, especially the TypeScript ones. The problem is, that those point their exports to the build artifacts. If you use those as a direct GitHub dependency the build will fail, as the repository obviously only contains the source, but not the artifacts.

Describe the solution you'd like

Therefore I'd like to introduce the "prepare" script. It would be an alias for "build". If such a prepare script exists, then npm will automatically run that after fetching the project from GitHub. This way the exports work as expected as the build artifacts are now there.

Describe alternatives you've considered

One could add the prepare script manually whenever you do such a fork. The problem is, that you need to be aware that that's one solution to the problem (I wasn't until recently).

You could also check-in the build artifacts into your fork. But also that is less convenient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions