Skip to content

Commit

Permalink
Support CompileRequest.silent of embedded protocol (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Jan 16, 2024
1 parent ad6f671 commit 728c8fe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 1 addition & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ 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
2 changes: 2 additions & 0 deletions lib/src/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Dispatcher, DispatcherHandlers} from './dispatcher';
import {Exception} from './exception';
import {FunctionRegistry} from './function-registry';
import {ImporterRegistry} from './importer-registry';
import {Logger} from './logger';
import {MessageTransformer} from './message-transformer';
import {PacketTransformer} from './packet-transformer';
import {SyncEmbeddedCompiler} from './sync-compiler';
Expand Down Expand Up @@ -148,6 +149,7 @@ function newCompileRequest(
quietDeps: !!options?.quietDeps,
verbose: !!options?.verbose,
charset: !!(options?.charset ?? true),
silent: options?.logger === Logger.silent,
});

switch (options?.style ?? 'expanded') {
Expand Down
7 changes: 7 additions & 0 deletions lib/src/logger.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright 2024 Google Inc. Use of this source code is governed by an
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

export const Logger = {
silent: {warn() {}, debug() {}},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sass-embedded",
"version": "1.69.7",
"protocol-version": "2.3.0",
"protocol-version": "2.4.0",
"compiler-version": "1.69.7",
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",
"repository": "sass/embedded-host-node",
Expand Down

0 comments on commit 728c8fe

Please sign in to comment.