sdk icon indicating copy to clipboard operation
sdk copied to clipboard

dartdev: Add empty project template

Open felixwoestmann opened this issue 1 year ago • 8 comments

As I am currently working on an OpenAPI code generator I was looking for a way to create a barebones dart project without any boilerplate. Therefore I propose to add an empty template only adding a minimal configuration.


  • [X] I’ve reviewed the contributor guide and applied the relevant portions to this PR.

felixwoestmann avatar Jul 02 '24 10:07 felixwoestmann

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/374020

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

copybara-service[bot] avatar Jul 02 '24 10:07 copybara-service[bot]

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/374021

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

copybara-service[bot] avatar Jul 02 '24 10:07 copybara-service[bot]

cc @kevmoo @mit-mit @bkonyi

It looks like we currently have:

          [cli]                  A command-line application with basic argument parsing.
          [console] (default)    A command-line application.
          [package]              A package containing shared Dart libraries.
          [server-shelf]         A server app using package:shelf.
          [web]                  A web app that uses only core Dart libraries.

When thinking about the project templates we offer, one of the main things that I would consider would be reducing new user confusion; reducing the questions we ask them that they don't yet have good context to answer. I think having fewer template options here is strictly better (even if each additional template would add some value in its own right). Above, I would actually strip out one (possibly two) options, and wouldn't add any new ones without an overwhelming value add.

(For the existing options above, we definitely don't need two command line starter templates, and its not clear that we need both a command-line and a package template).

devoncarew avatar Jul 08 '24 15:07 devoncarew

Just wanted to bring up that there are community solutions for templates (might help support @devoncarew point). For example, Very Good CLI already provides eight templates for users (those in Very Good Templates). It also has initiatives for creating a minimal templates.

In addition, there is also a whole ecosystem for templates available in BrickHub (with Dart support).

Overall, I'm not sure how many templates would the Dart Dev tool aim to support and maintain, and where to trace the line between what templates get in or not.

alestiago avatar Jul 08 '24 16:07 alestiago

@devoncarew cleanup of the existing templates could be orthogonal to having minimal template that tools could build on top of? Especially if we tweak this proposal so that the minimal template is hidden from --help given it's intended for tools, and not end users?

mit-mit avatar Aug 02 '24 10:08 mit-mit

What is the status of this PR?

mraleph avatar Sep 11 '24 12:09 mraleph

https://dart-review.googlesource.com/c/sdk/+/374021 has been updated with the latest commits from this pull request.

copybara-service[bot] avatar Oct 03 '24 20:10 copybara-service[bot]

I think adding this particular template is reasonable, but moving forward we should avoid adding more templates without investigating our options in this area for the Dart and Flutter CLI tooling.

bkonyi avatar Oct 15 '24 17:10 bkonyi

Hi @felixwoestmann there is one tiny change requested here; are you able to get that done?

mit-mit avatar Nov 04 '24 10:11 mit-mit

Hello @mit-mit I fixed the copyright notice. Thanks for the reminder.

felixwoestmann avatar Nov 04 '24 23:11 felixwoestmann

https://dart-review.googlesource.com/c/sdk/+/374021 has been updated with the latest commits from this pull request.

copybara-service[bot] avatar Nov 04 '24 23:11 copybara-service[bot]

https://dart-review.googlesource.com/c/sdk/+/374021 has been updated with the latest commits from this pull request.

copybara-service[bot] avatar Nov 04 '24 23:11 copybara-service[bot]

It looks like there are some test failures still, cc @felixwoestmann

00:10 [32m+20[0m[31m -1[0m: create empty [1m[31m[E][0m[0m

  Null check operator used on a null value

  pkg/dartdev/test/commands/create_test.dart 165:68  defineCreateTests.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 229:9   Declarer.test.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 227:7   Declarer.test.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/invoker.dart 258:9    Invoker._waitForOutstandingCallbacks.<fn>
  

00:10 [32m+20[0m[31m -1[0m: create empty-project[0m

00:10 [32m+20[0m[31m -2[0m: create empty-project [1m[31m[E][0m[0m

  Null check operator used on a null value

  pkg/dartdev/test/commands/create_test.dart 165:68  defineCreateTests.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 229:9   Declarer.test.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 227:7   Declarer.test.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/invoker.dart 258:9    Invoker._waitForOutstandingCallbacks.<fn>
  

00:10 [32m+20[0m[31m -2[0m: create console-simple[0m

00:11 [32m+21[0m[31m -2[0m: create cli getting started message[0m

00:11 [32m+22[0m[31m -2[0m: create console getting started message[0m

00:11 [32m+23[0m[31m -2[0m: create package getting started message[0m

00:11 [32m+24[0m[31m -2[0m: create server-shelf getting started message[0m

00:11 [32m+25[0m[31m -2[0m: create web getting started message[0m

00:11 [32m+26[0m[31m -2[0m: create empty getting started message[0m

00:11 [32m+26[0m[31m -3[0m: create empty getting started message [1m[31m[E][0m[0m

  Expected: 'dart run example/foo_example.dart'
    Actual: 'dart run'
     Which: is different. Both strings start the same, but the actual value is missing the following trailing characters:  example/f ...
  

  package:matcher/src/expect/expect.dart 152:31      fail
  package:matcher/src/expect/expect.dart 147:3       _expect
  package:matcher/src/expect/expect.dart 56:3        expect
  pkg/dartdev/test/commands/create_test.dart 203:9   defineCreateTests.<fn>
  package:test_api/src/backend/declarer.dart 229:19  Declarer.test.<fn>.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/declarer.dart 227:7   Declarer.test.<fn>
  ===== asynchronous gap ===========================
  package:test_api/src/backend/invoker.dart 258:9    Invoker._waitForOutstandingCallbacks.<fn>
  

00:11 [32m+26[0m[31m -3[0m: create console-simple getting started message[0m

mit-mit avatar Feb 05 '25 09:02 mit-mit

There is also a failing CLA check:

❌ 7dd3a2d Co-Author: <d**​@alestiago.com>

mit-mit avatar Feb 05 '25 09:02 mit-mit

Thanks for the heads up! Regarding the CLA it picked up another email, I can sign the CLA with such email this afternoon.


Update:

I tried signing it in with @alestiago.com and since it's not a Google account, the email that got used was dev%alestiago.com (at) gtempaccount.com. @felixwoestmann feel free to update the commit co-author notice.

alestiago avatar Feb 05 '25 12:02 alestiago

Sorry, we're not able to move this PR forward until 1) the CLA issue is resolved, and 2) the test issue is resolved.

mit-mit avatar Feb 18 '25 12:02 mit-mit

Any updates on this PR, if it is not going to move forward please close it.

a-siva avatar Mar 12 '25 18:03 a-siva