Skip to content

Commit 4cc1463

Browse files
committed
feat(wip): staging capabilities ws; mutations
1 parent 5059bc5 commit 4cc1463

94 files changed

Lines changed: 4266 additions & 2296 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/broken-links-and-wiki.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
# so the documentation job builds that one straight onto gh-pages instead
125125
FLOWR_LANDING_ONLY=1 npm run gen:landing
126126
# the signature browser is gitignored on purpose (megabytes); only the page and its samples are committed
127-
for LANDING in index.html wiki/landing/index.html; do
127+
for LANDING in index.html wiki/landing/index.html wiki/capabilities/index.html; do
128128
if [ -n "$(git status --porcelain -- "$LANDING")" ]; then CHANGED_FILES+=("$LANDING"); fi
129129
done
130130
# read in everything from /tmp/flowr-wiki-changed-files.txt and add to CHANGED_FILES

.github/workflows/scripts/run-flowr-command.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ if [ "$ACTION" == "doc" ]; then
159159
git add -f ".nojekyll" "$DOC_OUT/"
160160
if [ -d "wiki/stats/" ]; then git add -f "wiki/stats/"; fi
161161
git add -f "index.html"
162+
if [ -d "wiki/capabilities/" ]; then git add -f "wiki/capabilities/"; fi
162163
if [ -d "wiki/sigdb/" ]; then git add -f "wiki/sigdb/"; fi
163164
if [ -d "wiki/playground/" ]; then git add -f "wiki/playground/"; fi
164165
git commit -m "Update documentation"
@@ -167,7 +168,7 @@ if [ "$ACTION" == "doc" ]; then
167168
git checkout --orphan gh-pages-orphan-tmp
168169
git rm -r --cached . --quiet
169170
git add -f ".nojekyll" "$DOC_OUT/" "index.html"
170-
for extra in "wiki/img" "wiki/stats" "wiki/sigdb" "wiki/playground"; do
171+
for extra in "wiki/img" "wiki/stats" "wiki/capabilities" "wiki/sigdb" "wiki/playground"; do
171172
if [ -d "$extra" ]; then git add -f "$extra"; fi
172173
done
173174
git commit -m "Current documentation stage"

README.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ It offers a wide variety of features, for example:
5656

5757

5858
```text
59-
Query: linter (7 ms)
59+
Query: linter (27 ms)
6060
╰ Deprecated Functions (deprecated-functions): no findings
6161
╰ File Path Validity (file-path-validity): no findings
6262
╰ Seeded Randomness (seeded-randomness): no findings
@@ -74,7 +74,7 @@ It offers a wide variety of features, for example:
7474
╰ Unused Import (unused-import): no findings
7575
╰ Unclosed Connection (unclosed-connection): no findings
7676
╰ Unescaped Arguments (unescaped-arguments): no findings
77-
All queries together required ≈7 ms (1ms accuracy, total 7 ms)
77+
All queries together required ≈27 ms (1ms accuracy, total 28 ms)
7878
```
7979

8080

@@ -96,17 +96,17 @@ It offers a wide variety of features, for example:
9696
9797
_Results (prettified and summarized):_
9898
99-
Query: **linter** (10 ms)\
99+
Query: **linter** (60 ms)\
100100
   **Deprecated Functions** (deprecated-functions): _no findings_\
101101
   **File Path Validity** (file-path-validity):\
102102
       ╰ certain:\
103103
           ╰ Path `/root/x.txt` at 1.1-23\
104-
       ╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 1\
104+
       ╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 2\
105105
   **Seeded Randomness** (seeded-randomness): _no findings_\
106106
   **Absolute Paths** (absolute-file-paths):\
107107
       ╰ certain:\
108108
           ╰ Path `/root/x.txt` at 1.1-23\
109-
       ╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0\
109+
       ╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 1\
110110
   **Unused Definitions** (unused-definitions): _no findings_\
111111
   **Network Functions** (network-functions): _no findings_\
112112
   **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
@@ -120,18 +120,17 @@ It offers a wide variety of features, for example:
120120
   **Unused Import** (unused-import): _no findings_\
121121
   **Unclosed Connection** (unclosed-connection): _no findings_\
122122
   **Unescaped Arguments** (unescaped-arguments): _no findings_\
