-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a sass_api package and publishing infrastructure
- Loading branch information
Showing
21 changed files
with
364 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ package-lock.json | |
/benchmark/source | ||
node_modules/ | ||
/doc/api | ||
/pkg/*/doc/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## 1.0.0-beta.1 | ||
|
||
* Initial beta release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
This package exposes additional APIs for working with [Dart Sass], including | ||
access to the Sass AST and its load resolution logic. | ||
|
||
[Dart Sass]: https://pub.dev/packages/sass | ||
|
||
This is split out into a separate package because so that it can be versioned | ||
separately. The `sass_api` package's API is expected to evolve more quickly than | ||
the Sass language itself, and will likely have more breaking changes as the | ||
internals evolve to suit the needs of the Sass compiler. | ||
|
||
## Depending on Development Versions | ||
|
||
Sometimes it's necessary to depend on a version of a package that hasn't been | ||
released yet. Because this package directly re-exports names from the main | ||
`sass` package, you'll need to make sure you have a Git dependency on both it | ||
*and* the `sass` package: | ||
|
||
```yaml | ||
dependency_overrides: | ||
sass: | ||
git: | ||
url: git://github.com/sass/sass | ||
ref: main # Replace this with a feature branch if necessary | ||
sass_api: | ||
git: | ||
url: git://github.com/sass/sass | ||
ref: main # Make sure this is the same as above! | ||
path: pkg/sass_api | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
dartdoc: | ||
categories: | ||
AST: | ||
markdown: doc/ast.md | ||
name: Abstract Syntax Tree | ||
Dependencies: | ||
markdown: doc/dependencies.md | ||
Importer: | ||
markdown: doc/importer.md | ||
Parsing: | ||
markdown: doc/parsing.md | ||
Compile: | ||
markdown: doc/compile.md | ||
Value: | ||
markdown: doc/value.md | ||
Visitor: | ||
markdown: doc/visitor.md | ||
ignore: [reexported-private-api-across-packages] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Classes representing Sass's abstract syntax tree. | ||
|
||
Certain AST classes, most notably [`Stylesheet`], have `parse()` constructors | ||
that parse ASTs from string sources. | ||
|
||
[`Stylesheet`]: ../sass/Stylesheet-class.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../doc/compile.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APIs for resolving dependencies between Sass files. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../doc/importer.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
APIs that parse Sass or CSS source. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../doc/value.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Classes that implement the [visitor pattern] for traversing the Sass [AST]. | ||
Callers can either implement interfaces like [`StatementVisitor`] from scratch | ||
to handle *all* Sass node types, or extend helper classes like | ||
[`RecursiveStatementVisitor`] which traverse the entire AST to handle only | ||
specific nodes. | ||
|
||
[visitor pattern]: https://en.wikipedia.org/wiki/Visitor_pattern | ||
[AST]: AST-topic.html | ||
[`StatementVisitor`]: ../sass/StatementVisitor-class.html | ||
[`RecursiveStatementVisitor`]: ../sass/RecursiveStatementVisitor-class.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2021 Google Inc. Use of this source code is governed by an | ||
// MIT-style license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
/// We strongly recommend importing this library with the prefix `sass`. | ||
library sass; | ||
|
||
import 'package:sass/sass.dart'; | ||
import 'package:sass/src/parse/parser.dart'; | ||
|
||
export 'package:sass/sass.dart'; | ||
export 'package:sass/src/ast/node.dart'; | ||
export 'package:sass/src/ast/sass.dart' hide AtRootQuery; | ||
export 'package:sass/src/async_import_cache.dart'; | ||
export 'package:sass/src/exception.dart' show SassFormatException; | ||
export 'package:sass/src/import_cache.dart'; | ||
export 'package:sass/src/visitor/find_dependencies.dart'; | ||
export 'package:sass/src/visitor/interface/expression.dart'; | ||
export 'package:sass/src/visitor/interface/statement.dart'; | ||
export 'package:sass/src/visitor/recursive_ast.dart'; | ||
export 'package:sass/src/visitor/recursive_statement.dart'; | ||
export 'package:sass/src/visitor/statement_search.dart'; | ||
|
||
/// Parses [text] as a CSS identifier and returns the result. | ||
/// | ||
/// Throws a [SassFormatException] if parsing fails. | ||
/// | ||
/// {@category Parsing} | ||
String parseIdentifier(String text) => | ||
Parser.parseIdentifier(text, logger: Logger.quiet); | ||
|
||
/// Returns whether [text] is a valid CSS identifier. | ||
/// | ||
/// {@category Parsing} | ||
bool isIdentifier(String text) => | ||
Parser.isIdentifier(text, logger: Logger.quiet); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: sass_api | ||
# Note: Every time we add a new Sass AST node, we need to bump the *major* | ||
# version because it's a breaking change for anyone who's implementing the | ||
# visitor interface(s). | ||
version: 1.0.0-beta.1 | ||
description: Additional APIs for Dart Sass. | ||
author: Sass Team | ||
homepage: https://github.com/sass/dart-sass | ||
|
||
environment: | ||
sdk: '>=2.12.0 <3.0.0' | ||
|
||
dependencies: | ||
sass: 1.37.0 | ||
|
||
dependency_overrides: | ||
sass: {path: ../..} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.