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

Terser syntax through well-documented defaults and inference #16

Open
jsejcksn opened this issue Jun 29, 2020 · 4 comments
Open

Terser syntax through well-documented defaults and inference #16

jsejcksn opened this issue Jun 29, 2020 · 4 comments

Comments

@jsejcksn
Copy link

jsejcksn commented Jun 29, 2020

Issue Type

  • Feature Request

It appears that one of the primary goals of this project is to reduce typing. I think every programmer loves that.

It might be possible to allow for even terser syntax by establishing and documenting some sensible defaults and inference behavior. Here are some suggested considerations:

Default script:

For example, one could use the command denox run, which would be expanded to denox run default. (I gave default as the example here, but maybe you like main, etc.)

Example:

deno-workspace.yaml

scripts:
  default:
    file: main.ts
    deno_options:
      allow-net: example.com

shell

> denox run
# equal to:
# deno run --allow-net=example.com main.ts

Inferring file from script:

Likewise, in deno-workspace.scripts:
If a script does not provide a value for file, it could be inferred from its script key—this would allow it to be an optional property if people would like to organize scripts directly by file name. This practice provides the advantage of native terminal tab-completion and also promotes an organizational structure which aligns with the workspace filesystem.

Example:

This:

scripts:
  main.ts:
    file: main.ts
    deno_options:
      allow-net: example.com

could be equal to:

scripts:
  main.ts:
    deno_options:
      allow-net: example.com
@BentoumiTech
Copy link
Owner

BentoumiTech commented Aug 11, 2020

With the future possibility to specify cmd instead of file #15 , I'm afraid adding a terser syntax would result in more confusion.

@jsejcksn
Copy link
Author

@BentoumiTech I can see how that would complicate things. However, #19 addresses this.

@vintprox
Copy link

vintprox commented Oct 20, 2020

denox run is faster to type than denox start (or current denox run start), I like this change!

@ghost
Copy link

ghost commented Oct 23, 2021

What the workspace file look like if there was added support for deno test and not only deno run?
#7 (comment)

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

No branches or pull requests

3 participants