Skip to content

Commit

Permalink
Merge pull request #277 from sass/merge-main
Browse files Browse the repository at this point in the history
Merge main into feature.color-4
  • Loading branch information
nex3 authored Mar 27, 2024
2 parents 8c82e53 + 6cdf30a commit 1c136de
Show file tree
Hide file tree
Showing 50 changed files with 1,375 additions and 540 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ defaults:

env:
PROTOC_VERSION: 3.x
DEFAULT_NODE_VERSION: 18.x # If changing this, also change jobs.tests.strategy.matrix.node_version

on:
push:
Expand All @@ -19,10 +18,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
node-version: 'lts/*'
check-latest: true

- name: Check out the language repo
Expand All @@ -43,12 +42,12 @@ jobs:
strategy:
matrix:
os: [ubuntu, macos, windows]
node-version: [18.x, 16.x] # If changing this, also change env.DEFAULT_NODE_VERSION
node-version: ['lts/*', 'lts/-1', 'lts/-2']
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
Expand All @@ -73,9 +72,6 @@ jobs:
- run: npm run compile
- run: node test/after-compile-test.mjs

# The versions should be kept up-to-date with the latest LTS Node releases.
# They next need to be rotated October 2021. See
# https://github.com/nodejs/Release.
sass_spec:
name: 'JS API Tests | Node ${{ matrix.node_version }} | ${{ matrix.os }}'
runs-on: ${{ matrix.os }}-latest
Expand All @@ -84,17 +80,19 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
node_version: [18]
node_version: ['lts/*']
include:
# Include LTS versions on Ubuntu
- os: ubuntu
node_version: 16
node_version: lts/-1
- os: ubuntu
node_version: lts/-2

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with: {sdk: stable}
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with: {node-version: "${{ matrix.node_version }}"}

- name: Check out Dart Sass
Expand Down Expand Up @@ -142,10 +140,10 @@ jobs:
needs: [static_analysis, tests, sass_spec]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.DEFAULT_NODE_VERSION }}
node-version: 'lts/*'
check-latest: true
registry-url: 'https://registry.npmjs.org'
- run: npm install
Expand All @@ -159,9 +157,7 @@ jobs:
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
run: |
for pkg in linux-arm linux-arm64 linux-ia32 linux-x64 darwin-arm64 darwin-x64 win32-ia32 win32-x64; do
npx ts-node ./tool/prepare-optional-release.ts --package=$pkg && npm publish ./npm/$pkg
done
find ./npm -mindepth 1 -maxdepth 1 -print0 | xargs -0 -n 1 -- sh -xc 'npx ts-node ./tool/prepare-optional-release.ts --package=$(basename $1) && npm publish $1' --
- run: npm publish
env:
Expand Down
123 changes: 123 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,126 @@
## 1.72.0

* Support adjacent `/`s without whitespace in between when parsing plain CSS
expressions.

* Allow the Node.js `pkg:` importer to load Sass stylesheets for `package.json`
`exports` field entries without extensions.

* When printing suggestions for variables, use underscores in variable names
when the original usage used underscores.

### JavaScript API

* Properly resolve `pkg:` imports with the Node.js package importer when
arguments are passed to the JavaScript process.

## 1.71.1

### Command-Line Interface

* Ship the musl Linux release with the proper Dart executable.

### JavaScript API

* Export the `NodePackageImporter` class in ESM mode.

* Allow `NodePackageImporter` to locate a default directory even when the
entrypoint is an ESM module.

### Dart API

* Make passing a null argument to `NodePackageImporter()` a static error rather
than just a runtime error.

### Embedded Sass

* In the JS Embedded Host, properly install the musl Linux embedded compiler
when running on musl Linux.

## 1.71.0

For more information about `pkg:` importers, see [the
announcement][pkg-importers] on the Sass blog.

[pkg-importers]: https://sass-lang.com/blog/announcing-pkg-importers

### Command-Line Interface

* Add a `--pkg-importer` flag to enable built-in `pkg:` importers. Currently
this only supports the Node.js package resolution algorithm, via
`--pkg-importer=node`. For example, `@use "pkg:bootstrap"` will load
`node_modules/bootstrap/scss/bootstrap.scss`.

### JavaScript API

* Add a `NodePackageImporter` importer that can be passed to the `importers`
option. This loads files using the `pkg:` URL scheme according to the Node.js
package resolution algorithm. For example, `@use "pkg:bootstrap"` will load
`node_modules/bootstrap/scss/bootstrap.scss`. The constructor takes a single
optional argument, which indicates the base directory to use when locating
`node_modules` directories. It defaults to
`path.dirname(require.main.filename)`.

### Dart API

* Add a `NodePackageImporter` importer that can be passed to the `importers`
option. This loads files using the `pkg:` URL scheme according to the Node.js
package resolution algorithm. For example, `@use "pkg:bootstrap"` will load
`node_modules/bootstrap/scss/bootstrap.scss`. The constructor takes a single
argument, which indicates the base directory to use when locating
`node_modules` directories.

