@eagleoutice/flowr 2.13.16 → 2.14.1

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 (253) hide show
  1. package/README.md +36 -25
  2. package/abstract-interpretation/absint-visitor.js +1 -1
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  4. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
  5. package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
  6. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
  7. package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
  8. package/abstract-interpretation/data-frame/resolve-args.js +10 -5
  9. package/benchmark/calibration.d.ts +16 -7
  10. package/benchmark/calibration.js +44 -17
  11. package/benchmark/slicer.d.ts +3 -2
  12. package/benchmark/slicer.js +9 -5
  13. package/benchmark/stats/size-of.js +1 -1
  14. package/benchmark/summarizer/first-phase/process.d.ts +2 -0
  15. package/benchmark/summarizer/first-phase/process.js +2 -0
  16. package/cli/benchmark-app.js +4 -1
  17. package/cli/benchmark-helper-app.d.ts +1 -0
  18. package/cli/benchmark-helper-app.js +2 -2
  19. package/cli/common/options.d.ts +5 -31
  20. package/cli/common/options.js +2 -8
  21. package/cli/common/scripts-info.d.ts +5 -38
  22. package/cli/common/scripts-info.js +0 -8
  23. package/cli/repl/core.js +1 -1
  24. package/cli/repl/execute.d.ts +2 -2
  25. package/cli/repl/execute.js +2 -2
  26. package/cli/repl/parser/slice-query-parser.js +1 -1
  27. package/cli/repl/print-version.js +2 -2
  28. package/config.d.ts +16 -0
  29. package/config.js +83 -5
  30. package/control-flow/extract-cfg.js +1 -1
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  32. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  33. package/control-flow/useless-loop.js +1 -1
  34. package/core/print/slice-diff-ansi.js +1 -1
  35. package/core/steps/pipeline/create-pipeline.js +1 -1
  36. package/dataflow/cluster.js +2 -2
  37. package/dataflow/environments/apply-kill.js +1 -1
  38. package/dataflow/environments/built-in-props.d.ts +13 -2
  39. package/dataflow/environments/built-in-props.js +23 -1
  40. package/dataflow/environments/built-in.d.ts +7 -1
  41. package/dataflow/environments/built-in.js +42 -3
  42. package/dataflow/environments/default-builtin-config.d.ts +518 -11
  43. package/dataflow/environments/default-builtin-config.js +218 -23
  44. package/dataflow/environments/environment.d.ts +10 -2
  45. package/dataflow/environments/environment.js +25 -7
  46. package/dataflow/environments/identifier.d.ts +8 -2
  47. package/dataflow/environments/identifier.js +6 -1
  48. package/dataflow/environments/query-fn-props.d.ts +6 -0
  49. package/dataflow/environments/query-fn-props.js +22 -2
  50. package/dataflow/environments/reference-to-maybe.js +5 -5
  51. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  52. package/dataflow/environments/resolve-by-name.js +44 -7
  53. package/dataflow/environments/resolve-helper.d.ts +6 -0
  54. package/dataflow/environments/resolve-helper.js +6 -0
  55. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  56. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  57. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  58. package/dataflow/eval/resolve/node-value.js +15 -9
  59. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  60. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  61. package/dataflow/eval/resolve/resolve-operators.js +5 -4
  62. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  63. package/dataflow/eval/resolve/resolve-working-directory.d.ts +1 -1
  64. package/dataflow/eval/resolve/resolve-working-directory.js +3 -3
  65. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  66. package/dataflow/eval/resolve/resolve.js +10 -11
  67. package/dataflow/eval/values/general.d.ts +4 -1
  68. package/dataflow/eval/values/general.js +1 -1
  69. package/dataflow/extractor.js +2 -1
  70. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  71. package/dataflow/fn/exceptions-of-function.js +87 -39
  72. package/dataflow/fn/higher-order-function.js +5 -4
  73. package/dataflow/fn/strict-function.d.ts +40 -0
  74. package/dataflow/fn/strict-function.js +337 -0
  75. package/dataflow/graph/call-graph.js +14 -14
  76. package/dataflow/graph/df-helper.d.ts +24 -1
  77. package/dataflow/graph/df-helper.js +29 -7
  78. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  79. package/dataflow/graph/edge.d.ts +27 -0
  80. package/dataflow/graph/edge.js +33 -0
  81. package/dataflow/graph/graph-helper.d.ts +3 -4
  82. package/dataflow/graph/graph-helper.js +4 -5
  83. package/dataflow/graph/graph.d.ts +39 -3
  84. package/dataflow/graph/graph.js +75 -7
  85. package/dataflow/graph/vertex.d.ts +42 -6
  86. package/dataflow/graph/vertex.js +42 -6
  87. package/dataflow/info.d.ts +26 -0
  88. package/dataflow/info.js +28 -1
  89. package/dataflow/internal/linker.d.ts +1 -0
  90. package/dataflow/internal/linker.js +11 -9
  91. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  92. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  94. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  96. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  97. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  98. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  99. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  100. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  101. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  102. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  103. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  104. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  107. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -0
  108. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +29 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  110. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  111. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  113. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +44 -20
  114. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  115. package/dataflow/internal/process/functions/call/common.js +17 -6
  116. package/dataflow/internal/process/functions/call/deferred.js +2 -1
  117. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  118. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  119. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  120. package/dataflow/internal/process/functions/call/nse.d.ts +33 -5
  121. package/dataflow/internal/process/functions/call/nse.js +113 -6
  122. package/dataflow/internal/process/functions/call/quoted.d.ts +5 -0
  123. package/dataflow/internal/process/functions/call/quoted.js +21 -9
  124. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  125. package/dataflow/origin/dfg-get-origin.js +9 -6
  126. package/documentation/data/faq/faqs.js +88 -88
  127. package/documentation/data/faq/recommended-configs.js +1 -1
  128. package/documentation/data/faq/wiki-faq-store.js +1 -1
  129. package/documentation/doc-capabilities.js +1 -1
  130. package/documentation/doc-readme.js +1 -1
  131. package/documentation/doc-util/doc-auto-gen.js +6 -2
  132. package/documentation/doc-util/doc-functions.js +1 -1
  133. package/documentation/wiki-cfg.js +2 -2
  134. package/documentation/wiki-core.js +1 -1
  135. package/documentation/wiki-create-linting-rules.js +45 -45
  136. package/documentation/wiki-dataflow-graph.js +18 -18
  137. package/documentation/wiki-linter.js +1 -0
  138. package/documentation/wiki-linting-and-testing.js +93 -5
  139. package/documentation/wiki-mk/doc-maker.js +1 -1
  140. package/documentation/wiki-overview.js +12 -1
  141. package/documentation/wiki-query.js +53 -0
  142. package/documentation/wiki-signature-database.js +3 -0
  143. package/linter/linter-output.js +1 -1
  144. package/linter/linter-rules.d.ts +24 -0
  145. package/linter/linter-rules.js +3 -1
  146. package/linter/rules/file-path-validity.js +1 -1
  147. package/linter/rules/function-finder-util.js +1 -1
  148. package/linter/rules/naming-convention.js +1 -1
  149. package/linter/rules/network-functions.d.ts +1 -1
  150. package/linter/rules/no-leaked-credentials.js +2 -1
  151. package/linter/rules/stop-with-call-arg.js +4 -4
  152. package/linter/rules/unclosed-connection.d.ts +44 -0
  153. package/linter/rules/unclosed-connection.js +200 -0
  154. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  155. package/linter/rules/undefined-symbol-util.js +5 -4
  156. package/linter/rules/undefined-symbol.js +3 -3
  157. package/linter/rules/unused-definition.js +2 -1
  158. package/package.json +38 -51
  159. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  160. package/project/context/flowr-analyzer-environment-context.js +25 -0
  161. package/project/dependency-version-space.d.ts +3 -3
  162. package/project/dependency-version-space.js +3 -4
  163. package/project/flowr-analyzer.js +1 -1
  164. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
  165. package/project/plugins/file-plugins/files/flowr-description-file.js +1 -1
  166. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
  167. package/project/plugins/file-plugins/files/flowr-namespace-file.js +1 -1
  168. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +1 -1
  169. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -1
  170. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +1 -1
  171. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -4
  172. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  173. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +5 -5
  174. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +36 -7
  175. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -2
  176. package/project/sigdb/build.js +16 -16
  177. package/project/sigdb/codec.d.ts +1 -1
  178. package/project/sigdb/codec.js +13 -13
  179. package/project/sigdb/decompress.d.ts +1 -1
  180. package/project/sigdb/decompress.js +33 -33
  181. package/project/sigdb/index-format.js +2 -2
  182. package/project/sigdb/manifest.d.ts +3 -1
  183. package/project/sigdb/manifest.js +68 -27
  184. package/project/sigdb/memory-source.d.ts +64 -0
  185. package/project/sigdb/memory-source.js +133 -0
  186. package/project/sigdb/reader.js +14 -14
  187. package/project/sigdb/schema.d.ts +2 -2
  188. package/project/sigdb/schema.js +2 -2
  189. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  190. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  191. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  192. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  193. package/queries/catalog/dependencies-query/link-devices.js +3 -9
  194. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  195. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  196. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -1
  197. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -0
  198. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +6 -0
  199. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +25 -0
  200. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +31 -0
  201. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +56 -0
  202. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  203. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  204. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  205. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  206. package/queries/catalog/slice-query-options.d.ts +1 -1
  207. package/queries/catalog/slice-query-options.js +1 -1
  208. package/queries/query-function-filter.d.ts +8 -2
  209. package/queries/query-function-filter.js +11 -1
  210. package/queries/query.d.ts +11 -1
  211. package/queries/query.js +2 -0
  212. package/r-bridge/lang-4.x/ast/model/model.d.ts +4 -4
  213. package/r-bridge/lang-4.x/ast/model/model.js +4 -4
  214. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  215. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  216. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  217. package/r-bridge/retriever.d.ts +2 -1
  218. package/r-bridge/retriever.js +3 -2
  219. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  220. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  221. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  222. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  223. package/search/flowr-search-filters.d.ts +1 -1
  224. package/search/flowr-search-filters.js +2 -14
  225. package/search/search-executor/search-enrichers.js +4 -4
  226. package/search/search-executor/search-generators.js +1 -1
  227. package/slicing/criterion/parse.d.ts +2 -2
  228. package/slicing/criterion/parse.js +5 -5
  229. package/slicing/static/fingerprint.js +1 -1
  230. package/slicing/static/slice-call.d.ts +1 -1
  231. package/slicing/static/slice-call.js +2 -2
  232. package/slicing/static/static-slicer.js +4 -3
  233. package/util/assert.js +1 -1
  234. package/util/log.d.ts +4 -1
  235. package/util/log.js +15 -2
  236. package/util/logic.js +2 -2
  237. package/util/mermaid/cfg.js +1 -1
  238. package/util/mermaid/dfg.js +6 -6
  239. package/util/mermaid/mermaid.js +3 -1
  240. package/util/objects.d.ts +12 -0
  241. package/util/objects.js +48 -0
  242. package/util/quads.js +19 -6
  243. package/util/schema.js +2 -2
  244. package/util/simple-df/dfg-ascii.js +14 -3
  245. package/util/text/ansi.d.ts +2 -0
  246. package/util/text/ansi.js +8 -0
  247. package/util/text/name-rank.d.ts +29 -0
  248. package/util/text/name-rank.js +39 -0
  249. package/util/text/url-encoding.d.ts +15 -0
  250. package/util/text/url-encoding.js +59 -0
  251. package/util/version.js +1 -1
  252. package/cli/export-quads-app.d.ts +0 -7
  253. package/cli/export-quads-app.js +0 -44
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rankName = rankName;
4
+ /**
5
+ * Every rule beyond the match itself, as `points` and when they apply. A list rather than a run of
6
+ * conditions, so a rule can be read, weighed against its neighbours, or added without touching the rest.
7
+ */
8
+ const Adjustments = [
9
+ /* what was typed, exactly, always comes first; the same spelling in another case comes next */
10
+ [1200, ({ name, needle }) => name === needle],
11
+ [900, ({ name, needle }) => name !== needle && name.toLowerCase() === needle.toLowerCase()],
12
+ /* a real function from base R is what a reader usually means; a lone symbol almost never is */
13
+ [40, ({ name, baseR }) => baseR === true && name.length >= 3],
14
+ [-20, ({ variable }) => variable === true],
15
+ [-40, ({ name }) => name.length < 3],
16
+ /* `names<-` is the replacement form of `names`, and nobody reaches for it first */
17
+ [-35, ({ name }) => name.endsWith('<-')],
18
+ [-45, ({ name, needle }) => name.includes('.') && !needle.includes('.')],
19
+ /* `base` itself before the packages that merely ship with R */
20
+ [20, ({ base }) => base === true],
21
+ /* a name flowR recognises outranks a closer spelling it knows nothing about: typing `plot` should
22
+ offer `ggplot` before `plotH`, because one of them is a function people actually call */
23
+ [500, ({ known }) => known === true],
24
+ [-30, ({ s3 }) => s3 === true],
25
+ /* operators, punctuation, and SHOUTING names are rarely what someone is looking for */
26
+ [-60, ({ name }) => /^%.*%$/.test(name) || /^[^\w.]/.test(name)],
27
+ [-30, ({ name, needle }) => name === name.toUpperCase() && /[A-Z]/.test(name) && name !== needle],
28
+ [-400, ({ name }) => name.startsWith('.')]
29
+ ];
30
+ /** The points {@link NameRankInput} earns, higher being offered first. */
31
+ function rankName(of) {
32
+ const { name, needle, rank = 0, downloads = 0 } = of;
33
+ /* how well it matches comes first, then how short it is; popularity only settles what is left.
34
+ Length only matters against something typed: with an empty box it would rank `AIC` above `mean` */
35
+ const match = -rank * 150 - (needle ? name.length * 12 : 0)
36
+ + Math.min(Math.log10(downloads + 10), 8) * (needle ? 4 : 12);
37
+ return Adjustments.reduce((points, [worth, when]) => when(of) ? points + worth : points, match);
38
+ }
39
+ //# sourceMappingURL=name-rank.js.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Base64 for the pages flowR ships, which run in a browser and therefore have `btoa`/`atob` rather than
3
+ * node's `Buffer`. The url-safe pair is what lets the playground keep a script in its own address, so a
4
+ * link is the example.
5
+ */
6
+ /** bytes as base64 */
7
+ export declare function toBase64(bytes: Uint8Array): string;
8
+ /** text as base64 in the alphabet a url carries without escaping anything, padding dropped */
9
+ export declare function toBase64Url(text: string): string;
10
+ /** the inverse of {@link toBase64Url}, `undefined` for anything that is not what it produced */
11
+ export declare function fromBase64Url(text: string): string | undefined;
12
+ /** Text as short as it goes while staying a url: compressed when that helps, plain base64 when it does not. */
13
+ export declare function packForUrl(text: string): string;
14
+ /** The inverse of {@link packForUrl}, `undefined` for anything it did not produce. */
15
+ export declare function unpackFromUrl(payload: string): string | undefined;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toBase64 = toBase64;
4
+ exports.toBase64Url = toBase64Url;
5
+ exports.fromBase64Url = fromBase64Url;
6
+ exports.packForUrl = packForUrl;
7
+ exports.unpackFromUrl = unpackFromUrl;
8
+ const lz_string_1 = require("lz-string");
9
+ /**
10
+ * Base64 for the pages flowR ships, which run in a browser and therefore have `btoa`/`atob` rather than
11
+ * node's `Buffer`. The url-safe pair is what lets the playground keep a script in its own address, so a
12
+ * link is the example.
13
+ */
14
+ /** bytes as base64 */
15
+ function toBase64(bytes) {
16
+ let binary = '';
17
+ for (const byte of bytes) {
18
+ binary += String.fromCharCode(byte);
19
+ }
20
+ return btoa(binary);
21
+ }
22
+ /** text as base64 in the alphabet a url carries without escaping anything, padding dropped */
23
+ function toBase64Url(text) {
24
+ return toBase64(new TextEncoder().encode(text)).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, '');
25
+ }
26
+ /** the inverse of {@link toBase64Url}, `undefined` for anything that is not what it produced */
27
+ function fromBase64Url(text) {
28
+ try {
29
+ const binary = atob(text.replaceAll('-', '+').replaceAll('_', '/'));
30
+ return new TextDecoder('utf-8', { fatal: true }).decode(Uint8Array.from(binary, character => character.charCodeAt(0)));
31
+ }
32
+ catch {
33
+ return undefined; /* a link someone edited by hand */
34
+ }
35
+ }
36
+ /** Text as short as it goes while staying a url: compressed when that helps, plain base64 when it does not. */
37
+ function packForUrl(text) {
38
+ const plain = toBase64Url(text);
39
+ if (text.length === 0) {
40
+ return "t" /* Packing.Plain */ + plain;
41
+ }
42
+ const compressed = (0, lz_string_1.compressToEncodedURIComponent)(text);
43
+ return compressed.length < plain.length ? "z" /* Packing.Compressed */ + compressed : "t" /* Packing.Plain */ + plain;
44
+ }
45
+ /** The inverse of {@link packForUrl}, `undefined` for anything it did not produce. */
46
+ function unpackFromUrl(payload) {
47
+ const rest = payload.slice(1);
48
+ try {
49
+ switch (payload[0]) {
50
+ case "z" /* Packing.Compressed */: return (0, lz_string_1.decompressFromEncodedURIComponent)(rest) ?? undefined;
51
+ case "t" /* Packing.Plain */: return fromBase64Url(rest);
52
+ default: return undefined;
53
+ }
54
+ }
55
+ catch {
56
+ return undefined; /* a link someone edited by hand */
57
+ }
58
+ }
59
+ //# sourceMappingURL=url-encoding.js.map
package/util/version.js CHANGED
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
42
42
  const sigdb_download_1 = require("../project/sigdb/sigdb-download");
43
43
  const doc_files_1 = require("../documentation/doc-util/doc-files");
44
44
  // this is automatically replaced with the current version by release-it
45
- const version = '2.13.16';
45
+ const version = '2.14.1';
46
46
  // this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
47
47
  const versionDate = '2026-07-15T07:13:44Z';
48
48
  /**
@@ -1,7 +0,0 @@
1
- export interface QuadsCliOptions {
2
- verbose: boolean;
3
- help: boolean;
4
- input: string[];
5
- limit: number;
6
- output: string | undefined;
7
- }
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = __importDefault(require("fs"));
7
- const quads_1 = require("../util/quads");
8
- const log_1 = require("../util/log");
9
- const files_1 = require("../util/files");
10
- const script_1 = require("./common/script");
11
- const shell_1 = require("../r-bridge/shell");
12
- const retriever_1 = require("../r-bridge/retriever");
13
- const config_1 = require("../config");
14
- const options = (0, script_1.processCommandLineArgs)('export-quads', [], {
15
- subtitle: 'Generate RDF N-Quads from the AST of a given R script',
16
- examples: [
17
- '{bold -i} {italic example.R} {bold --output} {italic "example.quads"}',
18
- '{bold --help}'
19
- ]
20
- });
21
- const shell = new shell_1.RShell(config_1.FlowrConfig.getForEngine(config_1.FlowrConfig.fromFile(), 'r-shell'));
22
- async function writeQuadForSingleFile(request, output) {
23
- const normalized = await (0, retriever_1.retrieveNormalizedAstFromRCode)(request, shell);
24
- const serialized = (0, quads_1.serialize2quads)(normalized.ast.files[0].root, { context: request.content });
25
- log_1.log.info(`Appending quads to ${output}`);
26
- fs_1.default.appendFileSync(output, serialized);
27
- }
28
- async function getQuads() {
29
- const output = options.output ?? 'out.quads';
30
- let skipped = 0;
31
- for await (const request of (0, files_1.allRFilesFrom)(options.input, options.limit)) {
32
- try {
33
- await writeQuadForSingleFile(request, output);
34
- }
35
- catch (e) {
36
- log_1.log.error(`[Skipped] Error while processing ${request.content}: ${e.message} (${e.stack ?? ''})`);
37
- skipped++;
38
- }
39
- }
40
- console.log(`Skipped ${skipped} files`);
41
- shell.close();
42
- }
43
- void getQuads();
44
- //# sourceMappingURL=export-quads-app.js.map