UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

125 lines (90 loc) 5.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WikiSetup = void 0; const doc_maker_1 = require("./wiki-mk/doc-maker"); const doc_files_1 = require("./doc-util/doc-files"); const node_version_1 = require("../util/node-version"); /** * https://github.com/flowr-analysis/flowr/wiki/Setup */ class WikiSetup extends doc_maker_1.DocMaker { constructor() { super('wiki/Setup.md', module.filename, 'setup instructions'); } text({ ctx }) { return ` There are several ways to use _flowR_. You can download and build it from source, download the accompanying ${ctx.linkPage('flowr:docker', 'docker image')}, or use its ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')} and ${ctx.linkPage('flowr:rstudio-addin', 'RStudio Addin')}. - [🗒️ Using the Visual Studio Code Extension](#-using-the-visual-studio-code-extension) - [🗒️ Using the RStudio Addin](#-using-the-rstudio-addin) - [🐳️ Using the Docker Image](#-using-the-docker-image) - [⚒️ Building From Scratch](#-building-from-scratch) - [📜 Developing for _flowR_](#-developing-for-flowr) If you want to develop for _flowR_, you want to see how to [build from scratch](#-building-from-scratch) and have a look at the [Contributing Guidelines](${doc_files_1.RemoteFlowrFilePathBaseRef}.github/CONTRIBUTING.md). ## 🗒️ Using the Visual Studio Code Extension The easiest way to use _flowR_ is to install the ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')}. The extension directly includes a version of _flowR_ that can be used by default, so you can start analyzing code right away (given that you have R installed on your system). Please check out the marketplace entry for more information. This extension works with Positron as well (in general, it is available on ${ctx.linkPage('flowr:positron', 'open-vsx')} as well). ## 🗒️ Using the RStudio Addin You can also use _flowR_ as an RStudio Addin. Please check out the ${ctx.linkPage('flowr:rstudio-addin', 'RStudio Addin repository')} for more information on how to get started! ## 🐳️ Using the Docker Image You can get the image from ${ctx.linkPage('flowr:docker', 'docker hub')} by running: \`\`\`shell docker pull eagleoutice/flowr \`\`\` Afterward, you can test if the installation was successful by running the following (currently, there is no helper script for that): \`\`\`shell docker run -it --rm eagleoutice/flowr \`\`\` This should drop you into _flowR_'s read-evaluate-print loop. Enter ${ctx.replCmd('help')} to receive more information and ${ctx.replCmd('quit')} to leave. Please remember that you have to link external directories to make them available within the running container. To start flowr as a server, you can run: \`\`\`shell docker run -it --rm -p1042:1042 eagleoutice/flowr --server \`\`\` For more information, see the ${ctx.linkPage('wiki/Interface')} wiki page. ## ⚒️ Building From Scratch To use _flowR_, you may need [_R_](https://www.r-project.org/) installed and on your path (this only affects the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}, which is _not_ the default). ### Installing R Although there are several ways to do so, there is nothing wrong with installing&nbsp;R with the help of your favorite package manager or directly from the [website](https://cloud.r-project.org/).<a href="#note1" id="note1ref"><sup>&lt;1&gt;</sup></a> For 🪟&nbsp;Windows, see [here](https://www.hanss.info/sebastian/post/rtools-path/) for an explanation on how to add [_R_](https://www.r-project.org/) to your path variable. Again, you only require this for the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}. ### Installing Node.js Furthermore, you need the [node package manager](https://www.npmjs.com/) (for Linux, we recommend using [nvm](https://github.com/nvm-sh/nvm)). To work, we currently rely on node versions starting from \`${(0, node_version_1.minimumNodeMajor)()}.x\` (as declared by the \`engines.node\` field of the [package.json](${doc_files_1.RemoteFlowrFilePathBaseRef}package.json)). ### Installing _flowR_ After cloning the repository,<a href="#note2" id="note2ref"><sup>&lt;2&gt;</sup></a> you can install the dependencies with: \`\`\`shell npm i \`\`\` After that, you should be fine! You may test _flowR_'s command-line interface by running the following from the \`cli\` directory: \`\`\`shell npm run slicer -- --criterion "12@product" test/testfiles/example.R \`\`\` The output should look similar to this: \`\`\`R product <- 1 N <- 10 for(i in 1:(N-1)) product <- product * i cat("Product:", product, "\\n") \`\`\` At the time of writing this, there is currently no page for frequently encountered errors. So just [message me](mailto:florian.sihler@uni-ulm.de) in case of problems. ## 📜 Developing for _flowR_ If you want to develop for _flowR_, explore the wiki. For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}.github/CONTRIBUTING.md) in the repository. ### 📦 The Signature Database _flowR_ resolves \`library(pkg)\`/\`pkg::fn\` calls from a downloaded signature database (\`flowr-sigdb\`); no shards are committed (only the \`sigdb.remote.json\` pointer), everything else is fetched on demand &mdash; see the ${ctx.linkPage('wiki/Signature Database')} page. ----- <a id="note1" href="#note1ref">&lt;1&gt;</a>: Currently, _flowR_ is only tested with R versions \`4.x\` and \`3.6.x\`. <a id="note2" href="#note2ref">&lt;2&gt;</a>: We use [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}.github/CONTRIBUTING.md) in the repository for more information). `.trim(); } } exports.WikiSetup = WikiSetup; //# sourceMappingURL=wiki-setup.js.map