-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Comments
Added Area-Pkg, Pkg-Barback, Triaged labels. |
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. |
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: |
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. |
This comment was originally written by @seaneagan Here is another use case for accessing top-level files from transformers: |
Issue #21574 has been merged into this issue. |
This issue has been moved to dart-archive/barback#53. |
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?
The text was updated successfully, but these errors were encountered: