bump version to 0.9.0

This commit is contained in:
ConnorSkees 2020-06-16 20:40:19 -04:00
parent 2ad1b70f61
commit 2cd81ccb0f
6 changed files with 59 additions and 8 deletions

View File

@ -1,3 +1,23 @@
# 0.9.0
This release is focused on setting up the groundwork for implementing `@extend` as well
as being able to compile Bootstrap.
- Implement all builtin selector functions
- `selector-append`
- `selector-extend`
- `selector-nest`
- `selector-parse`
- `selector-replace`
- `selector-unify`
- `simple-selectors`
- `is-superselector`
- Implement builtin function `content-exists`
- Allow `@import`, `@warn`, and `@debug` in all contexts, such as inside `@mixin`
- Refactor control flow evaluation, resolving some issues blocking Bootstrap
#### Breaking Changes
- remove the `StyleSheet` struct in favor of freestanding functions, `from_string` and `from_path`
# 0.8.3
This release is largely focused on performance and robustness

View File

@ -1,6 +1,6 @@
[package]
name = "grass"
version = "0.8.3"
version = "0.9.0"
description = "SASS compiler"
readme = "README.md"
license = "MIT"

View File

@ -7,7 +7,7 @@ Spec progress as of 2020-05-01:
| Passing | Failing | Total |
|---------|---------|-------|
| 2193 | 2900 | 5093 |
| 2489 | 2604 | 5093 |
## Use as library
```
@ -88,6 +88,9 @@ grass input.scss
#![cfg_attr(feature = "profiling", inline(never))]
use std::{fs, path::Path};
#[cfg(feature = "wasm")]
use wasm_bindgen::prelude::*;
#[cfg(target_pointer_width = "64")]
pub(crate) use beef::lean::Cow;
#[cfg(not(target_pointer_width = "64"))]
@ -179,9 +182,9 @@ pub fn from_path(p: &str) -> Result<String> {
/// Ok(())
/// }
/// ```
#[cfg_attr(feature = "wasm", wasm_bindgen)]
#[cfg_attr(feature = "profiling", inline(never))]
#[cfg_attr(not(feature = "profiling"), inline)]
#[cfg(not(feature = "wasm"))]
pub fn from_string(p: String) -> Result<String> {
let mut map = CodeMap::new();
let file = map.add_file("stdin".into(), p);
@ -211,3 +214,35 @@ pub fn from_string(p: String) -> Result<String> {
.pretty_print(&map)
.map_err(|e| raw_to_parse_error(&map, e))
}
#[cfg(feature = "wasm")]
#[wasm_bindgen]
pub fn from_string(p: String) -> std::result::Result<String, JsValue> {
let mut map = CodeMap::new();
let file = map.add_file("stdin".into(), p);
Ok(Css::from_stmts(
Parser {
toks: &mut Lexer::new(&file)
.collect::<Vec<Token>>()
.into_iter()
.peekmore(),
map: &mut map,
path: Path::new(""),
scopes: &mut NeverEmptyVec::new(Scope::new()),
global_scope: &mut Scope::new(),
super_selectors: &mut NeverEmptyVec::new(Selector::new()),
span_before: file.span.subspan(0, 0),
content: None,
in_mixin: false,
in_function: false,
in_control_flow: false,
at_root: true,
at_root_has_selector: false,
}
.parse()
.map_err(|e| raw_to_parse_error(&map, e).to_string())?,
)
.map_err(|e| raw_to_parse_error(&map, e).to_string())?
.pretty_print(&map)
.map_err(|e| raw_to_parse_error(&map, e).to_string())?)
}

View File

@ -5,6 +5,7 @@ use std::{
use clap::{arg_enum, App, Arg};
#[cfg(not(feature = "wasm"))]
use grass::from_path;
arg_enum! {

View File

@ -31,9 +31,6 @@ use crate::{
use common::{Branch, NeverEmptyVec, SelectorOrStyle};
#[cfg(feature = "wasm")]
use wasm_bindgen::prelude::*;
mod args;
pub mod common;
mod ident;

View File

@ -1,7 +1,5 @@
use codemap::Span;
use crate::error::SassResult;
use super::{ComplexSelector, CssMediaQuery, SimpleSelector};
#[derive(Clone, Debug, Eq, PartialEq, Hash)]