sass-embedded 1.0.0-beta.3 → 1.0.0-beta.8

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.
Files changed (127) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/.gitignore +1 -0
  3. package/dist/lib/index.js +36 -2
  4. package/dist/lib/index.js.map +1 -1
  5. package/dist/lib/src/{embedded-compiler/compiler.js → async-compiler.js} +13 -13
  6. package/dist/lib/src/async-compiler.js.map +1 -0
  7. package/dist/lib/src/compile.js +187 -85
  8. package/dist/lib/src/compile.js.map +1 -1
  9. package/dist/lib/src/compiler-path.js +18 -0
  10. package/dist/lib/src/compiler-path.js.map +1 -0
  11. package/dist/lib/src/deprotofy-span.js +51 -0
  12. package/dist/lib/src/deprotofy-span.js.map +1 -0
  13. package/dist/lib/src/{embedded-protocol/dispatcher.js → dispatcher.js} +47 -41
  14. package/dist/lib/src/dispatcher.js.map +1 -0
  15. package/dist/lib/src/exception.js +20 -0
  16. package/dist/lib/src/exception.js.map +1 -0
  17. package/dist/lib/src/function-registry.js +92 -0
  18. package/dist/lib/src/function-registry.js.map +1 -0
  19. package/dist/lib/src/importer-registry.js +127 -0
  20. package/dist/lib/src/importer-registry.js.map +1 -0
  21. package/dist/lib/src/legacy.js +133 -0
  22. package/dist/lib/src/legacy.js.map +1 -0
  23. package/dist/lib/src/{embedded-protocol/message-transformer.js → message-transformer.js} +11 -10
  24. package/dist/lib/src/message-transformer.js.map +1 -0
  25. package/dist/lib/src/{embedded-compiler/packet-transformer.js → packet-transformer.js} +2 -1
  26. package/dist/lib/src/packet-transformer.js.map +1 -0
  27. package/dist/lib/src/protofier.js +272 -0
  28. package/dist/lib/src/protofier.js.map +1 -0
  29. package/dist/lib/src/{embedded-protocol/request-tracker.js → request-tracker.js} +1 -0
  30. package/dist/lib/src/request-tracker.js.map +1 -0
  31. package/dist/lib/src/sync-compiler.js +52 -0
  32. package/dist/lib/src/sync-compiler.js.map +1 -0
  33. package/dist/lib/src/{exception/span.js → sync-process/event.js} +2 -2
  34. package/dist/lib/src/sync-process/event.js.map +1 -0
  35. package/dist/lib/src/sync-process/index.js +122 -0
  36. package/dist/lib/src/sync-process/index.js.map +1 -0
  37. package/dist/lib/src/sync-process/sync-message-port.js +128 -0
  38. package/dist/lib/src/sync-process/sync-message-port.js.map +1 -0
  39. package/dist/lib/src/sync-process/worker.js +51 -0
  40. package/dist/lib/src/sync-process/worker.js.map +1 -0
  41. package/dist/lib/src/utils.js +88 -0
  42. package/dist/lib/src/utils.js.map +1 -1
  43. package/dist/lib/src/value/argument-list.js +31 -0
  44. package/dist/lib/src/value/argument-list.js.map +1 -0
  45. package/dist/lib/src/value/boolean.js +40 -0
  46. package/dist/lib/src/value/boolean.js.map +1 -0
  47. package/dist/lib/src/value/color.js +258 -0
  48. package/dist/lib/src/value/color.js.map +1 -0
  49. package/dist/lib/src/value/function.js +34 -0
  50. package/dist/lib/src/value/function.js.map +1 -0
  51. package/dist/lib/src/value/{value.js → index.js} +28 -17
  52. package/dist/lib/src/value/index.js.map +1 -0
  53. package/dist/lib/src/value/list.js +99 -0
  54. package/dist/lib/src/value/list.js.map +1 -0
  55. package/dist/lib/src/value/map.js +91 -0
  56. package/dist/lib/src/value/map.js.map +1 -0
  57. package/dist/lib/src/value/null.js +10 -6
  58. package/dist/lib/src/value/null.js.map +1 -1
  59. package/dist/lib/src/value/number.js +579 -0
  60. package/dist/lib/src/value/number.js.map +1 -0
  61. package/dist/lib/src/value/string.js +117 -0
  62. package/dist/lib/src/value/string.js.map +1 -0
  63. package/dist/lib/src/value/utils.js +120 -0
  64. package/dist/lib/src/value/utils.js.map +1 -0
  65. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js +994 -8
  66. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js.map +1 -1
  67. package/dist/package.json +63 -0
  68. package/dist/tool/utils.js +85 -91
  69. package/dist/tool/utils.js.map +1 -1
  70. package/dist/types/compile.d.ts +152 -0
  71. package/dist/types/exception.d.ts +41 -0
  72. package/dist/types/importer.d.ts +294 -0
  73. package/dist/types/index.d.ts +76 -0
  74. package/dist/types/legacy/exception.d.ts +54 -0
  75. package/dist/types/legacy/function.d.ts +700 -0
  76. package/dist/types/legacy/importer.d.ts +168 -0
  77. package/dist/types/legacy/options.d.ts +642 -0
  78. package/dist/types/legacy/plugin_this.d.ts +73 -0
  79. package/dist/types/legacy/render.d.ts +139 -0
  80. package/dist/types/logger/index.d.ts +94 -0
  81. package/dist/types/logger/source_location.d.ts +21 -0
  82. package/dist/types/logger/source_span.d.ts +34 -0
  83. package/dist/types/options.d.ts +408 -0
  84. package/dist/types/util/promise_or.d.ts +17 -0
  85. package/dist/types/value/argument_list.d.ts +47 -0
  86. package/dist/types/value/boolean.d.ts +29 -0
  87. package/dist/types/value/color.d.ts +107 -0
  88. package/dist/types/value/function.d.ts +22 -0
  89. package/dist/types/value/index.d.ts +173 -0
  90. package/dist/types/value/list.d.ts +54 -0
  91. package/dist/types/value/map.d.ts +41 -0
  92. package/dist/types/value/number.d.ts +305 -0
  93. package/dist/types/value/string.d.ts +84 -0
  94. package/download-compiler-for-end-user.js +1 -6
  95. package/package.json +23 -19
  96. package/dist/lib/index.d.ts +0 -1
  97. package/dist/lib/src/compile.d.ts +0 -20
  98. package/dist/lib/src/embedded-compiler/compiler.d.ts +0 -19
  99. package/dist/lib/src/embedded-compiler/compiler.js.map +0 -1
  100. package/dist/lib/src/embedded-compiler/packet-transformer.d.ts +0 -34
  101. package/dist/lib/src/embedded-compiler/packet-transformer.js.map +0 -1
  102. package/dist/lib/src/embedded-protocol/dispatcher.d.ts +0 -60
  103. package/dist/lib/src/embedded-protocol/dispatcher.js.map +0 -1
  104. package/dist/lib/src/embedded-protocol/message-transformer.d.ts +0 -47
  105. package/dist/lib/src/embedded-protocol/message-transformer.js.map +0 -1
  106. package/dist/lib/src/embedded-protocol/request-tracker.d.ts +0 -20
  107. package/dist/lib/src/embedded-protocol/request-tracker.js.map +0 -1
  108. package/dist/lib/src/embedded-protocol/utils.d.ts +0 -7
  109. package/dist/lib/src/embedded-protocol/utils.js +0 -52
  110. package/dist/lib/src/embedded-protocol/utils.js.map +0 -1
  111. package/dist/lib/src/exception/exception.d.ts +0 -19
  112. package/dist/lib/src/exception/exception.js +0 -36
  113. package/dist/lib/src/exception/exception.js.map +0 -1
  114. package/dist/lib/src/exception/location.d.ts +0 -11
  115. package/dist/lib/src/exception/location.js +0 -6
  116. package/dist/lib/src/exception/location.js.map +0 -1
  117. package/dist/lib/src/exception/span.d.ts +0 -29
  118. package/dist/lib/src/exception/span.js.map +0 -1
  119. package/dist/lib/src/node-sass/render.d.ts +0 -60
  120. package/dist/lib/src/node-sass/render.js +0 -126
  121. package/dist/lib/src/node-sass/render.js.map +0 -1
  122. package/dist/lib/src/utils.d.ts +0 -9
  123. package/dist/lib/src/value/null.d.ts +0 -11
  124. package/dist/lib/src/value/value.d.ts +0 -98
  125. package/dist/lib/src/value/value.js.map +0 -1
  126. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.d.ts +0 -1
  127. package/dist/tool/utils.d.ts +0 -29