## 1.70.0

### JavaScript API

* Add a `sass.initCompiler()` function that returns a `sass.Compiler` object
which supports `compile()` and `compileString()` methods with the same API as
the global Sass object. On the Node.js embedded host, each `sass.Compiler`
object uses a single long-lived subprocess, making compiling multiple
stylesheets much more efficient.

* Add a `sass.initAsyncCompiler()` function that returns a `sass.AsyncCompiler`
object which supports `compileAsync()` and `compileStringAsync()` methods with
the same API as the global Sass object. On the Node.js embedded host, each
`sass.AsynCompiler` object uses a single long-lived subprocess, making
compiling multiple stylesheets much more efficient.

### Embedded Sass

* Support the `CompileRequest.silent` field. This allows compilations with no
logging to avoid unnecessary request/response cycles.

* The Dart Sass embedded compiler now reports its name as "dart-sass" rather
than "Dart Sass", to match the JS API's `info` field.

## 1.69.7

### Embedded Sass

* In the JS Embedded Host, properly install the x64 Dart Sass executable on
ARM64 Windows.

## 1.69.6

* Produce better output for numbers with complex units in `meta.inspect()` and
debugging messages.

* Escape U+007F DELETE when serializing strings.

* When generating CSS error messages to display in-browser, escape all code
points that aren't in the US-ASCII region. Previously only code points U+0100
LATIN CAPITAL LETTER A WITH MACRON were escaped.

* Provide official releases for musl LibC and for Android.

* Don't crash when running `meta.apply()` in asynchronous mode.

### JS API

* Fix a bug where certain exceptions could produce `SourceSpan`s that didn't
follow the documented `SourceSpan` API.

## 1.69.5

### JS API
Expand Down
38 changes: 32 additions & 6 deletions lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ export const compile = sass.compile;
export const compileAsync = sass.compileAsync;
export const compileString = sass.compileString;
export const compileStringAsync = sass.compileStringAsync;
export const NodePackageImporter = sass.NodePackageImporter;
export const AsyncCompiler = sass.AsyncCompiler;
export const Compiler = sass.Compiler;
export const initAsyncCompiler = sass.initAsyncCompiler;
export const initCompiler = sass.initCompiler;
export const Logger = sass.Logger;
export const CalculationInterpolation = sass.CalculationInterpolation
export const CalculationOperation = sass.CalculationOperation
export const CalculationOperator = sass.CalculationOperator
export const CalculationInterpolation = sass.CalculationInterpolation;
export const CalculationOperation = sass.CalculationOperation;
export const CalculationOperator = sass.CalculationOperator;
export const SassArgumentList = sass.SassArgumentList;
export const SassBoolean = sass.SassBoolean;
export const SassCalculation = sass.SassCalculation
export const SassCalculation = sass.SassCalculation;
export const SassColor = sass.SassColor;
export const SassFunction = sass.SassFunction;
export const SassMixin = sass.SassMixin;
Expand Down Expand Up @@ -39,8 +44,9 @@ function defaultExportDeprecation() {
if (printedDefaultExportDeprecation) return;
printedDefaultExportDeprecation = true;
console.error(
"`import sass from 'sass'` is deprecated.\n" +
"Please use `import * as sass from 'sass'` instead.");
"`import sass from 'sass'` is deprecated.\n" +
"Please use `import * as sass from 'sass'` instead."
);
}

export default {
Expand All @@ -60,6 +66,26 @@ export default {
defaultExportDeprecation();
return sass.compileStringAsync;
},
get NodePackageImporter() {
defaultExportDeprecation();
return sass.NodePackageImporter;
},
get initAsyncCompiler() {
defaultExportDeprecation();
return sass.initAsyncCompiler;
},
get initCompiler() {
defaultExportDeprecation();
return sass.initCompiler;
},
get AsyncCompiler() {
defaultExportDeprecation();
return sass.AsyncCompiler;
},
get Compiler() {
defaultExportDeprecation();
return sass.Compiler;
},
get Logger() {
defaultExportDeprecation();
return sass.Logger;
Expand Down
7 changes: 4 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ export {
compileString,
compileAsync,
compileStringAsync,
NodePackageImporter,
} from './src/compile';
export {initAsyncCompiler, AsyncCompiler} from './src/compiler/async';
export {initCompiler, Compiler} from './src/compiler/sync';
export {render, renderSync} from './src/legacy';

export const info = `sass-embedded\t${pkg.version}`;

export const Logger = {
silent: {warn() {}, debug() {}},
};
export {Logger} from './src/logger';

// Legacy JS API

Expand Down
47 changes: 0 additions & 47 deletions lib/src/async-compiler.ts

This file was deleted.

Loading

0 comments on commit 1c136de

Please sign in to comment.