Comments (5)
Would love to know! I can see a way to detect whether you are run from a dev. environment. If your cwd contains a pubspec.yaml
, and the name
property is equal to your app, I think that indicates that you are running in a source checkout of your app.
A local pub run (pub run
) of an app that is not the one under development (running packages/grinder
in a foobar project), would have the pubspec be for foobar, not grinder.
A pub global activated app will be run from the user's cwd, and the cwd won't be related to where the app's actual code and assets are. Perhaps we could also use the Uri.base
property as well? I think for some (all?) pub global activated apps, it's an http: address rather than a file: based one?
The best we may be able to do is infer things for now; not sure what the recipe is though.
from pub_cache.
Happy to put the logic in this package, or in a better location, if we can determine a good way to detect the different runtime configurations.
from pub_cache.
I'm writing it now for dartdoc, would love a review when I'm done.
from pub_cache.
Here's a shot at it: https://github.com/dart-lang/dartdoc/blob/warning-on-snapshot/lib/resource_loader.dart
Handles loading a package: resource, under the following scenarios:
- Just running via the Dart VM
- Running via pub run + HTTP + source rewriting to HTTP URIs for imports
- Running via snapshot in global_package directory (this was the tough one)
Does not handle:
- Respecting package-root, it currently just looks for a package/ dir in most scenarios
- Probably a billion small details
Would love to discuss this strategy. For now, it might enough until we can load any resource with package: with core SDK capabilities.
from pub_cache.
tabling this for now
from pub_cache.
Related Issues (17)
- add info about which scripts an activated package has HOT 1
- make sure we support path activations
- Publish to pub ? HOT 2
- Lib throws when encounters a Git repo's pubspec.yaml without a version HOT 2
- rev and publish a new version
- Remove --preview-dart-2 flag
- publish 0.2.1 HOT 3
- Fix travis
- Use PUB_HOSTED_URL for hosted packages HOT 2
- Problems running my flutter app HOT 2
- improve docs
- searching for the pub folder HOT 5
- No packages found when running MacOS HOT 4
- intent to discontinue
- getBinaries() ==> getBinScripts()?
- support git packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pub_cache.