sass-embedded
Advanced tools
Comparing version 1.53.0 to 1.54.2
@@ -76,3 +76,3 @@ "use strict"; | ||
function newCompileRequest(importers, options) { | ||
var _a, _b, _c; | ||
var _a, _b, _c, _d; | ||
const request = new proto.InboundMessage.CompileRequest(); | ||
@@ -87,3 +87,4 @@ request.setImportersList(importers.importers); | ||
request.setVerbose(!!(options === null || options === void 0 ? void 0 : options.verbose)); | ||
switch ((_c = options === null || options === void 0 ? void 0 : options.style) !== null && _c !== void 0 ? _c : 'expanded') { | ||
request.setCharset(!!((_c = options === null || options === void 0 ? void 0 : options.charset) !== null && _c !== void 0 ? _c : true)); | ||
switch ((_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : 'expanded') { | ||
case 'expanded': | ||
@@ -90,0 +91,0 @@ request.setStyle(proto.OutputStyle.EXPANDED); |
@@ -108,2 +108,3 @@ "use strict"; | ||
verbose: options.verbose, | ||
charset: options.charset, | ||
logger: options.logger, | ||
@@ -110,0 +111,0 @@ }; |
{ | ||
"name": "sass-embedded", | ||
"version": "1.53.0", | ||
"protocol-version": "1.0.0", | ||
"compiler-version": "1.53.0", | ||
"version": "1.54.2", | ||
"protocol-version": "1.1.0", | ||
"compiler-version": "1.54.2", | ||
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol", | ||
@@ -62,4 +62,5 @@ "repository": "sass/embedded-host-node", | ||
"typescript": "^4.4.3", | ||
"yaml": "^1.10.2", | ||
"yargs": "^17.2.1" | ||
} | ||
} |
@@ -11,2 +11,3 @@ "use strict"; | ||
const p = require("path"); | ||
const yaml = require("yaml"); | ||
const shell = require("shelljs"); | ||
@@ -46,3 +47,3 @@ const tar_1 = require("tar"); | ||
default: | ||
throw Error(`Architecure ${arch} is not supported.`); | ||
throw Error(`Architecture ${arch} is not supported.`); | ||
} | ||
@@ -118,2 +119,3 @@ })(); | ||
}); | ||
await maybeOverrideSassDependency(repo); | ||
} | ||
@@ -126,2 +128,23 @@ const source = 'path' in options ? options.path : p.join(BUILD_PATH, repo); | ||
/** | ||
* Overrides the dart-sass dependency to latest git commit on main when the | ||
* pubspec file declares it as a "-dev" dependency. | ||
*/ | ||
async function maybeOverrideSassDependency(repo) { | ||
var _a; | ||
const pubspecPath = p.join(BUILD_PATH, repo, 'pubspec.yaml'); | ||
const pubspecRaw = await fs_1.promises.readFile(pubspecPath, { encoding: 'utf-8' }); | ||
const pubspec = yaml.parse(pubspecRaw); | ||
const sassVersion = (_a = pubspec === null || pubspec === void 0 ? void 0 : pubspec.dependencies) === null || _a === void 0 ? void 0 : _a.sass; | ||
if (typeof sassVersion !== 'string') | ||
return; | ||
if (!sassVersion.endsWith('-dev')) | ||
return; | ||
console.log(`${repo} depends on sass: ${sassVersion}, overriding with latest commit.`); | ||
pubspec['dependency_overrides'] = { | ||
...pubspec['dependency_overrides'], | ||
sass: { git: 'https://github.com/sass/dart-sass.git' }, | ||
}; | ||
await fs_1.promises.writeFile(pubspecPath, yaml.stringify(pubspec), { encoding: 'utf-8' }); | ||
} | ||
/** | ||
* Throws an informative error if we're running in a Linux environment that uses | ||
@@ -139,3 +162,3 @@ * musl. | ||
/** | ||
* Checks out JS API type defintions from the Sass language repo. | ||
* Checks out JS API type definitions from the Sass language repo. | ||
* | ||
@@ -142,0 +165,0 @@ * Can check out a Git `ref`, or link to the source at `path`. By default, |
@@ -112,2 +112,16 @@ import {FileImporter, Importer} from './importer'; | ||
/** | ||
* If `true`, the compiler may prepend `@charset "UTF-8";` or U+FEFF | ||
* (byte-order marker) if it outputs non-ASCII CSS. | ||
* | ||
* If `false`, the compiler never emits these byte sequences. This is ideal | ||
* when concatenating or embedding in HTML `<style>` tags. (The output will | ||
* still be UTF-8.) | ||
* | ||
* @defaultValue `true` | ||
* @category Output | ||
* @compatibility dart: "1.54.0", node: false | ||
*/ | ||
charset?: boolean; | ||
/** | ||
* Additional built-in Sass functions that are available in all stylesheets. | ||
@@ -114,0 +128,0 @@ * This option takes an object whose keys are Sass function signatures like |
{ | ||
"name": "sass-embedded", | ||
"version": "1.53.0", | ||
"protocol-version": "1.0.0", | ||
"compiler-version": "1.53.0", | ||
"version": "1.54.2", | ||
"protocol-version": "1.1.0", | ||
"compiler-version": "1.54.2", | ||
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol", | ||
@@ -62,4 +62,5 @@ "repository": "sass/embedded-host-node", | ||
"typescript": "^4.4.3", | ||
"yaml": "^1.10.2", | ||
"yargs": "^17.2.1" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
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 too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1181709
17419
22