From 3331824de28b162d587fb7bf779c2c5f00e50627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 18 Sep 2024 15:31:47 +0200 Subject: [PATCH 001/157] Add minimal example --- NAMESPACE | 1 + R/dummyanalysis.R | 6 ++++++ inst/Description.qml | 9 ++++++++- inst/qml/DummyAnalysis.qml | 41 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 R/dummyanalysis.R create mode 100644 inst/qml/DummyAnalysis.qml diff --git a/NAMESPACE b/NAMESPACE index de016fe..9d9dbd2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1 +1,2 @@ import(jaspBase) +export(DummyAnalysis) diff --git a/R/dummyanalysis.R b/R/dummyanalysis.R new file mode 100644 index 0000000..afc7507 --- /dev/null +++ b/R/dummyanalysis.R @@ -0,0 +1,6 @@ +DummyAnalysis <- function(jaspResults, dataset, options) { + dummyTextDescriptives <- createJaspHtml(text = "Fixed text") + + jaspResults[["dummyTextsDescriptives"]] <- dummyTextDescriptives + return() +} \ No newline at end of file diff --git a/inst/Description.qml b/inst/Description.qml index 785abaf..a1e2c74 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -11,4 +11,11 @@ Description maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" -} + + Analysis + { + title: "Example" + func: "DummyAnalysis" + qml: "DummyAnalysis.qml" + } +} \ No newline at end of file diff --git a/inst/qml/DummyAnalysis.qml b/inst/qml/DummyAnalysis.qml new file mode 100644 index 0000000..446c70a --- /dev/null +++ b/inst/qml/DummyAnalysis.qml @@ -0,0 +1,41 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + VariablesForm + { + AvailableVariablesList + { + name: "allVariablesList" + } + + AssignedVariablesList + { + name: "myVariable" + title: qsTr("Chosen variable") + allowedColumns: ["scale"] + singleVariable: true + } + } +} \ No newline at end of file From edcedebb4d798c85a1de0144bc04f793cd8ae7e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 25 Sep 2024 12:34:09 +0200 Subject: [PATCH 002/157] Use examples instead of dummyanalysis --- NAMESPACE | 2 +- R/dummyanalysis.R | 6 ------ R/examples.R | 6 ++++++ inst/Description.qml | 7 ++++--- inst/qml/{DummyAnalysis.qml => examples.qml} | 0 5 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 R/dummyanalysis.R create mode 100644 R/examples.R rename inst/qml/{DummyAnalysis.qml => examples.qml} (100%) diff --git a/NAMESPACE b/NAMESPACE index 9d9dbd2..7559495 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,2 @@ import(jaspBase) -export(DummyAnalysis) +export(StaticText) diff --git a/R/dummyanalysis.R b/R/dummyanalysis.R deleted file mode 100644 index afc7507..0000000 --- a/R/dummyanalysis.R +++ /dev/null @@ -1,6 +0,0 @@ -DummyAnalysis <- function(jaspResults, dataset, options) { - dummyTextDescriptives <- createJaspHtml(text = "Fixed text") - - jaspResults[["dummyTextsDescriptives"]] <- dummyTextDescriptives - return() -} \ No newline at end of file diff --git a/R/examples.R b/R/examples.R new file mode 100644 index 0000000..9783188 --- /dev/null +++ b/R/examples.R @@ -0,0 +1,6 @@ +StaticText <- function(jaspResults, dataset, options) { + staticTextDescriptives <- createJaspHtml(text = "This text has been hard-coded") + + jaspResults[["staticTextDescriptives"]] <- staticTextDescriptives + return() +} \ No newline at end of file diff --git a/inst/Description.qml b/inst/Description.qml index a1e2c74..cbe20b4 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -11,11 +11,12 @@ Description maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" + requiresData: false Analysis { - title: "Example" - func: "DummyAnalysis" - qml: "DummyAnalysis.qml" + title: "Static text output" + func: "StaticText" + qml: "examples.qml" } } \ No newline at end of file diff --git a/inst/qml/DummyAnalysis.qml b/inst/qml/examples.qml similarity index 100% rename from inst/qml/DummyAnalysis.qml rename to inst/qml/examples.qml From 80879bde694d60cea630f572158d1ed8b387c419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 25 Sep 2024 12:46:56 +0200 Subject: [PATCH 003/157] Add renv.lock to repo --- renv.lock | 600 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 600 insertions(+) create mode 100644 renv.lock diff --git a/renv.lock b/renv.lock new file mode 100644 index 0000000..c26ce74 --- /dev/null +++ b/renv.lock @@ -0,0 +1,600 @@ +{ + "R": { + "Version": "4.4.1", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cloud.r-project.org" + } + ] + }, + "Packages": { + "Formula": { + "Package": "Formula", + "Version": "1.2-5", + "Source": "Repository" + }, + "GPArotation": { + "Package": "GPArotation", + "Version": "2024.3-1", + "Source": "Repository" + }, + "Hmisc": { + "Package": "Hmisc", + "Version": "5.1-3", + "Source": "Repository" + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-60.2", + "Source": "Repository" + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.7-0", + "Source": "Repository" + }, + "R6": { + "Package": "R6", + "Version": "2.5.1", + "Source": "Repository" + }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-3", + "Source": "Repository" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.13", + "Source": "Repository" + }, + "abind": { + "Package": "abind", + "Version": "1.4-8", + "Source": "Repository" + }, + "askpass": { + "Package": "askpass", + "Version": "1.2.0", + "Source": "Repository" + }, + "backports": { + "Package": "backports", + "Version": "1.5.0", + "Source": "Repository" + }, + "base64enc": { + "Package": "base64enc", + "Version": "0.1-3", + "Source": "Repository" + }, + "bslib": { + "Package": "bslib", + "Version": "0.8.0", + "Source": "Repository" + }, + "cachem": { + "Package": "cachem", + "Version": "1.1.0", + "Source": "Repository" + }, + "callr": { + "Package": "callr", + "Version": "3.7.6", + "Source": "Repository" + }, + "checkmate": { + "Package": "checkmate", + "Version": "2.3.2", + "Source": "Repository" + }, + "cli": { + "Package": "cli", + "Version": "3.6.3", + "Source": "Repository" + }, + "cluster": { + "Package": "cluster", + "Version": "2.1.6", + "Source": "Repository" + }, + "codetools": { + "Package": "codetools", + "Version": "0.2-20", + "Source": "Repository" + }, + "colorspace": { + "Package": "colorspace", + "Version": "2.1-1", + "Source": "Repository" + }, + "corpcor": { + "Package": "corpcor", + "Version": "1.6.10", + "Source": "Repository" + }, + "cpp11": { + "Package": "cpp11", + "Version": "0.5.0", + "Source": "Repository" + }, + "data.table": { + "Package": "data.table", + "Version": "1.16.0", + "Source": "Repository" + }, + "desc": { + "Package": "desc", + "Version": "1.4.3", + "Source": "Repository" + }, + "digest": { + "Package": "digest", + "Version": "0.6.37", + "Source": "Repository" + }, + "evaluate": { + "Package": "evaluate", + "Version": "1.0.0", + "Source": "Repository" + }, + "fansi": { + "Package": "fansi", + "Version": "1.0.6", + "Source": "Repository" + }, + "farver": { + "Package": "farver", + "Version": "2.1.2", + "Source": "Repository" + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.2.0", + "Source": "Repository" + }, + "fdrtool": { + "Package": "fdrtool", + "Version": "1.2.18", + "Source": "Repository" + }, + "fontBitstreamVera": { + "Package": "fontBitstreamVera", + "Version": "0.1.1", + "Source": "Repository" + }, + "fontLiberation": { + "Package": "fontLiberation", + "Version": "0.1.0", + "Source": "Repository" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.2", + "Source": "Repository" + }, + "fontquiver": { + "Package": "fontquiver", + "Version": "0.2.1", + "Source": "Repository" + }, + "foreign": { + "Package": "foreign", + "Version": "0.8-86", + "Source": "Repository" + }, + "fs": { + "Package": "fs", + "Version": "1.6.4", + "Source": "Repository" + }, + "gdtools": { + "Package": "gdtools", + "Version": "0.4.0", + "Source": "Repository" + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.5.1", + "Source": "Repository" + }, + "glasso": { + "Package": "glasso", + "Version": "1.11", + "Source": "Repository" + }, + "glue": { + "Package": "glue", + "Version": "1.7.0", + "Source": "Repository" + }, + "gridExtra": { + "Package": "gridExtra", + "Version": "2.3", + "Source": "Repository" + }, + "gridGraphics": { + "Package": "gridGraphics", + "Version": "0.5-1", + "Source": "Repository" + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.5", + "Source": "Repository" + }, + "gtools": { + "Package": "gtools", + "Version": "3.9.5", + "Source": "Repository" + }, + "highr": { + "Package": "highr", + "Version": "0.11", + "Source": "Repository" + }, + "htmlTable": { + "Package": "htmlTable", + "Version": "2.4.3", + "Source": "Repository" + }, + "htmltools": { + "Package": "htmltools", + "Version": "0.5.8.1", + "Source": "Repository" + }, + "htmlwidgets": { + "Package": "htmlwidgets", + "Version": "1.6.4", + "Source": "Repository" + }, + "igraph": { + "Package": "igraph", + "Version": "2.0.3", + "Source": "Repository" + }, + "isoband": { + "Package": "isoband", + "Version": "0.2.7", + "Source": "Repository" + }, + "jaspBase": { + "Package": "jaspBase", + "Version": "0.19.0", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "jasp-stats", + "RemoteRepo": "jaspBase", + "RemoteRef": "HEAD", + "RemoteSha": "f12f1ffb8b2310c249fbe674596f5a08b3aac606" + }, + "jaspGraphs": { + "Package": "jaspGraphs", + "Version": "0.19.0", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "jasp-stats", + "RemoteRepo": "jaspGraphs", + "RemoteRef": "HEAD", + "RemoteSha": "b2e1799265a0741b49a1ca356f96448091dd8db0" + }, + "jpeg": { + "Package": "jpeg", + "Version": "0.1-10", + "Source": "Repository" + }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository" + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "1.8.8", + "Source": "Repository" + }, + "kinematics": { + "Package": "kinematics", + "Version": "1.0.0", + "Source": "Repository" + }, + "knitr": { + "Package": "knitr", + "Version": "1.48", + "Source": "Repository" + }, + "labeling": { + "Package": "labeling", + "Version": "0.4.3", + "Source": "Repository" + }, + "lattice": { + "Package": "lattice", + "Version": "0.22-6", + "Source": "Repository" + }, + "lavaan": { + "Package": "lavaan", + "Version": "0.6-18", + "Source": "Repository" + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.4", + "Source": "Repository" + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.3", + "Source": "Repository" + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository" + }, + "mgcv": { + "Package": "mgcv", + "Version": "1.9-1", + "Source": "Repository" + }, + "mime": { + "Package": "mime", + "Version": "0.12", + "Source": "Repository" + }, + "mnormt": { + "Package": "mnormt", + "Version": "2.1.1", + "Source": "Repository" + }, + "modules": { + "Package": "modules", + "Version": "0.13.0", + "Source": "Repository" + }, + "munsell": { + "Package": "munsell", + "Version": "0.5.1", + "Source": "Repository" + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-164", + "Source": "Repository" + }, + "nnet": { + "Package": "nnet", + "Version": "7.3-19", + "Source": "Repository" + }, + "numDeriv": { + "Package": "numDeriv", + "Version": "2016.8-1.1", + "Source": "Repository" + }, + "officer": { + "Package": "officer", + "Version": "0.6.6", + "Source": "Repository" + }, + "openssl": { + "Package": "openssl", + "Version": "2.2.1", + "Source": "Repository" + }, + "pbapply": { + "Package": "pbapply", + "Version": "1.7-2", + "Source": "Repository" + }, + "pbivnorm": { + "Package": "pbivnorm", + "Version": "0.6.0", + "Source": "Repository" + }, + "pillar": { + "Package": "pillar", + "Version": "1.9.0", + "Source": "Repository" + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.4.4", + "Source": "Repository" + }, + "pkgconfig": { + "Package": "pkgconfig", + "Version": "2.0.3", + "Source": "Repository" + }, + "plyr": { + "Package": "plyr", + "Version": "1.8.9", + "Source": "Repository" + }, + "png": { + "Package": "png", + "Version": "0.1-8", + "Source": "Repository" + }, + "processx": { + "Package": "processx", + "Version": "3.8.4", + "Source": "Repository" + }, + "ps": { + "Package": "ps", + "Version": "1.8.0", + "Source": "Repository" + }, + "psych": { + "Package": "psych", + "Version": "2.4.6.26", + "Source": "Repository" + }, + "qgraph": { + "Package": "qgraph", + "Version": "1.9.8", + "Source": "Repository" + }, + "quadprog": { + "Package": "quadprog", + "Version": "1.5-8", + "Source": "Repository" + }, + "ragg": { + "Package": "ragg", + "Version": "1.3.3", + "Source": "Repository" + }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository" + }, + "remotes": { + "Package": "remotes", + "Version": "2.5.0", + "Source": "Repository" + }, + "reshape2": { + "Package": "reshape2", + "Version": "1.4.4", + "Source": "Repository" + }, + "rjson": { + "Package": "rjson", + "Version": "0.2.23", + "Source": "Repository" + }, + "rlang": { + "Package": "rlang", + "Version": "1.1.4", + "Source": "Repository" + }, + "rmarkdown": { + "Package": "rmarkdown", + "Version": "2.28", + "Source": "Repository" + }, + "rpart": { + "Package": "rpart", + "Version": "4.1.23", + "Source": "Repository" + }, + "rstudioapi": { + "Package": "rstudioapi", + "Version": "0.16.0", + "Source": "Repository" + }, + "rvg": { + "Package": "rvg", + "Version": "0.3.4", + "Source": "Repository" + }, + "sass": { + "Package": "sass", + "Version": "0.4.9", + "Source": "Repository" + }, + "scales": { + "Package": "scales", + "Version": "1.3.0", + "Source": "Repository" + }, + "stringi": { + "Package": "stringi", + "Version": "1.8.4", + "Source": "Repository" + }, + "stringr": { + "Package": "stringr", + "Version": "1.5.1", + "Source": "Repository" + }, + "svglite": { + "Package": "svglite", + "Version": "2.1.3", + "Source": "Repository" + }, + "sys": { + "Package": "sys", + "Version": "3.4.2", + "Source": "Repository" + }, + "systemfonts": { + "Package": "systemfonts", + "Version": "1.1.0", + "Source": "Repository" + }, + "textshaping": { + "Package": "textshaping", + "Version": "0.4.0", + "Source": "Repository" + }, + "tibble": { + "Package": "tibble", + "Version": "3.2.1", + "Source": "Repository" + }, + "tinytex": { + "Package": "tinytex", + "Version": "0.53", + "Source": "Repository" + }, + "utf8": { + "Package": "utf8", + "Version": "1.2.4", + "Source": "Repository" + }, + "uuid": { + "Package": "uuid", + "Version": "1.2-1", + "Source": "Repository" + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.6.5", + "Source": "Repository" + }, + "viridis": { + "Package": "viridis", + "Version": "0.6.5", + "Source": "Repository" + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.2", + "Source": "Repository" + }, + "withr": { + "Package": "withr", + "Version": "3.0.1", + "Source": "Repository" + }, + "xfun": { + "Package": "xfun", + "Version": "0.47", + "Source": "Repository" + }, + "xml2": { + "Package": "xml2", + "Version": "1.3.6", + "Source": "Repository" + }, + "yaml": { + "Package": "yaml", + "Version": "2.3.10", + "Source": "Repository" + }, + "zip": { + "Package": "zip", + "Version": "2.3.1", + "Source": "Repository" + } + } +} From a7f7e9ebd0af2e14b48501f49f571c60995a17a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Tue, 26 Nov 2024 15:05:44 +0100 Subject: [PATCH 004/157] More dummy functionality --- NAMESPACE | 1 + R/examples.R | 7 +++++++ inst/Description.qml | 17 +++++++++++++++-- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 7559495..af42abc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,3 @@ import(jaspBase) export(StaticText) +export(RandomText) \ No newline at end of file diff --git a/R/examples.R b/R/examples.R index 9783188..b54fdcb 100644 --- a/R/examples.R +++ b/R/examples.R @@ -2,5 +2,12 @@ StaticText <- function(jaspResults, dataset, options) { staticTextDescriptives <- createJaspHtml(text = "This text has been hard-coded") jaspResults[["staticTextDescriptives"]] <- staticTextDescriptives + return() +} + +RandomText <- function(jaspResults, dataset, options) { + text <- createJaspHtml(text = paste(sample(LETTERS, 5), collapse = "")) + jaspResults[["text"]] <- text + return() } \ No newline at end of file diff --git a/inst/Description.qml b/inst/Description.qml index cbe20b4..f82c8f2 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -5,7 +5,7 @@ Description { name : "jaspModule" title : qsTr("Jasp Module") - description : qsTr("This module offers analyses.") + description : qsTr("Examples for module builders") version : "0.1" author : "JASP Team" maintainer : "JASP Team " @@ -13,10 +13,23 @@ Description license : "GPL (>= 2)" requiresData: false + + GroupTitle + { + title: qsTr("Text") + } + Analysis { - title: "Static text output" + title: "Static text" func: "StaticText" qml: "examples.qml" } + + Analysis + { + title: "Random text" + func: "RandomText" + qml: "examples.qml" + } } \ No newline at end of file From a7b2a1b6a2d4915246f6e39fc68857d1b923b96b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Tue, 26 Nov 2024 16:01:20 +0100 Subject: [PATCH 005/157] Create manual input --- NAMESPACE | 3 ++- R/examples.R | 7 +++++++ inst/Description.qml | 7 +++++++ inst/qml/examples.qml | 10 ++++++++++ inst/qml/integer.qml | 36 ++++++++++++++++++++++++++++++++++++ 5 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 inst/qml/integer.qml diff --git a/NAMESPACE b/NAMESPACE index af42abc..f3193d7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,4 @@ import(jaspBase) export(StaticText) -export(RandomText) \ No newline at end of file +export(RandomText) +export(AddOne) \ No newline at end of file diff --git a/R/examples.R b/R/examples.R index b54fdcb..8d40b9c 100644 --- a/R/examples.R +++ b/R/examples.R @@ -9,5 +9,12 @@ RandomText <- function(jaspResults, dataset, options) { text <- createJaspHtml(text = paste(sample(LETTERS, 5), collapse = "")) jaspResults[["text"]] <- text + return() +} + +AddOne <- function(jaspResults, dataset, options) { + text <- createJaspHtml(text = paste(sample(LETTERS, 5), collapse = "")) + jaspResults[["text"]] <- text + return() } \ No newline at end of file diff --git a/inst/Description.qml b/inst/Description.qml index f82c8f2..890787a 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -32,4 +32,11 @@ Description func: "RandomText" qml: "examples.qml" } + + Analysis + { + title: "Integer input" + func: "AddOne" + qml: "integer.qml" + } } \ No newline at end of file diff --git a/inst/qml/examples.qml b/inst/qml/examples.qml index 446c70a..5896f14 100644 --- a/inst/qml/examples.qml +++ b/inst/qml/examples.qml @@ -38,4 +38,14 @@ Form singleVariable: true } } + + IntegerField + { + name: "integer" + label: qsTr("Type a number") + min: 1 + defaultValue: 10 + fieldWidth: 50 + max: 1000 + } } \ No newline at end of file diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml new file mode 100644 index 0000000..8f1194a --- /dev/null +++ b/inst/qml/integer.qml @@ -0,0 +1,36 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + IntegerField + { + name: "mynumber" + label: qsTr("Type a number") + min: 1 + defaultValue: 10 + fieldWidth: 50 + max: 1000 + } +} \ No newline at end of file From 4b5f9146b0ce6b0828eb831efa0b86eb924b41a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Tue, 26 Nov 2024 16:15:08 +0100 Subject: [PATCH 006/157] Finally some interactivity --- R/examples.R | 4 ++-- inst/qml/integer.qml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/examples.R b/R/examples.R index 8d40b9c..16faa9b 100644 --- a/R/examples.R +++ b/R/examples.R @@ -13,8 +13,8 @@ RandomText <- function(jaspResults, dataset, options) { } AddOne <- function(jaspResults, dataset, options) { - text <- createJaspHtml(text = paste(sample(LETTERS, 5), collapse = "")) - jaspResults[["text"]] <- text + result <- as.character(options$my_number + 1) + jaspResults[["result"]] <- createJaspHtml(text = result) return() } \ No newline at end of file diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml index 8f1194a..c346462 100644 --- a/inst/qml/integer.qml +++ b/inst/qml/integer.qml @@ -26,7 +26,7 @@ Form IntegerField { - name: "mynumber" + name: "my_number" label: qsTr("Type a number") min: 1 defaultValue: 10 From baa2a87c010cb6b5fc55f96e1308ef8671056542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Mon, 2 Dec 2024 11:23:05 +0100 Subject: [PATCH 007/157] Update lock file --- .Rbuildignore | 2 + .Rprofile | 1 + .gitignore | 1 + renv.lock | 1166 +++++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 1045 insertions(+), 125 deletions(-) create mode 100644 .Rprofile diff --git a/.Rbuildignore b/.Rbuildignore index 112ad26..7d392e5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,5 @@ +^renv$ +^renv\.lock$ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 0000000..81b960f --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/.gitignore b/.gitignore index 854a153..2a2473d 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,5 @@ Thumbs.db # RStudio files .Rproj.user +renv/ _processedLockFile.lock diff --git a/renv.lock b/renv.lock index c26ce74..7648917 100644 --- a/renv.lock +++ b/renv.lock @@ -1,6 +1,6 @@ { "R": { - "Version": "4.4.1", + "Version": "4.4.2", "Repositories": [ { "Name": "CRAN", @@ -12,589 +12,1505 @@ "Formula": { "Package": "Formula", "Version": "1.2-5", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "7a29697b75e027767a53fde6c903eca7" }, "GPArotation": { "Package": "GPArotation", "Version": "2024.3-1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "b8b658ec0d7a6a55d9d01e00e3cafd20" }, "Hmisc": { "Package": "Hmisc", "Version": "5.1-3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Formula", + "R", + "base64enc", + "cluster", + "colorspace", + "data.table", + "foreign", + "ggplot2", + "grid", + "gridExtra", + "gtable", + "htmlTable", + "htmltools", + "knitr", + "methods", + "nnet", + "rmarkdown", + "rpart", + "viridis" + ], + "Hash": "9a446aea30bff7e8ee20f4c0973e8851" }, "MASS": { "Package": "MASS", "Version": "7.3-60.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats", + "utils" + ], + "Hash": "2f342c46163b0b54d7b64d1f798e2c78" }, "Matrix": { "Package": "Matrix", "Version": "1.7-0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "lattice", + "methods", + "stats", + "utils" + ], + "Hash": "1920b2f11133b12350024297d8a4ff4a" }, "R6": { "Package": "R6", "Version": "2.5.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" }, "RColorBrewer": { "Package": "RColorBrewer", "Version": "1.1-3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "45f0398006e83a5b10b72a90663d8d8c" }, "Rcpp": { "Package": "Rcpp", "Version": "1.0.13", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "utils" + ], + "Hash": "f27411eb6d9c3dada5edd444b8416675" }, "abind": { "Package": "abind", "Version": "1.4-8", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "utils" + ], + "Hash": "2288423bb0f20a457800d7fc47f6aa54" }, "askpass": { "Package": "askpass", "Version": "1.2.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "sys" + ], + "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" }, "backports": { "Package": "backports", "Version": "1.5.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "e1e1b9d75c37401117b636b7ae50827a" }, "base64enc": { "Package": "base64enc", "Version": "0.1-3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" }, "bslib": { "Package": "bslib", "Version": "0.8.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "cachem", + "fastmap", + "grDevices", + "htmltools", + "jquerylib", + "jsonlite", + "lifecycle", + "memoise", + "mime", + "rlang", + "sass" + ], + "Hash": "b299c6741ca9746fb227debcb0f9fb6c" }, "cachem": { "Package": "cachem", "Version": "1.1.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "fastmap", + "rlang" + ], + "Hash": "cd9a672193789068eb5a2aad65a0dedf" }, "callr": { "Package": "callr", "Version": "3.7.6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "processx", + "utils" + ], + "Hash": "d7e13f49c19103ece9e58ad2d83a7354" }, "checkmate": { "Package": "checkmate", "Version": "2.3.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "backports", + "utils" + ], + "Hash": "0e14e01ce07e7c88fd25de6d4260d26b" }, "cli": { "Package": "cli", "Version": "3.6.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "b21916dd77a27642b447374a5d30ecf3" }, "cluster": { "Package": "cluster", "Version": "2.1.6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats", + "utils" + ], + "Hash": "0aaa05204035dc43ea0004b9c76611dd" }, "codetools": { "Package": "codetools", "Version": "0.2-20", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "61e097f35917d342622f21cdc79c256e" }, "colorspace": { "Package": "colorspace", "Version": "2.1-1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats" + ], + "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" }, "corpcor": { "Package": "corpcor", "Version": "1.6.10", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "17ebe3b6d75d09c5bab3891880b34237" }, "cpp11": { "Package": "cpp11", "Version": "0.5.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "91570bba75d0c9d3f1040c835cee8fba" }, "data.table": { "Package": "data.table", "Version": "1.16.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "fb24e05d4a91d8b1c7ff8e284bde834a" }, "desc": { "Package": "desc", "Version": "1.4.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "utils" + ], + "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" }, "digest": { "Package": "digest", "Version": "0.6.37", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "33698c4b3127fc9f506654607fb73676" }, "evaluate": { "Package": "evaluate", "Version": "1.0.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "6b567375113ceb7d9f800de4dd42218e" }, "fansi": { "Package": "fansi", "Version": "1.0.6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "utils" + ], + "Hash": "962174cf2aeb5b9eea581522286a911f" }, "farver": { "Package": "farver", "Version": "2.1.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "680887028577f3fa2a81e410ed0d6e42" }, "fastmap": { "Package": "fastmap", "Version": "1.2.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" }, "fdrtool": { "Package": "fdrtool", "Version": "1.2.18", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "d2a06fbed1234e31c6a872aebbf30057" }, "fontBitstreamVera": { "Package": "fontBitstreamVera", "Version": "0.1.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f6068021eff4aba735a9b2353516636c" }, "fontLiberation": { "Package": "fontLiberation", "Version": "0.1.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f918c5e723f86f409912104d5b7a71d6" }, "fontawesome": { "Package": "fontawesome", "Version": "0.5.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "htmltools", + "rlang" + ], + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" }, "fontquiver": { "Package": "fontquiver", "Version": "0.2.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "fontBitstreamVera", + "fontLiberation" + ], + "Hash": "fc0f4226379e451057d55419fd31761e" }, "foreign": { "Package": "foreign", - "Version": "0.8-86", - "Source": "Repository" + "Version": "0.8-87", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "stats", + "utils" + ], + "Hash": "81fc09bdeab0077a73927ed1243404b6" }, "fs": { "Package": "fs", "Version": "1.6.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" }, "gdtools": { "Package": "gdtools", "Version": "0.4.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "fontquiver", + "htmltools", + "systemfonts", + "tools" + ], + "Hash": "e8e09897fee8d96f6bb02bf841177d20" }, "ggplot2": { "Package": "ggplot2", "Version": "3.5.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "MASS", + "R", + "cli", + "glue", + "grDevices", + "grid", + "gtable", + "isoband", + "lifecycle", + "mgcv", + "rlang", + "scales", + "stats", + "tibble", + "vctrs", + "withr" + ], + "Hash": "44c6a2f8202d5b7e878ea274b1092426" }, "glasso": { "Package": "glasso", "Version": "1.11", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1e1217c1b472d1dbffda819b57dc6d8d" }, "glue": { "Package": "glue", "Version": "1.7.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "e0b3a53876554bd45879e596cdb10a52" }, "gridExtra": { "Package": "gridExtra", "Version": "2.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "graphics", + "grid", + "gtable", + "utils" + ], + "Hash": "7d7f283939f563670a697165b2cf5560" }, "gridGraphics": { "Package": "gridGraphics", "Version": "0.5-1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "graphics", + "grid" + ], + "Hash": "5b79228594f02385d4df4979284879ae" }, "gtable": { "Package": "gtable", "Version": "0.3.5", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "grid", + "lifecycle", + "rlang" + ], + "Hash": "e18861963cbc65a27736e02b3cd3c4a0" }, "gtools": { "Package": "gtools", "Version": "3.9.5", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "stats", + "utils" + ], + "Hash": "588d091c35389f1f4a9d533c8d709b35" }, "highr": { "Package": "highr", "Version": "0.11", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "xfun" + ], + "Hash": "d65ba49117ca223614f71b60d85b8ab7" }, "htmlTable": { "Package": "htmlTable", "Version": "2.4.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "checkmate", + "htmltools", + "htmlwidgets", + "knitr", + "magrittr", + "methods", + "rstudioapi", + "stringr" + ], + "Hash": "ca027d8771f2c039aed82f00a81e725b" }, "htmltools": { "Package": "htmltools", "Version": "0.5.8.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "digest", + "fastmap", + "grDevices", + "rlang", + "utils" + ], + "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" }, "htmlwidgets": { "Package": "htmlwidgets", "Version": "1.6.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "htmltools", + "jsonlite", + "knitr", + "rmarkdown", + "yaml" + ], + "Hash": "04291cc45198225444a397606810ac37" }, "igraph": { "Package": "igraph", "Version": "2.0.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Matrix", + "R", + "cli", + "cpp11", + "grDevices", + "graphics", + "lifecycle", + "magrittr", + "methods", + "pkgconfig", + "rlang", + "stats", + "utils", + "vctrs" + ], + "Hash": "c3b7d801d722e26e4cd888e042bf9af5" }, "isoband": { "Package": "isoband", "Version": "0.2.7", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grid", + "utils" + ], + "Hash": "0080607b4a1a7b28979aecef976d8bc2" }, "jaspBase": { "Package": "jaspBase", - "Version": "0.19.0", + "Version": "0.19.2", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "jasp-stats", "RemoteRepo": "jaspBase", - "RemoteRef": "HEAD", - "RemoteSha": "f12f1ffb8b2310c249fbe674596f5a08b3aac606" + "RemoteRef": "master", + "RemoteSha": "67652e03f135b8d9b7c42e353a0fe02b9fea0929", + "Remotes": "jasp-stats/jaspGraphs", + "Requirements": [ + "R6", + "Rcpp", + "cli", + "codetools", + "compiler", + "ggplot2", + "grDevices", + "grid", + "gridExtra", + "gridGraphics", + "jaspGraphs", + "jsonlite", + "lifecycle", + "methods", + "modules", + "officer", + "pkgbuild", + "plyr", + "qgraph", + "ragg", + "remotes", + "rjson", + "rvg", + "svglite", + "systemfonts", + "withr" + ], + "Hash": "54ff30fbbe384057dea12677bdb0de3f" }, "jaspGraphs": { "Package": "jaspGraphs", - "Version": "0.19.0", + "Version": "0.19.2", "Source": "GitHub", "RemoteType": "github", "RemoteHost": "api.github.com", "RemoteUsername": "jasp-stats", "RemoteRepo": "jaspGraphs", - "RemoteRef": "HEAD", - "RemoteSha": "b2e1799265a0741b49a1ca356f96448091dd8db0" + "RemoteRef": "master", + "RemoteSha": "797e38a84746e9aa0f456439b8f00f756164d82c", + "Requirements": [ + "R6", + "RColorBrewer", + "ggplot2", + "gridExtra", + "gtable", + "jsonlite", + "lifecycle", + "rlang", + "scales", + "viridisLite" + ], + "Hash": "35093128cffc6280d0ec4183a851a9d9" }, "jpeg": { "Package": "jpeg", "Version": "0.1-10", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "031a0b683d001a7519202f0628fc0358" }, "jquerylib": { "Package": "jquerylib", "Version": "0.1.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "htmltools" + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" }, "jsonlite": { "Package": "jsonlite", "Version": "1.8.8", - "Source": "Repository" - }, - "kinematics": { - "Package": "kinematics", - "Version": "1.0.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods" + ], + "Hash": "e1b9c55281c5adc4dd113652d9e26768" }, "knitr": { "Package": "knitr", "Version": "1.48", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "evaluate", + "highr", + "methods", + "tools", + "xfun", + "yaml" + ], + "Hash": "acf380f300c721da9fde7df115a5f86f" }, "labeling": { "Package": "labeling", "Version": "0.4.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "graphics", + "stats" + ], + "Hash": "b64ec208ac5bc1852b285f665d6368b3" }, "lattice": { "Package": "lattice", "Version": "0.22-6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "stats", + "utils" + ], + "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" }, "lavaan": { "Package": "lavaan", "Version": "0.6-18", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "MASS", + "R", + "graphics", + "methods", + "mnormt", + "numDeriv", + "pbivnorm", + "quadprog", + "stats", + "stats4", + "utils" + ], + "Hash": "8cc22350004769221cf2468d41c7e389" }, "lifecycle": { "Package": "lifecycle", "Version": "1.0.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "rlang" + ], + "Hash": "b8552d117e1b808b09a832f589b79035" }, "magrittr": { "Package": "magrittr", "Version": "2.0.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "7ce2733a9826b3aeb1775d56fd305472" }, "memoise": { "Package": "memoise", "Version": "2.0.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "cachem", + "rlang" + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" }, "mgcv": { "Package": "mgcv", "Version": "1.9-1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Matrix", + "R", + "graphics", + "methods", + "nlme", + "splines", + "stats", + "utils" + ], + "Hash": "110ee9d83b496279960e162ac97764ce" }, "mime": { "Package": "mime", "Version": "0.12", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" }, "mnormt": { "Package": "mnormt", "Version": "2.1.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "c83992ef63553d1e4b97162a4a753470" }, "modules": { "Package": "modules", "Version": "0.13.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "1485aee3373bcfdbb2dd9048995af2ae" }, "munsell": { "Package": "munsell", "Version": "0.5.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "colorspace", + "methods" + ], + "Hash": "4fd8900853b746af55b81fda99da7695" }, "nlme": { "Package": "nlme", "Version": "3.1-164", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "graphics", + "lattice", + "stats", + "utils" + ], + "Hash": "a623a2239e642806158bc4dc3f51565d" }, "nnet": { "Package": "nnet", "Version": "7.3-19", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats", + "utils" + ], + "Hash": "2c797b46eea7fb58ede195bc0b1f1138" }, "numDeriv": { "Package": "numDeriv", "Version": "2016.8-1.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "df58958f293b166e4ab885ebcad90e02" }, "officer": { "Package": "officer", "Version": "0.6.6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "grDevices", + "graphics", + "openssl", + "ragg", + "stats", + "utils", + "uuid", + "xml2", + "zip" + ], + "Hash": "dc703d9a479e428a15dc6f82e268387e" }, "openssl": { "Package": "openssl", "Version": "2.2.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "askpass" + ], + "Hash": "c62edf62de70cadf40553e10c739049d" }, "pbapply": { "Package": "pbapply", "Version": "1.7-2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "parallel" + ], + "Hash": "68a2d681e10cf72f0afa1d84d45380e5" }, "pbivnorm": { "Package": "pbivnorm", "Version": "0.6.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "643e16a7da6aac3e18cadc3e14abb94b" }, "pillar": { "Package": "pillar", "Version": "1.9.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "cli", + "fansi", + "glue", + "lifecycle", + "rlang", + "utf8", + "utils", + "vctrs" + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" }, "pkgbuild": { "Package": "pkgbuild", "Version": "1.4.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "callr", + "cli", + "desc", + "processx" + ], + "Hash": "a29e8e134a460a01e0ca67a4763c595b" }, "pkgconfig": { "Package": "pkgconfig", "Version": "2.0.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "01f28d4278f15c76cddbea05899c5d6f" }, "plyr": { "Package": "plyr", "Version": "1.8.9", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp" + ], + "Hash": "6b8177fd19982f0020743fadbfdbd933" }, "png": { "Package": "png", "Version": "0.1-8", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "bd54ba8a0a5faded999a7aab6e46b374" }, "processx": { "Package": "processx", "Version": "3.8.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "ps", + "utils" + ], + "Hash": "0c90a7d71988856bad2a2a45dd871bb9" }, "ps": { "Package": "ps", "Version": "1.8.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" }, "psych": { "Package": "psych", "Version": "2.4.6.26", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "GPArotation", + "grDevices", + "graphics", + "lattice", + "methods", + "mnormt", + "nlme", + "parallel", + "stats" + ], + "Hash": "4448d5f3ac3e2cbf79074391d494637e" }, "qgraph": { "Package": "qgraph", "Version": "1.9.8", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Hmisc", + "Matrix", + "R", + "Rcpp", + "abind", + "colorspace", + "corpcor", + "fdrtool", + "ggplot2", + "glasso", + "grDevices", + "gtools", + "igraph", + "jpeg", + "lavaan", + "methods", + "parallel", + "pbapply", + "plyr", + "png", + "psych", + "reshape2" + ], + "Hash": "a78e4896ba8e67ceaa1086d664dc72a8" }, "quadprog": { "Package": "quadprog", "Version": "1.5-8", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5f919ae5e7f83a6f91dcf2288943370d" }, "ragg": { "Package": "ragg", "Version": "1.3.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "systemfonts", + "textshaping" + ], + "Hash": "0595fe5e47357111f29ad19101c7d271" }, "rappdirs": { "Package": "rappdirs", "Version": "0.3.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" }, "remotes": { "Package": "remotes", "Version": "2.5.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "3ee025083e66f18db6cf27b56e23e141" + }, + "renv": { + "Package": "renv", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "397b7b2a265bc5a7a06852524dabae20" }, "reshape2": { "Package": "reshape2", "Version": "1.4.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "plyr", + "stringr" + ], + "Hash": "bb5996d0bd962d214a11140d77589917" }, "rjson": { "Package": "rjson", "Version": "0.2.23", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "7a04e9eff95857dbf557b4e5f0b3d1a8" }, "rlang": { "Package": "rlang", "Version": "1.1.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" }, "rmarkdown": { "Package": "rmarkdown", "Version": "2.28", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bslib", + "evaluate", + "fontawesome", + "htmltools", + "jquerylib", + "jsonlite", + "knitr", + "methods", + "tinytex", + "tools", + "utils", + "xfun", + "yaml" + ], + "Hash": "062470668513dcda416927085ee9bdc7" }, "rpart": { "Package": "rpart", "Version": "4.1.23", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "b3d390424f41d04174cccf84d49676c2" }, "rstudioapi": { "Package": "rstudioapi", "Version": "0.16.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "96710351d642b70e8f02ddeb237c46a7" }, "rvg": { "Package": "rvg", "Version": "0.3.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "gdtools", + "grDevices", + "officer", + "rlang", + "xml2" + ], + "Hash": "84feb96f75452bfbb4b7858e36bea2c5" }, "sass": { "Package": "sass", "Version": "0.4.9", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "fs", + "htmltools", + "rappdirs", + "rlang" + ], + "Hash": "d53dbfddf695303ea4ad66f86e99b95d" }, "scales": { "Package": "scales", "Version": "1.3.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "RColorBrewer", + "cli", + "farver", + "glue", + "labeling", + "lifecycle", + "munsell", + "rlang", + "viridisLite" + ], + "Hash": "c19df082ba346b0ffa6f833e92de34d1" }, "stringi": { "Package": "stringi", "Version": "1.8.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats", + "tools", + "utils" + ], + "Hash": "39e1144fd75428983dc3f63aa53dfa91" }, "stringr": { "Package": "stringr", "Version": "1.5.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "lifecycle", + "magrittr", + "rlang", + "stringi", + "vctrs" + ], + "Hash": "960e2ae9e09656611e0b8214ad543207" }, "svglite": { "Package": "svglite", "Version": "2.1.3", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "systemfonts" + ], + "Hash": "124a41fdfa23e8691cb744c762f10516" }, "sys": { "Package": "sys", "Version": "3.4.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" }, "systemfonts": { "Package": "systemfonts", "Version": "1.1.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "lifecycle" + ], + "Hash": "213b6b8ed5afbf934843e6c3b090d418" }, "textshaping": { "Package": "textshaping", "Version": "0.4.0", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "lifecycle", + "systemfonts" + ], + "Hash": "5142f8bc78ed3d819d26461b641627ce" }, "tibble": { "Package": "tibble", "Version": "3.2.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "fansi", + "lifecycle", + "magrittr", + "methods", + "pillar", + "pkgconfig", + "rlang", + "utils", + "vctrs" + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" }, "tinytex": { "Package": "tinytex", "Version": "0.53", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "xfun" + ], + "Hash": "9db859e8aabbb474293dde3097839420" }, "utf8": { "Package": "utf8", "Version": "1.2.4", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "62b65c52671e6665f803ff02954446e9" }, "uuid": { "Package": "uuid", "Version": "1.2-1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "34e965e62a41fcafb1ca60e9b142085b" }, "vctrs": { "Package": "vctrs", "Version": "0.6.5", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "lifecycle", + "rlang" + ], + "Hash": "c03fa420630029418f7e6da3667aac4a" }, "viridis": { "Package": "viridis", "Version": "0.6.5", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "ggplot2", + "gridExtra", + "viridisLite" + ], + "Hash": "acd96d9fa70adeea4a5a1150609b9745" }, "viridisLite": { "Package": "viridisLite", "Version": "0.4.2", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" }, "withr": { "Package": "withr", "Version": "3.0.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics" + ], + "Hash": "07909200e8bbe90426fbfeb73e1e27aa" }, "xfun": { "Package": "xfun", "Version": "0.47", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "stats", + "tools" + ], + "Hash": "36ab21660e2d095fef0d83f689e0477c" }, "xml2": { "Package": "xml2", "Version": "1.3.6", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "methods", + "rlang" + ], + "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61" }, "yaml": { "Package": "yaml", "Version": "2.3.10", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "51dab85c6c98e50a18d7551e9d49f76c" }, "zip": { "Package": "zip", "Version": "2.3.1", - "Source": "Repository" + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" } } } From b30742181460a01e02b233aee4bbe6e15fbb44b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Mon, 9 Dec 2024 10:51:17 +0100 Subject: [PATCH 008/157] Improve AddOne example --- R/examples.R | 5 +++-- inst/Description.qml | 11 ++++++----- inst/qml/integer.qml | 14 +++++++++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/R/examples.R b/R/examples.R index 16faa9b..f8b86ef 100644 --- a/R/examples.R +++ b/R/examples.R @@ -14,7 +14,8 @@ RandomText <- function(jaspResults, dataset, options) { AddOne <- function(jaspResults, dataset, options) { result <- as.character(options$my_number + 1) - jaspResults[["result"]] <- createJaspHtml(text = result) + jaspResults[["result"]] <- createJaspHtml(text = result, + title = "This is your result:") return() -} \ No newline at end of file +} diff --git a/inst/Description.qml b/inst/Description.qml index 890787a..fdc4852 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -23,7 +23,7 @@ Description { title: "Static text" func: "StaticText" - qml: "examples.qml" + qml: "examples.qml" } Analysis @@ -35,8 +35,9 @@ Description Analysis { - title: "Integer input" - func: "AddOne" - qml: "integer.qml" + menu: "Add one" // Title for ribbon + title: "Add one" // Title for window + func: "AddOne" // Function to be called + qml: "integer.qml" // Design input window } -} \ No newline at end of file +} diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml index c346462..696de88 100644 --- a/inst/qml/integer.qml +++ b/inst/qml/integer.qml @@ -24,13 +24,21 @@ import JASP 1.0 Form { + Text + { + text: "This example shows how to manually introduce an input and perform a simple operation on it" + } + IntegerField { - name: "my_number" - label: qsTr("Type a number") + name: "my_number" // This will map to options$my_number in R + label: qsTr("Type a number") // qsTr allows for future translations + + // We can add some extra control parameters min: 1 defaultValue: 10 fieldWidth: 50 max: 1000 } -} \ No newline at end of file + +} From d6345c8de8dff02b390341c3b2c7f21ec868e926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Mon, 9 Dec 2024 10:52:44 +0100 Subject: [PATCH 009/157] Remove text examples They were too simplistic --- NAMESPACE | 4 +--- R/examples.R | 14 ------------ inst/Description.qml | 16 +------------- inst/qml/examples.qml | 51 ------------------------------------------- 4 files changed, 2 insertions(+), 83 deletions(-) delete mode 100644 inst/qml/examples.qml diff --git a/NAMESPACE b/NAMESPACE index f3193d7..663d042 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,2 @@ import(jaspBase) -export(StaticText) -export(RandomText) -export(AddOne) \ No newline at end of file +export(AddOne) diff --git a/R/examples.R b/R/examples.R index f8b86ef..3773cb3 100644 --- a/R/examples.R +++ b/R/examples.R @@ -1,17 +1,3 @@ -StaticText <- function(jaspResults, dataset, options) { - staticTextDescriptives <- createJaspHtml(text = "This text has been hard-coded") - - jaspResults[["staticTextDescriptives"]] <- staticTextDescriptives - return() -} - -RandomText <- function(jaspResults, dataset, options) { - text <- createJaspHtml(text = paste(sample(LETTERS, 5), collapse = "")) - jaspResults[["text"]] <- text - - return() -} - AddOne <- function(jaspResults, dataset, options) { result <- as.character(options$my_number + 1) jaspResults[["result"]] <- createJaspHtml(text = result, diff --git a/inst/Description.qml b/inst/Description.qml index fdc4852..4e85de7 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -16,21 +16,7 @@ Description GroupTitle { - title: qsTr("Text") - } - - Analysis - { - title: "Static text" - func: "StaticText" - qml: "examples.qml" - } - - Analysis - { - title: "Random text" - func: "RandomText" - qml: "examples.qml" + title: qsTr("Basic functions") } Analysis diff --git a/inst/qml/examples.qml b/inst/qml/examples.qml deleted file mode 100644 index 5896f14..0000000 --- a/inst/qml/examples.qml +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright (C) 2013-2018 University of Amsterdam -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public -// License along with this program. If not, see -// . -// -import QtQuick 2.8 -import QtQuick.Layouts 1.3 -import JASP.Controls 1.0 -import JASP.Widgets 1.0 -import JASP 1.0 - -Form -{ - VariablesForm - { - AvailableVariablesList - { - name: "allVariablesList" - } - - AssignedVariablesList - { - name: "myVariable" - title: qsTr("Chosen variable") - allowedColumns: ["scale"] - singleVariable: true - } - } - - IntegerField - { - name: "integer" - label: qsTr("Type a number") - min: 1 - defaultValue: 10 - fieldWidth: 50 - max: 1000 - } -} \ No newline at end of file From 28a86668954ffc126989929a0e377143d58518e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Mon, 9 Dec 2024 13:26:47 +0100 Subject: [PATCH 010/157] Problematic snippet regarding plots --- NAMESPACE | 1 + R/examples.R | 20 ++++++++++++++++++++ inst/Description.qml | 12 ++++++++++++ inst/qml/parabola.qml | 44 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 inst/qml/parabola.qml diff --git a/NAMESPACE b/NAMESPACE index 663d042..e861e0f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,3 @@ import(jaspBase) export(AddOne) +export(Parabola) diff --git a/R/examples.R b/R/examples.R index 3773cb3..fe74169 100644 --- a/R/examples.R +++ b/R/examples.R @@ -5,3 +5,23 @@ AddOne <- function(jaspResults, dataset, options) { return() } + +Parabola <- function(jaspResults, dataset, options) { + # Analysis + f <- function(x) { options$a * x^2 } # Function to be plotted + p <- ggplot2::ggplot() + # Plotting command + ggplot2::xlim(-3, 3) + + ggplot2::ylim(0, 10) + + ggplot2::geom_function(fun = f) + + # Aesthetics + parabolaPlot <- createJaspPlot(title = "Parabola", + width = 160, + height = 320) + parabolaPlot$dependOn(c("a")) # Refresh view whenever a changes + + jaspResults[["parabolaPlot"]] <- parabolaPlot + parabolaPlot$plotObject <- p + + return() +} diff --git a/inst/Description.qml b/inst/Description.qml index 4e85de7..98cc16f 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -26,4 +26,16 @@ Description func: "AddOne" // Function to be called qml: "integer.qml" // Design input window } + + GroupTitle + { + title: qsTr("Plotting") + } + + Analysis + { + title: "Plot a parabola" + func: "Parabola" + qml: "parabola.qml" + } } diff --git a/inst/qml/parabola.qml b/inst/qml/parabola.qml new file mode 100644 index 0000000..d2703b8 --- /dev/null +++ b/inst/qml/parabola.qml @@ -0,0 +1,44 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to plot a curve" + } + + IntegerField + { + name: "a" // This will map to options$a in R + label: qsTr("Type a number") // qsTr allows for future translations + + // We can add some extra control parameters + min: -10 + defaultValue: 1 + fieldWidth: 50 + max: 10 + } + +} From ddbbc473bb6467411ec3b075b4ef04fd22e33b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 11 Dec 2024 15:32:37 +0100 Subject: [PATCH 011/157] Firt example with data --- NAMESPACE | 1 + R/examples.R | 14 +++++++++++++- inst/Description.qml | 13 +++++++++++-- inst/qml/data.qml | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 inst/qml/data.qml diff --git a/NAMESPACE b/NAMESPACE index 663d042..e8b13c0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,2 +1,3 @@ import(jaspBase) export(AddOne) +export(ProcessData) diff --git a/R/examples.R b/R/examples.R index 3773cb3..9f275e9 100644 --- a/R/examples.R +++ b/R/examples.R @@ -1,7 +1,19 @@ AddOne <- function(jaspResults, dataset, options) { - result <- as.character(options$my_number + 1) + result <- as.character(options$my_number + 1) # options$my_number comes from the menu created by inst/qml/integer.qml + jaspResults[["result"]] <- createJaspHtml(text = result, title = "This is your result:") return() } + +ProcessData <- function(jaspResults, dataset, options) { + print("Find me!") + print(dataset) + + result <- paste0(as.character(dataset[,options$ts]), collapse = "") + jaspResults[["result"]] <- createJaspHtml(text = result, + title = "This is your result:") + + return() +} diff --git a/inst/Description.qml b/inst/Description.qml index 4e85de7..7662ab4 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -11,7 +11,8 @@ Description maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" - requiresData: false + preloadData: true + requiresData: true GroupTitle @@ -21,9 +22,17 @@ Description Analysis { + title: "Add one" // Title for window menu: "Add one" // Title for ribbon - title: "Add one" // Title for window func: "AddOne" // Function to be called qml: "integer.qml" // Design input window } + + Analysis + { + title: "Load data" + menu: "Load data" + func: "ProcessData" + qml: "data.qml" + } } diff --git a/inst/qml/data.qml b/inst/qml/data.qml new file mode 100644 index 0000000..5b3cf05 --- /dev/null +++ b/inst/qml/data.qml @@ -0,0 +1,40 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to load a dataset and perform a simple operation on it" + } + + VariablesForm + { + AvailableVariablesList { name: "allVariables" } + AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); allowedColumns: ["scale"] } + AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); allowedColumns: ["scale"] } + } + +} From af715726063dddc4e3d7f99bef8e24fe8aae397e Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:02:59 +0100 Subject: [PATCH 012/157] adding github workflow for merging jaspModules --- .github/workflows/post-merge-revert.yml | 76 +++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 .github/workflows/post-merge-revert.yml diff --git a/.github/workflows/post-merge-revert.yml b/.github/workflows/post-merge-revert.yml new file mode 100644 index 0000000..924df21 --- /dev/null +++ b/.github/workflows/post-merge-revert.yml @@ -0,0 +1,76 @@ +name: Post-Merge Branch and Revert Template Branch + +on: + pull_request_target: + types: + - closed # Trigger when a pull request is closed (merged or not) + +jobs: + post_merge_revert: + if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged + runs-on: ubuntu-24.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches and commit history + + # - name: Install yq + # run: | + # sudo apt-get update + # sudo apt-get install -y yq + + - name: Extract Package Name from meta.yaml + run: | + # PACKAGE_NAME=$(yq -r '.package.name' meta.yaml || echo "") + PACKAGE_NAME=$(grep "^Package:" | awk '{print $2}') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in meta.yaml" >&2 + exit 1 + fi + echo "Package name: $PACKAGE_NAME" + echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + shell: bash + + - name: Create Branch with Merge Sources + run: | + MERGED_BRANCH="module/${{ env.PACKAGE_NAME }}" + git checkout -b $MERGED_BRANCH + echo "Branch created: $MERGED_BRANCH" + git push --set-upstream origin $MERGED_BRANCH + + revert_branch: + if: always() # Always run this job, even if the previous job fails + runs-on: ubuntu-24.04 + needs: [post_merge_revert] # Wait for the previous job to complete + # continue-on-error: true # Continue even if the previous job fails + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Revert Template Branch to Pre-Merge State + run: | + MERGE_COMMIT=$(git rev-parse HEAD) + git revert -m 1 $MERGE_COMMIT + git push origin dev/template + + - name: Comment on Pull Request + uses: actions/github-script@v6 + with: + script: | + const comment = `The pull request was merged. A new branch \`module/${process.env.PACKAGE_NAME}\` has been created with the merge changes. The template branch has been reverted to before the merge.`; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); From aa2f5a2567adda9edc8b014a2847c0342c063236 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:03:19 +0100 Subject: [PATCH 013/157] adding github workflow for merging jaspModules --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1ce6d31..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From da07f455e15cc95bd979030c7a4a71f2947bdebe Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:08:13 +0100 Subject: [PATCH 014/157] new jaspmodule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..35cdb50 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: muJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From c04d62dfe9bc23ae42923ccdd31c9384c4621de3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 28 Jan 2025 12:34:39 +0000 Subject: [PATCH 015/157] Revert "Merge pull request #1 from recap/dev/template" This reverts commit 420c7c5ab1d4b7a71af8f1ed23b82c54362da975, reversing changes made to aa2f5a2567adda9edc8b014a2847c0342c063236. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 35cdb50..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: muJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From d50ce944d260a0aa888b27f70856b52e01c30b01 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:39:06 +0100 Subject: [PATCH 016/157] update workflow --- .github/workflows/post-merge-revert.yml | 8 +------- .github/workflows/unittests.yml | 17 ++++++++--------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/post-merge-revert.yml b/.github/workflows/post-merge-revert.yml index 924df21..90a2fbc 100644 --- a/.github/workflows/post-merge-revert.yml +++ b/.github/workflows/post-merge-revert.yml @@ -16,15 +16,9 @@ jobs: with: fetch-depth: 0 # Fetch all branches and commit history - # - name: Install yq - # run: | - # sudo apt-get update - # sudo apt-get install -y yq - - name: Extract Package Name from meta.yaml run: | - # PACKAGE_NAME=$(yq -r '.package.name' meta.yaml || echo "") - PACKAGE_NAME=$(grep "^Package:" | awk '{print $2}') + PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') if [ -z "$PACKAGE_NAME" ]; then echo "Error: Package name not found in meta.yaml" >&2 exit 1 diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 1aebc7e..f3738a0 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,18 +1,17 @@ on: - push: - paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] - pull_request: - paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] - schedule: - - cron: '13 12 * * 1-5' + workflow_dispatch: # remove this line to enable automatic testing + #push: + #paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] + #pull_request: + #paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] + #schedule: + #- cron: '13 12 * * 1-5' name: unit-tests jobs: - unit-tests: - uses: jasp-stats/jasp-actions/.github/workflows/unittests.yml@master with: - needs_JAGS: false + needs_JAGS: false needs_igraph: false From ff4f626e9f984a29de7e80d4023ef3f2770ccadc Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:43:12 +0100 Subject: [PATCH 017/157] new myJaspModule module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From d080e9481fd098d8c43ae8d936c77263c1794f9d Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 28 Jan 2025 12:44:26 +0000 Subject: [PATCH 018/157] Revert "Merge pull request #2 from recap/dev/template" This reverts commit e5495e0f23eb44e16caa3f8d180519b5e8d358c9, reversing changes made to b51cf34826ad097da4a9d5b1bcf1cf20b6a9603c. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From a066647b720f1fd6fca8901dd812d9a72a4e5e76 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 13:53:10 +0100 Subject: [PATCH 019/157] update README --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 99b0d43..5b39373 100644 --- a/README.md +++ b/README.md @@ -1 +1,16 @@ -# jaspModuleTemplate \ No newline at end of file +# jaspModuleTemplate + +This `dev/template` branch is a template for creating a new JASP module. It is a simple example that demonstrates how to create a new module that can be loaded into JASP. The module is written in Python and uses the `jasp` package to interact with JASP. + +## Forking this repository + +Fork this template and untick `Copy the master branch only` to get all branches including the `dev/template` branch. Clone this repository to your local machine and start developing your module. Switch to the `dev/template` branch to get the template code. + +```bash +git fetch +git checkout dev/template +``` + +## Contributing back new module to JASP + +Make sure you name your module appropiataly in the DESCRIPTION file and add a README.md file that explains what your module does. When you are ready to contribute your module back to JASP, create a pull request to the `dev/template` branch of this repository. We will review your module and help you get it into JASP. From 9c186f675c2758d1b47f40b80c20faa4acadb129 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 14:30:24 +0100 Subject: [PATCH 020/157] adding PR open check for DESCRIPTION file --- .github/workflows/check_module_on_pr.yml | 34 ++++++++++++++++++++++++ .github/workflows/post-merge-revert.yml | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check_module_on_pr.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml new file mode 100644 index 0000000..e546821 --- /dev/null +++ b/.github/workflows/check_module_on_pr.yml @@ -0,0 +1,34 @@ +name: Check DESCRIPTION File + +on: + pull_request: + types: [opened, synchronize] + +jobs: + check-description-file: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Step 2: Check if the DESCRIPTION file exists + - name: Verify DESCRIPTION file exists + run: | + if [ ! -f "DESCRIPTION" ]; then + echo "ERROR: DESCRIPTION file is missing." + exit 1 + else + echo "DESCRIPTION file exists." + fi + + - name: Check for package name in DESCRIPTION + run: | + PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in meta.yaml" >&2 + exit 1 + fi + echo "Package name OK: $PACKAGE_NAME" + shell: bash diff --git a/.github/workflows/post-merge-revert.yml b/.github/workflows/post-merge-revert.yml index 90a2fbc..196277a 100644 --- a/.github/workflows/post-merge-revert.yml +++ b/.github/workflows/post-merge-revert.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 0 # Fetch all branches and commit history - - name: Extract Package Name from meta.yaml + - name: Extract Package Name from DESCRIPTION run: | PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') if [ -z "$PACKAGE_NAME" ]; then From 9e7e122d2464f5f188cddf8cc9df57f18596becd Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 14:33:50 +0100 Subject: [PATCH 021/157] creating faulty module --- DESCRIPTION | 1 - 1 file changed, 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..6312046 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,3 @@ -Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 6b87ebf7f2eee6be32886e747b8161cfb70297b2 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 28 Jan 2025 14:37:17 +0100 Subject: [PATCH 022/157] adding myAwsomeModule --- DESCRIPTION | 1 + 1 file changed, 1 insertion(+) diff --git a/DESCRIPTION b/DESCRIPTION index 6312046..4fba863 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,3 +1,4 @@ +Package: myAwsomeModule Type: Package Title: A module for JASP Version: 0.1.0 From f9b48f919030f6bea4fd995dbd7b41da84251042 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 28 Jan 2025 13:39:48 +0000 Subject: [PATCH 023/157] Revert "Merge pull request #3 from recap/dev/template" This reverts commit e2133217f5e2a609b3c3183d3f495030e5d68dbb, reversing changes made to 9c186f675c2758d1b47f40b80c20faa4acadb129. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 4fba863..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myAwsomeModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 9ed2ee9ea24fcff399cdac4f88bee9e126f7eb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez-S=C3=A1nchez?= Date: Wed, 29 Jan 2025 11:38:00 +0100 Subject: [PATCH 024/157] Update DESCRIPTION --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..3460a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: someOtherName Type: Package Title: A module for JASP Version: 0.1.0 From 074c758d75144562ccfb6699315dbf3d72ddbcd0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 29 Jan 2025 10:40:13 +0000 Subject: [PATCH 025/157] Revert "Merge pull request #4 from PabRod/dev/template" This reverts commit 7deb734161966ffb0093b1291dcea25fb865b7a0, reversing changes made to f9b48f919030f6bea4fd995dbd7b41da84251042. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3460a7a..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: someOtherName +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 01f9e5c37fb896f76e754b0b0dff9f91e0802728 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 12:50:31 +0100 Subject: [PATCH 026/157] new workflow to create repo --- .github/workflows/post-merge-revert.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/post-merge-revert.yml b/.github/workflows/post-merge-revert.yml index 196277a..46f4c09 100644 --- a/.github/workflows/post-merge-revert.yml +++ b/.github/workflows/post-merge-revert.yml @@ -1,9 +1,11 @@ name: Post-Merge Branch and Revert Template Branch on: - pull_request_target: - types: - - closed # Trigger when a pull request is closed (merged or not) + workflow_dispatch: + # + # pull_request_target: + # types: + # - closed # Trigger when a pull request is closed (merged or not) jobs: post_merge_revert: From 74be81d95a471826086c058273138d1e338970a5 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 12:51:00 +0100 Subject: [PATCH 027/157] new workflow to create repo --- .github/workflows/post-merge-new-repo.yml | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/post-merge-new-repo.yml diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml new file mode 100644 index 0000000..1a12914 --- /dev/null +++ b/.github/workflows/post-merge-new-repo.yml @@ -0,0 +1,88 @@ +name: Post-Merge Repository Creation and Revert Template Branch + +on: + pull_request_target: + types: + - closed # Trigger when a pull request is closed (merged or not) + +jobs: + create_new_repository: + if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged + runs-on: ubuntu-24.04 + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches and commit history + + - name: Extract Package Name from DESCRIPTION + run: | + PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + echo "Package name: $PACKAGE_NAME" + echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + shell: bash + + - name: Create New Repository in Organization + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_NAME: "jasp-escience" # Replace with your actual organization name + REPO_NAME: ${{ env.PACKAGE_NAME }}-module + run: | + RESPONSE=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -H "Accept: application/vnd.github+json" \ + https://api.github.com/orgs/${ORG_NAME}/repos \ + -d "{\"name\":\"${{ env.REPO_NAME }}\", \"private\": false}") + + if echo "$RESPONSE" | grep -q '"full_name"'; then + echo "Repository created successfully: $ORG_NAME/$REPO_NAME" + echo "NEW_REPO_URL=https://github.com/$ORG_NAME/$REPO_NAME" >> $GITHUB_ENV + else + echo "Failed to create repository: $RESPONSE" + exit 1 + fi + + - name: Push Merged Code to New Repository + run: | + git clone "https://github.com/${{ github.repository }}.git" temp_repo + cd temp_repo + git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${ORG_NAME}/${{ env.PACKAGE_NAME }}.git" + git push --mirror + + revert_template_branch: + if: always() # Always run this job, even if the previous job fails + runs-on: ubuntu-24.04 + needs: [create_new_repository] + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Revert Template Branch to Pre-Merge State + run: | + MERGE_COMMIT=$(git rev-parse HEAD) + git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." + git push origin dev/template || echo "Push failed, continuing..." + + - name: Comment on Pull Request + uses: actions/github-script@v6 + with: + script: | + const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The template branch has been reverted.`; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); From 189976ce979cb3667d11d4140d54fb7b3df18e94 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 12:51:30 +0100 Subject: [PATCH 028/157] new workflow to create repo --- .github/workflows/post-merge-new-repo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 1a12914..d86c4f2 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -33,6 +33,7 @@ jobs: ORG_NAME: "jasp-escience" # Replace with your actual organization name REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | + echo "Creating repository $ORG_NAME/$REPO_NAME..." RESPONSE=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ -H "Accept: application/vnd.github+json" \ https://api.github.com/orgs/${ORG_NAME}/repos \ From e2fb56872fc50a7ec8a26f69f50114d4518cd766 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 12:53:45 +0100 Subject: [PATCH 029/157] new workflow to create repo --- .github/workflows/i18nCheck.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml index ed48104..10411ed 100644 --- a/.github/workflows/i18nCheck.yml +++ b/.github/workflows/i18nCheck.yml @@ -1,10 +1,10 @@ -on: - push: - paths: ['**.R', '**.qml', '**.po', '**.yml'] - - pull_request: - paths: ['**.R', '**.qml', '**.po', '**.yml'] - +on: + # push: + # paths: ['**.R', '**.qml', '**.po', '**.yml'] + # + # pull_request: + # paths: ['**.R', '**.qml', '**.po', '**.yml'] + # workflow_dispatch: name: i18n-check From 61887891cdcfa4989c1bbcf7fb4bd924474a440a Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 12:56:10 +0100 Subject: [PATCH 030/157] new module myJaspModule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 650b02605d1f93e9081d8211fe1404742bb314ac Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 11:57:35 +0000 Subject: [PATCH 031/157] Revert "Merge pull request #5 from recap/dev/template" This reverts commit cfbef07cc1d570d18d63d8386e730bad987054fd, reversing changes made to e2fb56872fc50a7ec8a26f69f50114d4518cd766. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From c1360caf81b6a04359041c33309f081c584bb104 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:08:37 +0100 Subject: [PATCH 032/157] new workflow to create repo --- .github/workflows/post-merge-new-repo.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index d86c4f2..680f509 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -34,10 +34,10 @@ jobs: REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | echo "Creating repository $ORG_NAME/$REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -H "Accept: application/vnd.github+json" \ - https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${{ env.REPO_NAME }}\", \"private\": false}") + RESPONSE=$(curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/${ORG_NAME}/repos \ + -d "{\"name\":\"${REPO_NAME}\", \"private\": false}") if echo "$RESPONSE" | grep -q '"full_name"'; then echo "Repository created successfully: $ORG_NAME/$REPO_NAME" From dd1c80d3c5972bea29ca8ebf26c73197f59e6e18 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:10:00 +0100 Subject: [PATCH 033/157] new module myJaspModule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From a62789d643b14f3d4e4d9822f1e8cef1f3595c2f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 12:10:51 +0000 Subject: [PATCH 034/157] Revert "Merge pull request #6 from recap/dev/template" This reverts commit 7d7f8be8a51d813c0fd19272beea19e9ed225822, reversing changes made to cbb676dae257d465b389eed6ab96133df7eea72e. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 826e654b7fc00f18af88af264071aff25455f9b0 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:28:05 +0100 Subject: [PATCH 035/157] update workflow using PAT --- .github/workflows/post-merge-new-repo.yml | 3 ++- .gitignore | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 680f509..3022645 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -30,11 +30,12 @@ jobs: - name: Create New Repository in Organization env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_PAT: ${{ secrets.ORG_PAT }} # Personal Access Token with org scope ORG_NAME: "jasp-escience" # Replace with your actual organization name REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | echo "Creating repository $ORG_NAME/$REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \ + RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/${ORG_NAME}/repos \ -d "{\"name\":\"${REPO_NAME}\", \"private\": false}") diff --git a/.gitignore b/.gitignore index 854a153..796b6be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*secret* # Compiled Object files *.slo *.lo From 197c997e7d2925b6d2e40670ff8cea4e07980919 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:29:22 +0100 Subject: [PATCH 036/157] new module myJaspModule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 64adfcd27ddb4357bdef1273ebfe51813e101779 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 12:30:15 +0000 Subject: [PATCH 037/157] Revert "Merge pull request #7 from recap/dev/template" This reverts commit 62c20d5e871e362655608cf5dd352ad3f18f3094, reversing changes made to 826e654b7fc00f18af88af264071aff25455f9b0. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From d9c78361ce2159e21cc556498f0a89a7c6f7e3c7 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:36:26 +0100 Subject: [PATCH 038/157] update workflow using PAT --- .github/workflows/post-merge-new-repo.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 3022645..0cb7352 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -49,10 +49,14 @@ jobs: fi - name: Push Merged Code to New Repository + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # Personal Access Token with org scope + ORG_NAME: "jasp-escience" # Replace with your actual organization name + REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | - git clone "https://github.com/${{ github.repository }}.git" temp_repo + git clone "https://github.com/${ORG_NAME}/${REPO_NAME}.git" temp_repo cd temp_repo - git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${ORG_NAME}/${{ env.PACKAGE_NAME }}.git" + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${ORG_NAME}/${REPO_NAME}.git" git push --mirror revert_template_branch: From d5540010dc6c844284cdcd435d7c98a04341888b Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:40:46 +0100 Subject: [PATCH 039/157] update workflow using PAT --- .github/workflows/post-merge-new-repo.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 0cb7352..4f4e0fa 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -54,8 +54,10 @@ jobs: ORG_NAME: "jasp-escience" # Replace with your actual organization name REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | - git clone "https://github.com/${ORG_NAME}/${REPO_NAME}.git" temp_repo + git clone "https://github.com/${{ github.repository }}.git" temp_repo cd temp_repo + git fetch + git checkout dev/template git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${ORG_NAME}/${REPO_NAME}.git" git push --mirror From 0047caa3b181dd9e351bea023ff1496e4fbb2185 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 13:41:48 +0100 Subject: [PATCH 040/157] new module myJaspModule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 6ce0cc7528bd8f6055b95d77dc3ca3765cc736d7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 12:43:39 +0000 Subject: [PATCH 041/157] Revert "Merge pull request #8 from recap/dev/template" This reverts commit 7f315d7c0fccb1afd1152f2017e47f5c01c8fe93, reversing changes made to d5540010dc6c844284cdcd435d7c98a04341888b. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 3ccf01e688a36f7d672867ffefd68755a360ffe8 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 14:29:30 +0100 Subject: [PATCH 042/157] new workflow to create repo --- .github/workflows/post-merge-new-repo.yml | 37 ++++++++++------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 4f4e0fa..b47e207 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,4 +1,4 @@ -name: Post-Merge Repository Creation and Revert Template Branch +name: Post-Merge Repository Creation and Revert Pull Request on: pull_request_target: @@ -9,6 +9,9 @@ jobs: create_new_repository: if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged runs-on: ubuntu-24.04 + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name steps: - name: Checkout Repository @@ -25,43 +28,35 @@ jobs: fi echo "Package name: $PACKAGE_NAME" echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV shell: bash - name: Create New Repository in Organization - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORG_PAT: ${{ secrets.ORG_PAT }} # Personal Access Token with org scope - ORG_NAME: "jasp-escience" # Replace with your actual organization name - REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | - echo "Creating repository $ORG_NAME/$REPO_NAME..." + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + echo "Creating repository $REPO_NAME..." RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${REPO_NAME}\", \"private\": false}") + -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") if echo "$RESPONSE" | grep -q '"full_name"'; then - echo "Repository created successfully: $ORG_NAME/$REPO_NAME" - echo "NEW_REPO_URL=https://github.com/$ORG_NAME/$REPO_NAME" >> $GITHUB_ENV + echo "Repository created successfully: $REPO_NAME" + echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV else echo "Failed to create repository: $RESPONSE" exit 1 fi - name: Push Merged Code to New Repository - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # Personal Access Token with org scope - ORG_NAME: "jasp-escience" # Replace with your actual organization name - REPO_NAME: ${{ env.PACKAGE_NAME }}-module run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" git clone "https://github.com/${{ github.repository }}.git" temp_repo cd temp_repo - git fetch - git checkout dev/template - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${ORG_NAME}/${REPO_NAME}.git" + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" git push --mirror - revert_template_branch: + revert_main_branch: if: always() # Always run this job, even if the previous job fails runs-on: ubuntu-24.04 needs: [create_new_repository] @@ -77,17 +72,17 @@ jobs: git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" - - name: Revert Template Branch to Pre-Merge State + - name: Revert Main Branch to Pre-Merge State run: | MERGE_COMMIT=$(git rev-parse HEAD) git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." - git push origin dev/template || echo "Push failed, continuing..." + git push origin main || echo "Push failed, continuing..." - name: Comment on Pull Request uses: actions/github-script@v6 with: script: | - const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The template branch has been reverted.`; + const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The main branch has been reverted.`; github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, owner: context.repo.owner, From 5de46d9da64c688688994961d734938878135b50 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 14:36:41 +0100 Subject: [PATCH 043/157] update README --- README.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 5b39373..1454047 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,11 @@ # jaspModuleTemplate -This `dev/template` branch is a template for creating a new JASP module. It is a simple example that demonstrates how to create a new module that can be loaded into JASP. The module is written in Python and uses the `jasp` package to interact with JASP. +This template repository is a starting point for developing a new module for JASP. It contains the necessary files and structure to get you started. ## Forking this repository -Fork this template and untick `Copy the master branch only` to get all branches including the `dev/template` branch. Clone this repository to your local machine and start developing your module. Switch to the `dev/template` branch to get the template code. - -```bash -git fetch -git checkout dev/template -``` +Fork this template repository to your own GitHub account to start developing your module. You can then clone the repository to your local machine and start developing your module. ## Contributing back new module to JASP -Make sure you name your module appropiataly in the DESCRIPTION file and add a README.md file that explains what your module does. When you are ready to contribute your module back to JASP, create a pull request to the `dev/template` branch of this repository. We will review your module and help you get it into JASP. +Once you have developed your module, you can contribute it back to JASP by creating a pull request. The JASP team will review your module and provide feedback. Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository. From 2761849a219338a68923ddfe9e799d2e00e483fd Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 13:38:03 +0000 Subject: [PATCH 044/157] Revert "Merge pull request #9 from jasp-escience/dev/template" This reverts commit e847d4fb642a076f808be306b624134742f476f6, reversing changes made to e04cc19efb5f0c9f71444bba2e9de3b8a6d4debe. --- .github/workflows/check_module_on_pr.yml | 34 --------- .github/workflows/i18nCheck.yml | 14 ++-- .github/workflows/post-merge-new-repo.yml | 91 ----------------------- .github/workflows/post-merge-revert.yml | 72 ------------------ .github/workflows/unittests.yml | 17 +++-- .gitignore | 1 - DESCRIPTION | 2 +- README.md | 12 +-- 8 files changed, 18 insertions(+), 225 deletions(-) delete mode 100644 .github/workflows/check_module_on_pr.yml delete mode 100644 .github/workflows/post-merge-new-repo.yml delete mode 100644 .github/workflows/post-merge-revert.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml deleted file mode 100644 index e546821..0000000 --- a/.github/workflows/check_module_on_pr.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Check DESCRIPTION File - -on: - pull_request: - types: [opened, synchronize] - -jobs: - check-description-file: - runs-on: ubuntu-latest - - steps: - # Step 1: Check out the repository - - name: Checkout repository - uses: actions/checkout@v4 - - # Step 2: Check if the DESCRIPTION file exists - - name: Verify DESCRIPTION file exists - run: | - if [ ! -f "DESCRIPTION" ]; then - echo "ERROR: DESCRIPTION file is missing." - exit 1 - else - echo "DESCRIPTION file exists." - fi - - - name: Check for package name in DESCRIPTION - run: | - PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in meta.yaml" >&2 - exit 1 - fi - echo "Package name OK: $PACKAGE_NAME" - shell: bash diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml index 10411ed..ed48104 100644 --- a/.github/workflows/i18nCheck.yml +++ b/.github/workflows/i18nCheck.yml @@ -1,10 +1,10 @@ -on: - # push: - # paths: ['**.R', '**.qml', '**.po', '**.yml'] - # - # pull_request: - # paths: ['**.R', '**.qml', '**.po', '**.yml'] - # +on: + push: + paths: ['**.R', '**.qml', '**.po', '**.yml'] + + pull_request: + paths: ['**.R', '**.qml', '**.po', '**.yml'] + workflow_dispatch: name: i18n-check diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml deleted file mode 100644 index b47e207..0000000 --- a/.github/workflows/post-merge-new-repo.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Post-Merge Repository Creation and Revert Pull Request - -on: - pull_request_target: - types: - - closed # Trigger when a pull request is closed (merged or not) - -jobs: - create_new_repository: - if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged - runs-on: ubuntu-24.04 - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all branches and commit history - - - name: Extract Package Name from DESCRIPTION - run: | - PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - echo "Package name: $PACKAGE_NAME" - echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - shell: bash - - - name: Create New Repository in Organization - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - echo "Creating repository $REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") - - if echo "$RESPONSE" | grep -q '"full_name"'; then - echo "Repository created successfully: $REPO_NAME" - echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV - else - echo "Failed to create repository: $RESPONSE" - exit 1 - fi - - - name: Push Merged Code to New Repository - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - git clone "https://github.com/${{ github.repository }}.git" temp_repo - cd temp_repo - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" - git push --mirror - - revert_main_branch: - if: always() # Always run this job, even if the previous job fails - runs-on: ubuntu-24.04 - needs: [create_new_repository] - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git User - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - - name: Revert Main Branch to Pre-Merge State - run: | - MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." - git push origin main || echo "Push failed, continuing..." - - - name: Comment on Pull Request - uses: actions/github-script@v6 - with: - script: | - const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The main branch has been reverted.`; - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); diff --git a/.github/workflows/post-merge-revert.yml b/.github/workflows/post-merge-revert.yml deleted file mode 100644 index 46f4c09..0000000 --- a/.github/workflows/post-merge-revert.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Post-Merge Branch and Revert Template Branch - -on: - workflow_dispatch: - # - # pull_request_target: - # types: - # - closed # Trigger when a pull request is closed (merged or not) - -jobs: - post_merge_revert: - if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged - runs-on: ubuntu-24.04 - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all branches and commit history - - - name: Extract Package Name from DESCRIPTION - run: | - PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in meta.yaml" >&2 - exit 1 - fi - echo "Package name: $PACKAGE_NAME" - echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV - shell: bash - - - name: Create Branch with Merge Sources - run: | - MERGED_BRANCH="module/${{ env.PACKAGE_NAME }}" - git checkout -b $MERGED_BRANCH - echo "Branch created: $MERGED_BRANCH" - git push --set-upstream origin $MERGED_BRANCH - - revert_branch: - if: always() # Always run this job, even if the previous job fails - runs-on: ubuntu-24.04 - needs: [post_merge_revert] # Wait for the previous job to complete - # continue-on-error: true # Continue even if the previous job fails - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git User - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - - name: Revert Template Branch to Pre-Merge State - run: | - MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT - git push origin dev/template - - - name: Comment on Pull Request - uses: actions/github-script@v6 - with: - script: | - const comment = `The pull request was merged. A new branch \`module/${process.env.PACKAGE_NAME}\` has been created with the merge changes. The template branch has been reverted to before the merge.`; - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index f3738a0..1aebc7e 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,17 +1,18 @@ on: - workflow_dispatch: # remove this line to enable automatic testing - #push: - #paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] - #pull_request: - #paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] - #schedule: - #- cron: '13 12 * * 1-5' + push: + paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] + pull_request: + paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] + schedule: + - cron: '13 12 * * 1-5' name: unit-tests jobs: + unit-tests: + uses: jasp-stats/jasp-actions/.github/workflows/unittests.yml@master with: - needs_JAGS: false + needs_JAGS: false needs_igraph: false diff --git a/.gitignore b/.gitignore index 796b6be..854a153 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -*secret* # Compiled Object files *.slo *.lo diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..1ce6d31 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: jaspModule Type: Package Title: A module for JASP Version: 0.1.0 diff --git a/README.md b/README.md index 1454047..99b0d43 100644 --- a/README.md +++ b/README.md @@ -1,11 +1 @@ -# jaspModuleTemplate - -This template repository is a starting point for developing a new module for JASP. It contains the necessary files and structure to get you started. - -## Forking this repository - -Fork this template repository to your own GitHub account to start developing your module. You can then clone the repository to your local machine and start developing your module. - -## Contributing back new module to JASP - -Once you have developed your module, you can contribute it back to JASP by creating a pull request. The JASP team will review your module and provide feedback. Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository. +# jaspModuleTemplate \ No newline at end of file From a3ea1102360020471a27fc4e9c797de66a8013e7 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 14:49:35 +0100 Subject: [PATCH 045/157] adding workflows to main branch --- .github/workflows/check_module_on_pr.yml | 34 +++++++++ .github/workflows/i18nCheck.yml | 17 +++-- .github/workflows/post-merge-new-repo.yml | 91 +++++++++++++++++++++++ .github/workflows/translations.yml | 8 +- .github/workflows/unittests.yml | 19 ++--- DESCRIPTION | 2 +- README.md | 12 ++- 7 files changed, 162 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/check_module_on_pr.yml create mode 100644 .github/workflows/post-merge-new-repo.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml new file mode 100644 index 0000000..e546821 --- /dev/null +++ b/.github/workflows/check_module_on_pr.yml @@ -0,0 +1,34 @@ +name: Check DESCRIPTION File + +on: + pull_request: + types: [opened, synchronize] + +jobs: + check-description-file: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Step 2: Check if the DESCRIPTION file exists + - name: Verify DESCRIPTION file exists + run: | + if [ ! -f "DESCRIPTION" ]; then + echo "ERROR: DESCRIPTION file is missing." + exit 1 + else + echo "DESCRIPTION file exists." + fi + + - name: Check for package name in DESCRIPTION + run: | + PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in meta.yaml" >&2 + exit 1 + fi + echo "Package name OK: $PACKAGE_NAME" + shell: bash diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml index ed48104..ec3c06b 100644 --- a/.github/workflows/i18nCheck.yml +++ b/.github/workflows/i18nCheck.yml @@ -1,12 +1,15 @@ -on: - push: - paths: ['**.R', '**.qml', '**.po', '**.yml'] - - pull_request: - paths: ['**.R', '**.qml', '**.po', '**.yml'] - +on: workflow_dispatch: +# on: +# push: +# paths: ['**.R', '**.qml', '**.po', '**.yml'] +# +# pull_request: +# paths: ['**.R', '**.qml', '**.po', '**.yml'] +# +# workflow_dispatch: + name: i18n-check jobs: diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml new file mode 100644 index 0000000..b47e207 --- /dev/null +++ b/.github/workflows/post-merge-new-repo.yml @@ -0,0 +1,91 @@ +name: Post-Merge Repository Creation and Revert Pull Request + +on: + pull_request_target: + types: + - closed # Trigger when a pull request is closed (merged or not) + +jobs: + create_new_repository: + if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged + runs-on: ubuntu-24.04 + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches and commit history + + - name: Extract Package Name from DESCRIPTION + run: | + PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + echo "Package name: $PACKAGE_NAME" + echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + shell: bash + + - name: Create New Repository in Organization + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + echo "Creating repository $REPO_NAME..." + RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/${ORG_NAME}/repos \ + -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") + + if echo "$RESPONSE" | grep -q '"full_name"'; then + echo "Repository created successfully: $REPO_NAME" + echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV + else + echo "Failed to create repository: $RESPONSE" + exit 1 + fi + + - name: Push Merged Code to New Repository + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + git clone "https://github.com/${{ github.repository }}.git" temp_repo + cd temp_repo + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" + git push --mirror + + revert_main_branch: + if: always() # Always run this job, even if the previous job fails + runs-on: ubuntu-24.04 + needs: [create_new_repository] + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + - name: Revert Main Branch to Pre-Merge State + run: | + MERGE_COMMIT=$(git rev-parse HEAD) + git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." + git push origin main || echo "Push failed, continuing..." + + - name: Comment on Pull Request + uses: actions/github-script@v6 + with: + script: | + const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The main branch has been reverted.`; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index eaa64e1..0ae22e8 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -1,9 +1,11 @@ on: - #schedule: - # - cron: '*/5 * * * *' - workflow_dispatch: +# on: +# schedule: +# - cron: '*/5 * * * *' +# workflow_dispatch: +# name: generate-translations jobs: diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 1aebc7e..45bb379 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -1,18 +1,19 @@ on: - push: - paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] - pull_request: - paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] - schedule: - - cron: '13 12 * * 1-5' + workflow_dispatch: + +# on: +# push: +# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] +# pull_request: +# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] +# schedule: +# - cron: '13 12 * * 1-5' name: unit-tests jobs: - unit-tests: - uses: jasp-stats/jasp-actions/.github/workflows/unittests.yml@master with: - needs_JAGS: false + needs_JAGS: false needs_igraph: false diff --git a/DESCRIPTION b/DESCRIPTION index 1ce6d31..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 diff --git a/README.md b/README.md index 99b0d43..1454047 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# jaspModuleTemplate \ No newline at end of file +# jaspModuleTemplate + +This template repository is a starting point for developing a new module for JASP. It contains the necessary files and structure to get you started. + +## Forking this repository + +Fork this template repository to your own GitHub account to start developing your module. You can then clone the repository to your local machine and start developing your module. + +## Contributing back new module to JASP + +Once you have developed your module, you can contribute it back to JASP by creating a pull request. The JASP team will review your module and provide feedback. Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository. From 5ace604a5d0412127942d1b6ddb48cf7cb4a9856 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 14:51:04 +0100 Subject: [PATCH 046/157] new module myJaspModule --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 96b20711eb274622ce000bfc113662d7c111fe81 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 30 Jan 2025 13:52:37 +0000 Subject: [PATCH 047/157] Revert "Merge pull request #10 from recap/main" This reverts commit 622abb07f5afb285553fd187b0370acff0e7fb6e, reversing changes made to a3ea1102360020471a27fc4e9c797de66a8013e7. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 3c298bd79d7cc154efc0ef056377c71248144589 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Thu, 30 Jan 2025 15:58:25 +0100 Subject: [PATCH 048/157] only run template workflows when PR is from forked repos --- .github/workflows/check_module_on_pr.yml | 1 + .github/workflows/post-merge-new-repo.yml | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index e546821..9451473 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -6,6 +6,7 @@ on: jobs: check-description-file: + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run on PRs from forks runs-on: ubuntu-latest steps: diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index b47e207..7b54372 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -7,7 +7,8 @@ on: jobs: create_new_repository: - if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged + # if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged + if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope @@ -57,7 +58,8 @@ jobs: git push --mirror revert_main_branch: - if: always() # Always run this job, even if the previous job fails + # if: always() # Always run this job, even if the previous job fails + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork runs-on: ubuntu-24.04 needs: [create_new_repository] From 1ec524b6a03c12c88338de01e7a76ce570ebd9e8 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:28:05 +0100 Subject: [PATCH 049/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 7b54372..9bce8fb 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -91,3 +91,18 @@ jobs: repo: context.repo.repo, body: comment }); + + - name: Add New Repository as a Submodule in jasp-escience/modules + env: + MODULES_REPO: "github.com/${ORG_NAME}/modules" + run: | + git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo + cd modules_repo + + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} + git add .gitmodules modules/${MODULE_NAME} + git commit -m "Added ${MODULE_NAME} as a submodule under modules/" + git push origin main From 6c75bbe840737b0c89151d0b7a7d4457844f1252 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:31:32 +0100 Subject: [PATCH 050/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 56db8539427891e005d3f6ee0dd532071a577d2f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 10:32:55 +0000 Subject: [PATCH 051/157] Revert "Merge pull request #11 from recap/main" This reverts commit dd3546333540c5007b52aac0ed1d2a902279ecb4, reversing changes made to 1ec524b6a03c12c88338de01e7a76ce570ebd9e8. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 7e6250ad436ad12d815db076006275eff202974e Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:39:00 +0100 Subject: [PATCH 052/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 9bce8fb..2f96aac 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -92,9 +92,15 @@ jobs: body: comment }); + add_submodule: + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + runs-on: ubuntu-24.04 + needs: [create_new_repository] + + steps: - name: Add New Repository as a Submodule in jasp-escience/modules env: - MODULES_REPO: "github.com/${ORG_NAME}/modules" + MODULES_REPO: "github.com/jasp-escience/modules" run: | git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo cd modules_repo From e46323f83da86839f0dafbac42d1f763d8b1ecd0 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:39:50 +0100 Subject: [PATCH 053/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From b33049ab763c7e53834ab54dbaf6779de9ab7de9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 10:41:18 +0000 Subject: [PATCH 054/157] Revert "Merge pull request #12 from recap/main" This reverts commit 82d384dae55d63f61f27e5494e00262d7e6fb9c1, reversing changes made to 7e6250ad436ad12d815db076006275eff202974e. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 8f43d82c0c406d44b8cf3196218eb51b58d5a7e8 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:46:56 +0100 Subject: [PATCH 055/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 2f96aac..402a0b7 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -100,7 +100,11 @@ jobs: steps: - name: Add New Repository as a Submodule in jasp-escience/modules env: + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name MODULES_REPO: "github.com/jasp-escience/modules" + MODULE_NAME: ${{ process.env.MODULE_NAME }} run: | git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo cd modules_repo From c5d1622ea3ae29c2e473bf3b794b2274fc79924f Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:48:42 +0100 Subject: [PATCH 056/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..e7cb4c4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: MyJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 0f0c843a5cc0b4425a3c71fdefca9f9d0df3bb98 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:51:34 +0100 Subject: [PATCH 057/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 1 - DESCRIPTION | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 402a0b7..10baee6 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -99,7 +99,6 @@ jobs: steps: - name: Add New Repository as a Submodule in jasp-escience/modules - env: env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name diff --git a/DESCRIPTION b/DESCRIPTION index e7cb4c4..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: MyJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 9fbf312f2ffa5b484ceaba67971bb6f9c4bedee4 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:52:41 +0100 Subject: [PATCH 058/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 012250666dc35a3afefa49252213b3352b02f44b Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 11:58:56 +0100 Subject: [PATCH 059/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 10baee6..9c4beb9 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -103,7 +103,6 @@ jobs: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name MODULES_REPO: "github.com/jasp-escience/modules" - MODULE_NAME: ${{ process.env.MODULE_NAME }} run: | git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo cd modules_repo @@ -111,7 +110,7 @@ jobs: git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" - git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} - git add .gitmodules modules/${MODULE_NAME} - git commit -m "Added ${MODULE_NAME} as a submodule under modules/" + git submodule add https://github.com/${ORG_NAME}/${process.env.MODULE_NAME}.git modules/${process.env.MODULE_NAME} + git add .gitmodules modules/${process.env.MODULE_NAME} + git commit -m "Added ${process.env.MODULE_NAME} as a submodule under modules/" git push origin main From 8e10709d01a385988a8bef2e326e5e995724dfd2 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:00:26 +0100 Subject: [PATCH 060/157] updating workflow to add submodule to modules repo --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 855672ad53b18ed7baec7bff7b14670ca309a4fa Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:01:09 +0100 Subject: [PATCH 061/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From d4e65acca1b756319ea5192dbe453bb6531564fd Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 11:02:04 +0000 Subject: [PATCH 062/157] Revert "Merge pull request #15 from recap/main" This reverts commit 29ae05b6e503624b3ba14c18732c295cf58447c6, reversing changes made to 8e10709d01a385988a8bef2e326e5e995724dfd2. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From e3c182fc7cd3aa3b80ecd31c2e9bc4b49779a1ac Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:10:12 +0100 Subject: [PATCH 063/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 9c4beb9..58f67e5 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -30,6 +30,8 @@ jobs: echo "Package name: $PACKAGE_NAME" echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + echo "ORG_NAME=$ORG_NAME" >> $GITHUB_ENV + echo "MODULES_REPO=github.com/${ORG_NAME}/modules" >> $GITHUB_ENV shell: bash - name: Create New Repository in Organization @@ -101,16 +103,19 @@ jobs: - name: Add New Repository as a Submodule in jasp-escience/modules env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - MODULES_REPO: "github.com/jasp-escience/modules" run: | + echo "---------------------------------" + echo $ORG_NAME + echo $MODULE_NAME + echo $MODULES_REPO + echo "---------------------------------" git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo cd modules_repo git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" - git submodule add https://github.com/${ORG_NAME}/${process.env.MODULE_NAME}.git modules/${process.env.MODULE_NAME} - git add .gitmodules modules/${process.env.MODULE_NAME} - git commit -m "Added ${process.env.MODULE_NAME} as a submodule under modules/" + git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} + git add .gitmodules modules/${MODULE_NAME} + git commit -m "Added ${MODULE_NAME} as a submodule under modules/" git push origin main From bf5fea18eb14e34b02ed942a53672ae0ba2e7ac0 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:11:32 +0100 Subject: [PATCH 064/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From a7a5db5d884ffdf54937d0cd957df09330e91a61 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 11:12:39 +0000 Subject: [PATCH 065/157] Revert "Merge pull request #16 from recap/main" This reverts commit 4ece16a280e276a647e81d0c56fcf6c08c888675, reversing changes made to e3c182fc7cd3aa3b80ecd31c2e9bc4b49779a1ac. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 6d9d5a95efa288ade2c567bac4b02e8ab09338ce Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:14:10 +0100 Subject: [PATCH 066/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 58f67e5..8f99c9a 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -103,6 +103,9 @@ jobs: - name: Add New Repository as a Submodule in jasp-escience/modules env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: ${{ env.ORG_NAME }} + MODULE_NAME: ${{ env.MODULE_NAME }} + MODULES_REPO: ${{ env.MODULES_REPO }} run: | echo "---------------------------------" echo $ORG_NAME From 3effe54ff2c431b82e611cd49bed1a042dc6e513 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 12:15:08 +0100 Subject: [PATCH 067/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From ee763ccac771e1ee99f232b84d48876fb66b2341 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 11:17:22 +0000 Subject: [PATCH 068/157] Revert "Merge pull request #17 from recap/main" This reverts commit 163a8c02ae668fa170f72e083b6fef6e858c06f7, reversing changes made to 6d9d5a95efa288ade2c567bac4b02e8ab09338ce. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From b35c584a98aaf461dcc8b04b3d2d65cda4372c34 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 14:37:41 +0100 Subject: [PATCH 069/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 28 ++++++++++++----------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 8f99c9a..8e40fef 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -10,6 +10,10 @@ jobs: # if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 + outputs: + package_name: ${{ steps.extract_vars.outputs.package_name }} + module_name: ${{ steps.extract_vars.outputs.module_name }} + org_name: ${{ steps.extract_vars.outputs.org_name }} env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name @@ -21,6 +25,7 @@ jobs: fetch-depth: 0 # Fetch all branches and commit history - name: Extract Package Name from DESCRIPTION + id: extract_vars run: | PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') if [ -z "$PACKAGE_NAME" ]; then @@ -30,8 +35,9 @@ jobs: echo "Package name: $PACKAGE_NAME" echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "ORG_NAME=$ORG_NAME" >> $GITHUB_ENV - echo "MODULES_REPO=github.com/${ORG_NAME}/modules" >> $GITHUB_ENV + echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUTS + echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUTS + echo "org_name=$ORG_NAME" >> $GITHUB_OUTPUTS shell: bash - name: Create New Repository in Organization @@ -95,23 +101,19 @@ jobs: }); add_submodule: - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork runs-on: ubuntu-24.04 needs: [create_new_repository] + env: + ORG_PAT: ${{ secrets.ORG_PAT }} + ORG_NAME: "jasp-escience" + MODULES_REPO: "github.com/jasp-escience/modules" + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + steps: - name: Add New Repository as a Submodule in jasp-escience/modules - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: ${{ env.ORG_NAME }} - MODULE_NAME: ${{ env.MODULE_NAME }} - MODULES_REPO: ${{ env.MODULES_REPO }} run: | - echo "---------------------------------" - echo $ORG_NAME - echo $MODULE_NAME - echo $MODULES_REPO - echo "---------------------------------" git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo cd modules_repo From 7c3760e3b77b6444eeb92f905a560e389e4e6592 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 14:44:34 +0100 Subject: [PATCH 070/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 1ff369f7581b8d81b8d2519ecfd5167358423fb9 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 14:51:26 +0100 Subject: [PATCH 071/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 6 +++--- DESCRIPTION | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 8e40fef..b5bdb37 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -35,9 +35,9 @@ jobs: echo "Package name: $PACKAGE_NAME" echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUTS - echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUTS - echo "org_name=$ORG_NAME" >> $GITHUB_OUTPUTS + echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT + echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT + echo "org_name=$ORG_NAME" >> $GITHUB_OUTPUT shell: bash - name: Create New Repository in Organization diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 99ee5ceb201a92c0dfe1ba57f7c5a8b1cdb63067 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 14:52:31 +0100 Subject: [PATCH 072/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 939dbda0adc4d66cbe72ad838413d9fb27b1b3f3 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 31 Jan 2025 13:53:55 +0000 Subject: [PATCH 073/157] Revert "Merge pull request #19 from recap/main" This reverts commit 9d48366be37bd79d38446a7ef3718b1ec3ad3fa3, reversing changes made to 1ff369f7581b8d81b8d2519ecfd5167358423fb9. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 4ea3f704998663bae0428bf994c61e1a1e273679 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 31 Jan 2025 15:05:28 +0100 Subject: [PATCH 074/157] updating workflow to add submodule to modules repo --- .github/workflows/post-merge-new-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index b5bdb37..3960bd2 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -10,7 +10,7 @@ jobs: # if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 - outputs: + outputs: # Define output variables. We need these to pass information between jobs package_name: ${{ steps.extract_vars.outputs.package_name }} module_name: ${{ steps.extract_vars.outputs.module_name }} org_name: ${{ steps.extract_vars.outputs.org_name }} From a956bf078e41147d9a95731342f9dc4341913323 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 10:49:26 +0100 Subject: [PATCH 075/157] increase security in PR workflow. --- .github/workflows/check_module_on_pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 9451473..1250e85 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -4,6 +4,8 @@ on: pull_request: types: [opened, synchronize] +permissions: {} + jobs: check-description-file: if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run on PRs from forks @@ -12,6 +14,7 @@ jobs: steps: # Step 1: Check out the repository - name: Checkout repository + persist-credentials: false uses: actions/checkout@v4 # Step 2: Check if the DESCRIPTION file exists From 3732b91adea92e7867876be048fc743549ddddb8 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 10:52:17 +0100 Subject: [PATCH 076/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 9185655d42aae31a9b367418cd6857ef0ca74105 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 10:58:45 +0100 Subject: [PATCH 077/157] increase security in PR workflow. --- .github/workflows/check_module_on_pr.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 1250e85..9d199cd 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -14,8 +14,10 @@ jobs: steps: # Step 1: Check out the repository - name: Checkout repository - persist-credentials: false uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false # Step 2: Check if the DESCRIPTION file exists - name: Verify DESCRIPTION file exists From a4fd350995272ff74b3b93aff5d905dee085f5e3 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 13:51:03 +0100 Subject: [PATCH 078/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 3960bd2..25d173d 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -7,13 +7,12 @@ on: jobs: create_new_repository: - # if: ${{ github.event.pull_request.merged == true }} # Only run if the PR was merged if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 + permissions: {} + outputs: # Define output variables. We need these to pass information between jobs - package_name: ${{ steps.extract_vars.outputs.package_name }} module_name: ${{ steps.extract_vars.outputs.module_name }} - org_name: ${{ steps.extract_vars.outputs.org_name }} env: ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name @@ -23,6 +22,7 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 # Fetch all branches and commit history + persist-credentials: false # Do not persist credentials to the git config - name: Extract Package Name from DESCRIPTION id: extract_vars @@ -32,12 +32,14 @@ jobs: echo "Error: Package name not found in DESCRIPTION" >&2 exit 1 fi - echo "Package name: $PACKAGE_NAME" - echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV + # Prevent special characters in package name + if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: PACKAGE_NAME contains invalid characters!" >&2 + exit 1 + fi + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT - echo "org_name=$ORG_NAME" >> $GITHUB_OUTPUT shell: bash - name: Create New Repository in Organization @@ -70,6 +72,8 @@ jobs: if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork runs-on: ubuntu-24.04 needs: [create_new_repository] + env: + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} steps: - name: Checkout Repository @@ -92,7 +96,7 @@ jobs: uses: actions/github-script@v6 with: script: | - const comment = `The pull request was merged. A new repository [${process.env.PACKAGE_NAME}](https://github.com/${{ github.repository_owner }}/${process.env.PACKAGE_NAME}) has been created in the organization with the merged content. The main branch has been reverted.`; + const comment = "The pull request was merged. A new repository [$MODULE_NAME](https://github.com/${{ github.repository_owner }}/$MODULE_NAME) has been created in the organization with the merged content. The main branch has been reverted."; github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, owner: context.repo.owner, From cb754d28a73e281c5f8ecd339a9838fec972cb69 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 13:58:15 +0100 Subject: [PATCH 079/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 25d173d..3240967 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -5,11 +5,12 @@ on: types: - closed # Trigger when a pull request is closed (merged or not) +permissions: {} + jobs: create_new_repository: if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 - permissions: {} outputs: # Define output variables. We need these to pass information between jobs module_name: ${{ steps.extract_vars.outputs.module_name }} @@ -70,6 +71,10 @@ jobs: revert_main_branch: # if: always() # Always run this job, even if the previous job fails if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + permissions: + contents: write + actions: read + runs-on: ubuntu-24.04 needs: [create_new_repository] env: From 5d00a2938c0c419ae0a662f942d7ef7ecdf74af9 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Feb 2025 13:02:54 +0000 Subject: [PATCH 080/157] Revert "Merge pull request #22 from recap/main" This reverts commit bfd3ec02c79df1147966351b3de14532cfe14018, reversing changes made to cb754d28a73e281c5f8ecd339a9838fec972cb69. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From f00d0c1fc8e0472457bb3500a9d80dad76eac3d4 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:09:32 +0100 Subject: [PATCH 081/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 3240967..41ceb9a 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -74,6 +74,7 @@ jobs: permissions: contents: write actions: read + pull-requests: write runs-on: ubuntu-24.04 needs: [create_new_repository] From 4f75bf0df90d3fb2f6faa2af626396a35da4e098 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:14:19 +0100 Subject: [PATCH 082/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 6e62b6c63f013e7722bd5c0ab80c476962d5d2b1 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Feb 2025 13:18:24 +0000 Subject: [PATCH 083/157] Revert "Merge pull request #23 from recap/main" This reverts commit da3bdfc721ff1255ea8ecbf117752ec458fe156a, reversing changes made to f00d0c1fc8e0472457bb3500a9d80dad76eac3d4. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From b5998f360fc0e56496bae67f62fa2073eb817dda Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:29:24 +0100 Subject: [PATCH 084/157] increase security in PR workflow. --- .github/workflows/check_module_on_pr.yml | 8 ++++++-- .github/workflows/post-merge-new-repo.yml | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 9d199cd..58b6c7d 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -33,8 +33,12 @@ jobs: run: | PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in meta.yaml" >&2 + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + # Prevent special characters in package name + if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi - echo "Package name OK: $PACKAGE_NAME" shell: bash diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 41ceb9a..5161076 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -102,7 +102,8 @@ jobs: uses: actions/github-script@v6 with: script: | - const comment = "The pull request was merged. A new repository [$MODULE_NAME](https://github.com/${{ github.repository_owner }}/$MODULE_NAME) has been created in the organization with the merged content. The main branch has been reverted."; + const module_name = process.env.MODULE_NAME; + const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/**${module_name}**) has been created in the organization with the merged content. The main branch has been reverted.`; github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, owner: context.repo.owner, From 9e2ec409e1cced7020123ba90b18fe80986d8df7 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:45:55 +0100 Subject: [PATCH 085/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 5161076..aaf6742 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,7 +1,7 @@ name: Post-Merge Repository Creation and Revert Pull Request on: - pull_request_target: + pull_request: types: - closed # Trigger when a pull request is closed (merged or not) @@ -71,26 +71,30 @@ jobs: revert_main_branch: # if: always() # Always run this job, even if the previous job fails if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - permissions: - contents: write - actions: read - pull-requests: write + # permissions: + # contents: write + # actions: read + # pull-requests: write runs-on: ubuntu-24.04 needs: [create_new_repository] env: MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + ORG_PAT: ${{ secrets.ORG_PAT }} steps: - name: Checkout Repository uses: actions/checkout@v4 with: fetch-depth: 0 + persist-credentials: false - name: Configure Git User run: | git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" + # Authenticate Git with Personal Access Token (PAT) + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - name: Revert Main Branch to Pre-Merge State run: | @@ -100,6 +104,8 @@ jobs: - name: Comment on Pull Request uses: actions/github-script@v6 + env: + GITHUB_TOKEN: ${{ secrets.ORG_PAT }} with: script: | const module_name = process.env.MODULE_NAME; From de323300f6656913024cbaa3a4cf90b205571e6e Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:47:24 +0100 Subject: [PATCH 086/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 81fee168fa1a4dd11c5c789e4518db30681ab91f Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 14:57:42 +0100 Subject: [PATCH 087/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 7 +++++-- DESCRIPTION | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index aaf6742..ea80166 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -69,8 +69,7 @@ jobs: git push --mirror revert_main_branch: - # if: always() # Always run this job, even if the previous job fails - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + if: always() # Always run this job, even if the previous job fails # permissions: # contents: write # actions: read @@ -84,12 +83,14 @@ jobs: steps: - name: Checkout Repository + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork uses: actions/checkout@v4 with: fetch-depth: 0 persist-credentials: false - name: Configure Git User + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork run: | git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" @@ -97,12 +98,14 @@ jobs: git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - name: Revert Main Branch to Pre-Merge State + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork run: | MERGE_COMMIT=$(git rev-parse HEAD) git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." git push origin main || echo "Push failed, continuing..." - name: Comment on Pull Request + if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork uses: actions/github-script@v6 env: GITHUB_TOKEN: ${{ secrets.ORG_PAT }} diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 10d67e3ff7037d103c3ddaf04197075fa905e1fc Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:05:10 +0100 Subject: [PATCH 088/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index ea80166..b90a09f 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,7 +1,7 @@ name: Post-Merge Repository Creation and Revert Pull Request on: - pull_request: + pull_request_target: types: - closed # Trigger when a pull request is closed (merged or not) From d6037fdc822dd3284e34d7509bb7853a6446e580 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:06:04 +0100 Subject: [PATCH 089/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 8742464045256a6d766524562ac135b0e6148b16 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:07:19 +0100 Subject: [PATCH 090/157] test modify workflow --- .github/workflows/post-merge-new-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index b90a09f..0082bad 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -38,7 +38,7 @@ jobs: echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi - + echo "This is from the FORKED REPO" echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT shell: bash From 7aa11e756118cd19b21e6fa6dc673a5406651a05 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Feb 2025 14:09:26 +0000 Subject: [PATCH 091/157] Revert "Merge pull request #25 from recap/main" This reverts commit e4d8b3cf06367f9a87907e2145b8fd6dea437312, reversing changes made to 10d67e3ff7037d103c3ddaf04197075fa905e1fc. --- .github/workflows/post-merge-new-repo.yml | 2 +- DESCRIPTION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 0082bad..b90a09f 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -38,7 +38,7 @@ jobs: echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi - echo "This is from the FORKED REPO" + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT shell: bash diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 38d30e3ae1c0cf288dc4541be3cae42d40a4e076 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:15:03 +0100 Subject: [PATCH 092/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index b90a09f..d2c7cfd 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,7 +1,8 @@ name: Post-Merge Repository Creation and Revert Pull Request on: - pull_request_target: + # pull_request_target: + pull_request: types: - closed # Trigger when a pull request is closed (merged or not) From 3178f2a0339e2bf67eba94751232e624b3ef61e2 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:18:38 +0100 Subject: [PATCH 093/157] increase security in PR workflow. --- .github/workflows/post-merge-new-repo.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index d2c7cfd..fab936b 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -71,10 +71,10 @@ jobs: revert_main_branch: if: always() # Always run this job, even if the previous job fails - # permissions: - # contents: write - # actions: read - # pull-requests: write + permissions: + contents: write + actions: read + pull-requests: write runs-on: ubuntu-24.04 needs: [create_new_repository] @@ -96,7 +96,7 @@ jobs: git config --global user.name "GitHub Actions" git config --global user.email "actions@github.com" # Authenticate Git with Personal Access Token (PAT) - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" + # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - name: Revert Main Branch to Pre-Merge State if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork @@ -108,12 +108,12 @@ jobs: - name: Comment on Pull Request if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork uses: actions/github-script@v6 - env: - GITHUB_TOKEN: ${{ secrets.ORG_PAT }} + # env: + # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} with: script: | const module_name = process.env.MODULE_NAME; - const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/**${module_name}**) has been created in the organization with the merged content. The main branch has been reverted.`; + const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; github.rest.issues.createComment({ issue_number: context.payload.pull_request.number, owner: context.repo.owner, From 3776744bec0ad233fdf8c09b88aa31956f0fb6bf Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:35:18 +0100 Subject: [PATCH 094/157] adding check for changes in .github/workflows --- .github/workflows/check_module_on_pr.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 58b6c7d..6eb1469 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -42,3 +42,17 @@ jobs: exit 1 fi shell: bash + + - name: Check if `.github/` folder was modified using Git diff + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) + + echo "Changed files:" + echo "$CHANGED_FILES" + + if echo "$CHANGED_FILES" | grep -q "^\.github/"; then + echo "❌ The `modules/` folder was been modified." + exit 1 + else + echo "βœ… The `modules/` folder has NOT modified." + fi From 268eb09c1a1b425fb855029673f9a77758ec85f8 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 15:42:56 +0100 Subject: [PATCH 095/157] adding check for changes in .github/workflows --- .github/workflows/check_module_on_pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 6eb1469..b04e820 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -51,8 +51,8 @@ jobs: echo "$CHANGED_FILES" if echo "$CHANGED_FILES" | grep -q "^\.github/"; then - echo "❌ The `modules/` folder was been modified." + echo "❌ The .github/ folder was been modified." exit 1 else - echo "βœ… The `modules/` folder has NOT modified." + echo "βœ… The .github/ folder has NOT modified." fi From 5d9bb95132ffd39195a6d5224ef2b5f586dc35dd Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:16:27 +0100 Subject: [PATCH 096/157] adding check for changes in .github/workflows --- .github/workflows/post-merge-new-repo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index fab936b..4444bce 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,8 +1,7 @@ name: Post-Merge Repository Creation and Revert Pull Request on: - # pull_request_target: - pull_request: + pull_request_target: types: - closed # Trigger when a pull request is closed (merged or not) From 25e1dc88a9760457ab02931e0df4179ce5429627 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:18:44 +0100 Subject: [PATCH 097/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 8bbe1a129a38180f3a5508363b6197ec78c34985 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:19:25 +0100 Subject: [PATCH 098/157] new module --- .github/workflows/post-merge-new-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 4444bce..99c4c2d 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -38,7 +38,7 @@ jobs: echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi - + echo "Oooops!" echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT shell: bash From a9f88a72a305577c5a216c25beb66a125b00e31b Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:27:37 +0100 Subject: [PATCH 099/157] manual revert --- .github/workflows/post-merge-new-repo.yml | 2 -- DESCRIPTION | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 99c4c2d..6fcfdc7 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -38,7 +38,6 @@ jobs: echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi - echo "Oooops!" echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT shell: bash @@ -87,7 +86,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - persist-credentials: false - name: Configure Git User if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From dfad630c907fa8e95ce635f1344448ca72533aa5 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:31:49 +0100 Subject: [PATCH 100/157] break if revert fails --- .github/workflows/post-merge-new-repo.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 6fcfdc7..060fcaf 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -99,8 +99,8 @@ jobs: if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork run: | MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT || echo "Revert failed, continuing..." - git push origin main || echo "Push failed, continuing..." + git revert -m 1 $MERGE_COMMIT + git push origin main - name: Comment on Pull Request if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork From 980f7a2d5ae757ddcfb23297a7a2d8f3b7b3b99a Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Mon, 3 Feb 2025 17:34:14 +0100 Subject: [PATCH 101/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From fcea838194f2cca9b72007a7dd56b4c228c61946 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Feb 2025 16:35:31 +0000 Subject: [PATCH 102/157] Revert "Merge pull request #28 from recap/main" This reverts commit 7a5e4d8f85031328d256ac57261f239353a24a3a, reversing changes made to dfad630c907fa8e95ce635f1344448ca72533aa5. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 7a0e40596f6d023a0f267729a2415f8a0716ddcf Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 4 Feb 2025 09:52:38 +0100 Subject: [PATCH 103/157] add new steps to check if module exists on PR creation --- .github/workflows/check_module_on_pr.yml | 34 +++++++++++++++++++++-- .github/workflows/post-merge-new-repo.yml | 3 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index b04e820..860c3b9 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -1,4 +1,4 @@ -name: Check DESCRIPTION File +name: Check pre-requisites for module creation on: pull_request: @@ -10,6 +10,8 @@ jobs: check-description-file: if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run on PRs from forks runs-on: ubuntu-latest + env: + ORG_NAME: "jasp-escience" steps: # Step 1: Check out the repository @@ -31,7 +33,8 @@ jobs: - name: Check for package name in DESCRIPTION run: | - PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') + # PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') + PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') if [ -z "$PACKAGE_NAME" ]; then echo "Error: Package name not found in DESCRIPTION" >&2 exit 1 @@ -41,6 +44,7 @@ jobs: echo "Error: PACKAGE_NAME contains invalid characters!" >&2 exit 1 fi + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV shell: bash - name: Check if `.github/` folder was modified using Git diff @@ -56,3 +60,29 @@ jobs: else echo "βœ… The .github/ folder has NOT modified." fi + + - name: Check if module already exists submodules + env: + MODULE_NAME: ${{ env.MODULE_NAME }} + run: | + git clone --depth=1 https://github.com/$ORG_NAME/modules.git target_repo + cd target_repo + if git config --file .gitmodules --get-regexp path | grep -q "^submodule.${MODULE_NAME} "; then + echo "❌ Submodule '${MODULE_NAME}' found! Failing the workflow." + exit 1 + else + echo "βœ… No submodule named '${MODULE_NAME}' found." + fi + shell: bash + + - name: Check if repository exists in organization + env: + MODULE_NAME: ${{ env.MODULE_NAME }} + run: | + if curl -s -o /dev/null -w "%{http_code}" "https://github.com/$ORG_NAME/$MODULE_NAME" | grep -q "200"; then + echo "❌ Repository '${MODULE_NAME}' exists in organization '${ORG_NAME}'. Failing the workflow." + exit 1 + else + echo "βœ… Repository '${MODULE_NAME}' does not exist in organization '${ORG_NAME}'." + fi + shell: bash diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 060fcaf..89440fd 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -28,7 +28,8 @@ jobs: - name: Extract Package Name from DESCRIPTION id: extract_vars run: | - PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') if [ -z "$PACKAGE_NAME" ]; then echo "Error: Package name not found in DESCRIPTION" >&2 exit 1 From bc4c3b2ca27c4c5cccfcd40faabbee258c067dab Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 4 Feb 2025 09:53:16 +0100 Subject: [PATCH 104/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 2b176404eec7e5e7eedf0650fb4ca4e784964261 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 4 Feb 2025 10:00:16 +0100 Subject: [PATCH 105/157] add new steps to check if module exists on PR creation --- .github/workflows/check_module_on_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 860c3b9..a7e944c 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -67,7 +67,7 @@ jobs: run: | git clone --depth=1 https://github.com/$ORG_NAME/modules.git target_repo cd target_repo - if git config --file .gitmodules --get-regexp path | grep -q "^submodule.${MODULE_NAME} "; then + if git config --file .gitmodules --get-regexp path | grep -q "^submodule.modules/${MODULE_NAME}.path"; then echo "❌ Submodule '${MODULE_NAME}' found! Failing the workflow." exit 1 else From 6928dc8299bae4df364569186d21bcc45c8fd6da Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 4 Feb 2025 10:02:38 +0100 Subject: [PATCH 106/157] add new steps to check if module exists on PR creation --- .github/workflows/check_module_on_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index a7e944c..6454f04 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -2,7 +2,7 @@ name: Check pre-requisites for module creation on: pull_request: - types: [opened, synchronize] + types: [opened] permissions: {} From d9a2b061cc4f43d41fac1c963c9f1506818c65f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Thu, 6 Feb 2025 11:53:51 +0100 Subject: [PATCH 107/157] Update ProcessData --- R/examples.R | 8 ++++---- inst/qml/data.qml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/examples.R b/R/examples.R index 9f275e9..5c3987f 100644 --- a/R/examples.R +++ b/R/examples.R @@ -8,10 +8,10 @@ AddOne <- function(jaspResults, dataset, options) { } ProcessData <- function(jaspResults, dataset, options) { - print("Find me!") - print(dataset) - - result <- paste0(as.character(dataset[,options$ts]), collapse = "") + # Dataset access + # options$ts --maps to--> 't' + # dataset[, options$ts] --maps to--> dataset$t + result <- paste(dataset[, options$ts], collapse = "") jaspResults[["result"]] <- createJaspHtml(text = result, title = "This is your result:") diff --git a/inst/qml/data.qml b/inst/qml/data.qml index 5b3cf05..f6bfa7b 100644 --- a/inst/qml/data.qml +++ b/inst/qml/data.qml @@ -33,8 +33,8 @@ Form { AvailableVariablesList { name: "allVariables" } AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); allowedColumns: ["scale"] } - AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); allowedColumns: ["scale"] } + AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } } } From e2e5e55972d22faf00127a8e1a1ee12b257681e0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 11 Feb 2025 12:27:50 +0000 Subject: [PATCH 108/157] Revert "Merge pull request #30 from jasp-escience/dummy" This reverts commit 5bb176d1381f06b9fa06b8c431addcd1d3776c42, reversing changes made to 6928dc8299bae4df364569186d21bcc45c8fd6da. --- .Rbuildignore | 2 - .Rprofile | 1 - .gitignore | 1 - NAMESPACE | 3 - R/examples.R | 39 -- inst/Description.qml | 38 +- inst/qml/data.qml | 40 -- inst/qml/integer.qml | 44 -- inst/qml/parabola.qml | 44 -- renv.lock | 1516 ----------------------------------------- 10 files changed, 1 insertion(+), 1727 deletions(-) delete mode 100644 .Rprofile delete mode 100644 R/examples.R delete mode 100644 inst/qml/data.qml delete mode 100644 inst/qml/integer.qml delete mode 100644 inst/qml/parabola.qml delete mode 100644 renv.lock diff --git a/.Rbuildignore b/.Rbuildignore index 7d392e5..112ad26 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,5 +1,3 @@ -^renv$ -^renv\.lock$ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ diff --git a/.Rprofile b/.Rprofile deleted file mode 100644 index 81b960f..0000000 --- a/.Rprofile +++ /dev/null @@ -1 +0,0 @@ -source("renv/activate.R") diff --git a/.gitignore b/.gitignore index 2a2473d..854a153 100644 --- a/.gitignore +++ b/.gitignore @@ -58,5 +58,4 @@ Thumbs.db # RStudio files .Rproj.user -renv/ _processedLockFile.lock diff --git a/NAMESPACE b/NAMESPACE index 0a4e42f..de016fe 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1 @@ import(jaspBase) -export(AddOne) -export(ProcessData) -export(Parabola) diff --git a/R/examples.R b/R/examples.R deleted file mode 100644 index c6e745a..0000000 --- a/R/examples.R +++ /dev/null @@ -1,39 +0,0 @@ -AddOne <- function(jaspResults, dataset, options) { - result <- as.character(options$my_number + 1) # options$my_number comes from the menu created by inst/qml/integer.qml - - jaspResults[["result"]] <- createJaspHtml(text = result, - title = "This is your result:") - - return() -} - -ProcessData <- function(jaspResults, dataset, options) { - # Dataset access - # options$ts --maps to--> 't' - # dataset[, options$ts] --maps to--> dataset$t - result <- paste(dataset[, options$ts], collapse = "") - jaspResults[["result"]] <- createJaspHtml(text = result, - title = "This is your result:") - - return() -} - -Parabola <- function(jaspResults, dataset, options) { - # Analysis - f <- function(x) { options$a * x^2 } # Function to be plotted - p <- ggplot2::ggplot() + # Plotting command - ggplot2::xlim(-3, 3) + - ggplot2::ylim(0, 10) + - ggplot2::geom_function(fun = f) - - # Aesthetics - parabolaPlot <- createJaspPlot(title = "Parabola", - width = 160, - height = 320) - parabolaPlot$dependOn(c("a")) # Refresh view whenever a changes - - jaspResults[["parabolaPlot"]] <- parabolaPlot - parabolaPlot$plotObject <- p - - return() -} diff --git a/inst/Description.qml b/inst/Description.qml index c8e103d..785abaf 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -5,46 +5,10 @@ Description { name : "jaspModule" title : qsTr("Jasp Module") - description : qsTr("Examples for module builders") + description : qsTr("This module offers analyses.") version : "0.1" author : "JASP Team" maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" - preloadData: true - requiresData: true - - - GroupTitle - { - title: qsTr("Basic functions") - } - - Analysis - { - title: "Add one" // Title for window - menu: "Add one" // Title for ribbon - func: "AddOne" // Function to be called - qml: "integer.qml" // Design input window - } - - Analysis - { - title: "Load data" - menu: "Load data" - func: "ProcessData" - qml: "data.qml" - } - - GroupTitle - { - title: qsTr("Plotting") - } - - Analysis - { - title: "Plot a parabola" - func: "Parabola" - qml: "parabola.qml" - } } diff --git a/inst/qml/data.qml b/inst/qml/data.qml deleted file mode 100644 index f6bfa7b..0000000 --- a/inst/qml/data.qml +++ /dev/null @@ -1,40 +0,0 @@ -// -// Copyright (C) 2013-2018 University of Amsterdam -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public -// License along with this program. If not, see -// . -// -import QtQuick 2.8 -import QtQuick.Layouts 1.3 -import JASP.Controls 1.0 -import JASP.Widgets 1.0 -import JASP 1.0 - -Form -{ - - Text - { - text: "This example shows how to load a dataset and perform a simple operation on it" - } - - VariablesForm - { - AvailableVariablesList { name: "allVariables" } - AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } - } - -} diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml deleted file mode 100644 index 696de88..0000000 --- a/inst/qml/integer.qml +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (C) 2013-2018 University of Amsterdam -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public -// License along with this program. If not, see -// . -// -import QtQuick 2.8 -import QtQuick.Layouts 1.3 -import JASP.Controls 1.0 -import JASP.Widgets 1.0 -import JASP 1.0 - -Form -{ - - Text - { - text: "This example shows how to manually introduce an input and perform a simple operation on it" - } - - IntegerField - { - name: "my_number" // This will map to options$my_number in R - label: qsTr("Type a number") // qsTr allows for future translations - - // We can add some extra control parameters - min: 1 - defaultValue: 10 - fieldWidth: 50 - max: 1000 - } - -} diff --git a/inst/qml/parabola.qml b/inst/qml/parabola.qml deleted file mode 100644 index d2703b8..0000000 --- a/inst/qml/parabola.qml +++ /dev/null @@ -1,44 +0,0 @@ -// -// Copyright (C) 2013-2018 University of Amsterdam -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public -// License along with this program. If not, see -// . -// -import QtQuick 2.8 -import QtQuick.Layouts 1.3 -import JASP.Controls 1.0 -import JASP.Widgets 1.0 -import JASP 1.0 - -Form -{ - - Text - { - text: "This example shows how to plot a curve" - } - - IntegerField - { - name: "a" // This will map to options$a in R - label: qsTr("Type a number") // qsTr allows for future translations - - // We can add some extra control parameters - min: -10 - defaultValue: 1 - fieldWidth: 50 - max: 10 - } - -} diff --git a/renv.lock b/renv.lock deleted file mode 100644 index 7648917..0000000 --- a/renv.lock +++ /dev/null @@ -1,1516 +0,0 @@ -{ - "R": { - "Version": "4.4.2", - "Repositories": [ - { - "Name": "CRAN", - "URL": "https://cloud.r-project.org" - } - ] - }, - "Packages": { - "Formula": { - "Package": "Formula", - "Version": "1.2-5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "7a29697b75e027767a53fde6c903eca7" - }, - "GPArotation": { - "Package": "GPArotation", - "Version": "2024.3-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "b8b658ec0d7a6a55d9d01e00e3cafd20" - }, - "Hmisc": { - "Package": "Hmisc", - "Version": "5.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Formula", - "R", - "base64enc", - "cluster", - "colorspace", - "data.table", - "foreign", - "ggplot2", - "grid", - "gridExtra", - "gtable", - "htmlTable", - "htmltools", - "knitr", - "methods", - "nnet", - "rmarkdown", - "rpart", - "viridis" - ], - "Hash": "9a446aea30bff7e8ee20f4c0973e8851" - }, - "MASS": { - "Package": "MASS", - "Version": "7.3-60.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "methods", - "stats", - "utils" - ], - "Hash": "2f342c46163b0b54d7b64d1f798e2c78" - }, - "Matrix": { - "Package": "Matrix", - "Version": "1.7-0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "grid", - "lattice", - "methods", - "stats", - "utils" - ], - "Hash": "1920b2f11133b12350024297d8a4ff4a" - }, - "R6": { - "Package": "R6", - "Version": "2.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "470851b6d5d0ac559e9d01bb352b4021" - }, - "RColorBrewer": { - "Package": "RColorBrewer", - "Version": "1.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "45f0398006e83a5b10b72a90663d8d8c" - }, - "Rcpp": { - "Package": "Rcpp", - "Version": "1.0.13", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "methods", - "utils" - ], - "Hash": "f27411eb6d9c3dada5edd444b8416675" - }, - "abind": { - "Package": "abind", - "Version": "1.4-8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods", - "utils" - ], - "Hash": "2288423bb0f20a457800d7fc47f6aa54" - }, - "askpass": { - "Package": "askpass", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "sys" - ], - "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" - }, - "backports": { - "Package": "backports", - "Version": "1.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "e1e1b9d75c37401117b636b7ae50827a" - }, - "base64enc": { - "Package": "base64enc", - "Version": "0.1-3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "543776ae6848fde2f48ff3816d0628bc" - }, - "bslib": { - "Package": "bslib", - "Version": "0.8.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "base64enc", - "cachem", - "fastmap", - "grDevices", - "htmltools", - "jquerylib", - "jsonlite", - "lifecycle", - "memoise", - "mime", - "rlang", - "sass" - ], - "Hash": "b299c6741ca9746fb227debcb0f9fb6c" - }, - "cachem": { - "Package": "cachem", - "Version": "1.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "fastmap", - "rlang" - ], - "Hash": "cd9a672193789068eb5a2aad65a0dedf" - }, - "callr": { - "Package": "callr", - "Version": "3.7.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "processx", - "utils" - ], - "Hash": "d7e13f49c19103ece9e58ad2d83a7354" - }, - "checkmate": { - "Package": "checkmate", - "Version": "2.3.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "backports", - "utils" - ], - "Hash": "0e14e01ce07e7c88fd25de6d4260d26b" - }, - "cli": { - "Package": "cli", - "Version": "3.6.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "b21916dd77a27642b447374a5d30ecf3" - }, - "cluster": { - "Package": "cluster", - "Version": "2.1.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "stats", - "utils" - ], - "Hash": "0aaa05204035dc43ea0004b9c76611dd" - }, - "codetools": { - "Package": "codetools", - "Version": "0.2-20", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "61e097f35917d342622f21cdc79c256e" - }, - "colorspace": { - "Package": "colorspace", - "Version": "2.1-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "methods", - "stats" - ], - "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" - }, - "corpcor": { - "Package": "corpcor", - "Version": "1.6.10", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats" - ], - "Hash": "17ebe3b6d75d09c5bab3891880b34237" - }, - "cpp11": { - "Package": "cpp11", - "Version": "0.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "91570bba75d0c9d3f1040c835cee8fba" - }, - "data.table": { - "Package": "data.table", - "Version": "1.16.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "fb24e05d4a91d8b1c7ff8e284bde834a" - }, - "desc": { - "Package": "desc", - "Version": "1.4.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "cli", - "utils" - ], - "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" - }, - "digest": { - "Package": "digest", - "Version": "0.6.37", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "33698c4b3127fc9f506654607fb73676" - }, - "evaluate": { - "Package": "evaluate", - "Version": "1.0.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "6b567375113ceb7d9f800de4dd42218e" - }, - "fansi": { - "Package": "fansi", - "Version": "1.0.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "utils" - ], - "Hash": "962174cf2aeb5b9eea581522286a911f" - }, - "farver": { - "Package": "farver", - "Version": "2.1.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "680887028577f3fa2a81e410ed0d6e42" - }, - "fastmap": { - "Package": "fastmap", - "Version": "1.2.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" - }, - "fdrtool": { - "Package": "fdrtool", - "Version": "1.2.18", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "stats" - ], - "Hash": "d2a06fbed1234e31c6a872aebbf30057" - }, - "fontBitstreamVera": { - "Package": "fontBitstreamVera", - "Version": "0.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "f6068021eff4aba735a9b2353516636c" - }, - "fontLiberation": { - "Package": "fontLiberation", - "Version": "0.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "f918c5e723f86f409912104d5b7a71d6" - }, - "fontawesome": { - "Package": "fontawesome", - "Version": "0.5.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "htmltools", - "rlang" - ], - "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" - }, - "fontquiver": { - "Package": "fontquiver", - "Version": "0.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "fontBitstreamVera", - "fontLiberation" - ], - "Hash": "fc0f4226379e451057d55419fd31761e" - }, - "foreign": { - "Package": "foreign", - "Version": "0.8-87", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods", - "stats", - "utils" - ], - "Hash": "81fc09bdeab0077a73927ed1243404b6" - }, - "fs": { - "Package": "fs", - "Version": "1.6.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" - }, - "gdtools": { - "Package": "gdtools", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "fontquiver", - "htmltools", - "systemfonts", - "tools" - ], - "Hash": "e8e09897fee8d96f6bb02bf841177d20" - }, - "ggplot2": { - "Package": "ggplot2", - "Version": "3.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "R", - "cli", - "glue", - "grDevices", - "grid", - "gtable", - "isoband", - "lifecycle", - "mgcv", - "rlang", - "scales", - "stats", - "tibble", - "vctrs", - "withr" - ], - "Hash": "44c6a2f8202d5b7e878ea274b1092426" - }, - "glasso": { - "Package": "glasso", - "Version": "1.11", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "1e1217c1b472d1dbffda819b57dc6d8d" - }, - "glue": { - "Package": "glue", - "Version": "1.7.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods" - ], - "Hash": "e0b3a53876554bd45879e596cdb10a52" - }, - "gridExtra": { - "Package": "gridExtra", - "Version": "2.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "graphics", - "grid", - "gtable", - "utils" - ], - "Hash": "7d7f283939f563670a697165b2cf5560" - }, - "gridGraphics": { - "Package": "gridGraphics", - "Version": "0.5-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "graphics", - "grid" - ], - "Hash": "5b79228594f02385d4df4979284879ae" - }, - "gtable": { - "Package": "gtable", - "Version": "0.3.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "grid", - "lifecycle", - "rlang" - ], - "Hash": "e18861963cbc65a27736e02b3cd3c4a0" - }, - "gtools": { - "Package": "gtools", - "Version": "3.9.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "methods", - "stats", - "utils" - ], - "Hash": "588d091c35389f1f4a9d533c8d709b35" - }, - "highr": { - "Package": "highr", - "Version": "0.11", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "xfun" - ], - "Hash": "d65ba49117ca223614f71b60d85b8ab7" - }, - "htmlTable": { - "Package": "htmlTable", - "Version": "2.4.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "checkmate", - "htmltools", - "htmlwidgets", - "knitr", - "magrittr", - "methods", - "rstudioapi", - "stringr" - ], - "Hash": "ca027d8771f2c039aed82f00a81e725b" - }, - "htmltools": { - "Package": "htmltools", - "Version": "0.5.8.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "base64enc", - "digest", - "fastmap", - "grDevices", - "rlang", - "utils" - ], - "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" - }, - "htmlwidgets": { - "Package": "htmlwidgets", - "Version": "1.6.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grDevices", - "htmltools", - "jsonlite", - "knitr", - "rmarkdown", - "yaml" - ], - "Hash": "04291cc45198225444a397606810ac37" - }, - "igraph": { - "Package": "igraph", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "cli", - "cpp11", - "grDevices", - "graphics", - "lifecycle", - "magrittr", - "methods", - "pkgconfig", - "rlang", - "stats", - "utils", - "vctrs" - ], - "Hash": "c3b7d801d722e26e4cd888e042bf9af5" - }, - "isoband": { - "Package": "isoband", - "Version": "0.2.7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "grid", - "utils" - ], - "Hash": "0080607b4a1a7b28979aecef976d8bc2" - }, - "jaspBase": { - "Package": "jaspBase", - "Version": "0.19.2", - "Source": "GitHub", - "RemoteType": "github", - "RemoteHost": "api.github.com", - "RemoteUsername": "jasp-stats", - "RemoteRepo": "jaspBase", - "RemoteRef": "master", - "RemoteSha": "67652e03f135b8d9b7c42e353a0fe02b9fea0929", - "Remotes": "jasp-stats/jaspGraphs", - "Requirements": [ - "R6", - "Rcpp", - "cli", - "codetools", - "compiler", - "ggplot2", - "grDevices", - "grid", - "gridExtra", - "gridGraphics", - "jaspGraphs", - "jsonlite", - "lifecycle", - "methods", - "modules", - "officer", - "pkgbuild", - "plyr", - "qgraph", - "ragg", - "remotes", - "rjson", - "rvg", - "svglite", - "systemfonts", - "withr" - ], - "Hash": "54ff30fbbe384057dea12677bdb0de3f" - }, - "jaspGraphs": { - "Package": "jaspGraphs", - "Version": "0.19.2", - "Source": "GitHub", - "RemoteType": "github", - "RemoteHost": "api.github.com", - "RemoteUsername": "jasp-stats", - "RemoteRepo": "jaspGraphs", - "RemoteRef": "master", - "RemoteSha": "797e38a84746e9aa0f456439b8f00f756164d82c", - "Requirements": [ - "R6", - "RColorBrewer", - "ggplot2", - "gridExtra", - "gtable", - "jsonlite", - "lifecycle", - "rlang", - "scales", - "viridisLite" - ], - "Hash": "35093128cffc6280d0ec4183a851a9d9" - }, - "jpeg": { - "Package": "jpeg", - "Version": "0.1-10", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "031a0b683d001a7519202f0628fc0358" - }, - "jquerylib": { - "Package": "jquerylib", - "Version": "0.1.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "htmltools" - ], - "Hash": "5aab57a3bd297eee1c1d862735972182" - }, - "jsonlite": { - "Package": "jsonlite", - "Version": "1.8.8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "methods" - ], - "Hash": "e1b9c55281c5adc4dd113652d9e26768" - }, - "knitr": { - "Package": "knitr", - "Version": "1.48", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "evaluate", - "highr", - "methods", - "tools", - "xfun", - "yaml" - ], - "Hash": "acf380f300c721da9fde7df115a5f86f" - }, - "labeling": { - "Package": "labeling", - "Version": "0.4.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "graphics", - "stats" - ], - "Hash": "b64ec208ac5bc1852b285f665d6368b3" - }, - "lattice": { - "Package": "lattice", - "Version": "0.22-6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "grid", - "stats", - "utils" - ], - "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" - }, - "lavaan": { - "Package": "lavaan", - "Version": "0.6-18", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "MASS", - "R", - "graphics", - "methods", - "mnormt", - "numDeriv", - "pbivnorm", - "quadprog", - "stats", - "stats4", - "utils" - ], - "Hash": "8cc22350004769221cf2468d41c7e389" - }, - "lifecycle": { - "Package": "lifecycle", - "Version": "1.0.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "rlang" - ], - "Hash": "b8552d117e1b808b09a832f589b79035" - }, - "magrittr": { - "Package": "magrittr", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "7ce2733a9826b3aeb1775d56fd305472" - }, - "memoise": { - "Package": "memoise", - "Version": "2.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "cachem", - "rlang" - ], - "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" - }, - "mgcv": { - "Package": "mgcv", - "Version": "1.9-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Matrix", - "R", - "graphics", - "methods", - "nlme", - "splines", - "stats", - "utils" - ], - "Hash": "110ee9d83b496279960e162ac97764ce" - }, - "mime": { - "Package": "mime", - "Version": "0.12", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "tools" - ], - "Hash": "18e9c28c1d3ca1560ce30658b22ce104" - }, - "mnormt": { - "Package": "mnormt", - "Version": "2.1.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "c83992ef63553d1e4b97162a4a753470" - }, - "modules": { - "Package": "modules", - "Version": "0.13.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "1485aee3373bcfdbb2dd9048995af2ae" - }, - "munsell": { - "Package": "munsell", - "Version": "0.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "colorspace", - "methods" - ], - "Hash": "4fd8900853b746af55b81fda99da7695" - }, - "nlme": { - "Package": "nlme", - "Version": "3.1-164", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "graphics", - "lattice", - "stats", - "utils" - ], - "Hash": "a623a2239e642806158bc4dc3f51565d" - }, - "nnet": { - "Package": "nnet", - "Version": "7.3-19", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats", - "utils" - ], - "Hash": "2c797b46eea7fb58ede195bc0b1f1138" - }, - "numDeriv": { - "Package": "numDeriv", - "Version": "2016.8-1.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "df58958f293b166e4ab885ebcad90e02" - }, - "officer": { - "Package": "officer", - "Version": "0.6.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R6", - "grDevices", - "graphics", - "openssl", - "ragg", - "stats", - "utils", - "uuid", - "xml2", - "zip" - ], - "Hash": "dc703d9a479e428a15dc6f82e268387e" - }, - "openssl": { - "Package": "openssl", - "Version": "2.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "askpass" - ], - "Hash": "c62edf62de70cadf40553e10c739049d" - }, - "pbapply": { - "Package": "pbapply", - "Version": "1.7-2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "parallel" - ], - "Hash": "68a2d681e10cf72f0afa1d84d45380e5" - }, - "pbivnorm": { - "Package": "pbivnorm", - "Version": "0.6.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "643e16a7da6aac3e18cadc3e14abb94b" - }, - "pillar": { - "Package": "pillar", - "Version": "1.9.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "cli", - "fansi", - "glue", - "lifecycle", - "rlang", - "utf8", - "utils", - "vctrs" - ], - "Hash": "15da5a8412f317beeee6175fbc76f4bb" - }, - "pkgbuild": { - "Package": "pkgbuild", - "Version": "1.4.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "callr", - "cli", - "desc", - "processx" - ], - "Hash": "a29e8e134a460a01e0ca67a4763c595b" - }, - "pkgconfig": { - "Package": "pkgconfig", - "Version": "2.0.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "utils" - ], - "Hash": "01f28d4278f15c76cddbea05899c5d6f" - }, - "plyr": { - "Package": "plyr", - "Version": "1.8.9", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp" - ], - "Hash": "6b8177fd19982f0020743fadbfdbd933" - }, - "png": { - "Package": "png", - "Version": "0.1-8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "bd54ba8a0a5faded999a7aab6e46b374" - }, - "processx": { - "Package": "processx", - "Version": "3.8.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "ps", - "utils" - ], - "Hash": "0c90a7d71988856bad2a2a45dd871bb9" - }, - "ps": { - "Package": "ps", - "Version": "1.8.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" - }, - "psych": { - "Package": "psych", - "Version": "2.4.6.26", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "GPArotation", - "grDevices", - "graphics", - "lattice", - "methods", - "mnormt", - "nlme", - "parallel", - "stats" - ], - "Hash": "4448d5f3ac3e2cbf79074391d494637e" - }, - "qgraph": { - "Package": "qgraph", - "Version": "1.9.8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "Hmisc", - "Matrix", - "R", - "Rcpp", - "abind", - "colorspace", - "corpcor", - "fdrtool", - "ggplot2", - "glasso", - "grDevices", - "gtools", - "igraph", - "jpeg", - "lavaan", - "methods", - "parallel", - "pbapply", - "plyr", - "png", - "psych", - "reshape2" - ], - "Hash": "a78e4896ba8e67ceaa1086d664dc72a8" - }, - "quadprog": { - "Package": "quadprog", - "Version": "1.5-8", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "5f919ae5e7f83a6f91dcf2288943370d" - }, - "ragg": { - "Package": "ragg", - "Version": "1.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "systemfonts", - "textshaping" - ], - "Hash": "0595fe5e47357111f29ad19101c7d271" - }, - "rappdirs": { - "Package": "rappdirs", - "Version": "0.3.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "5e3c5dc0b071b21fa128676560dbe94d" - }, - "remotes": { - "Package": "remotes", - "Version": "2.5.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "methods", - "stats", - "tools", - "utils" - ], - "Hash": "3ee025083e66f18db6cf27b56e23e141" - }, - "renv": { - "Package": "renv", - "Version": "1.0.7", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "utils" - ], - "Hash": "397b7b2a265bc5a7a06852524dabae20" - }, - "reshape2": { - "Package": "reshape2", - "Version": "1.4.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "plyr", - "stringr" - ], - "Hash": "bb5996d0bd962d214a11140d77589917" - }, - "rjson": { - "Package": "rjson", - "Version": "0.2.23", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "7a04e9eff95857dbf557b4e5f0b3d1a8" - }, - "rlang": { - "Package": "rlang", - "Version": "1.1.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "utils" - ], - "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" - }, - "rmarkdown": { - "Package": "rmarkdown", - "Version": "2.28", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "bslib", - "evaluate", - "fontawesome", - "htmltools", - "jquerylib", - "jsonlite", - "knitr", - "methods", - "tinytex", - "tools", - "utils", - "xfun", - "yaml" - ], - "Hash": "062470668513dcda416927085ee9bdc7" - }, - "rpart": { - "Package": "rpart", - "Version": "4.1.23", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics", - "stats" - ], - "Hash": "b3d390424f41d04174cccf84d49676c2" - }, - "rstudioapi": { - "Package": "rstudioapi", - "Version": "0.16.0", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" - }, - "rvg": { - "Package": "rvg", - "Version": "0.3.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "Rcpp", - "gdtools", - "grDevices", - "officer", - "rlang", - "xml2" - ], - "Hash": "84feb96f75452bfbb4b7858e36bea2c5" - }, - "sass": { - "Package": "sass", - "Version": "0.4.9", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R6", - "fs", - "htmltools", - "rappdirs", - "rlang" - ], - "Hash": "d53dbfddf695303ea4ad66f86e99b95d" - }, - "scales": { - "Package": "scales", - "Version": "1.3.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "R6", - "RColorBrewer", - "cli", - "farver", - "glue", - "labeling", - "lifecycle", - "munsell", - "rlang", - "viridisLite" - ], - "Hash": "c19df082ba346b0ffa6f833e92de34d1" - }, - "stringi": { - "Package": "stringi", - "Version": "1.8.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "stats", - "tools", - "utils" - ], - "Hash": "39e1144fd75428983dc3f63aa53dfa91" - }, - "stringr": { - "Package": "stringr", - "Version": "1.5.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "magrittr", - "rlang", - "stringi", - "vctrs" - ], - "Hash": "960e2ae9e09656611e0b8214ad543207" - }, - "svglite": { - "Package": "svglite", - "Version": "2.1.3", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cpp11", - "systemfonts" - ], - "Hash": "124a41fdfa23e8691cb744c762f10516" - }, - "sys": { - "Package": "sys", - "Version": "3.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" - }, - "systemfonts": { - "Package": "systemfonts", - "Version": "1.1.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cpp11", - "lifecycle" - ], - "Hash": "213b6b8ed5afbf934843e6c3b090d418" - }, - "textshaping": { - "Package": "textshaping", - "Version": "0.4.0", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cpp11", - "lifecycle", - "systemfonts" - ], - "Hash": "5142f8bc78ed3d819d26461b641627ce" - }, - "tibble": { - "Package": "tibble", - "Version": "3.2.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "fansi", - "lifecycle", - "magrittr", - "methods", - "pillar", - "pkgconfig", - "rlang", - "utils", - "vctrs" - ], - "Hash": "a84e2cc86d07289b3b6f5069df7a004c" - }, - "tinytex": { - "Package": "tinytex", - "Version": "0.53", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "xfun" - ], - "Hash": "9db859e8aabbb474293dde3097839420" - }, - "utf8": { - "Package": "utf8", - "Version": "1.2.4", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "62b65c52671e6665f803ff02954446e9" - }, - "uuid": { - "Package": "uuid", - "Version": "1.2-1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "34e965e62a41fcafb1ca60e9b142085b" - }, - "vctrs": { - "Package": "vctrs", - "Version": "0.6.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "glue", - "lifecycle", - "rlang" - ], - "Hash": "c03fa420630029418f7e6da3667aac4a" - }, - "viridis": { - "Package": "viridis", - "Version": "0.6.5", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "ggplot2", - "gridExtra", - "viridisLite" - ], - "Hash": "acd96d9fa70adeea4a5a1150609b9745" - }, - "viridisLite": { - "Package": "viridisLite", - "Version": "0.4.2", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R" - ], - "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" - }, - "withr": { - "Package": "withr", - "Version": "3.0.1", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "graphics" - ], - "Hash": "07909200e8bbe90426fbfeb73e1e27aa" - }, - "xfun": { - "Package": "xfun", - "Version": "0.47", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "grDevices", - "stats", - "tools" - ], - "Hash": "36ab21660e2d095fef0d83f689e0477c" - }, - "xml2": { - "Package": "xml2", - "Version": "1.3.6", - "Source": "Repository", - "Repository": "CRAN", - "Requirements": [ - "R", - "cli", - "methods", - "rlang" - ], - "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61" - }, - "yaml": { - "Package": "yaml", - "Version": "2.3.10", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "51dab85c6c98e50a18d7551e9d49f76c" - }, - "zip": { - "Package": "zip", - "Version": "2.3.1", - "Source": "Repository", - "Repository": "CRAN", - "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" - } - } -} From ba1621dbf1c9996e6025630881a6b80c10ba77db Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 13:47:51 +0100 Subject: [PATCH 109/157] updating workflow --- .github/workflows/check_module_on_pr.yml | 2 +- .github/workflows/post-merge-new-repo.yml | 268 +++++++++++----------- 2 files changed, 140 insertions(+), 130 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 6454f04..4af492b 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -8,7 +8,7 @@ permissions: {} jobs: check-description-file: - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run on PRs from forks + if: github.event.pull_request.head.repo.fork == true # Only run on PRs from forks runs-on: ubuntu-latest env: ORG_NAME: "jasp-escience" diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 89440fd..a048064 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -8,138 +8,148 @@ on: permissions: {} jobs: - create_new_repository: - if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork + test_fork: + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true # Only run if the PR was merged from a fork runs-on: ubuntu-24.04 - outputs: # Define output variables. We need these to pass information between jobs - module_name: ${{ steps.extract_vars.outputs.module_name }} - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all branches and commit history - persist-credentials: false # Do not persist credentials to the git config - - - name: Extract Package Name from DESCRIPTION - id: extract_vars + - name: Testing workflow should not run from internal PR run: | - # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') - PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - # Prevent special characters in package name - if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - exit 1 - fi - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT + echo "Running Workflow" shell: bash - - name: Create New Repository in Organization - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - echo "Creating repository $REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") - - if echo "$RESPONSE" | grep -q '"full_name"'; then - echo "Repository created successfully: $REPO_NAME" - echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV - else - echo "Failed to create repository: $RESPONSE" - exit 1 - fi - - - name: Push Merged Code to New Repository - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - git clone "https://github.com/${{ github.repository }}.git" temp_repo - cd temp_repo - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" - git push --mirror - - revert_main_branch: - if: always() # Always run this job, even if the previous job fails - permissions: - contents: write - actions: read - pull-requests: write - - runs-on: ubuntu-24.04 - needs: [create_new_repository] - env: - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - ORG_PAT: ${{ secrets.ORG_PAT }} - - steps: - - name: Checkout Repository - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git User - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - # Authenticate Git with Personal Access Token (PAT) - # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - - - name: Revert Main Branch to Pre-Merge State - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - run: | - MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT - git push origin main - - - name: Comment on Pull Request - if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - uses: actions/github-script@v6 - # env: - # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} - with: - script: | - const module_name = process.env.MODULE_NAME; - const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); - - add_submodule: - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - runs-on: ubuntu-24.04 - needs: [create_new_repository] - - env: - ORG_PAT: ${{ secrets.ORG_PAT }} - ORG_NAME: "jasp-escience" - MODULES_REPO: "github.com/jasp-escience/modules" - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - - steps: - - name: Add New Repository as a Submodule in jasp-escience/modules - run: | - git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo - cd modules_repo - - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} - git add .gitmodules modules/${MODULE_NAME} - git commit -m "Added ${MODULE_NAME} as a submodule under modules/" - git push origin main + # create_new_repository: + # if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork + # runs-on: ubuntu-24.04 + # + # outputs: # Define output variables. We need these to pass information between jobs + # module_name: ${{ steps.extract_vars.outputs.module_name }} + # env: + # ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + # ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name + # + # steps: + # - name: Checkout Repository + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # Fetch all branches and commit history + # persist-credentials: false # Do not persist credentials to the git config + # + # - name: Extract Package Name from DESCRIPTION + # id: extract_vars + # run: | + # # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + # PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') + # if [ -z "$PACKAGE_NAME" ]; then + # echo "Error: Package name not found in DESCRIPTION" >&2 + # exit 1 + # fi + # # Prevent special characters in package name + # if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + # echo "Error: PACKAGE_NAME contains invalid characters!" >&2 + # exit 1 + # fi + # echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + # echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT + # shell: bash + # + # - name: Create New Repository in Organization + # run: | + # REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + # echo "Creating repository $REPO_NAME..." + # RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ + # -H "X-GitHub-Api-Version: 2022-11-28" \ + # https://api.github.com/orgs/${ORG_NAME}/repos \ + # -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") + # + # if echo "$RESPONSE" | grep -q '"full_name"'; then + # echo "Repository created successfully: $REPO_NAME" + # echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV + # else + # echo "Failed to create repository: $RESPONSE" + # exit 1 + # fi + # + # - name: Push Merged Code to New Repository + # run: | + # REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + # git clone "https://github.com/${{ github.repository }}.git" temp_repo + # cd temp_repo + # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" + # git push --mirror + # + # revert_main_branch: + # if: always() # Always run this job, even if the previous job fails + # permissions: + # contents: write + # actions: read + # pull-requests: write + # + # runs-on: ubuntu-24.04 + # needs: [create_new_repository] + # env: + # MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + # ORG_PAT: ${{ secrets.ORG_PAT }} + # + # steps: + # - name: Checkout Repository + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # + # - name: Configure Git User + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # run: | + # git config --global user.name "GitHub Actions" + # git config --global user.email "actions@github.com" + # # Authenticate Git with Personal Access Token (PAT) + # # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" + # + # - name: Revert Main Branch to Pre-Merge State + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # run: | + # MERGE_COMMIT=$(git rev-parse HEAD) + # git revert -m 1 $MERGE_COMMIT + # git push origin main + # + # - name: Comment on Pull Request + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # uses: actions/github-script@v6 + # # env: + # # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} + # with: + # script: | + # const module_name = process.env.MODULE_NAME; + # const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; + # github.rest.issues.createComment({ + # issue_number: context.payload.pull_request.number, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: comment + # }); + # + # add_submodule: + # # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + # runs-on: ubuntu-24.04 + # needs: [create_new_repository] + # + # env: + # ORG_PAT: ${{ secrets.ORG_PAT }} + # ORG_NAME: "jasp-escience" + # MODULES_REPO: "github.com/jasp-escience/modules" + # MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + # + # steps: + # - name: Add New Repository as a Submodule in jasp-escience/modules + # run: | + # git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo + # cd modules_repo + # + # git config --global user.name "GitHub Actions" + # git config --global user.email "actions@github.com" + # + # git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} + # git add .gitmodules modules/${MODULE_NAME} + # git commit -m "Added ${MODULE_NAME} as a submodule under modules/" + # git push origin main From 8497c0f202fee9ab7861f33504f6b6ab1ea7ad13 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 13:50:36 +0100 Subject: [PATCH 110/157] test branch --- testfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 testfile diff --git a/testfile b/testfile new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/testfile @@ -0,0 +1 @@ +hello From 141677b74bf533508c331d9a0f9b7f3800288d1e Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 13:56:22 +0100 Subject: [PATCH 111/157] update workflow --- .github/workflows/check_module_on_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 4af492b..9c74b85 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -8,7 +8,7 @@ permissions: {} jobs: check-description-file: - if: github.event.pull_request.head.repo.fork == true # Only run on PRs from forks + if: github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' # Only run on PRs from forks runs-on: ubuntu-latest env: ORG_NAME: "jasp-escience" From da54bb2a5645ccb6a99a0d2e364e59028ada39d2 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 13:58:12 +0100 Subject: [PATCH 112/157] update workflow --- .github/workflows/check_module_on_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index 4af492b..a49fece 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -8,7 +8,7 @@ permissions: {} jobs: check-description-file: - if: github.event.pull_request.head.repo.fork == true # Only run on PRs from forks + if: github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' runs-on: ubuntu-latest env: ORG_NAME: "jasp-escience" From c2dc6a69e9078b286b776afb1efd73c41f8b4a5c Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 14:05:42 +0100 Subject: [PATCH 113/157] update workflow --- .github/workflows/post-merge-new-repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index a048064..a042d81 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -9,7 +9,7 @@ permissions: {} jobs: test_fork: - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true # Only run if the PR was merged from a fork + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' runs-on: ubuntu-24.04 steps: From 560f4cc023eb9a2a3c0820fc707990349b88da68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Tue, 11 Feb 2025 14:08:38 +0100 Subject: [PATCH 114/157] Add example icon --- inst/Description.qml | 5 ++- inst/icons/exampleIcon.png | Bin 0 -> 1820 bytes inst/icons/exampleIcon.svg | 83 +++++++++++++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 inst/icons/exampleIcon.png create mode 100644 inst/icons/exampleIcon.svg diff --git a/inst/Description.qml b/inst/Description.qml index c8e103d..392aaff 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -11,6 +11,7 @@ Description maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" + icon : "exampleIcon.png" // Located in /inst/icons/ preloadData: true requiresData: true @@ -24,8 +25,8 @@ Description { title: "Add one" // Title for window menu: "Add one" // Title for ribbon - func: "AddOne" // Function to be called - qml: "integer.qml" // Design input window + func: "AddOne" // Function to be called + qml: "integer.qml" // Design input window } Analysis diff --git a/inst/icons/exampleIcon.png b/inst/icons/exampleIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..09c807f03517311bb34af9e7405f98566e996658 GIT binary patch literal 1820 zcmV+%2jlpOP)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H12B}Fz zK~#90?V8zh+sF}zzXorSlw`>(OI~|zSGE$TvXy<>-9IVMdCz11yxb2-Z0}L)l_=}J zz?(qlp#g#b0U8upWxIl}iY1Vk82~@@^mO+K3JMAeK3*g|@czUfJmHUk_W|$cqd^q6 z@@Kvazn8;c`pa9sWy`~IPB6u>giiU+m(r<>BNz-1jBRFIK_mVKl?L3akw8buA=Dsopv4_pA$b6~APT{Mti zHlgC7&u{YeajVF?7F;yaZ>BYZ`UKo649ZaUVQYx)yYQ%+?;4j4R0^?Do;!KHSuhzaGR+>Bbno z=|tna-bD`E_ChWiaMVVBe`*h(hA;4H7ddWC$CIy5pfQ8jnK+pX-*P@`Sc3D09S_QIwy{)qwua!uZ$)ZeTPac)lS2+?$Go zqwv)k8WSm?n6EKsK7X}7`RpBDE^{!Kc7F- zUth*wSm2vXYdg#;J=zI8F>j*gI zs10A-nxC2d{iL;USzQ`sF7MLEZrqP~j;)}xZR(TvPwQEp-=JRvt9Iy4R-StOGF;Ws z0~h`LE`H7vBsnElKsxOx<`V2-zPyY#x~j)~C4kgY9QYziKD5jiiuZn@@`VS-ZP@9X z@7U|Yn+GwUp+}o$ZTDg1Act*qTtcqvCPLLi4_xHHjW6K=l9uV0mawKIL09o*h48>P zi_yn!&_k!uY>4#Bb5kKVo`Vj{Ff5~?C5=nSWdnWJgyFm>nsn^2l2962r>PZv%_d~d|6oa>0=*tV(k6w;QiYO}>)U4 zqm6{`P|%|_g$jwO4Z!zNbgpSZJ!+GJ9X(*Y^BU%!Ocv$ ztIogOWJ#yup}#weU;DTPZjJ@zx{my9--H&8?rCX@I^VDY*j5fR-kxtWmxqOnOLL_R zO;$dAL4J4;Z}a39{X8Y0-R;B6b9>mJFaLU!ov8bQyxp`S-jmx{SYj8->&$(DvnKK; zxY16_oM&^CD1>44sIIMwa|C8B&u=W07?t3*YL(Fh(ygGccVKI1TSo7i(SvRdEmU}z zJ^l5u3(Ya|YS$_XgEIW(!20a=(VAzu=yeS_ZCanN&f;T+lP0$_AC=&`hJH3P$aw?l zmC;0sBBxEXSGEdeN}2&!Vejd!S?77f3TllMNAHW}l8)K~Ji9?Qhv@~lG`5E5w;ed! zFflIc(=cXgBdrlUy|smDE)KI+n%ko46L@(s*CW{6+*#Oh3v9j zA(T;A)cPodg2a$C69mK}Yt# zMiOp}jvY|3-IfI6XZ&--IyY5wlRfp86DlZ_rRIKlFB|?d#MnVpY`@kRIeD5|&REzf`!PR%t zx4{CYLX|xJqb`3(SK1-_M2M=kvk$8P!3K{9iGBQnf`WpNm;V9d)R%Pjsfz~y0000< KMNUMnLSTX~@rLLC literal 0 HcmV?d00001 diff --git a/inst/icons/exampleIcon.svg b/inst/icons/exampleIcon.svg new file mode 100644 index 0000000..1399625 --- /dev/null +++ b/inst/icons/exampleIcon.svg @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + +ABC From 45707b596f3eb12e01595dd01c5e0f281ecdb2b0 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 14:12:18 +0100 Subject: [PATCH 115/157] update workflow to not trigger when org is jasp-escience --- .github/workflows/post-merge-new-repo.yml | 267 +++++++++++----------- 1 file changed, 129 insertions(+), 138 deletions(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index a042d81..9be02fa 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -8,148 +8,139 @@ on: permissions: {} jobs: - test_fork: + create_new_repository: if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' runs-on: ubuntu-24.04 + outputs: # Define output variables. We need these to pass information between jobs + module_name: ${{ steps.extract_vars.outputs.module_name }} + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name + steps: - - name: Testing workflow should not run from internal PR + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches and commit history + persist-credentials: false # Do not persist credentials to the git config + + - name: Extract Package Name from DESCRIPTION + id: extract_vars run: | - echo "Running Workflow" + # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + # Prevent special characters in package name + if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: PACKAGE_NAME contains invalid characters!" >&2 + exit 1 + fi + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT shell: bash - # create_new_repository: - # if: ${{ github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true }} # Only run if the PR was merged from a fork - # runs-on: ubuntu-24.04 - # - # outputs: # Define output variables. We need these to pass information between jobs - # module_name: ${{ steps.extract_vars.outputs.module_name }} - # env: - # ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - # ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - # - # steps: - # - name: Checkout Repository - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 # Fetch all branches and commit history - # persist-credentials: false # Do not persist credentials to the git config - # - # - name: Extract Package Name from DESCRIPTION - # id: extract_vars - # run: | - # # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') - # PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - # if [ -z "$PACKAGE_NAME" ]; then - # echo "Error: Package name not found in DESCRIPTION" >&2 - # exit 1 - # fi - # # Prevent special characters in package name - # if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - # echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - # exit 1 - # fi - # echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - # echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT - # shell: bash - # - # - name: Create New Repository in Organization - # run: | - # REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - # echo "Creating repository $REPO_NAME..." - # RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ - # -H "X-GitHub-Api-Version: 2022-11-28" \ - # https://api.github.com/orgs/${ORG_NAME}/repos \ - # -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") - # - # if echo "$RESPONSE" | grep -q '"full_name"'; then - # echo "Repository created successfully: $REPO_NAME" - # echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV - # else - # echo "Failed to create repository: $RESPONSE" - # exit 1 - # fi - # - # - name: Push Merged Code to New Repository - # run: | - # REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - # git clone "https://github.com/${{ github.repository }}.git" temp_repo - # cd temp_repo - # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" - # git push --mirror - # - # revert_main_branch: - # if: always() # Always run this job, even if the previous job fails - # permissions: - # contents: write - # actions: read - # pull-requests: write - # - # runs-on: ubuntu-24.04 - # needs: [create_new_repository] - # env: - # MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - # ORG_PAT: ${{ secrets.ORG_PAT }} - # - # steps: - # - name: Checkout Repository - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - # - name: Configure Git User - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - # run: | - # git config --global user.name "GitHub Actions" - # git config --global user.email "actions@github.com" - # # Authenticate Git with Personal Access Token (PAT) - # # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - # - # - name: Revert Main Branch to Pre-Merge State - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - # run: | - # MERGE_COMMIT=$(git rev-parse HEAD) - # git revert -m 1 $MERGE_COMMIT - # git push origin main - # - # - name: Comment on Pull Request - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - # uses: actions/github-script@v6 - # # env: - # # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} - # with: - # script: | - # const module_name = process.env.MODULE_NAME; - # const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; - # github.rest.issues.createComment({ - # issue_number: context.payload.pull_request.number, - # owner: context.repo.owner, - # repo: context.repo.repo, - # body: comment - # }); - # - # add_submodule: - # # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - # runs-on: ubuntu-24.04 - # needs: [create_new_repository] - # - # env: - # ORG_PAT: ${{ secrets.ORG_PAT }} - # ORG_NAME: "jasp-escience" - # MODULES_REPO: "github.com/jasp-escience/modules" - # MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - # - # steps: - # - name: Add New Repository as a Submodule in jasp-escience/modules - # run: | - # git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo - # cd modules_repo - # - # git config --global user.name "GitHub Actions" - # git config --global user.email "actions@github.com" - # - # git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} - # git add .gitmodules modules/${MODULE_NAME} - # git commit -m "Added ${MODULE_NAME} as a submodule under modules/" - # git push origin main + - name: Create New Repository in Organization + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + echo "Creating repository $REPO_NAME..." + RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/${ORG_NAME}/repos \ + -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") + + if echo "$RESPONSE" | grep -q '"full_name"'; then + echo "Repository created successfully: $REPO_NAME" + echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV + else + echo "Failed to create repository: $RESPONSE" + exit 1 + fi + + - name: Push Merged Code to New Repository + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + git clone "https://github.com/${{ github.repository }}.git" temp_repo + cd temp_repo + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" + git push --mirror + + revert_main_branch: + if: always() # Always run this job, even if the previous job fails + permissions: + contents: write + actions: read + pull-requests: write + + runs-on: ubuntu-24.04 + needs: [create_new_repository] + env: + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + ORG_PAT: ${{ secrets.ORG_PAT }} + + steps: + - name: Checkout Repository + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + # Authenticate Git with Personal Access Token (PAT) + # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" + + - name: Revert Main Branch to Pre-Merge State + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + run: | + MERGE_COMMIT=$(git rev-parse HEAD) + git revert -m 1 $MERGE_COMMIT + git push origin main + + - name: Comment on Pull Request + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + uses: actions/github-script@v6 + # env: + # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} + with: + script: | + const module_name = process.env.MODULE_NAME; + const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); + + add_submodule: + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + runs-on: ubuntu-24.04 + needs: [create_new_repository] + + env: + ORG_PAT: ${{ secrets.ORG_PAT }} + ORG_NAME: "jasp-escience" + MODULES_REPO: "github.com/jasp-escience/modules" + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + + steps: + - name: Add New Repository as a Submodule in jasp-escience/modules + run: | + git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo + cd modules_repo + + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} + git add .gitmodules modules/${MODULE_NAME} + git commit -m "Added ${MODULE_NAME} as a submodule under modules/" + git push origin main From 7ba187c85f5011beb16ad9c2f6c9c4f08c72fd4a Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 14:13:14 +0100 Subject: [PATCH 116/157] test file --- testfile | 1 + 1 file changed, 1 insertion(+) diff --git a/testfile b/testfile index ce01362..97531f3 100644 --- a/testfile +++ b/testfile @@ -1 +1,2 @@ hello +hello2 From 0cd68dfae2dae1db2f6fbc6155f8b5a4f500c92d Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Tue, 11 Feb 2025 14:16:29 +0100 Subject: [PATCH 117/157] remove file --- testfile | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 testfile diff --git a/testfile b/testfile deleted file mode 100644 index 97531f3..0000000 --- a/testfile +++ /dev/null @@ -1,2 +0,0 @@ -hello -hello2 From 3f2e635af9d0be6daab421d5169a378041aca974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Tue, 11 Feb 2025 14:23:30 +0100 Subject: [PATCH 118/157] Revert "Revert "Merge pull request #30 from jasp-escience/dummy"" This reverts commit e2e5e55972d22faf00127a8e1a1ee12b257681e0. --- .Rbuildignore | 2 + .Rprofile | 1 + .gitignore | 1 + NAMESPACE | 3 + R/examples.R | 39 ++ inst/Description.qml | 38 +- inst/qml/data.qml | 40 ++ inst/qml/integer.qml | 44 ++ inst/qml/parabola.qml | 44 ++ renv.lock | 1516 +++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1727 insertions(+), 1 deletion(-) create mode 100644 .Rprofile create mode 100644 R/examples.R create mode 100644 inst/qml/data.qml create mode 100644 inst/qml/integer.qml create mode 100644 inst/qml/parabola.qml create mode 100644 renv.lock diff --git a/.Rbuildignore b/.Rbuildignore index 112ad26..7d392e5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,5 @@ +^renv$ +^renv\.lock$ ^.*\.Rproj$ ^\.Rproj\.user$ ^\.travis\.yml$ diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 0000000..81b960f --- /dev/null +++ b/.Rprofile @@ -0,0 +1 @@ +source("renv/activate.R") diff --git a/.gitignore b/.gitignore index 854a153..2a2473d 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,5 @@ Thumbs.db # RStudio files .Rproj.user +renv/ _processedLockFile.lock diff --git a/NAMESPACE b/NAMESPACE index de016fe..0a4e42f 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1 +1,4 @@ import(jaspBase) +export(AddOne) +export(ProcessData) +export(Parabola) diff --git a/R/examples.R b/R/examples.R new file mode 100644 index 0000000..c6e745a --- /dev/null +++ b/R/examples.R @@ -0,0 +1,39 @@ +AddOne <- function(jaspResults, dataset, options) { + result <- as.character(options$my_number + 1) # options$my_number comes from the menu created by inst/qml/integer.qml + + jaspResults[["result"]] <- createJaspHtml(text = result, + title = "This is your result:") + + return() +} + +ProcessData <- function(jaspResults, dataset, options) { + # Dataset access + # options$ts --maps to--> 't' + # dataset[, options$ts] --maps to--> dataset$t + result <- paste(dataset[, options$ts], collapse = "") + jaspResults[["result"]] <- createJaspHtml(text = result, + title = "This is your result:") + + return() +} + +Parabola <- function(jaspResults, dataset, options) { + # Analysis + f <- function(x) { options$a * x^2 } # Function to be plotted + p <- ggplot2::ggplot() + # Plotting command + ggplot2::xlim(-3, 3) + + ggplot2::ylim(0, 10) + + ggplot2::geom_function(fun = f) + + # Aesthetics + parabolaPlot <- createJaspPlot(title = "Parabola", + width = 160, + height = 320) + parabolaPlot$dependOn(c("a")) # Refresh view whenever a changes + + jaspResults[["parabolaPlot"]] <- parabolaPlot + parabolaPlot$plotObject <- p + + return() +} diff --git a/inst/Description.qml b/inst/Description.qml index 785abaf..c8e103d 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -5,10 +5,46 @@ Description { name : "jaspModule" title : qsTr("Jasp Module") - description : qsTr("This module offers analyses.") + description : qsTr("Examples for module builders") version : "0.1" author : "JASP Team" maintainer : "JASP Team " website : "https://jasp-stats.org" license : "GPL (>= 2)" + preloadData: true + requiresData: true + + + GroupTitle + { + title: qsTr("Basic functions") + } + + Analysis + { + title: "Add one" // Title for window + menu: "Add one" // Title for ribbon + func: "AddOne" // Function to be called + qml: "integer.qml" // Design input window + } + + Analysis + { + title: "Load data" + menu: "Load data" + func: "ProcessData" + qml: "data.qml" + } + + GroupTitle + { + title: qsTr("Plotting") + } + + Analysis + { + title: "Plot a parabola" + func: "Parabola" + qml: "parabola.qml" + } } diff --git a/inst/qml/data.qml b/inst/qml/data.qml new file mode 100644 index 0000000..f6bfa7b --- /dev/null +++ b/inst/qml/data.qml @@ -0,0 +1,40 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to load a dataset and perform a simple operation on it" + } + + VariablesForm + { + AvailableVariablesList { name: "allVariables" } + AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } + } + +} diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml new file mode 100644 index 0000000..696de88 --- /dev/null +++ b/inst/qml/integer.qml @@ -0,0 +1,44 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to manually introduce an input and perform a simple operation on it" + } + + IntegerField + { + name: "my_number" // This will map to options$my_number in R + label: qsTr("Type a number") // qsTr allows for future translations + + // We can add some extra control parameters + min: 1 + defaultValue: 10 + fieldWidth: 50 + max: 1000 + } + +} diff --git a/inst/qml/parabola.qml b/inst/qml/parabola.qml new file mode 100644 index 0000000..d2703b8 --- /dev/null +++ b/inst/qml/parabola.qml @@ -0,0 +1,44 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to plot a curve" + } + + IntegerField + { + name: "a" // This will map to options$a in R + label: qsTr("Type a number") // qsTr allows for future translations + + // We can add some extra control parameters + min: -10 + defaultValue: 1 + fieldWidth: 50 + max: 10 + } + +} diff --git a/renv.lock b/renv.lock new file mode 100644 index 0000000..7648917 --- /dev/null +++ b/renv.lock @@ -0,0 +1,1516 @@ +{ + "R": { + "Version": "4.4.2", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://cloud.r-project.org" + } + ] + }, + "Packages": { + "Formula": { + "Package": "Formula", + "Version": "1.2-5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "7a29697b75e027767a53fde6c903eca7" + }, + "GPArotation": { + "Package": "GPArotation", + "Version": "2024.3-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "b8b658ec0d7a6a55d9d01e00e3cafd20" + }, + "Hmisc": { + "Package": "Hmisc", + "Version": "5.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Formula", + "R", + "base64enc", + "cluster", + "colorspace", + "data.table", + "foreign", + "ggplot2", + "grid", + "gridExtra", + "gtable", + "htmlTable", + "htmltools", + "knitr", + "methods", + "nnet", + "rmarkdown", + "rpart", + "viridis" + ], + "Hash": "9a446aea30bff7e8ee20f4c0973e8851" + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-60.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats", + "utils" + ], + "Hash": "2f342c46163b0b54d7b64d1f798e2c78" + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.7-0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "lattice", + "methods", + "stats", + "utils" + ], + "Hash": "1920b2f11133b12350024297d8a4ff4a" + }, + "R6": { + "Package": "R6", + "Version": "2.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "470851b6d5d0ac559e9d01bb352b4021" + }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "45f0398006e83a5b10b72a90663d8d8c" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.13", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "utils" + ], + "Hash": "f27411eb6d9c3dada5edd444b8416675" + }, + "abind": { + "Package": "abind", + "Version": "1.4-8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "utils" + ], + "Hash": "2288423bb0f20a457800d7fc47f6aa54" + }, + "askpass": { + "Package": "askpass", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "sys" + ], + "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" + }, + "backports": { + "Package": "backports", + "Version": "1.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "e1e1b9d75c37401117b636b7ae50827a" + }, + "base64enc": { + "Package": "base64enc", + "Version": "0.1-3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "543776ae6848fde2f48ff3816d0628bc" + }, + "bslib": { + "Package": "bslib", + "Version": "0.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "cachem", + "fastmap", + "grDevices", + "htmltools", + "jquerylib", + "jsonlite", + "lifecycle", + "memoise", + "mime", + "rlang", + "sass" + ], + "Hash": "b299c6741ca9746fb227debcb0f9fb6c" + }, + "cachem": { + "Package": "cachem", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "fastmap", + "rlang" + ], + "Hash": "cd9a672193789068eb5a2aad65a0dedf" + }, + "callr": { + "Package": "callr", + "Version": "3.7.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "processx", + "utils" + ], + "Hash": "d7e13f49c19103ece9e58ad2d83a7354" + }, + "checkmate": { + "Package": "checkmate", + "Version": "2.3.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "backports", + "utils" + ], + "Hash": "0e14e01ce07e7c88fd25de6d4260d26b" + }, + "cli": { + "Package": "cli", + "Version": "3.6.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "b21916dd77a27642b447374a5d30ecf3" + }, + "cluster": { + "Package": "cluster", + "Version": "2.1.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats", + "utils" + ], + "Hash": "0aaa05204035dc43ea0004b9c76611dd" + }, + "codetools": { + "Package": "codetools", + "Version": "0.2-20", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "61e097f35917d342622f21cdc79c256e" + }, + "colorspace": { + "Package": "colorspace", + "Version": "2.1-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "methods", + "stats" + ], + "Hash": "d954cb1c57e8d8b756165d7ba18aa55a" + }, + "corpcor": { + "Package": "corpcor", + "Version": "1.6.10", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats" + ], + "Hash": "17ebe3b6d75d09c5bab3891880b34237" + }, + "cpp11": { + "Package": "cpp11", + "Version": "0.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "91570bba75d0c9d3f1040c835cee8fba" + }, + "data.table": { + "Package": "data.table", + "Version": "1.16.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "fb24e05d4a91d8b1c7ff8e284bde834a" + }, + "desc": { + "Package": "desc", + "Version": "1.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "cli", + "utils" + ], + "Hash": "99b79fcbd6c4d1ce087f5c5c758b384f" + }, + "digest": { + "Package": "digest", + "Version": "0.6.37", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "33698c4b3127fc9f506654607fb73676" + }, + "evaluate": { + "Package": "evaluate", + "Version": "1.0.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "6b567375113ceb7d9f800de4dd42218e" + }, + "fansi": { + "Package": "fansi", + "Version": "1.0.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "utils" + ], + "Hash": "962174cf2aeb5b9eea581522286a911f" + }, + "farver": { + "Package": "farver", + "Version": "2.1.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "680887028577f3fa2a81e410ed0d6e42" + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.2.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "aa5e1cd11c2d15497494c5292d7ffcc8" + }, + "fdrtool": { + "Package": "fdrtool", + "Version": "1.2.18", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "d2a06fbed1234e31c6a872aebbf30057" + }, + "fontBitstreamVera": { + "Package": "fontBitstreamVera", + "Version": "0.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f6068021eff4aba735a9b2353516636c" + }, + "fontLiberation": { + "Package": "fontLiberation", + "Version": "0.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "f918c5e723f86f409912104d5b7a71d6" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "htmltools", + "rlang" + ], + "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" + }, + "fontquiver": { + "Package": "fontquiver", + "Version": "0.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "fontBitstreamVera", + "fontLiberation" + ], + "Hash": "fc0f4226379e451057d55419fd31761e" + }, + "foreign": { + "Package": "foreign", + "Version": "0.8-87", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "stats", + "utils" + ], + "Hash": "81fc09bdeab0077a73927ed1243404b6" + }, + "fs": { + "Package": "fs", + "Version": "1.6.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "15aeb8c27f5ea5161f9f6a641fafd93a" + }, + "gdtools": { + "Package": "gdtools", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "fontquiver", + "htmltools", + "systemfonts", + "tools" + ], + "Hash": "e8e09897fee8d96f6bb02bf841177d20" + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "MASS", + "R", + "cli", + "glue", + "grDevices", + "grid", + "gtable", + "isoband", + "lifecycle", + "mgcv", + "rlang", + "scales", + "stats", + "tibble", + "vctrs", + "withr" + ], + "Hash": "44c6a2f8202d5b7e878ea274b1092426" + }, + "glasso": { + "Package": "glasso", + "Version": "1.11", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "1e1217c1b472d1dbffda819b57dc6d8d" + }, + "glue": { + "Package": "glue", + "Version": "1.7.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods" + ], + "Hash": "e0b3a53876554bd45879e596cdb10a52" + }, + "gridExtra": { + "Package": "gridExtra", + "Version": "2.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "graphics", + "grid", + "gtable", + "utils" + ], + "Hash": "7d7f283939f563670a697165b2cf5560" + }, + "gridGraphics": { + "Package": "gridGraphics", + "Version": "0.5-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "graphics", + "grid" + ], + "Hash": "5b79228594f02385d4df4979284879ae" + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "grid", + "lifecycle", + "rlang" + ], + "Hash": "e18861963cbc65a27736e02b3cd3c4a0" + }, + "gtools": { + "Package": "gtools", + "Version": "3.9.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods", + "stats", + "utils" + ], + "Hash": "588d091c35389f1f4a9d533c8d709b35" + }, + "highr": { + "Package": "highr", + "Version": "0.11", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "xfun" + ], + "Hash": "d65ba49117ca223614f71b60d85b8ab7" + }, + "htmlTable": { + "Package": "htmlTable", + "Version": "2.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "checkmate", + "htmltools", + "htmlwidgets", + "knitr", + "magrittr", + "methods", + "rstudioapi", + "stringr" + ], + "Hash": "ca027d8771f2c039aed82f00a81e725b" + }, + "htmltools": { + "Package": "htmltools", + "Version": "0.5.8.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "base64enc", + "digest", + "fastmap", + "grDevices", + "rlang", + "utils" + ], + "Hash": "81d371a9cc60640e74e4ab6ac46dcedc" + }, + "htmlwidgets": { + "Package": "htmlwidgets", + "Version": "1.6.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grDevices", + "htmltools", + "jsonlite", + "knitr", + "rmarkdown", + "yaml" + ], + "Hash": "04291cc45198225444a397606810ac37" + }, + "igraph": { + "Package": "igraph", + "Version": "2.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Matrix", + "R", + "cli", + "cpp11", + "grDevices", + "graphics", + "lifecycle", + "magrittr", + "methods", + "pkgconfig", + "rlang", + "stats", + "utils", + "vctrs" + ], + "Hash": "c3b7d801d722e26e4cd888e042bf9af5" + }, + "isoband": { + "Package": "isoband", + "Version": "0.2.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "grid", + "utils" + ], + "Hash": "0080607b4a1a7b28979aecef976d8bc2" + }, + "jaspBase": { + "Package": "jaspBase", + "Version": "0.19.2", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "jasp-stats", + "RemoteRepo": "jaspBase", + "RemoteRef": "master", + "RemoteSha": "67652e03f135b8d9b7c42e353a0fe02b9fea0929", + "Remotes": "jasp-stats/jaspGraphs", + "Requirements": [ + "R6", + "Rcpp", + "cli", + "codetools", + "compiler", + "ggplot2", + "grDevices", + "grid", + "gridExtra", + "gridGraphics", + "jaspGraphs", + "jsonlite", + "lifecycle", + "methods", + "modules", + "officer", + "pkgbuild", + "plyr", + "qgraph", + "ragg", + "remotes", + "rjson", + "rvg", + "svglite", + "systemfonts", + "withr" + ], + "Hash": "54ff30fbbe384057dea12677bdb0de3f" + }, + "jaspGraphs": { + "Package": "jaspGraphs", + "Version": "0.19.2", + "Source": "GitHub", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "jasp-stats", + "RemoteRepo": "jaspGraphs", + "RemoteRef": "master", + "RemoteSha": "797e38a84746e9aa0f456439b8f00f756164d82c", + "Requirements": [ + "R6", + "RColorBrewer", + "ggplot2", + "gridExtra", + "gtable", + "jsonlite", + "lifecycle", + "rlang", + "scales", + "viridisLite" + ], + "Hash": "35093128cffc6280d0ec4183a851a9d9" + }, + "jpeg": { + "Package": "jpeg", + "Version": "0.1-10", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "031a0b683d001a7519202f0628fc0358" + }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "htmltools" + ], + "Hash": "5aab57a3bd297eee1c1d862735972182" + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "1.8.8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "methods" + ], + "Hash": "e1b9c55281c5adc4dd113652d9e26768" + }, + "knitr": { + "Package": "knitr", + "Version": "1.48", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "evaluate", + "highr", + "methods", + "tools", + "xfun", + "yaml" + ], + "Hash": "acf380f300c721da9fde7df115a5f86f" + }, + "labeling": { + "Package": "labeling", + "Version": "0.4.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "graphics", + "stats" + ], + "Hash": "b64ec208ac5bc1852b285f665d6368b3" + }, + "lattice": { + "Package": "lattice", + "Version": "0.22-6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "grid", + "stats", + "utils" + ], + "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" + }, + "lavaan": { + "Package": "lavaan", + "Version": "0.6-18", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "MASS", + "R", + "graphics", + "methods", + "mnormt", + "numDeriv", + "pbivnorm", + "quadprog", + "stats", + "stats4", + "utils" + ], + "Hash": "8cc22350004769221cf2468d41c7e389" + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "rlang" + ], + "Hash": "b8552d117e1b808b09a832f589b79035" + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "7ce2733a9826b3aeb1775d56fd305472" + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "cachem", + "rlang" + ], + "Hash": "e2817ccf4a065c5d9d7f2cfbe7c1d78c" + }, + "mgcv": { + "Package": "mgcv", + "Version": "1.9-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Matrix", + "R", + "graphics", + "methods", + "nlme", + "splines", + "stats", + "utils" + ], + "Hash": "110ee9d83b496279960e162ac97764ce" + }, + "mime": { + "Package": "mime", + "Version": "0.12", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "tools" + ], + "Hash": "18e9c28c1d3ca1560ce30658b22ce104" + }, + "mnormt": { + "Package": "mnormt", + "Version": "2.1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "c83992ef63553d1e4b97162a4a753470" + }, + "modules": { + "Package": "modules", + "Version": "0.13.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "1485aee3373bcfdbb2dd9048995af2ae" + }, + "munsell": { + "Package": "munsell", + "Version": "0.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "colorspace", + "methods" + ], + "Hash": "4fd8900853b746af55b81fda99da7695" + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-164", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "graphics", + "lattice", + "stats", + "utils" + ], + "Hash": "a623a2239e642806158bc4dc3f51565d" + }, + "nnet": { + "Package": "nnet", + "Version": "7.3-19", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats", + "utils" + ], + "Hash": "2c797b46eea7fb58ede195bc0b1f1138" + }, + "numDeriv": { + "Package": "numDeriv", + "Version": "2016.8-1.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "df58958f293b166e4ab885ebcad90e02" + }, + "officer": { + "Package": "officer", + "Version": "0.6.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "grDevices", + "graphics", + "openssl", + "ragg", + "stats", + "utils", + "uuid", + "xml2", + "zip" + ], + "Hash": "dc703d9a479e428a15dc6f82e268387e" + }, + "openssl": { + "Package": "openssl", + "Version": "2.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "askpass" + ], + "Hash": "c62edf62de70cadf40553e10c739049d" + }, + "pbapply": { + "Package": "pbapply", + "Version": "1.7-2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "parallel" + ], + "Hash": "68a2d681e10cf72f0afa1d84d45380e5" + }, + "pbivnorm": { + "Package": "pbivnorm", + "Version": "0.6.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "643e16a7da6aac3e18cadc3e14abb94b" + }, + "pillar": { + "Package": "pillar", + "Version": "1.9.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "cli", + "fansi", + "glue", + "lifecycle", + "rlang", + "utf8", + "utils", + "vctrs" + ], + "Hash": "15da5a8412f317beeee6175fbc76f4bb" + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.4.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "callr", + "cli", + "desc", + "processx" + ], + "Hash": "a29e8e134a460a01e0ca67a4763c595b" + }, + "pkgconfig": { + "Package": "pkgconfig", + "Version": "2.0.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "01f28d4278f15c76cddbea05899c5d6f" + }, + "plyr": { + "Package": "plyr", + "Version": "1.8.9", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp" + ], + "Hash": "6b8177fd19982f0020743fadbfdbd933" + }, + "png": { + "Package": "png", + "Version": "0.1-8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "bd54ba8a0a5faded999a7aab6e46b374" + }, + "processx": { + "Package": "processx", + "Version": "3.8.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "ps", + "utils" + ], + "Hash": "0c90a7d71988856bad2a2a45dd871bb9" + }, + "ps": { + "Package": "ps", + "Version": "1.8.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" + }, + "psych": { + "Package": "psych", + "Version": "2.4.6.26", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "GPArotation", + "grDevices", + "graphics", + "lattice", + "methods", + "mnormt", + "nlme", + "parallel", + "stats" + ], + "Hash": "4448d5f3ac3e2cbf79074391d494637e" + }, + "qgraph": { + "Package": "qgraph", + "Version": "1.9.8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "Hmisc", + "Matrix", + "R", + "Rcpp", + "abind", + "colorspace", + "corpcor", + "fdrtool", + "ggplot2", + "glasso", + "grDevices", + "gtools", + "igraph", + "jpeg", + "lavaan", + "methods", + "parallel", + "pbapply", + "plyr", + "png", + "psych", + "reshape2" + ], + "Hash": "a78e4896ba8e67ceaa1086d664dc72a8" + }, + "quadprog": { + "Package": "quadprog", + "Version": "1.5-8", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5f919ae5e7f83a6f91dcf2288943370d" + }, + "ragg": { + "Package": "ragg", + "Version": "1.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "systemfonts", + "textshaping" + ], + "Hash": "0595fe5e47357111f29ad19101c7d271" + }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "5e3c5dc0b071b21fa128676560dbe94d" + }, + "remotes": { + "Package": "remotes", + "Version": "2.5.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "methods", + "stats", + "tools", + "utils" + ], + "Hash": "3ee025083e66f18db6cf27b56e23e141" + }, + "renv": { + "Package": "renv", + "Version": "1.0.7", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "utils" + ], + "Hash": "397b7b2a265bc5a7a06852524dabae20" + }, + "reshape2": { + "Package": "reshape2", + "Version": "1.4.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "plyr", + "stringr" + ], + "Hash": "bb5996d0bd962d214a11140d77589917" + }, + "rjson": { + "Package": "rjson", + "Version": "0.2.23", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "7a04e9eff95857dbf557b4e5f0b3d1a8" + }, + "rlang": { + "Package": "rlang", + "Version": "1.1.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "utils" + ], + "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" + }, + "rmarkdown": { + "Package": "rmarkdown", + "Version": "2.28", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "bslib", + "evaluate", + "fontawesome", + "htmltools", + "jquerylib", + "jsonlite", + "knitr", + "methods", + "tinytex", + "tools", + "utils", + "xfun", + "yaml" + ], + "Hash": "062470668513dcda416927085ee9bdc7" + }, + "rpart": { + "Package": "rpart", + "Version": "4.1.23", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics", + "stats" + ], + "Hash": "b3d390424f41d04174cccf84d49676c2" + }, + "rstudioapi": { + "Package": "rstudioapi", + "Version": "0.16.0", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "96710351d642b70e8f02ddeb237c46a7" + }, + "rvg": { + "Package": "rvg", + "Version": "0.3.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "Rcpp", + "gdtools", + "grDevices", + "officer", + "rlang", + "xml2" + ], + "Hash": "84feb96f75452bfbb4b7858e36bea2c5" + }, + "sass": { + "Package": "sass", + "Version": "0.4.9", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R6", + "fs", + "htmltools", + "rappdirs", + "rlang" + ], + "Hash": "d53dbfddf695303ea4ad66f86e99b95d" + }, + "scales": { + "Package": "scales", + "Version": "1.3.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "R6", + "RColorBrewer", + "cli", + "farver", + "glue", + "labeling", + "lifecycle", + "munsell", + "rlang", + "viridisLite" + ], + "Hash": "c19df082ba346b0ffa6f833e92de34d1" + }, + "stringi": { + "Package": "stringi", + "Version": "1.8.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "stats", + "tools", + "utils" + ], + "Hash": "39e1144fd75428983dc3f63aa53dfa91" + }, + "stringr": { + "Package": "stringr", + "Version": "1.5.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "lifecycle", + "magrittr", + "rlang", + "stringi", + "vctrs" + ], + "Hash": "960e2ae9e09656611e0b8214ad543207" + }, + "svglite": { + "Package": "svglite", + "Version": "2.1.3", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "systemfonts" + ], + "Hash": "124a41fdfa23e8691cb744c762f10516" + }, + "sys": { + "Package": "sys", + "Version": "3.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" + }, + "systemfonts": { + "Package": "systemfonts", + "Version": "1.1.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "lifecycle" + ], + "Hash": "213b6b8ed5afbf934843e6c3b090d418" + }, + "textshaping": { + "Package": "textshaping", + "Version": "0.4.0", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cpp11", + "lifecycle", + "systemfonts" + ], + "Hash": "5142f8bc78ed3d819d26461b641627ce" + }, + "tibble": { + "Package": "tibble", + "Version": "3.2.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "fansi", + "lifecycle", + "magrittr", + "methods", + "pillar", + "pkgconfig", + "rlang", + "utils", + "vctrs" + ], + "Hash": "a84e2cc86d07289b3b6f5069df7a004c" + }, + "tinytex": { + "Package": "tinytex", + "Version": "0.53", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "xfun" + ], + "Hash": "9db859e8aabbb474293dde3097839420" + }, + "utf8": { + "Package": "utf8", + "Version": "1.2.4", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "62b65c52671e6665f803ff02954446e9" + }, + "uuid": { + "Package": "uuid", + "Version": "1.2-1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "34e965e62a41fcafb1ca60e9b142085b" + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.6.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "glue", + "lifecycle", + "rlang" + ], + "Hash": "c03fa420630029418f7e6da3667aac4a" + }, + "viridis": { + "Package": "viridis", + "Version": "0.6.5", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "ggplot2", + "gridExtra", + "viridisLite" + ], + "Hash": "acd96d9fa70adeea4a5a1150609b9745" + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.2", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R" + ], + "Hash": "c826c7c4241b6fc89ff55aaea3fa7491" + }, + "withr": { + "Package": "withr", + "Version": "3.0.1", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "graphics" + ], + "Hash": "07909200e8bbe90426fbfeb73e1e27aa" + }, + "xfun": { + "Package": "xfun", + "Version": "0.47", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "grDevices", + "stats", + "tools" + ], + "Hash": "36ab21660e2d095fef0d83f689e0477c" + }, + "xml2": { + "Package": "xml2", + "Version": "1.3.6", + "Source": "Repository", + "Repository": "CRAN", + "Requirements": [ + "R", + "cli", + "methods", + "rlang" + ], + "Hash": "1d0336142f4cd25d8d23cd3ba7a8fb61" + }, + "yaml": { + "Package": "yaml", + "Version": "2.3.10", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "51dab85c6c98e50a18d7551e9d49f76c" + }, + "zip": { + "Package": "zip", + "Version": "2.3.1", + "Source": "Repository", + "Repository": "CRAN", + "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" + } + } +} From edf55c00b54028b6461851e8a8474cb0f84733a0 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 11 Feb 2025 13:52:54 +0000 Subject: [PATCH 119/157] Revert "Merge pull request #35 from recap/main" This reverts commit 1fb37e0649e187c0f271b80850557ff97e1a067d, reversing changes made to 0c583bb397c3512f950c6afbe579e6afc882666a. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 51e70d26265ca6530b5371e9927ca7deb9a15192 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Wed, 12 Feb 2025 09:50:19 +0100 Subject: [PATCH 120/157] new module --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 4cbe29fa2c0f565c69b053cc423f6c0d1232f13d Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Wed, 12 Feb 2025 09:55:38 +0100 Subject: [PATCH 121/157] update workflow to delte workflows when creating new repo --- .github/workflows/post-merge-new-repo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 9be02fa..75aa357 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -65,6 +65,8 @@ jobs: REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" git clone "https://github.com/${{ github.repository }}.git" temp_repo cd temp_repo + rm .github/workflows/check_module_on_pr.yml + rm .github/workflows/post-merge-new-repo.yml git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" git push --mirror From 966f2a9d28c65bd84f412889308caf9e7f4bbc5f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 12 Feb 2025 08:58:31 +0000 Subject: [PATCH 122/157] Revert "Merge pull request #36 from recap/main" This reverts commit 7e679b73c6a9a85a705e091b5bf99ef4b20bf085, reversing changes made to 4cbe29fa2c0f565c69b053cc423f6c0d1232f13d. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From 1164e5a04f5d59b782d88f1b445e44a70e278e76 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Wed, 12 Feb 2025 10:01:33 +0100 Subject: [PATCH 123/157] update workflow to delte workflows when creating new repo --- .github/workflows/post-merge-new-repo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 75aa357..f7c519e 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -65,9 +65,10 @@ jobs: REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" git clone "https://github.com/${{ github.repository }}.git" temp_repo cd temp_repo + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" rm .github/workflows/check_module_on_pr.yml rm .github/workflows/post-merge-new-repo.yml - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" + git commit -am "Remove CI/CD workflows" git push --mirror revert_main_branch: From 0547c18e207e1b8fbaa07c5cdc8d69bf23b745b6 Mon Sep 17 00:00:00 2001 From: "R. Cushing" Date: Wed, 12 Feb 2025 10:07:27 +0100 Subject: [PATCH 124/157] new module (#37) --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From c94134024751ff5af1cf13d00ee44a61fed516cc Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 12 Feb 2025 09:07:47 +0000 Subject: [PATCH 125/157] Revert "new module (#37)" This reverts commit 0547c18e207e1b8fbaa07c5cdc8d69bf23b745b6. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From aa2ddf76b479d5d0fee5cc31b9ddc9a60512fe69 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Wed, 12 Feb 2025 11:11:37 +0100 Subject: [PATCH 126/157] update workflow to delte workflows when creating new repo --- .github/workflows/post-merge-new-repo.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index f7c519e..01f7b33 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -64,6 +64,8 @@ jobs: run: | REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" git clone "https://github.com/${{ github.repository }}.git" temp_repo + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@users.noreply.github.com" cd temp_repo git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" rm .github/workflows/check_module_on_pr.yml From da261a3015cee7498546780d3a7a511f6145eaec Mon Sep 17 00:00:00 2001 From: "R. Cushing" Date: Wed, 12 Feb 2025 11:17:07 +0100 Subject: [PATCH 127/157] new module (#38) --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..d1ed5f2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: myJaspModule Type: Package Title: A module for JASP Version: 0.1.0 From 2f39c5b9078f7303d73771ba0924e0d92cfa09b7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 12 Feb 2025 10:17:27 +0000 Subject: [PATCH 128/157] Revert "new module (#38)" This reverts commit da261a3015cee7498546780d3a7a511f6145eaec. --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1ed5f2..11c9a7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: myJaspModule +Package: jaspModuleTemplate Type: Package Title: A module for JASP Version: 0.1.0 From eed5432fbb50e22b4a5d2012c90222b8f790b20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 12 Feb 2025 11:17:43 +0100 Subject: [PATCH 129/157] Remove line invoking Travis --- tests/testthat.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/testthat.R b/tests/testthat.R index a744b3c..41651f7 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,2 @@ library(jaspTools) library(testthat) - -jaspTools::runTestsTravis(module = getwd()) From 54e11dd965a155b79a8d032eada31704e00d4304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 12 Feb 2025 11:37:42 +0100 Subject: [PATCH 130/157] Edit DESCRIPTION and update dependencies --- DESCRIPTION | 2 +- renv.lock | 175 +++++++++++++++++++++++++++------------------------- 2 files changed, 93 insertions(+), 84 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11c9a7a..2f52392 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -6,7 +6,7 @@ Date: 2020-10-15 Author: JASP Team Website: jasp-stats.org Maintainer: JASP Team -Description: This module offers analyses. +Description: Example module showing basic functionality. Use it for inspiration when creating your own module. License: GPL (>= 2) Encoding: UTF-8 Imports: diff --git a/renv.lock b/renv.lock index 7648917..3da7007 100644 --- a/renv.lock +++ b/renv.lock @@ -33,7 +33,7 @@ }, "Hmisc": { "Package": "Hmisc", - "Version": "5.1-3", + "Version": "5.2-2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -57,11 +57,11 @@ "rpart", "viridis" ], - "Hash": "9a446aea30bff7e8ee20f4c0973e8851" + "Hash": "ce88f29ff07b63c77f9b7ac747b9321b" }, "MASS": { "Package": "MASS", - "Version": "7.3-60.2", + "Version": "7.3-64", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -72,11 +72,11 @@ "stats", "utils" ], - "Hash": "2f342c46163b0b54d7b64d1f798e2c78" + "Hash": "49d2d8090b74c1179df1aff16201caf8" }, "Matrix": { "Package": "Matrix", - "Version": "1.7-0", + "Version": "1.7-2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -89,7 +89,7 @@ "stats", "utils" ], - "Hash": "1920b2f11133b12350024297d8a4ff4a" + "Hash": "f6a81550f166acbe2cd5229e9ca079b9" }, "R6": { "Package": "R6", @@ -113,14 +113,14 @@ }, "Rcpp": { "Package": "Rcpp", - "Version": "1.0.13", + "Version": "1.0.14", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "methods", "utils" ], - "Hash": "f27411eb6d9c3dada5edd444b8416675" + "Hash": "e7bdd9ee90e96921ca8a0f1972d66682" }, "abind": { "Package": "abind", @@ -136,13 +136,13 @@ }, "askpass": { "Package": "askpass", - "Version": "1.2.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "sys" ], - "Hash": "cad6cf7f1d5f6e906700b9d3e718c796" + "Hash": "c39f4155b3ceb1a9a2799d700fbd4b6a" }, "backports": { "Package": "backports", @@ -166,7 +166,7 @@ }, "bslib": { "Package": "bslib", - "Version": "0.8.0", + "Version": "0.9.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -184,7 +184,7 @@ "rlang", "sass" ], - "Hash": "b299c6741ca9746fb227debcb0f9fb6c" + "Hash": "70a6489cc254171fb9b4a7f130f44dca" }, "cachem": { "Package": "cachem", @@ -224,18 +224,18 @@ }, "cli": { "Package": "cli", - "Version": "3.6.3", + "Version": "3.6.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "b21916dd77a27642b447374a5d30ecf3" + "Hash": "1216ac65ac55ec0058a6f75d7ca0fd52" }, "cluster": { "Package": "cluster", - "Version": "2.1.6", + "Version": "2.1.8", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -245,17 +245,17 @@ "stats", "utils" ], - "Hash": "0aaa05204035dc43ea0004b9c76611dd" + "Hash": "b361779da7f8b129a1859b6cf243ba58" }, "codetools": { "Package": "codetools", - "Version": "0.2-20", + "Version": "0.2-19", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "61e097f35917d342622f21cdc79c256e" + "Hash": "c089a619a7fae175d149d89164f8c7d8" }, "colorspace": { "Package": "colorspace", @@ -284,24 +284,24 @@ }, "cpp11": { "Package": "cpp11", - "Version": "0.5.0", + "Version": "0.5.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "91570bba75d0c9d3f1040c835cee8fba" + "Hash": "9df43854f1c84685d095ed6270b52387" }, "data.table": { "Package": "data.table", - "Version": "1.16.0", + "Version": "1.16.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "methods" ], - "Hash": "fb24e05d4a91d8b1c7ff8e284bde834a" + "Hash": "38bbf05fc2503143db4c734a7e5cab66" }, "desc": { "Package": "desc", @@ -318,24 +318,24 @@ }, "digest": { "Package": "digest", - "Version": "0.6.37", + "Version": "0.6.35", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "33698c4b3127fc9f506654607fb73676" + "Hash": "698ece7ba5a4fa4559e3d537e7ec3d31" }, "evaluate": { "Package": "evaluate", - "Version": "1.0.0", + "Version": "1.0.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R" ], - "Hash": "6b567375113ceb7d9f800de4dd42218e" + "Hash": "e9651417729bbe7472e32b5027370e79" }, "fansi": { "Package": "fansi", @@ -398,7 +398,7 @@ }, "fontawesome": { "Package": "fontawesome", - "Version": "0.5.2", + "Version": "0.5.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -406,7 +406,7 @@ "htmltools", "rlang" ], - "Hash": "c2efdd5f0bcd1ea861c2d4e2a883a67d" + "Hash": "bd1297f9b5b1fc1372d19e2c4cd82215" }, "fontquiver": { "Package": "fontquiver", @@ -422,7 +422,7 @@ }, "foreign": { "Package": "foreign", - "Version": "0.8-87", + "Version": "0.8-88", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -431,7 +431,7 @@ "stats", "utils" ], - "Hash": "81fc09bdeab0077a73927ed1243404b6" + "Hash": "ffaf42daf543339d0961120cb1de57b8" }, "fs": { "Package": "fs", @@ -446,7 +446,7 @@ }, "gdtools": { "Package": "gdtools", - "Version": "0.4.0", + "Version": "0.4.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -457,7 +457,7 @@ "systemfonts", "tools" ], - "Hash": "e8e09897fee8d96f6bb02bf841177d20" + "Hash": "169e77416ce3f7ac73fc975909dd5455" }, "ggplot2": { "Package": "ggplot2", @@ -530,7 +530,7 @@ }, "gtable": { "Package": "gtable", - "Version": "0.3.5", + "Version": "0.3.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -539,9 +539,10 @@ "glue", "grid", "lifecycle", - "rlang" + "rlang", + "stats" ], - "Hash": "e18861963cbc65a27736e02b3cd3c4a0" + "Hash": "de949855009e2d4d0e52a844e30617ae" }, "gtools": { "Package": "gtools", @@ -617,7 +618,7 @@ }, "igraph": { "Package": "igraph", - "Version": "2.0.3", + "Version": "2.1.4", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -636,7 +637,7 @@ "utils", "vctrs" ], - "Hash": "c3b7d801d722e26e4cd888e042bf9af5" + "Hash": "db7352c3d239d0a319d2e3d0d040ed16" }, "isoband": { "Package": "isoband", @@ -658,7 +659,7 @@ "RemoteUsername": "jasp-stats", "RemoteRepo": "jaspBase", "RemoteRef": "master", - "RemoteSha": "67652e03f135b8d9b7c42e353a0fe02b9fea0929", + "RemoteSha": "cf7c84b877e1af958dd0d5b228d9a81831002bdd", "Remotes": "jasp-stats/jaspGraphs", "Requirements": [ "R6", @@ -688,7 +689,7 @@ "systemfonts", "withr" ], - "Hash": "54ff30fbbe384057dea12677bdb0de3f" + "Hash": "98b18ec61f0bd447d543612016111494" }, "jaspGraphs": { "Package": "jaspGraphs", @@ -699,7 +700,7 @@ "RemoteUsername": "jasp-stats", "RemoteRepo": "jaspGraphs", "RemoteRef": "master", - "RemoteSha": "797e38a84746e9aa0f456439b8f00f756164d82c", + "RemoteSha": "b469f513870af3b28d84477aa4f4a8f06e154e3c", "Requirements": [ "R6", "RColorBrewer", @@ -712,7 +713,7 @@ "scales", "viridisLite" ], - "Hash": "35093128cffc6280d0ec4183a851a9d9" + "Hash": "18d8d081d96bb9675ae3d5d9e63fe48e" }, "jpeg": { "Package": "jpeg", @@ -746,7 +747,7 @@ }, "knitr": { "Package": "knitr", - "Version": "1.48", + "Version": "1.49", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -758,7 +759,7 @@ "xfun", "yaml" ], - "Hash": "acf380f300c721da9fde7df115a5f86f" + "Hash": "9fcb189926d93c636dea94fbe4f44480" }, "labeling": { "Package": "labeling", @@ -773,7 +774,7 @@ }, "lattice": { "Package": "lattice", - "Version": "0.22-6", + "Version": "0.22-5", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -784,11 +785,11 @@ "stats", "utils" ], - "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2" + "Hash": "7c5e89f04e72d6611c77451f6331a091" }, "lavaan": { "Package": "lavaan", - "Version": "0.6-18", + "Version": "0.6-19", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -804,7 +805,7 @@ "stats4", "utils" ], - "Hash": "8cc22350004769221cf2468d41c7e389" + "Hash": "78573997f3acd282f34c626ffb6a906d" }, "lifecycle": { "Package": "lifecycle", @@ -901,7 +902,7 @@ }, "nlme": { "Package": "nlme", - "Version": "3.1-164", + "Version": "3.1-167", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -911,11 +912,11 @@ "stats", "utils" ], - "Hash": "a623a2239e642806158bc4dc3f51565d" + "Hash": "abd9318b4073223646c0f9d3ed641904" }, "nnet": { "Package": "nnet", - "Version": "7.3-19", + "Version": "7.3-20", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -923,7 +924,7 @@ "stats", "utils" ], - "Hash": "2c797b46eea7fb58ede195bc0b1f1138" + "Hash": "c955edf99ff24a32e96bd0a22645af60" }, "numDeriv": { "Package": "numDeriv", @@ -937,11 +938,12 @@ }, "officer": { "Package": "officer", - "Version": "0.6.6", + "Version": "0.6.7", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R6", + "cli", "grDevices", "graphics", "openssl", @@ -952,17 +954,17 @@ "xml2", "zip" ], - "Hash": "dc703d9a479e428a15dc6f82e268387e" + "Hash": "d6c0a4e796301a5d252de42c92a9a8b9" }, "openssl": { "Package": "openssl", - "Version": "2.2.1", + "Version": "2.3.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "askpass" ], - "Hash": "c62edf62de70cadf40553e10c739049d" + "Hash": "bc54d87ebf858b28de18df4bca6528d3" }, "pbapply": { "Package": "pbapply", @@ -1060,18 +1062,18 @@ }, "ps": { "Package": "ps", - "Version": "1.8.0", + "Version": "1.7.6", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "4b9c8485b0c7eecdf0a9ba5132a45576" + "Hash": "dd2b9319ee0656c8acf45c7f40c59de7" }, "psych": { "Package": "psych", - "Version": "2.4.6.26", + "Version": "2.4.12", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1085,7 +1087,7 @@ "parallel", "stats" ], - "Hash": "4448d5f3ac3e2cbf79074391d494637e" + "Hash": "b6659cfdaf2545e88959f00bdb0a0951" }, "qgraph": { "Package": "qgraph", @@ -1198,18 +1200,18 @@ }, "rlang": { "Package": "rlang", - "Version": "1.1.4", + "Version": "1.1.3", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "utils" ], - "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1" + "Hash": "42548638fae05fd9a9b5f3f437fbbbe2" }, "rmarkdown": { "Package": "rmarkdown", - "Version": "2.28", + "Version": "2.29", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1228,11 +1230,11 @@ "xfun", "yaml" ], - "Hash": "062470668513dcda416927085ee9bdc7" + "Hash": "df99277f63d01c34e95e3d2f06a79736" }, "rpart": { "Package": "rpart", - "Version": "4.1.23", + "Version": "4.1.24", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1241,14 +1243,14 @@ "graphics", "stats" ], - "Hash": "b3d390424f41d04174cccf84d49676c2" + "Hash": "ad31b457482eda7a12e51c5d8e7b0be4" }, "rstudioapi": { "Package": "rstudioapi", - "Version": "0.16.0", + "Version": "0.17.1", "Source": "Repository", "Repository": "CRAN", - "Hash": "96710351d642b70e8f02ddeb237c46a7" + "Hash": "5f90cd73946d706cfe26024294236113" }, "rvg": { "Package": "rvg", @@ -1344,35 +1346,42 @@ }, "sys": { "Package": "sys", - "Version": "3.4.2", + "Version": "3.4.3", "Source": "Repository", "Repository": "CRAN", - "Hash": "3a1be13d68d47a8cd0bfd74739ca1555" + "Hash": "de342ebfebdbf40477d0758d05426646" }, "systemfonts": { "Package": "systemfonts", - "Version": "1.1.0", + "Version": "1.2.1", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cpp11", - "lifecycle" + "grid", + "jsonlite", + "lifecycle", + "tools", + "utils" ], - "Hash": "213b6b8ed5afbf934843e6c3b090d418" + "Hash": "f8b2924480a2679e2bad9750646112fe" }, "textshaping": { "Package": "textshaping", - "Version": "0.4.0", + "Version": "1.0.0", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "R", "cpp11", "lifecycle", - "systemfonts" + "stats", + "stringi", + "systemfonts", + "utils" ], - "Hash": "5142f8bc78ed3d819d26461b641627ce" + "Hash": "5d44adc8145c718066b0bc374d142ca1" }, "tibble": { "Package": "tibble", @@ -1395,13 +1404,13 @@ }, "tinytex": { "Package": "tinytex", - "Version": "0.53", + "Version": "0.54", "Source": "Repository", "Repository": "CRAN", "Requirements": [ "xfun" ], - "Hash": "9db859e8aabbb474293dde3097839420" + "Hash": "3ec7e3ddcacc2d34a9046941222bf94d" }, "utf8": { "Package": "utf8", @@ -1462,7 +1471,7 @@ }, "withr": { "Package": "withr", - "Version": "3.0.1", + "Version": "3.0.2", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1470,11 +1479,11 @@ "grDevices", "graphics" ], - "Hash": "07909200e8bbe90426fbfeb73e1e27aa" + "Hash": "cc2d62c76458d425210d1eb1478b30b4" }, "xfun": { "Package": "xfun", - "Version": "0.47", + "Version": "0.50", "Source": "Repository", "Repository": "CRAN", "Requirements": [ @@ -1483,7 +1492,7 @@ "stats", "tools" ], - "Hash": "36ab21660e2d095fef0d83f689e0477c" + "Hash": "44ab88837d3f8dfc66a837299b887fa6" }, "xml2": { "Package": "xml2", @@ -1507,10 +1516,10 @@ }, "zip": { "Package": "zip", - "Version": "2.3.1", + "Version": "2.3.2", "Source": "Repository", "Repository": "CRAN", - "Hash": "fcc4bd8e6da2d2011eb64a5e5cc685ab" + "Hash": "2f2ac1424654714391fe94dd69e196a9" } } } From cf6a10fe67096d3b253c9a63c64b5bf8954dbca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 12 Feb 2025 13:50:59 +0100 Subject: [PATCH 131/157] Fix wrong package name --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2f52392..02db40b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: jaspModuleTemplate +Package: jaspModule Type: Package Title: A module for JASP Version: 0.1.0 From a5efade098af83c322fb3faab447c74796ddfa82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 12 Feb 2025 13:51:16 +0100 Subject: [PATCH 132/157] Add tables example --- NAMESPACE | 3 ++- R/examples.R | 15 +++++++++++++++ inst/Description.qml | 8 ++++++++ inst/qml/table.qml | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 inst/qml/table.qml diff --git a/NAMESPACE b/NAMESPACE index 0a4e42f..4c92578 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,5 @@ import(jaspBase) export(AddOne) export(ProcessData) -export(Parabola) +export(ProcessTable) +export(Parabola) \ No newline at end of file diff --git a/R/examples.R b/R/examples.R index c6e745a..50c1adb 100644 --- a/R/examples.R +++ b/R/examples.R @@ -18,6 +18,21 @@ ProcessData <- function(jaspResults, dataset, options) { return() } +ProcessTable <- function(jaspResults, dataset, options) { + # Prints the inputs as a table + stats <- createJaspTable(gettext("Some descriptives")) + + stats$addColumnInfo(name = "times") + stats$addColumnInfo(name = "xs") + + stats[["times"]] <- dataset[, options$ts] + stats[["xs"]] <- dataset[, options$xs] + + jaspResults[["stats"]] <- stats + + return() +} + Parabola <- function(jaspResults, dataset, options) { # Analysis f <- function(x) { options$a * x^2 } # Function to be plotted diff --git a/inst/Description.qml b/inst/Description.qml index 392aaff..f38713c 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -37,6 +37,14 @@ Description qml: "data.qml" } + Analysis + { + title: "Tabular results" + menu: "Tabular results" + func: "ProcessTable" + qml: "table.qml" + } + GroupTitle { title: qsTr("Plotting") diff --git a/inst/qml/table.qml b/inst/qml/table.qml new file mode 100644 index 0000000..bc581d4 --- /dev/null +++ b/inst/qml/table.qml @@ -0,0 +1,40 @@ +// +// Copyright (C) 2013-2018 University of Amsterdam +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public +// License along with this program. If not, see +// . +// +import QtQuick 2.8 +import QtQuick.Layouts 1.3 +import JASP.Controls 1.0 +import JASP.Widgets 1.0 +import JASP 1.0 + +Form +{ + + Text + { + text: "This example shows how to load a dataset and output it as a table" + } + + VariablesForm + { + AvailableVariablesList { name: "allVariables" } + AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } + AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } + } + +} From 751b31769e231dbc69279b9854d4bcc20d3409fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 12 Feb 2025 15:15:41 +0100 Subject: [PATCH 133/157] Add renv initializer --- .gitignore | 1 - renv/.gitignore | 7 + renv/activate.R | 1220 ++++++++++++++++++++++++++++++++++++++++++++ renv/settings.json | 19 + 4 files changed, 1246 insertions(+), 1 deletion(-) create mode 100644 renv/.gitignore create mode 100644 renv/activate.R create mode 100644 renv/settings.json diff --git a/.gitignore b/.gitignore index 2a2473d..854a153 100644 --- a/.gitignore +++ b/.gitignore @@ -58,5 +58,4 @@ Thumbs.db # RStudio files .Rproj.user -renv/ _processedLockFile.lock diff --git a/renv/.gitignore b/renv/.gitignore new file mode 100644 index 0000000..0ec0cbb --- /dev/null +++ b/renv/.gitignore @@ -0,0 +1,7 @@ +library/ +local/ +cellar/ +lock/ +python/ +sandbox/ +staging/ diff --git a/renv/activate.R b/renv/activate.R new file mode 100644 index 0000000..d13f993 --- /dev/null +++ b/renv/activate.R @@ -0,0 +1,1220 @@ + +local({ + + # the requested version of renv + version <- "1.0.7" + attr(version, "sha") <- NULL + + # the project directory + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() + + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } + + # figure out whether the autoloader is enabled + enabled <- local({ + + # first, check config option + override <- getOption("renv.config.autoloader.enabled") + if (!is.null(override)) + return(override) + + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + + # next, check environment variables + # TODO: prefer using the configuration one in the future + envvars <- c( + "RENV_CONFIG_AUTOLOADER_ENABLED", + "RENV_AUTOLOADER_ENABLED", + "RENV_ACTIVATE_PROJECT" + ) + + for (envvar in envvars) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(tolower(envval) %in% c("true", "t", "1")) + } + + # enable by default + TRUE + + }) + + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + + return(FALSE) + + } + + # avoid recursion + if (identical(getOption("renv.autoloader.running"), TRUE)) { + warning("ignoring recursive attempt to run renv autoloader") + return(invisible(TRUE)) + } + + # signal that we're loading renv during R startup + options(renv.autoloader.running = TRUE) + on.exit(options(renv.autoloader.running = NULL), add = TRUE) + + # signal that we've consented to use renv + options(renv.consent = TRUE) + + # load the 'utils' package eagerly -- this ensures that renv shims, which + # mask 'utils' packages, will come first on the search path + library(utils, lib.loc = .Library) + + # unload renv if it's already been loaded + if ("renv" %in% loadedNamespaces()) + unloadNamespace("renv") + + # load bootstrap tools + `%||%` <- function(x, y) { + if (is.null(x)) y else x + } + + catf <- function(fmt, ..., appendLF = TRUE) { + + quiet <- getOption("renv.bootstrap.quiet", default = FALSE) + if (quiet) + return(invisible()) + + msg <- sprintf(fmt, ...) + cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") + + invisible(msg) + + } + + header <- function(label, + ..., + prefix = "#", + suffix = "-", + n = min(getOption("width"), 78)) + { + label <- sprintf(label, ...) + n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) + if (n <= 0) + return(paste(prefix, label)) + + tail <- paste(rep.int(suffix, n), collapse = "") + paste0(prefix, " ", label, " ", tail) + + } + + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + paste(substring(lines, common), collapse = "\n") + + } + + startswith <- function(string, prefix) { + substring(string, 1, nchar(prefix)) == prefix + } + + bootstrap <- function(version, library) { + + friendly <- renv_bootstrap_version_friendly(version) + section <- header(sprintf("Bootstrapping renv %s", friendly)) + catf(section) + + # attempt to download renv + catf("- Downloading renv ... ", appendLF = FALSE) + withCallingHandlers( + tarball <- renv_bootstrap_download(version), + error = function(err) { + catf("FAILED") + stop("failed to download:\n", conditionMessage(err)) + } + ) + catf("OK") + on.exit(unlink(tarball), add = TRUE) + + # now attempt to install + catf("- Installing renv ... ", appendLF = FALSE) + withCallingHandlers( + status <- renv_bootstrap_install(version, tarball, library), + error = function(err) { + catf("FAILED") + stop("failed to install:\n", conditionMessage(err)) + } + ) + catf("OK") + + # add empty line to break up bootstrapping from normal output + catf("") + + return(invisible()) + } + + renv_bootstrap_tests_running <- function() { + getOption("renv.tests.running", default = FALSE) + } + + renv_bootstrap_repos <- function() { + + # get CRAN repository + cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") + + # check for repos override + repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) + if (!is.na(repos)) { + + # check for RSPM; if set, use a fallback repository for renv + rspm <- Sys.getenv("RSPM", unset = NA) + if (identical(rspm, repos)) + repos <- c(RSPM = rspm, CRAN = cran) + + return(repos) + + } + + # check for lockfile repositories + repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) + if (!inherits(repos, "error") && length(repos)) + return(repos) + + # retrieve current repos + repos <- getOption("repos") + + # ensure @CRAN@ entries are resolved + repos[repos == "@CRAN@"] <- cran + + # add in renv.bootstrap.repos if set + default <- c(FALLBACK = "https://cloud.r-project.org") + extra <- getOption("renv.bootstrap.repos", default = default) + repos <- c(repos, extra) + + # remove duplicates that might've snuck in + dupes <- duplicated(repos) | duplicated(names(repos)) + repos[!dupes] + + } + + renv_bootstrap_repos_lockfile <- function() { + + lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock") + if (!file.exists(lockpath)) + return(NULL) + + lockfile <- tryCatch(renv_json_read(lockpath), error = identity) + if (inherits(lockfile, "error")) { + warning(lockfile) + return(NULL) + } + + repos <- lockfile$R$Repositories + if (length(repos) == 0) + return(NULL) + + keys <- vapply(repos, `[[`, "Name", FUN.VALUE = character(1)) + vals <- vapply(repos, `[[`, "URL", FUN.VALUE = character(1)) + names(vals) <- keys + + return(vals) + + } + + renv_bootstrap_download <- function(version) { + + sha <- attr(version, "sha", exact = TRUE) + + methods <- if (!is.null(sha)) { + + # attempting to bootstrap a development version of renv + c( + function() renv_bootstrap_download_tarball(sha), + function() renv_bootstrap_download_github(sha) + ) + + } else { + + # attempting to bootstrap a release version of renv + c( + function() renv_bootstrap_download_tarball(version), + function() renv_bootstrap_download_cran_latest(version), + function() renv_bootstrap_download_cran_archive(version) + ) + + } + + for (method in methods) { + path <- tryCatch(method(), error = identity) + if (is.character(path) && file.exists(path)) + return(path) + } + + stop("All download methods failed") + + } + + renv_bootstrap_download_impl <- function(url, destfile) { + + mode <- "wb" + + # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 + fixup <- + Sys.info()[["sysname"]] == "Windows" && + substring(url, 1L, 5L) == "file:" + + if (fixup) + mode <- "w+b" + + args <- list( + url = url, + destfile = destfile, + mode = mode, + quiet = TRUE + ) + + if ("headers" %in% names(formals(utils::download.file))) + args$headers <- renv_bootstrap_download_custom_headers(url) + + do.call(utils::download.file, args) + + } + + renv_bootstrap_download_custom_headers <- function(url) { + + headers <- getOption("renv.download.headers") + if (is.null(headers)) + return(character()) + + if (!is.function(headers)) + stopf("'renv.download.headers' is not a function") + + headers <- headers(url) + if (length(headers) == 0L) + return(character()) + + if (is.list(headers)) + headers <- unlist(headers, recursive = FALSE, use.names = TRUE) + + ok <- + is.character(headers) && + is.character(names(headers)) && + all(nzchar(names(headers))) + + if (!ok) + stop("invocation of 'renv.download.headers' did not return a named character vector") + + headers + + } + + renv_bootstrap_download_cran_latest <- function(version) { + + spec <- renv_bootstrap_download_cran_latest_find(version) + type <- spec$type + repos <- spec$repos + + baseurl <- utils::contrib.url(repos = repos, type = type) + ext <- if (identical(type, "source")) + ".tar.gz" + else if (Sys.info()[["sysname"]] == "Windows") + ".zip" + else + ".tgz" + name <- sprintf("renv_%s%s", version, ext) + url <- paste(baseurl, name, sep = "/") + + destfile <- file.path(tempdir(), name) + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (inherits(status, "condition")) + return(FALSE) + + # report success and return + destfile + + } + + renv_bootstrap_download_cran_latest_find <- function(version) { + + # check whether binaries are supported on this system + binary <- + getOption("renv.bootstrap.binary", default = TRUE) && + !identical(.Platform$pkgType, "source") && + !identical(getOption("pkgType"), "source") && + Sys.info()[["sysname"]] %in% c("Darwin", "Windows") + + types <- c(if (binary) "binary", "source") + + # iterate over types + repositories + for (type in types) { + for (repos in renv_bootstrap_repos()) { + + # retrieve package database + db <- tryCatch( + as.data.frame( + utils::available.packages(type = type, repos = repos), + stringsAsFactors = FALSE + ), + error = identity + ) + + if (inherits(db, "error")) + next + + # check for compatible entry + entry <- db[db$Package %in% "renv" & db$Version %in% version, ] + if (nrow(entry) == 0) + next + + # found it; return spec to caller + spec <- list(entry = entry, type = type, repos = repos) + return(spec) + + } + } + + # if we got here, we failed to find renv + fmt <- "renv %s is not available from your declared package repositories" + stop(sprintf(fmt, version)) + + } + + renv_bootstrap_download_cran_archive <- function(version) { + + name <- sprintf("renv_%s.tar.gz", version) + repos <- renv_bootstrap_repos() + urls <- file.path(repos, "src/contrib/Archive/renv", name) + destfile <- file.path(tempdir(), name) + + for (url in urls) { + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (identical(status, 0L)) + return(destfile) + + } + + return(FALSE) + + } + + renv_bootstrap_download_tarball <- function(version) { + + # if the user has provided the path to a tarball via + # an environment variable, then use it + tarball <- Sys.getenv("RENV_BOOTSTRAP_TARBALL", unset = NA) + if (is.na(tarball)) + return() + + # allow directories + if (dir.exists(tarball)) { + name <- sprintf("renv_%s.tar.gz", version) + tarball <- file.path(tarball, name) + } + + # bail if it doesn't exist + if (!file.exists(tarball)) { + + # let the user know we weren't able to honour their request + fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." + msg <- sprintf(fmt, tarball) + warning(msg) + + # bail + return() + + } + + catf("- Using local tarball '%s'.", tarball) + tarball + + } + + renv_bootstrap_download_github <- function(version) { + + enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") + if (!identical(enabled, "TRUE")) + return(FALSE) + + # prepare download options + pat <- Sys.getenv("GITHUB_PAT") + if (nzchar(Sys.which("curl")) && nzchar(pat)) { + fmt <- "--location --fail --header \"Authorization: token %s\"" + extra <- sprintf(fmt, pat) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "curl", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + fmt <- "--header=\"Authorization: token %s\"" + extra <- sprintf(fmt, pat) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "wget", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } + + url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) + name <- sprintf("renv_%s.tar.gz", version) + destfile <- file.path(tempdir(), name) + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (!identical(status, 0L)) + return(FALSE) + + renv_bootstrap_download_augment(destfile) + + return(destfile) + + } + + # Add Sha to DESCRIPTION. This is stop gap until #890, after which we + # can use renv::install() to fully capture metadata. + renv_bootstrap_download_augment <- function(destfile) { + sha <- renv_bootstrap_git_extract_sha1_tar(destfile) + if (is.null(sha)) { + return() + } + + # Untar + tempdir <- tempfile("renv-github-") + on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) + untar(destfile, exdir = tempdir) + pkgdir <- dir(tempdir, full.names = TRUE)[[1]] + + # Modify description + desc_path <- file.path(pkgdir, "DESCRIPTION") + desc_lines <- readLines(desc_path) + remotes_fields <- c( + "RemoteType: github", + "RemoteHost: api.github.com", + "RemoteRepo: renv", + "RemoteUsername: rstudio", + "RemotePkgRef: rstudio/renv", + paste("RemoteRef: ", sha), + paste("RemoteSha: ", sha) + ) + writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) + + # Re-tar + local({ + old <- setwd(tempdir) + on.exit(setwd(old), add = TRUE) + + tar(destfile, compression = "gzip") + }) + invisible() + } + + # Extract the commit hash from a git archive. Git archives include the SHA1 + # hash as the comment field of the tarball pax extended header + # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) + # For GitHub archives this should be the first header after the default one + # (512 byte) header. + renv_bootstrap_git_extract_sha1_tar <- function(bundle) { + + # open the bundle for reading + # We use gzcon for everything because (from ?gzcon) + # > Reading from a connection which does not supply a 'gzip' magic + # > header is equivalent to reading from the original connection + conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) + on.exit(close(conn)) + + # The default pax header is 512 bytes long and the first pax extended header + # with the comment should be 51 bytes long + # `52 comment=` (11 chars) + 40 byte SHA1 hash + len <- 0x200 + 0x33 + res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) + + if (grepl("^52 comment=", res)) { + sub("52 comment=", "", res) + } else { + NULL + } + } + + renv_bootstrap_install <- function(version, tarball, library) { + + # attempt to install it into project library + dir.create(library, showWarnings = FALSE, recursive = TRUE) + output <- renv_bootstrap_install_impl(library, tarball) + + # check for successful install + status <- attr(output, "status") + if (is.null(status) || identical(status, 0L)) + return(status) + + # an error occurred; report it + header <- "installation of renv failed" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- paste(c(header, lines, output), collapse = "\n") + stop(text) + + } + + renv_bootstrap_install_impl <- function(library, tarball) { + + # invoke using system2 so we can capture and report output + bin <- R.home("bin") + exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" + R <- file.path(bin, exe) + + args <- c( + "--vanilla", "CMD", "INSTALL", "--no-multiarch", + "-l", shQuote(path.expand(library)), + shQuote(path.expand(tarball)) + ) + + system2(R, args, stdout = TRUE, stderr = TRUE) + + } + + renv_bootstrap_platform_prefix <- function() { + + # construct version prefix + version <- paste(R.version$major, R.version$minor, sep = ".") + prefix <- paste("R", numeric_version(version)[1, 1:2], sep = "-") + + # include SVN revision for development versions of R + # (to avoid sharing platform-specific artefacts with released versions of R) + devel <- + identical(R.version[["status"]], "Under development (unstable)") || + identical(R.version[["nickname"]], "Unsuffered Consequences") + + if (devel) + prefix <- paste(prefix, R.version[["svn rev"]], sep = "-r") + + # build list of path components + components <- c(prefix, R.version$platform) + + # include prefix if provided by user + prefix <- renv_bootstrap_platform_prefix_impl() + if (!is.na(prefix) && nzchar(prefix)) + components <- c(prefix, components) + + # build prefix + paste(components, collapse = "/") + + } + + renv_bootstrap_platform_prefix_impl <- function() { + + # if an explicit prefix has been supplied, use it + prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) + if (!is.na(prefix)) + return(prefix) + + # if the user has requested an automatic prefix, generate it + auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + + if (auto %in% c("TRUE", "True", "true", "1")) + return(renv_bootstrap_platform_prefix_auto()) + + # empty string on failure + "" + + } + + renv_bootstrap_platform_prefix_auto <- function() { + + prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) + if (inherits(prefix, "error") || prefix %in% "unknown") { + + msg <- paste( + "failed to infer current operating system", + "please file a bug report at https://github.com/rstudio/renv/issues", + sep = "; " + ) + + warning(msg) + + } + + prefix + + } + + renv_bootstrap_platform_os <- function() { + + sysinfo <- Sys.info() + sysname <- sysinfo[["sysname"]] + + # handle Windows + macOS up front + if (sysname == "Windows") + return("windows") + else if (sysname == "Darwin") + return("macos") + + # check for os-release files + for (file in c("/etc/os-release", "/usr/lib/os-release")) + if (file.exists(file)) + return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) + + # check for redhat-release files + if (file.exists("/etc/redhat-release")) + return(renv_bootstrap_platform_os_via_redhat_release()) + + "unknown" + + } + + renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { + + # read /etc/os-release + release <- utils::read.table( + file = file, + sep = "=", + quote = c("\"", "'"), + col.names = c("Key", "Value"), + comment.char = "#", + stringsAsFactors = FALSE + ) + + vars <- as.list(release$Value) + names(vars) <- release$Key + + # get os name + os <- tolower(sysinfo[["sysname"]]) + + # read id + id <- "unknown" + for (field in c("ID", "ID_LIKE")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + id <- vars[[field]] + break + } + } + + # read version + version <- "unknown" + for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + version <- vars[[field]] + break + } + } + + # join together + paste(c(os, id, version), collapse = "-") + + } + + renv_bootstrap_platform_os_via_redhat_release <- function() { + + # read /etc/redhat-release + contents <- readLines("/etc/redhat-release", warn = FALSE) + + # infer id + id <- if (grepl("centos", contents, ignore.case = TRUE)) + "centos" + else if (grepl("redhat", contents, ignore.case = TRUE)) + "redhat" + else + "unknown" + + # try to find a version component (very hacky) + version <- "unknown" + + parts <- strsplit(contents, "[[:space:]]")[[1L]] + for (part in parts) { + + nv <- tryCatch(numeric_version(part), error = identity) + if (inherits(nv, "error")) + next + + version <- nv[1, 1] + break + + } + + paste(c("linux", id, version), collapse = "-") + + } + + renv_bootstrap_library_root_name <- function(project) { + + # use project name as-is if requested + asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") + if (asis) + return(basename(project)) + + # otherwise, disambiguate based on project's path + id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) + paste(basename(project), id, sep = "-") + + } + + renv_bootstrap_library_root <- function(project) { + + prefix <- renv_bootstrap_profile_prefix() + + path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) + if (!is.na(path)) + return(paste(c(path, prefix), collapse = "/")) + + path <- renv_bootstrap_library_root_impl(project) + if (!is.null(path)) { + name <- renv_bootstrap_library_root_name(project) + return(paste(c(path, prefix, name), collapse = "/")) + } + + renv_bootstrap_paths_renv("library", project = project) + + } + + renv_bootstrap_library_root_impl <- function(project) { + + root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) + if (!is.na(root)) + return(root) + + type <- renv_bootstrap_project_type(project) + if (identical(type, "package")) { + userdir <- renv_bootstrap_user_dir() + return(file.path(userdir, "library")) + } + + } + + renv_bootstrap_validate_version <- function(version, description = NULL) { + + # resolve description file + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") + + # check whether requested version 'version' matches loaded version of renv + sha <- attr(version, "sha", exact = TRUE) + valid <- if (!is.null(sha)) + renv_bootstrap_validate_version_dev(sha, description) + else + renv_bootstrap_validate_version_release(version, description) + + if (valid) + return(TRUE) + + # the loaded version of renv doesn't match the requested version; + # give the user instructions on how to proceed + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) + paste("rstudio/renv", description[["RemoteSha"]], sep = "@") + else + paste("renv", description[["Version"]], sep = "@") + + # display both loaded version + sha if available + friendly <- renv_bootstrap_version_friendly( + version = description[["Version"]], + sha = if (dev) description[["RemoteSha"]] + ) + + fmt <- heredoc(" + renv %1$s was loaded from project library, but this project is configured to use renv %2$s. + - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. + - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. + ") + catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) + + FALSE + + } + + renv_bootstrap_validate_version_dev <- function(version, description) { + expected <- description[["RemoteSha"]] + is.character(expected) && startswith(expected, version) + } + + renv_bootstrap_validate_version_release <- function(version, description) { + expected <- description[["Version"]] + is.character(expected) && identical(expected, version) + } + + renv_bootstrap_hash_text <- function(text) { + + hashfile <- tempfile("renv-hash-") + on.exit(unlink(hashfile), add = TRUE) + + writeLines(text, con = hashfile) + tools::md5sum(hashfile) + + } + + renv_bootstrap_load <- function(project, libpath, version) { + + # try to load renv from the project library + if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) + return(FALSE) + + # warn if the version of renv loaded does not match + renv_bootstrap_validate_version(version) + + # execute renv load hooks, if any + hooks <- getHook("renv::autoload") + for (hook in hooks) + if (is.function(hook)) + tryCatch(hook(), error = warnify) + + # load the project + renv::load(project) + + TRUE + + } + + renv_bootstrap_profile_load <- function(project) { + + # if RENV_PROFILE is already set, just use that + profile <- Sys.getenv("RENV_PROFILE", unset = NA) + if (!is.na(profile) && nzchar(profile)) + return(profile) + + # check for a profile file (nothing to do if it doesn't exist) + path <- renv_bootstrap_paths_renv("profile", profile = FALSE, project = project) + if (!file.exists(path)) + return(NULL) + + # read the profile, and set it if it exists + contents <- readLines(path, warn = FALSE) + if (length(contents) == 0L) + return(NULL) + + # set RENV_PROFILE + profile <- contents[[1L]] + if (!profile %in% c("", "default")) + Sys.setenv(RENV_PROFILE = profile) + + profile + + } + + renv_bootstrap_profile_prefix <- function() { + profile <- renv_bootstrap_profile_get() + if (!is.null(profile)) + return(file.path("profiles", profile, "renv")) + } + + renv_bootstrap_profile_get <- function() { + profile <- Sys.getenv("RENV_PROFILE", unset = "") + renv_bootstrap_profile_normalize(profile) + } + + renv_bootstrap_profile_set <- function(profile) { + profile <- renv_bootstrap_profile_normalize(profile) + if (is.null(profile)) + Sys.unsetenv("RENV_PROFILE") + else + Sys.setenv(RENV_PROFILE = profile) + } + + renv_bootstrap_profile_normalize <- function(profile) { + + if (is.null(profile) || profile %in% c("", "default")) + return(NULL) + + profile + + } + + renv_bootstrap_path_absolute <- function(path) { + + substr(path, 1L, 1L) %in% c("~", "/", "\\") || ( + substr(path, 1L, 1L) %in% c(letters, LETTERS) && + substr(path, 2L, 3L) %in% c(":/", ":\\") + ) + + } + + renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) { + renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv") + root <- if (renv_bootstrap_path_absolute(renv)) NULL else project + prefix <- if (profile) renv_bootstrap_profile_prefix() + components <- c(root, renv, prefix, ...) + paste(components, collapse = "/") + } + + renv_bootstrap_project_type <- function(path) { + + descpath <- file.path(path, "DESCRIPTION") + if (!file.exists(descpath)) + return("unknown") + + desc <- tryCatch( + read.dcf(descpath, all = TRUE), + error = identity + ) + + if (inherits(desc, "error")) + return("unknown") + + type <- desc$Type + if (!is.null(type)) + return(tolower(type)) + + package <- desc$Package + if (!is.null(package)) + return("package") + + "unknown" + + } + + renv_bootstrap_user_dir <- function() { + dir <- renv_bootstrap_user_dir_impl() + path.expand(chartr("\\", "/", dir)) + } + + renv_bootstrap_user_dir_impl <- function() { + + # use local override if set + override <- getOption("renv.userdir.override") + if (!is.null(override)) + return(override) + + # use R_user_dir if available + tools <- asNamespace("tools") + if (is.function(tools$R_user_dir)) + return(tools$R_user_dir("renv", "cache")) + + # try using our own backfill for older versions of R + envvars <- c("R_USER_CACHE_DIR", "XDG_CACHE_HOME") + for (envvar in envvars) { + root <- Sys.getenv(envvar, unset = NA) + if (!is.na(root)) + return(file.path(root, "R/renv")) + } + + # use platform-specific default fallbacks + if (Sys.info()[["sysname"]] == "Windows") + file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv") + else if (Sys.info()[["sysname"]] == "Darwin") + "~/Library/Caches/org.R-project.R/R/renv" + else + "~/.cache/R/renv" + + } + + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { + sha <- sha %||% attr(version, "sha", exact = TRUE) + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(version, libpath) + } + + renv_bootstrap_run <- function(version, libpath) { + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + return(renv::load(project = getwd())) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + + } + + renv_json_read <- function(file = NULL, text = NULL) { + + jlerr <- NULL + + # if jsonlite is loaded, use that instead + if ("jsonlite" %in% loadedNamespaces()) { + + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + jlerr <- json + + } + + # otherwise, fall back to the default JSON reader + json <- tryCatch(renv_json_read_default(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + # report an error + if (!is.null(jlerr)) + stop(jlerr) + else + stop(json) + + } + + renv_json_read_jsonlite <- function(file = NULL, text = NULL) { + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + jsonlite::fromJSON(txt = text, simplifyVector = FALSE) + } + + renv_json_read_default <- function(file = NULL, text = NULL) { + + # find strings in the JSON + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + pattern <- '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' + locs <- gregexpr(pattern, text, perl = TRUE)[[1]] + + # if any are found, replace them with placeholders + replaced <- text + strings <- character() + replacements <- character() + + if (!identical(c(locs), -1L)) { + + # get the string values + starts <- locs + ends <- locs + attr(locs, "match.length") - 1L + strings <- substring(text, starts, ends) + + # only keep those requiring escaping + strings <- grep("[[\\]{}:]", strings, perl = TRUE, value = TRUE) + + # compute replacements + replacements <- sprintf('"\032%i\032"', seq_along(strings)) + + # replace the strings + mapply(function(string, replacement) { + replaced <<- sub(string, replacement, replaced, fixed = TRUE) + }, strings, replacements) + + } + + # transform the JSON into something the R parser understands + transformed <- replaced + transformed <- gsub("{}", "`names<-`(list(), character())", transformed, fixed = TRUE) + transformed <- gsub("[[{]", "list(", transformed, perl = TRUE) + transformed <- gsub("[]}]", ")", transformed, perl = TRUE) + transformed <- gsub(":", "=", transformed, fixed = TRUE) + text <- paste(transformed, collapse = "\n") + + # parse it + json <- parse(text = text, keep.source = FALSE, srcfile = NULL)[[1L]] + + # construct map between source strings, replaced strings + map <- as.character(parse(text = strings)) + names(map) <- as.character(parse(text = replacements)) + + # convert to list + map <- as.list(map) + + # remap strings in object + remapped <- renv_json_read_remap(json, map) + + # evaluate + eval(remapped, envir = baseenv()) + + } + + renv_json_read_remap <- function(json, map) { + + # fix names + if (!is.null(names(json))) { + lhs <- match(names(json), names(map), nomatch = 0L) + rhs <- match(names(map), names(json), nomatch = 0L) + names(json)[rhs] <- map[lhs] + } + + # fix values + if (is.character(json)) + return(map[[json]] %||% json) + + # handle true, false, null + if (is.name(json)) { + text <- as.character(json) + if (text == "true") + return(TRUE) + else if (text == "false") + return(FALSE) + else if (text == "null") + return(NULL) + } + + # recurse + if (is.recursive(json)) { + for (i in seq_along(json)) { + json[i] <- list(renv_json_read_remap(json[[i]], map)) + } + } + + json + + } + + # load the renv profile, if any + renv_bootstrap_profile_load(project) + + # construct path to library root + root <- renv_bootstrap_library_root(project) + + # construct library prefix for platform + prefix <- renv_bootstrap_platform_prefix() + + # construct full libpath + libpath <- file.path(root, prefix) + + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) + + invisible() + +}) diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 0000000..74c1d4b --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,19 @@ +{ + "bioconductor.version": null, + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "explicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} From 8a84bf170ea561e191fb8ffec6bf5e8bb8b9c184 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Fri, 14 Feb 2025 11:14:14 +0100 Subject: [PATCH 134/157] disable workflows on pull_request --- .github/workflows/check_module_on_pr.yml | 7 +++++-- .github/workflows/post-merge-new-repo.yml | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml index a49fece..258e0c3 100644 --- a/.github/workflows/check_module_on_pr.yml +++ b/.github/workflows/check_module_on_pr.yml @@ -1,8 +1,11 @@ name: Check pre-requisites for module creation on: - pull_request: - types: [opened] + workflow_dispatch: + +# on: +# pull_request: +# types: [opened] permissions: {} diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml index 01f7b33..0ac8822 100644 --- a/.github/workflows/post-merge-new-repo.yml +++ b/.github/workflows/post-merge-new-repo.yml @@ -1,9 +1,11 @@ name: Post-Merge Repository Creation and Revert Pull Request on: - pull_request_target: - types: - - closed # Trigger when a pull request is closed (merged or not) + workflow_dispatch: +# on: +# pull_request_target: +# types: +# - closed # Trigger when a pull request is closed (merged or not) permissions: {} From 874e01a1e50ea2069452fed671009a1664e30135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 19 Mar 2025 14:56:13 +0100 Subject: [PATCH 135/157] Temporarily remove actions --- .github/workflows/check_module_on_pr.yml | 91 ------------- .github/workflows/i18nCheck.yml | 17 --- .github/workflows/post-merge-new-repo.yml | 153 ---------------------- .github/workflows/translations.yml | 23 ---- .github/workflows/unittests.yml | 19 --- 5 files changed, 303 deletions(-) delete mode 100644 .github/workflows/check_module_on_pr.yml delete mode 100644 .github/workflows/i18nCheck.yml delete mode 100644 .github/workflows/post-merge-new-repo.yml delete mode 100644 .github/workflows/translations.yml delete mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml deleted file mode 100644 index 258e0c3..0000000 --- a/.github/workflows/check_module_on_pr.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Check pre-requisites for module creation - -on: - workflow_dispatch: - -# on: -# pull_request: -# types: [opened] - -permissions: {} - -jobs: - check-description-file: - if: github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-latest - env: - ORG_NAME: "jasp-escience" - - steps: - # Step 1: Check out the repository - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - # Step 2: Check if the DESCRIPTION file exists - - name: Verify DESCRIPTION file exists - run: | - if [ ! -f "DESCRIPTION" ]; then - echo "ERROR: DESCRIPTION file is missing." - exit 1 - else - echo "DESCRIPTION file exists." - fi - - - name: Check for package name in DESCRIPTION - run: | - # PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') - PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - # Prevent special characters in package name - if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - exit 1 - fi - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - shell: bash - - - name: Check if `.github/` folder was modified using Git diff - run: | - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) - - echo "Changed files:" - echo "$CHANGED_FILES" - - if echo "$CHANGED_FILES" | grep -q "^\.github/"; then - echo "❌ The .github/ folder was been modified." - exit 1 - else - echo "βœ… The .github/ folder has NOT modified." - fi - - - name: Check if module already exists submodules - env: - MODULE_NAME: ${{ env.MODULE_NAME }} - run: | - git clone --depth=1 https://github.com/$ORG_NAME/modules.git target_repo - cd target_repo - if git config --file .gitmodules --get-regexp path | grep -q "^submodule.modules/${MODULE_NAME}.path"; then - echo "❌ Submodule '${MODULE_NAME}' found! Failing the workflow." - exit 1 - else - echo "βœ… No submodule named '${MODULE_NAME}' found." - fi - shell: bash - - - name: Check if repository exists in organization - env: - MODULE_NAME: ${{ env.MODULE_NAME }} - run: | - if curl -s -o /dev/null -w "%{http_code}" "https://github.com/$ORG_NAME/$MODULE_NAME" | grep -q "200"; then - echo "❌ Repository '${MODULE_NAME}' exists in organization '${ORG_NAME}'. Failing the workflow." - exit 1 - else - echo "βœ… Repository '${MODULE_NAME}' does not exist in organization '${ORG_NAME}'." - fi - shell: bash diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml deleted file mode 100644 index ec3c06b..0000000 --- a/.github/workflows/i18nCheck.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: - workflow_dispatch: - -# on: -# push: -# paths: ['**.R', '**.qml', '**.po', '**.yml'] -# -# pull_request: -# paths: ['**.R', '**.qml', '**.po', '**.yml'] -# -# workflow_dispatch: - -name: i18n-check - -jobs: - i18n-check: - uses: jasp-stats/jasp-actions/.github/workflows/i18nCheck.yml@master diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml deleted file mode 100644 index 0ac8822..0000000 --- a/.github/workflows/post-merge-new-repo.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: Post-Merge Repository Creation and Revert Pull Request - -on: - workflow_dispatch: -# on: -# pull_request_target: -# types: -# - closed # Trigger when a pull request is closed (merged or not) - -permissions: {} - -jobs: - create_new_repository: - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-24.04 - - outputs: # Define output variables. We need these to pass information between jobs - module_name: ${{ steps.extract_vars.outputs.module_name }} - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all branches and commit history - persist-credentials: false # Do not persist credentials to the git config - - - name: Extract Package Name from DESCRIPTION - id: extract_vars - run: | - # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') - PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - # Prevent special characters in package name - if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - exit 1 - fi - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT - shell: bash - - - name: Create New Repository in Organization - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - echo "Creating repository $REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") - - if echo "$RESPONSE" | grep -q '"full_name"'; then - echo "Repository created successfully: $REPO_NAME" - echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV - else - echo "Failed to create repository: $RESPONSE" - exit 1 - fi - - - name: Push Merged Code to New Repository - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - git clone "https://github.com/${{ github.repository }}.git" temp_repo - git config --global user.name "GitHub Actions" - git config --global user.email "github-actions@users.noreply.github.com" - cd temp_repo - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" - rm .github/workflows/check_module_on_pr.yml - rm .github/workflows/post-merge-new-repo.yml - git commit -am "Remove CI/CD workflows" - git push --mirror - - revert_main_branch: - if: always() # Always run this job, even if the previous job fails - permissions: - contents: write - actions: read - pull-requests: write - - runs-on: ubuntu-24.04 - needs: [create_new_repository] - env: - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - ORG_PAT: ${{ secrets.ORG_PAT }} - - steps: - - name: Checkout Repository - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git User - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - # Authenticate Git with Personal Access Token (PAT) - # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - - - name: Revert Main Branch to Pre-Merge State - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - run: | - MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT - git push origin main - - - name: Comment on Pull Request - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - uses: actions/github-script@v6 - # env: - # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} - with: - script: | - const module_name = process.env.MODULE_NAME; - const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); - - add_submodule: - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-24.04 - needs: [create_new_repository] - - env: - ORG_PAT: ${{ secrets.ORG_PAT }} - ORG_NAME: "jasp-escience" - MODULES_REPO: "github.com/jasp-escience/modules" - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - - steps: - - name: Add New Repository as a Submodule in jasp-escience/modules - run: | - git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo - cd modules_repo - - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} - git add .gitmodules modules/${MODULE_NAME} - git commit -m "Added ${MODULE_NAME} as a submodule under modules/" - git push origin main diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml deleted file mode 100644 index 0ae22e8..0000000 --- a/.github/workflows/translations.yml +++ /dev/null @@ -1,23 +0,0 @@ -on: - workflow_dispatch: - -# on: -# schedule: -# - cron: '*/5 * * * *' -# workflow_dispatch: -# -name: generate-translations - -jobs: - generate-translations: - runs-on: ubuntu-latest - env: - REPO_KEY: ${{ secrets.REPOS_KEY }} - WEBLATE_KEY: ${{ secrets.WEBLATE_KEY }} - QML_REPO: jasptestmodule-qml - R_REPO: jasttestmodule-r - - steps: - - uses: jasp-stats/jasp-actions/wlcLock@master - - - uses: jasp-stats/jasp-actions/translations@master diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml deleted file mode 100644 index 45bb379..0000000 --- a/.github/workflows/unittests.yml +++ /dev/null @@ -1,19 +0,0 @@ -on: - workflow_dispatch: - -# on: -# push: -# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] -# pull_request: -# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] -# schedule: -# - cron: '13 12 * * 1-5' - -name: unit-tests - -jobs: - unit-tests: - uses: jasp-stats/jasp-actions/.github/workflows/unittests.yml@master - with: - needs_JAGS: false - needs_igraph: false From e7b1adfa5dbcdd5f6ee85cd2060c2be16ddb6bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 19 Mar 2025 14:58:15 +0100 Subject: [PATCH 136/157] Revert "Temporarily remove actions" This reverts commit 874e01a1e50ea2069452fed671009a1664e30135. --- .github/workflows/check_module_on_pr.yml | 91 +++++++++++++ .github/workflows/i18nCheck.yml | 17 +++ .github/workflows/post-merge-new-repo.yml | 153 ++++++++++++++++++++++ .github/workflows/translations.yml | 23 ++++ .github/workflows/unittests.yml | 19 +++ 5 files changed, 303 insertions(+) create mode 100644 .github/workflows/check_module_on_pr.yml create mode 100644 .github/workflows/i18nCheck.yml create mode 100644 .github/workflows/post-merge-new-repo.yml create mode 100644 .github/workflows/translations.yml create mode 100644 .github/workflows/unittests.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml new file mode 100644 index 0000000..258e0c3 --- /dev/null +++ b/.github/workflows/check_module_on_pr.yml @@ -0,0 +1,91 @@ +name: Check pre-requisites for module creation + +on: + workflow_dispatch: + +# on: +# pull_request: +# types: [opened] + +permissions: {} + +jobs: + check-description-file: + if: github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + runs-on: ubuntu-latest + env: + ORG_NAME: "jasp-escience" + + steps: + # Step 1: Check out the repository + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + # Step 2: Check if the DESCRIPTION file exists + - name: Verify DESCRIPTION file exists + run: | + if [ ! -f "DESCRIPTION" ]; then + echo "ERROR: DESCRIPTION file is missing." + exit 1 + else + echo "DESCRIPTION file exists." + fi + + - name: Check for package name in DESCRIPTION + run: | + # PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') + PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + # Prevent special characters in package name + if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: PACKAGE_NAME contains invalid characters!" >&2 + exit 1 + fi + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + shell: bash + + - name: Check if `.github/` folder was modified using Git diff + run: | + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) + + echo "Changed files:" + echo "$CHANGED_FILES" + + if echo "$CHANGED_FILES" | grep -q "^\.github/"; then + echo "❌ The .github/ folder was been modified." + exit 1 + else + echo "βœ… The .github/ folder has NOT modified." + fi + + - name: Check if module already exists submodules + env: + MODULE_NAME: ${{ env.MODULE_NAME }} + run: | + git clone --depth=1 https://github.com/$ORG_NAME/modules.git target_repo + cd target_repo + if git config --file .gitmodules --get-regexp path | grep -q "^submodule.modules/${MODULE_NAME}.path"; then + echo "❌ Submodule '${MODULE_NAME}' found! Failing the workflow." + exit 1 + else + echo "βœ… No submodule named '${MODULE_NAME}' found." + fi + shell: bash + + - name: Check if repository exists in organization + env: + MODULE_NAME: ${{ env.MODULE_NAME }} + run: | + if curl -s -o /dev/null -w "%{http_code}" "https://github.com/$ORG_NAME/$MODULE_NAME" | grep -q "200"; then + echo "❌ Repository '${MODULE_NAME}' exists in organization '${ORG_NAME}'. Failing the workflow." + exit 1 + else + echo "βœ… Repository '${MODULE_NAME}' does not exist in organization '${ORG_NAME}'." + fi + shell: bash diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml new file mode 100644 index 0000000..ec3c06b --- /dev/null +++ b/.github/workflows/i18nCheck.yml @@ -0,0 +1,17 @@ +on: + workflow_dispatch: + +# on: +# push: +# paths: ['**.R', '**.qml', '**.po', '**.yml'] +# +# pull_request: +# paths: ['**.R', '**.qml', '**.po', '**.yml'] +# +# workflow_dispatch: + +name: i18n-check + +jobs: + i18n-check: + uses: jasp-stats/jasp-actions/.github/workflows/i18nCheck.yml@master diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml new file mode 100644 index 0000000..0ac8822 --- /dev/null +++ b/.github/workflows/post-merge-new-repo.yml @@ -0,0 +1,153 @@ +name: Post-Merge Repository Creation and Revert Pull Request + +on: + workflow_dispatch: +# on: +# pull_request_target: +# types: +# - closed # Trigger when a pull request is closed (merged or not) + +permissions: {} + +jobs: + create_new_repository: + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + runs-on: ubuntu-24.04 + + outputs: # Define output variables. We need these to pass information between jobs + module_name: ${{ steps.extract_vars.outputs.module_name }} + env: + ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope + ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all branches and commit history + persist-credentials: false # Do not persist credentials to the git config + + - name: Extract Package Name from DESCRIPTION + id: extract_vars + run: | + # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') + PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') + if [ -z "$PACKAGE_NAME" ]; then + echo "Error: Package name not found in DESCRIPTION" >&2 + exit 1 + fi + # Prevent special characters in package name + if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then + echo "Error: PACKAGE_NAME contains invalid characters!" >&2 + exit 1 + fi + echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV + echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT + shell: bash + + - name: Create New Repository in Organization + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + echo "Creating repository $REPO_NAME..." + RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/orgs/${ORG_NAME}/repos \ + -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") + + if echo "$RESPONSE" | grep -q '"full_name"'; then + echo "Repository created successfully: $REPO_NAME" + echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV + else + echo "Failed to create repository: $RESPONSE" + exit 1 + fi + + - name: Push Merged Code to New Repository + run: | + REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" + git clone "https://github.com/${{ github.repository }}.git" temp_repo + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@users.noreply.github.com" + cd temp_repo + git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" + rm .github/workflows/check_module_on_pr.yml + rm .github/workflows/post-merge-new-repo.yml + git commit -am "Remove CI/CD workflows" + git push --mirror + + revert_main_branch: + if: always() # Always run this job, even if the previous job fails + permissions: + contents: write + actions: read + pull-requests: write + + runs-on: ubuntu-24.04 + needs: [create_new_repository] + env: + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + ORG_PAT: ${{ secrets.ORG_PAT }} + + steps: + - name: Checkout Repository + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git User + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + # Authenticate Git with Personal Access Token (PAT) + # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" + + - name: Revert Main Branch to Pre-Merge State + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + run: | + MERGE_COMMIT=$(git rev-parse HEAD) + git revert -m 1 $MERGE_COMMIT + git push origin main + + - name: Comment on Pull Request + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + uses: actions/github-script@v6 + # env: + # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} + with: + script: | + const module_name = process.env.MODULE_NAME; + const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; + github.rest.issues.createComment({ + issue_number: context.payload.pull_request.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment + }); + + add_submodule: + # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork + if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' + runs-on: ubuntu-24.04 + needs: [create_new_repository] + + env: + ORG_PAT: ${{ secrets.ORG_PAT }} + ORG_NAME: "jasp-escience" + MODULES_REPO: "github.com/jasp-escience/modules" + MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} + + steps: + - name: Add New Repository as a Submodule in jasp-escience/modules + run: | + git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo + cd modules_repo + + git config --global user.name "GitHub Actions" + git config --global user.email "actions@github.com" + + git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} + git add .gitmodules modules/${MODULE_NAME} + git commit -m "Added ${MODULE_NAME} as a submodule under modules/" + git push origin main diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000..0ae22e8 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,23 @@ +on: + workflow_dispatch: + +# on: +# schedule: +# - cron: '*/5 * * * *' +# workflow_dispatch: +# +name: generate-translations + +jobs: + generate-translations: + runs-on: ubuntu-latest + env: + REPO_KEY: ${{ secrets.REPOS_KEY }} + WEBLATE_KEY: ${{ secrets.WEBLATE_KEY }} + QML_REPO: jasptestmodule-qml + R_REPO: jasttestmodule-r + + steps: + - uses: jasp-stats/jasp-actions/wlcLock@master + + - uses: jasp-stats/jasp-actions/translations@master diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml new file mode 100644 index 0000000..45bb379 --- /dev/null +++ b/.github/workflows/unittests.yml @@ -0,0 +1,19 @@ +on: + workflow_dispatch: + +# on: +# push: +# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win', '**.yml'] +# pull_request: +# paths: ['**.R', 'tests/**', '**.Rd', '**.c', '**.cpp', '**.h', '**.hpp', 'DESCRIPTION', 'NAMESPACE', 'MAKEVARS', 'MAKEVARS.win'] +# schedule: +# - cron: '13 12 * * 1-5' + +name: unit-tests + +jobs: + unit-tests: + uses: jasp-stats/jasp-actions/.github/workflows/unittests.yml@master + with: + needs_JAGS: false + needs_igraph: false From edb2c327c0bf3c6a3f8caef02193fa25e01d7b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez-S=C3=A1nchez?= Date: Thu, 20 Mar 2025 13:02:35 +0100 Subject: [PATCH 137/157] Update R/examples.R Co-authored-by: Don van den Bergh --- R/examples.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/examples.R b/R/examples.R index 50c1adb..9e87581 100644 --- a/R/examples.R +++ b/R/examples.R @@ -22,8 +22,8 @@ ProcessTable <- function(jaspResults, dataset, options) { # Prints the inputs as a table stats <- createJaspTable(gettext("Some descriptives")) - stats$addColumnInfo(name = "times") - stats$addColumnInfo(name = "xs") + stats$addColumnInfo(name = gettext("times")) + stats$addColumnInfo(name = gettext("xs")) stats[["times"]] <- dataset[, options$ts] stats[["xs"]] <- dataset[, options$xs] From c90875e6aaa28079c43de21b856040de2174ad02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez-S=C3=A1nchez?= Date: Thu, 20 Mar 2025 13:02:59 +0100 Subject: [PATCH 138/157] Update R/examples.R Co-authored-by: Don van den Bergh --- R/examples.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/examples.R b/R/examples.R index 9e87581..cdc2e4d 100644 --- a/R/examples.R +++ b/R/examples.R @@ -42,7 +42,7 @@ Parabola <- function(jaspResults, dataset, options) { ggplot2::geom_function(fun = f) # Aesthetics - parabolaPlot <- createJaspPlot(title = "Parabola", + parabolaPlot <- createJaspPlot(title = gettext("Parabola"), width = 160, height = 320) parabolaPlot$dependOn(c("a")) # Refresh view whenever a changes From 5d8dbecddf17c555bd8c757ba2dc74587c5ba5a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez-S=C3=A1nchez?= Date: Thu, 20 Mar 2025 13:03:16 +0100 Subject: [PATCH 139/157] Update inst/Description.qml Co-authored-by: Don van den Bergh --- inst/Description.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/Description.qml b/inst/Description.qml index f38713c..5ba7f5f 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -23,8 +23,8 @@ Description Analysis { - title: "Add one" // Title for window - menu: "Add one" // Title for ribbon + title: qsTr("Add one") // Title for window + menu: qsTr("Add one") // Title for ribbon func: "AddOne" // Function to be called qml: "integer.qml" // Design input window } From 97d3834544d4332cff4545541659b4e3bdd78d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Thu, 20 Mar 2025 13:22:44 +0100 Subject: [PATCH 140/157] Revert "Remove line invoking Travis" This reverts commit eed5432fbb50e22b4a5d2012c90222b8f790b20b. --- tests/testthat.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat.R b/tests/testthat.R index 41651f7..a744b3c 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,2 +1,4 @@ library(jaspTools) library(testthat) + +jaspTools::runTestsTravis(module = getwd()) From 08ee90f5c7dc570e07503ca3672c2d5d643d5fa0 Mon Sep 17 00:00:00 2001 From: Reggie Cushing Date: Wed, 26 Mar 2025 11:18:18 +0100 Subject: [PATCH 141/157] revert workflows --- .github/workflows/check_module_on_pr.yml | 91 ------------- .github/workflows/i18nCheck.yml | 15 +-- .github/workflows/post-merge-new-repo.yml | 153 ---------------------- .github/workflows/translations.yml | 7 +- 4 files changed, 8 insertions(+), 258 deletions(-) delete mode 100644 .github/workflows/check_module_on_pr.yml delete mode 100644 .github/workflows/post-merge-new-repo.yml diff --git a/.github/workflows/check_module_on_pr.yml b/.github/workflows/check_module_on_pr.yml deleted file mode 100644 index 258e0c3..0000000 --- a/.github/workflows/check_module_on_pr.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Check pre-requisites for module creation - -on: - workflow_dispatch: - -# on: -# pull_request: -# types: [opened] - -permissions: {} - -jobs: - check-description-file: - if: github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-latest - env: - ORG_NAME: "jasp-escience" - - steps: - # Step 1: Check out the repository - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - persist-credentials: false - - # Step 2: Check if the DESCRIPTION file exists - - name: Verify DESCRIPTION file exists - run: | - if [ ! -f "DESCRIPTION" ]; then - echo "ERROR: DESCRIPTION file is missing." - exit 1 - else - echo "DESCRIPTION file exists." - fi - - - name: Check for package name in DESCRIPTION - run: | - # PACKAGE_NAME=$(cat DESCRIPTION | grep "^Package:" | awk '{print $2}') - PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - # Prevent special characters in package name - if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - exit 1 - fi - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - shell: bash - - - name: Check if `.github/` folder was modified using Git diff - run: | - CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}) - - echo "Changed files:" - echo "$CHANGED_FILES" - - if echo "$CHANGED_FILES" | grep -q "^\.github/"; then - echo "❌ The .github/ folder was been modified." - exit 1 - else - echo "βœ… The .github/ folder has NOT modified." - fi - - - name: Check if module already exists submodules - env: - MODULE_NAME: ${{ env.MODULE_NAME }} - run: | - git clone --depth=1 https://github.com/$ORG_NAME/modules.git target_repo - cd target_repo - if git config --file .gitmodules --get-regexp path | grep -q "^submodule.modules/${MODULE_NAME}.path"; then - echo "❌ Submodule '${MODULE_NAME}' found! Failing the workflow." - exit 1 - else - echo "βœ… No submodule named '${MODULE_NAME}' found." - fi - shell: bash - - - name: Check if repository exists in organization - env: - MODULE_NAME: ${{ env.MODULE_NAME }} - run: | - if curl -s -o /dev/null -w "%{http_code}" "https://github.com/$ORG_NAME/$MODULE_NAME" | grep -q "200"; then - echo "❌ Repository '${MODULE_NAME}' exists in organization '${ORG_NAME}'. Failing the workflow." - exit 1 - else - echo "βœ… Repository '${MODULE_NAME}' does not exist in organization '${ORG_NAME}'." - fi - shell: bash diff --git a/.github/workflows/i18nCheck.yml b/.github/workflows/i18nCheck.yml index ec3c06b..46c314e 100644 --- a/.github/workflows/i18nCheck.yml +++ b/.github/workflows/i18nCheck.yml @@ -1,14 +1,11 @@ on: - workflow_dispatch: + push: + paths: ["**.R", "**.qml", "**.po", "**.yml"] + + pull_request: + paths: ["**.R", "**.qml", "**.po", "**.yml"] -# on: -# push: -# paths: ['**.R', '**.qml', '**.po', '**.yml'] -# -# pull_request: -# paths: ['**.R', '**.qml', '**.po', '**.yml'] -# -# workflow_dispatch: + workflow_dispatch: name: i18n-check diff --git a/.github/workflows/post-merge-new-repo.yml b/.github/workflows/post-merge-new-repo.yml deleted file mode 100644 index 0ac8822..0000000 --- a/.github/workflows/post-merge-new-repo.yml +++ /dev/null @@ -1,153 +0,0 @@ -name: Post-Merge Repository Creation and Revert Pull Request - -on: - workflow_dispatch: -# on: -# pull_request_target: -# types: -# - closed # Trigger when a pull request is closed (merged or not) - -permissions: {} - -jobs: - create_new_repository: - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-24.04 - - outputs: # Define output variables. We need these to pass information between jobs - module_name: ${{ steps.extract_vars.outputs.module_name }} - env: - ORG_PAT: ${{ secrets.ORG_PAT }} # N.B. Check validity of Personal Access Token with org scope - ORG_NAME: "jasp-escience" # N.B. Replace with actual organization name - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Fetch all branches and commit history - persist-credentials: false # Do not persist credentials to the git config - - - name: Extract Package Name from DESCRIPTION - id: extract_vars - run: | - # PACKAGE_NAME=$(grep "^Package:" DESCRIPTION | awk '{print $2}') - PACKAGE_NAME=$(awk -F ': ' '/^Package:/ {print $2}' DESCRIPTION | tr -d '\r') - if [ -z "$PACKAGE_NAME" ]; then - echo "Error: Package name not found in DESCRIPTION" >&2 - exit 1 - fi - # Prevent special characters in package name - if [[ ! "$PACKAGE_NAME" =~ ^[a-zA-Z0-9_-]+$ ]]; then - echo "Error: PACKAGE_NAME contains invalid characters!" >&2 - exit 1 - fi - echo "MODULE_NAME=${PACKAGE_NAME}-module" >> $GITHUB_ENV - echo "module_name=${PACKAGE_NAME}-module" >> $GITHUB_OUTPUT - shell: bash - - - name: Create New Repository in Organization - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - echo "Creating repository $REPO_NAME..." - RESPONSE=$(curl -X POST -H "Authorization: Bearer $ORG_PAT" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/orgs/${ORG_NAME}/repos \ - -d "{\"name\":\"${{ env.MODULE_NAME}}\", \"private\": false}") - - if echo "$RESPONSE" | grep -q '"full_name"'; then - echo "Repository created successfully: $REPO_NAME" - echo "NEW_REPO_URL=https://github.com/$REPO_NAME" >> $GITHUB_ENV - else - echo "Failed to create repository: $RESPONSE" - exit 1 - fi - - - name: Push Merged Code to New Repository - run: | - REPO_NAME="${ORG_NAME}/${{ env.MODULE_NAME }}" - git clone "https://github.com/${{ github.repository }}.git" temp_repo - git config --global user.name "GitHub Actions" - git config --global user.email "github-actions@users.noreply.github.com" - cd temp_repo - git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${REPO_NAME}.git" - rm .github/workflows/check_module_on_pr.yml - rm .github/workflows/post-merge-new-repo.yml - git commit -am "Remove CI/CD workflows" - git push --mirror - - revert_main_branch: - if: always() # Always run this job, even if the previous job fails - permissions: - contents: write - actions: read - pull-requests: write - - runs-on: ubuntu-24.04 - needs: [create_new_repository] - env: - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - ORG_PAT: ${{ secrets.ORG_PAT }} - - steps: - - name: Checkout Repository - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Configure Git User - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - run: | - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - # Authenticate Git with Personal Access Token (PAT) - # git remote set-url origin "https://x-access-token:${ORG_PAT}@github.com/${{ github.repository }}.git" - - - name: Revert Main Branch to Pre-Merge State - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - run: | - MERGE_COMMIT=$(git rev-parse HEAD) - git revert -m 1 $MERGE_COMMIT - git push origin main - - - name: Comment on Pull Request - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - uses: actions/github-script@v6 - # env: - # GITHUB_TOKEN: ${{ secrets.ORG_PAT }} - with: - script: | - const module_name = process.env.MODULE_NAME; - const comment = `πŸŽ‰ The pull request was merged. A new repository [ **${module_name}** ](https://github.com/${{ github.repository_owner }}/${module_name}) has been created in the organization with the merged content. The main branch has been reverted.`; - github.rest.issues.createComment({ - issue_number: context.payload.pull_request.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); - - add_submodule: - # if: ${{ github.event.pull_request.head.repo.fork == true }} # Only run if the PR is from a fork - if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.fork == true && github.event.pull_request.head.repo.owner.login != 'jasp-escience' - runs-on: ubuntu-24.04 - needs: [create_new_repository] - - env: - ORG_PAT: ${{ secrets.ORG_PAT }} - ORG_NAME: "jasp-escience" - MODULES_REPO: "github.com/jasp-escience/modules" - MODULE_NAME: ${{ needs.create_new_repository.outputs.module_name }} - - steps: - - name: Add New Repository as a Submodule in jasp-escience/modules - run: | - git clone https://x-access-token:${ORG_PAT}@${MODULES_REPO}.git modules_repo - cd modules_repo - - git config --global user.name "GitHub Actions" - git config --global user.email "actions@github.com" - - git submodule add https://github.com/${ORG_NAME}/${MODULE_NAME}.git modules/${MODULE_NAME} - git add .gitmodules modules/${MODULE_NAME} - git commit -m "Added ${MODULE_NAME} as a submodule under modules/" - git push origin main diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 0ae22e8..fc71825 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -1,11 +1,8 @@ on: + schedule: + - cron: "*/5 * * * *" workflow_dispatch: -# on: -# schedule: -# - cron: '*/5 * * * *' -# workflow_dispatch: -# name: generate-translations jobs: From a4603c8a0ba29d7581f7ce8bdfd3b41416c66c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 26 Mar 2025 11:31:47 +0100 Subject: [PATCH 142/157] Apply proper dataset subsetting See https://github.com/jasp-stats/jaspModuleTemplate/pull/12\#discussion_r2003575807 --- R/examples.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/examples.R b/R/examples.R index cdc2e4d..fd3fec8 100644 --- a/R/examples.R +++ b/R/examples.R @@ -10,8 +10,8 @@ AddOne <- function(jaspResults, dataset, options) { ProcessData <- function(jaspResults, dataset, options) { # Dataset access # options$ts --maps to--> 't' - # dataset[, options$ts] --maps to--> dataset$t - result <- paste(dataset[, options$ts], collapse = "") + # dataset[[options$ts]] --maps to--> dataset$t + result <- paste(dataset[[options$ts]], collapse = "") jaspResults[["result"]] <- createJaspHtml(text = result, title = "This is your result:") @@ -25,8 +25,8 @@ ProcessTable <- function(jaspResults, dataset, options) { stats$addColumnInfo(name = gettext("times")) stats$addColumnInfo(name = gettext("xs")) - stats[["times"]] <- dataset[, options$ts] - stats[["xs"]] <- dataset[, options$xs] + stats[["times"]] <- dataset[[options$ts]] + stats[["xs"]] <- dataset[[options$xs]] jaspResults[["stats"]] <- stats From 2d9b56e0ea37eba75d68511ac211ec1a385fe247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez-S=C3=A1nchez?= Date: Wed, 26 Mar 2025 11:34:18 +0100 Subject: [PATCH 143/157] Apply suggestions to parabolaPlot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: FrantiΕ‘ek BartoΕ‘ <38475991+FBartos@users.noreply.github.com> --- R/examples.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/examples.R b/R/examples.R index fd3fec8..704aa00 100644 --- a/R/examples.R +++ b/R/examples.R @@ -40,13 +40,15 @@ Parabola <- function(jaspResults, dataset, options) { ggplot2::xlim(-3, 3) + ggplot2::ylim(0, 10) + ggplot2::geom_function(fun = f) - +# add jasp theme +p <- jaspGraphs::geom_rangeframe() + + jaspGraphs::themeJaspRaw() # Aesthetics parabolaPlot <- createJaspPlot(title = gettext("Parabola"), width = 160, height = 320) parabolaPlot$dependOn(c("a")) # Refresh view whenever a changes - +parabolaPlot$info <- gettext("This figure displays a parabola specified via the `a` option.") jaspResults[["parabolaPlot"]] <- parabolaPlot parabolaPlot$plotObject <- p From 78eb154b093100fcfc0d3f3c272e8fcbff3d97af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 26 Mar 2025 11:47:28 +0100 Subject: [PATCH 144/157] Use camelCase for functions --- NAMESPACE | 8 ++++---- R/examples.R | 8 ++++---- inst/Description.qml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 4c92578..b0dc707 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,5 @@ import(jaspBase) -export(AddOne) -export(ProcessData) -export(ProcessTable) -export(Parabola) \ No newline at end of file +export(addOne) +export(processData) +export(processTable) +export(parabola) \ No newline at end of file diff --git a/R/examples.R b/R/examples.R index 704aa00..4158b12 100644 --- a/R/examples.R +++ b/R/examples.R @@ -1,4 +1,4 @@ -AddOne <- function(jaspResults, dataset, options) { +addOne <- function(jaspResults, dataset, options) { result <- as.character(options$my_number + 1) # options$my_number comes from the menu created by inst/qml/integer.qml jaspResults[["result"]] <- createJaspHtml(text = result, @@ -7,7 +7,7 @@ AddOne <- function(jaspResults, dataset, options) { return() } -ProcessData <- function(jaspResults, dataset, options) { +processData <- function(jaspResults, dataset, options) { # Dataset access # options$ts --maps to--> 't' # dataset[[options$ts]] --maps to--> dataset$t @@ -18,7 +18,7 @@ ProcessData <- function(jaspResults, dataset, options) { return() } -ProcessTable <- function(jaspResults, dataset, options) { +processTable <- function(jaspResults, dataset, options) { # Prints the inputs as a table stats <- createJaspTable(gettext("Some descriptives")) @@ -33,7 +33,7 @@ ProcessTable <- function(jaspResults, dataset, options) { return() } -Parabola <- function(jaspResults, dataset, options) { +parabola <- function(jaspResults, dataset, options) { # Analysis f <- function(x) { options$a * x^2 } # Function to be plotted p <- ggplot2::ggplot() + # Plotting command diff --git a/inst/Description.qml b/inst/Description.qml index 5ba7f5f..a32ab87 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -25,7 +25,7 @@ Description { title: qsTr("Add one") // Title for window menu: qsTr("Add one") // Title for ribbon - func: "AddOne" // Function to be called + func: "addOne" // Function to be called qml: "integer.qml" // Design input window } @@ -33,7 +33,7 @@ Description { title: "Load data" menu: "Load data" - func: "ProcessData" + func: "processData" qml: "data.qml" } @@ -41,7 +41,7 @@ Description { title: "Tabular results" menu: "Tabular results" - func: "ProcessTable" + func: "processTable" qml: "table.qml" } @@ -53,7 +53,7 @@ Description Analysis { title: "Plot a parabola" - func: "Parabola" + func: "parabola" qml: "parabola.qml" } } From 3bb5b76fcdd6fbba3ec30b835a750e94c347c555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 26 Mar 2025 11:54:22 +0100 Subject: [PATCH 145/157] Add qsTr wrapper to all text, title and menu fields in the qml files --- inst/Description.qml | 10 +++++----- inst/qml/data.qml | 2 +- inst/qml/integer.qml | 2 +- inst/qml/parabola.qml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/inst/Description.qml b/inst/Description.qml index a32ab87..da6ca24 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -31,16 +31,16 @@ Description Analysis { - title: "Load data" - menu: "Load data" + title: qsTr("Load data") + menu: qsTr("Load data") func: "processData" qml: "data.qml" } Analysis { - title: "Tabular results" - menu: "Tabular results" + title: qsTr("Tabular results") + menu: qsTr("Tabular results") func: "processTable" qml: "table.qml" } @@ -52,7 +52,7 @@ Description Analysis { - title: "Plot a parabola" + title: qsTr("Plot a parabola") func: "parabola" qml: "parabola.qml" } diff --git a/inst/qml/data.qml b/inst/qml/data.qml index f6bfa7b..7193d20 100644 --- a/inst/qml/data.qml +++ b/inst/qml/data.qml @@ -26,7 +26,7 @@ Form Text { - text: "This example shows how to load a dataset and perform a simple operation on it" + text: qsTr("This example shows how to load a dataset and perform a simple operation on it") } VariablesForm diff --git a/inst/qml/integer.qml b/inst/qml/integer.qml index 696de88..584d3e9 100644 --- a/inst/qml/integer.qml +++ b/inst/qml/integer.qml @@ -26,7 +26,7 @@ Form Text { - text: "This example shows how to manually introduce an input and perform a simple operation on it" + text: qsTr("This example shows how to manually introduce an input and perform a simple operation on it") } IntegerField diff --git a/inst/qml/parabola.qml b/inst/qml/parabola.qml index d2703b8..742a949 100644 --- a/inst/qml/parabola.qml +++ b/inst/qml/parabola.qml @@ -26,7 +26,7 @@ Form Text { - text: "This example shows how to plot a curve" + text: qsTr("This example shows how to plot a curve") } IntegerField From 33bea851f43d0217a30ed611093fd8e7f0b3311c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 26 Mar 2025 13:14:35 +0100 Subject: [PATCH 146/157] Add documentation to inputs, and improve readability See https://github.com/jasp-stats/jaspModuleTemplate/pull/12#discussion_r2007061918 --- inst/qml/data.qml | 19 ++++++++++++++++--- inst/qml/table.qml | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/inst/qml/data.qml b/inst/qml/data.qml index 7193d20..6448e3e 100644 --- a/inst/qml/data.qml +++ b/inst/qml/data.qml @@ -32,9 +32,22 @@ Form VariablesForm { AvailableVariablesList { name: "allVariables" } - AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } + + AssignedVariablesList { + name: "ts" + label: qsTr("Times (t)") + info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the time.") + singleVariable: true + allowedColumns: ["scale"] + } + + AssignedVariablesList { + name: "xs" + label: qsTr("Positions (x)") + info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the positions.") + singleVariable: true + allowedColumns: ["scale"] + } } } diff --git a/inst/qml/table.qml b/inst/qml/table.qml index bc581d4..4a6def1 100644 --- a/inst/qml/table.qml +++ b/inst/qml/table.qml @@ -32,9 +32,22 @@ Form VariablesForm { AvailableVariablesList { name: "allVariables" } - AssignedVariablesList { name: "ts"; label: qsTr("Times (t)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "xs"; label: qsTr("Horizontal positions (x)"); singleVariable: true; allowedColumns: ["scale"] } - AssignedVariablesList { name: "ys"; label: qsTr("Vertical positions (y)"); singleVariable: true; allowedColumns: ["scale"] } + + AssignedVariablesList { + name: "ts" + label: qsTr("Times (t)") + info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the time.") + singleVariable: true + allowedColumns: ["scale"] + } + + AssignedVariablesList { + name: "xs" + label: qsTr("Positions (x)") + info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the positions.") + singleVariable: true + allowedColumns: ["scale"] + } } } From 1837b43327c320ded99c90d9fb5e3f93ab169e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 26 Mar 2025 13:19:37 +0100 Subject: [PATCH 147/157] Capitalize first letter of all qml files See https://github.com/jasp-stats/jaspModuleTemplate/pull/12\#issuecomment-2736932619 --- inst/Description.qml | 8 ++++---- inst/qml/{data.qml => Data.qml} | 0 inst/qml/{integer.qml => Integer.qml} | 0 inst/qml/{parabola.qml => Parabola.qml} | 0 inst/qml/{table.qml => Table.qml} | 0 5 files changed, 4 insertions(+), 4 deletions(-) rename inst/qml/{data.qml => Data.qml} (100%) rename inst/qml/{integer.qml => Integer.qml} (100%) rename inst/qml/{parabola.qml => Parabola.qml} (100%) rename inst/qml/{table.qml => Table.qml} (100%) diff --git a/inst/Description.qml b/inst/Description.qml index da6ca24..6b89a6b 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -26,7 +26,7 @@ Description title: qsTr("Add one") // Title for window menu: qsTr("Add one") // Title for ribbon func: "addOne" // Function to be called - qml: "integer.qml" // Design input window + qml: "Integer.qml" // Design input window } Analysis @@ -34,7 +34,7 @@ Description title: qsTr("Load data") menu: qsTr("Load data") func: "processData" - qml: "data.qml" + qml: "Data.qml" } Analysis @@ -42,7 +42,7 @@ Description title: qsTr("Tabular results") menu: qsTr("Tabular results") func: "processTable" - qml: "table.qml" + qml: "Table.qml" } GroupTitle @@ -54,6 +54,6 @@ Description { title: qsTr("Plot a parabola") func: "parabola" - qml: "parabola.qml" + qml: "Parabola.qml" } } diff --git a/inst/qml/data.qml b/inst/qml/Data.qml similarity index 100% rename from inst/qml/data.qml rename to inst/qml/Data.qml diff --git a/inst/qml/integer.qml b/inst/qml/Integer.qml similarity index 100% rename from inst/qml/integer.qml rename to inst/qml/Integer.qml diff --git a/inst/qml/parabola.qml b/inst/qml/Parabola.qml similarity index 100% rename from inst/qml/parabola.qml rename to inst/qml/Parabola.qml diff --git a/inst/qml/table.qml b/inst/qml/Table.qml similarity index 100% rename from inst/qml/table.qml rename to inst/qml/Table.qml From bfb36a0362d127fff9d9866ddcedcf0c571259a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Thu, 27 Mar 2025 15:16:07 +0100 Subject: [PATCH 148/157] Remove (temporarily) translations.yml At least until we figure out why it is failing and email bombing everybody. Sorry for that --- .github/workflows/translations.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml deleted file mode 100644 index fc71825..0000000 --- a/.github/workflows/translations.yml +++ /dev/null @@ -1,20 +0,0 @@ -on: - schedule: - - cron: "*/5 * * * *" - workflow_dispatch: - -name: generate-translations - -jobs: - generate-translations: - runs-on: ubuntu-latest - env: - REPO_KEY: ${{ secrets.REPOS_KEY }} - WEBLATE_KEY: ${{ secrets.WEBLATE_KEY }} - QML_REPO: jasptestmodule-qml - R_REPO: jasttestmodule-r - - steps: - - uses: jasp-stats/jasp-actions/wlcLock@master - - - uses: jasp-stats/jasp-actions/translations@master From 55d31519f17661a39c4ce635abeefadf9c2833dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 10:33:29 +0200 Subject: [PATCH 149/157] Revert "Remove (temporarily) translations.yml" This reverts commit bfb36a0362d127fff9d9866ddcedcf0c571259a0. --- .github/workflows/translations.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000..fc71825 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,20 @@ +on: + schedule: + - cron: "*/5 * * * *" + workflow_dispatch: + +name: generate-translations + +jobs: + generate-translations: + runs-on: ubuntu-latest + env: + REPO_KEY: ${{ secrets.REPOS_KEY }} + WEBLATE_KEY: ${{ secrets.WEBLATE_KEY }} + QML_REPO: jasptestmodule-qml + R_REPO: jasttestmodule-r + + steps: + - uses: jasp-stats/jasp-actions/wlcLock@master + + - uses: jasp-stats/jasp-actions/translations@master From 9e771f6c7ffac3b732409f5313fcfb0d2f4a20e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 10:34:27 +0200 Subject: [PATCH 150/157] Recover and deactivate translations.yml As suggested by Bruno --- .github/workflows/translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index fc71825..e07ae44 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -1,6 +1,6 @@ on: schedule: - - cron: "*/5 * * * *" + # - cron: "*/5 * * * *" workflow_dispatch: name: generate-translations From b84a2ab262ccc03068f365a37b4aac424ceecaed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:01:05 +0200 Subject: [PATCH 151/157] Add info fields to all forms Suggested by Bruno --- inst/qml/Data.qml | 2 ++ inst/qml/Integer.qml | 5 +++++ inst/qml/Parabola.qml | 3 +++ inst/qml/Table.qml | 1 + 4 files changed, 11 insertions(+) diff --git a/inst/qml/Data.qml b/inst/qml/Data.qml index 6448e3e..54be528 100644 --- a/inst/qml/Data.qml +++ b/inst/qml/Data.qml @@ -24,6 +24,8 @@ import JASP 1.0 Form { + info: qsTr("This example shows how to load a dataset and perform a simple operation on it") // Used for populating the info tab + Text { text: qsTr("This example shows how to load a dataset and perform a simple operation on it") diff --git a/inst/qml/Integer.qml b/inst/qml/Integer.qml index 584d3e9..0efcdfd 100644 --- a/inst/qml/Integer.qml +++ b/inst/qml/Integer.qml @@ -24,6 +24,9 @@ import JASP 1.0 Form { + info: qsTr("This analysis just adds one to the input. \ + It's purpose is to show an easy example of manual input.") // Used for populating the info tab + Text { text: qsTr("This example shows how to manually introduce an input and perform a simple operation on it") @@ -31,6 +34,8 @@ Form IntegerField { + info: qsTr("This is the number that will be used in the operation") + name: "my_number" // This will map to options$my_number in R label: qsTr("Type a number") // qsTr allows for future translations diff --git a/inst/qml/Parabola.qml b/inst/qml/Parabola.qml index 742a949..61bdfa8 100644 --- a/inst/qml/Parabola.qml +++ b/inst/qml/Parabola.qml @@ -23,6 +23,7 @@ import JASP 1.0 Form { + info: qsTr("This example shows how to plot a curve.") Text { @@ -31,6 +32,8 @@ Form IntegerField { + info: qsTr("The shape of the parabola is dynamically determined by this number") + name: "a" // This will map to options$a in R label: qsTr("Type a number") // qsTr allows for future translations diff --git a/inst/qml/Table.qml b/inst/qml/Table.qml index 4a6def1..6764c38 100644 --- a/inst/qml/Table.qml +++ b/inst/qml/Table.qml @@ -23,6 +23,7 @@ import JASP 1.0 Form { + info: qsTr("This example shows how to load a dataset and output it as a table") Text { From 07fb95c2de209040543f38935f62935763d9e368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:03:31 +0200 Subject: [PATCH 152/157] Properly deactivate translation GitHub action --- .github/workflows/translations.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index e07ae44..43f9929 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -1,7 +1,7 @@ -on: - schedule: - # - cron: "*/5 * * * *" - workflow_dispatch: +# on: +# #schedule: +# # - cron: "*/5 * * * *" +# workflow_dispatch: name: generate-translations From 3e95e55d4793585840894ece17706bc2168998f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:09:22 +0200 Subject: [PATCH 153/157] Properly deactivate translations GitHub action --- .github/workflows/translations.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index 43f9929..5119c36 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -1,7 +1,7 @@ -# on: -# #schedule: -# # - cron: "*/5 * * * *" -# workflow_dispatch: + on: + workflow_dispatch: +# schedule: +# - cron: "*/5 * * * *" name: generate-translations From 82feb35d31f0c2e43b4cfaeb1377773a6abdac12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:11:13 +0200 Subject: [PATCH 154/157] Remove (temporarily) translations.yml Suggested by Bruno --- .github/workflows/translations.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/translations.yml diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml deleted file mode 100644 index 5119c36..0000000 --- a/.github/workflows/translations.yml +++ /dev/null @@ -1,20 +0,0 @@ - on: - workflow_dispatch: -# schedule: -# - cron: "*/5 * * * *" - -name: generate-translations - -jobs: - generate-translations: - runs-on: ubuntu-latest - env: - REPO_KEY: ${{ secrets.REPOS_KEY }} - WEBLATE_KEY: ${{ secrets.WEBLATE_KEY }} - QML_REPO: jasptestmodule-qml - R_REPO: jasttestmodule-r - - steps: - - uses: jasp-stats/jasp-actions/wlcLock@master - - - uses: jasp-stats/jasp-actions/translations@master From 6fb74b94693bd0202436bd783e0cbc0f98bb4aad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:27:04 +0200 Subject: [PATCH 155/157] Be explicit about requiresData --- inst/Description.qml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/inst/Description.qml b/inst/Description.qml index 6b89a6b..48e7751 100644 --- a/inst/Description.qml +++ b/inst/Description.qml @@ -23,10 +23,11 @@ Description Analysis { - title: qsTr("Add one") // Title for window - menu: qsTr("Add one") // Title for ribbon - func: "addOne" // Function to be called - qml: "Integer.qml" // Design input window + title: qsTr("Add one") // Title for window + menu: qsTr("Add one") // Title for ribbon + func: "addOne" // Function to be called + qml: "Integer.qml" // Design input window + requiresData: false // Allow to run even without data } Analysis @@ -47,7 +48,7 @@ Description GroupTitle { - title: qsTr("Plotting") + title: qsTr("Plotting") } Analysis @@ -55,5 +56,6 @@ Description title: qsTr("Plot a parabola") func: "parabola" qml: "Parabola.qml" + requiresData: false } } From 76f749b9004679ecbff9ddb94e4f7bb25f4a8b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:39:15 +0200 Subject: [PATCH 156/157] Simplify Data.qml --- inst/qml/Data.qml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/inst/qml/Data.qml b/inst/qml/Data.qml index 54be528..6b79a25 100644 --- a/inst/qml/Data.qml +++ b/inst/qml/Data.qml @@ -24,11 +24,13 @@ import JASP 1.0 Form { - info: qsTr("This example shows how to load a dataset and perform a simple operation on it") // Used for populating the info tab + info: qsTr("This example shows how to load a dataset and perform a simple operation on it. \ + Specifically, it concatenates the values of a column. \n + e.g.: [1, 2, 3] -> '123'") // Used for populating the info tab Text { - text: qsTr("This example shows how to load a dataset and perform a simple operation on it") + text: qsTr("This example shows how to load a dataset and perform a simple operation on it.") } VariablesForm @@ -38,15 +40,7 @@ Form AssignedVariablesList { name: "ts" label: qsTr("Times (t)") - info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the time.") - singleVariable: true - allowedColumns: ["scale"] - } - - AssignedVariablesList { - name: "xs" - label: qsTr("Positions (x)") - info: qsTr("This info entry adds documentation to the (i) icon in the analysis file. E.g., Specify variable containing the positions.") + info: qsTr("Vector representing times") singleVariable: true allowedColumns: ["scale"] } From 721c6fd52d85c3138e4aa3639d3019777bd14d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Rodr=C3=ADguez=20S=C3=A1nchez?= Date: Wed, 2 Apr 2025 11:47:43 +0200 Subject: [PATCH 157/157] Edit README --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1454047..f2306a2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,22 @@ # jaspModuleTemplate -This template repository is a starting point for developing a new module for JASP. It contains the necessary files and structure to get you started. +This template repository is a starting point for developing a new module for JASP. +It contains the necessary files and structure, plus a numbers of examples to get started. -## Forking this repository +## How to use this repository -Fork this template repository to your own GitHub account to start developing your module. You can then clone the repository to your local machine and start developing your module. +Fork this template repository to your own GitHub account to start developing your module. +You can then clone the repository to your local machine and start developing your module. + +The repository contains example functionality. +Feel free to reuse and adapt the examples to your needs. +Feel also free to remove the ones you don't need. ## Contributing back new module to JASP -Once you have developed your module, you can contribute it back to JASP by creating a pull request. The JASP team will review your module and provide feedback. Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository. +Once you have developed your module, you can contribute it back to JASP by creating a pull request. +The JASP team will review your module and provide feedback. +Once your module is accepted, a new repo is created in the JASP organization and your module is added to the JASP module repository. + +## Reference +[Adding your own modules to JASP](https://github.com/jasp-stats/jasp-desktop/blob/development/Docs/development/jasp-adding-module.md) \ No newline at end of file