Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e490354
Update Dart Sass version and release
sassbot Sep 2, 2025
4dd3994
Bump actions/checkout from 4 to 5 (#390)
dependabot[bot] Sep 3, 2025
a53778b
Update Dart Sass version and release
sassbot Sep 6, 2025
a58f463
Bump actions/setup-node from 4 to 5 (#393)
dependabot[bot] Sep 8, 2025
1c8d64a
Update Dart Sass version and release
sassbot Sep 19, 2025
2b3cb8e
Update Dart Sass version and release
sassbot Sep 22, 2025
3f28c96
Update Dart Sass version and release
sassbot Sep 23, 2025
b513e88
Bump actions/setup-node from 5 to 6 (#394)
dependabot[bot] Oct 20, 2025
b1b70d2
Fix Node.js deprecation warnings about passing args to child_process
nex3 Oct 31, 2025
5c78e6f
Fix after-compile-test for the new module.exports export
nex3 Oct 31, 2025
6cb356a
Include MJS files in formatting checks and fixes
nex3 Oct 31, 2025
3afea5c
Merge pull request #395 from sass/child-process-deprecation
nex3 Oct 31, 2025
5cb75b2
Update Dart Sass version and release
sassbot Oct 31, 2025
2597c1d
Update release workflow to support npm trusted publshing (#396)
nex3 Nov 3, 2025
ebc2bd6
Update Dart Sass version and release
sassbot Nov 10, 2025
4bcd8d5
Update Dart Sass version and release
sassbot Nov 18, 2025
53c98c0
Fix a use-before-initialize bug in the async compiler (#399)
nex3 Nov 19, 2025
2b2cb3e
Update Dart Sass version and release
sassbot Nov 19, 2025
66e8d71
Pass --provenance to npm publish
nex3 Nov 20, 2025
d2b8b99
Remove needs and runs-on from the release trigger workflow
nex3 Nov 21, 2025
1be4281
Bump actions/checkout from 5 to 6 (#403)
dependabot[bot] Nov 24, 2025
2bdc2f0
Merge pull request #402 from sass/provenance
nex3 Nov 25, 2025
7070618
Exclude obsolete deprecations when making a version fatal (#400)
jathak Dec 2, 2025
3022f4c
Update Dart Sass version and release
sassbot Dec 8, 2025
583b898
Update Dart Sass version and release
sassbot Dec 8, 2025
2c8fca4
Update Dart Sass version and release
sassbot Dec 9, 2025
3b65fa7
Update Dart Sass version and release
sassbot Dec 11, 2025
cf082c7
Add support for the display-p3-linear color space (#405)
nex3 Dec 16, 2025
1100b49
Update Dart Sass version and release
sassbot Dec 16, 2025
a30805a
Update Dart Sass version and release
sassbot Dec 19, 2025
e4551e1
Merge branch 'main' of github.com:sass/embedded-host-node into featur…
nex3 Dec 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"error",
{"allowExpressions": true}
],
"n/no-extraneous-require": ["error", {
"allowModules": ["sass"]
}],
"func-style": ["error", "declaration"],
"prefer-const": ["error", {"destructuring": "all"}],
// It would be nice to sort import declaration order as well, but that's not
Expand Down
45 changes: 12 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
check-latest: true
Expand All @@ -46,8 +46,8 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
check-latest: true
Expand Down Expand Up @@ -89,10 +89,10 @@ jobs:
node_version: lts/-2

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

- name: Check out Dart Sass
Expand Down Expand Up @@ -124,31 +124,10 @@ jobs:
working-directory: sass-spec

deploy_npm:
name: Deploy npm
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/') && github.repository == 'sass/embedded-host-node'"
needs: [static_analysis, tests, sass_spec]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
check-latest: true
registry-url: 'https://registry.npmjs.org'
- run: npm install

- name: "Check we're not using a -dev version of the embedded protocol"
run: jq -r '.["protocol-version"]' package.json | grep -qv -- '-dev$'
- name: "Check we're not using a -dev version of the embedded compiler"
run: jq -r '.["compiler-version"]' package.json | grep -qv -- '-dev$'

- name: Publish optional dependencies
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
run: |
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:
NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
if: "github.ref_type == 'tag' && github.event.repository.fork == false"
permissions:
attestations: write
contents: write
id-token: write
uses: ./.github/workflows/release.yml
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
workflow_call:

jobs:
deploy_npm:
name: Deploy npm
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 'lts/*'
check-latest: true
registry-url: 'https://registry.npmjs.org'

# npm trusted publisher infrastructure requires npm >=11.5.1
- run: npm install -g npm@latest

- run: npm install

- name: "Check we're not using a -dev version of the embedded protocol"
run: jq -r '.["protocol-version"]' package.json | grep -qv -- '-dev$'
- name: "Check we're not using a -dev version of the embedded compiler"
run: jq -r '.["compiler-version"]' package.json | grep -qv -- '-dev$'

- name: Publish optional dependencies
run: |
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 --provenance $1' --

- run: npm publish --provenance
147 changes: 147 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,150 @@
## 1.97.1

* Fix a bug with the new CSS-style `if()` syntax where values would be evaluated
even if their conditions didn't match.

## 1.97.0

* Add support for the `display-p3-linear` color space.

## 1.96.0

* Allow numbers with complex units (more than one numerator unit or more than
zero denominator units) to be emitted to CSS. These are now emitted as
`calc()` expressions, which now support complex units in plain CSS.

## 1.95.1

* No user-visible changes.

## 1.95.0

* Add support for the [CSS-style `if()` function]. In addition to supporting the
plain CSS syntax, this also supports a `sass()` query that takes a Sass
expression that evaluates to `true` or `false` at preprocessing time depending
on whether the Sass value is truthy. If there are no plain-CSS queries, the
function will return the first value whose query returns true during
preprocessing. For example, `if(sass(false): 1; sass(true): 2; else: 3)`
returns `2`.

[CSS-style `if()` function]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/if

* The old Sass `if()` syntax is now deprecated. Users are encouraged to migrate
to the new CSS syntax. `if($condition, $if-true, $if-false)` can be changed to
`if(sass($condition): $if-true; else: $if-false)`.

See [the Sass website](https://sass-lang.com/d/if-function) for details.

* Plain-CSS `if()` functions are now considered "special numbers", meaning that
they can be used in place of arguments to CSS color functions.

* Plain-CSS `if()` functions and `attr()` functions are now considered "special
variable strings" (like `var()`), meaning they can now be used in place of
multiple arguments or syntax fragments in various CSS functions.

## 1.94.3

* Fix the span reported for standalone `%` expressions followed by whitespace.

## 1.94.2

### Command-Line Interface

* Using `--fatal-deprecation <version>` no longer emits warnings about
deprecations that are obsolete.

### Dart API

* `Deprecation.forVersion` now excludes obsolete deprecations from the set it
returns.

### JS API

* Excludes obsolete deprecations from `fatalDeprecations` when a `Version` is
passed.

### Node.js Embedded Host

* Fix a bug where a variable could be used before it was initialized during
async compilation.

## 1.94.1

* No user-visible changes.

## 1.94.0

* **Potentially breaking compatibility fix:** `@function` rules whose names
begin with `--` are now parsed as unknown at-rules to support the plain CSS
`@function` rule. Within this rule, the `result` property is parsed as raw
CSS just like custom properties.

* **Potentially breaking compatibility fix:** `@mixin` rules whose names begin
with `--` are now errors. These are not yet parsed as unknown at-rules because
no browser currently supports CSS mixins.

## 1.93.3

* Fix a performance regression that was introduced in 1.92.0.

## 1.93.2

* No user-visible changes.

### JavaScript API

* Fix another error in the release process for `@sass/types`.

## 1.93.1

* No user-visible changes.

### JavaScript API

* Fix an error in the release process for `@sass/types`.

## 1.93.0

* Fix a crash when a style rule contains a nested `@import`, and the loaded file
`@use`s a user-defined module as well as `@include`s a top-level mixin which
emits top-level declarations.

### JavaScript API

* Release a `@sass/types` package which contains the type annotations used by
both the `sass` and `sass-embedded` package without any additional code or
dependencies.

## 1.92.1

* Fix a bug where variable definitions from one imported, forwarded module
would not be passed as implicit configuration to a later imported, forwarded
module.

## 1.92.0

* **Breaking change:** Emit declarations, childless at-rules, and comments in
the order they appear in the source even when they're interleaved with nested
rules. This obsoletes the `mixed-decls` deprecation.

* **Breaking change:** The function name `type()` is now fully reserved for the
plain CSS function. This means that `@function` definitions with the name
`type` will produce errors, while function calls will be parsed as special
function strings.

* Configuring private variables using `@use ... with`, `@forward ... with`, and
`meta.load-css(..., $with: ...)` is now deprecated. Private variables were
always intended to be fully encapsulated within the module that defines them,
and this helps enforce that encapsulation.

* Fix a bug where `@extend` rules loaded through a mixture of `@import` and
`@use` rules could fail to apply correctly.

### Command-Line Interface

* In `--watch` mode, delete the source map when the associated source file is
deleted.

## 1.91.0

* **Potentially breaking change:** `meta.inspect()` (as well as other systems
Expand Down
30 changes: 18 additions & 12 deletions bin/sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,31 @@

import * as child_process from 'child_process';
import * as path from 'path';

import {compilerCommand} from '../lib/src/compiler-path';

// TODO npm/cmd-shim#152 and yarnpkg/berry#6422 - If and when the package
// managers support it, we should make this a proper shell script rather than a
// JS wrapper.

try {
child_process.execFileSync(
compilerCommand[0],
[...compilerCommand.slice(1), ...process.argv.slice(2)],
{
// Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980
shell: ['.bat', '.cmd'].includes(
path.extname(compilerCommand[0]).toLowerCase(),
),
stdio: 'inherit',
windowsHide: true,
},
);
let command = compilerCommand[0];
let args = [...compilerCommand.slice(1), ...process.argv.slice(2)];
const options: child_process.ExecFileSyncOptions = {
stdio: 'inherit',
windowsHide: true,
};

// Node forbids launching .bat and .cmd without a shell due to CVE-2024-27980,
// and DEP0190 forbids passing an argument list *with* shell: true. To work
// around this, we have to manually concatenate the arguments.
if (['.bat', '.cmd'].includes(path.extname(command).toLowerCase())) {
command = `${command} ${args.join(' ')}`;
args = [];
options.shell = true;
}

child_process.execFileSync(command, args, options);
} catch (error) {
if (error.code) {
throw error;
Expand Down
2 changes: 1 addition & 1 deletion lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function defaultExportDeprecation() {
printedDefaultExportDeprecation = true;
console.error(
"`import sass from 'sass'` is deprecated.\n" +
"Please use `import * as sass from 'sass'` instead."
"Please use `import * as sass from 'sass'` instead.",
);
}

Expand Down
Loading