-
Notifications
You must be signed in to change notification settings - Fork 9
barback: allow source assets at top-level of package #53
Comments
<img src="https://avatars.githubusercontent.com/u/2156198?v=3" align="left" width="48" height="48"hspace="10"> Comment by kasperl Added Area-Pkg, Pkg-Barback, Triaged labels. |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 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. |
<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment 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: |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 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. |
<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan Here is another use case for accessing top-level files from transformers: |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 Issue dart-lang/pub#1191 has been merged into this issue. |
<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#19434
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 dart-lang/pub#970, 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: