Skip to content

barback: allow source assets at top-level of package #19434

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
DartBot opened this issue Jun 13, 2014 · 7 comments
Closed

barback: allow source assets at top-level of package #19434

DartBot opened this issue Jun 13, 2014 · 7 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 13, 2014

This issue was originally filed by @seaneagan


I'd like to write a transformer to copy a package's "pubspec.yaml" to a sub-directory (e.g. "lib") that's available when running pub serve/build/run/issue #18539, but from:

https://www.dartlang.org/tools/pub/assets-and-transformers.html

"An asset can be in any root level directory of your package"

So I assume that means source assets cannot be at the top-level as "pubspec.yaml" is.

Can that restriction be relaxed?

@kasperl
Copy link

kasperl commented Jun 16, 2014

Added Area-Pkg, Pkg-Barback, Triaged labels.

@nex3
Copy link
Member

nex3 commented Jun 16, 2014

Unfortunately, this restriction is pretty important. Pub makes a lot of assumptions that the publicly-accessible files in your package are exactly those in lib/. These assumptions are necessary for performance, since listing and loading the contents of every file in every dependency can be extremely painful, and for correctness, since users may not want or expect their transformers to run on files outside lib (or web/ or bin/, if they're using serve, build, and/or run).


Added NotPlanned label.

@DartBot
Copy link
Author

DartBot commented Sep 23, 2014

This comment was originally written by @seaneagan


I see there is a $include configuration that can be passed to a transformer in the pubspec. Why not let $include refer to files at the top-level:

transformers:
  copy_to_lib:
    $include: pubspec.yaml

@nex3
Copy link
Member

nex3 commented Sep 23, 2014

Although semantically that may work, there are a lot of technological issues. Pub has a lot of logic that assumes a certain set of directories to be relevant, and that filters down to stuff like directory watching and publishing in complex ways.

We do want to find a way to provide packages' versions to the program, but I don't think this is how we'll do it.

@DartBot
Copy link
Author

DartBot commented Nov 6, 2014

This comment was originally written by @seaneagan


Here is another use case for accessing top-level files from transformers:

https://github.com/sethladd/dartdoc/issues/2

@nex3
Copy link
Member

nex3 commented Nov 12, 2014

Issue #21574 has been merged into this issue.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/barback#53.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-not-planned Closed as we don't intend to take action on the reported issue type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants