Commit Graph

317 Commits

Author SHA1 Message Date
Natalie Weizenbaum
028b2f6a01 Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:25:49 -07:00
Natalie Weizenbaum
015a76cf0b Revert "Add a map.deep-merge() function (#1077) (#1080)"
This reverts commit 315e86b442.

Once again, this was supposed to go on feature.nested-maps.
2020-09-15 16:24:53 -07:00
Natalie Weizenbaum
315e86b442
Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:23:01 -07:00
Natalie Weizenbaum
9503b57ac5 Revert "Add a map.deep-merge() function (#1077)"
This reverts commit bc7216a441.

This was intended to land on a feature branch, not on master.
2020-09-15 15:17:55 -07:00
Natalie Weizenbaum
bc7216a441
Add a map.deep-merge() function (#1077)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 13:03:38 -07:00
Jennifer Thakar
830bb3aab2
Move Node tests on Windows to Travis (#1063)
* Move Node tests on Windows to Travis

Appveyor is flaky and can't be restarted by all team members, so moving
everything to Travis is preferable if we can get it to work.

* Actually use latest stable Node

This should also workaround the issue with lts/* not working on
Windows.

* Use npm.cmd instead of raw npm on Windows

* Use p.prettyUri() for Node API tests

Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2020-09-08 09:23:46 -07:00
Natalie Weizenbaum
1dff9a7ce4
Don't crash when writing Infinity in JS mode (#1069)
Closes #1031
2020-09-04 12:25:42 -07:00
Awjin Ahn
e302719e15
Update error handling to be asymmetric. (#18)
(As per the protocol spec)
2020-08-26 14:10:13 -07:00
Natalie Weizenbaum
b046b97c9e Use cli_pkg's testing infrastructure 2020-07-21 16:21:24 -07:00
Natalie Weizenbaum
5b99160a15 Fix an outdated test 2020-07-20 19:19:44 -07:00
Jennifer Thakar
7d6dae02a4
Always use absolute URLs in stdout source maps (#1021)
Fixes #1020.
2020-06-04 17:03:06 -07:00
awjin
21a1c58b20 Don't read file if Node importer returns file and contents.
Instead, use `contents` with `file` as the canonical url.

Closes https://github.com/sass/dart-sass/issues/975.
2020-04-24 17:38:30 -07:00
Jennifer Thakar
7160b6426d
Add missing constants to JS API (#990)
Fixes #977.
2020-04-24 16:11:46 -07:00
Natalie Weizenbaum
83ec64a1f2
Work around dart-lang/sdk#41259 (#984) 2020-04-21 16:03:58 -07:00
georgpukk
4d78316cb7
Fix a check that prevents compiling .css files to themselves (#968)
Co-Authored-By: Natalie Weizenbaum <nweiz@google.com>
2020-03-11 14:48:00 -07:00
Natalie Weizenbaum
f8c74d1315 Add a regression test for #550 2020-02-24 19:03:23 -08:00
Natalie Weizenbaum
c5daba6439
Don't load cli_pkg/testing on Node (#959)
This transitively loads dart:mirrors, which has stopped working as of
Dart 2.8.0-dev.9.0.

See dart-lang/sdk#40698
2020-02-19 22:42:33 -08:00
Natalie Weizenbaum
a95c5b8ccb Do variable index adjustments when accessing variables, not nodes
Doing this for variable *nodes* was breaking in extremely specific
circumstances:

* A null node is passed into setVariable() and, if source maps are
  enabled, recorded in _variableNodes.

* Later on, getVariableNode() is called for that variable. Because
  that variable's node is null, it calls
  _getVariableNodeFromGlobalModule() even though the variable is
  actually defined.

* _getVariableNodeFromGlobalModule() sets _lastVariableIndex to 0 on
  the assumption that the variable is undefined, which turns out to be
  incorrect in this specific case.

The next commit will fix the issue where a null node can be passed
into setVariable() when source maps are enabled, but it makes more
sense to assign the variable index to 0 in the variable access anyway,
since it happens first and isn't skipped when source maps are
disabled.
2020-02-07 00:51:46 -08:00
Natalie Weizenbaum
5450c1c07b
Use cli_pkg to build and release executables (#924) 2020-01-24 13:05:04 -08:00
Natalie Weizenbaum
eeeac1d689
Give JavaScript value objects useful constructor.name values (#936)
Closes #810
2020-01-17 14:46:10 -08:00
Natalie Weizenbaum
7ddd7563ca Add a test case to verify that the pubspec version is bumped 2020-01-15 17:35:32 -08:00
Natalie Weizenbaum
27c32d0582 Fix an error test 2020-01-14 16:54:23 -08:00
Natalie Weizenbaum
ca63b1ba7d
Don't try to resolve relative Node importer URLs for source maps (#923)
* Don't try to resolve relative Node importer URLs for source maps

Closes #922

* Reformat
2020-01-09 13:14:44 -08:00
Jennifer Thakar
bfdf4b35a4
Fix import-only files for Node importers (#919) 2020-01-03 15:41:12 -08:00
Jennifer Thakar
79d9a73474
Cache separate canonical URLs for @use and @import (#908)
Fixes #899.

The cache for canonical URLs is now keyed on *both* the rule URL and
whether that URL was canonicalized for an `@import` rule.
2020-01-02 15:25:02 -08:00
Natalie Weizenbaum
f1410ffac1
Fix invalid YAML in .travis.yml (#887)
This also adds a test to verify that all YAML files are valid. Travis
won't run tests at all if its YAML is invalid, but this way Appveyor
can warn about broken Travis config and vice versa, and a local test
run will warn about either.
2019-11-19 14:27:20 -08:00
Awjin Ahn
3d1dab3563 Print call-site for @errors in mixins and functions (#878)
For any @errors encountered in mixins or functions, use the call-site
(instead of the @error rule) as the span printed in the error message.

Closes #474
See sass/sass-spec#1494
2019-11-13 17:56:35 -08:00
Natalie Weizenbaum
03805ce1ce
Add support for first-class function value types (#10) 2019-11-11 13:36:13 -08:00
Natalie Weizenbaum
6b34ffd7f3
Add the ability to invoke functions (#9)
This doesn't yet support first-class function values.
2019-11-08 15:25:42 -08:00
Natalie Weizenbaum
95bb3aceb6
Add support for importers (#8) 2019-11-07 16:03:47 -08:00
Natalie Weizenbaum
20978e0320 Fix new strict inference hints from Dart 2.6 2019-11-06 14:47:24 -08:00
Natalie Weizenbaum
ec05600af2
Emit LogEvents (#6) 2019-11-05 13:51:08 -08:00
Natalie Weizenbaum
3de78be2f0
Plug in the actual Sass compiler (#5)
This now supports real CompileRequest and CompileResponses, although
it's missing features like importers, custom functions, and source
maps.
2019-11-04 19:50:50 -08:00
Natalie Weizenbaum
44059573bb
Watch files through @forward rules (#871)
Closes #870
2019-11-04 13:32:27 -08:00
Natalie Weizenbaum
ebdcb23d79 Run from script or native snapshots in tests if available 2019-11-04 12:04:02 -08:00
Natalie Weizenbaum
7489d5796d Add a very basic protocol dispatcher and a few tests
Currently this doesn't actually invoke the compiler, it just always
returns the expanded output for "a {b: c}".
2019-11-01 19:02:12 -07:00
Natalie Weizenbaum
7f75f80fb4 Make the test StreamController work with lengthDelimitedEncoder 2019-10-30 12:11:12 -07:00
Natalie Weizenbaum
3392db0074
Don't compile .css files in directories to themselves (#862)
This also adds support for compiling .css files in directories *at
all*, which had previously only worked in --watch mode.

Closes #853
2019-10-29 23:48:21 +00:00
Natalie Weizenbaum
be35dbb7cc
Add a length-delimited StreamChannelTransformer (#1)
This implements the packet scheme that the embedded protocol uses when
communicating over stdin and stdout.
2019-10-29 21:05:18 +00:00
XhmikosR
a95d61e886 Typo fixes (#842) 2019-10-10 15:33:36 -07:00
Natalie Weizenbaum
586a0eb703 Code review change 2019-10-01 15:05:11 -07:00
Natalie Weizenbaum
93a3a6f9f3 Merge branch 'master' into feature.use 2019-09-24 17:20:39 +01:00
Natalie Weizenbaum
24cd96665d Mitigate watch test flakiness 2019-09-11 12:12:44 -07:00
Natalie Weizenbaum
aea990d4fc
Properly watch .css files for changes (#814)
Closes #806
2019-09-03 16:42:21 -07:00
Natalie Weizenbaum
4ccddf8b13
Dash-normalize user-defined functions (#813)
Closes #811
2019-09-03 16:00:07 -07:00
Natalie Weizenbaum
8dea51d410
Change variable syntax to namespace.$name (#803)
See sass/sass#2731
2019-08-29 15:31:03 -07:00
Natalie Weizenbaum
5349042994
Allow @use in the REPL (#784) 2019-07-30 00:51:54 +01:00
Natalie Weizenbaum
6775490251 Merge remote-tracking branch 'origin/master' into merge-master 2019-07-25 17:15:27 -07:00
Natalie Weizenbaum
7b3a2adc12 Properly indicate the error location in the REPL
Previously, errors in variable assignment lines would be reported
incorrectly.
2019-07-17 15:45:00 -07:00
Natalie Weizenbaum
437e04ea0b Merge remote-tracking branch 'origin/master' into feature.use 2019-07-16 18:49:15 -07:00
Natalie Weizenbaum
47e0cfc8c8 Empty maps have undecided separators
Closes #737
2019-07-03 15:31:56 -07:00
Natalie Weizenbaum
6f89055ea6
Add support for "@use with" (#728) 2019-06-26 17:34:24 -07:00
Natalie Weizenbaum
e4b18b5231
Produce better stack traces for syntax errors loaded via import/use (#722)
We now wrap _withStackFrame() around wider sections of code, including
_loadStylesheet() which handles parse errors, so that the @use/@import
stack frames are available.
2019-06-18 17:26:46 -07:00
Natalie Weizenbaum
bea609d74b
Add a top-level warn() function for functions and importers (#711)
In addition to being useful for users of Sass, this will make it
possible for core Sass functions to produce warnings without needing
an explicit reference to the evaluator.
2019-06-06 19:42:44 +01:00
Natalie Weizenbaum
11e3749721
Merge pull request #709 from sass/analysis
Enable stricter analysis options, especially around typing
2019-05-31 17:01:13 +01:00
Natalie Weizenbaum
ac38653776 Enable strict raw types 2019-05-31 16:01:49 +01:00
Natalie Weizenbaum
79e9bbd816 Enable strict inference 2019-05-31 15:54:59 +01:00
Natalie Weizenbaum
1340ba7b8a Enable and fix (most) pedantic lints 2019-05-31 15:18:59 +01:00
Natalie Weizenbaum
2836780339
Merge pull request #689 from sass/exponent
Fix some number serialization bugs
2019-05-24 15:09:37 -07:00
Natalie Weizenbaum
0fe0208f6e Remove exponent notation for integers on Node.js
Closes #688
2019-05-21 13:36:36 -07:00
Natalie Weizenbaum
768da7088c
Resolve imports using custom imports before load paths (#687)
Closes #681
2019-05-20 15:34:57 -07:00
Natalie Weizenbaum
db87ed2f0e
Use the new Dart 2.3.0 literal syntax (#684) 2019-05-17 18:02:12 -07:00
Natalie Weizenbaum
7c9d63a4dc Reformat with the latest formatter 2019-05-15 18:17:26 -07:00
Natalie Weizenbaum
34c068a189
Generate a CSS file describing an error when one occurs (#659)
Closes #657
2019-05-02 18:14:25 -07:00
Natalie Weizenbaum
407eefded1
Add support for attribute selector modifiers (#658)
Closes #656
2019-04-30 11:31:18 -07:00
Natalie Weizenbaum
80b70b9dc2 Skip synchronize_test on Windows 2019-04-25 11:51:29 -07:00
Natalie Weizenbaum
7bd0f422b9 Test Windows and OS X on Travis 2019-04-25 11:51:27 -07:00
Natalie Weizenbaum
3b3a43a8f9
Add a --charset flag and API option (#644)
The automatic @charset adding is useful in general, but there are
consistently cases where it trips up naïve downstream tools. This
option makes it easier for users to control when it occurs.
2019-04-08 14:49:08 -07:00
Natalie Weizenbaum
495c6f3163
Only claim "package:" URLs are unsupported on Node (#637)
Closes #630
2019-04-04 12:17:36 -07:00
Natalie Weizenbaum
8c9412b520
Fix importing files relative to "package:" imports (#638)
The PackageImporter wasn't accepting paths relative to its
canonicalized outputs as inputs.

Closes #631
2019-04-03 13:57:52 -07:00
Natalie Weizenbaum
9999835df0
Add a sass.types.Error constructor to the JS API (#627)
Closes #590
2019-04-03 01:07:12 -07:00
Natalie Weizenbaum
bc5e3c4f8f
Properly parse CR, CR LF, and FF as newlines everywhere (#626)
Closes #623
2019-03-18 16:50:23 -07:00
Natalie Weizenbaum
b102dc496a
Allow individual directories to be passed on the command-line (#581)
Closes #543
2019-02-01 14:59:58 -08:00
Natalie Weizenbaum
e8ac314f56
Support dart-lang/source_span#25 (#566)
This adds a --no-unicode option to disable Unicode span rendering,
decouples repl highlighting from SourceSpan.highlight, and updates
tests to work with the new error highlighting.

It also tightly scopes source spans for statements with children.
Previously, source spans for these nodes extended all the way through
any whitespace that followed the node. This led to messy-looking
multiline span highlights with dart-lang/source_span#25.

Now, StylesheetParser.children doesn't consume trailing whitespace.
Instead, we add a helper method StylesheetParser._withChildren that
parses children, creates the appropriate span, and then consumes the
trailing whitespace.
2019-01-28 20:42:32 -05:00
Natalie Weizenbaum
7a75b7b786
Don't canonicalize file case in source maps (#541)
Closes #540
2019-01-04 14:17:18 -05:00
Natalie Weizenbaum
18c0cbdaea
Match Node Sass's this.includePaths behavior for importers (#551)
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2019-01-03 10:48:20 -08:00
Natalie Weizenbaum
759b587364
Don't omit units in numbers in compressed mode (#545)
See https://github.com/sass/sass/issues/649#issuecomment-447033060
2019-01-03 10:47:54 -08:00
Natalie Weizenbaum
06b9fbd812
Merge branch 'master' into windows-path-separator 2018-12-26 14:17:45 -08:00
Natalie Weizenbaum
9f2f11682e
Merge pull request #546 from sass/source-map-urls
Properly use ImportResult.sourceMapUrl for source map URLs
2018-12-20 17:39:28 -08:00
Natalie Weizenbaum
7ae11f1c0e Make synchronize_test draw from the canonical list of synced files 2018-12-20 16:22:43 -08:00
Natalie Weizenbaum
23968148d0 Properly use ImportResult.sourceMapUrl for source map URLs
This also uses data: URLs to refer to stylesheets from stdin in source
maps.
2018-12-20 16:22:43 -08:00
Nicholas Shahan
3a493f23ab
Add documentation comment collection to AST (#548)
- Documentation comments are simply identified by starting with a triple-slash "///". 
- Adjacent comments in indented syntax are now coalesced into a single comment.
2018-12-20 16:08:26 -08:00
Natalie Weizenbaum
519bfa3d6b Match Node Sass's this.includePaths behavior for importers
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2018-12-17 15:30:17 -08:00
Natalie Weizenbaum
94fd7e6e50
Match Ruby Sass's number behavior (#544)
This introduces two changes:

1. It changes the epsilon within which two numbers are considered
   equal to be an order of magnitude smaller than the numeric
   precision. Ruby Sass has always done this, and Dart Sass should
   have but did not until now.

2. It parses the component of a number after the decimal point using
   double.parse() to avoid accumulating floating point errors.
2018-12-13 15:27:08 -08:00
Natalie Weizenbaum
dad8491035
Make types.String.prototype.setValue() de-quote a string (#535)
Closes #513
2018-12-06 15:06:32 -08:00
Natalie Weizenbaum
487e5025ff Reformat with Dart-2-only features 2018-11-15 15:16:24 -08:00
Natalie Weizenbaum
80afdd88f8 Run in Dart 2 runtime mode everywhere 2018-11-14 13:53:53 -08:00
Natalie Weizenbaum
77563be056
Add support for SASS_PATH (#514)
Closes #512
2018-11-05 15:24:14 -08:00
Natalie Weizenbaum
9e18b7e95b
Always include the error location in JS error messages (#511)
Always include the error location in JS error messages

I was trying to match Node Sass's behavior by having Error.formatted
property have more detail than Error.message, but our errors rely on
source snippets for context so this just ended up making them
confusing.
2018-10-31 18:13:04 -07:00
Natalie Weizenbaum
a25bbb3fc7
Add a ParenthesizedExpression class (#503)
This allows us to accurately track the source spans for parenthesized
expressions, which in turn allows us to print accurate error
indications.

Adding a new class for this more accurately represents the structure
of the expression, but it also involves an extra allocation during
parsing and an extra level of nesting during evaluation which could
have a small but real performance impact.

We could alternatively add a package-internal setter for
Expression.span, and update the source span for parenthesized
expressions after they're initially parsed. However, this has its own
downsides: it adds complexity and mutability to the object model; and
many expression classes currently use lazily-generated spans, so
making them settable would require adding extra slots on those
classes.

I decided to go with the extra class because it only adds overhead
when parentheses are actually used in practice, as opposed to adding
overhead to every list/color/etc. The runtime overhead is also likely
to be mitigated if at any point we add a constant-folding step.
2018-10-17 16:52:32 -07:00
Jen Thakar
9a1f322d7f Remove space around combinators in compressed mode (#494)
Complex selectors like "a > b" will now be output as "a>b" in
compressed mode.
2018-10-11 18:03:09 -07:00
Natalie Weizenbaum
0595ac3e71
Fix an import-resolution bug (#488)
When a stylesheet is imported, the parsed stylesheet object is cached
based on its canonical URL. However, the stylesheet.span.sourceUrl was
based on the text of the import that was used to load that stylesheet.
The idea was to make the source URL in stack traces look nicer, but it
meant that relative URLs could be resolved based on the old importer's
URL before being sent to the new importer, which caused bugs.

Now stylesheet.span.sourceUrl is always the canonical URL of the
stylesheet, and thus safe to cache. We then use the import cache to
convert the canonical URL to a human-friendly URL at the point at
which we generate stack traces.

This also deprecates support for relative canonical URLs. The
semantics of these URLs were always unclear, and with the new change
in import internals the old behavior doesn't make much sense. It's
preserved for backwards-compatibility, but deprecated.
2018-10-11 15:06:26 -07:00
Natalie Weizenbaum
0620ccc19a
Fix @debug on stdin (#493) 2018-10-10 15:05:23 -07:00
Natalie Weizenbaum
04ada09a82
Get rid of the dart2 test tag (#477)
We're only ever running tests under Dart 2 now, so it's irrelevant
whether they're Dart 2-only.
2018-09-19 15:28:47 -04:00
Natalie Weizenbaum
1a5eb2a2e3
Fix embedding source maps with non-ASCII characters (#471)
Closes #457
2018-09-11 12:13:43 -07:00
Natalie Weizenbaum
ede9c81e0b
Properly adjust source maps when prepending encoding information (#470)
Closes #469
2018-09-10 15:38:30 -07:00
Natalie Weizenbaum
3346c7974a
Fix analysis hints (#450) 2018-08-15 12:43:55 -07:00
Natalie Weizenbaum
d1bb4a0d6d
Allow a BOM at the beginning of a document (#441)
This was only breaking in JS because apparently dart:io automatically
filters out BOMs.

Closes #437
2018-08-10 16:31:15 -07:00
Natalie Weizenbaum
0f7f9e69a7
Add support for plain CSS imports (#436)
Closes #424
2018-08-10 15:58:15 -07:00
Natalie Weizenbaum
8bffd52729
Don't hang after a syntax error in --watch (#435)
Closes #401
2018-08-03 15:38:16 -07:00
Natalie Weizenbaum
13b8ad6d4d Format 2018-07-23 16:57:21 -07:00
Natalie Weizenbaum
e1750216ee Don't crash when passing includePaths with importer
Closes #412
2018-07-23 16:20:06 -07:00
Natalie Weizenbaum
9bb272dcff
Support Node Sass's sass.types.Color(argb) constructor (#398)
Closes #397
2018-07-03 17:09:54 -07:00
Natalie Weizenbaum
96c46a242e
Add a --stop-on-error flag (#391)
Closes #264
2018-06-29 18:12:36 -07:00
Michael R Fairhurst
cd275705cd Fix places awaiting void, for dart 2 (#393) 2018-06-29 13:20:26 -07:00
Natalie Weizenbaum
425305725b
Add a --poll option (#390)
Partially addresses #264.
2018-06-28 18:20:28 -07:00
Natalie Weizenbaum
c462b82102 Run snapshots in Dart 1 mode
Until dart-lang/sdk#33257 is fixed, this ensures that users get as
much performance as possible.
2018-06-27 15:51:16 -07:00
Natalie Weizenbaum
ecc04665cf
Fix a couple more Grinder invocations (#387) 2018-06-27 14:32:44 -07:00
Natalie Weizenbaum
7e6f03fc18
Run the Dart CLI tests from app snapshots on CI (#383)
This substantially speeds up the test time, and once we re-enable Dart
2 support is should work around dart-lang/sdk#33257.
2018-06-27 13:12:16 -07:00
Natalie Weizenbaum
39eeeb51ef
Add a missing _ignoreErrors() call in StylesheetGraph (#377)
We weren't ignoring errors when reloading a file, which meant that
syntax errors would get surfaced in the wrong place and cause a crash.

Closes #359
2018-06-26 20:10:46 -07:00
Natalie Weizenbaum
a87300a1e9 Use camel-case for grinder task names
This also causes Grinder to use hyphen-separated names for them on the
CLI, rather than underscore-separated.
2018-06-25 16:40:26 -07:00
Natalie Weizenbaum
87e568faa4
Fix a bug where we were setting the base URL of stylesheets wrong (#370)
Closes #369
2018-06-20 17:43:40 -07:00
Natalie Weizenbaum
6693a82f3b
Use the latest test_descriptor features to clean up tests (#366) 2018-06-19 17:50:49 -07:00
Natalie Weizenbaum
fdbccc8625
Ensure that source map comment URLs are relative to the CSS file (#365)
Closes #364
2018-06-19 17:50:37 -07:00
Natalie Weizenbaum
61eea4abd8
Format with the latest formatter version (#363) 2018-06-19 12:46:24 -07:00
Natalie Weizenbaum
c5071ef843 Stop using a deprecated API 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
c626bf5613 Remove casts that are now unnecessary 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
b949f9fe72 Use Dart 2 constants 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
7a2d724cc9 Use of() constructors instead of from() 2018-06-14 16:15:27 -07:00
Natalie Weizenbaum
6ad67a6f28 Remove the workaround for dart-lang/sdk#30098
This un-reverts pull request #320 from sass/remove-path-workaround,
which was reverted by commit 0fb5d25ee2.
2018-06-14 16:15:27 -07:00
Natalie Weizenbaum
f074152f61 Add a tick in a test that's failing on Windows 2018-06-13 16:42:10 -07:00
Natalie Weizenbaum
0519163ae3 Use the standard tick helper rather than a custom sleep 2018-06-13 16:41:29 -07:00
Natalie Weizenbaum
5efa7bf48a Normalize path separators in watch test expectations 2018-06-13 16:41:29 -07:00
Natalie Weizenbaum
6bbb961675 Add a --watch command
Partially addresses #264
2018-06-09 14:13:36 -04:00
Natalie Weizenbaum
3362273c29 Disallow --update and --watch with --interactive 2018-06-09 14:09:20 -04:00
Natalie Weizenbaum
594f936c54 Fix an edge-case bug
If a non-partial stylesheet is next to a partial with the same name,
canonicalizing the source URL would fail. We don't really need to
canonicalize that URL anyway, though, since it's only used for import
loops and such a loop will reload and rerun the entrypoint anyway.
2018-06-08 20:28:38 -04:00
Natalie Weizenbaum
0a21fb7063 Make sure --update surfaces failures properly 2018-06-08 20:28:38 -04:00
Natalie Weizenbaum
b9e1585cf6
Add a helper function for update tests (#348) 2018-06-07 09:54:18 -04:00
Natalie Weizenbaum
c26903e30e
Don't consider drive separators to be path-separating colons (#342)
Closes #340
2018-05-31 20:38:45 -04:00
Natalie Weizenbaum
0fb5d25ee2 Revert "Merge pull request #320 from sass/remove-path-workaround"
This reverts commit 08bfb46f16, reversing
changes made to ad73a91f84.
2018-05-31 14:37:21 -04:00
Natalie Weizenbaum
8435be5f4b Style tweaks 2018-05-30 18:59:49 -04:00
Natalie Weizenbaum
1d7b0aa5ad Merge branch 'master' into jathak-interactive 2018-05-30 18:41:15 -04:00
Natalie Weizenbaum
8e97e66426 Remove unused test/cli_shared.dart
[skip ci]
2018-05-30 18:37:55 -04:00
Natalie Weizenbaum
0c637b2e6a
Split CLI tests into multiple suites (#337) 2018-05-30 18:35:35 -04:00
Natalie Weizenbaum
d4655f22bd
Fix an Importer-calling bug (#338)
We were resolving URLs relative to the canonical URL rather than the
original URL, which broke importers for which those were different,
like the package importer.

Closes #334
2018-05-30 17:47:37 -04:00
Jen Thakar
930f361026 Merge branch 'master' of git://github.com/sass/dart-sass into interactive 2018-05-29 21:33:53 -07:00
Jen Thakar
da44841498 Add TrackingLogger and uses it in --interactive
If a warning or debug message is emitted, and then the line errors,
a simpler error message is output instead of highlighting the bad
input in the original line.
2018-05-29 21:27:36 -07:00
Natalie Weizenbaum
ac8c01a595 Add an --update flag
Partially addresses #264
2018-05-28 16:58:09 -04:00
Natalie Weizenbaum
31c77fb1cc Remove the workaround for dart-lang/sdk#30098 2018-05-28 15:23:47 -04:00
Jen Thakar
eb71e2d5a7 Fix logging and invalid options for --interactive
--interactive now uses the ExecutableOptions' logger, so it respects
the --quiet option.

An invalid option used with --interactive will now be output.
2018-05-26 22:49:13 -07:00
Jen Thakar
6351458f35 Merge branch 'master' of git://github.com/sass/dart-sass into interactive 2018-05-26 21:49:48 -07:00
Jen Thakar
590b2a02c5 Fix bugs in interactive mode
The REPL no longer crashes when syntax errors point after the end of
the input; it also ignores empty lines.
2018-05-26 21:37:18 -07:00
Natalie Weizenbaum
ad73a91f84
Match Node Sass's logic around source map file names (#333)
When sourceMap is a string and outFile is null, Node Sass determines
the source map filename from the input filename.
2018-05-24 19:16:14 -04:00
Natalie Weizenbaum
7c26959156
Node API: generate a source map even when outFile isn't set (#331)
Contrary to documentation, Node Sass generates a source map when
outFile is unset as long as sourceMap is a string.
2018-05-24 18:42:16 -04:00
Natalie Weizenbaum
a7118824b5 Fix source map path canonicalization
We need to canonicalize rather than normalize to ensure a consistent
output.
2018-05-24 17:21:19 -04:00
Natalie Weizenbaum
d17b3e73fe Normalize source map paths before converting to URLs
This ensures that source map URLs are always consistent on Windows,
where the case may be different from run to run.
2018-05-24 12:21:28 -04:00
Natalie Weizenbaum
d68acf9ac2
Support compiling entire directories at once (#324)
Partially addresses #264
2018-05-22 23:06:33 +01:00
Natalie Weizenbaum
1450c241c6 Support input:output syntax for compiling multiple files at once
Partially addresses #264
2018-05-20 20:57:33 +01:00
Jen Thakar
6d86b5fbdf Merge branch 'master' of git://github.com/sass/dart-sass into interactive 2018-05-08 10:23:33 -07:00
Jen Thakar
49198f55ed Add proper error logging to --interactive
Errors are now logged w/o the Sass stack trace and with arrows
pointing to the piece of the input that caused the error.

The bad input will also be highlighted in red if color is enabled.

Adds tests for error logging, both with and without color.
2018-05-08 09:54:35 -07:00