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

Configuration file and module system #3777

Closed
morr0ne opened this issue Jan 24, 2020 · 2 comments
Closed

Configuration file and module system #3777

morr0ne opened this issue Jan 24, 2020 · 2 comments

Comments

@morr0ne
Copy link

morr0ne commented Jan 24, 2020

Having a configuration file and polished module system, like having a deno init command that creates a configuration file
For example, running

deno init awesome-project

would generate the following config.json

{
    "name": "beatiful-project",
    "main": "index.ts",
    "dependencies": {}
}

This would enable to configure the workspace maybe with some flags option

{
    "name": "beatiful-project",
    "main": "index.ts",
    "flags": "--allow-net",
    "dependencies": {}
}

Also this would enable adding depencies kinda the nodejs way while still adding them globally and also generate a lock file for added security
For example, runnning:

dino fetch dirname

would result in

{
    "name": "beatiful-project",
    "main": "index.ts",
    "flags": "--allow-net",
    "dependencies": {
      "dirname": "https://deno.land/x/dirname/mod.ts"
    }
}

and generate a deno.lock file like so

dirname@1.0.0:
  version "1.0.0"
  resolved "https://deno.land/x/dirname/mod.ts"
  integrity "some integrity check"
  dependencies:
     some-depency@0.3.2
     other-depency@2.3.0

This is just my suggestion, maybe the configuration could be in xml the point is that a good module system would be very helpful and also help offline development
Maybe running

deno fetch

will install all needed dependencies

@yardenshoham
Copy link
Contributor

So a package.json?

@ry
Copy link
Member

ry commented Jan 24, 2020

IMHO "init" programs are anti-patterns. It's a poor way to abstract complexity. The boilerplate is too complex, so just have a program generate it for you. That might be an ok solution when you have no control over the system you're "initializing" but in Deno we do. Instead of generating boilerplate, I want to eliminate the boilerplate. Therefore there will not be a "deno init".

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