sass-embedded 1.69.6 → 1.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/index.js +9 -4
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/index.mjs +20 -0
- package/dist/lib/src/compile.js +25 -227
- package/dist/lib/src/compile.js.map +1 -1
- package/dist/lib/src/compiler/async.js +127 -0
- package/dist/lib/src/compiler/async.js.map +1 -0
- package/dist/lib/src/compiler/sync.js +146 -0
- package/dist/lib/src/compiler/sync.js.map +1 -0
- package/dist/lib/src/compiler/utils.js +153 -0
- package/dist/lib/src/compiler/utils.js.map +1 -0
- package/dist/lib/src/compiler-path.js +1 -1
- package/dist/lib/src/dispatcher.js +23 -5
- package/dist/lib/src/dispatcher.js.map +1 -1
- package/dist/lib/src/function-registry.js +4 -7
- package/dist/lib/src/function-registry.js.map +1 -1
- package/dist/lib/src/legacy/utils.js +10 -10
- package/dist/lib/src/legacy/utils.js.map +1 -1
- package/dist/lib/src/logger.js +10 -0
- package/dist/lib/src/logger.js.map +1 -0
- package/dist/lib/src/vendor/embedded_sass_pb.js +7 -0
- package/dist/lib/src/vendor/embedded_sass_pb.js.map +1 -1
- package/dist/package.json +19 -19
- package/dist/tool/utils.js +2 -2
- package/dist/tool/utils.js.map +1 -1
- package/dist/types/compile.d.ts +184 -6
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.m.d.ts +4 -0
- package/package.json +19 -19
- package/dist/lib/src/async-compiler.js +0 -42
- package/dist/lib/src/async-compiler.js.map +0 -1
- package/dist/lib/src/sync-compiler.js +0 -55
- package/dist/lib/src/sync-compiler.js.map +0 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2024 Google LLC. Use of this source code is governed by an
|
|
3
|
+
// MIT-style license that can be found in the LICENSE file or at
|
|
4
|
+
// https://opensource.org/licenses/MIT.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.initCompiler = exports.Compiler = void 0;
|
|
7
|
+
const rxjs_1 = require("rxjs");
|
|
8
|
+
const path = require("path");
|
|
9
|
+
const utils_1 = require("./utils");
|
|
10
|
+
const compiler_path_1 = require("../compiler-path");
|
|
11
|
+
const function_registry_1 = require("../function-registry");
|
|
12
|
+
const importer_registry_1 = require("../importer-registry");
|
|
13
|
+
const message_transformer_1 = require("../message-transformer");
|
|
14
|
+
const packet_transformer_1 = require("../packet-transformer");
|
|
15
|
+
const sync_process_1 = require("../sync-process");
|
|
16
|
+
const utils = require("../utils");
|
|
17
|
+
/**
|
|
18
|
+
* Flag allowing the constructor passed by `initCompiler` so we can
|
|
19
|
+
* differentiate and throw an error if the `Compiler` is constructed via `new
|
|
20
|
+
* Compiler`.
|
|
21
|
+
*/
|
|
22
|
+
const initFlag = Symbol();
|
|
23
|
+
/** A synchronous wrapper for the embedded Sass compiler */
|
|
24
|
+
class Compiler {
|
|
25
|
+
/** Writes `buffer` to the child process's stdin. */
|
|
26
|
+
writeStdin(buffer) {
|
|
27
|
+
this.process.stdin.write(buffer);
|
|
28
|
+
}
|
|
29
|
+
/** Yields the next event from the underlying process. */
|
|
30
|
+
yield() {
|
|
31
|
+
const event = this.process.yield();
|
|
32
|
+
switch (event.type) {
|
|
33
|
+
case 'stdout':
|
|
34
|
+
this.stdout$.next(event.data);
|
|
35
|
+
return true;
|
|
36
|
+
case 'stderr':
|
|
37
|
+
this.stderr$.next(event.data);
|
|
38
|
+
return true;
|
|
39
|
+
case 'exit':
|
|
40
|
+
this.disposed = true;
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** Blocks until the underlying process exits. */
|
|
45
|
+
yieldUntilExit() {
|
|
46
|
+
while (!this.disposed) {
|
|
47
|
+
this.yield();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sends a compile request to the child process and returns the CompileResult.
|
|
52
|
+
* Throws if there were any protocol or compilation errors.
|
|
53
|
+
*/
|
|
54
|
+
compileRequestSync(request, importers, options) {
|
|
55
|
+
const functions = new function_registry_1.FunctionRegistry(options === null || options === void 0 ? void 0 : options.functions);
|
|
56
|
+
const dispatcher = (0, utils_1.createDispatcher)(this.compilationId++, this.messageTransformer, {
|
|
57
|
+
handleImportRequest: request => importers.import(request),
|
|
58
|
+
handleFileImportRequest: request => importers.fileImport(request),
|
|
59
|
+
handleCanonicalizeRequest: request => importers.canonicalize(request),
|
|
60
|
+
handleFunctionCallRequest: request => functions.call(request),
|
|
61
|
+
});
|
|
62
|
+
this.dispatchers.add(dispatcher);
|
|
63
|
+
dispatcher.logEvents$.subscribe(event => (0, utils_1.handleLogEvent)(options, event));
|
|
64
|
+
let error;
|
|
65
|
+
let response;
|
|
66
|
+
dispatcher.sendCompileRequest(request, (error_, response_) => {
|
|
67
|
+
this.dispatchers.delete(dispatcher);
|
|
68
|
+
// Reset the compilation ID when the compiler goes idle (no active
|
|
69
|
+
// dispatchers) to avoid overflowing it.
|
|
70
|
+
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1429266794
|
|
71
|
+
if (this.dispatchers.size === 0)
|
|
72
|
+
this.compilationId = 1;
|
|
73
|
+
if (error_) {
|
|
74
|
+
error = error_;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
response = response_;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
for (;;) {
|
|
81
|
+
if (!this.yield()) {
|
|
82
|
+
throw utils.compilerError('Embedded compiler exited unexpectedly.');
|
|
83
|
+
}
|
|
84
|
+
if (error)
|
|
85
|
+
throw error;
|
|
86
|
+
if (response)
|
|
87
|
+
return (0, utils_1.handleCompileResponse)(response);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Guards against using a disposed compiler. */
|
|
91
|
+
throwIfDisposed() {
|
|
92
|
+
if (this.disposed) {
|
|
93
|
+
throw utils.compilerError('Sync compiler has already been disposed.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Initialize resources shared across compilations. */
|
|
97
|
+
constructor(flag) {
|
|
98
|
+
/** The underlying process that's being wrapped. */
|
|
99
|
+
this.process = new sync_process_1.SyncProcess(compiler_path_1.compilerCommand[0], [...compiler_path_1.compilerCommand.slice(1), '--embedded'], {
|
|
100
|
+
// Use the command's cwd so the compiler survives the removal of the
|
|
101
|
+
// current working directory.
|
|
102
|
+
// https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923
|
|
103
|
+
cwd: path.dirname(compiler_path_1.compilerCommand[0]),
|
|
104
|
+
windowsHide: true,
|
|
105
|
+
});
|
|
106
|
+
/** The next compilation ID. */
|
|
107
|
+
this.compilationId = 1;
|
|
108
|
+
/** A list of active dispatchers. */
|
|
109
|
+
this.dispatchers = new Set();
|
|
110
|
+
/** The buffers emitted by the child process's stdout. */
|
|
111
|
+
this.stdout$ = new rxjs_1.Subject();
|
|
112
|
+
/** The buffers emitted by the child process's stderr. */
|
|
113
|
+
this.stderr$ = new rxjs_1.Subject();
|
|
114
|
+
/** Whether the underlying compiler has already exited. */
|
|
115
|
+
this.disposed = false;
|
|
116
|
+
if (flag !== initFlag) {
|
|
117
|
+
throw utils.compilerError('Compiler can not be directly constructed. ' +
|
|
118
|
+
'Please use `sass.initAsyncCompiler()` instead.');
|
|
119
|
+
}
|
|
120
|
+
this.stderr$.subscribe(data => process.stderr.write(data));
|
|
121
|
+
const packetTransformer = new packet_transformer_1.PacketTransformer(this.stdout$, buffer => {
|
|
122
|
+
this.writeStdin(buffer);
|
|
123
|
+
});
|
|
124
|
+
this.messageTransformer = new message_transformer_1.MessageTransformer(packetTransformer.outboundProtobufs$, packet => packetTransformer.writeInboundProtobuf(packet));
|
|
125
|
+
}
|
|
126
|
+
compile(path, options) {
|
|
127
|
+
this.throwIfDisposed();
|
|
128
|
+
const importers = new importer_registry_1.ImporterRegistry(options);
|
|
129
|
+
return this.compileRequestSync((0, utils_1.newCompilePathRequest)(path, importers, options), importers, options);
|
|
130
|
+
}
|
|
131
|
+
compileString(source, options) {
|
|
132
|
+
this.throwIfDisposed();
|
|
133
|
+
const importers = new importer_registry_1.ImporterRegistry(options);
|
|
134
|
+
return this.compileRequestSync((0, utils_1.newCompileStringRequest)(source, importers, options), importers, options);
|
|
135
|
+
}
|
|
136
|
+
dispose() {
|
|
137
|
+
this.process.stdin.end();
|
|
138
|
+
this.yieldUntilExit();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.Compiler = Compiler;
|
|
142
|
+
function initCompiler() {
|
|
143
|
+
return new Compiler(initFlag);
|
|
144
|
+
}
|
|
145
|
+
exports.initCompiler = initCompiler;
|
|
146
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../lib/src/compiler/sync.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAA6B;AAE7B,6BAA6B;AAC7B,mCAOiB;AACjB,oDAAiD;AAEjD,4DAAsD;AACtD,4DAAsD;AACtD,gEAA0D;AAC1D,8DAAwD;AACxD,kDAA4C;AAC5C,kCAAkC;AAKlC;;;;GAIG;AACH,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC;AAE1B,2DAA2D;AAC3D,MAAa,QAAQ;IAgCnB,oDAAoD;IAC5C,UAAU,CAAC,MAAc;QAC/B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,yDAAyD;IACjD,KAAK;QACX,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;YACnB,KAAK,QAAQ;gBACX,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBAC9B,OAAO,IAAI,CAAC;YAEd,KA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CAAC,kBAAkB,CAC5B,IAAA,+BAAuB,EAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EACnD,SAAS,EACT,OAAO,CACR,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;CACF;AAjKD,4BAiKC;AAED,SAAgB,YAAY;IAC1B,OAAO,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2024 Google LLC. Use of this source code is governed by an
|
|
3
|
+
// MIT-style license that can be found in the LICENSE file or at
|
|
4
|
+
// https://opensource.org/licenses/MIT.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.handleCompileResponse = exports.handleLogEvent = exports.newCompileStringRequest = exports.newCompilePathRequest = exports.createDispatcher = void 0;
|
|
7
|
+
const p = require("path");
|
|
8
|
+
const supportsColor = require("supports-color");
|
|
9
|
+
const deprotofy_span_1 = require("../deprotofy-span");
|
|
10
|
+
const dispatcher_1 = require("../dispatcher");
|
|
11
|
+
const exception_1 = require("../exception");
|
|
12
|
+
const utils_1 = require("../legacy/utils");
|
|
13
|
+
const logger_1 = require("../logger");
|
|
14
|
+
const utils = require("../utils");
|
|
15
|
+
const proto = require("../vendor/embedded_sass_pb");
|
|
16
|
+
/**
|
|
17
|
+
* Creates a dispatcher that dispatches messages from the given `stdout` stream.
|
|
18
|
+
*/
|
|
19
|
+
function createDispatcher(compilationId, messageTransformer, handlers) {
|
|
20
|
+
return new dispatcher_1.Dispatcher(compilationId, messageTransformer.outboundMessages$, message => messageTransformer.writeInboundMessage(message), handlers);
|
|
21
|
+
}
|
|
22
|
+
exports.createDispatcher = createDispatcher;
|
|
23
|
+
// Creates a compilation request for the given `options` without adding any
|
|
24
|
+
// input-specific options.
|
|
25
|
+
function newCompileRequest(importers, options) {
|
|
26
|
+
var _a, _b, _c, _d;
|
|
27
|
+
const request = new proto.InboundMessage_CompileRequest({
|
|
28
|
+
importers: importers.importers,
|
|
29
|
+
globalFunctions: Object.keys((_a = options === null || options === void 0 ? void 0 : options.functions) !== null && _a !== void 0 ? _a : {}),
|
|
30
|
+
sourceMap: !!(options === null || options === void 0 ? void 0 : options.sourceMap),
|
|
31
|
+
sourceMapIncludeSources: !!(options === null || options === void 0 ? void 0 : options.sourceMapIncludeSources),
|
|
32
|
+
alertColor: (_b = options === null || options === void 0 ? void 0 : options.alertColor) !== null && _b !== void 0 ? _b : !!supportsColor.stdout,
|
|
33
|
+
alertAscii: !!(options === null || options === void 0 ? void 0 : options.alertAscii),
|
|
34
|
+
quietDeps: !!(options === null || options === void 0 ? void 0 : options.quietDeps),
|
|
35
|
+
verbose: !!(options === null || options === void 0 ? void 0 : options.verbose),
|
|
36
|
+
charset: !!((_c = options === null || options === void 0 ? void 0 : options.charset) !== null && _c !== void 0 ? _c : true),
|
|
37
|
+
silent: (options === null || options === void 0 ? void 0 : options.logger) === logger_1.Logger.silent,
|
|
38
|
+
});
|
|
39
|
+
switch ((_d = options === null || options === void 0 ? void 0 : options.style) !== null && _d !== void 0 ? _d : 'expanded') {
|
|
40
|
+
case 'expanded':
|
|
41
|
+
request.style = proto.OutputStyle.EXPANDED;
|
|
42
|
+
break;
|
|
43
|
+
case 'compressed':
|
|
44
|
+
request.style = proto.OutputStyle.COMPRESSED;
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
throw new Error(`Unknown options.style: "${options === null || options === void 0 ? void 0 : options.style}"`);
|
|
48
|
+
}
|
|
49
|
+
return request;
|
|
50
|
+
}
|
|
51
|
+
// Creates a request for compiling a file.
|
|
52
|
+
function newCompilePathRequest(path, importers, options) {
|
|
53
|
+
const absPath = p.resolve(path);
|
|
54
|
+
const request = newCompileRequest(importers, options);
|
|
55
|
+
request.input = { case: 'path', value: absPath };
|
|
56
|
+
return request;
|
|
57
|
+
}
|
|
58
|
+
exports.newCompilePathRequest = newCompilePathRequest;
|
|
59
|
+
// Creates a request for compiling a string.
|
|
60
|
+
function newCompileStringRequest(source, importers, options) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const input = new proto.InboundMessage_CompileRequest_StringInput({
|
|
63
|
+
source,
|
|
64
|
+
syntax: utils.protofySyntax((_a = options === null || options === void 0 ? void 0 : options.syntax) !== null && _a !== void 0 ? _a : 'scss'),
|
|
65
|
+
});
|
|
66
|
+
const url = (_b = options === null || options === void 0 ? void 0 : options.url) === null || _b === void 0 ? void 0 : _b.toString();
|
|
67
|
+
if (url && url !== utils_1.legacyImporterProtocol) {
|
|
68
|
+
input.url = url;
|
|
69
|
+
}
|
|
70
|
+
if (options && 'importer' in options && options.importer) {
|
|
71
|
+
input.importer = importers.register(options.importer);
|
|
72
|
+
}
|
|
73
|
+
else if (url === utils_1.legacyImporterProtocol) {
|
|
74
|
+
input.importer = new proto.InboundMessage_CompileRequest_Importer({
|
|
75
|
+
importer: { case: 'path', value: p.resolve('.') },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
// When importer is not set on the host, the compiler will set a
|
|
80
|
+
// FileSystemImporter if `url` is set to a file: url or a NoOpImporter.
|
|
81
|
+
}
|
|
82
|
+
const request = newCompileRequest(importers, options);
|
|
83
|
+
request.input = { case: 'string', value: input };
|
|
84
|
+
return request;
|
|
85
|
+
}
|
|
86
|
+
exports.newCompileStringRequest = newCompileStringRequest;
|
|
87
|
+
/** Handles a log event according to `options`. */
|
|
88
|
+
function handleLogEvent(options, event) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
let span = event.span ? (0, deprotofy_span_1.deprotofySourceSpan)(event.span) : null;
|
|
91
|
+
if (span && (options === null || options === void 0 ? void 0 : options.legacy))
|
|
92
|
+
span = (0, utils_1.removeLegacyImporterFromSpan)(span);
|
|
93
|
+
let message = event.message;
|
|
94
|
+
if (options === null || options === void 0 ? void 0 : options.legacy)
|
|
95
|
+
message = (0, utils_1.removeLegacyImporter)(message);
|
|
96
|
+
let formatted = event.formatted;
|
|
97
|
+
if (options === null || options === void 0 ? void 0 : options.legacy)
|
|
98
|
+
formatted = (0, utils_1.removeLegacyImporter)(formatted);
|
|
99
|
+
if (event.type === proto.LogEventType.DEBUG) {
|
|
100
|
+
if ((_a = options === null || options === void 0 ? void 0 : options.logger) === null || _a === void 0 ? void 0 : _a.debug) {
|
|
101
|
+
options.logger.debug(message, {
|
|
102
|
+
span: span,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
console.error(formatted);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if ((_b = options === null || options === void 0 ? void 0 : options.logger) === null || _b === void 0 ? void 0 : _b.warn) {
|
|
111
|
+
const params = {
|
|
112
|
+
deprecation: event.type === proto.LogEventType.DEPRECATION_WARNING,
|
|
113
|
+
};
|
|
114
|
+
if (span)
|
|
115
|
+
params.span = span;
|
|
116
|
+
const stack = event.stackTrace;
|
|
117
|
+
if (stack) {
|
|
118
|
+
params.stack = (options === null || options === void 0 ? void 0 : options.legacy) ? (0, utils_1.removeLegacyImporter)(stack) : stack;
|
|
119
|
+
}
|
|
120
|
+
options.logger.warn(message, params);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
console.error(formatted);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.handleLogEvent = handleLogEvent;
|
|
128
|
+
/**
|
|
129
|
+
* Converts a `CompileResponse` into a `CompileResult`.
|
|
130
|
+
*
|
|
131
|
+
* Throws a `SassException` if the compilation failed.
|
|
132
|
+
*/
|
|
133
|
+
function handleCompileResponse(response) {
|
|
134
|
+
if (response.result.case === 'success') {
|
|
135
|
+
const success = response.result.value;
|
|
136
|
+
const result = {
|
|
137
|
+
css: success.css,
|
|
138
|
+
loadedUrls: response.loadedUrls.map(url => new URL(url)),
|
|
139
|
+
};
|
|
140
|
+
const sourceMap = success.sourceMap;
|
|
141
|
+
if (sourceMap)
|
|
142
|
+
result.sourceMap = JSON.parse(sourceMap);
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
else if (response.result.case === 'failure') {
|
|
146
|
+
throw new exception_1.Exception(response.result.value);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
throw utils.compilerError('Compiler sent empty CompileResponse.');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
exports.handleCompileResponse = handleCompileResponse;
|
|
153
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/src/compiler/utils.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,0BAA0B;AAC1B,gDAAgD;AAChD,sDAAsD;AACtD,8CAA6D;AAC7D,4CAAuC;AAEvC,2CAIyB;AACzB,sCAAiC;AAEjC,kCAAkC;AAClC,oDAAoD;AA0BpD;;GAEG;AACH,SAAgB,gBAAgB,CAC9B,aAAqB,EACrB,kBAAsC,EACtC,QAAkC;IAElC,OAAO,IAAI,uBAAU,CACnB,aAAa,EACb,kBAAkB,CAAC,iBAAiB,EACpC,OAAO,CAAC,EAAE,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAC1D,QAAQ,CACT,CAAC;AACJ,CAAC;AAXD,4CAWC;AAED,2EAA2E;AAC3E,0BAA0B;AAC1B,SAAS,iBAAiB,CACxB,SAA6C,EAC7C,OAAmC;;IAEnC,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,6BAA6B,CAAC;QACtD,SAAS,EAAE,SAAS,CAAC,SAAS;QAC9B,eAAe,EAAE,MAAM,CAAC,IAAI,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAA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KAAK,CAAC,SAAS,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,qBAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,MAAM,KAAK,CAAC,aAAa,CAAC,sCAAsC,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAlBD,sDAkBC"}
|
|
@@ -24,7 +24,7 @@ exports.compilerCommand = (() => {
|
|
|
24
24
|
//
|
|
25
25
|
// TODO: Make sure to remove "arm64" from "npm/win32-x64/package.json" when
|
|
26
26
|
// this logic is removed once we have true windows-arm64 support.
|
|
27
|
-
const arch = platform === 'win32' && process.arch === 'arm64' ? '
|
|
27
|
+
const arch = platform === 'win32' && process.arch === 'arm64' ? 'x64' : process.arch;
|
|
28
28
|
// find for development
|
|
29
29
|
for (const path of ['vendor', '../../../lib/src/vendor']) {
|
|
30
30
|
const executable = p.resolve(__dirname, path, `dart-sass/sass${platform === 'win32' ? '.bat' : ''}`);
|
|
@@ -41,6 +41,10 @@ class Dispatcher {
|
|
|
41
41
|
// All outbound messages for this compilation. If we detect any errors while
|
|
42
42
|
// dispatching messages, this completes.
|
|
43
43
|
this.messages$ = new rxjs_1.Subject();
|
|
44
|
+
// Subject to unsubscribe from all outbound messages to prevent past
|
|
45
|
+
// dispatchers with compilation IDs reused by future dispatchers from
|
|
46
|
+
// receiving messages intended for future dispatchers.
|
|
47
|
+
this.unsubscribe$ = new rxjs_1.Subject();
|
|
44
48
|
// If the dispatcher encounters an error, this errors out. It is publicly
|
|
45
49
|
// exposed as a readonly Observable.
|
|
46
50
|
this.errorInternal$ = new rxjs_1.Subject();
|
|
@@ -64,7 +68,7 @@ class Dispatcher {
|
|
|
64
68
|
return result instanceof Promise
|
|
65
69
|
? result.then(() => message)
|
|
66
70
|
: [message];
|
|
67
|
-
}))
|
|
71
|
+
}), (0, operators_1.takeUntil)(this.unsubscribe$))
|
|
68
72
|
.subscribe({
|
|
69
73
|
next: message => this.messages$.next(message),
|
|
70
74
|
error: error => this.throwAndClose(error),
|
|
@@ -76,21 +80,29 @@ class Dispatcher {
|
|
|
76
80
|
}
|
|
77
81
|
/**
|
|
78
82
|
* Sends a CompileRequest inbound. Passes the corresponding outbound
|
|
79
|
-
* CompileResponse or an error to `callback
|
|
83
|
+
* CompileResponse or an error to `callback` and unsubscribes from all
|
|
84
|
+
* outbound events.
|
|
80
85
|
*
|
|
81
86
|
* This uses an old-style callback argument so that it can work either
|
|
82
87
|
* synchronously or asynchronously. If the underlying stdout stream emits
|
|
83
88
|
* events synchronously, `callback` will be called synchronously.
|
|
84
89
|
*/
|
|
85
90
|
sendCompileRequest(request, callback) {
|
|
91
|
+
// Call the callback but unsubscribe first
|
|
92
|
+
const callback_ = (err, response) => {
|
|
93
|
+
this.unsubscribe();
|
|
94
|
+
return callback(err, response);
|
|
95
|
+
};
|
|
86
96
|
if (this.messages$.isStopped) {
|
|
87
|
-
|
|
97
|
+
callback_(new Error('Tried writing to closed dispatcher'), undefined);
|
|
88
98
|
return;
|
|
89
99
|
}
|
|
90
100
|
this.messages$
|
|
91
101
|
.pipe((0, operators_1.filter)(message => message.message.case === 'compileResponse'), (0, operators_1.map)(message => message.message.value))
|
|
92
|
-
.subscribe({ next: response =>
|
|
93
|
-
this.error$.subscribe({
|
|
102
|
+
.subscribe({ next: response => callback_(null, response) });
|
|
103
|
+
this.error$.subscribe({
|
|
104
|
+
error: error => callback_(error, undefined),
|
|
105
|
+
});
|
|
94
106
|
try {
|
|
95
107
|
this.writeInboundMessage([
|
|
96
108
|
this.compilationId,
|
|
@@ -103,11 +115,17 @@ class Dispatcher {
|
|
|
103
115
|
this.throwAndClose(error);
|
|
104
116
|
}
|
|
105
117
|
}
|
|
118
|
+
// Stop the outbound message subscription.
|
|
119
|
+
unsubscribe() {
|
|
120
|
+
this.unsubscribe$.next(undefined);
|
|
121
|
+
this.unsubscribe$.complete();
|
|
122
|
+
}
|
|
106
123
|
// Rejects with `error` all promises awaiting an outbound response, and
|
|
107
124
|
// silently closes all subscriptions awaiting outbound events.
|
|
108
125
|
throwAndClose(error) {
|
|
109
126
|
this.messages$.complete();
|
|
110
127
|
this.errorInternal$.error(error);
|
|
128
|
+
this.unsubscribe();
|
|
111
129
|
}
|
|
112
130
|
// Keeps track of all outbound messages. If the outbound `message` contains a
|
|
113
131
|
// request or response, registers it with pendingOutboundRequests. If it
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../../lib/src/dispatcher.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../../lib/src/dispatcher.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAAyC;AACzC,8CAAgE;AAGhE,mDAAmD;AACnD,uDAAiD;AACjD,mCAAoE;AAQpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,UAAU;IAkCrB,YACmB,aAAqB,EACrB,iBAEhB,EACgB,mBAER,EACQ,uBAAiD;QAPjD,kBAAa,GAAb,aAAa,CAAQ;QACrB,sBAAiB,GAAjB,iBAAiB,CAEjC;QACgB,wBAAmB,GAAnB,mBAAmB,CAE3B;QACQ,4BAAuB,GAAvB,uBAAuB,CAA0B;QAzCpE,6EAA6E;QAC7E,kCAAkC;QACjB,4BAAuB,GAAG,IAAI,gCAAc,EAAE,CAAC;QAEhE,4EAA4E;QAC5E,wCAAwC;QACvB,cAAS,GAAG,IAAI,cAAO,EAAyB,CAAC;QAElE,oEAAoE;QACpE,qEAAqE;QACrE,sDAAsD;QACrC,iBAAY,GAAG,IAAI,cAAO,EAAQ,CAAC;QAEpD,yEAA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CAAC;SACpC,CAAC,CAAC;IACL,CAAC;CACF;AA1OD,gCA0OC"}
|
|
@@ -10,11 +10,6 @@ const proto = require("./vendor/embedded_sass_pb");
|
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
const protofier_1 = require("./protofier");
|
|
12
12
|
const value_1 = require("./value");
|
|
13
|
-
/**
|
|
14
|
-
* The next ID to use for a function. The embedded protocol requires that
|
|
15
|
-
* function IDs be globally unique.
|
|
16
|
-
*/
|
|
17
|
-
let nextFunctionID = 0;
|
|
18
13
|
/**
|
|
19
14
|
* Tracks functions that are defined on the host so that the compiler can
|
|
20
15
|
* execute them.
|
|
@@ -24,6 +19,8 @@ class FunctionRegistry {
|
|
|
24
19
|
this.functionsByName = new Map();
|
|
25
20
|
this.functionsById = new Map();
|
|
26
21
|
this.idsByFunction = new Map();
|
|
22
|
+
/** The next ID to use for a function. */
|
|
23
|
+
this.id = 0;
|
|
27
24
|
for (const [signature, fn] of Object.entries(functionsBySignature !== null && functionsBySignature !== void 0 ? functionsBySignature : {})) {
|
|
28
25
|
const openParen = signature.indexOf('(');
|
|
29
26
|
if (openParen === -1) {
|
|
@@ -35,8 +32,8 @@ class FunctionRegistry {
|
|
|
35
32
|
/** Registers `fn` as a function that can be called using the returned ID. */
|
|
36
33
|
register(fn) {
|
|
37
34
|
return utils.putIfAbsent(this.idsByFunction, fn, () => {
|
|
38
|
-
const id =
|
|
39
|
-
|
|
35
|
+
const id = this.id;
|
|
36
|
+
this.id += 1;
|
|
40
37
|
this.functionsById.set(id, fn);
|
|
41
38
|
return id;
|
|
42
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-registry.js","sourceRoot":"","sources":["../../../lib/src/function-registry.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAA6B;AAG7B,iCAAiC;AAEjC,mDAAmD;AACnD,mCAAkE;AAClE,2CAAsC;AACtC,mCAA8B;AAE9B;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ElD,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACvC,MAAM,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC9D,IAAI,EAAE;gBAAE,OAAO,EAAE,CAAC;YAElB,MAAM,IAAA,qBAAa,EACjB,oEAAoE;gBAClE,UAAU,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CACxC,CAAC;QACJ,CAAC;aAAM,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YACpD,MAAM,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC5D,IAAI,EAAE;gBAAE,OAAO,EAAE,CAAC;YAElB,MAAM,IAAA,qBAAa,EACjB,oEAAoE;gBAClE,YAAY,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAC1C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,IAAA,qBAAa,EACjB,sEAAsE;gBACpE,OAAO,CACV,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAnGD,4CAmGC"}
|
|
@@ -19,31 +19,31 @@ exports.legacyImporterProtocol = 'legacy-importer:';
|
|
|
19
19
|
* legacy importer from manually-specified absolute URLs.
|
|
20
20
|
*/
|
|
21
21
|
exports.legacyImporterProtocolPrefix = 'legacy-importer-';
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
// A regular expression that matches legacy importer protocol syntax that
|
|
23
|
+
// should be removed from human-readable messages.
|
|
24
24
|
const removeLegacyImporterRegExp = new RegExp(`${exports.legacyImporterProtocol}|${exports.legacyImporterProtocolPrefix}`, 'g');
|
|
25
|
-
|
|
25
|
+
// Returns `string` with all instances of legacy importer syntax removed.
|
|
26
26
|
function removeLegacyImporter(string) {
|
|
27
27
|
return string.replace(removeLegacyImporterRegExp, '');
|
|
28
28
|
}
|
|
29
29
|
exports.removeLegacyImporter = removeLegacyImporter;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
// Returns a copy of [span] with the URL updated to remove legacy importer
|
|
31
|
+
// syntax.
|
|
32
32
|
function removeLegacyImporterFromSpan(span) {
|
|
33
33
|
if (!span.url)
|
|
34
34
|
return span;
|
|
35
35
|
return { ...span, url: new URL(removeLegacyImporter(span.url.toString())) };
|
|
36
36
|
}
|
|
37
37
|
exports.removeLegacyImporterFromSpan = removeLegacyImporterFromSpan;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
// Converts [path] to a `file:` URL and adds the [legacyImporterProtocolPrefix]
|
|
39
|
+
// to the beginning so we can distinguish it from manually-specified absolute
|
|
40
|
+
// `file:` URLs.
|
|
41
41
|
function pathToLegacyFileUrl(path) {
|
|
42
42
|
return new URL(`${exports.legacyImporterProtocolPrefix}${(0, url_1.pathToFileURL)(path)}`);
|
|
43
43
|
}
|
|
44
44
|
exports.pathToLegacyFileUrl = pathToLegacyFileUrl;
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
// Converts a `file:` URL with [legacyImporterProtocolPrefix] to the filesystem
|
|
46
|
+
// path which it represents.
|
|
47
47
|
function legacyFileUrlToPath(url) {
|
|
48
48
|
assert_1.strict.equal(url.protocol, importer_1.legacyImporterFileProtocol);
|
|
49
49
|
const originalUrl = url
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/src/legacy/utils.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,mCAAwC;AACxC,6BAAkC;AAElC,oCAAoD;AAEpD,yCAAsD;AAEtD;;GAEG;AACU,QAAA,sBAAsB,GAAG,kBAAkB,CAAC;AAEzD;;;;;GAKG;AACU,QAAA,4BAA4B,GAAG,kBAAkB,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRo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ACV,SAAS,CAAC,oCAA4B,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,IAAA,kCAA0B,EAAC,WAAW,CAAC,CAAC;AACjD,CAAC;AAND,kDAMC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2024 Google Inc. Use of this source code is governed by an
|
|
3
|
+
// MIT-style license that can be found in the LICENSE file or at
|
|
4
|
+
// https://opensource.org/licenses/MIT.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Logger = void 0;
|
|
7
|
+
exports.Logger = {
|
|
8
|
+
silent: { warn() { }, debug() { } },
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../lib/src/logger.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAE1B,QAAA,MAAM,GAAG;IACpB,MAAM,EAAE,EAAC,IAAI,KAAI,CAAC,EAAE,KAAK,KAAI,CAAC,EAAC;CAChC,CAAC"}
|
|
@@ -420,6 +420,12 @@ class InboundMessage_CompileRequest extends protobuf_1.Message {
|
|
|
420
420
|
* @generated from field: bool charset = 13;
|
|
421
421
|
*/
|
|
422
422
|
this.charset = false;
|
|
423
|
+
/**
|
|
424
|
+
* Whether to silently suppresses all `LogEvent`s.
|
|
425
|
+
*
|
|
426
|
+
* @generated from field: bool silent = 14;
|
|
427
|
+
*/
|
|
428
|
+
this.silent = false;
|
|
423
429
|
protobuf_1.proto3.util.initPartial(data, this);
|
|
424
430
|
}
|
|
425
431
|
static fromBinary(bytes, options) {
|
|
@@ -451,6 +457,7 @@ InboundMessage_CompileRequest.fields = protobuf_1.proto3.util.newFieldList(() =>
|
|
|
451
457
|
{ no: 11, name: "quiet_deps", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
452
458
|
{ no: 12, name: "source_map_include_sources", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
453
459
|
{ no: 13, name: "charset", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
460
|
+
{ no: 14, name: "silent", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
|
|
454
461
|
]);
|
|
455
462
|
/**
|
|
456
463
|
* An input stylesheet provided as plain text, rather than loaded from the
|