@rindo/core 1.8.12 → 1.17.4

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 (545) hide show
  1. package/bin/rindo +53 -19
  2. package/cli/index.cjs.js +524 -0
  3. package/cli/index.d.ts +15 -0
  4. package/cli/index.js +500 -0
  5. package/cli/package.json +9 -0
  6. package/compiler/package.json +8 -6
  7. package/compiler/rindo.d.ts +111 -0
  8. package/compiler/rindo.js +62852 -6655
  9. package/compiler/rindo.min.js +17 -0
  10. package/dependencies.json +80 -0
  11. package/dev-server/client/app-error.d.ts +18 -0
  12. package/dev-server/client/events.d.ts +6 -0
  13. package/dev-server/client/hmr-components.d.ts +1 -0
  14. package/dev-server/client/hmr-external-styles.d.ts +1 -0
  15. package/dev-server/client/hmr-images.d.ts +1 -0
  16. package/dev-server/client/hmr-inline-styles.d.ts +1 -0
  17. package/dev-server/client/hmr-util.d.ts +9 -0
  18. package/dev-server/client/hmr-window.d.ts +10 -0
  19. package/dev-server/client/index.d.ts +6 -0
  20. package/dev-server/client/index.js +785 -0
  21. package/dev-server/client/logger.d.ts +5 -0
  22. package/dev-server/client/package.json +8 -0
  23. package/dev-server/client/progress.d.ts +3 -0
  24. package/dev-server/client/status.d.ts +4 -0
  25. package/dev-server/connector.html +6 -0
  26. package/dev-server/content-type-db.json +1 -0
  27. package/dev-server/index.d.ts +6 -0
  28. package/dev-server/index.js +260 -0
  29. package/dev-server/open-in-editor-api.js +1 -0
  30. package/dev-server/package.json +8 -0
  31. package/dev-server/server-worker.js +1570 -0
  32. package/{dist/dev-server → dev-server}/static/favicon.ico +0 -0
  33. package/{dist/dev-server → dev-server}/templates/directory-index.html +132 -132
  34. package/dev-server/templates/initial-load.html +160 -0
  35. package/{dist/sys/node → dev-server}/visualstudio.vbs +0 -0
  36. package/dev-server/ws.js +1 -0
  37. package/{dist/sys/node → dev-server}/xdg-open +0 -0
  38. package/internal/app-data/index.cjs.js +88 -0
  39. package/internal/app-data/index.d.ts +3 -0
  40. package/internal/{client/build-conditionals.mjs → app-data/index.js} +24 -21
  41. package/internal/app-data/package.json +9 -0
  42. package/internal/client/css-shim.js +4 -0
  43. package/internal/client/{dom.rindo-client.mjs → dom.js} +73 -137
  44. package/{dist/client/index.mjs → internal/client/index.js} +736 -736
  45. package/internal/client/package.json +7 -0
  46. package/internal/client/patch.js +136 -0
  47. package/internal/client/polyfills/core-js.js +11 -10
  48. package/internal/client/polyfills/css-shim.js +1 -656
  49. package/internal/client/polyfills/dom.js +79 -146
  50. package/internal/client/polyfills/es5-html-element.js +1 -18
  51. package/internal/client/polyfills/index.js +6 -7
  52. package/internal/client/{shadow-css.rindo-client.mjs → shadow-css.js} +14 -17
  53. package/internal/hydrate/index.js +1073 -0
  54. package/internal/hydrate/package.json +7 -0
  55. package/internal/hydrate/runner.d.ts +205 -0
  56. package/internal/hydrate/runner.js +748 -0
  57. package/internal/hydrate/shadow-css.js +146 -0
  58. package/internal/index.d.ts +4 -18
  59. package/internal/index.js +1 -1
  60. package/internal/package.json +8 -6
  61. package/internal/rindo-core/index.d.ts +2 -0
  62. package/{dist → internal/rindo-core}/index.js +0 -0
  63. package/internal/rindo-ext-modules.d.ts +39 -0
  64. package/internal/rindo-private.d.ts +2183 -0
  65. package/internal/rindo-public-compiler.d.ts +2094 -0
  66. package/{dist/declarations/docs.d.ts → internal/rindo-public-docs.d.ts} +13 -1
  67. package/internal/rindo-public-runtime.d.ts +1552 -0
  68. package/internal/testing/index.js +1032 -0
  69. package/internal/testing/package.json +7 -0
  70. package/internal/testing/shadow-css.js +146 -0
  71. package/mock-doc/index.cjs.js +4500 -0
  72. package/mock-doc/index.d.ts +905 -0
  73. package/mock-doc/index.js +4464 -2
  74. package/mock-doc/package.json +9 -10
  75. package/package.json +84 -137
  76. package/readme.md +3 -82
  77. package/screenshot/compare/build/app.css +1 -1
  78. package/screenshot/compare/build/app.esm.js +1 -1
  79. package/screenshot/compare/build/app.js +27 -812
  80. package/{dist/compiler/polyfills.d.ts → screenshot/compare/build/index.esm.js} +0 -0
  81. package/screenshot/compare/build/{p-113f7459.js → p-081b0641.js} +1 -1
  82. package/screenshot/compare/build/p-227a1e18.entry.js +1 -0
  83. package/screenshot/compare/build/p-2c298727.entry.js +1 -0
  84. package/screenshot/compare/build/p-5479268c.entry.js +1 -0
  85. package/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
  86. package/screenshot/compare/build/p-6ba08604.entry.js +1 -0
  87. package/screenshot/compare/build/p-6bc63295.entry.js +1 -0
  88. package/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
  89. package/screenshot/compare/build/{p-ejpsp3kx.js → p-7b4e3ba7.js} +1 -1
  90. package/screenshot/compare/build/p-988eb362.css +1 -0
  91. package/screenshot/compare/build/p-9b6a9315.js +1 -0
  92. package/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
  93. package/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
  94. package/screenshot/compare/build/{p-efb0eac6.js → p-e2efe0df.js} +1 -1
  95. package/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
  96. package/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
  97. package/screenshot/compare/build/p-f0b99977.entry.js +1 -0
  98. package/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
  99. package/screenshot/compare/build/p-fbbae598.js +1 -0
  100. package/screenshot/compare/host.config.json +14 -14
  101. package/screenshot/compare/index.html +1 -1
  102. package/{dist/screenshot → screenshot}/connector-base.d.ts +1 -1
  103. package/{dist/screenshot → screenshot}/connector-local.d.ts +1 -1
  104. package/screenshot/connector.js +2 -3
  105. package/{dist/screenshot → screenshot}/index.d.ts +1 -1
  106. package/screenshot/index.js +642 -2
  107. package/screenshot/local-connector.js +2 -3
  108. package/screenshot/package.json +8 -13
  109. package/{dist/screenshot → screenshot}/pixel-match.d.ts +0 -0
  110. package/screenshot/pixel-match.js +22 -6
  111. package/screenshot/screenshot-compare.d.ts +3 -0
  112. package/{dist/screenshot → screenshot}/screenshot-fs.d.ts +1 -1
  113. package/sys/node/autoprefixer.js +1 -0
  114. package/sys/node/glob.js +1 -0
  115. package/sys/node/graceful-fs.js +1 -0
  116. package/sys/node/index.d.ts +18 -0
  117. package/sys/node/index.js +1402 -2
  118. package/sys/node/node-fetch.js +1 -0
  119. package/sys/node/package.json +8 -5
  120. package/sys/node/prompts.js +1 -0
  121. package/sys/node/worker.js +33 -0
  122. package/{dist/testing → testing}/index.d.ts +5 -6
  123. package/testing/index.js +3903 -2
  124. package/testing/jest/jest-config.d.ts +92 -0
  125. package/{dist/testing → testing}/jest/jest-environment.d.ts +4 -2
  126. package/{dist/testing → testing}/jest/jest-preprocessor.d.ts +1 -0
  127. package/{dist/testing → testing}/jest/jest-runner.d.ts +1 -1
  128. package/{dist/testing → testing}/jest/jest-screenshot.d.ts +1 -1
  129. package/{dist/testing → testing}/jest/jest-serializer.d.ts +1 -1
  130. package/{dist/testing → testing}/jest/jest-setup-test-framework.d.ts +0 -0
  131. package/testing/jest-environment.js +3 -3
  132. package/testing/jest-preprocessor.js +3 -3
  133. package/testing/jest-preset.js +20 -28
  134. package/testing/jest-runner.js +3 -3
  135. package/testing/jest-setuptestframework.js +3 -3
  136. package/{dist/testing → testing}/matchers/attributes.d.ts +0 -0
  137. package/{dist/testing → testing}/matchers/class-list.d.ts +0 -0
  138. package/{dist/testing → testing}/matchers/events.d.ts +9 -1
  139. package/{dist/testing → testing}/matchers/html.d.ts +0 -0
  140. package/{dist/testing → testing}/matchers/index.d.ts +3 -1
  141. package/{dist/testing → testing}/matchers/screenshot.d.ts +1 -1
  142. package/{dist/testing → testing}/matchers/text.d.ts +0 -0
  143. package/testing/mock-fetch.d.ts +11 -0
  144. package/testing/mocks.d.ts +14 -0
  145. package/testing/package.json +8 -6
  146. package/testing/puppeteer/index.d.ts +2 -0
  147. package/{dist/testing → testing}/puppeteer/puppeteer-browser.d.ts +2 -2
  148. package/{dist/testing → testing}/puppeteer/puppeteer-declarations.d.ts +9 -9
  149. package/{dist/testing → testing}/puppeteer/puppeteer-element.d.ts +5 -3
  150. package/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
  151. package/{dist/testing → testing}/puppeteer/puppeteer-events.d.ts +7 -7
  152. package/testing/puppeteer/puppeteer-page.d.ts +2 -0
  153. package/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
  154. package/testing/reset-build-conditionals.d.ts +2 -0
  155. package/testing/spec-page.d.ts +2 -0
  156. package/testing/test-transpile.d.ts +2 -0
  157. package/{dist/testing → testing}/testing-logger.d.ts +10 -8
  158. package/testing/testing-sys.d.ts +1 -0
  159. package/{dist/testing → testing}/testing-utils.d.ts +3 -2
  160. package/testing/testing.d.ts +2 -0
  161. package/build-conditionals/index.d.ts +0 -2
  162. package/build-conditionals/index.mjs +0 -66
  163. package/build-conditionals/package.json +0 -6
  164. package/compiler/index.js +0 -2
  165. package/dist/cli/index.js +0 -6068
  166. package/dist/client/css-shim-14a9812e.js +0 -656
  167. package/dist/client/css-shim-69821662.js +0 -658
  168. package/dist/client/declarations/rindo.core.d.ts +0 -1347
  169. package/dist/client/dom-68c8fe31.js +0 -139
  170. package/dist/client/dom-af01458a.js +0 -137
  171. package/dist/client/index.js +0 -2937
  172. package/dist/client/polyfills/core-js.js +0 -10
  173. package/dist/client/polyfills/css-shim.js +0 -656
  174. package/dist/client/polyfills/dom.js +0 -146
  175. package/dist/client/polyfills/es5-html-element.js +0 -18
  176. package/dist/client/polyfills/index.js +0 -35
  177. package/dist/client/polyfills/promise.js +0 -9
  178. package/dist/client/polyfills/system.js +0 -6
  179. package/dist/client/shadow-css-6ef31c68.js +0 -386
  180. package/dist/client/shadow-css-8fd1a9e4.js +0 -388
  181. package/dist/compiler/app-core/app-es5-disabled.d.ts +0 -2
  182. package/dist/compiler/app-core/app-polyfills.d.ts +0 -3
  183. package/dist/compiler/app-core/build-conditionals.d.ts +0 -6
  184. package/dist/compiler/app-core/bundle-app-core.d.ts +0 -6
  185. package/dist/compiler/app-core/component-styles.d.ts +0 -4
  186. package/dist/compiler/app-core/format-component-runtime-meta.d.ts +0 -4
  187. package/dist/compiler/app-core/optimize-module.d.ts +0 -7
  188. package/dist/compiler/browser/build-conditionals-client.d.ts +0 -3
  189. package/dist/compiler/browser/compile-options.d.ts +0 -12
  190. package/dist/compiler/browser/compile.d.ts +0 -2
  191. package/dist/compiler/browser/create-compiler.d.ts +0 -14
  192. package/dist/compiler/browser/index.d.ts +0 -11
  193. package/dist/compiler/build/build-ctx.d.ts +0 -74
  194. package/dist/compiler/build/build-finish.d.ts +0 -3
  195. package/dist/compiler/build/build-hmr.d.ts +0 -2
  196. package/dist/compiler/build/build-results.d.ts +0 -2
  197. package/dist/compiler/build/build-stats.d.ts +0 -3
  198. package/dist/compiler/build/build.d.ts +0 -2
  199. package/dist/compiler/build/cache-stats.d.ts +0 -4
  200. package/dist/compiler/build/compiler-build-id.d.ts +0 -6
  201. package/dist/compiler/build/compiler-ctx.d.ts +0 -44
  202. package/dist/compiler/build/init-index-html.d.ts +0 -2
  203. package/dist/compiler/build/validate-files.d.ts +0 -2
  204. package/dist/compiler/build/write-build.d.ts +0 -2
  205. package/dist/compiler/cache.d.ts +0 -22
  206. package/dist/compiler/compiler.d.ts +0 -27
  207. package/dist/compiler/component-hydrate/bundle-hydrate-factory.d.ts +0 -3
  208. package/dist/compiler/component-hydrate/generate-hydrate-app.d.ts +0 -2
  209. package/dist/compiler/component-hydrate/hydrate-factory-closure.d.ts +0 -2
  210. package/dist/compiler/component-hydrate/update-to-hydrate-components.d.ts +0 -2
  211. package/dist/compiler/component-hydrate/write-hydrate-outputs.d.ts +0 -3
  212. package/dist/compiler/component-lazy/generate-cjs.d.ts +0 -3
  213. package/dist/compiler/component-lazy/generate-esm-browser.d.ts +0 -3
  214. package/dist/compiler/component-lazy/generate-esm.d.ts +0 -3
  215. package/dist/compiler/component-lazy/generate-lazy-app.d.ts +0 -3
  216. package/dist/compiler/component-lazy/generate-lazy-module.d.ts +0 -4
  217. package/dist/compiler/component-lazy/generate-system.d.ts +0 -3
  218. package/dist/compiler/component-lazy/update-to-lazy-component.d.ts +0 -2
  219. package/dist/compiler/component-lazy/write-lazy-entry-module.d.ts +0 -2
  220. package/dist/compiler/component-native/update-to-native-component.d.ts +0 -2
  221. package/dist/compiler/config/config-reload.d.ts +0 -3
  222. package/dist/compiler/config/config-utils.d.ts +0 -4
  223. package/dist/compiler/config/validate-config.d.ts +0 -4
  224. package/dist/compiler/config/validate-copy.d.ts +0 -2
  225. package/dist/compiler/config/validate-dev-server.d.ts +0 -2
  226. package/dist/compiler/config/validate-docs.d.ts +0 -2
  227. package/dist/compiler/config/validate-namespace.d.ts +0 -3
  228. package/dist/compiler/config/validate-output-stats.d.ts +0 -2
  229. package/dist/compiler/config/validate-outputs-angular.d.ts +0 -2
  230. package/dist/compiler/config/validate-outputs-custom.d.ts +0 -2
  231. package/dist/compiler/config/validate-outputs-dist-module.d.ts +0 -2
  232. package/dist/compiler/config/validate-outputs-dist.d.ts +0 -2
  233. package/dist/compiler/config/validate-outputs-hydrate-script.d.ts +0 -2
  234. package/dist/compiler/config/validate-outputs-www.d.ts +0 -2
  235. package/dist/compiler/config/validate-outputs.d.ts +0 -2
  236. package/dist/compiler/config/validate-paths.d.ts +0 -2
  237. package/dist/compiler/config/validate-plugins.d.ts +0 -2
  238. package/dist/compiler/config/validate-prerender.d.ts +0 -2
  239. package/dist/compiler/config/validate-rollup-config.d.ts +0 -2
  240. package/dist/compiler/config/validate-service-worker.d.ts +0 -2
  241. package/dist/compiler/config/validate-testing.d.ts +0 -2
  242. package/dist/compiler/config/validate-workers.d.ts +0 -2
  243. package/dist/compiler/copy/assets-copy-tasks.d.ts +0 -3
  244. package/dist/compiler/copy/hashed-copy.d.ts +0 -2
  245. package/dist/compiler/copy/local-copy-tasks.d.ts +0 -3
  246. package/dist/compiler/docs/constants.d.ts +0 -2
  247. package/dist/compiler/docs/custom/index.d.ts +0 -2
  248. package/dist/compiler/docs/docs.d.ts +0 -2
  249. package/dist/compiler/docs/generate-doc-data.d.ts +0 -3
  250. package/dist/compiler/docs/json/index.d.ts +0 -3
  251. package/dist/compiler/docs/readme/docs-util.d.ts +0 -13
  252. package/dist/compiler/docs/readme/index.d.ts +0 -3
  253. package/dist/compiler/docs/readme/markdown-css-props.d.ts +0 -2
  254. package/dist/compiler/docs/readme/markdown-dependencies.d.ts +0 -2
  255. package/dist/compiler/docs/readme/markdown-events.d.ts +0 -2
  256. package/dist/compiler/docs/readme/markdown-methods.d.ts +0 -2
  257. package/dist/compiler/docs/readme/markdown-props.d.ts +0 -2
  258. package/dist/compiler/docs/readme/markdown-slots.d.ts +0 -2
  259. package/dist/compiler/docs/readme/markdown-usage.d.ts +0 -6
  260. package/dist/compiler/docs/readme/output-docs.d.ts +0 -3
  261. package/dist/compiler/docs/style-docs.d.ts +0 -2
  262. package/dist/compiler/docs/vscode/index.d.ts +0 -2
  263. package/dist/compiler/entries/component-bundles.d.ts +0 -3
  264. package/dist/compiler/entries/component-graph.d.ts +0 -2
  265. package/dist/compiler/entries/default-bundles.d.ts +0 -3
  266. package/dist/compiler/entries/entry-modules.d.ts +0 -6
  267. package/dist/compiler/entries/resolve-component-dependencies.d.ts +0 -2
  268. package/dist/compiler/events.d.ts +0 -15
  269. package/dist/compiler/fs-watch/fs-watch-init.d.ts +0 -2
  270. package/dist/compiler/fs-watch/fs-watch-log.d.ts +0 -2
  271. package/dist/compiler/fs-watch/fs-watch-rebuild.d.ts +0 -7
  272. package/dist/compiler/html/inject-module-preloads.d.ts +0 -3
  273. package/dist/compiler/html/inject-sw-script.d.ts +0 -4
  274. package/dist/compiler/html/inline-esm-import.d.ts +0 -2
  275. package/dist/compiler/html/inline-style-sheets.d.ts +0 -2
  276. package/dist/compiler/html/update-global-styles-link.d.ts +0 -2
  277. package/dist/compiler/html/used-components.d.ts +0 -2
  278. package/dist/compiler/html/utils.d.ts +0 -2
  279. package/dist/compiler/html/validate-manifest-json.d.ts +0 -2
  280. package/dist/compiler/index.d.ts +0 -10
  281. package/dist/compiler/index.js +0 -18008
  282. package/dist/compiler/output-targets/empty-dir.d.ts +0 -6
  283. package/dist/compiler/output-targets/index.d.ts +0 -2
  284. package/dist/compiler/output-targets/output-angular.d.ts +0 -4
  285. package/dist/compiler/output-targets/output-app.d.ts +0 -4
  286. package/dist/compiler/output-targets/output-collection.d.ts +0 -3
  287. package/dist/compiler/output-targets/output-copy.d.ts +0 -2
  288. package/dist/compiler/output-targets/output-custom.d.ts +0 -2
  289. package/dist/compiler/output-targets/output-docs.d.ts +0 -2
  290. package/dist/compiler/output-targets/output-hydrate.d.ts +0 -2
  291. package/dist/compiler/output-targets/output-lazy-loader.d.ts +0 -2
  292. package/dist/compiler/output-targets/output-module.d.ts +0 -4
  293. package/dist/compiler/output-targets/output-prerender.d.ts +0 -2
  294. package/dist/compiler/output-targets/output-service-workers.d.ts +0 -2
  295. package/dist/compiler/output-targets/output-types.d.ts +0 -2
  296. package/dist/compiler/output-targets/output-utils.d.ts +0 -54
  297. package/dist/compiler/output-targets/output-www.d.ts +0 -2
  298. package/dist/compiler/plugin/plugin.d.ts +0 -6
  299. package/dist/compiler/prerender/crawl-urls.d.ts +0 -3
  300. package/dist/compiler/prerender/host-config.d.ts +0 -12
  301. package/dist/compiler/prerender/prerender-config.d.ts +0 -2
  302. package/dist/compiler/prerender/prerender-main.d.ts +0 -2
  303. package/dist/compiler/prerender/prerender-queue.d.ts +0 -3
  304. package/dist/compiler/prerender/prerender-template-html.d.ts +0 -2
  305. package/dist/compiler/prerender/prerendered-write-path.d.ts +0 -2
  306. package/dist/compiler/prerender/robots-txt.d.ts +0 -2
  307. package/dist/compiler/prerender/sitemap-xml.d.ts +0 -3
  308. package/dist/compiler/rollup-plugins/component-entry.d.ts +0 -3
  309. package/dist/compiler/rollup-plugins/css-transformer.d.ts +0 -3
  310. package/dist/compiler/rollup-plugins/global-scripts.d.ts +0 -4
  311. package/dist/compiler/rollup-plugins/image-plugin.d.ts +0 -3
  312. package/dist/compiler/rollup-plugins/in-memory-fs-read.d.ts +0 -3
  313. package/dist/compiler/rollup-plugins/loader.d.ts +0 -4
  314. package/dist/compiler/rollup-plugins/plugin-helper.d.ts +0 -5
  315. package/dist/compiler/rollup-plugins/rindo-build-conditionals.d.ts +0 -7
  316. package/dist/compiler/rollup-plugins/rindo-client.d.ts +0 -3
  317. package/dist/compiler/rollup-plugins/rindo-external-runtime.d.ts +0 -2
  318. package/dist/compiler/rollup-plugins/rindo-hydrate.d.ts +0 -3
  319. package/dist/compiler/rollup-plugins/rindo-public-plugin.d.ts +0 -2
  320. package/dist/compiler/service-worker/generate-sw.d.ts +0 -7
  321. package/dist/compiler/service-worker/service-worker-util.d.ts +0 -2
  322. package/dist/compiler/style/cached-styles.d.ts +0 -5
  323. package/dist/compiler/style/component-styles.d.ts +0 -2
  324. package/dist/compiler/style/css-imports.d.ts +0 -9
  325. package/dist/compiler/style/css-to-esm.d.ts +0 -5
  326. package/dist/compiler/style/generate-styles.d.ts +0 -2
  327. package/dist/compiler/style/global-styles.d.ts +0 -3
  328. package/dist/compiler/style/normalize-styles.d.ts +0 -2
  329. package/dist/compiler/style/optimize-css.d.ts +0 -2
  330. package/dist/compiler/style/scope-css.d.ts +0 -3
  331. package/dist/compiler/style/style-utils.d.ts +0 -10
  332. package/dist/compiler/transformers/add-component-meta-proxy.d.ts +0 -3
  333. package/dist/compiler/transformers/add-component-meta-static.d.ts +0 -4
  334. package/dist/compiler/transformers/add-imports.d.ts +0 -3
  335. package/dist/compiler/transformers/collections/add-external-import.d.ts +0 -2
  336. package/dist/compiler/transformers/collections/parse-collection-components.d.ts +0 -2
  337. package/dist/compiler/transformers/collections/parse-collection-deprecated.d.ts +0 -2
  338. package/dist/compiler/transformers/collections/parse-collection-manifest.d.ts +0 -7
  339. package/dist/compiler/transformers/collections/parse-collection-module.d.ts +0 -2
  340. package/dist/compiler/transformers/component-build-conditionals.d.ts +0 -2
  341. package/dist/compiler/transformers/component-hydrate/hydrate-component.d.ts +0 -3
  342. package/dist/compiler/transformers/component-hydrate/hydrate-runtime-cmp-meta.d.ts +0 -3
  343. package/dist/compiler/transformers/component-hydrate/tranform-to-hydrate-component.d.ts +0 -2
  344. package/dist/compiler/transformers/component-lazy/lazy-component.d.ts +0 -3
  345. package/dist/compiler/transformers/component-lazy/lazy-constructor.d.ts +0 -3
  346. package/dist/compiler/transformers/component-lazy/lazy-element-getter.d.ts +0 -3
  347. package/dist/compiler/transformers/component-lazy/transform-lazy-component.d.ts +0 -4
  348. package/dist/compiler/transformers/component-native/native-component.d.ts +0 -3
  349. package/dist/compiler/transformers/component-native/native-connected-callback.d.ts +0 -3
  350. package/dist/compiler/transformers/component-native/native-constructor.d.ts +0 -3
  351. package/dist/compiler/transformers/component-native/native-element-getter.d.ts +0 -3
  352. package/dist/compiler/transformers/component-native/native-static-style.d.ts +0 -3
  353. package/dist/compiler/transformers/component-native/tranform-to-native-component.d.ts +0 -4
  354. package/dist/compiler/transformers/core-runtime-apis.d.ts +0 -30
  355. package/dist/compiler/transformers/create-event.d.ts +0 -3
  356. package/dist/compiler/transformers/decorators-to-static/component-decorator.d.ts +0 -3
  357. package/dist/compiler/transformers/decorators-to-static/convert-decorators.d.ts +0 -3
  358. package/dist/compiler/transformers/decorators-to-static/decorator-utils.d.ts +0 -10
  359. package/dist/compiler/transformers/decorators-to-static/element-decorator.d.ts +0 -3
  360. package/dist/compiler/transformers/decorators-to-static/event-decorator.d.ts +0 -4
  361. package/dist/compiler/transformers/decorators-to-static/listen-decorator.d.ts +0 -6
  362. package/dist/compiler/transformers/decorators-to-static/method-decorator.d.ts +0 -3
  363. package/dist/compiler/transformers/decorators-to-static/prop-decorator.d.ts +0 -4
  364. package/dist/compiler/transformers/decorators-to-static/state-decorator.d.ts +0 -3
  365. package/dist/compiler/transformers/decorators-to-static/style-to-static.d.ts +0 -3
  366. package/dist/compiler/transformers/decorators-to-static/watch-decorator.d.ts +0 -3
  367. package/dist/compiler/transformers/define-custom-element.d.ts +0 -3
  368. package/dist/compiler/transformers/host-data-transform.d.ts +0 -3
  369. package/dist/compiler/transformers/legacy-props.d.ts +0 -3
  370. package/dist/compiler/transformers/remove-static-meta-properties.d.ts +0 -2
  371. package/dist/compiler/transformers/reserved-public-members.d.ts +0 -3
  372. package/dist/compiler/transformers/rindo-import-path.d.ts +0 -3
  373. package/dist/compiler/transformers/static-to-meta/call-expression.d.ts +0 -3
  374. package/dist/compiler/transformers/static-to-meta/class-methods.d.ts +0 -3
  375. package/dist/compiler/transformers/static-to-meta/component.d.ts +0 -3
  376. package/dist/compiler/transformers/static-to-meta/element-ref.d.ts +0 -2
  377. package/dist/compiler/transformers/static-to-meta/encapsulation.d.ts +0 -3
  378. package/dist/compiler/transformers/static-to-meta/events.d.ts +0 -3
  379. package/dist/compiler/transformers/static-to-meta/import.d.ts +0 -3
  380. package/dist/compiler/transformers/static-to-meta/listeners.d.ts +0 -3
  381. package/dist/compiler/transformers/static-to-meta/methods.d.ts +0 -3
  382. package/dist/compiler/transformers/static-to-meta/props.d.ts +0 -3
  383. package/dist/compiler/transformers/static-to-meta/states.d.ts +0 -3
  384. package/dist/compiler/transformers/static-to-meta/string-literal.d.ts +0 -3
  385. package/dist/compiler/transformers/static-to-meta/styles.d.ts +0 -3
  386. package/dist/compiler/transformers/static-to-meta/vdom.d.ts +0 -3
  387. package/dist/compiler/transformers/static-to-meta/visitor.d.ts +0 -3
  388. package/dist/compiler/transformers/static-to-meta/watchers.d.ts +0 -3
  389. package/dist/compiler/transformers/style-imports.d.ts +0 -3
  390. package/dist/compiler/transformers/transform-utils.d.ts +0 -31
  391. package/dist/compiler/transformers/update-component-class.d.ts +0 -3
  392. package/dist/compiler/transformers/update-rindo-core-import.d.ts +0 -3
  393. package/dist/compiler/transformers/watcher-meta-transform.d.ts +0 -3
  394. package/dist/compiler/transpile/compiler-options.d.ts +0 -4
  395. package/dist/compiler/transpile/transpile-app.d.ts +0 -2
  396. package/dist/compiler/transpile/transpile-module.d.ts +0 -5
  397. package/dist/compiler/transpile/transpile-service.d.ts +0 -3
  398. package/dist/compiler/transpile/transpile-to-es5-main.d.ts +0 -2
  399. package/dist/compiler/transpile/validate-types-main.d.ts +0 -2
  400. package/dist/compiler/types/generate-app-types.d.ts +0 -2
  401. package/dist/compiler/types/generate-component-types.d.ts +0 -8
  402. package/dist/compiler/types/generate-event-types.d.ts +0 -2
  403. package/dist/compiler/types/generate-method-types.d.ts +0 -2
  404. package/dist/compiler/types/generate-prop-types.d.ts +0 -2
  405. package/dist/compiler/types/generate-types.d.ts +0 -2
  406. package/dist/compiler/types/rindo-types.d.ts +0 -3
  407. package/dist/compiler/types/types-utils.d.ts +0 -4
  408. package/dist/compiler/types/update-import-refs.d.ts +0 -11
  409. package/dist/compiler/types/validate-package-json.d.ts +0 -9
  410. package/dist/declarations/assets.d.ts +0 -17
  411. package/dist/declarations/browser-compile.d.ts +0 -47
  412. package/dist/declarations/build-conditionals.d.ts +0 -91
  413. package/dist/declarations/build-events.d.ts +0 -19
  414. package/dist/declarations/build.d.ts +0 -247
  415. package/dist/declarations/cache.d.ts +0 -11
  416. package/dist/declarations/collection-manifest.d.ts +0 -106
  417. package/dist/declarations/collection.d.ts +0 -139
  418. package/dist/declarations/compiler.d.ts +0 -53
  419. package/dist/declarations/component-compiler-meta.d.ts +0 -198
  420. package/dist/declarations/component-constructor.d.ts +0 -61
  421. package/dist/declarations/component-interfaces.d.ts +0 -123
  422. package/dist/declarations/config.d.ts +0 -409
  423. package/dist/declarations/css-var-shim.d.ts +0 -9
  424. package/dist/declarations/decorators.d.ts +0 -150
  425. package/dist/declarations/dev-server.d.ts +0 -135
  426. package/dist/declarations/diagnostics.d.ts +0 -21
  427. package/dist/declarations/entry.d.ts +0 -28
  428. package/dist/declarations/events.d.ts +0 -13
  429. package/dist/declarations/file-system.d.ts +0 -91
  430. package/dist/declarations/fs-watch.d.ts +0 -15
  431. package/dist/declarations/host-element.d.ts +0 -53
  432. package/dist/declarations/hydrate.d.ts +0 -99
  433. package/dist/declarations/in-memory-fs.d.ts +0 -59
  434. package/dist/declarations/index.d.ts +0 -45
  435. package/dist/declarations/jsdoc.d.ts +0 -16
  436. package/dist/declarations/jsx.d.ts +0 -1050
  437. package/dist/declarations/logger.d.ts +0 -25
  438. package/dist/declarations/minify-js.d.ts +0 -11
  439. package/dist/declarations/module.d.ts +0 -35
  440. package/dist/declarations/optimize-css.d.ts +0 -12
  441. package/dist/declarations/output-targets.d.ts +0 -189
  442. package/dist/declarations/plugin.d.ts +0 -23
  443. package/dist/declarations/prerender.d.ts +0 -79
  444. package/dist/declarations/render.d.ts +0 -62
  445. package/dist/declarations/runtime.d.ts +0 -92
  446. package/dist/declarations/screenshots.d.ts +0 -192
  447. package/dist/declarations/server.d.ts +0 -19
  448. package/dist/declarations/style.d.ts +0 -35
  449. package/dist/declarations/system.d.ts +0 -174
  450. package/dist/declarations/testing.d.ts +0 -523
  451. package/dist/declarations/transpile.d.ts +0 -24
  452. package/dist/declarations/types.d.ts +0 -24
  453. package/dist/declarations/vdom.d.ts +0 -55
  454. package/dist/declarations/worker.d.ts +0 -33
  455. package/dist/dev-server/content-type-db.json +0 -1
  456. package/dist/dev-server/index.js +0 -887
  457. package/dist/dev-server/static/app-error.css +0 -257
  458. package/dist/dev-server/static/dev-server-client.html +0 -13
  459. package/dist/dev-server/templates/initial-load.html +0 -160
  460. package/dist/hydrate/index.d.ts +0 -101
  461. package/dist/hydrate/index.mjs +0 -1281
  462. package/dist/hydrate/platform.mjs +0 -347
  463. package/dist/index.d.ts +0 -99
  464. package/dist/mock-doc/index.d.ts +0 -851
  465. package/dist/mock-doc/index.js +0 -3982
  466. package/dist/mock-doc/index.mjs +0 -3954
  467. package/dist/runtime/index.js +0 -2576
  468. package/dist/runtime/index.mjs +0 -2521
  469. package/dist/runtime/shadow-css-6ef31c68.js +0 -386
  470. package/dist/runtime/shadow-css-8fd1a9e4.js +0 -388
  471. package/dist/screenshot/index.js +0 -520
  472. package/dist/sys/node/graceful-fs.js +0 -975
  473. package/dist/sys/node/index.js +0 -33545
  474. package/dist/sys/node/node-fetch.js +0 -1779
  475. package/dist/sys/node/open-in-editor.js +0 -734
  476. package/dist/sys/node/sys-worker.js +0 -67035
  477. package/dist/sys/node/websocket.js +0 -3728
  478. package/dist/testing/build-conditionals.d.ts +0 -4
  479. package/dist/testing/build-conditionals.js +0 -43
  480. package/dist/testing/core.d.ts +0 -35
  481. package/dist/testing/core.js +0 -52
  482. package/dist/testing/index.js +0 -40511
  483. package/dist/testing/jest/jest-config.d.ts +0 -4
  484. package/dist/testing/mock-fetch.d.ts +0 -46
  485. package/dist/testing/mocks.d.ts +0 -12
  486. package/dist/testing/platform.d.ts +0 -23
  487. package/dist/testing/platform.js +0 -321
  488. package/dist/testing/puppeteer/puppeteer-emulate.d.ts +0 -2
  489. package/dist/testing/puppeteer/puppeteer-find.d.ts +0 -5
  490. package/dist/testing/puppeteer/puppeteer-page.d.ts +0 -2
  491. package/dist/testing/puppeteer/puppeteer-screenshot.d.ts +0 -4
  492. package/dist/testing/spec-page.d.ts +0 -5
  493. package/dist/testing/task-queue.d.ts +0 -15
  494. package/dist/testing/test-transpile.d.ts +0 -5
  495. package/dist/testing/testing-fs.d.ts +0 -31
  496. package/dist/testing/testing-sys.d.ts +0 -19
  497. package/dist/testing/testing.d.ts +0 -12
  498. package/dist/utils/index.js +0 -1575
  499. package/dist/utils/index.mjs +0 -1511
  500. package/internal/client/css-shim.rindo-client.mjs +0 -656
  501. package/internal/client/index.mjs +0 -2859
  502. package/internal/client/polyfills/promise.js +0 -9
  503. package/internal/images.d.ts +0 -5
  504. package/runtime/package.json +0 -5
  505. package/screenshot/compare/build/p-020f8d73.js +0 -1
  506. package/screenshot/compare/build/p-09qdknbg.system.entry.js +0 -1
  507. package/screenshot/compare/build/p-0a13mpsc.system.entry.js +0 -1
  508. package/screenshot/compare/build/p-168ec2c4.system.js +0 -1
  509. package/screenshot/compare/build/p-2ab1fdf1.system.js +0 -1
  510. package/screenshot/compare/build/p-2pxcsgrj.entry.js +0 -1
  511. package/screenshot/compare/build/p-42fb7034.system.js +0 -1
  512. package/screenshot/compare/build/p-54d9d7c2.system.js +0 -1
  513. package/screenshot/compare/build/p-67c1f911.js +0 -1
  514. package/screenshot/compare/build/p-68613371.system.js +0 -1
  515. package/screenshot/compare/build/p-7dvsjpu0.entry.js +0 -1
  516. package/screenshot/compare/build/p-aa67fb06.js +0 -1
  517. package/screenshot/compare/build/p-aeb3cec1.system.js +0 -1
  518. package/screenshot/compare/build/p-b6e44a24.js +0 -1
  519. package/screenshot/compare/build/p-c1c25b8a.js +0 -1
  520. package/screenshot/compare/build/p-c9bopbjy.system.entry.js +0 -1
  521. package/screenshot/compare/build/p-c9iqz1pp.system.entry.js +0 -1
  522. package/screenshot/compare/build/p-dizjz8rg.entry.js +0 -1
  523. package/screenshot/compare/build/p-dnta0rwp.system.entry.js +0 -1
  524. package/screenshot/compare/build/p-e9670d22.system.js +0 -1
  525. package/screenshot/compare/build/p-ei9jkpd0.system.entry.js +0 -1
  526. package/screenshot/compare/build/p-ejwcppol.entry.js +0 -1
  527. package/screenshot/compare/build/p-f6612d5d.system.js +0 -1
  528. package/screenshot/compare/build/p-foiivsfc.css +0 -1
  529. package/screenshot/compare/build/p-gpjjyogx.entry.js +0 -1
  530. package/screenshot/compare/build/p-howklem2.system.entry.js +0 -1
  531. package/screenshot/compare/build/p-knv9wvoc.entry.js +0 -1
  532. package/screenshot/compare/build/p-nsqsfhhy.entry.js +0 -1
  533. package/screenshot/compare/build/p-ojt278pp.entry.js +0 -1
  534. package/screenshot/compare/build/p-oywass99.entry.js +0 -1
  535. package/screenshot/compare/build/p-q3ujhub6.entry.js +0 -1
  536. package/screenshot/compare/build/p-qw4xnmxv.entry.js +0 -1
  537. package/screenshot/compare/build/p-t1wvevhc.system.entry.js +0 -1
  538. package/screenshot/compare/build/p-tnjarrex.system.entry.js +0 -1
  539. package/screenshot/compare/build/p-vhfpd6kk.system.entry.js +0 -1
  540. package/screenshot/compare/build/p-vk6rhemd.system.entry.js +0 -1
  541. package/screenshot/compare/build/p-w6bnm16k.entry.js +0 -1
  542. package/screenshot/compare/build/p-xje6d7zl.system.entry.js +0 -1
  543. package/screenshot/compare/build/p-y5jlrcha.system.entry.js +0 -1
  544. package/screenshot/compare/build/p-yh170wkt.entry.js +0 -1
  545. package/testing/jest.preprocessor.js +0 -7
package/sys/node/index.js CHANGED
@@ -1,2 +1,1402 @@
1
- /* @rindo/core/sys/node */
2
- module.exports = require('../../dist/sys/node');
1
+ function _interopDefault(e) {
2
+ return e && "object" == typeof e && "default" in e ? e.default : e;
3
+ }
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var t = {};
8
+ return e && Object.keys(e).forEach((function(r) {
9
+ var s = Object.getOwnPropertyDescriptor(e, r);
10
+ Object.defineProperty(t, r, s.get ? s : {
11
+ enumerable: !0,
12
+ get: function() {
13
+ return e[r];
14
+ }
15
+ });
16
+ })), t.default = e, t;
17
+ }
18
+
19
+ async function nodeCopyTasks(e, t) {
20
+ const r = {
21
+ diagnostics: [],
22
+ dirPaths: [],
23
+ filePaths: []
24
+ };
25
+ try {
26
+ e = ((e, t = (e => e)) => {
27
+ const r = new Set;
28
+ return e.filter(e => {
29
+ const s = t(e);
30
+ return null == s || !r.has(s) && (r.add(s), !0);
31
+ });
32
+ })((n = await Promise.all(e.map(e => async function r(e, t) {
33
+ return (e => {
34
+ const t = {
35
+ "{": "}",
36
+ "(": ")",
37
+ "[": "]"
38
+ }, r = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\))/;
39
+ if ("" === e) return !1;
40
+ let s;
41
+ for (;s = r.exec(e); ) {
42
+ if (s[2]) return !0;
43
+ let r = s.index + s[0].length;
44
+ const n = s[1], o = n ? t[n] : null;
45
+ if (n && o) {
46
+ const t = e.indexOf(o, r);
47
+ -1 !== t && (r = t + 1);
48
+ }
49
+ e = e.slice(r);
50
+ }
51
+ return !1;
52
+ })(e.src) ? await async function r(e, t) {
53
+ return (await asyncGlob(e.src, {
54
+ cwd: t,
55
+ nodir: !0
56
+ })).map(r => function s(e, t, r) {
57
+ const s = path.join(e.dest, e.keepDirStructure ? r : path.basename(r));
58
+ return {
59
+ src: path.join(t, r),
60
+ dest: s,
61
+ warn: e.warn,
62
+ keepDirStructure: e.keepDirStructure
63
+ };
64
+ }(e, t, r));
65
+ }(e, t) : [ {
66
+ src: getSrcAbsPath(t, e.src),
67
+ dest: e.keepDirStructure ? path.join(e.dest, e.src) : e.dest,
68
+ warn: e.warn,
69
+ keepDirStructure: e.keepDirStructure
70
+ } ];
71
+ }(e, t))), e = n.flat ? n.flat(1) : n.reduce((e, t) => (e.push(...t), e), [])), e => e.dest);
72
+ const s = [];
73
+ for (;e.length > 0; ) {
74
+ const t = e.splice(0, 100);
75
+ await Promise.all(t.map(e => processCopyTask(r, s, e)));
76
+ }
77
+ const o = function s(e) {
78
+ const t = [];
79
+ return e.forEach(e => {
80
+ !function r(e, t) {
81
+ (t = normalizePath(t)) !== ROOT_DIR && t + "/" !== ROOT_DIR && "" !== t && (e.includes(t) || e.push(t));
82
+ }(t, path.dirname(e.dest));
83
+ }), t.sort((e, t) => {
84
+ const r = e.split("/").length, s = t.split("/").length;
85
+ return r < s ? -1 : r > s ? 1 : e < t ? -1 : e > t ? 1 : 0;
86
+ }), t;
87
+ }(s);
88
+ try {
89
+ await Promise.all(o.map(e => mkdir(e, {
90
+ recursive: !0
91
+ })));
92
+ } catch (e) {}
93
+ for (;s.length > 0; ) {
94
+ const e = s.splice(0, 100);
95
+ await Promise.all(e.map(e => copyFile(e.src, e.dest)));
96
+ }
97
+ } catch (e) {
98
+ catchError(r.diagnostics, e);
99
+ }
100
+ var n;
101
+ return r;
102
+ }
103
+
104
+ function getSrcAbsPath(e, t) {
105
+ return path.isAbsolute(t) ? t : path.join(e, t);
106
+ }
107
+
108
+ async function processCopyTask(e, t, r) {
109
+ try {
110
+ r.src = normalizePath(r.src), r.dest = normalizePath(r.dest), (await stat(r.src)).isDirectory() ? (e.dirPaths.includes(r.dest) || e.dirPaths.push(r.dest),
111
+ await async function s(e, t, r) {
112
+ try {
113
+ const s = await readdir(r.src);
114
+ await Promise.all(s.map(async s => {
115
+ const n = {
116
+ src: path.join(r.src, s),
117
+ dest: path.join(r.dest, s),
118
+ warn: r.warn
119
+ };
120
+ await processCopyTask(e, t, n);
121
+ }));
122
+ } catch (t) {
123
+ catchError(e.diagnostics, t);
124
+ }
125
+ }(e, t, r)) : function n(e) {
126
+ return e = e.trim().toLowerCase(), IGNORE.some(t => e.endsWith(t));
127
+ }(r.src) || (e.filePaths.includes(r.dest) || e.filePaths.push(r.dest), t.push(r));
128
+ } catch (t) {
129
+ !1 !== r.warn && (buildError(e.diagnostics).messageText = t.message);
130
+ }
131
+ }
132
+
133
+ function asyncGlob(e, t) {
134
+ return new Promise((r, s) => {
135
+ (0, glob.glob)(e, t, (e, t) => {
136
+ e ? s(e) : r(t);
137
+ });
138
+ });
139
+ }
140
+
141
+ function semiver(e, t, r) {
142
+ return e = e.split("."), t = t.split("."), fn(e[0], t[0]) || fn(e[1], t[1]) || (t[2] = t.slice(2).join("."),
143
+ (r = /[.-]/.test(e[2] = e.slice(2).join("."))) == /[.-]/.test(t[2]) ? fn(e[2], t[2]) : r ? -1 : 1);
144
+ }
145
+
146
+ async function checkVersion(e, t) {
147
+ try {
148
+ const r = await async function r(e) {
149
+ try {
150
+ const e = await function t() {
151
+ return new Promise(e => {
152
+ fs.readFile(getLastCheckStoragePath(), "utf8", (t, r) => {
153
+ if (!t && isString(r)) try {
154
+ e(JSON.parse(r));
155
+ } catch (e) {}
156
+ e(null);
157
+ });
158
+ });
159
+ }();
160
+ if (null == e) return setLastCheck(), null;
161
+ if (!function r(e, t, s) {
162
+ return t + s < e;
163
+ }(Date.now(), e, 6048e5)) return null;
164
+ const t = setLastCheck(), r = await async function s(e) {
165
+ const t = await Promise.resolve().then((function() {
166
+ return _interopNamespace(require("https"));
167
+ }));
168
+ return new Promise((r, s) => {
169
+ const n = t.request(e, t => {
170
+ if (t.statusCode > 299) return void s(`url: ${e}, staus: ${t.statusCode}`);
171
+ t.once("error", s);
172
+ const n = [];
173
+ t.once("end", () => {
174
+ r(n.join(""));
175
+ }), t.on("data", e => {
176
+ n.push(e);
177
+ });
178
+ });
179
+ n.once("error", s), n.end();
180
+ });
181
+ }("https://registry.npmjs.org/@rindo/core"), s = JSON.parse(r);
182
+ return await t, s["dist-tags"].latest;
183
+ } catch (t) {
184
+ e.debug("getLatestCompilerVersion error: " + t);
185
+ }
186
+ return null;
187
+ }(e);
188
+ if (null != r) return () => {
189
+ semiver(t, r) < 0 ? function s(e, t, r) {
190
+ const s = [ `Update available: ${t} ${ARROW} ${r}`, "To get the latest, please run:", "npm install @rindo/core" ], n = s[0].length, o = [];
191
+ let i = BOX_TOP_LEFT;
192
+ for (;i.length <= n + 2 * PADDING; ) i += BOX_HORIZONTAL;
193
+ i += BOX_TOP_RIGHT, o.push(i), s.forEach(e => {
194
+ let t = BOX_VERTICAL;
195
+ for (let e = 0; e < PADDING; e++) t += " ";
196
+ for (t += e; t.length <= n + 2 * PADDING; ) t += " ";
197
+ t += BOX_VERTICAL, o.push(t);
198
+ });
199
+ let a = BOX_BOTTOM_LEFT;
200
+ for (;a.length <= n + 2 * PADDING; ) a += BOX_HORIZONTAL;
201
+ a += BOX_BOTTOM_RIGHT, o.push(a);
202
+ let l = `\n${INDENT$1}${o.join("\n" + INDENT$1)}\n`;
203
+ l = l.replace(t, e.red(t)), l = l.replace(r, e.green(r)), l = l.replace("npm install @rindo/core", e.cyan("npm install @rindo/core")),
204
+ console.log(l);
205
+ }(e, t, r) : console.debug(`${e.cyan("@rindo/core")} version ${e.green(t)} is the latest version`);
206
+ };
207
+ } catch (t) {
208
+ e.debug("unable to load latest compiler version: " + t);
209
+ }
210
+ return noop;
211
+ }
212
+
213
+ function setLastCheck() {
214
+ return new Promise(e => {
215
+ const t = JSON.stringify(Date.now());
216
+ fs.writeFile(getLastCheckStoragePath(), t, () => {
217
+ e();
218
+ });
219
+ });
220
+ }
221
+
222
+ function getLastCheckStoragePath() {
223
+ return path.join(os.tmpdir(), "rindo_last_version_node.json");
224
+ }
225
+
226
+ function getNextWorker(e) {
227
+ const t = e.filter(e => !e.stopped);
228
+ return 0 === t.length ? null : t.sort((e, t) => e.tasks.size < t.tasks.size ? -1 : e.tasks.size > t.tasks.size ? 1 : e.totalTasksAssigned < t.totalTasksAssigned ? -1 : e.totalTasksAssigned > t.totalTasksAssigned ? 1 : 0)[0];
229
+ }
230
+
231
+ function createNodeSysNoWatch(e = {}) {
232
+ const t = e.process || global.process, r = new Set, s = [], n = os.cpus(), o = n.length, i = os.platform(), a = {
233
+ name: "node",
234
+ version: t.versions.node,
235
+ access: e => new Promise(t => {
236
+ fs.access(e, e => {
237
+ t(!e);
238
+ });
239
+ }),
240
+ accessSync(e) {
241
+ let t = !1;
242
+ try {
243
+ fs.accessSync(e), t = !0;
244
+ } catch (e) {}
245
+ return t;
246
+ },
247
+ addDestory(e) {
248
+ r.add(e);
249
+ },
250
+ removeDestory(e) {
251
+ r.delete(e);
252
+ },
253
+ applyPrerenderGlobalPatch(e) {
254
+ if ("function" != typeof global.fetch) {
255
+ const t = require(path.join(__dirname, "node-fetch.js"));
256
+ global.fetch = (r, s) => {
257
+ if ("string" == typeof r) {
258
+ const n = new URL(r, e.devServerHostUrl).href;
259
+ return t.fetch(n, s);
260
+ }
261
+ return r.url = new URL(r.url, e.devServerHostUrl).href, t.fetch(r, s);
262
+ }, global.Headers = t.Headers, global.Request = t.Request, global.Response = t.Response,
263
+ global.FetchError = t.FetchError;
264
+ }
265
+ e.window.fetch = global.fetch, e.window.Headers = global.Headers, e.window.Request = global.Request,
266
+ e.window.Response = global.Response, e.window.FetchError = global.FetchError;
267
+ },
268
+ checkVersion,
269
+ copyFile: (e, t) => new Promise(r => {
270
+ fs.copyFile(e, t, e => {
271
+ r(!e);
272
+ });
273
+ }),
274
+ createWorkerController(e) {
275
+ const t = path.join(__dirname, "worker.js");
276
+ return new NodeWorkerController(t, e);
277
+ },
278
+ async destroy() {
279
+ const e = [];
280
+ r.forEach(t => {
281
+ try {
282
+ const r = t();
283
+ r && r.then && e.push(r);
284
+ } catch (e) {
285
+ console.error("node sys destroy: " + e);
286
+ }
287
+ }), e.length > 0 && await Promise.all(e), r.clear();
288
+ },
289
+ dynamicImport: e => Promise.resolve((e => ("function" == typeof __webpack_require__ ? __non_webpack_require__ : require)(e))(e)),
290
+ encodeToBase64: e => Buffer.from(e).toString("base64"),
291
+ async ensureDependencies() {
292
+ const e = [];
293
+ let t = null;
294
+ try {
295
+ t = require.resolve("typescript");
296
+ } catch (t) {
297
+ const r = buildError(e);
298
+ r.header = "Unable to find TypeScript", r.messageText = 'Please ensure you install the dependencies first, for example: "npm install"';
299
+ }
300
+ return {
301
+ rindoPath: a.getCompilerExecutingPath(),
302
+ typescriptPath: t,
303
+ diagnostics: e
304
+ };
305
+ },
306
+ async ensureResources() {},
307
+ exit,
308
+ getCurrentDirectory: () => normalizePath(t.cwd()),
309
+ getCompilerExecutingPath: () => path.join(__dirname, "..", "..", "compiler", "rindo.js"),
310
+ getDevServerExecutingPath: () => path.join(__dirname, "..", "..", "dev-server", "index.js"),
311
+ getEnvironmentVar: e => process.env[e],
312
+ getLocalModulePath: () => null,
313
+ getRemoteModuleUrl: () => null,
314
+ glob: asyncGlob,
315
+ hardwareConcurrency: o,
316
+ isSymbolicLink: e => new Promise(t => {
317
+ try {
318
+ fs.lstat(e, (e, r) => {
319
+ t(!e && r.isSymbolicLink());
320
+ });
321
+ } catch (e) {
322
+ t(!1);
323
+ }
324
+ }),
325
+ mkdir: (e, t) => new Promise(r => {
326
+ t ? fs.mkdir(e, t, t => {
327
+ r({
328
+ basename: path.basename(e),
329
+ dirname: path.dirname(e),
330
+ path: e,
331
+ newDirs: [],
332
+ error: t
333
+ });
334
+ }) : fs.mkdir(e, t => {
335
+ r({
336
+ basename: path.basename(e),
337
+ dirname: path.dirname(e),
338
+ path: e,
339
+ newDirs: [],
340
+ error: t
341
+ });
342
+ });
343
+ }),
344
+ mkdirSync(e, t) {
345
+ const r = {
346
+ basename: path.basename(e),
347
+ dirname: path.dirname(e),
348
+ path: e,
349
+ newDirs: [],
350
+ error: null
351
+ };
352
+ try {
353
+ fs.mkdirSync(e, t);
354
+ } catch (e) {
355
+ r.error = e;
356
+ }
357
+ return r;
358
+ },
359
+ nextTick: t.nextTick,
360
+ normalizePath,
361
+ onProcessInterrupt: e => {
362
+ s.includes(e) || s.push(e);
363
+ },
364
+ platformPath: path,
365
+ readdir: e => new Promise(t => {
366
+ fs.readdir(e, (r, s) => {
367
+ t(r ? [] : s.map(t => normalizePath(path.join(e, t))));
368
+ });
369
+ }),
370
+ readdirSync(e) {
371
+ try {
372
+ return fs.readdirSync(e).map(t => normalizePath(path.join(e, t)));
373
+ } catch (e) {}
374
+ return [];
375
+ },
376
+ readFile: e => new Promise(t => {
377
+ fs.readFile(e, "utf8", (e, r) => {
378
+ t(r);
379
+ });
380
+ }),
381
+ readFileSync(e) {
382
+ try {
383
+ return fs.readFileSync(e, "utf8");
384
+ } catch (e) {}
385
+ },
386
+ realpath: e => new Promise(t => {
387
+ fs.realpath(e, "utf8", (e, r) => {
388
+ t({
389
+ path: r,
390
+ error: e
391
+ });
392
+ });
393
+ }),
394
+ realpathSync(e) {
395
+ const t = {
396
+ path: void 0,
397
+ error: null
398
+ };
399
+ try {
400
+ t.path = fs.realpathSync(e, "utf8");
401
+ } catch (e) {
402
+ t.error = e;
403
+ }
404
+ return t;
405
+ },
406
+ rename: (e, t) => new Promise(r => {
407
+ fs.rename(e, t, s => {
408
+ r({
409
+ oldPath: e,
410
+ newPath: t,
411
+ error: s,
412
+ oldDirs: [],
413
+ oldFiles: [],
414
+ newDirs: [],
415
+ newFiles: [],
416
+ renamed: [],
417
+ isFile: !1,
418
+ isDirectory: !1
419
+ });
420
+ });
421
+ }),
422
+ resolvePath: e => normalizePath(e),
423
+ rmdir: (e, t) => new Promise(r => {
424
+ t && t.recursive ? fs.rmdir(e, {
425
+ recursive: !0
426
+ }, t => {
427
+ r({
428
+ basename: path.basename(e),
429
+ dirname: path.dirname(e),
430
+ path: e,
431
+ removedDirs: [],
432
+ removedFiles: [],
433
+ error: t
434
+ });
435
+ }) : fs.rmdir(e, t => {
436
+ r({
437
+ basename: path.basename(e),
438
+ dirname: path.dirname(e),
439
+ path: e,
440
+ removedDirs: [],
441
+ removedFiles: [],
442
+ error: t
443
+ });
444
+ });
445
+ }),
446
+ rmdirSync(e, t) {
447
+ try {
448
+ return t && t.recursive ? fs.rmdirSync(e, {
449
+ recursive: !0
450
+ }) : fs.rmdirSync(e), {
451
+ basename: path.basename(e),
452
+ dirname: path.dirname(e),
453
+ path: e,
454
+ removedDirs: [],
455
+ removedFiles: [],
456
+ error: null
457
+ };
458
+ } catch (t) {
459
+ return {
460
+ basename: path.basename(e),
461
+ dirname: path.dirname(e),
462
+ path: e,
463
+ removedDirs: [],
464
+ removedFiles: [],
465
+ error: t
466
+ };
467
+ }
468
+ },
469
+ stat: e => new Promise(t => {
470
+ fs.stat(e, (e, r) => {
471
+ t(e ? void 0 : r);
472
+ });
473
+ }),
474
+ statSync(e) {
475
+ try {
476
+ return fs.statSync(e);
477
+ } catch (e) {}
478
+ },
479
+ tmpdir: () => os.tmpdir(),
480
+ unlink: e => new Promise(t => {
481
+ fs.unlink(e, r => {
482
+ t({
483
+ basename: path.basename(e),
484
+ dirname: path.dirname(e),
485
+ path: e,
486
+ error: r
487
+ });
488
+ });
489
+ }),
490
+ unlinkSync(e) {
491
+ const t = {
492
+ basename: path.basename(e),
493
+ dirname: path.dirname(e),
494
+ path: e,
495
+ error: null
496
+ };
497
+ try {
498
+ fs.unlinkSync(e);
499
+ } catch (e) {
500
+ t.error = e;
501
+ }
502
+ return t;
503
+ },
504
+ writeFile: (e, t) => new Promise(r => {
505
+ fs.writeFile(e, t, t => {
506
+ r({
507
+ path: e,
508
+ error: t
509
+ });
510
+ });
511
+ }),
512
+ writeFileSync(e, t) {
513
+ const r = {
514
+ path: e,
515
+ error: null
516
+ };
517
+ try {
518
+ fs.writeFileSync(e, t);
519
+ } catch (e) {
520
+ r.error = e;
521
+ }
522
+ return r;
523
+ },
524
+ generateContentHash(e, t) {
525
+ let r = crypto.createHash("sha1").update(e).digest("hex").toLowerCase();
526
+ return "number" == typeof t && (r = r.substr(0, t)), Promise.resolve(r);
527
+ },
528
+ copy: nodeCopyTasks,
529
+ details: {
530
+ cpuModel: (Array.isArray(n) && n.length > 0 ? n[0] && n[0].model : "") || "",
531
+ freemem: () => os.freemem(),
532
+ platform: "darwin" === i || "linux" === i ? i : "win32" === i ? "windows" : "",
533
+ release: os.release(),
534
+ totalmem: os.totalmem()
535
+ }
536
+ }, l = new NodeResolveModule;
537
+ return a.lazyRequire = new NodeLazyRequire(l, {
538
+ "@types/jest": [ "24.9.1", "25.2.3" ],
539
+ "@types/puppeteer": [ "1.19.0", "2.0.1" ],
540
+ jest: [ "24.9.0", "26.0.1" ],
541
+ "jest-cli": [ "24.9.0", "26.0.1" ],
542
+ pixelmatch: [ "4.0.2", "4.0.2" ],
543
+ puppeteer: [ "1.19.0", "2.1.1" ],
544
+ "puppeteer-core": [ "1.19.0", "2.1.1" ],
545
+ "workbox-build": [ "4.3.1", "4.3.1" ]
546
+ }), t.on("SIGINT", () => {
547
+ for (;;) {
548
+ const e = s.pop();
549
+ if ("function" != typeof e) break;
550
+ try {
551
+ e();
552
+ } catch (e) {}
553
+ }
554
+ }), a;
555
+ }
556
+
557
+ var symbols, ansiColors, create_1, fn, exit;
558
+
559
+ Object.defineProperty(exports, "__esModule", {
560
+ value: !0
561
+ });
562
+
563
+ const fs = _interopDefault(require("./graceful-fs.js")), path = _interopDefault(require("path")), util = require("util"), glob = _interopDefault(require("./glob.js")), os = require("os"), crypto = require("crypto"), cp = require("child_process"), events = require("events"), createTerminalLogger = e => {
564
+ let t = "info", r = null;
565
+ const s = [], n = e => {
566
+ if (e.length) {
567
+ const t = new Date, r = "[" + ("0" + t.getMinutes()).slice(-2) + ":" + ("0" + t.getSeconds()).slice(-2) + "." + Math.floor(t.getMilliseconds() / 1e3 * 10) + "]";
568
+ e[0] = p(r) + e[0].substr(r.length);
569
+ }
570
+ }, o = e => {
571
+ if (e.length) {
572
+ const t = "[ WARN ]";
573
+ e[0] = d(u(t)) + e[0].substr(t.length);
574
+ }
575
+ }, i = e => {
576
+ if (e.length) {
577
+ const t = "[ ERROR ]";
578
+ e[0] = d(c(t)) + e[0].substr(t.length);
579
+ }
580
+ }, a = e => {
581
+ if (e.length) {
582
+ const t = new Date, r = "[" + ("0" + t.getMinutes()).slice(-2) + ":" + ("0" + t.getSeconds()).slice(-2) + "." + Math.floor(t.getMilliseconds() / 1e3 * 10) + "]";
583
+ e[0] = h(r) + e[0].substr(r.length);
584
+ }
585
+ }, l = (t, n) => {
586
+ if (r) {
587
+ const r = new Date, o = ("0" + r.getHours()).slice(-2) + ":" + ("0" + r.getMinutes()).slice(-2) + ":" + ("0" + r.getSeconds()).slice(-2) + ".0" + Math.floor(r.getMilliseconds() / 1e3 * 10) + " " + ("000" + (e.memoryUsage() / 1e6).toFixed(1)).slice(-6) + "MB " + t + " " + n.join(", ");
588
+ s.push(o);
589
+ }
590
+ }, c = t => e.color(t, "red"), u = t => e.color(t, "yellow"), h = t => e.color(t, "cyan"), d = t => e.color(t, "bold"), p = t => e.color(t, "dim"), f = t => e.color(t, "bgRed"), g = e => LOG_LEVELS.indexOf(e) >= LOG_LEVELS.indexOf(t), m = (t, r, s) => {
591
+ var n, o;
592
+ let i = t.length - r + s - 1;
593
+ for (;t.length + INDENT.length > e.getColumns(); ) if (r > t.length - r + s && r > 5) t = t.substr(1),
594
+ r--; else {
595
+ if (!(i > 1)) break;
596
+ t = t.substr(0, t.length - 1), i--;
597
+ }
598
+ const a = [], l = Math.max(t.length, r + s);
599
+ for (n = 0; n < l; n++) o = t.charAt(n), n >= r && n < r + s && (o = f("" === o ? " " : o)),
600
+ a.push(o);
601
+ return a.join("");
602
+ }, y = e => e.trim().startsWith("//") ? p(e) : e.split(" ").map(e => JS_KEYWORDS.indexOf(e) > -1 ? h(e) : e).join(" "), b = e => {
603
+ let t = !0;
604
+ const r = [];
605
+ for (var s = 0; s < e.length; s++) {
606
+ const n = e.charAt(s);
607
+ ";" === n || "{" === n ? t = !0 : ".#,:}@$[]/*".indexOf(n) > -1 && (t = !1), t && "abcdefghijklmnopqrstuvwxyz-_".indexOf(n.toLowerCase()) > -1 ? r.push(h(n)) : r.push(n);
608
+ }
609
+ return r.join("");
610
+ };
611
+ return {
612
+ enableColors: e.enableColors,
613
+ emoji: e.emoji,
614
+ getLevel: () => t,
615
+ setLevel: e => t = e,
616
+ debug: (...t) => {
617
+ if (g("debug")) {
618
+ e.memoryUsage() > 0 && t.push(p(` MEM: ${(e.memoryUsage() / 1e6).toFixed(1)}MB`));
619
+ const r = wordWrap(t, e.getColumns());
620
+ a(r), console.log(r.join("\n"));
621
+ }
622
+ l("D", t);
623
+ },
624
+ info: (...t) => {
625
+ if (g("info")) {
626
+ const r = wordWrap(t, e.getColumns());
627
+ n(r), console.log(r.join("\n"));
628
+ }
629
+ l("I", t);
630
+ },
631
+ warn: (...t) => {
632
+ if (g("warn")) {
633
+ const r = wordWrap(t, e.getColumns());
634
+ o(r), console.warn("\n" + r.join("\n") + "\n");
635
+ }
636
+ l("W", t);
637
+ },
638
+ error: (...t) => {
639
+ for (let e = 0; e < t.length; e++) if (t[e] instanceof Error) {
640
+ const r = t[e];
641
+ t[e] = r.message, r.stack && (t[e] += "\n" + r.stack);
642
+ }
643
+ if (g("error")) {
644
+ const r = wordWrap(t, e.getColumns());
645
+ i(r), console.error("\n" + r.join("\n") + "\n");
646
+ }
647
+ l("E", t);
648
+ },
649
+ createTimeSpan: (t, r = !1, s) => {
650
+ const o = Date.now(), i = () => Date.now() - o, c = {
651
+ duration: i,
652
+ finish: (t, o, c, u) => {
653
+ const h = i();
654
+ let f;
655
+ return f = h > 1e3 ? "in " + (h / 1e3).toFixed(2) + " s" : parseFloat(h.toFixed(3)) > 0 ? "in " + h + " ms" : "in less than 1 ms",
656
+ ((t, r, s, o, i, c, u) => {
657
+ let h = t;
658
+ if (s && (h = e.color(t, s)), o && (h = d(h)), h += " " + p(r), c) {
659
+ if (g("debug")) {
660
+ const t = [ h ], r = e.memoryUsage();
661
+ r > 0 && t.push(p(` MEM: ${(r / 1e6).toFixed(1)}MB`));
662
+ const s = wordWrap(t, e.getColumns());
663
+ a(s), console.log(s.join("\n"));
664
+ }
665
+ l("D", [ `${t} ${r}` ]);
666
+ } else {
667
+ const s = wordWrap([ h ], e.getColumns());
668
+ n(s), console.log(s.join("\n")), l("I", [ `${t} ${r}` ]), u && u.push(`${t} ${r}`);
669
+ }
670
+ i && console.log("");
671
+ })(t, f, o, c, u, r, s), h;
672
+ }
673
+ };
674
+ return ((t, r, s) => {
675
+ const o = [ `${t} ${p("...")}` ];
676
+ if (r) {
677
+ if (g("debug")) {
678
+ e.memoryUsage() > 0 && o.push(p(` MEM: ${(e.memoryUsage() / 1e6).toFixed(1)}MB`));
679
+ const r = wordWrap(o, e.getColumns());
680
+ a(r), console.log(r.join("\n")), l("D", [ t + " ..." ]);
681
+ }
682
+ } else {
683
+ const r = wordWrap(o, e.getColumns());
684
+ n(r), console.log(r.join("\n")), l("I", [ t + " ..." ]), s && s.push(t + " ...");
685
+ }
686
+ })(t, r, s), c;
687
+ },
688
+ printDiagnostics: (r, s) => {
689
+ if (!r || 0 === r.length) return;
690
+ let l = [ "" ];
691
+ r.forEach(r => {
692
+ l = l.concat(((r, s) => {
693
+ const l = wordWrap([ r.messageText ], e.getColumns());
694
+ let c = "";
695
+ r.header && "Build Error" !== r.header && (c += r.header), "string" == typeof r.absFilePath && "string" != typeof r.relFilePath && ("string" != typeof s && (s = e.cwd()),
696
+ r.relFilePath = e.relativePath(s, r.absFilePath), r.relFilePath.includes("/") || (r.relFilePath = "./" + r.relFilePath));
697
+ let d = r.relFilePath;
698
+ return "string" != typeof d && (d = r.absFilePath), "string" == typeof d && (c.length > 0 && (c += ": "),
699
+ c += h(d), "number" == typeof r.lineNumber && r.lineNumber > -1 && (c += p(":"),
700
+ c += u("" + r.lineNumber), "number" == typeof r.columnNumber && r.columnNumber > -1 && (c += p(":"),
701
+ c += u("" + r.columnNumber)))), c.length > 0 && l.unshift(INDENT + c), l.push(""),
702
+ r.lines && r.lines.length && (prepareLines(r.lines).forEach(e => {
703
+ if (!isMeaningfulLine(e.text)) return;
704
+ let t = "";
705
+ for (e.lineNumber > -1 && (t = `L${e.lineNumber}: `); t.length < INDENT.length; ) t = " " + t;
706
+ let s = e.text;
707
+ e.errorCharStart > -1 && (s = m(s, e.errorCharStart, e.errorLength)), t = p(t),
708
+ "typescript" === r.language || "javascript" === r.language ? t += y(s) : "scss" === r.language || "css" === r.language ? t += b(s) : t += s,
709
+ l.push(t);
710
+ }), l.push("")), "error" === r.level ? i(l) : "warn" === r.level ? o(l) : "debug" === r.level ? a(l) : n(l),
711
+ null != r.debugText && "debug" === t && (l.push(r.debugText), a(wordWrap([ r.debugText ], e.getColumns()))),
712
+ l;
713
+ })(r, s));
714
+ }), console.log(l.join("\n"));
715
+ },
716
+ red: c,
717
+ green: t => e.color(t, "green"),
718
+ yellow: u,
719
+ blue: t => e.color(t, "blue"),
720
+ magenta: t => e.color(t, "magenta"),
721
+ cyan: h,
722
+ gray: t => e.color(t, "gray"),
723
+ bold: d,
724
+ dim: p,
725
+ bgRed: f,
726
+ setLogFilePath: e => r = e,
727
+ writeLogs: t => {
728
+ if (r) try {
729
+ l("F", [ "--------------------------------------" ]), e.writeLogs(r, s.join("\n"), t);
730
+ } catch (e) {}
731
+ s.length = 0;
732
+ }
733
+ };
734
+ }, LOG_LEVELS = [ "debug", "info", "warn", "error" ], wordWrap = (e, t) => {
735
+ const r = [], s = [];
736
+ e.forEach(e => {
737
+ null === e ? s.push("null") : void 0 === e ? s.push("undefined") : "string" == typeof e ? e.replace(/\s/gm, " ").split(" ").forEach(e => {
738
+ e.trim().length && s.push(e.trim());
739
+ }) : "number" == typeof e || "boolean" == typeof e || "function" == typeof e ? s.push(e.toString()) : Array.isArray(e) || Object(e) === e ? s.push(() => e.toString()) : s.push(e.toString());
740
+ });
741
+ let n = INDENT;
742
+ return s.forEach(e => {
743
+ r.length > 25 || ("function" == typeof e ? (n.trim().length && r.push(n), r.push(e()),
744
+ n = INDENT) : INDENT.length + e.length > t - 1 ? (n.trim().length && r.push(n),
745
+ r.push(INDENT + e), n = INDENT) : e.length + n.length > t - 1 ? (r.push(n), n = INDENT + e + " ") : n += e + " ");
746
+ }), n.trim().length && r.push(n), r.map(e => e.trimRight());
747
+ }, prepareLines = e => {
748
+ const t = JSON.parse(JSON.stringify(e));
749
+ for (let e = 0; e < 100; e++) {
750
+ if (!eachLineHasLeadingWhitespace(t)) return t;
751
+ for (let e = 0; e < t.length; e++) if (t[e].text = t[e].text.substr(1), t[e].errorCharStart--,
752
+ !t[e].text.length) return t;
753
+ }
754
+ return t;
755
+ }, eachLineHasLeadingWhitespace = e => {
756
+ if (!e.length) return !1;
757
+ for (var t = 0; t < e.length; t++) {
758
+ if (!e[t].text || e[t].text.length < 1) return !1;
759
+ const r = e[t].text.charAt(0);
760
+ if (" " !== r && "\t" !== r) return !1;
761
+ }
762
+ return !0;
763
+ }, isMeaningfulLine = e => !!e && (e = e.trim()).length > 0, JS_KEYWORDS = [ "abstract", "any", "as", "break", "boolean", "case", "catch", "class", "console", "const", "continue", "debugger", "declare", "default", "delete", "do", "else", "enum", "export", "extends", "false", "finally", "for", "from", "function", "get", "if", "import", "in", "implements", "Infinity", "instanceof", "let", "module", "namespace", "NaN", "new", "number", "null", "public", "private", "protected", "require", "return", "static", "set", "string", "super", "switch", "this", "throw", "try", "true", "type", "typeof", "undefined", "var", "void", "with", "while", "yield" ], INDENT = " ";
764
+
765
+ symbols = function createCommonjsModule(e, t, r) {
766
+ return e(r = {
767
+ path: t,
768
+ exports: {},
769
+ require: function(e, t) {
770
+ return function r() {
771
+ throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
772
+ }();
773
+ }
774
+ }, r.exports), r.exports;
775
+ }((function(e) {
776
+ const t = "Hyper" === process.env.TERM_PROGRAM, r = "win32" === process.platform, s = "linux" === process.platform, n = {
777
+ ballotDisabled: "☒",
778
+ ballotOff: "☐",
779
+ ballotOn: "☑",
780
+ bullet: "•",
781
+ bulletWhite: "◦",
782
+ fullBlock: "█",
783
+ heart: "❤",
784
+ identicalTo: "≡",
785
+ line: "─",
786
+ mark: "※",
787
+ middot: "·",
788
+ minus: "-",
789
+ multiplication: "×",
790
+ obelus: "÷",
791
+ pencilDownRight: "✎",
792
+ pencilRight: "✏",
793
+ pencilUpRight: "✐",
794
+ percent: "%",
795
+ pilcrow2: "❡",
796
+ pilcrow: "¶",
797
+ plusMinus: "±",
798
+ section: "§",
799
+ starsOff: "☆",
800
+ starsOn: "★",
801
+ upDownArrow: "↕"
802
+ }, o = Object.assign({}, n, {
803
+ check: "√",
804
+ cross: "×",
805
+ ellipsisLarge: "...",
806
+ ellipsis: "...",
807
+ info: "i",
808
+ question: "?",
809
+ questionSmall: "?",
810
+ pointer: ">",
811
+ pointerSmall: "»",
812
+ radioOff: "( )",
813
+ radioOn: "(*)",
814
+ warning: "‼"
815
+ }), i = Object.assign({}, n, {
816
+ ballotCross: "✘",
817
+ check: "✔",
818
+ cross: "✖",
819
+ ellipsisLarge: "⋯",
820
+ ellipsis: "…",
821
+ info: "ℹ",
822
+ question: "?",
823
+ questionFull: "?",
824
+ questionSmall: "﹖",
825
+ pointer: s ? "▸" : "❯",
826
+ pointerSmall: s ? "‣" : "›",
827
+ radioOff: "◯",
828
+ radioOn: "◉",
829
+ warning: "⚠"
830
+ });
831
+ e.exports = r && !t ? o : i, Reflect.defineProperty(e.exports, "common", {
832
+ enumerable: !1,
833
+ value: n
834
+ }), Reflect.defineProperty(e.exports, "windows", {
835
+ enumerable: !1,
836
+ value: o
837
+ }), Reflect.defineProperty(e.exports, "other", {
838
+ enumerable: !1,
839
+ value: i
840
+ });
841
+ }));
842
+
843
+ const ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g, create = () => {
844
+ const e = {
845
+ enabled: !0,
846
+ visible: !0,
847
+ styles: {},
848
+ keys: {}
849
+ };
850
+ "FORCE_COLOR" in process.env && (e.enabled = "0" !== process.env.FORCE_COLOR);
851
+ const t = (e, t, r) => "function" == typeof e ? e(t) : e.wrap(t, r), r = (r, s) => {
852
+ if ("" === r || null == r) return "";
853
+ if (!1 === e.enabled) return r;
854
+ if (!1 === e.visible) return "";
855
+ let n = "" + r, o = n.includes("\n"), i = s.length;
856
+ for (i > 0 && s.includes("unstyle") && (s = [ ...new Set([ "unstyle", ...s ]) ].reverse()); i-- > 0; ) n = t(e.styles[s[i]], n, o);
857
+ return n;
858
+ }, s = (t, s, n) => {
859
+ e.styles[t] = (e => {
860
+ let t = e.open = `[${e.codes[0]}m`, r = e.close = `[${e.codes[1]}m`, s = e.regex = new RegExp(`\\u001b\\[${e.codes[1]}m`, "g");
861
+ return e.wrap = (e, n) => {
862
+ e.includes(r) && (e = e.replace(s, r + t));
863
+ let o = t + e + r;
864
+ return n ? o.replace(/\r*\n/g, `${r}$&${t}`) : o;
865
+ }, e;
866
+ })({
867
+ name: t,
868
+ codes: s
869
+ }), (e.keys[n] || (e.keys[n] = [])).push(t), Reflect.defineProperty(e, t, {
870
+ configurable: !0,
871
+ enumerable: !0,
872
+ set(r) {
873
+ e.alias(t, r);
874
+ },
875
+ get() {
876
+ let s = e => r(e, s.stack);
877
+ return Reflect.setPrototypeOf(s, e), s.stack = this.stack ? this.stack.concat(t) : [ t ],
878
+ s;
879
+ }
880
+ });
881
+ };
882
+ return s("reset", [ 0, 0 ], "modifier"), s("bold", [ 1, 22 ], "modifier"), s("dim", [ 2, 22 ], "modifier"),
883
+ s("italic", [ 3, 23 ], "modifier"), s("underline", [ 4, 24 ], "modifier"), s("inverse", [ 7, 27 ], "modifier"),
884
+ s("hidden", [ 8, 28 ], "modifier"), s("strikethrough", [ 9, 29 ], "modifier"), s("black", [ 30, 39 ], "color"),
885
+ s("red", [ 31, 39 ], "color"), s("green", [ 32, 39 ], "color"), s("yellow", [ 33, 39 ], "color"),
886
+ s("blue", [ 34, 39 ], "color"), s("magenta", [ 35, 39 ], "color"), s("cyan", [ 36, 39 ], "color"),
887
+ s("white", [ 37, 39 ], "color"), s("gray", [ 90, 39 ], "color"), s("grey", [ 90, 39 ], "color"),
888
+ s("bgBlack", [ 40, 49 ], "bg"), s("bgRed", [ 41, 49 ], "bg"), s("bgGreen", [ 42, 49 ], "bg"),
889
+ s("bgYellow", [ 43, 49 ], "bg"), s("bgBlue", [ 44, 49 ], "bg"), s("bgMagenta", [ 45, 49 ], "bg"),
890
+ s("bgCyan", [ 46, 49 ], "bg"), s("bgWhite", [ 47, 49 ], "bg"), s("blackBright", [ 90, 39 ], "bright"),
891
+ s("redBright", [ 91, 39 ], "bright"), s("greenBright", [ 92, 39 ], "bright"), s("yellowBright", [ 93, 39 ], "bright"),
892
+ s("blueBright", [ 94, 39 ], "bright"), s("magentaBright", [ 95, 39 ], "bright"),
893
+ s("cyanBright", [ 96, 39 ], "bright"), s("whiteBright", [ 97, 39 ], "bright"), s("bgBlackBright", [ 100, 49 ], "bgBright"),
894
+ s("bgRedBright", [ 101, 49 ], "bgBright"), s("bgGreenBright", [ 102, 49 ], "bgBright"),
895
+ s("bgYellowBright", [ 103, 49 ], "bgBright"), s("bgBlueBright", [ 104, 49 ], "bgBright"),
896
+ s("bgMagentaBright", [ 105, 49 ], "bgBright"), s("bgCyanBright", [ 106, 49 ], "bgBright"),
897
+ s("bgWhiteBright", [ 107, 49 ], "bgBright"), e.ansiRegex = ANSI_REGEX, e.hasColor = e.hasAnsi = t => (e.ansiRegex.lastIndex = 0,
898
+ "string" == typeof t && "" !== t && e.ansiRegex.test(t)), e.alias = (t, s) => {
899
+ let n = "string" == typeof s ? e[s] : s;
900
+ if ("function" != typeof n) throw new TypeError("Expected alias to be the name of an existing color (string) or a function");
901
+ n.stack || (Reflect.defineProperty(n, "name", {
902
+ value: t
903
+ }), e.styles[t] = n, n.stack = [ t ]), Reflect.defineProperty(e, t, {
904
+ configurable: !0,
905
+ enumerable: !0,
906
+ set(r) {
907
+ e.alias(t, r);
908
+ },
909
+ get() {
910
+ let t = e => r(e, t.stack);
911
+ return Reflect.setPrototypeOf(t, e), t.stack = this.stack ? this.stack.concat(n.stack) : n.stack,
912
+ t;
913
+ }
914
+ });
915
+ }, e.theme = t => {
916
+ if (null === (r = t) || "object" != typeof r || Array.isArray(r)) throw new TypeError("Expected theme to be an object");
917
+ var r;
918
+ for (let r of Object.keys(t)) e.alias(r, t[r]);
919
+ return e;
920
+ }, e.alias("unstyle", t => "string" == typeof t && "" !== t ? (e.ansiRegex.lastIndex = 0,
921
+ t.replace(e.ansiRegex, "")) : ""), e.alias("noop", e => e), e.none = e.clear = e.noop,
922
+ e.stripColor = e.unstyle, e.symbols = symbols, e.define = s, e;
923
+ };
924
+
925
+ ansiColors = create(), create_1 = create, ansiColors.create = create_1;
926
+
927
+ const noop = () => {}, isString = e => "string" == typeof e, buildError = e => {
928
+ const t = {
929
+ level: "error",
930
+ type: "build",
931
+ header: "Build Error",
932
+ messageText: "build error",
933
+ relFilePath: null,
934
+ absFilePath: null,
935
+ lines: []
936
+ };
937
+ return e && e.push(t), t;
938
+ }, catchError = (e, t, r) => {
939
+ const s = {
940
+ level: "error",
941
+ type: "build",
942
+ header: "Build Error",
943
+ messageText: "build error",
944
+ relFilePath: null,
945
+ absFilePath: null,
946
+ lines: []
947
+ };
948
+ return isString(r) ? s.messageText = r : null != t && (null != t.stack ? s.messageText = t.stack.toString() : null != t.message ? s.messageText = t.message.toString() : s.messageText = t.toString()),
949
+ null == e || shouldIgnoreError(s.messageText) || e.push(s), s;
950
+ }, shouldIgnoreError = e => e === TASK_CANCELED_MSG, TASK_CANCELED_MSG = "task canceled", normalizePath = e => {
951
+ if ("string" != typeof e) throw new Error("invalid path to normalize");
952
+ e = normalizeSlashes(e.trim());
953
+ const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
954
+ return "" === o ? "." : "" === s && n && e.includes("/") && !n.startsWith(".") && !n.startsWith("@") ? "./" + o : o;
955
+ }, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
956
+ if (!Array.isArray(e) || 0 === e.length) return [];
957
+ const t = [ e[0] ];
958
+ for (let r = 1; r < e.length; r++) {
959
+ const s = e[r];
960
+ if (s && "." !== s) {
961
+ if (".." === s) if (t.length > 1) {
962
+ if (".." !== t[t.length - 1]) {
963
+ t.pop();
964
+ continue;
965
+ }
966
+ } else if (t[0]) continue;
967
+ t.push(s);
968
+ }
969
+ }
970
+ return t;
971
+ }, getRootLength = e => {
972
+ const t = getEncodedRootLength(e);
973
+ return t < 0 ? ~t : t;
974
+ }, getEncodedRootLength = e => {
975
+ if (!e) return 0;
976
+ const t = e.charCodeAt(0);
977
+ if (47 === t || 92 === t) {
978
+ if (e.charCodeAt(1) !== t) return 1;
979
+ const r = e.indexOf(47 === t ? "/" : "\\", 2);
980
+ return r < 0 ? e.length : r + 1;
981
+ }
982
+ if (isVolumeCharacter(t) && 58 === e.charCodeAt(1)) {
983
+ const t = e.charCodeAt(2);
984
+ if (47 === t || 92 === t) return 3;
985
+ if (2 === e.length) return 2;
986
+ }
987
+ const r = e.indexOf("://");
988
+ if (-1 !== r) {
989
+ const t = r + "://".length, s = e.indexOf("/", t);
990
+ if (-1 !== s) {
991
+ const n = e.slice(0, r), o = e.slice(t, s);
992
+ if ("file" === n && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(s + 1))) {
993
+ const t = getFileUrlVolumeSeparatorEnd(e, s + 2);
994
+ if (-1 !== t) {
995
+ if (47 === e.charCodeAt(t)) return ~(t + 1);
996
+ if (t === e.length) return ~t;
997
+ }
998
+ }
999
+ return ~(s + 1);
1000
+ }
1001
+ return ~e.length;
1002
+ }
1003
+ return 0;
1004
+ }, isVolumeCharacter = e => e >= 97 && e <= 122 || e >= 65 && e <= 90, getFileUrlVolumeSeparatorEnd = (e, t) => {
1005
+ const r = e.charCodeAt(t);
1006
+ if (58 === r) return t + 1;
1007
+ if (37 === r && 51 === e.charCodeAt(t + 1)) {
1008
+ const r = e.charCodeAt(t + 2);
1009
+ if (97 === r || 65 === r) return t + 3;
1010
+ }
1011
+ return -1;
1012
+ }, pathComponents = (e, t) => {
1013
+ const r = e.substring(0, t), s = e.substring(t).split("/"), n = s.length;
1014
+ return n > 0 && !s[n - 1] && s.pop(), [ r, ...s ];
1015
+ }, copyFile = util.promisify(fs.copyFile), mkdir = util.promisify(fs.mkdir), readdir = util.promisify(fs.readdir), readFile = util.promisify(fs.readFile), stat = util.promisify(fs.stat), ROOT_DIR = normalizePath(path.resolve("/")), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
1016
+
1017
+ fn = new Intl.Collator(0, {
1018
+ numeric: 1
1019
+ }).compare;
1020
+
1021
+ const ARROW = "→", BOX_TOP_LEFT = "╭", BOX_TOP_RIGHT = "╮", BOX_BOTTOM_LEFT = "╰", BOX_BOTTOM_RIGHT = "╯", BOX_VERTICAL = "│", BOX_HORIZONTAL = "─", PADDING = 2, INDENT$1 = " ";
1022
+
1023
+ exit = function e(t, r) {
1024
+ function s() {
1025
+ n === r.length && process.exit(t);
1026
+ }
1027
+ r || (r = [ process.stdout, process.stderr ]);
1028
+ var n = 0;
1029
+ r.forEach((function(e) {
1030
+ 0 === e.bufferSize ? n++ : e.write("", "utf-8", (function() {
1031
+ n++, s();
1032
+ })), e.write = function() {};
1033
+ })), s(), process.on("exit", (function() {
1034
+ process.exit(t);
1035
+ }));
1036
+ };
1037
+
1038
+ class NodeLazyRequire {
1039
+ constructor(e, t) {
1040
+ this.nodeResolveModule = e, this.lazyDependencies = t, this.moduleData = new Map;
1041
+ }
1042
+ async ensure(e, t, r) {
1043
+ const s = [];
1044
+ let n = !1;
1045
+ const o = r.map(async e => {
1046
+ const r = this.moduleData.get(e);
1047
+ if (r && r.fromDir && r.modulePath) return;
1048
+ const [o, i] = this.lazyDependencies[e];
1049
+ try {
1050
+ const r = this.nodeResolveModule.resolveModule(t, e), s = await async function a(e) {
1051
+ const t = await readFile(e, "utf8");
1052
+ return JSON.parse(t);
1053
+ }(r);
1054
+ if (n = !0, semiver(s.version, o) >= 0) return void this.moduleData.set(e, {
1055
+ fromDir: t,
1056
+ modulePath: path.dirname(r)
1057
+ });
1058
+ } catch (e) {}
1059
+ s.push({
1060
+ moduleId: e,
1061
+ requiredVersionRange: i
1062
+ });
1063
+ });
1064
+ if (await Promise.all(o), 0 === s.length) return Promise.resolve();
1065
+ const i = `Please wait while required dependencies are ${n ? "updated" : "installed"}. This may take a few moments and will only be required for the initial run.`;
1066
+ e.info(e.magenta(i));
1067
+ const a = s.map(e => e.moduleId), l = e.createTimeSpan(`installing dependenc${a.length > 1 ? "ies" : "y"}: ${a.join(", ")}`);
1068
+ try {
1069
+ const r = s.map(e => {
1070
+ let t = e.moduleId;
1071
+ return e.requiredVersionRange && (t += "@" + e.requiredVersionRange), t;
1072
+ });
1073
+ await function c(e, t, r) {
1074
+ return new Promise((s, n) => {
1075
+ const o = [ "install", ...r, "--no-audit", "--save-exact", "--save-dev" ], i = {
1076
+ shell: !0,
1077
+ cwd: t,
1078
+ env: Object.assign({}, process.env)
1079
+ };
1080
+ i.env.NODE_ENV = "development", "debug" === e.getLevel() && o.push("--verbose"),
1081
+ e.debug("npm " + o.join(" ")), e.debug("npm, cwd: " + t);
1082
+ const a = cp.spawn("npm", o, i);
1083
+ let l = "";
1084
+ a.stdout && (a.stdout.setEncoding("utf8"), a.stdout.on("data", e => {
1085
+ l += e;
1086
+ })), a.stderr && (a.stderr.setEncoding("utf8"), a.stderr.on("data", e => {
1087
+ l += e;
1088
+ })), a.once("exit", t => {
1089
+ "debug" === e.getLevel() && e.debug("npm, exit " + t), 0 === t ? s() : n(`failed to install: ${r.join(", ")}${l ? ", " + l : ""}`);
1090
+ });
1091
+ });
1092
+ }(e, t, r), s.forEach(e => {
1093
+ this.moduleData.set(e.moduleId, {
1094
+ fromDir: t,
1095
+ modulePath: null
1096
+ });
1097
+ }), l.finish("installing dependencies finished");
1098
+ } catch (t) {
1099
+ e.error("lazy require failed: " + t);
1100
+ }
1101
+ }
1102
+ require(e) {
1103
+ const t = this.moduleData.get(e);
1104
+ if (!t) throw new Error("lazy required module has not been ensured: " + e);
1105
+ if (!t.modulePath) {
1106
+ const r = this.nodeResolveModule.resolveModule(t.fromDir, e);
1107
+ t.modulePath = path.dirname(r), this.moduleData.set(e, t);
1108
+ }
1109
+ return require(t.modulePath);
1110
+ }
1111
+ getModulePath(e) {
1112
+ const t = this.moduleData.get(e);
1113
+ if (!t) throw new Error("lazy required module has not been ensured: " + e);
1114
+ if (!t.modulePath) {
1115
+ const r = this.nodeResolveModule.resolveModule(t.fromDir, e);
1116
+ t.modulePath = path.dirname(r), this.moduleData.set(e, t);
1117
+ }
1118
+ return t.modulePath;
1119
+ }
1120
+ }
1121
+
1122
+ class NodeResolveModule {
1123
+ constructor() {
1124
+ this.resolveModuleCache = new Map;
1125
+ }
1126
+ resolveModule(e, t, r) {
1127
+ const s = `${e}:${t}`, n = this.resolveModuleCache.get(s);
1128
+ if (n) return n;
1129
+ if (r && r.manuallyResolve) return this.resolveModuleManually(e, t, s);
1130
+ if (t.startsWith("@types/")) return this.resolveTypesModule(e, t, s);
1131
+ const o = require("module");
1132
+ e = path.resolve(e);
1133
+ const i = path.join(e, "noop.js");
1134
+ let a = normalizePath(o._resolveFilename(t, {
1135
+ id: i,
1136
+ filename: i,
1137
+ paths: o._nodeModulePaths(e)
1138
+ }));
1139
+ const l = normalizePath(path.parse(e).root);
1140
+ let c;
1141
+ for (;a !== l; ) if (a = normalizePath(path.dirname(a)), c = path.join(a, "package.json"),
1142
+ fs.existsSync(c)) return this.resolveModuleCache.set(s, c), c;
1143
+ throw new Error(`error loading "${t}" from "${e}"`);
1144
+ }
1145
+ resolveTypesModule(e, t, r) {
1146
+ const s = t.split("/"), n = normalizePath(path.parse(e).root);
1147
+ let o, i = normalizePath(path.join(e, "noop.js"));
1148
+ for (;i !== n; ) if (i = normalizePath(path.dirname(i)), o = path.join(i, "node_modules", s[0], s[1], "package.json"),
1149
+ fs.existsSync(o)) return this.resolveModuleCache.set(r, o), o;
1150
+ throw new Error(`error loading "${t}" from "${e}"`);
1151
+ }
1152
+ resolveModuleManually(e, t, r) {
1153
+ const s = normalizePath(path.parse(e).root);
1154
+ let n, o = normalizePath(path.join(e, "noop.js"));
1155
+ for (;o !== s; ) if (o = normalizePath(path.dirname(o)), n = path.join(o, "node_modules", t, "package.json"),
1156
+ fs.existsSync(n)) return this.resolveModuleCache.set(r, n), n;
1157
+ throw new Error(`error loading "${t}" from "${e}"`);
1158
+ }
1159
+ }
1160
+
1161
+ class NodeWorkerMain extends events.EventEmitter {
1162
+ constructor(e, t) {
1163
+ super(), this.id = e, this.tasks = new Map, this.exitCode = null, this.processQueue = !0,
1164
+ this.sendQueue = [], this.stopped = !1, this.successfulMessage = !1, this.totalTasksAssigned = 0,
1165
+ this.fork(t);
1166
+ }
1167
+ fork(e) {
1168
+ const t = {
1169
+ execArgv: process.execArgv.filter(e => !/^--(debug|inspect)/.test(e)),
1170
+ env: process.env,
1171
+ cwd: process.cwd(),
1172
+ silent: !0
1173
+ };
1174
+ this.childProcess = cp.fork(e, [], t), this.childProcess.stdout.setEncoding("utf8"),
1175
+ this.childProcess.stdout.on("data", e => {
1176
+ console.log(e);
1177
+ }), this.childProcess.stderr.setEncoding("utf8"), this.childProcess.stderr.on("data", e => {
1178
+ console.log(e);
1179
+ }), this.childProcess.on("message", this.receiveFromWorker.bind(this)), this.childProcess.on("error", e => {
1180
+ this.emit("error", e);
1181
+ }), this.childProcess.once("exit", e => {
1182
+ this.exitCode = e, this.emit("exit", e);
1183
+ });
1184
+ }
1185
+ run(e) {
1186
+ this.totalTasksAssigned++, this.tasks.set(e.rindoId, e), this.sendToWorker({
1187
+ rindoId: e.rindoId,
1188
+ args: e.inputArgs
1189
+ });
1190
+ }
1191
+ sendToWorker(e) {
1192
+ this.processQueue ? this.childProcess.send(e, e => {
1193
+ if (!(e && e instanceof Error) && (this.processQueue = !0, this.sendQueue.length > 0)) {
1194
+ const e = this.sendQueue.slice();
1195
+ this.sendQueue = [], e.forEach(e => this.sendToWorker(e));
1196
+ }
1197
+ }) && !/^win/.test(process.platform) || (this.processQueue = !1) : this.sendQueue.push(e);
1198
+ }
1199
+ receiveFromWorker(e) {
1200
+ if (this.successfulMessage = !0, this.stopped) return;
1201
+ const t = this.tasks.get(e.rindoId);
1202
+ t ? (null != e.rindoRtnError ? t.reject(e.rindoRtnError) : t.resolve(e.rindoRtnValue),
1203
+ this.tasks.delete(e.rindoId), this.emit("response", e)) : null != e.rindoRtnError && this.emit("error", e.rindoRtnError);
1204
+ }
1205
+ stop() {
1206
+ this.stopped = !0, this.tasks.forEach(e => e.reject(TASK_CANCELED_MSG)), this.tasks.clear(),
1207
+ this.successfulMessage ? (this.childProcess.send({
1208
+ exit: !0
1209
+ }), setTimeout(() => {
1210
+ null === this.exitCode && this.childProcess.kill("SIGKILL");
1211
+ }, 100)) : this.childProcess.kill("SIGKILL");
1212
+ }
1213
+ }
1214
+
1215
+ class NodeWorkerController extends events.EventEmitter {
1216
+ constructor(e, t) {
1217
+ super(), this.forkModulePath = e, this.workerIds = 0, this.rindoId = 0, this.isEnding = !1,
1218
+ this.taskQueue = [], this.workers = [];
1219
+ const r = os.cpus().length;
1220
+ this.useForkedWorkers = t > 0, this.maxWorkers = Math.max(Math.min(t, r), 2) - 1,
1221
+ this.useForkedWorkers ? this.startWorkers() : this.mainThreadRunner = require(e);
1222
+ }
1223
+ onError(e, t) {
1224
+ if ("ERR_IPC_CHANNEL_CLOSED" === e.code) return this.stopWorker(t);
1225
+ "EPIPE" !== e.code && console.error(e);
1226
+ }
1227
+ onExit(e) {
1228
+ setTimeout(() => {
1229
+ let t = !1;
1230
+ const r = this.workers.find(t => t.id === e);
1231
+ r && (r.tasks.forEach(e => {
1232
+ e.retries++, this.taskQueue.unshift(e), t = !0;
1233
+ }), r.tasks.clear()), this.stopWorker(e), t && this.processTaskQueue();
1234
+ }, 10);
1235
+ }
1236
+ startWorkers() {
1237
+ for (;this.workers.length < this.maxWorkers; ) this.startWorker();
1238
+ }
1239
+ startWorker() {
1240
+ const e = this.workerIds++, t = new NodeWorkerMain(e, this.forkModulePath);
1241
+ t.on("response", this.processTaskQueue.bind(this)), t.once("exit", () => {
1242
+ this.onExit(e);
1243
+ }), t.on("error", t => {
1244
+ this.onError(t, e);
1245
+ }), this.workers.push(t);
1246
+ }
1247
+ stopWorker(e) {
1248
+ const t = this.workers.find(t => t.id === e);
1249
+ if (t) {
1250
+ t.stop();
1251
+ const e = this.workers.indexOf(t);
1252
+ e > -1 && this.workers.splice(e, 1);
1253
+ }
1254
+ }
1255
+ processTaskQueue() {
1256
+ if (!this.isEnding) for (this.useForkedWorkers && this.startWorkers(); this.taskQueue.length > 0; ) {
1257
+ const e = getNextWorker(this.workers);
1258
+ if (!e) break;
1259
+ e.run(this.taskQueue.shift());
1260
+ }
1261
+ }
1262
+ send(...e) {
1263
+ return this.isEnding ? Promise.reject(TASK_CANCELED_MSG) : this.useForkedWorkers ? new Promise((t, r) => {
1264
+ const s = {
1265
+ rindoId: this.rindoId++,
1266
+ inputArgs: e,
1267
+ retries: 0,
1268
+ resolve: t,
1269
+ reject: r
1270
+ };
1271
+ this.taskQueue.push(s), this.processTaskQueue();
1272
+ }) : this.mainThreadRunner[e[0]].apply(null, e.slice(1));
1273
+ }
1274
+ handler(e) {
1275
+ return (...t) => this.send(e, ...t);
1276
+ }
1277
+ cancelTasks() {
1278
+ for (const e of this.workers) e.tasks.forEach(e => e.reject(TASK_CANCELED_MSG)),
1279
+ e.tasks.clear();
1280
+ this.taskQueue.length = 0;
1281
+ }
1282
+ destroy() {
1283
+ if (!this.isEnding) {
1284
+ this.isEnding = !0;
1285
+ for (const e of this.taskQueue) e.reject(TASK_CANCELED_MSG);
1286
+ this.taskQueue.length = 0;
1287
+ const e = this.workers.map(e => e.id);
1288
+ for (const t of e) this.stopWorker(t);
1289
+ }
1290
+ }
1291
+ }
1292
+
1293
+ exports.createNodeLogger = e => {
1294
+ let t = !0;
1295
+ const r = e.process, s = createTerminalLogger({
1296
+ color: (e, r) => t ? ansiColors[r](e) : e,
1297
+ cwd: () => r.cwd(),
1298
+ emoji: e => "win32" !== r.platform ? e : "",
1299
+ enableColors: e => t = e,
1300
+ getColumns: () => {
1301
+ const e = r.stdout && r.stdout.columns || 80;
1302
+ return Math.max(Math.min(120, e), 60);
1303
+ },
1304
+ memoryUsage: () => r.memoryUsage().rss,
1305
+ relativePath: (e, t) => path.relative(e, t),
1306
+ writeLogs: (e, t, r) => {
1307
+ if (r) try {
1308
+ fs.accessSync(e);
1309
+ } catch (e) {
1310
+ r = !1;
1311
+ }
1312
+ r ? fs.appendFileSync(e, t) : fs.writeFileSync(e, t);
1313
+ }
1314
+ });
1315
+ return s.createLineUpdater = async () => {
1316
+ const e = await Promise.resolve().then((function() {
1317
+ return _interopNamespace(require("readline"));
1318
+ }));
1319
+ let t = Promise.resolve();
1320
+ const s = s => (s = s.substr(0, r.stdout.columns - 5) + "", t = t.then(() => new Promise(t => {
1321
+ e.clearLine(r.stdout, 0), e.cursorTo(r.stdout, 0, null), r.stdout.write(s, t);
1322
+ })));
1323
+ return r.stdout.write("[?25l"), {
1324
+ update: s,
1325
+ stop: () => s("[?25h")
1326
+ };
1327
+ }, s;
1328
+ }, exports.createNodeSys = function createNodeSys(e = {}) {
1329
+ const t = createNodeSysNoWatch(e), r = require("typescript"), s = r.sys.watchFile, n = r.sys.watchDirectory;
1330
+ return t.watchTimeout = 80, t.events = (() => {
1331
+ const e = [], t = t => {
1332
+ const r = e.findIndex(e => e.callback === t);
1333
+ return r > -1 && (e.splice(r, 1), !0);
1334
+ };
1335
+ return {
1336
+ emit: (t, r) => {
1337
+ const s = t.toLowerCase().trim(), n = e.slice();
1338
+ for (const e of n) if (null == e.eventName) try {
1339
+ e.callback(t, r);
1340
+ } catch (e) {
1341
+ console.error(e);
1342
+ } else if (e.eventName === s) try {
1343
+ e.callback(r);
1344
+ } catch (e) {
1345
+ console.error(e);
1346
+ }
1347
+ },
1348
+ on: (r, s) => {
1349
+ if ("function" == typeof r) {
1350
+ const s = null, n = r;
1351
+ return e.push({
1352
+ eventName: s,
1353
+ callback: n
1354
+ }), () => t(n);
1355
+ }
1356
+ if ("string" == typeof r && "function" == typeof s) {
1357
+ const n = r.toLowerCase().trim(), o = s;
1358
+ return e.push({
1359
+ eventName: n,
1360
+ callback: o
1361
+ }), () => t(o);
1362
+ }
1363
+ return () => !1;
1364
+ },
1365
+ unsubscribeAll: () => {
1366
+ e.length = 0;
1367
+ }
1368
+ };
1369
+ })(), t.watchDirectory = (e, r, s) => {
1370
+ const o = n(e, e => {
1371
+ e = normalizePath(e), r(e, null);
1372
+ }, s), i = () => {
1373
+ o.close();
1374
+ };
1375
+ return t.addDestory(i), {
1376
+ close() {
1377
+ t.removeDestory(i), o.close();
1378
+ }
1379
+ };
1380
+ }, t.watchFile = (e, n) => {
1381
+ const o = s(e, (e, s) => {
1382
+ e = normalizePath(e), s === r.FileWatcherEventKind.Created ? (n(e, "fileAdd"), t.events.emit("fileAdd", e)) : s === r.FileWatcherEventKind.Changed ? (n(e, "fileUpdate"),
1383
+ t.events.emit("fileUpdate", e)) : s === r.FileWatcherEventKind.Deleted && (n(e, "fileDelete"),
1384
+ t.events.emit("fileDelete", e));
1385
+ }), i = () => {
1386
+ o.close();
1387
+ };
1388
+ return t.addDestory(i), {
1389
+ close() {
1390
+ t.removeDestory(i), o.close();
1391
+ }
1392
+ };
1393
+ }, t;
1394
+ }, exports.createNodeSysNoWatch = createNodeSysNoWatch, exports.setupNodeProcess = function setupNodeProcess(e) {
1395
+ e.process.on("unhandledRejection", t => {
1396
+ if (!shouldIgnoreError(t)) {
1397
+ let r = "unhandledRejection";
1398
+ null != t && ("string" == typeof t ? r += ": " + t : t.stack ? r += ": " + t.stack : t.message && (r += ": " + t.message)),
1399
+ e.logger.error(r);
1400
+ }
1401
+ });
1402
+ };