123-
_All queries together required ≈10 ms (1ms accuracy, total 11 ms)_
123+
_All queries together required ≈60 ms (1ms accuracy, total 62 ms)_
124124
125125
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
126126
127-
The analysis required _10.6 ms_ (including parsing and normalization and the query) within the generation environment.
127+
The analysis required _61.9 ms_ (including parsing and normalization and the query) within the generation environment.
128128
129129
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
130130
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
131131
132132
133133
134-
135134
```json
136135
{
137136
"linter": {
@@ -141,7 +140,7 @@ It offers a wide variety of features, for example:
141140
".meta": {
142141
"builtin": 0,
143142
"sigdb": 0,
144-
"searchTimeMs": 0,
143+
"searchTimeMs": 2,
145144
"processTimeMs": 1
146145
}
147146
},
@@ -165,7 +164,7 @@ It offers a wide variety of features, for example:
165164
"totalWritesBeforeAlways": 0,
166165
"totalValid": 0,
167166
"searchTimeMs": 1,
168-
"processTimeMs": 1
167+
"processTimeMs": 2
169168
}
170169
},
171170
"seeded-randomness": {
@@ -196,8 +195,8 @@ It offers a wide variety of features, for example:
196195
".meta": {
197196
"totalConsidered": 1,
198197
"totalUnknown": 0,
199-
"searchTimeMs": 0,
200-
"processTimeMs": 0
198+
"searchTimeMs": 1,
199+
"processTimeMs": 1
201200
}
202201
},
203202
"unused-definitions": {
@@ -214,7 +213,7 @@ It offers a wide variety of features, for example:
214213
"totalCalls": 0,
215214
"totalFunctionDefinitions": 0,
216215
"searchTimeMs": 0,
217-
"processTimeMs": 0
216+
"processTimeMs": 1
218217
}
219218
},
220219
"dataframe-access-validation": {
@@ -224,13 +223,13 @@ It offers a wide variety of features, for example:
224223
"numAccesses": 0,
225224
"totalAccessed": 0,
226225
"searchTimeMs": 0,
227-
"processTimeMs": 1
226+
"processTimeMs": 13
228227
}
229228
},
230229
"dead-code": {
231230
"results": [],
232231
".meta": {
233-
"searchTimeMs": 0,
232+
"searchTimeMs": 1,
234233
"processTimeMs": 0
235234
}
236235
},
@@ -239,7 +238,7 @@ It offers a wide variety of features, for example:
239238
".meta": {
240239
"numOfUselessLoops": 0,
241240
"searchTimeMs": 0,
242-
"processTimeMs": 0
241+
"processTimeMs": 4
243242
}
244243
},
245244
"problematic-inputs": {
@@ -285,7 +284,7 @@ It offers a wide variety of features, for example:
285284
"subscript": 0
286285
},
287286
"searchTimeMs": 0,
288-
"processTimeMs": 3
287+
"processTimeMs": 22
289288
}
290289
},
291290
"unused-import": {
@@ -295,7 +294,7 @@ It offers a wide variety of features, for example:
295294
"totalUnresolved": 0,
296295
"totalMultiPackage": 0,
297296
"totalUnused": 0,
298-
"searchTimeMs": 0,
297+
"searchTimeMs": 2,
299298
"processTimeMs": 0
300299
}
301300
},
@@ -313,17 +312,17 @@ It offers a wide variety of features, for example:
313312
".meta": {
314313
"totalCriticalArguments": 0,
315314
"totalEscapedArguments": 0,
316-
"searchTimeMs": 0,
317-
"processTimeMs": 1
315+
"searchTimeMs": 1,
316+
"processTimeMs": 2
318317
}
319318
}
320319
},
321320
".meta": {
322-
"timing": 10
321+
"timing": 60
323322
}
324323
},
325324
".meta": {
326-
"timing": 10
325+
"timing": 60
327326
}
328327
}
329328
```
@@ -403,7 +402,7 @@ It offers a wide variety of features, for example:
403402
N <- 10
404403
for(i in 1:(N-1)) sum <- sum + i + w
405404
sum
406-
All queries together required ≈3 ms (1ms accuracy, total 3 ms)
405+
All queries together required ≈17 ms (1ms accuracy, total 18 ms)
407406
```
408407
409408
@@ -765,7 +764,7 @@ It offers a wide variety of features, for example:
765764
```
766765
767766
768-
(The analysis required _3.4 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/Signature-Database) is mounted for these generated graphs, so `library()` calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. `acf` as `stats::acf`).)
767+
(The analysis required _7.7 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/Signature-Database) is mounted for these generated graphs, so `library()` calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. `acf` as `stats::acf`).)
769768
770769
771770

index.html

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"build:copy-data": "ts-node --transpile-only scripts/sigdb-copy.ts",
3333
"build:copy-wasm": "ts-node --transpile-only scripts/copy-wasm.ts",
3434
"gen:base-packages": "ts-node --transpile-only scripts/gen-base-packages.ts",
35-
"gen:landing": "ts-node --transpile-only scripts/gen-landing.ts && ts-node --transpile-only scripts/gen-benchmark-index.ts && ts-node --transpile-only scripts/gen-sigdb-index.ts && ts-node --transpile-only scripts/gen-playground.ts",
35+
"gen:landing": "ts-node --transpile-only scripts/gen-landing.ts && ts-node --transpile-only scripts/gen-benchmark-index.ts && ts-node --transpile-only scripts/gen-capabilities.ts && ts-node --transpile-only scripts/gen-sigdb-index.ts && ts-node --transpile-only scripts/gen-playground.ts",
3636
"sigdb:remote": "ts-node --transpile-only scripts/sigdb-remote.ts",
3737
"sigdb:sync": "ts-node --transpile-only scripts/sigdb-sync.ts",
3838
"sigdb:publish": "ts-node scripts/publish-sigdb.ts",

scripts/gen-capabilities.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Generates the capabilities page at `wiki/capabilities/index.html`, which is what flowR's documentation
3+
* points at whenever it says what flowR can and cannot do with R.
4+
*
5+
* The page is plain static HTML like the landing page. It carries every capability, the tests that demonstrate
6+
* it, and its example, which opens in the playground rather than running here.
7+
*/
8+
import path from 'path';
9+
import { template, writePage } from './html-page';
10+
import { TreeSitterExecutor } from '../src/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor';
11+
import { capabilitiesAsHtml } from '../src/documentation/doc-capabilities';
12+
13+
const Target = path.join('wiki', 'capabilities', 'index.html');
14+
15+
async function main(): Promise<void> {
16+
await TreeSitterExecutor.initTreeSitter();
17+
const { body, summary } = await capabilitiesAsHtml(new TreeSitterExecutor());
18+
const page = template('landing-capabilities-template.html')
19+
.replaceAll('<!--SUMMARY-->', `${summary.fully} of ${summary.total} features fully, ${summary.partially} partially and ${summary.not} not supported.`)
20+
.replace('<!--CAPABILITIES-->', body);
21+
console.log(` wrote ${Target} (${(writePage(Target, page) / 1024).toFixed(1)} kB)`);
22+
}
23+
24+
void main();

0 commit comments

Comments
 (0)