Skip to content

Feature request - pub init, install #1413

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

Closed
lteacher opened this issue Apr 27, 2016 · 3 comments
Closed

Feature request - pub init, install #1413

lteacher opened this issue Apr 27, 2016 · 3 comments

Comments

@lteacher
Copy link

Hello,

pub init
I am aware that discussions have been had around the pub init possibility in #1110 and #1135 and probably more. However, I think the point was lost in those issues. I do not think that pub init should scaffold an application folder structure. The command should just create the pubspec with prompts for the minimum required fields. It should be as simple as possible for a new developer to whip out some dart file with maybe some package and run it without any need to go searching for stagehand or knowing all the ins and outs of the directory structure. Whilst it is understandable to promote the correct structure, I think it is more important to make the experience as quick and friendly as possible to get more interest in the language.

A user should be able to literally:

mkdir test
pub init
touch filename.dart
# add their code into it
dart filename.dart

Another issue argued that pub is not about scaffolding, that sounds good to me but initializing this pubspec? why not i mean it can run tests, serve files and all the rest at least it can create the file that is
required for using any additional pub packages. That seems actually more appropriate than serve

And, I know that actually you can just run the dart file without the pubspec but this would be nice and lead to:

pub install[--save|--save-dev]
It would be good to be able to just run pub install and save the dependencies into the pubspec just like.... npm.

Finally, I am aware that these features are just sugary changes to simplify already relatively simple steps needed to do it manually but the reason I am posting this is because I think Dart is fantastic and it needs more exposure and a larger community. Simple things like these can make all the difference so why not?

@zoechi
Copy link

zoechi commented Apr 27, 2016

pub doesn't run tests. pub runs scripts from dependency or global activated packages which can be the test package which contains a test runner.

The creator of #1135 created https://pub.dartlang.org/packages/den which does what you want from pub (creating and updating pubspec.yaml instead of creating full project like stagehand)

@lteacher
Copy link
Author

Well the thing is that I won't know anything about the package without having posted this issue or reading your response. It might be true that it does that sure but why is it better for a new user to need to search and find a random package to perform functions on the pubspec.yaml that is used by pub .

@nex3
Copy link
Member

nex3 commented Apr 27, 2016

This is a duplicate of existing issues, and my opinion hasn't changed: scaffolding and pubspec modification are better handled by third-party tools.

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