You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

sass-embedded

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sass-embedded - npm Package Compare versions

Comparing version

to
1.78.0

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const config = {
roots: ['<rootDir>/lib/', '<rootDir>/test/'],
preset: 'ts-jest',

@@ -5,0 +6,0 @@ testEnvironment: 'node',

@@ -9,13 +9,21 @@ "use strict";

const p = require("path");
const elf_1 = require("./elf");
const utils_1 = require("./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"
* Detect if the given binary is linked with musl libc by checking if
* the interpreter basename starts with "ld-musl-"
*/
const isLinuxMusl = function () {
return fs.readFileSync(process.execPath).includes('/ld-musl-');
};
function isLinuxMusl(path) {
try {
const interpreter = (0, elf_1.getElfInterpreter)(path);
return p.basename(interpreter).startsWith('ld-musl-');
}
catch (error) {
console.warn(`Warning: Failed to detect linux-musl, fallback to linux-gnu: ${error.message}`);
return false;
}
}
/** The full command for the embedded compiler executable. */
exports.compilerCommand = (() => {
const platform = process.platform === 'linux' && isLinuxMusl()
const platform = process.platform === 'linux' && isLinuxMusl(process.execPath)
? 'linux-musl'

@@ -22,0 +30,0 @@ : process.platform;

@@ -117,2 +117,5 @@ "use strict";

logger: options.logger,
fatalDeprecations: options.fatalDeprecations,
futureDeprecations: options.futureDeprecations,
silenceDeprecations: options.silenceDeprecations,
legacy: true,

@@ -119,0 +122,0 @@ };

@@ -32,3 +32,3 @@ "use strict";

return args => new Promise((resolve, reject) => {
const done = (result) => {
function done(result) {
try {

@@ -45,3 +45,3 @@ if (result instanceof Error) {

}
};
}
// The cast here is necesary to work around microsoft/TypeScript#33815.

@@ -48,0 +48,0 @@ const syncResult = callback.apply(thisArg, [...args.map(wrapValue), done]);

@@ -15,4 +15,6 @@ "use strict";

}
const isValidClampArg = (value) => value instanceof CalculationInterpolation ||
(value instanceof string_1.SassString && !value.hasQuotes);
function isValidClampArg(value) {
return (value instanceof CalculationInterpolation ||
(value instanceof string_1.SassString && !value.hasQuotes));
}
/* A SassScript calculation */

@@ -19,0 +21,0 @@ class SassCalculation extends index_1.Value {

@@ -118,2 +118,9 @@ "use strict";

},
'feature-exists': {
id: 'feature-exists',
description: 'meta.feature-exists',
status: 'active',
deprecatedIn: new version_1.Version(1, 78, 0),
obsoleteIn: null,
},
import: {

@@ -120,0 +127,0 @@ id: 'import',

{
"name": "sass-embedded",
"version": "1.77.8",
"version": "1.78.0",
"protocol-version": "2.7.1",
"compiler-version": "1.77.8",
"compiler-version": "1.78.0",
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",

@@ -26,2 +26,5 @@ "repository": "sass/embedded-host-node",

},
"bin": {
"sass": "dist/bin/sass.js"
},
"scripts": {

@@ -39,19 +42,22 @@ "init": "ts-node ./tool/init.ts",

"optionalDependencies": {
"sass-embedded-android-arm": "1.77.8",
"sass-embedded-android-arm64": "1.77.8",
"sass-embedded-android-ia32": "1.77.8",
"sass-embedded-android-x64": "1.77.8",
"sass-embedded-darwin-arm64": "1.77.8",
"sass-embedded-darwin-x64": "1.77.8",
"sass-embedded-linux-arm": "1.77.8",
"sass-embedded-linux-arm64": "1.77.8",
"sass-embedded-linux-ia32": "1.77.8",
"sass-embedded-linux-x64": "1.77.8",
"sass-embedded-linux-musl-arm": "1.77.8",
"sass-embedded-linux-musl-arm64": "1.77.8",
"sass-embedded-linux-musl-ia32": "1.77.8",
"sass-embedded-linux-musl-x64": "1.77.8",
"sass-embedded-win32-arm64": "1.77.8",
"sass-embedded-win32-ia32": "1.77.8",
"sass-embedded-win32-x64": "1.77.8"
"sass-embedded-android-arm": "1.78.0",
"sass-embedded-android-arm64": "1.78.0",
"sass-embedded-android-ia32": "1.78.0",
"sass-embedded-android-riscv64": "1.78.0",
"sass-embedded-android-x64": "1.78.0",
"sass-embedded-darwin-arm64": "1.78.0",
"sass-embedded-darwin-x64": "1.78.0",
"sass-embedded-linux-arm": "1.78.0",
"sass-embedded-linux-arm64": "1.78.0",
"sass-embedded-linux-ia32": "1.78.0",
"sass-embedded-linux-riscv64": "1.78.0",
"sass-embedded-linux-x64": "1.78.0",
"sass-embedded-linux-musl-arm": "1.78.0",
"sass-embedded-linux-musl-arm64": "1.78.0",
"sass-embedded-linux-musl-ia32": "1.78.0",
"sass-embedded-linux-musl-riscv64": "1.78.0",
"sass-embedded-linux-musl-x64": "1.78.0",
"sass-embedded-win32-arm64": "1.78.0",
"sass-embedded-win32-ia32": "1.78.0",
"sass-embedded-win32-x64": "1.78.0"
},

@@ -72,3 +78,3 @@ "dependencies": {

"@types/jest": "^29.4.0",
"@types/node": "^20.1.0",
"@types/node": "^22.0.0",
"@types/shelljs": "^0.8.8",

@@ -75,0 +81,0 @@ "@types/supports-color": "^8.1.1",

@@ -53,2 +53,4 @@ "use strict";

return 'arm64';
case 'riscv64':
return 'riscv64';
default:

@@ -94,27 +96,2 @@ throw Error(`Architecture ${arch} is not supported.`);

}
// Patch the launcher script if needed.
//
// For linux both `-linux-` and `-linux-musl-` packages will be installed
// because npm doesn't know how to select packages based on LibC. To avoid
// conflicts, only the `-linux-` packages have "bin" scripts defined in
// package.json, which we patch to detect which LibC is available and launch the
// correct binary.
async function patchLauncherScript(path, dartPlatform, dartArch) {
if (dartPlatform !== 'linux')
return;
const scriptPath = p.join(path, 'dart-sass', 'sass');
console.log(`Patching ${scriptPath} script.`);
const shebang = Buffer.from('#!/bin/sh\n');
const buffer = await fs_1.promises.readFile(scriptPath);
if (!buffer.subarray(0, shebang.length).equals(shebang)) {
throw new Error(`${scriptPath} is not a shell script!`);
}
const lines = buffer.toString('utf-8').split('\n');
const index = lines.findIndex(line => line.startsWith('path='));
if (index < 0) {
throw new Error(`The format of ${scriptPath} has changed!`);
}
lines.splice(index + 1, 0, '# Detect linux-musl', 'if grep -qm 1 /ld-musl- /proc/self/exe; then', ` path="$path/../../sass-embedded-linux-musl-${dartArch}/dart-sass"`, 'fi');
await fs_1.promises.writeFile(scriptPath, lines.join('\n'));
}
void (async () => {

@@ -141,3 +118,2 @@ try {

});
await patchLauncherScript(outPath, dartPlatform, dartArch);
}

@@ -144,0 +120,0 @@ catch (error) {

@@ -9,3 +9,3 @@ /**

// START AUTOGENERATED LIST
// Checksum: 309e4f1f008f08379b824ab6094e13df2e18e187
// Checksum: dd5c6aa0f1431fa9fc88bb71a96f832adbc165f5

@@ -125,2 +125,9 @@ /**

/**
* Deprecation for meta.feature-exists
*
* This deprecation became active in Dart Sass 1.78.0.
*/
'feature-exists': Deprecation<'feature-exists'>;
/**
* Deprecation for @import rules.

@@ -127,0 +134,0 @@ *

@@ -32,3 +32,3 @@ // This is a mirror of the JS API definitions in `spec/js-api`, but with comments

} from './importer';
export {Logger, SourceSpan, SourceLocation} from './logger';
export {Logger, LoggerWarnOptions, SourceSpan, SourceLocation} from './logger';
export {

@@ -35,0 +35,0 @@ CustomFunction,

@@ -32,3 +32,3 @@ // This is a mirror of the JS API definitions in `spec/js-api`, but with comments

} from './importer';
export {Logger, SourceSpan, SourceLocation} from './logger';
export {Logger, LoggerWarnOptions, SourceSpan, SourceLocation} from './logger';
export {

@@ -35,0 +35,0 @@ CustomFunction,

@@ -0,1 +1,2 @@

import {DeprecationOrId, Version} from '../deprecations';
import {Logger} from '../logger';

@@ -487,2 +488,41 @@ import {LegacyImporter} from './importer';

/**
* A set of deprecations to treat as fatal.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will error instead.
*
* If a `Version` is provided, then all deprecations that were active in that
* compiler version will be treated as fatal.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
fatalDeprecations?: (DeprecationOrId | Version)[];
/**
* A set of future deprecations to opt into early.
*
* Future deprecations passed here will be treated as active by the compiler,
* emitting warnings as necessary.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
futureDeprecations?: DeprecationOrId[];
/**
* A set of active deprecations to ignore.
*
* If a deprecation warning of any provided type is encountered during
* compilation, the compiler will ignore it instead.
*
* **Heads up!** The deprecated functionality you're depending on will
* eventually break.
*
* @category Messages
* @compatiblity dart: "1.78.0", node: false
*/
silenceDeprecations?: DeprecationOrId[];
/**
* By default, Dart Sass will print only five instances of the same

@@ -489,0 +529,0 @@ * deprecation warning per compilation to avoid deluging users in console

@@ -8,2 +8,31 @@ import {Deprecation} from '../deprecations';

/**
* The options passed to {@link Logger.warn}.
*
* * `deprecation`: Whether this is a deprecation warning.
*
* * `deprecationType`: The type of deprecation. Only set if `deprecation` is
* true.
*
* * `span`: The location in the Sass source code that generated this warning.
* This may be unset if the warning didn't come from Sass source, for
* example if it's from a deprecated JavaScript option.
*
* * `stack`: The Sass stack trace at the point the warning was issued. This may
* be unset if the warning didn't come from Sass source, for example if it's
* from a deprecated JavaScript option.
*
* @category Logger
*/
export type LoggerWarnOptions = (
| {
deprecation: true;
deprecationType: Deprecation;
}
| {deprecation: false}
) & {
span?: SourceSpan;
stack?: string;
};
/**
* An object that can be passed to {@link LegacySharedOptions.logger} to control

@@ -46,20 +75,7 @@ * how Sass emits warnings and debug messages.

*
* `options` may contain the following fields:
*
* @param message - The warning message.
* @param options.deprecation - Whether this is a deprecation warning.
* @param options.deprecationType - The type of deprecation this warning is
* for, if any.
* @param options.span - The location in the Sass source code that generated this
* warning.
* @param options.stack - The Sass stack trace at the point the warning was issued.
*/
warn?(
message: string,
options: (
| {
deprecation: true;
deprecationType: Deprecation;
}
| {deprecation: false}
) & {span?: SourceSpan; stack?: string}
): void;
warn?(message: string, options: LoggerWarnOptions): void;

@@ -66,0 +82,0 @@ /**

{
"name": "sass-embedded",
"version": "1.77.8",
"version": "1.78.0",
"protocol-version": "2.7.1",
"compiler-version": "1.77.8",
"compiler-version": "1.78.0",
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",

@@ -26,2 +26,5 @@ "repository": "sass/embedded-host-node",

},
"bin": {
"sass": "dist/bin/sass.js"
},
"scripts": {

@@ -39,19 +42,22 @@ "init": "ts-node ./tool/init.ts",

"optionalDependencies": {
"sass-embedded-android-arm": "1.77.8",
"sass-embedded-android-arm64": "1.77.8",
"sass-embedded-android-ia32": "1.77.8",
"sass-embedded-android-x64": "1.77.8",
"sass-embedded-darwin-arm64": "1.77.8",
"sass-embedded-darwin-x64": "1.77.8",
"sass-embedded-linux-arm": "1.77.8",
"sass-embedded-linux-arm64": "1.77.8",
"sass-embedded-linux-ia32": "1.77.8",
"sass-embedded-linux-x64": "1.77.8",
"sass-embedded-linux-musl-arm": "1.77.8",
"sass-embedded-linux-musl-arm64": "1.77.8",
"sass-embedded-linux-musl-ia32": "1.77.8",
"sass-embedded-linux-musl-x64": "1.77.8",
"sass-embedded-win32-arm64": "1.77.8",
"sass-embedded-win32-ia32": "1.77.8",
"sass-embedded-win32-x64": "1.77.8"
"sass-embedded-android-arm": "1.78.0",
"sass-embedded-android-arm64": "1.78.0",
"sass-embedded-android-ia32": "1.78.0",
"sass-embedded-android-riscv64": "1.78.0",
"sass-embedded-android-x64": "1.78.0",
"sass-embedded-darwin-arm64": "1.78.0",
"sass-embedded-darwin-x64": "1.78.0",
"sass-embedded-linux-arm": "1.78.0",
"sass-embedded-linux-arm64": "1.78.0",
"sass-embedded-linux-ia32": "1.78.0",
"sass-embedded-linux-riscv64": "1.78.0",
"sass-embedded-linux-x64": "1.78.0",
"sass-embedded-linux-musl-arm": "1.78.0",
"sass-embedded-linux-musl-arm64": "1.78.0",
"sass-embedded-linux-musl-ia32": "1.78.0",
"sass-embedded-linux-musl-riscv64": "1.78.0",
"sass-embedded-linux-musl-x64": "1.78.0",
"sass-embedded-win32-arm64": "1.78.0",
"sass-embedded-win32-ia32": "1.78.0",
"sass-embedded-win32-x64": "1.78.0"
},

@@ -72,3 +78,3 @@ "dependencies": {

"@types/jest": "^29.4.0",
"@types/node": "^20.1.0",
"@types/node": "^22.0.0",
"@types/shelljs": "^0.8.8",

@@ -75,0 +81,0 @@ "@types/supports-color": "^8.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet