Giter VIP home page Giter VIP logo

dart_dev's People

Contributors

aaronlademann-wf avatar alexandercampbell-wk avatar annawatson-wk avatar bencampbell-wf avatar charliekump-wf avatar christopherdaly-wf avatar corwinsheahan-wf avatar evanweible-wf avatar georgelesica-wf avatar greglittlefield-wf avatar jayudey-wf avatar joebingham-wk avatar johnbland-wf avatar maxwellpeterson-wf avatar olesiathoms-wk avatar regenvanwalbeek-wf avatar rm-astro-wf avatar rmconsole-readonly-wk avatar rmconsole-wf avatar rmconsole2-wf avatar rmconsole3-wf avatar rmconsole4-wk avatar rmconsole5-wk avatar rmconsole6-wk avatar rmconsole7-wk avatar robbecker-wf avatar smaifullerton-wk avatar timmccall-wf avatar tomconnell-wf avatar travissanderson-wf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dart_dev's Issues

CP-2134 Test: run tests in checked mode

There should at least be an option to run tests in checked mode. As tests are currently being run in a separate process using the pub run test executable, it would require adding the -c/--checked flag to the pub run command. If the test task was updated to run tests programmatically, it would probably just inherit the checked flag from the pub run command used to run dart_dev.

CP-2141 Use dependency APIs instead of executables where possible

Problem

Currently we are using processes to run the executables for the following tasks:

  • dart formatter
  • tests
  • coverage
  • docs

Solution

If possible, we should switch these to using the APIs directly for several reasons:

  • executing the task programmatically is much faster than starting a process to do so
  • typed interaction and results allows us to provide more useful return types for the APIs and more useful output for the CLIs
  • consumers would no longer need to also have the above packages installed as immediate dependencies because we would no longer be using the executables

Resources

Pre-OSS Checklist

  • dartfmt line length option #14
  • Tests #15
  • Licenses #17
  • Update installation instructions to point to actual version (or get rid of it in favor or auto generated version on Pub) #33
  • Changelog #12
  • Prep pubspec.yaml #27
  • Travis CI setup #29
  • Codecov.io setup #30

CP-2144 Format Task: specify list of files to format/check

By default, the format task should use the project's configuration for files to format. But, we should also allow running the formatter on a specific file or set of files. This can be done by allowing additional args to the format CLI that override the default configuration.

Analyze: improve documentation to better explain what "entry points" are and how many are necessary

The dartanalyzer follows imports, which means it's only necessary to analyze the top-level entry points since all other files (that are imported) will be reachable and will be analyzed.

On this same note, the "entryPoints" config option may not be very intuitive since it accepts directories or files and expands directories to look for all top-level files. We may want to leave the file expansion to the shell and only accept a list of files.

CP-2152 Allow dynamic after/before dependencies based on task options

Use Case

Consider a project where..

  • Unit tests can be run without any dependencies.
  • Integration tests require an HTTP server to be running.

Currently, the Test task supports this use case by allowing a project to start the integration server in the before section and kill it in the after section. But, it doesn't do this dynamically based on whether or not the --integration flag was actually included. So when only running unit tests, the integration server would be run unnecessarily, slowing down what should be an extremely fast unit test run.

Possible Solutions

Add fields to the TestConfig class that would allow specific before/after dependencies for each type of test suite. This creates quite a bit of bloat on that config object, however.

Support the passing of selected options/flags to the before/after functions so that they can be dynamically altered at runtime. This would allow the integration server to only start up if the --integration flag is set. This seems like a better approach, but I'm unsure of how to best pass that configuration into the functions because it will require a static function interface.

Task: Apply Licenses to source files

Given that a LICENSE file is present, copy that file to every source file in the repository that does not already include it.

Options

directories: which directories to traverse and add license headers within.
fileTypes: file types to check (.dart, .html, .css)

Increase the dependency range for dart_style

We are currently depending on ^0.2.0 of dart_style, which is still very new. There are a lot of projects that will not have upgraded to that version, which can produce a version range discrepancy. We should widen this range since the our usage is compatible with older versions.

CP-2149 Refactor task APIs and CLIs to be more consistent in their usage and the returned result

Each task should have two static methods:

static Future<TaskResult> run(...);
static Task start(...);

Additionally, each task's done Future should resolve with the TaskResult instance. The CLIs should return this same TaskResult.

Calling .run() is simpler and eventually returns the end result that consumers want. However, calling .start() gives the consumer the opportunity to stream the output to somewhere like stdout for live feedback.

This will allow our integration tests to call into the CLIs directly to programmatically execute the tests instead of spawning new processes to do that. The returned result can then be used easily by the test to verify information about the task without having to parse the stdout output.

CP-2138 Test: add a -l flag to list the test suites available

Currently the tests are split up between unit and integration tests. Eventually, there will be a functional test suite as well. We may add the ability to dynamically define test suites to better organize tests.

With this in mind, it could be helpful to have a -l flag that lists out the test suites that are available.

Additionally, we may want to opportunistically inform the CLI user of the available test suites.. for example:

  • User runs ddev test, which runs the unit test suite
  • Ddev notices that the project has defined an integration test suite as well
  • Print out a line before starting the test run that there are also integration tests available and to use the --integration flag to run them

CP-2145 Uncaught Error: Exception: Coverage formatting failed.

Guys love the idea of ddev... Hopefully by endless grinder task can go away..

Anyhow run into this problem

ddev coverage

::: Collecting coverage

    Running test suite test/cxs_store_test.dart
    dart --observe=56484 test/cxs_store_test.dart

        Observatory listening on http://127.0.0.1:56484
        00:00 +0: A group of tests First Test
        00:00 +1: All tests passed!

    Collecting coverage for test/cxs_store_test.dart
    pub run coverage:collect_coverage --port=56484 -o coverage/collection/test/cxs_store_test.dart.json
    Formatting coverage
    pub run coverage:format_coverage -l --package-root=packages -i coverage/coverage.json -o coverage/coverage.lcov --verbose --report-on=lib/


        Provided package root "packages" is not directory.

        Usage: dart format_coverage.dart [OPTION...]

        -s, --sdk-root        path to the SDK root
        -p, --package-root    path to the package root
        -i, --in              input(s): may be file or directory
        -o, --out             output: may be file or stdout
                              (defaults to "stdout")

            --report-on       which directories or files to report coverage on
        -j, --workers         number of workers
                              (defaults to "1")

        -r, --pretty-print    convert coverage data to pretty print format
        -l, --lcov            convert coverage data to lcov format
        -v, --verbose         verbose output
        -h, --help            show this help
    Coverage formatting failed. Could not generate coverage/coverage.lcov
Unhandled exception:
Uncaught Error: Exception: Coverage formatting failed. Could not generate coverage/coverage.lcov
Stack Trace:
#0      CoverageTask._format.<_format_async_body> (package:dart_dev/src/tasks/coverage/api.dart:280:7)
#1      _RootZone.runUnary (dart:async/zone.dart:1166)
#2      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:494)
#3      _Future._propagateToListeners (dart:async/future_impl.dart:577)
#4      _Future._completeWithValue (dart:async/future_impl.dart:368)
#5      _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:422)
#6      _microtaskLoop (dart:async/schedule_microtask.dart:43)
#7      _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#8      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:895)
#1      _microtaskLoop (dart:async/schedule_microtask.dart:43)
#2      _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#3      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

Dart Version

Dart VM version: 1.12.0-dev.5.9 (Mon Aug 24 03:56:54 2015) on "macos_x64"

Description

I can make this happen consistently, if you use stagehand to set a package-simple project. You will certain hit the problem.

Thanks in advance and keep the work... Just need a way to run dart_doc now.

CP-2151 More intelligent directory support

Tasks like analyze and format currently only target the lib/ directory by default. This could be made more intelligent by checking for the existence of other standard directories (bin/, example/, tool/) and including them only if they exist.

CP-2139 New Task: Code Generation

Feature Request

As a developer I should be able to execute code generation commands with dart dev. I should be able to define a "library search path" in the configuration that defines all the code paths to apply a source_gen Generator class. I should be able to specify a list of of generator classes that will be applied to the given search path items. When I run pub run dart_dev generate the tool should use my configuration for to determine the list of generators and the search paths to generate code.

Codecov.io

  • Setup reporting during CI build
  • Add badge to README

Script for running tests

Command

test

Flags

  • --unit runs unit tests (defaults to on, negatable)
  • --integration runs integration tests (defaults to off)
  • --functional runs functional tests (defaults to off)

Default configuration

  • Runs test runner from test package (pub run test)
  • --integration, --functional have no effect

Configuration

TBD

Examples command throws exception when pub serve encounters dart2js warning

The dart_dev executable throws an exception when it encounters a dart2js warning when serving a non-dartium client. This exception causes the dart_dev process to exit leaving the child pub serve process running.

    [example] GET ....
    [Info from Dart2JS]:
    Compiling <omitted_path>/main.dart...
Unhandled exception:
Uncaught Error: [Dart2JS on <omitted_path>/main.dart]:
#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:895)
#1      _microtaskLoop (dart:async/schedule_microtask.dart:43)
#2      _microtaskLoopEntry (dart:async/schedule_microtask.dart:52)
#3      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

This seems to be an issue when a child process of dart_dev emits output to stderr.

Steps to Reproduce

  • run pub run dart_dev examples with an example that includes code that throws a warning or hint in the dart2js compiler.
  • serve a dartium client to confirm and confirm no error
  • serve a non-dartium(chrome) client and confirm it throws an exception

Copy License: Trim each line when building the license header

The dartformatter removes trailing whitespace from comments, which means after we apply the license text to all source files, the formatter will need to be run. If the copy license task trimmed each line, the generated code should already be "clean".

Fix readme formatting on pub

https://pub.dartlang.org/packages/dart_dev

Issues

  • GitHub tables are not standard markdown - use HTML tables instead
  • Blockquotes end to early..
    • at the beginning rationale
    • under "CLI Usage"
    • under "Programmatic Usage"
  • Headers under "Getting Started" are too small
  • "Project Configuration" code block is missing most of the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.