Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed May 25, 2024
1 parent a8e9dd0 commit 7284cfc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/docs/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Initialize a converter, then use it to `compress` URIs to CURIEs, or `expand` CU
main();
```

This is not required when running JavaScript code on server-side, e.g. using NodeJS.

!!! danger "CORS exists"

When executing JS in the browser we are bound to the same rules as everyone on the web, such as CORS. If CORS are not enabled on the server you are fetching the converter from, then you will need to use a proxy such as [corsproxy.io](https://corsproxy.io).
Expand Down
23 changes: 22 additions & 1 deletion scripts/test-r.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,30 @@ for arg in "$@"; do
fi
done

# TODO: we still need to figure out how to properly install R dependencies in a way that is stable and does not depend on user config
# By default R installs packages in /usr/local/lib/R/site-library, which requires sudo...

# A proposed solution is to override an env variable like R_LIBS_USER=~/R_libs, but that does not look stable
# And it is not serious to ask all potential users to set this variable in their environment
# Crazy idea: R should automatically install the packages in a local hidden folder for this project
# Otherwise we can also just chown or chmod the whole R/site-library directory, but that's not safe

# The commands below have been working on Ubuntu and MacOS the past months, but on new Ubuntu setup it fails even when permissions are fixed (nice reproducibility)
# > ERROR: dependencies ‘usethis’, ‘pkgdown’, ‘rcmdcheck’, ‘rversions’, ‘urlchecker’ are not available for package ‘devtools’

# R installed with: sudo apt install r-base r-base-dev


if [ "$INSTALL_DEPS" = true ]; then
Rscript -e 'required_packages <- c("usethis", "devtools", "testthat", "rextendr"); install.packages(required_packages, repos="http://cran.r-project.org")'
echo "☕️ Get yourself a coffee, installing R packages is the slowest process I have ever seen."
echo "Apparently R does not install packages, it rebuilds all of them from scratch calling CMake and other stuff."
echo "If facing issues related to the installation directory permissions use:"
echo 'sudo chown -R $(id -u):$(id -g) /usr/local/lib/R/site-library/'
Rscript -e 'install.packages(c("usethis", "devtools", "testthat", "rextendr"), repos="http://cran.r-project.org")'
# Rscript -e 'required_packages <- c("usethis", "devtools", "testthat", "rextendr"); install.packages(required_packages, repos="http://cran.r-project.org")'
# Rscript --save -e 'required_packages <- c("usethis", "devtools", "testthat", "rextendr"); install.packages(required_packages, repos="http://cran.r-project.org", dependencies=TRUE)'
fi



Rscript -e 'rextendr::document("./r"); library(testthat); test_dir("r/tests");'

0 comments on commit 7284cfc

Please sign in to comment.