Skip to content

Commit

Permalink
Merge branch 'main' into feature.shared-resources
Browse files Browse the repository at this point in the history
* main:
  Update Dart Sass version and release
  Look for x64 version on arm64 windows (sass#266)
  Update Dart Sass version and release
  Support musl-libc and android (sass#265)
  • Loading branch information
jgerigmeyer committed Jan 8, 2024
2 parents 55a55ed + ad6f671 commit 0f0b5aa
Show file tree
Hide file tree
Showing 29 changed files with 334 additions and 33 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,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
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 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: 28 additions & 10 deletions lib/src/compiler-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,35 @@ import * as fs from 'fs';
import * as p from 'path';
import {isErrnoException} from './utils';

/**
* Detect if the current running node binary is linked with musl libc by
* checking if the binary contains a string like "/.../ld-musl-$ARCH.so"
*/
const isLinuxMusl = function () {
return fs.readFileSync(process.execPath).includes('/ld-musl-');
};

/** The full command for the embedded compiler executable. */
export const compilerCommand = (() => {
const platform =
process.platform === 'linux' && isLinuxMusl()
? 'linux-musl'
: (process.platform as string);

// https://github.com/sass/embedded-host-node/issues/263
// Use windows-x64 emulation on windows-arm64
//
// TODO: Make sure to remove "arm64" from "npm/win32-x64/package.json" when
// this logic is removed once we have true windows-arm64 support.
const arch =
platform === 'win32' && process.arch === 'arm64' ? 'x64' : process.arch;

// find for development
for (const path of ['vendor', '../../../lib/src/vendor']) {
const executable = p.resolve(
__dirname,
path,
`dart-sass/sass${process.platform === 'win32' ? '.bat' : ''}`
`dart-sass/sass${platform === 'win32' ? '.bat' : ''}`
);

if (fs.existsSync(executable)) return [executable];
Expand All @@ -22,13 +43,11 @@ export const compilerCommand = (() => {
try {
return [
require.resolve(
`sass-embedded-${process.platform}-${process.arch}/` +
'dart-sass/src/dart' +
(process.platform === 'win32' ? '.exe' : '')
`sass-embedded-${platform}-${arch}/dart-sass/src/dart` +
(platform === 'win32' ? '.exe' : '')
),
require.resolve(
`sass-embedded-${process.platform}-${process.arch}/` +
'dart-sass/src/sass.snapshot'
`sass-embedded-${platform}-${arch}/dart-sass/src/sass.snapshot`
),
];
} catch (ignored) {
Expand All @@ -38,9 +57,8 @@ export const compilerCommand = (() => {
try {
return [
require.resolve(
`sass-embedded-${process.platform}-${process.arch}/` +
'dart-sass/sass' +
(process.platform === 'win32' ? '.bat' : '')
`sass-embedded-${platform}-${arch}/dart-sass/sass` +
(platform === 'win32' ? '.bat' : '')
),
];
} catch (e: unknown) {
Expand All @@ -52,7 +70,7 @@ export const compilerCommand = (() => {
throw new Error(
"Embedded Dart Sass couldn't find the embedded compiler executable. " +
'Please make sure the optional dependency ' +
`sass-embedded-${process.platform}-${process.arch} is installed in ` +
`sass-embedded-${platform}-${arch} is installed in ` +
'node_modules.'
);
})();
3 changes: 3 additions & 0 deletions npm/android-arm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-android-arm`

This is the **android-arm** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
23 changes: 23 additions & 0 deletions npm/android-arm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "sass-embedded-android-arm",
"version": "1.69.7",
"description": "The android-arm binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"bin": {
"sass": "./dart-sass/sass"
},
"os": [
"android"
],
"cpu": [
"arm"
]
}
3 changes: 3 additions & 0 deletions npm/android-arm64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-android-arm64`

This is the **android-arm64** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
23 changes: 23 additions & 0 deletions npm/android-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "sass-embedded-android-arm64",
"version": "1.69.7",
"description": "The android-arm64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"bin": {
"sass": "./dart-sass/sass"
},
"os": [
"android"
],
"cpu": [
"arm64"
]
}
3 changes: 3 additions & 0 deletions npm/android-ia32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-android-ia32`

This is the **android-ia32** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
23 changes: 23 additions & 0 deletions npm/android-ia32/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "sass-embedded-android-ia32",
"version": "1.69.7",
"description": "The android-ia32 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"bin": {
"sass": "./dart-sass/sass"
},
"os": [
"android"
],
"cpu": [
"ia32"
]
}
3 changes: 3 additions & 0 deletions npm/android-x64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-android-x64`

This is the **android-x64** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
23 changes: 23 additions & 0 deletions npm/android-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "sass-embedded-android-x64",
"version": "1.69.7",
"description": "The android-x64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"bin": {
"sass": "./dart-sass/sass"
},
"os": [
"android"
],
"cpu": [
"x64"
]
}
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-darwin-arm64",
"version": "1.69.5",
"version": "1.69.7",
"description": "The darwin-arm64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-darwin-x64",
"version": "1.69.5",
"version": "1.69.7",
"description": "The darwin-x64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-linux-arm",
"version": "1.69.5",
"version": "1.69.7",
"description": "The linux-arm binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-linux-arm64",
"version": "1.69.5",
"version": "1.69.7",
"description": "The linux-arm64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-ia32/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-linux-ia32",
"version": "1.69.5",
"version": "1.69.7",
"description": "The linux-ia32 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
3 changes: 3 additions & 0 deletions npm/linux-musl-arm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-linux-musl-arm`

This is the **linux-musl-arm** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
20 changes: 20 additions & 0 deletions npm/linux-musl-arm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sass-embedded-linux-musl-arm",
"version": "1.69.7",
"description": "The linux-musl-arm binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"os": [
"linux"
],
"cpu": [
"arm"
]
}
3 changes: 3 additions & 0 deletions npm/linux-musl-arm64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-linux-musl-arm64`

This is the **linux-musl-arm64** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
20 changes: 20 additions & 0 deletions npm/linux-musl-arm64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sass-embedded-linux-musl-arm64",
"version": "1.69.7",
"description": "The linux-musl-arm64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"os": [
"linux"
],
"cpu": [
"arm64"
]
}
3 changes: 3 additions & 0 deletions npm/linux-musl-ia32/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-linux-musl-ia32`

This is the **linux-musl-ia32** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
20 changes: 20 additions & 0 deletions npm/linux-musl-ia32/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sass-embedded-linux-musl-ia32",
"version": "1.69.7",
"description": "The linux-musl-ia32 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"os": [
"linux"
],
"cpu": [
"ia32"
]
}
3 changes: 3 additions & 0 deletions npm/linux-musl-x64/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `sass-embedded-linux-musl-x64`

This is the **linux-musl-x64** binary for [`sass-embedded`](https://www.npmjs.com/package/sass-embedded)
20 changes: 20 additions & 0 deletions npm/linux-musl-x64/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "sass-embedded-linux-musl-x64",
"version": "1.69.7",
"description": "The linux-musl-x64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
"license": "MIT",
"files": [
"dart-sass/**/*"
],
"engines": {
"node": ">=14.0.0"
},
"os": [
"linux"
],
"cpu": [
"x64"
]
}
2 changes: 1 addition & 1 deletion npm/linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-linux-x64",
"version": "1.69.5",
"version": "1.69.7",
"description": "The linux-x64 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
2 changes: 1 addition & 1 deletion npm/win32-ia32/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sass-embedded-win32-ia32",
"version": "1.69.5",
"version": "1.69.7",
"description": "The win32-ia32 binary for sass-embedded",
"repository": "sass/embedded-host-node",
"author": "Google Inc.",
Expand Down
Loading

0 comments on commit 0f0b5aa

Please sign in to comment.