@@ -1,47 +0,0 @@
1
- /// <reference types="node" />
2
- import { Observable } from 'rxjs';
3
- import { InboundMessage, OutboundMessage } from '../vendor/embedded-protocol/embedded_sass_pb';
4
- export declare type InboundRequestType = InboundMessage.MessageCase.COMPILE_REQUEST;
5
- export declare type InboundRequest = InboundMessage.CompileRequest;
6
- export declare type InboundResponseType = InboundMessage.MessageCase.IMPORT_RESPONSE | InboundMessage.MessageCase.FILE_IMPORT_RESPONSE | InboundMessage.MessageCase.CANONICALIZE_RESPONSE | InboundMessage.MessageCase.FUNCTION_CALL_RESPONSE;
7
- export declare type InboundResponse = InboundMessage.ImportResponse | InboundMessage.FileImportResponse | InboundMessage.CanonicalizeResponse | InboundMessage.FunctionCallResponse;
8
- export declare type OutboundRequestType = OutboundMessage.MessageCase.IMPORT_REQUEST | OutboundMessage.MessageCase.FILE_IMPORT_REQUEST | OutboundMessage.MessageCase.CANONICALIZE_REQUEST | OutboundMessage.MessageCase.FUNCTION_CALL_REQUEST;
9
- export declare type OutboundRequest = OutboundMessage.ImportRequest | OutboundMessage.FileImportRequest | OutboundMessage.CanonicalizeRequest | OutboundMessage.FunctionCallRequest;
10
- export declare type OutboundResponseType = OutboundMessage.MessageCase.COMPILE_RESPONSE;
11
- export declare type OutboundResponse = OutboundMessage.CompileResponse;
12
- export declare type OutboundEventType = OutboundMessage.MessageCase.LOG_EVENT;
13
- export declare type OutboundEvent = OutboundMessage.LogEvent;
14
- export declare type InboundTypedMessage = {
15
- payload: InboundRequest | InboundResponse;
16
- type: InboundRequestType | InboundResponseType;
17
- };
18
- export declare type OutboundTypedMessage = {
19
- payload: OutboundRequest | OutboundResponse | OutboundEvent;
20
- type: OutboundRequestType | OutboundResponseType | OutboundEventType;
21
- };
22
- /**
23
- * Encodes InboundTypedMessages into protocol buffers and decodes protocol
24
- * buffers into OutboundTypedMessages. Any Embedded Protocol violations that can
25
- * be detected at the message level are encapsulated here and reported as
26
- * errors.
27
- *
28
- * This transformer communicates via In/OutboundTypedMessages instead of raw
29
- * In/OutboundMessages in order to expose more type information to consumers.
30
- * This makes the stream of messages from the transformer easier to interact
31
- * with.
32
- */
33
- export declare class MessageTransformer {
34
- private readonly outboundProtobufs$;
35
- private readonly writeInboundProtobuf;
36
- private readonly outboundMessagesInternal$;
37
- /**
38
- * The OutboundTypedMessages, decoded from protocol buffers. If any errors are
39
- * detected while encoding/decoding, this Observable will error out.
40
- */
41
- readonly outboundMessages$: Observable<OutboundTypedMessage>;
42
- constructor(outboundProtobufs$: Observable<Buffer>, writeInboundProtobuf: (buffer: Buffer) => void);
43
- /**
44
- * Converts the inbound `message` to a protocol buffer.
45
- */
46
- writeInboundMessage(message: InboundTypedMessage): void;
47
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"message-transformer.js","sourceRoot":"","sources":["../../../../lib/src/embedded-protocol/message-transformer.ts"],"names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C;KACrE;IAED,IAAI,CAAC,OAAO;QAAE,MAAM,qBAAa,CAAC,iCAAiC,CAAC,CAAC;IACrE,OAAO;QACL,OAAO;QACP,IAAI;KACL,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,SAAS,MAAM,CAAC,OAA4B;IAC1C,MAAM,cAAc,GAAG,IAAI,iCAAc,EAAE,CAAC;IAC5C,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,iCAAc,CAAC,WAAW,CAAC,eAAe;YAC7C,cAAc,CAAC,iBAAiB,CAC9B,OAAO,CAAC,OAAwC,CACjD,CAAC;YACF,MAAM;QACR,KAAK,iCAAc,CAAC,WAAW,CAAC,eAAe;YAC7C,cAAc,CAAC,iBAAiB,CAC9B,OAAO,CAAC,OAAwC,CACjD,CAAC;YACF,MAAM;QACR,KAAK,iCAAc,CAAC,WAAW,CAAC,oBAAoB;YAClD,cAAc,CAAC,qBAAqB,CAClC,OAAO,CAAC,OAA4C,CACrD,CAAC;YACF,MAAM;QACR,KAAK,iCAAc,CAAC,WAAW,CAAC,qBAAqB;YACnD,cAAc,CAAC,uBAAuB,CACpC,OAAO,CAAC,OAA8C,CACvD,CAAC;YACF,MAAM;QACR,KAAK,iCAAc,CAAC,WAAW,CAAC,sBAAsB;YACpD,cAAc,CAAC,uBAAuB,CACpC,OAAO,CAAC,OAA8C,CACvD,CAAC;YACF,MAAM;KACT;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC;AACvD,CAAC"}
@@ -1,20 +0,0 @@
1
- import { InboundResponseType, OutboundResponseType } from './message-transformer';
2
- /**
3
- * Manages pending inbound and outbound requests. Ensures that requests and
4
- * responses interact correctly and obey the Embedded Protocol.
5
- */
6
- export declare class RequestTracker {
7
- private readonly requests;
8
- /** The next available request ID. */
9
- get nextId(): number;
10
- /**
11
- * Adds an entry for a pending request with ID `id`. The entry stores the
12
- * expected response type. Throws an error if the Protocol Error is violated.
13
- */
14
- add(id: number, expectedResponseType: InboundResponseType | OutboundResponseType): void;
15
- /**
16
- * Resolves a pending request with matching ID `id` and expected response type
17
- * `type`. Throws an error if the Protocol Error is violated.
18
- */
19
- resolve(id: number, type: InboundResponseType | OutboundResponseType): void;
20
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-tracker.js","sourceRoot":"","sources":["../../../../lib/src/embedded-protocol/request-tracker.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;AAIvC;;;GAGG;AACH,MAAa,cAAc;IAA3B;QACE,4EAA4E;QAC5E,8CAA8C;QAC7B,aAAQ,GAErB,EAAE,CAAC;IA4CT,CAAC;IA1CC,qCAAqC;IACrC,IAAI,MAAM;QACR,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;gBAC/D,OAAO,CAAC,CAAC;aACV;SACF;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,GAAG,CACD,EAAU,EACV,oBAAgE;QAEhE,IAAI,EAAE,GAAG,CAAC,EAAE;YACV,MAAM,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;SAC1C;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;YAC5B,MAAM,KAAK,CACT,cAAc,EAAE,6CAA6C,CAC9D,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,oBAAoB,CAAC;IAC3C,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,EAAU,EAAE,IAAgD;QAClE,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE;YACjE,MAAM,KAAK,CAAC,eAAe,EAAE,uCAAuC,CAAC,CAAC;SACvE;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE;YACrC,MAAM,KAAK,CACT,oBAAoB,EAAE,oDAAoD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,iBAAiB,IAAI,GAAG,CACpH,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;IAC3B,CAAC;CACF;AAjDD,wCAiDC"}
@@ -1,7 +0,0 @@
1
- import * as proto from '../vendor/embedded-protocol/embedded_sass_pb';
2
- import { SassException } from '../exception/exception';
3
- /**
4
- * Creates a SassException from the given protocol `buffer`. Throws if the
5
- * buffer has invalid fields.
6
- */
7
- export declare function deprotifyException(buffer: proto.OutboundMessage.CompileResponse.CompileFailure): SassException;
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("../utils");
4
- const exception_1 = require("../exception/exception");
5
- /**
6
- * Creates a SassException from the given protocol `buffer`. Throws if the
7
- * buffer has invalid fields.
8
- */
9
- function deprotifyException(buffer) {
10
- const span = buffer.getSpan();
11
- return new exception_1.SassException(buffer.getMessage(), buffer.getFormatted(), span ? deprotifySourceSpan(span) : undefined, buffer.getStackTrace());
12
- }
13
- exports.deprotifyException = deprotifyException;
14
- // Creates a SourceSpan from the given protocol `buffer`. Throws if the buffer
15
- // has invalid fields.
16
- function deprotifySourceSpan(buffer) {
17
- const text = buffer.getText();
18
- if (buffer.getStart() === undefined) {
19
- throw utils_1.compilerError('Expected SourceSpan to have start.');
20
- }
21
- const start = deprotifySourceLocation(buffer.getStart());
22
- let end;
23
- if (buffer.getEnd() === undefined) {
24
- if (text !== '') {
25
- throw utils_1.compilerError('Expected SourceSpan text to be empty.');
26
- }
27
- }
28
- else {
29
- end = deprotifySourceLocation(buffer.getEnd());
30
- if (end.offset < start.offset) {
31
- throw utils_1.compilerError('Expected SourceSpan end to be after start.');
32
- }
33
- }
34
- const url = buffer.getUrl() === '' ? undefined : buffer.getUrl();
35
- const context = buffer.getContext() === '' ? undefined : buffer.getContext();
36
- return {
37
- text,
38
- start,
39
- end,
40
- url,
41
- context,
42
- };
43
- }
44
- // Creates a SourceLocation from the given protocol `buffer`.
45
- function deprotifySourceLocation(buffer) {
46
- return {
47
- offset: buffer.getOffset(),
48
- line: buffer.getLine(),
49
- column: buffer.getColumn(),
50
- };
51
- }
52
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/src/embedded-protocol/utils.ts"],"names":[],"mappings":";;AAGA,oCAAuC;AACvC,sDAAqD;AAErD;;;GAGG;AACH,SAAgB,kBAAkB,CAChC,MAA4D;IAE5D,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAE9B,OAAO,IAAI,yBAAa,CACtB,MAAM,CAAC,UAAU,EAAE,EACnB,MAAM,CAAC,YAAY,EAAE,EACrB,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAC5C,MAAM,CAAC,aAAa,EAAE,CACvB,CAAC;AACJ,CAAC;AAXD,gDAWC;AAED,8EAA8E;AAC9E,sBAAsB;AACtB,SAAS,mBAAmB,CAAC,MAAwB;IACnD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IAE9B,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK,SAAS,EAAE;QACnC,MAAM,qBAAa,CAAC,oCAAoC,CAAC,CAAC;KAC3D;IACD,MAAM,KAAK,GAAG,uBAAuB,CAAC,MAAM,CAAC,QAAQ,EAAG,CAAC,CAAC;IAE1D,IAAI,GAAG,CAAC;IACR,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,SAAS,EAAE;QACjC,IAAI,IAAI,KAAK,EAAE,EAAE;YACf,MAAM,qBAAa,CAAC,uCAAuC,CAAC,CAAC;SAC9D;KACF;SAAM;QACL,GAAG,GAAG,uBAAuB,CAAC,MAAM,CAAC,MAAM,EAAG,CAAC,CAAC;QAChD,IAAI,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,EAAE;YAC7B,MAAM,qBAAa,CAAC,4CAA4C,CAAC,CAAC;SACnE;KACF;IAED,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IAEjE,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAE7E,OAAO;QACL,IAAI;QACJ,KAAK;QACL,GAAG;QACH,GAAG;QACH,OAAO;KACR,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,SAAS,uBAAuB,CAC9B,MAAuC;IAEvC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE;KAC3B,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- import { SourceSpan } from './span';
2
- /**
3
- * An exception thrown by Sass.
4
- */
5
- export declare class SassException extends Error {
6
- readonly message: string;
7
- private readonly formatted;
8
- readonly span?: SourceSpan | undefined;
9
- readonly trace?: string | undefined;
10
- /**
11
- * @param message - The error message.
12
- * @param formatted - The formatted error message. Includes the message, span,
13
- * and trace.
14
- * @param [span] - The source span associated with the error.
15
- * @param [trace] - The trace associated with the error.
16
- */
17
- constructor(message: string, formatted: string, span?: SourceSpan | undefined, trace?: string | undefined);
18
- toString(): string;
19
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- // Copyright 2020 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
- /**
7
- * An exception thrown by Sass.
8
- */
9
- class SassException extends Error {
10
- /**
11
- * @param message - The error message.
12
- * @param formatted - The formatted error message. Includes the message, span,
13
- * and trace.
14
- * @param [span] - The source span associated with the error.
15
- * @param [trace] - The trace associated with the error.
16
- */
17
- constructor(message, formatted, span, trace) {
18
- var _a;
19
- super(message);
20
- this.message = message;
21
- this.formatted = formatted;
22
- this.span = span;
23
- this.trace = trace;
24
- if (formatted === '')
25
- this.formatted = `Error: ${message}`;
26
- if (trace === '')
27
- this.trace = undefined;
28
- // Inject the entire Sass error into the JS stack trace.
29
- this.stack = (_a = this.stack) === null || _a === void 0 ? void 0 : _a.replace(new RegExp(`^Error: ${message}`), this.formatted);
30
- }
31
- toString() {
32
- return this.formatted;
33
- }
34
- }
35
- exports.SassException = SassException;
36
- //# sourceMappingURL=exception.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exception.js","sourceRoot":"","sources":["../../../../lib/src/exception/exception.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;AAIvC;;GAEG;AACH,MAAa,aAAc,SAAQ,KAAK;IACtC;;;;;;OAMG;IACH,YACW,OAAe,EACP,SAAiB,EACzB,IAAiB,EACjB,KAAc;;QAEvB,KAAK,CAAC,OAAO,CAAC,CAAC;QALN,YAAO,GAAP,OAAO,CAAQ;QACP,cAAS,GAAT,SAAS,CAAQ;QACzB,SAAI,GAAJ,IAAI,CAAa;QACjB,UAAK,GAAL,KAAK,CAAS;QAIvB,IAAI,SAAS,KAAK,EAAE;YAAE,IAAI,CAAC,SAAS,GAAG,UAAU,OAAO,EAAE,CAAC;QAC3D,IAAI,KAAK,KAAK,EAAE;YAAE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QAEzC,wDAAwD;QACxD,IAAI,CAAC,KAAK,SAAG,IAAI,CAAC,KAAK,0CAAE,OAAO,CAC9B,IAAI,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,EAChC,IAAI,CAAC,SAAS,CACf,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AA7BD,sCA6BC"}
@@ -1,11 +0,0 @@
1
- /**
2
- * A single point in a source file.
3
- */
4
- export interface SourceLocation {
5
- /** 0-based offset of this location within the source file. */
6
- readonly offset: number;
7
- /** 0-based line number of this location within the source file. */
8
- readonly line: number;
9
- /** 0-based column number of this location within its line. */
10
- readonly column: number;
11
- }
@@ -1,6 +0,0 @@
1
- "use strict";
2
- // Copyright 2020 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
- //# sourceMappingURL=location.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../../lib/src/exception/location.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC"}
@@ -1,29 +0,0 @@
1
- import { SourceLocation } from './location';
2
- /**
3
- * A chunk of a source file.
4
- */
5
- export interface SourceSpan {
6
- /**
7
- * The text covered by the span, between `start.offset` and `end.offset` in
8
- * the source file referred to by `url`.
9
- */
10
- readonly text: string;
11
- /** The location of the first character in the span. */
12
- readonly start: SourceLocation;
13
- /**
14
- * The location of the first character after the span. If omitted, indicates
15
- * that the span is empty and points immediately before `start`.
16
- */
17
- readonly end?: SourceLocation;
18
- /**
19
- * The URL of the file to which this span refers. If omitted, indicates that
20
- * the span refers to a string that doesn't specify a URL.
21
- */
22
- readonly url?: string;
23
- /**
24
- * Additional source text surrounding the span. Usually contains the full
25
- * lines the span begins and ends on if the span itself doesn't cover the full
26
- * lines.
27
- */
28
- readonly context?: string;
29
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"span.js","sourceRoot":"","sources":["../../../../lib/src/exception/span.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC"}
@@ -1,60 +0,0 @@
1
- /// <reference types="node" />
2
- /**
3
- * Options that are passed to render().
4
- *
5
- * This attempts to match the Node Sass render options as closely as possible
6
- * (see: https://github.com/sass/node-sass#options).
7
- */
8
- export declare type RenderOptions = (FileOptions | StringOptions) & SharedOptions;
9
- interface FileOptions extends SharedOptions {
10
- file: string;
11
- }
12
- interface StringOptions extends SharedOptions {
13
- data: string;
14
- file?: string;
15
- }
16
- interface SharedOptions {
17
- omitSourceMapUrl?: boolean;
18
- outFile?: string | null;
19
- sourceMap?: boolean | string;
20
- sourceMapEmbed?: boolean;
21
- sourceMapRoot?: string;
22
- }
23
- /**
24
- * The result returned by render().
25
- *
26
- * This attempts to match the Node Sass result object as closely as possible
27
- * (see: https://github.com/sass/node-sass#result-object).
28
- */
29
- export interface RenderResult {
30
- css: Buffer;
31
- map?: Buffer;
32
- stats: {
33
- start: number;
34
- end: number;
35
- duration: number;
36
- entry: string;
37
- };
38
- }
39
- /**
40
- * An error thrown by render().
41
- *
42
- * This attempts to match the Node Sass error object as closely as possible
43
- * (see: https://github.com/sass/node-sass#error-object).
44
- */
45
- export interface RenderError extends Error {
46
- status: number;
47
- message: string;
48
- formatted?: string;
49
- line?: number;
50
- column?: number;
51
- file?: string;
52
- }
53
- /**
54
- * Converts Sass to CSS.
55
- *
56
- * This attempts to match the Node Sass `render()` API as closely as possible
57
- * (see: https://github.com/sass/node-sass#usage).
58
- */
59
- export declare function render(options: RenderOptions, callback: (error?: RenderError, result?: RenderResult) => void): void;
60
- export {};
@@ -1,126 +0,0 @@
1
- "use strict";
2
- // Copyright 2021 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
- const p = require("path");
7
- const url_1 = require("url");
8
- const compile_1 = require("../compile");
9
- const exception_1 = require("../exception/exception");
10
- const utils_1 = require("../utils");
11
- /**
12
- * Converts Sass to CSS.
13
- *
14
- * This attempts to match the Node Sass `render()` API as closely as possible
15
- * (see: https://github.com/sass/node-sass#usage).
16
- */
17
- function render(options, callback) {
18
- const fileRequest = options;
19
- const stringRequest = options;
20
- if (!fileRequest.file && utils_1.isNullOrUndefined(stringRequest.data)) {
21
- callback(newRenderError(Error('Either options.data or options.file must be set.')));
22
- return;
23
- }
24
- let sourceMap;
25
- const getSourceMap = wasSourceMapRequested(options)
26
- ? (map) => (sourceMap = map)
27
- : undefined;
28
- const start = Date.now();
29
- const compileSass = stringRequest.data
30
- ? compile_1.compileString({
31
- source: stringRequest.data,
32
- sourceMap: getSourceMap,
33
- url: stringRequest.file ? url_1.pathToFileURL(stringRequest.file) : 'stdin',
34
- })
35
- : compile_1.compile({ path: fileRequest.file, sourceMap: getSourceMap });
36
- compileSass.then(css => callback(undefined, newRenderResult(options, start, css, sourceMap)), error => callback(newRenderError(error)));
37
- }
38
- exports.render = render;
39
- // Determines whether a sourceMap was requested by the call to render().
40
- function wasSourceMapRequested(options) {
41
- return (typeof options.sourceMap === 'string' ||
42
- (options.sourceMap === true && !!options.outFile));
43
- }
44
- // Transforms the compilation result into an object that mimics the Node Sass
45
- // API format.
46
- function newRenderResult(options, start, css, sourceMap) {
47
- var _a, _b;
48
- const end = Date.now();
49
- let sourceMapBytes;
50
- if (sourceMap) {
51
- sourceMap.sourceRoot = (_a = options.sourceMapRoot) !== null && _a !== void 0 ? _a : '';
52
- const sourceMapPath = typeof options.sourceMap === 'string'
53
- ? options.sourceMap
54
- : options.outFile + '.map';
55
- const sourceMapDir = p.dirname(sourceMapPath);
56
- if (options.outFile) {
57
- sourceMap.file = p.relative(sourceMapDir, options.outFile);
58
- }
59
- else if (options.file) {
60
- const extension = p.extname(options.file);
61
- sourceMap.file = `${options.file.substring(0, options.file.length - extension.length)}.css`;
62
- }
63
- else {
64
- sourceMap.file = 'stdin.css';
65
- }
66
- sourceMap.sources = sourceMap.sources.map(source => {
67
- if (source.startsWith('file://')) {
68
- return p.relative(sourceMapDir, url_1.fileURLToPath(source));
69
- }
70
- return source;
71
- });
72
- sourceMapBytes = Buffer.from(JSON.stringify(sourceMap));
73
- if (!options.omitSourceMapUrl) {
74
- let url;
75
- if (options.sourceMapEmbed) {
76
- url = `data:application/json;base64,${sourceMapBytes.toString('base64')}`;
77
- }
78
- else if (options.outFile) {
79
- url = p.relative(p.dirname(options.outFile), sourceMapPath);
80
- }
81
- else {
82
- url = sourceMapPath;
83
- }
84
- css += `\n\n/*# sourceMappingURL=${url} */`;
85
- }
86
- }
87
- return {
88
- css: Buffer.from(css),
89
- map: sourceMapBytes,
90
- stats: {
91
- entry: (_b = options.file) !== null && _b !== void 0 ? _b : 'data',
92
- start,
93
- end,
94
- duration: end - start,
95
- },
96
- };
97
- }
98
- // Decorates an Error with additional fields so that it behaves like a Node Sass
99
- // error.
100
- function newRenderError(error) {
101
- var _a, _b, _c;
102
- if (!(error instanceof exception_1.SassException)) {
103
- return Object.assign(error, {
104
- status: 3,
105
- });
106
- }
107
- let file = ((_a = error.span) === null || _a === void 0 ? void 0 : _a.url) || undefined;
108
- if (file && file !== 'stdin') {
109
- file = url_1.fileURLToPath(file);
110
- }
111
- return Object.assign(new Error(), {
112
- status: 1,
113
- message: error.toString().replace(/^Error: /, ''),
114
- formatted: error.toString(),
115
- toString: () => error.toString(),
116
- stack: error.stack,
117
- line: utils_1.isNullOrUndefined((_b = error.span) === null || _b === void 0 ? void 0 : _b.start.line)
118
- ? undefined
119
- : error.span.start.line + 1,
120
- column: utils_1.isNullOrUndefined((_c = error.span) === null || _c === void 0 ? void 0 : _c.start.column)
121
- ? undefined
122
- : error.span.start.column + 1,
123
- file,
124
- });
125
- }
126
- //# sourceMappingURL=render.js.map
@@ -1 +0,0 @@
1
- {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YAAY,yBAAa,CAAC,EAAE;QACrC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;YAC1B,MAAM,EAAE,CAAC;SACV,CAAC,CAAC;KACJ;IAED,IAAI,IAAI,GAAG,OAAA,KAAK,CAAC,IAAI,0CAAE,GAAG,KAAI,SAAS,CAAC;IACxC,IAAI,IAAI,IAAI,IAAI,KAAK,OAAO,EAAE;QAC5B,IAAI,GAAG,mBAAa,CAAC,IAAI,CAAC,CAAC;KAC5B;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,EAAE;QAChC,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QACjD,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE;QAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE;QAChC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,IAAI,EAAE,yBAAiB,OAAC,KAAK,CAAC,IAAI,0CAAE,KAAK,CAAC,IAAI,CAAC;YAC7C,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,KAAK,CAAC,IAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;QAC9B,MAAM,EAAE,yBAAiB,OAAC,KAAK,CAAC,IAAI,0CAAE,KAAK,CAAC,MAAM,CAAC;YACjD,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,KAAK,CAAC,IAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAChC,IAAI;KACL,CAAC,CAAC;AACL,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare type PromiseOr<T> = T | Promise<T>;
2
- /** Checks for null or undefined. */
3
- export declare function isNullOrUndefined<T>(object: T): boolean;
4
- /** Constructs a compiler-caused Error. */
5
- export declare function compilerError(message: string): Error;
6
- /** Constructs a host-caused Error. */
7
- export declare function hostError(message: string): Error;
8
- /** Constructs an error caused by an invalid value type. */
9
- export declare function valueError(message: string, name?: string): Error;
@@ -1,11 +0,0 @@
1
- import { Value } from './value';
2
- declare class SassNull extends Value {
3
- private readonly _hashCode;
4
- get isTruthy(): boolean;
5
- get realNull(): null;
6
- equals(other: Value): boolean;
7
- hashCode(): number;
8
- }
9
- /** The singleton instance of SassScript null. */
10
- export declare const sassNull: SassNull;
11
- export {};
@@ -1,98 +0,0 @@
1
- import { List, OrderedMap, ValueObject } from 'immutable';
2
- /**
3
- * A SassScript value.
4
- *
5
- * All SassScript values are immutable.
6
- *
7
- * Concrete values (such as `SassColor`) are implemented as subclasses and get
8
- * instantiated as normal JS classes.
9
- *
10
- * Untyped values can be cast to particular types using `assert*()` functions,
11
- * which throw user-friendly error messages if they fail.
12
- *
13
- * All values, except `false` and `null`, count as `true`.
14
- *
15
- * All values can be used as lists. Maps count as lists of pairs, while all
16
- * other values count as single-value lists.
17
- */
18
- export declare abstract class Value implements ValueObject {
19
- /** Whether `this` counts as `true`. */
20
- get isTruthy(): boolean;
21
- /** Returns JS null if `this` is `sassNull`. Otherwise, returns `this`. */
22
- get realNull(): Value | null;
23
- /** `this` as a list. */
24
- get asList(): List<Value>;
25
- /** The separator for `this` as a list. */
26
- get separator(): null;
27
- /** Whether `this`, as a list, has brackets. */
28
- get hasBrackets(): boolean;
29
- /**
30
- * Converts `sassIndex` to a JS index into the array returned by `asList`.
31
- *
32
- * Sass indices start counting at 1, and may be negative in order to index
33
- * from the end of the list.
34
- *
35
- * `sassIndex` must be...
36
- * - a number, and
37
- * - an integer, and
38
- * - a valid index into `asList`.
39
- *
40
- * Otherwise, this throws an error.
41
- *
42
- * If `this` came from a function argument, `name` is the argument name
43
- * (without the `$`) and is used for error reporting.
44
- */
45
- sassIndexToListIndex(sassIndex: Value, name?: string): number;
46
- /**
47
- * Casts `this` to `SassBoolean`; throws if `this` isn't a boolean.
48
- *
49
- * If `this` came from a function argument, `name` is the argument name
50
- * (without the `$`) and is used for error reporting.
51
- */
52
- assertBoolean(name?: string): Value;
53
- /**
54
- * Casts `this` to `SassColor`; throws if `this` isn't a color.
55
- *
56
- * If `this` came from a function argument, `name` is the argument name
57
- * (without the `$`) and is used for error reporting.
58
- */
59
- assertColor(name?: string): Value;
60
- /**
61
- * Casts `this` to `SassFunction`; throws if `this` isn't a function
62
- * reference.
63
- *
64
- * If `this` came from a function argument, `name` is the argument name
65
- * (without the `$`) and is used for error reporting.
66
- */
67
- assertFunction(name?: string): Value;
68
- /**
69
- * Casts `this` to `SassMap`; throws if `this` isn't a map.
70
- *
71
- * If `this` came from a function argument, `name` is the argument name
72
- * (without the `$`) and is used for error reporting.
73
- */
74
- assertMap(name?: string): Value;
75
- /**
76
- * Returns `this` as a `SassMap` if it counts as one (including empty lists),
77
- * or `null` if it does not.
78
- */
79
- tryMap(): OrderedMap<Value, Value> | null;
80
- /**
81
- * Casts `this` to `SassString`; throws if `this` isn't a string.
82
- *
83
- * If `this` came from a function argument, `name` is the argument name
84
- * (without the `$`) and is used for error reporting.
85
- */
86
- assertNumber(name?: string): Value;
87
- /**
88
- * Casts `this` to `SassString`; throws if `this` isn't a string.
89
- *
90
- * If `this` came from a function argument, `name` is the argument name
91
- * (without the `$`) and is used for error reporting.
92
- */
93
- assertString(name?: string): Value;
94
- /** Whether `this == other` in SassScript. */
95
- abstract equals(other: Value): boolean;
96
- /** This is the same for values that are `==` in SassScript. */
97
- abstract hashCode(): number;
98
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"value.js","sourceRoot":"","sources":["../../../../lib/src/value/value.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;AAEvC,yCAAwD;AAExD,oCAAoC;AAEpC;;;;;;;;;;;;;;;GAeG;AACH,MAAsB,KAAK;IACzB,uCAAuC;IACvC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0EAA0E;IAC1E,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wB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vD,CAAC;CAOF;AAhID,sBAgIC"}
@@ -1,29 +0,0 @@
1
- /**
2
- * Gets the latest version of the Embedded Protocol. Throws if an error occurs.
3
- *
4
- * @param version - The Git ref to check out and build. Defaults to `main`.
5
- * @param path - Build from this path instead of pulling from Github.
6
- * @param release - Download the latest release instead of building from source.
7
- */
8
- export declare function getEmbeddedProtocol(options: {
9
- outPath: string;
10
- version?: string;
11
- path?: string;
12
- release?: boolean;
13
- }): Promise<void>;
14
- /**
15
- * Gets the latest version of the Dart Sass wrapper for the Embedded Compiler.
16
- * Throws if an error occurs.
17
- *
18
- * @param version - If `release` is true, the version of the released binary to
19
- * download (defaults to the latest version). If it's false, the Git ref to
20
- * check out and build (defaults to main).
21
- * @param path - Build from this path instead of pulling from Github.
22
- * @param release - Download the latest release instead of building from source.
23
- */
24
- export declare function getDartSassEmbedded(options: {
25
- outPath: string;
26
- version?: string;
27
- path?: string;
28
- release?: boolean;
29
- }): Promise<void>;