| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 /// Contains all warning messages produced by the code_transformers package. | |
| 6 library code_transformers.src.messages; | |
| 7 | |
| 8 import 'package:code_transformers/messages/messages.dart'; | |
| 9 | |
| 10 const NO_ABSOLUTE_PATHS = const MessageTemplate( | |
| 11 const MessageId('code_transformers', 1), | |
| 12 'absolute paths not allowed: "%-url-%"', 'Absolute paths not allowed', ''' | |
| 13 The transformers processing your code were trying to resolve a URL and identify | |
| 14 a file that they correspond to. Currently only relative paths can be resolved. | |
| 15 '''); | |
| 16 | |
| 17 const INVALID_URL_TO_OTHER_PACKAGE = const MessageTemplate( | |
| 18 const MessageId('code_transformers', 2), | |
| 19 'Invalid URL to reach to another package: %-url-%. Path ' | |
| 20 'reaching to other packages must first reach up all the ' | |
| 21 'way to the %-prefix-% directory. For example, try changing the URL ' | |
| 22 'to: %-fixedUrl-%', 'Invalid URL to reach another package', ''' | |
| 23 To reach an asset that belongs to another package, use `package:` URLs in | |
| 24 Dart code, but in any other language (like HTML or CSS) use relative URLs that | |
| 25 first go all the way to the `packages/` directory. | |
| 26 | |
| 27 The rules for correctly writing these imports are subtle and have a lot of | |
| 28 special cases. Please review | |
| 29 <https://www.dartlang.org/polymer/app-directories.html> to learn | |
| 30 more. | |
| 31 '''); | |
| 32 | |
| 33 const INVALID_PREFIX_PATH = const MessageTemplate( | |
| 34 const MessageId('code_transformers', 3), | |
| 35 'incomplete %-prefix-%/ path. It should have at least 3 ' | |
| 36 'segments %-prefix-%/name/path_from_name\'s_%-folder-%_dir', | |
| 37 'Incomplete URL to asset in another package', ''' | |
| 38 URLs that refer to assets in other packages need to explicitly mention the | |
| 39 `packages/` directory. In the future this requirement might be removed, but for | |
| 40 now you must use a canonical URL form for it. | |
| 41 | |
| 42 For example, if `packages/a/a.html` needs to import `packages/b/b.html`, | |
| 43 you might expect a.html to import `../b/b.html`. Instead, it must import | |
| 44 `../../packages/b/b.html`. | |
| 45 | |
| 46 See [issue 15797](http://dartbug.com/15797) and | |
| 47 <https://www.dartlang.org/polymer/app-directories.html> to learn more. | |
| 48 '''); | |
| 49 | |
| 50 const UNSPECIFIED_FROM_IN_NON_LIB_ASSET = const MessageTemplate( | |
| 51 const MessageId('code_transformers', 4), | |
| 52 'Cannot create URI for %-id-% without specifying where to import it from.', | |
| 53 'Missing `from` argument.', ''' | |
| 54 Assets outside of the lib folder can only be imported via relative URIs. Use | |
| 55 the `from` argument in `assetIdToUri` to specify the location in the same | |
| 56 package where you intend to import this asset from. | |
| 57 '''); | |
| 58 | |
| 59 const IMPORT_FROM_DIFFERENT_PACKAGE = const MessageTemplate( | |
| 60 const MessageId('code_transformers', 5), | |
| 61 'Not possible to import %-toId-% from %-fromId-%', 'Cannot import asset.', | |
| 62 ''' | |
| 63 Assets outside of the lib folder can only be imported via relative URIs from | |
| 64 assets in the same package. To import an asset from another package, you need to | |
| 65 move it into the lib folder of your package. | |
| 66 '''); | |
| OLD | NEW |