sass-embedded 1.56.2 → 1.58.2
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/src/compile.js +43 -39
- package/dist/lib/src/compile.js.map +1 -1
- package/dist/lib/src/compiler-path.js +6 -6
- package/dist/lib/src/compiler-path.js.map +1 -1
- package/dist/lib/src/deprotofy-span.js +9 -18
- package/dist/lib/src/deprotofy-span.js.map +1 -1
- package/dist/lib/src/dispatcher.js +48 -48
- package/dist/lib/src/dispatcher.js.map +1 -1
- package/dist/lib/src/exception.js +4 -4
- package/dist/lib/src/exception.js.map +1 -1
- package/dist/lib/src/function-registry.js +24 -25
- package/dist/lib/src/function-registry.js.map +1 -1
- package/dist/lib/src/importer-registry.js +57 -64
- package/dist/lib/src/importer-registry.js.map +1 -1
- package/dist/lib/src/legacy/index.js +1 -1
- package/dist/lib/src/legacy/index.js.map +1 -1
- package/dist/lib/src/message-transformer.js +8 -81
- package/dist/lib/src/message-transformer.js.map +1 -1
- package/dist/lib/src/messages.js +6 -0
- package/dist/lib/src/messages.js.map +1 -0
- package/dist/lib/src/packet-transformer.js.map +1 -1
- package/dist/lib/src/protofier.js +99 -116
- package/dist/lib/src/protofier.js.map +1 -1
- package/dist/lib/src/sync-compiler.js +5 -2
- package/dist/lib/src/sync-compiler.js.map +1 -1
- package/dist/lib/src/utils.js +1 -1
- package/dist/lib/src/utils.js.map +1 -1
- package/dist/package.json +23 -24
- package/dist/tool/get-embedded-compiler.js +68 -0
- package/dist/tool/get-embedded-compiler.js.map +1 -0
- package/dist/tool/get-embedded-protocol.js +41 -0
- package/dist/tool/get-embedded-protocol.js.map +1 -0
- package/dist/tool/get-js-api.js +33 -0
- package/dist/tool/get-js-api.js.map +1 -0
- package/dist/tool/{prepare-dev-environment.js → init.js} +18 -38
- package/dist/tool/init.js.map +1 -0
- package/dist/tool/prepare-optional-release.js +94 -3
- package/dist/tool/prepare-optional-release.js.map +1 -1
- package/dist/tool/prepare-release.js +4 -4
- package/dist/tool/prepare-release.js.map +1 -1
- package/dist/tool/utils.js +6 -248
- package/dist/tool/utils.js.map +1 -1
- package/package.json +23 -24
- package/CHANGELOG.md +0 -2761
- package/dist/.gitignore +0 -18
- package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js +0 -9031
- package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js.map +0 -1
- package/dist/tool/prepare-dev-environment.js.map +0 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Protofier = void 0;
|
|
7
7
|
const immutable_1 = require("immutable");
|
|
8
|
-
const proto = require("./vendor/
|
|
8
|
+
const proto = require("./vendor/embedded_sass_pb");
|
|
9
9
|
const utils = require("./utils");
|
|
10
10
|
const argument_list_1 = require("./value/argument-list");
|
|
11
11
|
const color_1 = require("./value/color");
|
|
@@ -47,103 +47,94 @@ class Protofier {
|
|
|
47
47
|
protofy(value) {
|
|
48
48
|
const result = new proto.Value();
|
|
49
49
|
if (value instanceof string_1.SassString) {
|
|
50
|
-
const string = new proto.
|
|
51
|
-
string.
|
|
52
|
-
string.
|
|
53
|
-
result.
|
|
50
|
+
const string = new proto.Value_String();
|
|
51
|
+
string.text = value.text;
|
|
52
|
+
string.quoted = value.hasQuotes;
|
|
53
|
+
result.value = { case: 'string', value: string };
|
|
54
54
|
}
|
|
55
55
|
else if (value instanceof number_1.SassNumber) {
|
|
56
|
-
|
|
56
|
+
const number = new proto.Value_Number();
|
|
57
|
+
number.value = value.value;
|
|
58
|
+
number.numerators = value.numeratorUnits.toArray();
|
|
59
|
+
number.denominators = value.denominatorUnits.toArray();
|
|
60
|
+
result.value = { case: 'number', value: number };
|
|
57
61
|
}
|
|
58
62
|
else if (value instanceof color_1.SassColor) {
|
|
59
63
|
if (value.hasCalculatedHsl) {
|
|
60
|
-
const color = new proto.
|
|
61
|
-
color.
|
|
62
|
-
color.
|
|
63
|
-
color.
|
|
64
|
-
color.
|
|
65
|
-
result.
|
|
64
|
+
const color = new proto.Value_HslColor();
|
|
65
|
+
color.hue = value.hue;
|
|
66
|
+
color.saturation = value.saturation;
|
|
67
|
+
color.lightness = value.lightness;
|
|
68
|
+
color.alpha = value.alpha;
|
|
69
|
+
result.value = { case: 'hslColor', value: color };
|
|
66
70
|
}
|
|
67
71
|
else {
|
|
68
|
-
const color = new proto.
|
|
69
|
-
color.
|
|
70
|
-
color.
|
|
71
|
-
color.
|
|
72
|
-
color.
|
|
73
|
-
result.
|
|
72
|
+
const color = new proto.Value_RgbColor();
|
|
73
|
+
color.red = value.red;
|
|
74
|
+
color.green = value.green;
|
|
75
|
+
color.blue = value.blue;
|
|
76
|
+
color.alpha = value.alpha;
|
|
77
|
+
result.value = { case: 'rgbColor', value: color };
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
else if (value instanceof list_1.SassList) {
|
|
77
|
-
const list = new proto.
|
|
78
|
-
list.
|
|
79
|
-
list.
|
|
81
|
+
const list = new proto.Value_List();
|
|
82
|
+
list.separator = this.protofySeparator(value.separator);
|
|
83
|
+
list.hasBrackets = value.hasBrackets;
|
|
80
84
|
for (const element of value.asList) {
|
|
81
|
-
list.
|
|
85
|
+
list.contents.push(this.protofy(element));
|
|
82
86
|
}
|
|
83
|
-
result.
|
|
87
|
+
result.value = { case: 'list', value: list };
|
|
84
88
|
}
|
|
85
89
|
else if (value instanceof argument_list_1.SassArgumentList) {
|
|
86
|
-
const list = new proto.
|
|
87
|
-
list.
|
|
88
|
-
list.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const keywords = list.getKeywordsMap();
|
|
90
|
+
const list = new proto.Value_ArgumentList();
|
|
91
|
+
list.id = value.id;
|
|
92
|
+
list.separator = this.protofySeparator(value.separator);
|
|
93
|
+
list.contents = value.asList
|
|
94
|
+
.map(element => this.protofy(element))
|
|
95
|
+
.toArray();
|
|
93
96
|
for (const [key, mapValue] of value.keywordsInternal) {
|
|
94
|
-
keywords
|
|
97
|
+
list.keywords[key] = this.protofy(mapValue);
|
|
95
98
|
}
|
|
96
|
-
result.
|
|
99
|
+
result.value = { case: 'argumentList', value: list };
|
|
97
100
|
}
|
|
98
101
|
else if (value instanceof map_1.SassMap) {
|
|
99
|
-
const map = new proto.
|
|
102
|
+
const map = new proto.Value_Map();
|
|
100
103
|
for (const [key, mapValue] of value.contents) {
|
|
101
|
-
const entry = new proto.
|
|
102
|
-
entry.
|
|
103
|
-
entry.
|
|
104
|
-
map.
|
|
104
|
+
const entry = new proto.Value_Map_Entry();
|
|
105
|
+
entry.key = this.protofy(key);
|
|
106
|
+
entry.value = this.protofy(mapValue);
|
|
107
|
+
map.entries.push(entry);
|
|
105
108
|
}
|
|
106
|
-
result.
|
|
109
|
+
result.value = { case: 'map', value: map };
|
|
107
110
|
}
|
|
108
111
|
else if (value instanceof function_1.SassFunction) {
|
|
109
112
|
if (value.id !== undefined) {
|
|
110
|
-
const fn = new proto.
|
|
111
|
-
fn.
|
|
112
|
-
result.
|
|
113
|
+
const fn = new proto.Value_CompilerFunction();
|
|
114
|
+
fn.id = value.id;
|
|
115
|
+
result.value = { case: 'compilerFunction', value: fn };
|
|
113
116
|
}
|
|
114
117
|
else {
|
|
115
|
-
const fn = new proto.
|
|
116
|
-
fn.
|
|
117
|
-
fn.
|
|
118
|
-
result.
|
|
118
|
+
const fn = new proto.Value_HostFunction();
|
|
119
|
+
fn.id = this.functions.register(value.callback);
|
|
120
|
+
fn.signature = value.signature;
|
|
121
|
+
result.value = { case: 'hostFunction', value: fn };
|
|
119
122
|
}
|
|
120
123
|
}
|
|
121
124
|
else if (value === boolean_1.sassTrue) {
|
|
122
|
-
result.
|
|
125
|
+
result.value = { case: 'singleton', value: proto.SingletonValue.TRUE };
|
|
123
126
|
}
|
|
124
127
|
else if (value === boolean_1.sassFalse) {
|
|
125
|
-
result.
|
|
128
|
+
result.value = { case: 'singleton', value: proto.SingletonValue.FALSE };
|
|
126
129
|
}
|
|
127
130
|
else if (value === null_1.sassNull) {
|
|
128
|
-
result.
|
|
131
|
+
result.value = { case: 'singleton', value: proto.SingletonValue.NULL };
|
|
129
132
|
}
|
|
130
133
|
else {
|
|
131
134
|
throw utils.compilerError(`Unknown Value ${value}`);
|
|
132
135
|
}
|
|
133
136
|
return result;
|
|
134
137
|
}
|
|
135
|
-
/** Converts `number` to its protocol buffer representation. */
|
|
136
|
-
protofyNumber(number) {
|
|
137
|
-
const value = new proto.Value.Number();
|
|
138
|
-
value.setValue(number.value);
|
|
139
|
-
for (const unit of number.numeratorUnits) {
|
|
140
|
-
value.addNumerators(unit);
|
|
141
|
-
}
|
|
142
|
-
for (const unit of number.denominatorUnits) {
|
|
143
|
-
value.addDenominators(unit);
|
|
144
|
-
}
|
|
145
|
-
return value;
|
|
146
|
-
}
|
|
147
138
|
/** Converts `separator` to its protocol buffer representation. */
|
|
148
139
|
protofySeparator(separator) {
|
|
149
140
|
switch (separator) {
|
|
@@ -161,97 +152,89 @@ class Protofier {
|
|
|
161
152
|
}
|
|
162
153
|
/** Converts `value` to its JS representation. */
|
|
163
154
|
deprotofy(value) {
|
|
164
|
-
switch (value.
|
|
165
|
-
case
|
|
166
|
-
const string = value.
|
|
167
|
-
return string.
|
|
168
|
-
? string_1.SassString.empty({ quotes: string.
|
|
169
|
-
: new string_1.SassString(string.
|
|
155
|
+
switch (value.value.case) {
|
|
156
|
+
case 'string': {
|
|
157
|
+
const string = value.value.value;
|
|
158
|
+
return string.text.length === 0
|
|
159
|
+
? string_1.SassString.empty({ quotes: string.quoted })
|
|
160
|
+
: new string_1.SassString(string.text, { quotes: string.quoted });
|
|
161
|
+
}
|
|
162
|
+
case 'number': {
|
|
163
|
+
const number = value.value.value;
|
|
164
|
+
return new number_1.SassNumber(number.value, {
|
|
165
|
+
numeratorUnits: number.numerators,
|
|
166
|
+
denominatorUnits: number.denominators,
|
|
167
|
+
});
|
|
170
168
|
}
|
|
171
|
-
case
|
|
172
|
-
|
|
173
|
-
case proto.Value.ValueCase.RGB_COLOR: {
|
|
174
|
-
const color = value.getRgbColor();
|
|
169
|
+
case 'rgbColor': {
|
|
170
|
+
const color = value.value.value;
|
|
175
171
|
return new color_1.SassColor({
|
|
176
|
-
red: color.
|
|
177
|
-
green: color.
|
|
178
|
-
blue: color.
|
|
179
|
-
alpha: color.
|
|
172
|
+
red: color.red,
|
|
173
|
+
green: color.green,
|
|
174
|
+
blue: color.blue,
|
|
175
|
+
alpha: color.alpha,
|
|
180
176
|
});
|
|
181
177
|
}
|
|
182
|
-
case
|
|
183
|
-
const color = value.
|
|
178
|
+
case 'hslColor': {
|
|
179
|
+
const color = value.value.value;
|
|
184
180
|
return new color_1.SassColor({
|
|
185
|
-
hue: color.
|
|
186
|
-
saturation: color.
|
|
187
|
-
lightness: color.
|
|
188
|
-
alpha: color.
|
|
181
|
+
hue: color.hue,
|
|
182
|
+
saturation: color.saturation,
|
|
183
|
+
lightness: color.lightness,
|
|
184
|
+
alpha: color.alpha,
|
|
189
185
|
});
|
|
190
186
|
}
|
|
191
|
-
case
|
|
192
|
-
const list = value.
|
|
193
|
-
const separator = this.deprotofySeparator(list.
|
|
194
|
-
|
|
195
|
-
if (separator === null && contents.length > 1) {
|
|
187
|
+
case 'list': {
|
|
188
|
+
const list = value.value.value;
|
|
189
|
+
const separator = this.deprotofySeparator(list.separator);
|
|
190
|
+
if (separator === null && list.contents.length > 1) {
|
|
196
191
|
throw utils.compilerError(`Value.List ${list} can't have an undecided separator because it ` +
|
|
197
|
-
`has ${contents.length} elements`);
|
|
192
|
+
`has ${list.contents.length} elements`);
|
|
198
193
|
}
|
|
199
|
-
return new list_1.SassList(contents.map(element => this.deprotofy(element)), { separator, brackets: list.
|
|
194
|
+
return new list_1.SassList(list.contents.map(element => this.deprotofy(element)), { separator, brackets: list.hasBrackets });
|
|
200
195
|
}
|
|
201
|
-
case
|
|
202
|
-
const list = value.
|
|
203
|
-
const separator = this.deprotofySeparator(list.
|
|
204
|
-
|
|
205
|
-
if (separator === null && contents.length > 1) {
|
|
196
|
+
case 'argumentList': {
|
|
197
|
+
const list = value.value.value;
|
|
198
|
+
const separator = this.deprotofySeparator(list.separator);
|
|
199
|
+
if (separator === null && list.contents.length > 1) {
|
|
206
200
|
throw utils.compilerError(`Value.List ${list} can't have an undecided separator because it ` +
|
|
207
|
-
`has ${contents.length} elements`);
|
|
201
|
+
`has ${list.contents.length} elements`);
|
|
208
202
|
}
|
|
209
|
-
const result = new argument_list_1.SassArgumentList(contents.map(element => this.deprotofy(element)), (0, immutable_1.OrderedMap)(
|
|
203
|
+
const result = new argument_list_1.SassArgumentList(list.contents.map(element => this.deprotofy(element)), (0, immutable_1.OrderedMap)(Object.entries(list.keywords).map(([key, value]) => [
|
|
210
204
|
key,
|
|
211
205
|
this.deprotofy(value),
|
|
212
|
-
])), separator, list.
|
|
206
|
+
])), separator, list.id);
|
|
213
207
|
this.argumentLists.push(result);
|
|
214
208
|
return result;
|
|
215
209
|
}
|
|
216
|
-
case
|
|
217
|
-
return new map_1.SassMap((0, immutable_1.OrderedMap)(value
|
|
218
|
-
.
|
|
219
|
-
.getEntriesList()
|
|
220
|
-
.map(entry => {
|
|
221
|
-
const key = entry.getKey();
|
|
210
|
+
case 'map':
|
|
211
|
+
return new map_1.SassMap((0, immutable_1.OrderedMap)(value.value.value.entries.map(entry => {
|
|
212
|
+
const key = entry.key;
|
|
222
213
|
if (!key)
|
|
223
214
|
throw utils.mandatoryError('Value.Map.Entry.key');
|
|
224
|
-
const value = entry.
|
|
215
|
+
const value = entry.value;
|
|
225
216
|
if (!value)
|
|
226
217
|
throw utils.mandatoryError('Value.Map.Entry.value');
|
|
227
218
|
return [this.deprotofy(key), this.deprotofy(value)];
|
|
228
219
|
})));
|
|
229
|
-
case
|
|
230
|
-
return new function_1.SassFunction(value.
|
|
231
|
-
case
|
|
220
|
+
case 'compilerFunction':
|
|
221
|
+
return new function_1.SassFunction(value.value.value.id);
|
|
222
|
+
case 'hostFunction':
|
|
232
223
|
throw utils.compilerError('The compiler may not send Value.host_function.');
|
|
233
|
-
case
|
|
234
|
-
switch (value.
|
|
224
|
+
case 'singleton':
|
|
225
|
+
switch (value.value.value) {
|
|
235
226
|
case proto.SingletonValue.TRUE:
|
|
236
227
|
return boolean_1.sassTrue;
|
|
237
228
|
case proto.SingletonValue.FALSE:
|
|
238
229
|
return boolean_1.sassFalse;
|
|
239
230
|
case proto.SingletonValue.NULL:
|
|
240
231
|
return null_1.sassNull;
|
|
241
|
-
default:
|
|
242
|
-
throw utils.compilerError(`Unknown Value.singleton ${value.getSingleton()}`);
|
|
243
232
|
}
|
|
233
|
+
// eslint-disable-next-line no-fallthrough
|
|
244
234
|
default:
|
|
245
235
|
throw utils.mandatoryError('Value.value');
|
|
246
236
|
}
|
|
247
237
|
}
|
|
248
|
-
/** Converts `number` to its JS representation. */
|
|
249
|
-
deprotofyNumber(number) {
|
|
250
|
-
return new number_1.SassNumber(number.getValue(), {
|
|
251
|
-
numeratorUnits: number.getNumeratorsList(),
|
|
252
|
-
denominatorUnits: number.getDenominatorsList(),
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
238
|
/** Converts `separator` to its JS representation. */
|
|
256
239
|
deprotofySeparator(separator) {
|
|
257
240
|
switch (separator) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protofier.js","sourceRoot":"","sources":["../../../lib/src/protofier.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,yCAAqC;AAErC,
|
|
1
|
+
{"version":3,"file":"protofier.js","sourceRoot":"","sources":["../../../lib/src/protofier.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,yCAAqC;AAErC,mDAAmD;AACnD,iCAAiC;AAEjC,yDAAuD;AACvD,yCAAwC;AACxC,+CAA8C;AAC9C,uCAAqD;AACrD,qCAAoC;AACpC,2CAA0C;AAC1C,2CAA0C;AAE1C,uCAA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rxjs_1.Subject();
|
|
20
20
|
/** The buffers emitted by the child process's stderr. */
|
|
21
21
|
this.stderr$ = new rxjs_1.Subject();
|
|
22
|
+
/** Whether the underlying compiler has already exited. */
|
|
23
|
+
this.exited = false;
|
|
22
24
|
}
|
|
23
25
|
/** Writes `buffer` to the child process's stdin. */
|
|
24
26
|
writeStdin(buffer) {
|
|
@@ -34,13 +36,14 @@ class SyncEmbeddedCompiler {
|
|
|
34
36
|
this.stderr$.next(event.data);
|
|
35
37
|
return true;
|
|
36
38
|
case 'exit':
|
|
39
|
+
this.exited = true;
|
|
37
40
|
return false;
|
|
38
41
|
}
|
|
39
42
|
}
|
|
40
43
|
/** Blocks until the underlying process exits. */
|
|
41
44
|
yieldUntilExit() {
|
|
42
|
-
while (this.
|
|
43
|
-
|
|
45
|
+
while (!this.exited) {
|
|
46
|
+
this.yield();
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
/** Kills the child process, cleaning up all associated Observables. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-compiler.js","sourceRoot":"","sources":["../../../lib/src/sync-compiler.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAA6B;AAE7B,iDAA2C;AAC3C,mDAA6C;AAE7C;;;GAGG;AACH,MAAa,oBAAoB;IAAjC;QACE,mDAAmD;QAClC,YAAO,GAAG,IAAI,0BAAW,CAAC,4BAAY,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAC;QAE9E,yDAAyD;QAChD,YAAO,GAAG,IAAI,cAAO,EAAU,CAAC;QAEzC,yDAAyD;QAChD,YAAO,GAAG,IAAI,cAAO,EAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"sync-compiler.js","sourceRoot":"","sources":["../../../lib/src/sync-compiler.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,+BAA6B;AAE7B,iDAA2C;A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ofySyntax = exports
|
|
|
7
7
|
const immutable_1 = require("immutable");
|
|
8
8
|
const p = require("path");
|
|
9
9
|
const url = require("url");
|
|
10
|
-
const proto = require("./vendor/
|
|
10
|
+
const proto = require("./vendor/embedded_sass_pb");
|
|
11
11
|
/**
|
|
12
12
|
* The equivalent of `Promise.then()`, except that if the first argument is a
|
|
13
13
|
* plain value it synchronously invokes `callback()` and returns its result.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/src/utils.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,yCAA+B;AAC/B,0BAA0B;AAC1B,2BAA2B;AAE3B,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/src/utils.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,yCAA+B;AAC/B,0BAA0B;AAC1B,2BAA2B;AAE3B,mDAAmD;AAcnD;;;GAGG;AACH,SAAgB,MAAM,CACpB,cAAkC,EAClC,QAA0C;IAE1C,OAAO,cAAc,YAAY,OAAO;QACtC,CAAC,CAAE,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAwB;QACvD,CAAC,CAAC,QAAQ,CAAC,cAAmB,CAAC,CAAC;AACpC,CAAC;AAPD,wBAOC;AAED;;;GAGG;AACH,SAAgB,OAAO,CACrB,sBAAgD,EAChD,QAAgD;IAEhD,IAAI;QACF,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAC;QACxC,OAAO,MAAM,YAAY,OAAO;YAC9B,CAAC,CAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAwB;YAChD,CAAC,CAAC,MAAM,CAAC;KACZ;IAAC,OAAO,KAAc,EAAE;QACvB,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;KACxB;AACH,CAAC;AAZD,0BAYC;AAED,oCAAoC;AACpC,SAAgB,iBAAiB,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AIC;AAED;;;GAGG;AACH,SAAgB,WAAW,CACzB,GAAc,EACd,GAAM,EACN,QAAiB;IAEjB,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,IAAI,GAAG,KAAK,SAAS,EAAE;QACrB,OAAO,GAAG,CAAC;KACZ;SAAM;QACL,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;QAC1B,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACrB,OAAO,MAAM,CAAC;KACf;AACH,CAAC;AAbD,kCAaC"}
|
package/dist/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sass-embedded",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"protocol-version": "1.
|
|
5
|
-
"compiler-version": "1.
|
|
3
|
+
"version": "1.58.2",
|
|
4
|
+
"protocol-version": "1.2.0",
|
|
5
|
+
"compiler-version": "1.58.2",
|
|
6
6
|
"description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",
|
|
7
7
|
"repository": "sass/embedded-host-node",
|
|
8
8
|
"author": "Google Inc.",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"node": ">=14.0.0"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|
|
19
|
-
"init": "ts-node ./tool/
|
|
19
|
+
"init": "ts-node ./tool/init.ts",
|
|
20
20
|
"check": "npm-run-all check:gts check:tsc",
|
|
21
21
|
"check:gts": "gts check",
|
|
22
22
|
"check:tsc": "tsc --noEmit",
|
|
@@ -27,28 +27,29 @@
|
|
|
27
27
|
"test": "jest"
|
|
28
28
|
},
|
|
29
29
|
"optionalDependencies": {
|
|
30
|
-
"sass-embedded-darwin-arm64": "1.
|
|
31
|
-
"sass-embedded-darwin-x64": "1.
|
|
32
|
-
"sass-embedded-linux-arm": "1.
|
|
33
|
-
"sass-embedded-linux-arm64": "1.
|
|
34
|
-
"sass-embedded-linux-ia32": "1.
|
|
35
|
-
"sass-embedded-linux-x64": "1.
|
|
36
|
-
"sass-embedded-win32-ia32": "1.
|
|
37
|
-
"sass-embedded-win32-x64": "1.
|
|
30
|
+
"sass-embedded-darwin-arm64": "1.58.2",
|
|
31
|
+
"sass-embedded-darwin-x64": "1.58.2",
|
|
32
|
+
"sass-embedded-linux-arm": "1.58.2",
|
|
33
|
+
"sass-embedded-linux-arm64": "1.58.2",
|
|
34
|
+
"sass-embedded-linux-ia32": "1.58.2",
|
|
35
|
+
"sass-embedded-linux-x64": "1.58.2",
|
|
36
|
+
"sass-embedded-win32-ia32": "1.58.2",
|
|
37
|
+
"sass-embedded-win32-x64": "1.58.2"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
+
"@bufbuild/protobuf": "^1.0.0",
|
|
40
41
|
"buffer-builder": "^0.2.0",
|
|
41
|
-
"google-protobuf": "^3.11.4",
|
|
42
42
|
"immutable": "^4.0.0",
|
|
43
43
|
"rxjs": "^7.4.0",
|
|
44
44
|
"supports-color": "^8.1.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@bufbuild/buf": "^1.13.1-4",
|
|
48
|
+
"@bufbuild/protoc-gen-es": "^1.0.0",
|
|
47
49
|
"@types/buffer-builder": "^0.2.0",
|
|
48
50
|
"@types/google-protobuf": "^3.7.2",
|
|
49
|
-
"@types/jest": "^
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"@types/node-fetch": "^2.6.0",
|
|
51
|
+
"@types/jest": "^29.4.0",
|
|
52
|
+
"@types/node": "^18.11.18",
|
|
52
53
|
"@types/shelljs": "^0.8.8",
|
|
53
54
|
"@types/supports-color": "^8.1.1",
|
|
54
55
|
"@types/tar": "^6.1.0",
|
|
@@ -56,19 +57,17 @@
|
|
|
56
57
|
"del": "^6.0.0",
|
|
57
58
|
"extract-zip": "^2.0.1",
|
|
58
59
|
"gts": "^4.0.0",
|
|
59
|
-
"jest": "^
|
|
60
|
-
"minipass": "
|
|
61
|
-
"node-fetch": "^2.6.0",
|
|
60
|
+
"jest": "^29.4.1",
|
|
61
|
+
"minipass": "4.0.3",
|
|
62
62
|
"npm-run-all": "^4.1.5",
|
|
63
|
-
"
|
|
63
|
+
"path-equal": "^1.2.5",
|
|
64
64
|
"shelljs": "^0.8.4",
|
|
65
|
-
"source-map-js": "^0.
|
|
65
|
+
"source-map-js": "^1.0.2",
|
|
66
66
|
"tar": "^6.0.5",
|
|
67
|
-
"ts-jest": "^
|
|
67
|
+
"ts-jest": "^29.0.5",
|
|
68
68
|
"ts-node": "^10.2.1",
|
|
69
|
-
"ts-protoc-gen": "^0.15.0",
|
|
70
69
|
"typescript": "^4.4.3",
|
|
71
|
-
"yaml": "^
|
|
70
|
+
"yaml": "^2.2.1",
|
|
72
71
|
"yargs": "^17.2.1"
|
|
73
72
|
}
|
|
74
73
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 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.getEmbeddedCompiler = void 0;
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const p = require("path");
|
|
9
|
+
const yaml = require("yaml");
|
|
10
|
+
const shell = require("shelljs");
|
|
11
|
+
const utils = require("./utils");
|
|
12
|
+
/**
|
|
13
|
+
* Downlaods and builds the Embedded Dart Sass compiler.
|
|
14
|
+
*
|
|
15
|
+
* Can check out and build the source from a Git `ref` or build from the source
|
|
16
|
+
* at `path`. By default, checks out the latest revision from GitHub.
|
|
17
|
+
*/
|
|
18
|
+
async function getEmbeddedCompiler(outPath, options) {
|
|
19
|
+
var _a;
|
|
20
|
+
const repo = 'dart-sass-embedded';
|
|
21
|
+
let source;
|
|
22
|
+
if (!options || 'ref' in options) {
|
|
23
|
+
utils.fetchRepo({
|
|
24
|
+
repo,
|
|
25
|
+
outPath: 'build',
|
|
26
|
+
ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : 'main',
|
|
27
|
+
});
|
|
28
|
+
source = p.join('build', repo);
|
|
29
|
+
await maybeOverrideSassDependency(source);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
source = options.path;
|
|
33
|
+
}
|
|
34
|
+
buildDartSassEmbedded(source);
|
|
35
|
+
await utils.link(p.join(source, 'build'), p.join(outPath, repo));
|
|
36
|
+
}
|
|
37
|
+
exports.getEmbeddedCompiler = getEmbeddedCompiler;
|
|
38
|
+
/**
|
|
39
|
+
* Overrides Embedded Dart Sass compiler's dependency on Dart Sass to use the
|
|
40
|
+
* latest version of Dart Sass from the `main` branch.
|
|
41
|
+
*
|
|
42
|
+
* This allows us to avoid needing to commit a dependency override to the
|
|
43
|
+
* embedded compiler when it doesn't actually require any local changes.
|
|
44
|
+
*/
|
|
45
|
+
async function maybeOverrideSassDependency(repo) {
|
|
46
|
+
const pubspecPath = p.join(repo, 'pubspec.yaml');
|
|
47
|
+
const pubspec = yaml.parse(await fs_1.promises.readFile(pubspecPath, { encoding: 'utf-8' }));
|
|
48
|
+
console.log(`Overriding ${repo} to load Dart Sass from HEAD.`);
|
|
49
|
+
pubspec['dependency_overrides'] = {
|
|
50
|
+
...pubspec['dependency_overrides'],
|
|
51
|
+
sass: { git: 'https://github.com/sass/dart-sass.git' },
|
|
52
|
+
};
|
|
53
|
+
await fs_1.promises.writeFile(pubspecPath, yaml.stringify(pubspec), { encoding: 'utf-8' });
|
|
54
|
+
}
|
|
55
|
+
// Builds the Embedded Dart Sass executable from the source at `repoPath`.
|
|
56
|
+
function buildDartSassEmbedded(repoPath) {
|
|
57
|
+
console.log('Downloading dart-sass-embedded dependencies.');
|
|
58
|
+
shell.exec('dart pub upgrade', {
|
|
59
|
+
cwd: repoPath,
|
|
60
|
+
silent: true,
|
|
61
|
+
});
|
|
62
|
+
console.log('Building dart-sass-embedded executable.');
|
|
63
|
+
shell.exec('dart run grinder protobuf pkg-standalone-dev', {
|
|
64
|
+
cwd: repoPath,
|
|
65
|
+
silent: true,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=get-embedded-compiler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-embedded-compiler.js","sourceRoot":"","sources":["../../tool/get-embedded-compiler.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;;AAEvC,2BAAkC;AAClC,0BAA0B;AAC1B,6BAA6B;AAC7B,iCAAiC;AAEjC,iCAAiC;AAEjC;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB,CACvC,OAAe,EACf,OAAwC;;IAExC,MAAM,IAAI,GAAG,oBAAoB,CAAC;IAElC,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC,OAAO,IAAI,KAAK,IAAI,OAAO,EAAE;QAChC,KAAK,CAAC,SAAS,CAAC;YACd,IAAI;YACJ,OAAO,EAAE,OAAO;YAChB,GAAG,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,mCAAI,MAAM;SAC5B,CAAC,CAAC;QACH,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC/B,MAAM,2BAA2B,CAAC,MAAM,CAAC,CAAC;KAC3C;SAAM;QACL,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;KACvB;IAED,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC9B,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC;AArBD,kDAqBC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,2BAA2B,CAAC,IAAY;IACrD,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,MAAM,aAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CACpD,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,+BAA+B,CAAC,CAAC;IAE/D,OAAO,CAAC,sBAAsB,CAAC,GAAG;QAChC,GAAG,OAAO,CAAC,sBAAsB,CAAC;QAClC,IAAI,EAAE,EAAC,GAAG,EAAE,uCAAuC,EAAC;KACrD,CAAC;IACF,MAAM,aAAE,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAC;AAChF,CAAC;AAED,0EAA0E;AAC1E,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,OAAO,CAAC,GAAG,CAAC,8CAA8C,CAAC,CAAC;IAC5D,KAAK,CAAC,IAAI,CAAC,kBAAkB,EAAE;QAC7B,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACvD,KAAK,CAAC,IAAI,CAAC,8CAA8C,EAAE;QACzD,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 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.getEmbeddedProtocol = void 0;
|
|
7
|
+
const path_equal_1 = require("path-equal");
|
|
8
|
+
const shell = require("shelljs");
|
|
9
|
+
const pkg = require("../package.json");
|
|
10
|
+
const utils = require("./utils");
|
|
11
|
+
/**
|
|
12
|
+
* Downloads and builds the Embedded Sass protocol definition.
|
|
13
|
+
*
|
|
14
|
+
* Can check out and build the source from a Git `ref` or build from the source
|
|
15
|
+
* at `path`. By default, checks out the tagged version specified in
|
|
16
|
+
* package.json's `protocol-version` field. If this version ends in `-dev`,
|
|
17
|
+
* checks out the latest revision from GitHub instead.
|
|
18
|
+
*/
|
|
19
|
+
async function getEmbeddedProtocol(outPath, options) {
|
|
20
|
+
if (!options || 'ref' in options) {
|
|
21
|
+
let ref = options === null || options === void 0 ? void 0 : options.ref;
|
|
22
|
+
if (ref === undefined) {
|
|
23
|
+
const version = pkg['protocol-version'];
|
|
24
|
+
ref = version.endsWith('-dev') ? 'main' : version;
|
|
25
|
+
}
|
|
26
|
+
utils.fetchRepo({ repo: 'embedded-protocol', outPath: 'build', ref });
|
|
27
|
+
}
|
|
28
|
+
else if (!(0, path_equal_1.pathEqual)(options.path, 'build/embedded-protocol')) {
|
|
29
|
+
await utils.cleanDir('build/embedded-protocol');
|
|
30
|
+
await utils.link(options.path, 'build/embedded-protocol');
|
|
31
|
+
}
|
|
32
|
+
buildEmbeddedProtocol();
|
|
33
|
+
}
|
|
34
|
+
exports.getEmbeddedProtocol = getEmbeddedProtocol;
|
|
35
|
+
// Builds the embedded proto into a TS file.
|
|
36
|
+
function buildEmbeddedProtocol() {
|
|
37
|
+
const version = shell.exec('npx buf --version', { silent: true }).stdout.trim();
|
|
38
|
+
console.log(`Building TS with buf ${version}.`);
|
|
39
|
+
shell.exec('npx buf generate');
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=get-embedded-protocol.js.map
|