sass-embedded 1.0.0-beta.1 → 1.0.0-beta.7

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 (116) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +3 -3
  3. package/dist/.gitignore +2 -1
  4. package/dist/lib/index.js +29 -2
  5. package/dist/lib/index.js.map +1 -1
  6. package/dist/lib/src/{embedded/compiler.js → async-compiler.js} +13 -13
  7. package/dist/lib/src/async-compiler.js.map +1 -0
  8. package/dist/lib/src/compile.js +170 -69
  9. package/dist/lib/src/compile.js.map +1 -1
  10. package/dist/lib/src/compiler-path.js +18 -0
  11. package/dist/lib/src/compiler-path.js.map +1 -0
  12. package/dist/lib/src/deprotofy-span.js +51 -0
  13. package/dist/lib/src/deprotofy-span.js.map +1 -0
  14. package/dist/lib/src/{embedded/dispatcher.js → dispatcher.js} +63 -57
  15. package/dist/lib/src/dispatcher.js.map +1 -0
  16. package/dist/lib/src/exception.js +20 -0
  17. package/dist/lib/src/exception.js.map +1 -0
  18. package/dist/lib/src/function-registry.js +81 -0
  19. package/dist/lib/src/function-registry.js.map +1 -0
  20. package/dist/lib/src/legacy.js +133 -0
  21. package/dist/lib/src/legacy.js.map +1 -0
  22. package/dist/lib/src/{embedded/message-transformer.js → message-transformer.js} +35 -34
  23. package/dist/lib/src/message-transformer.js.map +1 -0
  24. package/dist/lib/src/{embedded/packet-transformer.js → packet-transformer.js} +2 -1
  25. package/dist/lib/src/packet-transformer.js.map +1 -0
  26. package/dist/lib/src/protofier.js +205 -0
  27. package/dist/lib/src/protofier.js.map +1 -0
  28. package/dist/lib/src/{embedded/request-tracker.js → request-tracker.js} +1 -0
  29. package/dist/lib/src/request-tracker.js.map +1 -0
  30. package/dist/lib/src/sync-compiler.js +52 -0
  31. package/dist/lib/src/sync-compiler.js.map +1 -0
  32. package/dist/lib/src/{exception/span.js → sync-process/event.js} +2 -2
  33. package/dist/lib/src/sync-process/event.js.map +1 -0
  34. package/dist/lib/src/sync-process/index.js +122 -0
  35. package/dist/lib/src/sync-process/index.js.map +1 -0
  36. package/dist/lib/src/sync-process/sync-message-port.js +128 -0
  37. package/dist/lib/src/sync-process/sync-message-port.js.map +1 -0
  38. package/dist/lib/src/sync-process/worker.js +51 -0
  39. package/dist/lib/src/sync-process/worker.js.map +1 -0
  40. package/dist/lib/src/utils.js +64 -42
  41. package/dist/lib/src/utils.js.map +1 -1
  42. package/dist/lib/src/value/boolean.js +40 -0
  43. package/dist/lib/src/value/boolean.js.map +1 -0
  44. package/dist/lib/src/value/color.js +258 -0
  45. package/dist/lib/src/value/color.js.map +1 -0
  46. package/dist/lib/src/value/index.js +147 -0
  47. package/dist/lib/src/value/index.js.map +1 -0
  48. package/dist/lib/src/value/list.js +99 -0
  49. package/dist/lib/src/value/list.js.map +1 -0
  50. package/dist/lib/src/value/map.js +91 -0
  51. package/dist/lib/src/value/map.js.map +1 -0
  52. package/dist/lib/src/value/null.js +35 -0
  53. package/dist/lib/src/value/null.js.map +1 -0
  54. package/dist/lib/src/value/number.js +579 -0
  55. package/dist/lib/src/value/number.js.map +1 -0
  56. package/dist/lib/src/value/string.js +117 -0
  57. package/dist/lib/src/value/string.js.map +1 -0
  58. package/dist/lib/src/value/utils.js +120 -0
  59. package/dist/lib/src/value/utils.js.map +1 -0
  60. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js +1738 -261
  61. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.js.map +1 -1
  62. package/dist/package.json +63 -0
  63. package/dist/tool/utils.js +78 -90
  64. package/dist/tool/utils.js.map +1 -1
  65. package/dist/types/compile.d.ts +152 -0
  66. package/dist/types/exception.d.ts +41 -0
  67. package/dist/types/importer.d.ts +294 -0
  68. package/dist/types/index.d.ts +76 -0
  69. package/dist/types/legacy/exception.d.ts +54 -0
  70. package/dist/types/legacy/function.d.ts +652 -0
  71. package/dist/types/legacy/importer.d.ts +168 -0
  72. package/dist/types/legacy/options.d.ts +642 -0
  73. package/dist/types/legacy/plugin_this.d.ts +70 -0
  74. package/dist/types/legacy/render.d.ts +139 -0
  75. package/dist/types/logger/index.d.ts +94 -0
  76. package/dist/types/logger/source_location.d.ts +21 -0
  77. package/dist/types/logger/source_span.d.ts +34 -0
  78. package/dist/types/options.d.ts +408 -0
  79. package/dist/types/util/promise_or.d.ts +17 -0
  80. package/dist/types/value/argument_list.d.ts +47 -0
  81. package/dist/types/value/boolean.d.ts +29 -0
  82. package/dist/types/value/color.d.ts +107 -0
  83. package/dist/types/value/function.d.ts +22 -0
  84. package/dist/types/value/index.d.ts +173 -0
  85. package/dist/types/value/list.d.ts +54 -0
  86. package/dist/types/value/map.d.ts +41 -0
  87. package/dist/types/value/number.d.ts +305 -0
  88. package/dist/types/value/string.d.ts +84 -0
  89. package/download-compiler-for-end-user.js +1 -6
  90. package/package.json +25 -21
  91. package/dist/lib/index.d.ts +0 -1
  92. package/dist/lib/src/compile.d.ts +0 -20
  93. package/dist/lib/src/embedded/compiler.d.ts +0 -19
  94. package/dist/lib/src/embedded/compiler.js.map +0 -1
  95. package/dist/lib/src/embedded/dispatcher.d.ts +0 -60
  96. package/dist/lib/src/embedded/dispatcher.js.map +0 -1
  97. package/dist/lib/src/embedded/message-transformer.d.ts +0 -47
  98. package/dist/lib/src/embedded/message-transformer.js.map +0 -1
  99. package/dist/lib/src/embedded/packet-transformer.d.ts +0 -34
  100. package/dist/lib/src/embedded/packet-transformer.js.map +0 -1
  101. package/dist/lib/src/embedded/request-tracker.d.ts +0 -20
  102. package/dist/lib/src/embedded/request-tracker.js.map +0 -1
  103. package/dist/lib/src/exception/exception.d.ts +0 -19
  104. package/dist/lib/src/exception/exception.js +0 -36
  105. package/dist/lib/src/exception/exception.js.map +0 -1
  106. package/dist/lib/src/exception/location.d.ts +0 -11
  107. package/dist/lib/src/exception/location.js +0 -6
  108. package/dist/lib/src/exception/location.js.map +0 -1
  109. package/dist/lib/src/exception/span.d.ts +0 -29
  110. package/dist/lib/src/exception/span.js.map +0 -1
  111. package/dist/lib/src/node-sass/render.d.ts +0 -60
  112. package/dist/lib/src/node-sass/render.js +0 -125
  113. package/dist/lib/src/node-sass/render.js.map +0 -1
  114. package/dist/lib/src/utils.d.ts +0 -14
  115. package/dist/lib/src/vendor/embedded-protocol/embedded_sass_pb.d.ts +0 -1
  116. package/dist/tool/utils.d.ts +0 -29
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "sass-embedded",
3
+ "version": "1.0.0-beta.7",
4
+ "protocol-version": "1.0.0-beta.16",
5
+ "compiler-version": "1.0.0-beta.14",
6
+ "description": "Node.js library that communicates with Embedded Dart Sass using the Embedded Sass protocol",
7
+ "repository": "sass/embedded-host-node",
8
+ "author": "Google Inc.",
9
+ "license": "MIT",
10
+ "main": "dist/lib/index.js",
11
+ "types": "dist/types/index.d.ts",
12
+ "files": [
13
+ "dist/**/*",
14
+ "download-compiler-for-end-user.js"
15
+ ],
16
+ "engines": {
17
+ "node": ">=14.0.0"
18
+ },
19
+ "scripts": {
20
+ "init": "ts-node ./tool/prepare-dev-environment.ts",
21
+ "check": "gts check",
22
+ "clean": "gts clean",
23
+ "compile": "tsc",
24
+ "fix": "gts fix",
25
+ "postinstall": "node ./download-compiler-for-end-user.js",
26
+ "prepublishOnly": "npm run clean && ts-node ./tool/prepare-release.ts",
27
+ "test": "jest"
28
+ },
29
+ "dependencies": {
30
+ "buffer-builder": "^0.2.0",
31
+ "extract-zip": "^2.0.1",
32
+ "google-protobuf": "^3.11.4",
33
+ "immutable": "^4.0.0",
34
+ "node-fetch": "^2.6.0",
35
+ "rxjs": "^7.4.0",
36
+ "semver": "^7.3.5",
37
+ "shelljs": "^0.8.4",
38
+ "supports-color": "^8.1.1",
39
+ "tar": "^6.0.5"
40
+ },
41
+ "devDependencies": {
42
+ "@types/buffer-builder": "^0.2.0",
43
+ "@types/google-protobuf": "^3.7.2",
44
+ "@types/jest": "^27.0.2",
45
+ "@types/node": "^16.10.3",
46
+ "@types/node-fetch": "^2.5.7",
47
+ "@types/semver": "^7.3.4",
48
+ "@types/shelljs": "^0.8.8",
49
+ "@types/supports-color": "^8.1.1",
50
+ "@types/tar": "^6.1.0",
51
+ "@types/yargs": "^17.0.4",
52
+ "del": "^6.0.0",
53
+ "gts": "^3.1.0",
54
+ "jest": "^27.2.5",
55
+ "protoc": "^1.0.4",
56
+ "source-map-js": "^0.6.1",
57
+ "ts-jest": "^27.0.5",
58
+ "ts-node": "^10.2.1",
59
+ "ts-protoc-gen": "^0.15.0",
60
+ "typescript": "^4.4.3",
61
+ "yargs": "^17.2.1"
62
+ }
63
+ }
@@ -3,13 +3,14 @@
3
3
  // MIT-style license that can be found in the LICENSE file or at
4
4
  // https://opensource.org/licenses/MIT.
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getJSApi = exports.getDartSassEmbedded = exports.getEmbeddedProtocol = void 0;
6
7
  const extractZip = require("extract-zip");
7
8
  const fs_1 = require("fs");
8
9
  const node_fetch_1 = require("node-fetch");
9
10
  const p = require("path");
10
- const semver_1 = require("semver");
11
11
  const shell = require("shelljs");
12
12
  const tar_1 = require("tar");
13
+ const pkg = require("../package.json");
13
14
  shell.config.fatal = true;
14
15
  // The current platform's operating system. Throws if the operating system
15
16
  // is not supported by Dart Sass Embedded.
@@ -35,6 +36,11 @@ const ARCH = (() => {
35
36
  return 'ia32';
36
37
  case 'x64':
37
38
  return 'x64';
39
+ // TODO: This is blocked until Github Actions supports compiling Dart Sass
40
+ // for arm64. Until then, download the x64 binary for arm64 users.
41
+ // https://github.com/sass/dart-sass/issues/1125
42
+ case 'arm64':
43
+ return 'x64';
38
44
  default:
39
45
  throw Error(`Architecure ${process.arch} is not supported.`);
40
46
  }
@@ -44,117 +50,103 @@ const ARCHIVE_EXTENSION = OS === 'windows' ? '.zip' : '.tar.gz';
44
50
  // Directory that holds source files.
45
51
  const BUILD_PATH = 'build';
46
52
  /**
47
- * Gets the latest version of the Embedded Protocol. Throws if an error occurs.
53
+ * Gets the Embedded Protocol.
54
+ *
55
+ * Can download the release `version`, check out and build the source from a Git
56
+ * `ref`, or build from the source at `path`.
48
57
  *
49
- * @param version - The Git ref to check out and build. Defaults to `master`.
50
- * @param path - Build from this path instead of pulling from Github.
51
- * @param release - Download the latest release instead of building from source.
58
+ * By default, downloads the release version specified in package.json. Throws
59
+ * if an error occurs.
52
60
  */
53
- async function getEmbeddedProtocol(options) {
61
+ async function getEmbeddedProtocol(outPath, options) {
54
62
  var _a;
55
63
  const repo = 'embedded-protocol';
56
- if (options.release) {
57
- const latestRelease = await getLatestReleaseInfo({
58
- repo,
59
- tag: true,
60
- });
64
+ if (!options || 'version' in options) {
65
+ const version = (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : pkg['protocol-version'];
61
66
  await downloadRelease({
62
67
  repo,
63
- assetUrl: `https://github.com/sass/${repo}/archive/` +
64
- `${latestRelease.name.replace(' ', '-')}` +
65
- ARCHIVE_EXTENSION,
68
+ assetUrl: `https://github.com/sass/${repo}/archive/${version}${ARCHIVE_EXTENSION}`,
66
69
  outPath: BUILD_PATH,
67
70
  });
68
- fs_1.promises.rename(p.join(BUILD_PATH, `${repo}-${latestRelease.name.replace(' ', '-')}`), p.join(BUILD_PATH, repo));
71
+ fs_1.promises.rename(p.join(BUILD_PATH, `${repo}-${version}`), p.join(BUILD_PATH, repo));
69
72
  }
70
- else if (!options.path) {
73
+ else if ('ref' in options) {
71
74
  fetchRepo({
72
75
  repo,
73
76
  outPath: BUILD_PATH,
74
- ref: options.version,
77
+ ref: options.ref,
75
78
  });
76
79
  }
77
- const repoPath = (_a = options.path) !== null && _a !== void 0 ? _a : p.join(BUILD_PATH, repo);
78
- buildEmbeddedProtocol(repoPath);
79
- await linkBuiltFiles(repoPath, p.join(options.outPath, repo));
80
+ const source = options && 'path' in options ? options.path : p.join(BUILD_PATH, repo);
81
+ buildEmbeddedProtocol(source);
82
+ await link(source, p.join(outPath, repo));
80
83
  }
81
84
  exports.getEmbeddedProtocol = getEmbeddedProtocol;
82
85
  /**
83
- * Gets the latest version of the Dart Sass wrapper for the Embedded Compiler.
84
- * Throws if an error occurs.
86
+ * Gets the Dart Sass wrapper for the Embedded Compiler.
85
87
  *
86
- * @param version - If `release` is true, the version of the released binary to
87
- * download (defaults to the latest version). If it's false, the Git ref to
88
- * check out and build (defaults to master).
89
- * @param path - Build from this path instead of pulling from Github.
90
- * @param release - Download the latest release instead of building from source.
88
+ * Can download the release `version`, check out and build the source from a Git
89
+ * `ref`, or build from the source at `path`.
90
+ *
91
+ * By default, downloads the release version specified in package.json. Throws
92
+ * if an error occurs.
91
93
  */
92
- async function getDartSassEmbedded(options) {
94
+ async function getDartSassEmbedded(outPath, options) {
95
+ var _a;
93
96
  const repo = 'dart-sass-embedded';
94
- if (options.release) {
95
- const release = options.version
96
- ? { tag_name: options.version, name: `sass_embedded ${options.version}` }
97
- : await getLatestReleaseInfo({
98
- repo,
99
- });
97
+ if (!options || 'version' in options) {
98
+ const version = (_a = options === null || options === void 0 ? void 0 : options.version) !== null && _a !== void 0 ? _a : pkg['compiler-version'];
100
99
  await downloadRelease({
101
100
  repo,
102
101
  assetUrl: `https://github.com/sass/${repo}/releases/download/` +
103
- `${release.tag_name}/` +
104
- `${release.name.replace(' ', '-')}-` +
105
- `${OS}-${ARCH}` +
106
- ARCHIVE_EXTENSION,
107
- outPath: options.outPath,
102
+ `${version}/sass_embedded-${version}-` +
103
+ `${OS}-${ARCH}${ARCHIVE_EXTENSION}`,
104
+ outPath,
108
105
  });
109
- fs_1.promises.rename(p.join(options.outPath, 'sass_embedded'), p.join(options.outPath, repo));
110
- }
111
- else if (options.path) {
112
- buildDartSassEmbedded(options.path);
113
- await linkBuiltFiles(p.join(options.path, 'build'), p.join(options.outPath, repo));
106
+ fs_1.promises.rename(p.join(outPath, 'sass_embedded'), p.join(outPath, repo));
107
+ return;
114
108
  }
115
- else {
109
+ if ('ref' in options) {
116
110
  fetchRepo({
117
111
  repo,
118
112
  outPath: BUILD_PATH,
119
- ref: options.version,
113
+ ref: options.ref,
120
114
  });
121
- buildDartSassEmbedded(p.join(BUILD_PATH, repo));
122
- await linkBuiltFiles(p.join(BUILD_PATH, repo, 'build'), p.join(options.outPath, repo));
123
115
  }
116
+ const source = 'path' in options ? options.path : p.join(BUILD_PATH, repo);
117
+ buildDartSassEmbedded(source);
118
+ await link(p.join(source, 'build'), p.join(outPath, repo));
124
119
  }
125
120
  exports.getDartSassEmbedded = getDartSassEmbedded;
126
- // Gets the ReleaseInfo of the latest release for `repo`. If `version` is given,
127
- // throws an error if the latest version is not semver-compatible with
128
- // `version`. If `tag` is true, gets the latest tag instead of release.
129
- async function getLatestReleaseInfo(options) {
130
- console.log(`Getting version info for ${options.repo}.`);
131
- const response = await node_fetch_1.default('https://api.github.com/repos/sass/' +
132
- `${options.repo}/${options.tag ? 'tags' : 'releases'}`, {
133
- redirect: 'follow',
134
- });
135
- if (!response.ok) {
136
- throw Error(`Failed to get version info for ${options.repo}: ${response.statusText}`);
137
- }
138
- const latestRelease = JSON.parse(await response.text())[0];
139
- const latestVersion = options.tag
140
- ? latestRelease.name
141
- : latestRelease.tag_name;
142
- if (options.versionConstraint) {
143
- try {
144
- semver_1.satisfies(latestVersion, options.versionConstraint);
145
- }
146
- catch (_a) {
147
- throw Error(`Latest release ${latestVersion} is not compatible with ${options.versionConstraint}.`);
148
- }
149
- }
150
- console.log(`Latest release for ${options.repo} is ${latestVersion}.`);
151
- return latestRelease;
121
+ /**
122
+ * Checks out JS API type defintions from the Sass language repo.
123
+ *
124
+ * Can check out a Git `ref`, or link to the source at `path`. By default,
125
+ * checks out the latest revision from GitHub.
126
+ */
127
+ async function getJSApi(outPath, options) {
128
+ var _a;
129
+ const repo = 'sass';
130
+ let source;
131
+ if (!options || 'ref' in options) {
132
+ fetchRepo({
133
+ repo,
134
+ outPath: BUILD_PATH,
135
+ ref: (_a = options === null || options === void 0 ? void 0 : options.ref) !== null && _a !== void 0 ? _a : 'main',
136
+ });
137
+ source = p.join(BUILD_PATH, repo);
138
+ }
139
+ else {
140
+ source = options.path;
141
+ }
142
+ await link(p.join(source, 'js-api-doc'), p.join(outPath, repo));
152
143
  }
144
+ exports.getJSApi = getJSApi;
153
145
  // Downloads the release for `repo` located at `assetUrl`, then unzips it into
154
146
  // `outPath`.
155
147
  async function downloadRelease(options) {
156
148
  console.log(`Downloading ${options.repo} release asset.`);
157
- const response = await node_fetch_1.default(options.assetUrl, {
149
+ const response = await (0, node_fetch_1.default)(options.assetUrl, {
158
150
  redirect: 'follow',
159
151
  });
160
152
  if (!response.ok) {
@@ -171,7 +163,7 @@ async function downloadRelease(options) {
171
163
  });
172
164
  }
173
165
  else {
174
- tar_1.extract({
166
+ (0, tar_1.extract)({
175
167
  file: zippedAssetPath,
176
168
  cwd: options.outPath,
177
169
  sync: true,
@@ -181,21 +173,16 @@ async function downloadRelease(options) {
181
173
  }
182
174
  // Clones `repo` into `outPath`, then checks out the given Git `ref`.
183
175
  function fetchRepo(options) {
184
- var _a;
185
- if (!fs_1.existsSync(p.join(options.outPath, options.repo))) {
176
+ if (!(0, fs_1.existsSync)(p.join(options.outPath, options.repo))) {
186
177
  console.log(`Cloning ${options.repo} into ${options.outPath}.`);
187
178
  shell.exec(`git clone \
188
179
  --depth=1 \
189
180
  git://github.com/sass/${options.repo} \
190
181
  ${p.join(options.outPath, options.repo)}`, { silent: true });
191
182
  }
192
- const version = options.ref ? `commit ${options.ref}` : 'latest update';
183
+ const version = options.ref === 'main' ? 'latest update' : `commit ${options.ref}`;
193
184
  console.log(`Fetching ${version} for ${options.repo}.`);
194
- shell.exec(`git fetch --depth=1 origin ${(_a = options.ref) !== null && _a !== void 0 ? _a : 'master'}`, {
195
- silent: true,
196
- cwd: p.join(options.outPath, options.repo),
197
- });
198
- shell.exec('git reset --hard FETCH_HEAD', {
185
+ shell.exec(`git fetch --depth=1 origin ${options.ref} && git reset --hard FETCH_HEAD`, {
199
186
  silent: true,
200
187
  cwd: p.join(options.outPath, options.repo),
201
188
  });
@@ -229,16 +216,17 @@ function buildDartSassEmbedded(repoPath) {
229
216
  silent: true,
230
217
  });
231
218
  }
232
- // Links the built files at `builtPath` into `outPath`.
233
- async function linkBuiltFiles(builtPath, outPath) {
234
- console.log(`Linking built files into ${outPath}.`);
235
- await cleanDir(outPath);
219
+ // Links or copies the contents of `source` into `destination`.
220
+ async function link(source, destination) {
221
+ await cleanDir(destination);
236
222
  if (OS === 'windows') {
237
- shell.cp('-R', builtPath, outPath);
223
+ console.log(`Copying ${source} into ${destination}.`);
224
+ shell.cp('-R', source, destination);
238
225
  }
239
226
  else {
227
+ console.log(`Linking ${source} into ${destination}.`);
240
228
  // Symlinking doesn't play nice with Jasmine's test globbing on Windows.
241
- fs_1.promises.symlink(p.resolve(builtPath), outPath);
229
+ fs_1.promises.symlink(p.resolve(source), destination);
242
230
  }
243
231
  }
244
232
  // Ensures that `dir` does not exist, but its parent directory does.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../tool/utils.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,gEAAgE;AAChE,uCAAuC;;AAEvC,0CAA2C;AAC3C,2BAA8C;AAC9C,2CAA+B;AAC/B,0BAA0B;AAC1B,mCAAiC;AACjC,iCAAiC;AACjC,6BAA0C;AAE1C,KAAK,CAAC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;AAE1B,0EAA0E;AAC1E,0CAA0C;AAC1C,MAAM,EAAE,GAAkC,CAAC,GAAG,EAAE;IAC9C,QAAQ,OAAO,CAAC,QAAQ,EAAE;QACxB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QACnB;YACE,MAAM,KAAK,CAAC,YAAY,OAAO,CAAC,QAAQ,oBAAoB,CAAC,CAAC;KACjE;AACH,CAAC,CAAC,EAAE,CAAC;AAEL,yEAAyE;AACzE,mC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js';
2
+
3
+ import {Options, StringOptions} from './options';
4
+
5
+ /**
6
+ * The result of compiling Sass to CSS. Returned by [[compile]],
7
+ * [[compileAsync]], [[compileString]], and [[compileStringAsync]].
8
+ *
9
+ * @category Compile
10
+ */
11
+ export interface CompileResult {
12
+ /**
13
+ * The generated CSS.
14
+ *
15
+ * Note that this *never* includes a `sourceMapUrl` comment—it's up to the
16
+ * caller to determine where to save the source map and how to link to it from
17
+ * the stylesheet.
18
+ */
19
+ css: string;
20
+
21
+ /**
22
+ * The canonical URLs of all the stylesheets that were loaded during the
23
+ * Sass compilation. The order of these URLs is not guaranteed.
24
+ */
25
+ loadedUrls: URL[];
26
+
27
+ /**
28
+ * The object representation of the source map that maps locations in the
29
+ * generated CSS back to locations in the Sass source code.
30
+ *
31
+ * This typically uses absolute `file:` URLs to refer to Sass files, although
32
+ * this can be controlled by having a custom [[Importer]] return
33
+ * [[ImporterResult.sourceMapUrl]].
34
+ *
35
+ * This is set if and only if [[Options.sourceMap]] is `true`.
36
+ */
37
+ sourceMap?: RawSourceMap;
38
+ }
39
+
40
+ /**
41
+ * Synchronously compiles the Sass file at `path` to CSS. If it succeeds it
42
+ * returns a [[CompileResult]], and if it fails it throws an [[Exception]].
43
+ *
44
+ * This only allows synchronous [[Importer]]s and [[CustomFunction]]s.
45
+ *
46
+ * @example
47
+ *
48
+ * ```js
49
+ * const sass = require('sass');
50
+ *
51
+ * const result = sass.compile("style.scss");
52
+ * console.log(result.css);
53
+ * ```
54
+ *
55
+ * @category Compile
56
+ * @compatibility dart: "1.45.0", node: false
57
+ */
58
+ export function compile(path: string, options?: Options<'sync'>): CompileResult;
59
+
60
+ /**
61
+ * Asynchronously compiles the Sass file at `path` to CSS. Returns a promise
62
+ * that resolves with a [[CompileResult]] if it succeeds and rejects with an
63
+ * [[Exception]] if it fails.
64
+ *
65
+ * This only allows synchronous or asynchronous [[Importer]]s and
66
+ * [[CustomFunction]]s.
67
+ *
68
+ * **Heads up!** When using Dart Sass, **[[compile]] is almost twice as fast as
69
+ * [[compileAsync]]**, due to the overhead of making the entire evaluation
70
+ * process asynchronous.
71
+ *
72
+ * @example
73
+ *
74
+ * ```js
75
+ * const sass = require('sass');
76
+ *
77
+ * const result = await sass.compileAsync("style.scss");
78
+ * console.log(result.css);
79
+ * ```
80
+ *
81
+ * @category Compile
82
+ * @compatibility dart: "1.45.0", node: false
83
+ */
84
+ export function compileAsync(
85
+ path: string,
86
+ options?: Options<'async'>
87
+ ): Promise<CompileResult>;
88
+
89
+ /**
90
+ * Synchronously compiles a stylesheet whose contents is `source` to CSS. If it
91
+ * succeeds it returns a [[CompileResult]], and if it fails it throws an
92
+ * [[Exception]].
93
+ *
94
+ * This only allows synchronous [[Importer]]s and [[CustomFunction]]s.
95
+ *
96
+ * @example
97
+ *
98
+ * ```js
99
+ * const sass = require('sass');
100
+ *
101
+ * const result = sass.compileString(`
102
+ * h1 {
103
+ * font-size: 40px;
104
+ * code {
105
+ * font-face: Roboto Mono;
106
+ * }
107
+ * }`);
108
+ * console.log(result.css);
109
+ * ```
110
+ *
111
+ * @category Compile
112
+ * @compatibility dart: "1.45.0", node: false
113
+ */
114
+ export function compileString(
115
+ source: string,
116
+ options?: StringOptions<'sync'>
117
+ ): CompileResult;
118
+
119
+ /**
120
+ * Asynchronously compiles a stylesheet whose contents is `source` to CSS.
121
+ * Returns a promise that resolves with a [[CompileResult]] if it succeeds and
122
+ * rejects with an [[Exception]] if it fails.
123
+ *
124
+ * This only allows synchronous or asynchronous [[Importer]]s and
125
+ * [[CustomFunction]]s.
126
+ *
127
+ * **Heads up!** When using Dart Sass, **[[compile]] is almost twice as fast as
128
+ * [[compileAsync]]**, due to the overhead of making the entire evaluation
129
+ * process asynchronous.
130
+ *
131
+ * @example
132
+ *
133
+ * ```js
134
+ * const sass = require('sass');
135
+ *
136
+ * const result = await sass.compileStringAsync(`
137
+ * h1 {
138
+ * font-size: 40px;
139
+ * code {
140
+ * font-face: Roboto Mono;
141
+ * }
142
+ * }`);
143
+ * console.log(result.css);
144
+ * ```
145
+ *
146
+ * @category Compile
147
+ * @compatibility dart: "1.45.0", node: false
148
+ */
149
+ export function compileStringAsync(
150
+ source: string,
151
+ options?: StringOptions<'async'>
152
+ ): Promise<CompileResult>;
@@ -0,0 +1,41 @@
1
+ import {SourceSpan} from './logger';
2
+
3
+ /**
4
+ * An exception thrown because a Sass compilation failed.
5
+ *
6
+ * @category Other
7
+ */
8
+ export class Exception extends Error {
9
+ private constructor();
10
+
11
+ /**
12
+ * A human-friendly representation of the exception.
13
+ *
14
+ * Because many tools simply print `Error.message` directly, this includes not
15
+ * only the textual description of what went wrong (the [[sassMessage]]) but
16
+ * also an indication of where in the Sass stylesheet the error occurred (the
17
+ * [[span]]) and the Sass stack trace at the point of error (the
18
+ * [[sassStack]]).
19
+ */
20
+ message: string;
21
+
22
+ /**
23
+ * A textual description of what went wrong.
24
+ *
25
+ * Unlike [[message]], this does *not* include representations of [[span]] or
26
+ * [[sassStack]].
27
+ */
28
+ readonly sassMessage: string;
29
+
30
+ /**
31
+ * A human-friendly representation of the Sass stack trace at the point of
32
+ * error.
33
+ */
34
+ readonly sassStack: string;
35
+
36
+ /** The location the error occurred in the Sass file that triggered it. */
37
+ readonly span: SourceSpan;
38
+
39
+ /** Returns the same string as [[message]]. */
40
+ toString(): string;
41
+ }