Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add importable scripts #116

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add importable scripts #116

wants to merge 6 commits into from

Conversation

cvanem
Copy link

@cvanem cvanem commented May 17, 2019

Allow scripts to be imported from a file as an alternative to the standard object hash in the packages.json scripts field. Also define the basic structure of the imported file.

RFC
Documentation: yarnpkg/website#951
PR: yarnpkg/yarn#7284

@arcanis
Copy link
Member

arcanis commented May 17, 2019

Hey! Thanks for the suggestion 😃 I do have one big concern, however: this proposal makes it impossible to statically know what scripts are available. We would always have to execute the Javascript code to figure it out.

@cvanem
Copy link
Author

cvanem commented May 17, 2019

@arcanis Yes, I suppose that is another drawback that should be added. Is this concern due to a performance hit or something else? The Javascript code would only be executed if a filename input is provided.

@cvanem
Copy link
Author

cvanem commented Jun 1, 2019

@arcanis Hey just following up on this. Can you tell me how likely it is that this PR will be accepted anytime soon? The reason I am asking, is that we are currently evaluating some options for cleaning up our scripts. See mui/material-ui#15497

If this is not going to be accepted, then I would like to resolve any issues so it can be accepted, or look at other options, such as using nps.

@zkochan
Copy link

zkochan commented Jul 14, 2019

This is one of the reasons I added support of package.yaml to pnpm (although I am still not sure that was a good idea). But a yaml file (or a json5 file), also satisfies your requirements.

You can write scripts like this:

scripts:
  # This is some comment
  test: >-
    pnpm recursive test
    --reporter append-only
    --workspace-concurrency 1
    --filter ./packages
    --filter ./privatePackages
build: pnpm recursive run tsc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants