@modern-js/module-tools 2.0.0-beta.3 → 2.0.0-beta.6

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 (463) hide show
  1. package/CHANGELOG.md +331 -211
  2. package/bin/modern.js +1 -0
  3. package/compiled/@babel/code-frame/index.d.ts +1 -0
  4. package/compiled/@babel/code-frame/index.js +1 -0
  5. package/compiled/@babel/code-frame/license +22 -0
  6. package/compiled/@babel/code-frame/package.json +1 -0
  7. package/compiled/@babel/generator/index.d.ts +1 -0
  8. package/compiled/@babel/generator/index.js +1 -0
  9. package/compiled/@babel/generator/license +22 -0
  10. package/compiled/@babel/generator/package.json +1 -0
  11. package/compiled/@babel/helper-validator-identifier/index.d.ts +1 -0
  12. package/compiled/@babel/helper-validator-identifier/index.js +1 -0
  13. package/compiled/@babel/helper-validator-identifier/license +22 -0
  14. package/compiled/@babel/helper-validator-identifier/package.json +1 -0
  15. package/compiled/@babel/highlight/index.d.ts +1 -0
  16. package/compiled/@babel/highlight/index.js +1 -0
  17. package/compiled/@babel/highlight/license +22 -0
  18. package/compiled/@babel/highlight/package.json +1 -0
  19. package/compiled/@babel/parser/@babel/types/lib/index-legacy.d.ts +2742 -0
  20. package/compiled/@babel/parser/index.js +1 -0
  21. package/compiled/@babel/parser/license +19 -0
  22. package/compiled/@babel/parser/package.json +1 -0
  23. package/compiled/@babel/parser/typings/babel-parser.d.ts +214 -0
  24. package/compiled/@babel/template/index.d.ts +1 -0
  25. package/compiled/@babel/template/index.js +1 -0
  26. package/compiled/@babel/template/license +22 -0
  27. package/compiled/@babel/template/package.json +1 -0
  28. package/compiled/@babel/traverse/index.d.ts +1199 -0
  29. package/compiled/@babel/traverse/index.js +1 -0
  30. package/compiled/@babel/traverse/license +22 -0
  31. package/compiled/@babel/traverse/package.json +1 -0
  32. package/compiled/@babel/types/index.js +1 -0
  33. package/compiled/@babel/types/lib/index-legacy.d.ts +2732 -0
  34. package/compiled/@babel/types/license +22 -0
  35. package/compiled/@babel/types/package.json +1 -0
  36. package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +86 -0
  37. package/compiled/@rollup/plugin-json/estree/index.d.ts +548 -0
  38. package/compiled/@rollup/plugin-json/index.js +1 -0
  39. package/compiled/@rollup/plugin-json/license +21 -0
  40. package/compiled/@rollup/plugin-json/package.json +1 -0
  41. package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +948 -0
  42. package/compiled/@rollup/plugin-json/types/index.d.ts +41 -0
  43. package/compiled/find-up/index.d.ts +138 -0
  44. package/compiled/find-up/index.js +1 -0
  45. package/compiled/find-up/license +9 -0
  46. package/compiled/find-up/locate-path/index.d.ts +83 -0
  47. package/compiled/find-up/package.json +1 -0
  48. package/compiled/less/index.d.ts +282 -0
  49. package/compiled/less/index.js +1 -0
  50. package/compiled/less/package.json +1 -0
  51. package/compiled/normalize-path/index.d.ts +8 -0
  52. package/compiled/normalize-path/index.js +8 -0
  53. package/compiled/normalize-path/license +21 -0
  54. package/compiled/normalize-path/package.json +1 -0
  55. package/compiled/p-map/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  56. package/compiled/p-map/cacheable-lookup/index.d.ts +139 -0
  57. package/compiled/p-map/cacheable-request/index.d.ts +137 -0
  58. package/compiled/p-map/got/dist/source/as-promise/index.d.ts +3 -0
  59. package/compiled/p-map/got/dist/source/as-promise/types.d.ts +256 -0
  60. package/compiled/p-map/got/dist/source/core/index.d.ts +1124 -0
  61. package/compiled/p-map/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  62. package/compiled/p-map/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  63. package/compiled/p-map/got/dist/source/core/utils/timed-out.d.ts +29 -0
  64. package/compiled/p-map/got/dist/source/index.d.ts +4 -0
  65. package/compiled/p-map/got/dist/source/types.d.ts +344 -0
  66. package/compiled/p-map/http-cache-semantics/index.d.ts +170 -0
  67. package/compiled/p-map/index.d.ts +67 -0
  68. package/compiled/p-map/index.js +1 -0
  69. package/compiled/p-map/keyv/src/index.d.ts +104 -0
  70. package/compiled/p-map/license +9 -0
  71. package/compiled/p-map/p-cancelable/index.d.ts +176 -0
  72. package/compiled/p-map/package.json +1 -0
  73. package/compiled/p-map/responselike/index.d.ts +34 -0
  74. package/compiled/postcss-custom-properties/index.d.ts +1 -0
  75. package/compiled/postcss-custom-properties/index.js +1 -0
  76. package/compiled/postcss-custom-properties/package.json +1 -0
  77. package/compiled/postcss-flexbugs-fixes/index.d.ts +1 -0
  78. package/compiled/postcss-flexbugs-fixes/index.js +1 -0
  79. package/compiled/postcss-flexbugs-fixes/license +20 -0
  80. package/compiled/postcss-flexbugs-fixes/package.json +1 -0
  81. package/compiled/postcss-font-variant/index.d.ts +1 -0
  82. package/compiled/postcss-font-variant/index.js +1 -0
  83. package/compiled/postcss-font-variant/license +20 -0
  84. package/compiled/postcss-font-variant/package.json +1 -0
  85. package/compiled/postcss-initial/index.d.ts +1 -0
  86. package/compiled/postcss-initial/index.js +1 -0
  87. package/compiled/postcss-initial/license +20 -0
  88. package/compiled/postcss-initial/package.json +1 -0
  89. package/compiled/postcss-media-minmax/index.d.ts +1 -0
  90. package/compiled/postcss-media-minmax/index.js +1 -0
  91. package/compiled/postcss-media-minmax/license +22 -0
  92. package/compiled/postcss-media-minmax/package.json +1 -0
  93. package/compiled/postcss-nesting/index.d.ts +1 -0
  94. package/compiled/postcss-nesting/index.js +2 -0
  95. package/compiled/postcss-nesting/package.json +1 -0
  96. package/compiled/postcss-page-break/index.d.ts +1 -0
  97. package/compiled/postcss-page-break/index.js +1 -0
  98. package/compiled/postcss-page-break/license +20 -0
  99. package/compiled/postcss-page-break/package.json +1 -0
  100. package/compiled/postcss-value-parser/index.d.ts +1 -0
  101. package/compiled/postcss-value-parser/index.js +1 -0
  102. package/compiled/postcss-value-parser/license +22 -0
  103. package/compiled/postcss-value-parser/package.json +1 -0
  104. package/compiled/rollup/fsevents.node +0 -0
  105. package/compiled/rollup/index.js +82 -0
  106. package/compiled/rollup/package.json +1 -0
  107. package/compiled/rollup/types/rollup.d.ts +948 -0
  108. package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +21 -0
  109. package/compiled/rollup-plugin-dts/index.js +1 -0
  110. package/compiled/rollup-plugin-dts/package.json +1 -0
  111. package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +948 -0
  112. package/compiled/sass/index.js +1 -0
  113. package/compiled/sass/license +1619 -0
  114. package/compiled/sass/package.json +1 -0
  115. package/compiled/sass/types/compile.d.ts +152 -0
  116. package/compiled/sass/types/exception.d.ts +41 -0
  117. package/compiled/sass/types/importer.d.ts +294 -0
  118. package/compiled/sass/types/index.d.ts +80 -0
  119. package/compiled/sass/types/legacy/exception.d.ts +54 -0
  120. package/compiled/sass/types/legacy/function.d.ts +756 -0
  121. package/compiled/sass/types/legacy/importer.d.ts +168 -0
  122. package/compiled/sass/types/legacy/options.d.ts +642 -0
  123. package/compiled/sass/types/legacy/plugin_this.d.ts +73 -0
  124. package/compiled/sass/types/legacy/render.d.ts +139 -0
  125. package/compiled/sass/types/logger/index.d.ts +94 -0
  126. package/compiled/sass/types/logger/source_location.d.ts +21 -0
  127. package/compiled/sass/types/logger/source_span.d.ts +34 -0
  128. package/compiled/sass/types/options.d.ts +435 -0
  129. package/compiled/sass/types/util/promise_or.d.ts +17 -0
  130. package/compiled/sass/types/value/argument_list.d.ts +47 -0
  131. package/compiled/sass/types/value/boolean.d.ts +29 -0
  132. package/compiled/sass/types/value/color.d.ts +107 -0
  133. package/compiled/sass/types/value/function.d.ts +22 -0
  134. package/compiled/sass/types/value/index.d.ts +173 -0
  135. package/compiled/sass/types/value/list.d.ts +54 -0
  136. package/compiled/sass/types/value/map.d.ts +41 -0
  137. package/compiled/sass/types/value/number.d.ts +305 -0
  138. package/compiled/sass/types/value/string.d.ts +84 -0
  139. package/compiled/signal-exit/index.d.ts +24 -0
  140. package/compiled/signal-exit/index.js +1 -0
  141. package/compiled/signal-exit/package.json +1 -0
  142. package/dist/builder/build.d.ts +23 -0
  143. package/dist/builder/build.js +269 -0
  144. package/dist/builder/build.js.map +1 -0
  145. package/dist/builder/clear.d.ts +3 -0
  146. package/dist/builder/clear.js +67 -0
  147. package/dist/builder/clear.js.map +1 -0
  148. package/dist/builder/copy.d.ts +11 -0
  149. package/dist/builder/copy.js +196 -0
  150. package/dist/builder/copy.js.map +1 -0
  151. package/dist/builder/dts/index.d.ts +2 -0
  152. package/dist/builder/dts/index.js +32 -0
  153. package/dist/builder/dts/index.js.map +1 -0
  154. package/dist/builder/dts/rollup.d.ts +17 -0
  155. package/dist/builder/dts/rollup.js +167 -0
  156. package/dist/builder/dts/rollup.js.map +1 -0
  157. package/dist/builder/dts/tsc.d.ts +3 -0
  158. package/dist/builder/dts/tsc.js +153 -0
  159. package/dist/builder/dts/tsc.js.map +1 -0
  160. package/dist/builder/index.d.ts +8 -0
  161. package/dist/builder/index.js +116 -0
  162. package/dist/builder/index.js.map +1 -0
  163. package/dist/builder/platform.d.ts +4 -0
  164. package/dist/builder/platform.js +132 -0
  165. package/dist/builder/platform.js.map +1 -0
  166. package/dist/cli.d.ts +3 -0
  167. package/dist/cli.js +95 -0
  168. package/dist/cli.js.map +1 -0
  169. package/dist/command.d.ts +7 -0
  170. package/dist/command.js +164 -0
  171. package/dist/command.js.map +1 -0
  172. package/dist/config/defineConfig.d.ts +2 -0
  173. package/dist/config/defineConfig.js +29 -0
  174. package/dist/config/defineConfig.js.map +1 -0
  175. package/dist/config/normalize.d.ts +17 -0
  176. package/dist/config/normalize.js +168 -0
  177. package/dist/config/normalize.js.map +1 -0
  178. package/dist/config/schema.d.ts +641 -0
  179. package/dist/config/schema.js +215 -0
  180. package/dist/config/schema.js.map +1 -0
  181. package/dist/constants/build-presets.d.ts +81 -0
  182. package/dist/constants/build-presets.js +236 -0
  183. package/dist/constants/build-presets.js.map +1 -0
  184. package/dist/constants/build.d.ts +5 -0
  185. package/dist/constants/build.js +78 -0
  186. package/dist/constants/build.js.map +1 -0
  187. package/dist/constants/colors.d.ts +4 -0
  188. package/dist/constants/colors.js +35 -0
  189. package/dist/constants/colors.js.map +1 -0
  190. package/dist/constants/dts.d.ts +4 -0
  191. package/dist/constants/dts.js +52 -0
  192. package/dist/constants/dts.js.map +1 -0
  193. package/dist/constants/file.d.ts +3 -0
  194. package/dist/constants/file.js +35 -0
  195. package/dist/constants/file.js.map +1 -0
  196. package/dist/constants/legacy-build-presets.d.ts +13 -0
  197. package/dist/constants/legacy-build-presets.js +198 -0
  198. package/dist/constants/legacy-build-presets.js.map +1 -0
  199. package/dist/constants/log.d.ts +8 -0
  200. package/dist/constants/log.js +43 -0
  201. package/dist/constants/log.js.map +1 -0
  202. package/dist/dev.d.ts +10 -0
  203. package/dist/dev.js +129 -0
  204. package/dist/dev.js.map +1 -0
  205. package/dist/{types/features/build/error.d.ts → error.d.ts} +1 -1
  206. package/dist/error.js +148 -0
  207. package/dist/error.js.map +1 -0
  208. package/dist/hooks/build.d.ts +22 -0
  209. package/dist/hooks/build.js +39 -0
  210. package/dist/hooks/build.js.map +1 -0
  211. package/dist/hooks/dev.d.ts +12 -0
  212. package/dist/hooks/dev.js +37 -0
  213. package/dist/hooks/dev.js.map +1 -0
  214. package/dist/hooks/index.d.ts +29 -0
  215. package/dist/hooks/index.js +46 -0
  216. package/dist/hooks/index.js.map +1 -0
  217. package/dist/hooks/misc.d.ts +5 -0
  218. package/dist/hooks/misc.js +33 -0
  219. package/dist/hooks/misc.js.map +1 -0
  220. package/dist/index.d.ts +5 -0
  221. package/dist/index.js +37 -0
  222. package/dist/index.js.map +1 -0
  223. package/dist/{types/locale → locale}/en.d.ts +0 -0
  224. package/dist/locale/en.js +51 -0
  225. package/dist/locale/en.js.map +1 -0
  226. package/dist/{types/locale → locale}/index.d.ts +0 -0
  227. package/dist/locale/index.js +39 -0
  228. package/dist/locale/index.js.map +1 -0
  229. package/dist/{types/locale → locale}/zh.d.ts +0 -0
  230. package/dist/locale/zh.js +51 -0
  231. package/dist/locale/zh.js.map +1 -0
  232. package/dist/plugins.d.ts +2 -0
  233. package/dist/plugins.js +55 -0
  234. package/dist/plugins.js.map +1 -0
  235. package/dist/types/color.d.ts +1 -0
  236. package/dist/types/color.js +17 -0
  237. package/dist/types/color.js.map +1 -0
  238. package/dist/types/command.d.ts +11 -0
  239. package/dist/types/command.js +17 -0
  240. package/dist/types/command.js.map +1 -0
  241. package/dist/types/config/index.d.ts +92 -0
  242. package/dist/types/config/index.js +19 -0
  243. package/dist/types/config/index.js.map +1 -0
  244. package/dist/types/config/style.d.ts +12 -0
  245. package/dist/types/config/style.js +17 -0
  246. package/dist/types/config/style.js.map +1 -0
  247. package/dist/types/context.d.ts +5 -0
  248. package/dist/types/context.js +17 -0
  249. package/dist/types/context.js.map +1 -0
  250. package/dist/types/copy.d.ts +15 -0
  251. package/dist/types/copy.js +17 -0
  252. package/dist/types/copy.js.map +1 -0
  253. package/dist/types/{utils/tsconfig.d.ts → dts.d.ts} +11 -3
  254. package/dist/types/dts.js +17 -0
  255. package/dist/types/dts.js.map +1 -0
  256. package/dist/types/hooks.d.ts +25 -0
  257. package/dist/types/hooks.js +17 -0
  258. package/dist/types/hooks.js.map +1 -0
  259. package/dist/types/index.d.ts +17 -6
  260. package/dist/types/index.js +23 -0
  261. package/dist/types/index.js.map +1 -0
  262. package/dist/types/utils.d.ts +7 -0
  263. package/dist/types/utils.js +17 -0
  264. package/dist/types/utils.js.map +1 -0
  265. package/dist/utils/builder.d.ts +8 -0
  266. package/dist/utils/builder.js +104 -0
  267. package/dist/utils/builder.js.map +1 -0
  268. package/dist/utils/config.d.ts +6 -0
  269. package/dist/utils/config.js +167 -0
  270. package/dist/utils/config.js.map +1 -0
  271. package/dist/utils/context.d.ts +7 -0
  272. package/dist/utils/context.js +60 -0
  273. package/dist/utils/context.js.map +1 -0
  274. package/dist/utils/dts.d.ts +14 -0
  275. package/dist/utils/dts.js +186 -0
  276. package/dist/utils/dts.js.map +1 -0
  277. package/dist/utils/input.d.ts +16 -0
  278. package/dist/utils/input.js +113 -0
  279. package/dist/utils/input.js.map +1 -0
  280. package/dist/utils/language.d.ts +2 -0
  281. package/dist/utils/language.js +68 -0
  282. package/dist/utils/language.js.map +1 -0
  283. package/dist/utils/libuild-plugins.d.ts +6 -0
  284. package/dist/utils/libuild-plugins.js +83 -0
  285. package/dist/utils/libuild-plugins.js.map +1 -0
  286. package/dist/utils/log.d.ts +2 -0
  287. package/dist/utils/log.js +68 -0
  288. package/dist/utils/log.js.map +1 -0
  289. package/dist/utils/onExit.d.ts +1 -0
  290. package/dist/utils/onExit.js +63 -0
  291. package/dist/utils/onExit.js.map +1 -0
  292. package/dist/utils/path.d.ts +1 -0
  293. package/dist/utils/path.js +59 -0
  294. package/dist/utils/path.js.map +1 -0
  295. package/dist/utils/style.d.ts +31 -0
  296. package/dist/utils/style.js +129 -0
  297. package/dist/utils/style.js.map +1 -0
  298. package/dist/{types/utils/tspaths-transform/index.d.ts → utils/tspaths-transform.d.ts} +0 -0
  299. package/dist/utils/tspaths-transform.js +119 -0
  300. package/dist/utils/tspaths-transform.js.map +1 -0
  301. package/package.json +43 -72
  302. package/dist/js/modern/cli/build.js +0 -11
  303. package/dist/js/modern/cli/dev.js +0 -11
  304. package/dist/js/modern/cli/index.js +0 -3
  305. package/dist/js/modern/cli/new.js +0 -13
  306. package/dist/js/modern/commands/build.js +0 -69
  307. package/dist/js/modern/commands/dev.js +0 -43
  308. package/dist/js/modern/commands/index.js +0 -2
  309. package/dist/js/modern/features/build/build-platform.js +0 -69
  310. package/dist/js/modern/features/build/bundle/index.js +0 -9
  311. package/dist/js/modern/features/build/bundle/runRollup.js +0 -136
  312. package/dist/js/modern/features/build/bundle/runSpeedy.js +0 -176
  313. package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -75
  314. package/dist/js/modern/features/build/bundleless/generator-dts/index.js +0 -106
  315. package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +0 -94
  316. package/dist/js/modern/features/build/bundleless/index.js +0 -21
  317. package/dist/js/modern/features/build/bundleless/runBabel.js +0 -242
  318. package/dist/js/modern/features/build/bundleless/style.js +0 -241
  319. package/dist/js/modern/features/build/constants.js +0 -98
  320. package/dist/js/modern/features/build/error.js +0 -127
  321. package/dist/js/modern/features/build/index.js +0 -117
  322. package/dist/js/modern/features/build/legacy-constants.js +0 -103
  323. package/dist/js/modern/features/build/logger/index.js +0 -2
  324. package/dist/js/modern/features/build/logger/logText.js +0 -56
  325. package/dist/js/modern/features/build/logger/loggerManager.js +0 -93
  326. package/dist/js/modern/features/build/normalize.js +0 -277
  327. package/dist/js/modern/features/build/types.js +0 -0
  328. package/dist/js/modern/features/build/utils.js +0 -92
  329. package/dist/js/modern/features/dev/index.js +0 -47
  330. package/dist/js/modern/hooks/build.js +0 -20
  331. package/dist/js/modern/hooks/dev.js +0 -14
  332. package/dist/js/modern/hooks/index.js +0 -15
  333. package/dist/js/modern/index.js +0 -63
  334. package/dist/js/modern/locale/en.js +0 -25
  335. package/dist/js/modern/locale/index.js +0 -10
  336. package/dist/js/modern/locale/zh.js +0 -25
  337. package/dist/js/modern/schema/build-config.js +0 -117
  338. package/dist/js/modern/schema/index.js +0 -4
  339. package/dist/js/modern/schema/output.js +0 -45
  340. package/dist/js/modern/schema/source.js +0 -7
  341. package/dist/js/modern/schema/tools.js +0 -6
  342. package/dist/js/modern/schema/types.js +0 -0
  343. package/dist/js/modern/types.js +0 -0
  344. package/dist/js/modern/utils/babel.js +0 -84
  345. package/dist/js/modern/utils/color.js +0 -2
  346. package/dist/js/modern/utils/constants.js +0 -3
  347. package/dist/js/modern/utils/copy.js +0 -70
  348. package/dist/js/modern/utils/init-env.js +0 -13
  349. package/dist/js/modern/utils/json.js +0 -13
  350. package/dist/js/modern/utils/language.js +0 -6
  351. package/dist/js/modern/utils/logger.js +0 -96
  352. package/dist/js/modern/utils/readline.js +0 -17
  353. package/dist/js/modern/utils/tsconfig.js +0 -13
  354. package/dist/js/modern/utils/tspaths-transform/constants.js +0 -5
  355. package/dist/js/modern/utils/tspaths-transform/index.js +0 -113
  356. package/dist/js/modern/utils/tspaths-transform/utils.js +0 -18
  357. package/dist/js/modern/utils/valide.js +0 -26
  358. package/dist/js/node/cli/build.js +0 -18
  359. package/dist/js/node/cli/dev.js +0 -18
  360. package/dist/js/node/cli/index.js +0 -38
  361. package/dist/js/node/cli/new.js +0 -20
  362. package/dist/js/node/commands/build.js +0 -80
  363. package/dist/js/node/commands/dev.js +0 -52
  364. package/dist/js/node/commands/index.js +0 -19
  365. package/dist/js/node/features/build/build-platform.js +0 -76
  366. package/dist/js/node/features/build/bundle/index.js +0 -17
  367. package/dist/js/node/features/build/bundle/runRollup.js +0 -145
  368. package/dist/js/node/features/build/bundle/runSpeedy.js +0 -186
  369. package/dist/js/node/features/build/bundleless/copy-assets.js +0 -84
  370. package/dist/js/node/features/build/bundleless/generator-dts/index.js +0 -114
  371. package/dist/js/node/features/build/bundleless/generator-dts/utils.js +0 -105
  372. package/dist/js/node/features/build/bundleless/index.js +0 -29
  373. package/dist/js/node/features/build/bundleless/runBabel.js +0 -255
  374. package/dist/js/node/features/build/bundleless/style.js +0 -254
  375. package/dist/js/node/features/build/constants.js +0 -116
  376. package/dist/js/node/features/build/error.js +0 -139
  377. package/dist/js/node/features/build/index.js +0 -128
  378. package/dist/js/node/features/build/legacy-constants.js +0 -111
  379. package/dist/js/node/features/build/logger/index.js +0 -27
  380. package/dist/js/node/features/build/logger/logText.js +0 -66
  381. package/dist/js/node/features/build/logger/loggerManager.js +0 -95
  382. package/dist/js/node/features/build/normalize.js +0 -288
  383. package/dist/js/node/features/build/types.js +0 -0
  384. package/dist/js/node/features/build/utils.js +0 -107
  385. package/dist/js/node/features/dev/index.js +0 -56
  386. package/dist/js/node/hooks/build.js +0 -32
  387. package/dist/js/node/hooks/dev.js +0 -24
  388. package/dist/js/node/hooks/index.js +0 -36
  389. package/dist/js/node/index.js +0 -83
  390. package/dist/js/node/locale/en.js +0 -32
  391. package/dist/js/node/locale/index.js +0 -17
  392. package/dist/js/node/locale/zh.js +0 -32
  393. package/dist/js/node/schema/build-config.js +0 -126
  394. package/dist/js/node/schema/index.js +0 -11
  395. package/dist/js/node/schema/output.js +0 -52
  396. package/dist/js/node/schema/source.js +0 -14
  397. package/dist/js/node/schema/tools.js +0 -13
  398. package/dist/js/node/schema/types.js +0 -0
  399. package/dist/js/node/types.js +0 -0
  400. package/dist/js/node/utils/babel.js +0 -93
  401. package/dist/js/node/utils/color.js +0 -9
  402. package/dist/js/node/utils/constants.js +0 -11
  403. package/dist/js/node/utils/copy.js +0 -79
  404. package/dist/js/node/utils/init-env.js +0 -20
  405. package/dist/js/node/utils/json.js +0 -20
  406. package/dist/js/node/utils/language.js +0 -12
  407. package/dist/js/node/utils/logger.js +0 -107
  408. package/dist/js/node/utils/readline.js +0 -25
  409. package/dist/js/node/utils/tsconfig.js +0 -21
  410. package/dist/js/node/utils/tspaths-transform/constants.js +0 -12
  411. package/dist/js/node/utils/tspaths-transform/index.js +0 -123
  412. package/dist/js/node/utils/tspaths-transform/utils.js +0 -25
  413. package/dist/js/node/utils/valide.js +0 -34
  414. package/dist/types/cli/build.d.ts +0 -3
  415. package/dist/types/cli/dev.d.ts +0 -3
  416. package/dist/types/cli/index.d.ts +0 -3
  417. package/dist/types/cli/new.d.ts +0 -2
  418. package/dist/types/commands/build.d.ts +0 -17
  419. package/dist/types/commands/dev.d.ts +0 -5
  420. package/dist/types/commands/index.d.ts +0 -2
  421. package/dist/types/features/build/build-platform.d.ts +0 -7
  422. package/dist/types/features/build/bundle/index.d.ts +0 -3
  423. package/dist/types/features/build/bundle/runRollup.d.ts +0 -3
  424. package/dist/types/features/build/bundle/runSpeedy.d.ts +0 -10
  425. package/dist/types/features/build/bundleless/copy-assets.d.ts +0 -3
  426. package/dist/types/features/build/bundleless/generator-dts/index.d.ts +0 -3
  427. package/dist/types/features/build/bundleless/generator-dts/utils.d.ts +0 -21
  428. package/dist/types/features/build/bundleless/index.d.ts +0 -4
  429. package/dist/types/features/build/bundleless/runBabel.d.ts +0 -32
  430. package/dist/types/features/build/bundleless/style.d.ts +0 -25
  431. package/dist/types/features/build/constants.d.ts +0 -18
  432. package/dist/types/features/build/index.d.ts +0 -12
  433. package/dist/types/features/build/legacy-constants.d.ts +0 -8
  434. package/dist/types/features/build/logger/index.d.ts +0 -2
  435. package/dist/types/features/build/logger/logText.d.ts +0 -39
  436. package/dist/types/features/build/logger/loggerManager.d.ts +0 -40
  437. package/dist/types/features/build/normalize.d.ts +0 -19
  438. package/dist/types/features/build/types.d.ts +0 -15
  439. package/dist/types/features/build/utils.d.ts +0 -36
  440. package/dist/types/features/dev/index.d.ts +0 -9
  441. package/dist/types/hooks/build.d.ts +0 -46
  442. package/dist/types/hooks/dev.d.ts +0 -20
  443. package/dist/types/hooks/index.d.ts +0 -30
  444. package/dist/types/schema/build-config.d.ts +0 -205
  445. package/dist/types/schema/index.d.ts +0 -217
  446. package/dist/types/schema/output.d.ts +0 -215
  447. package/dist/types/schema/source.d.ts +0 -6
  448. package/dist/types/schema/tools.d.ts +0 -6
  449. package/dist/types/schema/types.d.ts +0 -45
  450. package/dist/types/types.d.ts +0 -51
  451. package/dist/types/utils/babel.d.ts +0 -8
  452. package/dist/types/utils/color.d.ts +0 -2
  453. package/dist/types/utils/constants.d.ts +0 -2
  454. package/dist/types/utils/copy.d.ts +0 -5
  455. package/dist/types/utils/init-env.d.ts +0 -21
  456. package/dist/types/utils/json.d.ts +0 -4
  457. package/dist/types/utils/language.d.ts +0 -1
  458. package/dist/types/utils/logger.d.ts +0 -58
  459. package/dist/types/utils/readline.d.ts +0 -9
  460. package/dist/types/utils/tspaths-transform/constants.d.ts +0 -1
  461. package/dist/types/utils/tspaths-transform/utils.d.ts +0 -4
  462. package/dist/types/utils/valide.d.ts +0 -12
  463. package/types.d.ts +0 -1
@@ -0,0 +1,173 @@
1
+ import {List, ValueObject} from 'immutable';
2
+
3
+ import {SassBoolean} from './boolean';
4
+ import {SassColor} from './color';
5
+ import {SassFunction} from './function';
6
+ import {ListSeparator} from './list';
7
+ import {SassMap} from './map';
8
+ import {SassNumber} from './number';
9
+ import {SassString} from './string';
10
+
11
+ export {SassArgumentList} from './argument_list';
12
+ export {SassBoolean, sassTrue, sassFalse} from './boolean';
13
+ export {SassColor} from './color';
14
+ export {SassFunction} from './function';
15
+ export {SassList, ListSeparator} from './list';
16
+ export {SassMap} from './map';
17
+ export {SassNumber} from './number';
18
+ export {SassString} from './string';
19
+
20
+ /**
21
+ * Sass's [`null` value](https://sass-lang.com/documentation/values/null).
22
+ *
23
+ * @category Custom Function
24
+ */
25
+ export const sassNull: Value;
26
+
27
+ /**
28
+ * The abstract base class of Sass's value types.
29
+ *
30
+ * This is passed to and returned by [[CustomFunction]]s, which are passed into
31
+ * the Sass implementation using [[Options.functions]].
32
+ *
33
+ * @category Custom Function
34
+ */
35
+ export abstract class Value implements ValueObject {
36
+ protected constructor();
37
+
38
+ /**
39
+ * This value as a list.
40
+ *
41
+ * All SassScript values can be used as lists. Maps count as lists of pairs,
42
+ * and all other values count as single-value lists.
43
+ *
44
+ * @returns An immutable [[List]] from the [`immutable`
45
+ * package](https://immutable-js.com/).
46
+ */
47
+ get asList(): List<Value>;
48
+
49
+ /**
50
+ * Whether this value as a list has brackets.
51
+ *
52
+ * All SassScript values can be used as lists. Maps count as lists of pairs,
53
+ * and all other values count as single-value lists.
54
+ */
55
+ get hasBrackets(): boolean;
56
+
57
+ /**
58
+ * Whether the value counts as `true` in an `@if` statement and other
59
+ * contexts.
60
+ */
61
+ get isTruthy(): boolean;
62
+
63
+ /**
64
+ * Returns JavaScript's `null` value if this is [[sassNull]], and returns
65
+ * `this` otherwise.
66
+ */
67
+ get realNull(): null | Value;
68
+
69
+ /**
70
+ * The separator for this value as a list.
71
+ *
72
+ * All SassScript values can be used as lists. Maps count as lists of pairs,
73
+ * and all other values count as single-value lists.
74
+ */
75
+ get separator(): ListSeparator;
76
+
77
+ /**
78
+ * Converts `sassIndex` into a JavaScript-style index into the list returned
79
+ * by [[asList]].
80
+ *
81
+ * Sass indexes are one-based, while JavaScript indexes are zero-based. Sass
82
+ * indexes may also be negative in order to index from the end of the list.
83
+ *
84
+ * @param sassIndex - The Sass-style index into this as a list.
85
+ * @param name - The name of the function argument `sassIndex` came from
86
+ * (without the `$`) if it came from an argument. Used for error reporting.
87
+ * @throws `Error` If `sassIndex` isn't a number, if that number isn't an
88
+ * integer, or if that integer isn't a valid index for [[asList]].
89
+ */
90
+ sassIndexToListIndex(sassIndex: Value, name?: string): number;
91
+
92
+ /**
93
+ * Returns the value at index `index` in this value as a list, or `undefined`
94
+ * if `index` isn't valid for this list.
95
+ *
96
+ * All SassScript values can be used as lists. Maps count as lists of pairs,
97
+ * and all other values count as single-value lists.
98
+ *
99
+ * This is a shorthand for `this.asList.get(index)`, although it may be more
100
+ * efficient in some cases.
101
+ *
102
+ * **Heads up!** This method uses the same indexing conventions as the
103
+ * `immutable` package: unlike Sass the index of the first element is 0, but
104
+ * like Sass negative numbers index from the end of the list.
105
+ */
106
+ get(index: number): Value | undefined;
107
+
108
+ /**
109
+ * Throws if `this` isn't a [[SassBoolean]].
110
+ *
111
+ * **Heads up!** Functions should generally use [[isTruthy]] rather than
112
+ * requiring a literal boolean.
113
+ *
114
+ * @param name - The name of the function argument `this` came from (without
115
+ * the `$`) if it came from an argument. Used for error reporting.
116
+ */
117
+ assertBoolean(name?: string): SassBoolean;
118
+
119
+ /**
120
+ * Throws if `this` isn't a [[SassColor]].
121
+ *
122
+ * @param name - The name of the function argument `this` came from (without
123
+ * the `$`) if it came from an argument. Used for error reporting.
124
+ */
125
+ assertColor(name?: string): SassColor;
126
+
127
+ /**
128
+ * Throws if `this` isn't a [[SassFunction]].
129
+ *
130
+ * @param name - The name of the function argument `this` came from (without
131
+ * the `$`) if it came from an argument. Used for error reporting.
132
+ */
133
+ assertFunction(name?: string): SassFunction;
134
+
135
+ /**
136
+ * Throws if `this` isn't a [[SassMap]].
137
+ *
138
+ * @param name - The name of the function argument `this` came from (without
139
+ * the `$`) if it came from an argument. Used for error reporting.
140
+ */
141
+ assertMap(name?: string): SassMap;
142
+
143
+ /**
144
+ * Throws if `this` isn't a [[SassNumber]].
145
+ *
146
+ * @param name - The name of the function argument `this` came from (without
147
+ * the `$`) if it came from an argument. Used for error reporting.
148
+ */
149
+ assertNumber(name?: string): SassNumber;
150
+
151
+ /**
152
+ * Throws if `this` isn't a [[SassString]].
153
+ *
154
+ * @param name - The name of the function argument `this` came from (without
155
+ * the `$`) if it came from an argument. Used for error reporting.
156
+ */
157
+ assertString(name?: string): SassString;
158
+
159
+ /**
160
+ * Returns `this` as a map if it counts as one (empty lists count as empty
161
+ * maps) or `null` if it doesn't.
162
+ */
163
+ tryMap(): SassMap | null;
164
+
165
+ /** Returns whether `this` represents the same value as `other`. */
166
+ equals(other: Value): boolean;
167
+
168
+ /** Returns a hash code that can be used to store `this` in a hash map. */
169
+ hashCode(): number;
170
+
171
+ /** @hidden */
172
+ toString(): string;
173
+ }
@@ -0,0 +1,54 @@
1
+ import {List} from 'immutable';
2
+
3
+ import {Value} from './index';
4
+
5
+ /**
6
+ * Possible separators used by Sass lists. The special separator `null` is only
7
+ * used for lists with fewer than two elements, and indicates that the separator
8
+ * has not yet been decided for this list.
9
+ *
10
+ * @category Custom Function
11
+ */
12
+ export type ListSeparator = ',' | '/' | ' ' | null;
13
+
14
+ /**
15
+ * Sass's [list type](https://sass-lang.com/documentation/values/lists).
16
+ *
17
+ * @category Custom Function
18
+ */
19
+ export class SassList extends Value {
20
+ /**
21
+ * Creates a new list.
22
+ *
23
+ * @param contents - The contents of the list. This may be either a plain
24
+ * JavaScript array or an immutable [[List]] from the [`immutable`
25
+ * package](https://immutable-js.com/).
26
+ *
27
+ * @param options.separator - The separator to use between elements of this
28
+ * list. Defaults to `','`.
29
+ *
30
+ * @param options.brackets - Whether the list has square brackets. Defaults to
31
+ * `false`.
32
+ */
33
+ constructor(
34
+ contents: Value[] | List<Value>,
35
+ options?: {
36
+ separator?: ListSeparator;
37
+ brackets?: boolean;
38
+ }
39
+ );
40
+
41
+ /**
42
+ * Creates an empty list.
43
+ *
44
+ * @param options.separator - The separator to use between elements of this
45
+ * list. Defaults to `','`.
46
+ *
47
+ * @param options.brackets - Whether the list has square brackets. Defaults to
48
+ * `false`.
49
+ */
50
+ constructor(options?: {separator?: ListSeparator; brackets?: boolean});
51
+
52
+ /** @hidden */
53
+ get separator(): ListSeparator;
54
+ }
@@ -0,0 +1,41 @@
1
+ import {OrderedMap} from 'immutable';
2
+
3
+ import {SassList} from './list';
4
+ import {Value} from './index';
5
+
6
+ /**
7
+ * Sass's [map type](https://sass-lang.com/documentation/values/maps).
8
+ *
9
+ * @category Custom Function
10
+ */
11
+ export class SassMap extends Value {
12
+ /**
13
+ * Creates a new map.
14
+ *
15
+ * @param contents - The contents of the map. This is an immutable
16
+ * [[OrderedMap]] from the [`immutable` package](https://immutable-js.com/).
17
+ * Defaults to an empty map.
18
+ */
19
+ constructor(contents?: OrderedMap<Value, Value>);
20
+
21
+ /**
22
+ * Returns the contents of this map as an immutable [[OrderedMap]] from the
23
+ * [`immutable` package](https://immutable-js.com/).
24
+ */
25
+ get contents(): OrderedMap<Value, Value>;
26
+
27
+ /**
28
+ * Returns the value associated with `key` in this map, or `undefined` if
29
+ * `key` isn't in the map.
30
+ *
31
+ * This is a shorthand for `this.contents.get(key)`, although it may be more
32
+ * efficient in some cases.
33
+ */
34
+ get(key: Value): Value | undefined;
35
+
36
+ /** Inherited from [[Value.get]]. */
37
+ get(index: number): SassList | undefined;
38
+
39
+ /** @hidden */
40
+ tryMap(): SassMap;
41
+ }
@@ -0,0 +1,305 @@
1
+ import {List} from 'immutable';
2
+
3
+ import {Value} from './index';
4
+
5
+ /**
6
+ * Sass's [number type](https://sass-lang.com/documentation/values/numbers).
7
+ *
8
+ * @category Custom Function
9
+ */
10
+ export class SassNumber extends Value {
11
+ /**
12
+ * Creates a new number with more complex units than just a single numerator.
13
+ *
14
+ * Upon construction, any compatible numerator and denominator units are
15
+ * simplified away according to the conversion factor between them.
16
+ *
17
+ * @param value - The number's numeric value.
18
+ *
19
+ * @param unit - If this is a string, it's used as the single numerator unit
20
+ * for the number.
21
+ *
22
+ * @param unit.numeratorUnits - If passed, these are the numerator units to
23
+ * use for the number. This may be either a plain JavaScript array or an
24
+ * immutable [[List]] from the [`immutable`
25
+ * package](https://immutable-js.com/).
26
+ *
27
+ * @param unit.denominatorUnits - If passed, these are the denominator units
28
+ * to use for the number. This may be either a plain JavaScript array or an
29
+ * immutable [[List]] from the [`immutable`
30
+ * package](https://immutable-js.com/).
31
+ */
32
+ constructor(
33
+ value: number,
34
+ unit?:
35
+ | string
36
+ | {
37
+ numeratorUnits?: string[] | List<string>;
38
+ denominatorUnits?: string[] | List<string>;
39
+ }
40
+ );
41
+
42
+ /** This number's numeric value. */
43
+ get value(): number;
44
+
45
+ /** Whether [[value]] is an integer according to Sass's equality logic. */
46
+ get isInt(): boolean;
47
+
48
+ /**
49
+ * If [[value]] is an integer according to [[isInt]], returns [[value]]
50
+ * rounded to that integer. If it's not an integer, returns `null`.
51
+ */
52
+ get asInt(): number | null;
53
+
54
+ /**
55
+ * This number's numerator units as an immutable [[List]] from the
56
+ * [`immutable` package](https://immutable-js.com/).
57
+ */
58
+ get numeratorUnits(): List<string>;
59
+
60
+ /**
61
+ * This number's denominator units as an immutable [[List]] from the
62
+ * [`immutable` package](https://immutable-js.com/).
63
+ */
64
+ get denominatorUnits(): List<string>;
65
+
66
+ /** Whether this number has any numerator or denominator units. */
67
+ get hasUnits(): boolean;
68
+
69
+ /**
70
+ * If [[value]] is an integer according to [[isInt]], returns it rounded to
71
+ * that integer. Otherwise, throws an error.
72
+ *
73
+ * @param name - The name of the function argument `this` came from (without
74
+ * the `$`) if it came from an argument. Used for error reporting.
75
+ */
76
+ assertInt(name?: string): number;
77
+
78
+ /**
79
+ * Returns [[value]] if it's within `min` and `max`. If [[value]] is equal to
80
+ * `min` or `max` according to Sass's equality, returns `min` or `max`
81
+ * respectively. Otherwise, throws an error.
82
+ *
83
+ * @param name - The name of the function argument `this` came from (without
84
+ * the `$`) if it came from an argument. Used for error reporting.
85
+ */
86
+ assertInRange(min: number, max: number, name?: string): number;
87
+
88
+ /**
89
+ * If this number has no units, returns it. Otherwise, throws an error.
90
+ *
91
+ * @param name - The name of the function argument `this` came from (without
92
+ * the `$`) if it came from an argument. Used for error reporting.
93
+ */
94
+ assertNoUnits(name?: string): SassNumber;
95
+
96
+ /**
97
+ * If this number has `unit` as its only unit (and as a numerator), returns
98
+ * this number. Otherwise, throws an error.
99
+ *
100
+ * @param name - The name of the function argument `this` came from (without
101
+ * the `$`) if it came from an argument. Used for error reporting.
102
+ */
103
+ assertUnit(unit: string, name?: string): SassNumber;
104
+
105
+ /** Whether this number has `unit` as its only unit (and as a numerator). */
106
+ hasUnit(unit: string): boolean;
107
+
108
+ /**
109
+ * Whether this has exactly one numerator unit, and that unit is compatible
110
+ * with `unit`.
111
+ */
112
+ compatibleWithUnit(unit: string): boolean;
113
+
114
+ /**
115
+ * Returns a copy of this number, converted to the units represented by
116
+ * `newNumerators` and `newDenominators`.
117
+ *
118
+ * @throws `Error` if this number's units are incompatible with
119
+ * `newNumerators` and `newDenominators`; or if this number is unitless and
120
+ * either `newNumerators` or `newDenominators` are not empty, or vice-versa.
121
+ *
122
+ * @param newNumerators - The numerator units to convert this number to. This
123
+ * may be either a plain JavaScript array or an immutable [[List]] from the
124
+ * [`immutable` package](https://immutable-js.com/).
125
+ *
126
+ * @param newDenominators - The denominator units to convert this number to.
127
+ * This may be either a plain JavaScript array or an immutable [[List]] from
128
+ * the [`immutable` package](https://immutable-js.com/).
129
+ *
130
+ * @param name - The name of the function argument `this` came from (without
131
+ * the `$`) if it came from an argument. Used for error reporting.
132
+ */
133
+ convert(
134
+ newNumerators: string[] | List<string>,
135
+ newDenominators: string[] | List<string>,
136
+ name?: string
137
+ ): SassNumber;
138
+
139
+ /**
140
+ * Returns a copy of this number, converted to the same units as `other`.
141
+ *
142
+ * @throws `Error` if this number's units are incompatible with `other`'s
143
+ * units, or if either number is unitless but the other is not.
144
+ *
145
+ * @param name - The name of the function argument `this` came from (without
146
+ * the `$`) if it came from an argument. Used for error reporting.
147
+ *
148
+ * @param otherName - The name of the function argument `other` came from
149
+ * (without the `$`) if it came from an argument. Used for error reporting.
150
+ */
151
+ convertToMatch(
152
+ other: SassNumber,
153
+ name?: string,
154
+ otherName?: string
155
+ ): SassNumber;
156
+
157
+ /**
158
+ * Returns [[value]], converted to the units represented by `newNumerators`
159
+ * and `newDenominators`.
160
+ *
161
+ * @throws `Error` if this number's units are incompatible with
162
+ * `newNumerators` and `newDenominators`; or if this number is unitless and
163
+ * either `newNumerators` or `newDenominators` are not empty, or vice-versa.
164
+ *
165
+ * @param newNumerators - The numerator units to convert [[value]] to. This
166
+ * may be either a plain JavaScript array or an immutable [[List]] from the
167
+ * [`immutable` package](https://immutable-js.com/).
168
+ *
169
+ * @param newDenominators - The denominator units to convert [[value]] to.
170
+ * This may be either a plain JavaScript array or an immutable [[List]] from
171
+ * the [`immutable` package](https://immutable-js.com/).
172
+ *
173
+ * @param name - The name of the function argument `this` came from (without
174
+ * the `$`) if it came from an argument. Used for error reporting.
175
+ */
176
+ convertValue(
177
+ newNumerators: string[] | List<string>,
178
+ newDenominators: string[] | List<string>,
179
+ name?: string
180
+ ): number;
181
+
182
+ /**
183
+ * Returns [[value]], converted to the same units as `other`.
184
+ *
185
+ * @throws `Error` if this number's units are incompatible with `other`'s
186
+ * units, or if either number is unitless but the other is not.
187
+ *
188
+ * @param name - The name of the function argument `this` came from (without
189
+ * the `$`) if it came from an argument. Used for error reporting.
190
+ *
191
+ * @param otherName - The name of the function argument `other` came from
192
+ * (without the `$`) if it came from an argument. Used for error reporting.
193
+ */
194
+ convertValueToMatch(
195
+ other: SassNumber,
196
+ name?: string,
197
+ otherName?: string
198
+ ): number;
199
+
200
+ /**
201
+ * Returns a copy of this number, converted to the units represented by
202
+ * `newNumerators` and `newDenominators`.
203
+ *
204
+ * Unlike [[convert]] this does *not* throw an error if this number is
205
+ * unitless and either `newNumerators` or `newDenominators` are not empty, or
206
+ * vice-versa. Instead, it treats all unitless numbers as convertible to and
207
+ * from all units without changing the value.
208
+ *
209
+ * @throws `Error` if this number's units are incompatible with
210
+ * `newNumerators` and `newDenominators`.
211
+ *
212
+ * @param newNumerators - The numerator units to convert this number to. This
213
+ * may be either a plain JavaScript array or an immutable [[List]] from the
214
+ * [`immutable` package](https://immutable-js.com/).
215
+ *
216
+ * @param newDenominators - The denominator units to convert this number to.
217
+ * This may be either a plain JavaScript array or an immutable [[List]] from
218
+ * the [`immutable` package](https://immutable-js.com/).
219
+ *
220
+ * @param name - The name of the function argument `this` came from (without
221
+ * the `$`) if it came from an argument. Used for error reporting.
222
+ */
223
+ coerce(
224
+ newNumerators: string[] | List<string>,
225
+ newDenominators: string[] | List<string>,
226
+ name?: string
227
+ ): SassNumber;
228
+
229
+ /**
230
+ * Returns a copy of this number, converted to the units represented by
231
+ * `newNumerators` and `newDenominators`.
232
+ *
233
+ * Unlike [[convertToMatch]] this does *not* throw an error if this number is
234
+ * unitless and either `newNumerators` or `newDenominators` are not empty, or
235
+ * vice-versa. Instead, it treats all unitless numbers as convertible to and
236
+ * from all units without changing the value.
237
+ *
238
+ * @throws `Error` if this number's units are incompatible with `other`'s
239
+ * units.
240
+ *
241
+ * @param name - The name of the function argument `this` came from (without
242
+ * the `$`) if it came from an argument. Used for error reporting.
243
+ *
244
+ * @param otherName - The name of the function argument `other` came from
245
+ * (without the `$`) if it came from an argument. Used for error reporting.
246
+ */
247
+ coerceToMatch(
248
+ other: SassNumber,
249
+ name?: string,
250
+ otherName?: string
251
+ ): SassNumber;
252
+
253
+ /**
254
+ * Returns [[value]], converted to the units represented by `newNumerators` and
255
+ * `newDenominators`.
256
+ *
257
+ * Unlike [[convertValue]] this does *not* throw an error if this number is
258
+ * unitless and either `newNumerators` or `newDenominators` are not empty, or
259
+ * vice-versa. Instead, it treats all unitless numbers as convertible to and
260
+ * from all units without changing the value.
261
+ *
262
+ * @throws `Error` if this number's units are incompatible with
263
+ * `newNumerators` and `newDenominators`.
264
+ *
265
+ * @param newNumerators - The numerator units to convert [[value]] to. This
266
+ * may be either a plain JavaScript array or an immutable [[List]] from the
267
+ * [`immutable` package](https://immutable-js.com/).
268
+ *
269
+ * @param newDenominators - The denominator units to convert [[value]] to.
270
+ * This may be either a plain JavaScript array or an immutable [[List]] from
271
+ * the [`immutable` package](https://immutable-js.com/).
272
+ *
273
+ * @param name - The name of the function argument `this` came from (without
274
+ * the `$`) if it came from an argument. Used for error reporting.
275
+ */
276
+ coerceValue(
277
+ newNumerators: string[] | List<string>,
278
+ newDenominators: string[] | List<string>,
279
+ name?: string
280
+ ): number;
281
+
282
+ /**
283
+ * Returns [[value]], converted to the units represented by `newNumerators`
284
+ * and `newDenominators`.
285
+ *
286
+ * Unlike [[convertValueToMatch]] this does *not* throw an error if this
287
+ * number is unitless and either `newNumerators` or `newDenominators` are not
288
+ * empty, or vice-versa. Instead, it treats all unitless numbers as
289
+ * convertible to and from all units without changing the value.
290
+ *
291
+ * @throws `Error` if this number's units are incompatible with `other`'s
292
+ * units.
293
+ *
294
+ * @param name - The name of the function argument `this` came from (without
295
+ * the `$`) if it came from an argument. Used for error reporting.
296
+ *
297
+ * @param otherName - The name of the function argument `other` came from
298
+ * (without the `$`) if it came from an argument. Used for error reporting.
299
+ */
300
+ coerceValueToMatch(
301
+ other: SassNumber,
302
+ name?: string,
303
+ otherName?: string
304
+ ): number;
305
+ }
@@ -0,0 +1,84 @@
1
+ import {Value} from './index';
2
+
3
+ /**
4
+ * Sass's [string type](https://sass-lang.com/documentation/values/strings).
5
+ *
6
+ * @category Custom Function
7
+ */
8
+ export class SassString extends Value {
9
+ /**
10
+ * Creates a new string.
11
+ *
12
+ * @param text - The contents of the string. For quoted strings, this is the
13
+ * semantic content—any escape sequences that were been written in the source
14
+ * text are resolved to their Unicode values. For unquoted strings, though,
15
+ * escape sequences are preserved as literal backslashes.
16
+ *
17
+ * @param options.quotes - Whether the string is quoted. Defaults to `true`.
18
+ */
19
+ constructor(
20
+ text: string,
21
+ options?: {
22
+ quotes?: boolean;
23
+ }
24
+ );
25
+
26
+ /**
27
+ * Creates an empty string.
28
+ *
29
+ * @param options.quotes - Whether the string is quoted. Defaults to `true`.
30
+ */
31
+ constructor(options?: {quotes?: boolean});
32
+
33
+ /**
34
+ * The contents of the string.
35
+ *
36
+ * For quoted strings, this is the semantic content—any escape sequences that
37
+ * were been written in the source text are resolved to their Unicode values.
38
+ * For unquoted strings, though, escape sequences are preserved as literal
39
+ * backslashes.
40
+ *
41
+ * This difference allows us to distinguish between identifiers with escapes,
42
+ * such as `url\u28 http://example.com\u29`, and unquoted strings that contain
43
+ * characters that aren't valid in identifiers, such as
44
+ * `url(http://example.com)`. Unfortunately, it also means that we don't
45
+ * consider `foo` and `f\6F\6F` the same string.
46
+ */
47
+ get text(): string;
48
+
49
+ /** Whether this string has quotes. */
50
+ get hasQuotes(): boolean;
51
+
52
+ /**
53
+ * Sass's notion of this string's length.
54
+ *
55
+ * Sass treats strings as a series of Unicode code points while JavaScript
56
+ * treats them as a series of UTF-16 code units. For example, the character
57
+ * U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
58
+ * is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
59
+ * JavaScript, `"n😊b".length` returns `4`, whereas in Sass
60
+ * `string.length("n😊b")` returns `3`.
61
+ */
62
+ get sassLength(): number;
63
+
64
+ /**
65
+ * Converts `sassIndex` to a JavaScript index into [[text]].
66
+ *
67
+ * Sass indices are one-based, while JavaScript indices are zero-based. Sass
68
+ * indices may also be negative in order to index from the end of the string.
69
+ *
70
+ * In addition, Sass indices refer to Unicode code points while JavaScript
71
+ * string indices refer to UTF-16 code units. For example, the character
72
+ * U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
73
+ * is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
74
+ * JavaScript, `"n😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
75
+ * `string.slice("n😊b", 1, 1)` returns `"😊"`.
76
+ *
77
+ * This function converts Sass's code point indices to JavaScript's code unit
78
+ * indices. This means it's O(n) in the length of `text`.
79
+ *
80
+ * @throws `Error` - If `sassIndex` isn't a number, if that number isn't an
81
+ * integer, or if that integer isn't a valid index for this string.
82
+ */
83
+ sassIndexToStringIndex(sassIndex: Value, name?: string): number;
84
+ }
@@ -0,0 +1,24 @@
1
+ // Type definitions for signal-exit 3.0
2
+ // Project: https://github.com/tapjs/signal-exit
3
+ // Definitions by: BendingBender <https://github.com/BendingBender>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ // TypeScript Version: 2.1
6
+
7
+ export = signalExit;
8
+
9
+ declare function signalExit(
10
+ callback: (code: number | null, signal: signalExit.Signal | null) => void,
11
+ options?: signalExit.Options
12
+ ): () => void;
13
+
14
+ declare namespace signalExit {
15
+ function load(): void;
16
+ function unload(): void;
17
+ function signals(): Signal[];
18
+
19
+ type Signal = 'SIGABRT' | 'SIGALRM' | 'SIGHUP' | 'SIGINT' | 'SIGTERM' | string;
20
+
21
+ interface Options {
22
+ alwaysLast?: boolean | undefined;
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ (()=>{var e={580:(e,t,r)=>{var i=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(i)){e.exports=function(){return function(){}}}else{var n=r(491);var o=r(357);var a=/^win/i.test(i.platform);var f=r(361);if(typeof f!=="function"){f=f.EventEmitter}var l;if(i.__signal_exit_emitter__){l=i.__signal_exit_emitter__}else{l=i.__signal_exit_emitter__=new f;l.count=0;l.emitted={}}if(!l.infinite){l.setMaxListeners(Infinity);l.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}n.equal(typeof e,"function","a callback must be provided for exit handler");if(p===false){_()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){l.removeListener(r,e);if(l.listeners("exit").length===0&&l.listeners("afterexit").length===0){s()}};l.on(r,e);return remove};var s=function unload(){if(!p||!processOk(global.process)){return}p=false;o.forEach((function(e){try{i.removeListener(e,c[e])}catch(e){}}));i.emit=d;i.reallyExit=x;l.count-=1};e.exports.unload=s;var u=function emit(e,t,r){if(l.emitted[e]){return}l.emitted[e]=true;l.emit(e,t,r)};var c={};o.forEach((function(e){c[e]=function listener(){if(!processOk(global.process)){return}var t=i.listeners(e);if(t.length===l.count){s();u("exit",null,e);u("afterexit",null,e);if(a&&e==="SIGHUP"){e="SIGINT"}i.kill(i.pid,e)}}}));e.exports.signals=function(){return o};var p=false;var _=function load(){if(p||!processOk(global.process)){return}p=true;l.count+=1;o=o.filter((function(e){try{i.on(e,c[e]);return true}catch(e){return false}}));i.emit=I;i.reallyExit=v};e.exports.load=_;var x=i.reallyExit;var v=function processReallyExit(e){if(!processOk(global.process)){return}i.exitCode=e||0;u("exit",i.exitCode,null);u("afterexit",i.exitCode,null);x.call(i,i.exitCode)};var d=i.emit;var I=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){i.exitCode=t}var r=d.apply(this,arguments);u("exit",i.exitCode,null);u("afterexit",i.exitCode,null);return r}else{return d.apply(this,arguments)}}}},357:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},491:e=>{"use strict";e.exports=require("assert")},361:e=>{"use strict";e.exports=require("events")}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={exports:{}};var o=true;try{e[r](n,n.exports,__nccwpck_require__);o=false}finally{if(o)delete t[r]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r=__nccwpck_require__(580);module.exports=r})();
@@ -0,0 +1 @@
1
+ {"name":"signal-exit","author":"Ben Coe <ben@npmjs.com>","version":"3.0.7","license":"ISC"}