Skip to content

Commit

Permalink
Merge pull request #145 from p2m2/develop
Browse files Browse the repository at this point in the history
0.3.0-alpha.6
  • Loading branch information
ofilangi authored Sep 28, 2021
2 parents f78a786 + 05ecff1 commit a7cb7f4
Show file tree
Hide file tree
Showing 380 changed files with 169,265 additions and 166,638 deletions.
22 changes: 12 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
version: 2.1
orbs:
node: circleci/node@4.2.0
node: circleci/node@4.7.0
workflows:
compile-workflow:
jobs:
Expand Down Expand Up @@ -189,8 +189,7 @@ jobs:
- run:
name: Test JVM env and Coverage
command: |
cat /dev/null | sbt clean coverage discoveryJVM/test:test
sbt discoveryJVM/coverageReport
cat /dev/null | sbt clean coverage discoveryJVM/Test/test discoveryJVM/coverageReport
bash <(curl -s https://codecov.io/bash)
bash <(curl -Ls https://coverage.codacy.com/get.sh) report
Expand All @@ -206,14 +205,17 @@ jobs:
- checkout
- setup_remote_docker
- node/install
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Test JS
name: Test ScalaJs/JavaScript
command: sbt discoveryJS/test
- run:
name: Test TypeScript
command: |
sbt "discoveryJS / Compile / fastOptJS / webpack"
sbt npmPackageJson
npm i
npm test
#- run:
# name: Set Npm token
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
Expand Down Expand Up @@ -279,7 +281,7 @@ jobs:
publish_npm:
docker:
- image: circleci/node:12.20
- image: cimg/node:16.7.0
auth:
username: ${DOCKER_USER}
password: ${DOCKER_PASS}
Expand Down
35 changes: 11 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
# Discovery

[![p2m2](https://circleci.com/gh/p2m2/Discovery.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
[![codecov](https://codecov.io/gh/p2m2/Discovery/branch/develop/graph/badge.svg)](https://codecov.io/gh/p2m2/Discovery)
[![p2m2](https://circleci.com/gh/p2m2/discovery.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
[![codecov](https://codecov.io/gh/p2m2/discovery/branch/develop/graph/badge.svg)](https://codecov.io/gh/p2m2/discovery)
[![CodeFactor](https://www.codefactor.io/repository/github/p2m2/discovery/badge)](https://www.codefactor.io/repository/github/p2m2/discovery)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/8d8ecb66f9ff4963a22efab3c693b629)](https://www.codacy.com/gh/p2m2/Discovery/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=p2m2/Discovery&amp;utm_campaign=Badge_Grade)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/8d8ecb66f9ff4963a22efab3c693b629)](https://www.codacy.com/gh/p2m2/discovery/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=p2m2/discovery&amp;utm_campaign=Badge_Grade)


- easy sparql query construct using a simple editor and a web browser
- Use a simple editor with a web browser to request any RDF resource
- display rich information on the web page or console
- offers building blocks to facilitate queries
- offers building blocks system with atomic element to ease query construction

## SBT confi

```
libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.1.0",
```
further information and documentation, visit https://p2m2.github.io/discovery/

### Html/Js example

Expand Down Expand Up @@ -80,21 +75,13 @@ libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.1.0",
</script>
```

[js fiddle example](https://jsfiddle.net/uoecqath/5/)

[js fiddle example](https://jsfiddle.net/ofilangi/h6fbg845/)

#### Node import

##### dependencies
## Import discovery with SBT

### html examples

[discovery-tutorial-html-js](https://github.com/p2m2/discovery-tutorial-html-js)

### NodeJs examples

[discovery-tutorial-nodejs](https://github.com/p2m2/discovery-tutorial-nodejs)
```
libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.2.0"
```

### Scala examples

full example with [table view implementation](https://github.com/p2m2/discovery-table-view) using [scalatags](https://github.com/lihaoyi/scalatags)
84 changes: 53 additions & 31 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,35 @@ import sbt.Keys.scalacOptions
import sbtcrossproject.CrossPlugin.autoImport.crossProject

/* scala libs */
lazy val utestVersion = "0.7.7"
lazy val upickleVersion = "1.2.2"
lazy val airframeLogVersion = "20.11.0"
lazy val scalaParserCombinatorVersion = "1.1.2"
lazy val RosHttpVersion = "3.0.0"
lazy val utestVersion = "0.7.10"
lazy val upickleVersion = "1.4.0"
lazy val airframeLogVersion = "21.6.0"
lazy val scalaJsDOMVersion = "1.1.0"
lazy val scalaStubVersion = "1.0.0"
lazy val scalatagVersion = "0.9.2"
lazy val rdf4jVersion = "3.6.0-M2"
lazy val slf4j_version = "1.7.9"
lazy val scalatagVersion = "0.9.4"
lazy val rdf4jVersion = "3.7.2"
lazy val slf4j_version = "1.7.31"

/* p2m2 libs */
lazy val comunica_actor_init_sparql_rdfjs_version = "1.0.0"
lazy val comunica_actor_init_sparql_rdfjs_version = "1.21.1"
lazy val data_model_rdfjs_version = "1.0.0"
lazy val n3js_facade_version = "1.0.1"
lazy val rdfxml_streaming_parser_version = "1.0.0"
lazy val n3js_facade_version = "1.11.1"
lazy val rdfxml_streaming_parser_version = "1.5.0"

/* npm libs */
lazy val npm_axios_version = "0.21.1"
lazy val npm_qs_version = "6.9.6"
lazy val npm_qs_version = "6.10.1"
lazy val npm_showdown_version = "1.9.1"
lazy val npm_comunica_version = "1.19.2"
lazy val npm_comunica_version_datasource = "1.21.1"

lazy val types_jest = "27.0.1"
lazy val jest = "27.0.6"
lazy val tsjest = "27.0.5"

releaseIgnoreUntrackedFiles := true

val version_build = scala.util.Properties.envOrElse("DISCOVERY_VERSION", "local-SNAPSHOT" )
val static_version_build = "0.3.0-alpha.6"
val version_build = scala.util.Properties.envOrElse("DISCOVERY_VERSION", static_version_build )
val SWDiscoveryVersionAtBuildTimeFile = "./shared/src/main/scala/inrae/semantic_web/SWDiscoveryVersionAtBuildTime.scala"


Expand All @@ -51,11 +54,11 @@ ThisBuild / organization := "com.github.p2m2"
ThisBuild / organizationName := "p2m2"
ThisBuild / organizationHomepage := Some(url("https://www6.inrae.fr/p2m2"))
ThisBuild / licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/mit-license.php"))
ThisBuild / homepage := Some(url("https://github.com/p2m2/Discovery"))
ThisBuild / description := "Ease Sparql request on the network MetaboHUB/Semantics Databases."
ThisBuild / homepage := Some(url("https://github.com/p2m2/discovery"))
ThisBuild / description := "Ease Sparql request to reach semantic database."
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/p2m2/Discovery"),
url("https://github.com/p2m2/discovery"),
"scm:[email protected]:p2m2/Discovery.git"
)
)
Expand Down Expand Up @@ -101,21 +104,20 @@ lazy val root = (project in file("."))

lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
.settings(
resolvers += Resolver.bintrayRepo("hmil", "maven"),
libraryDependencies ++= Seq(
"com.softwaremill.sttp.client3" %% "core" % "3.3.4" % Test,
"com.lihaoyi" %%% "utest" % utestVersion % Test,
"fr.hmil" %%% "roshttp" % RosHttpVersion % Test ,
"com.lihaoyi" %%% "upickle" % upickleVersion,
"org.wvlet.airframe" %%% "airframe-log" % airframeLogVersion,
"org.scala-lang.modules" %%% "scala-parser-combinators" % scalaParserCombinatorVersion
"io.lemonlabs" %%% "scala-uri" % "3.5.0"
),
testFrameworks += new TestFramework("utest.runner.Framework"),
scalacOptions ++= Seq("-deprecation", "-feature"),
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.AllLibraryJars,
coverageMinimum := 70,
coverageMinimumStmtTotal := 70,
coverageFailOnMinimum := false,
coverageHighlighting := true,
parallelExecution in Test := false
Test / parallelExecution := false
)
.jsConfigure(_.enablePlugins(ScalaJSBundlerPlugin))
.jsSettings(
Expand All @@ -126,19 +128,20 @@ lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
"com.github.p2m2" %%% "rdfxml-streaming-parser" % rdfxml_streaming_parser_version,
),
webpackBundlingMode := BundlingMode.LibraryAndApplication(),
npmDependencies in Compile ++= Seq(
Compile / npmDependencies ++= Seq(
"axios" -> npm_axios_version,
"qs" -> npm_qs_version,
"showdown" -> npm_showdown_version,
"@comunica/utils-datasource" -> npm_comunica_version
"@comunica/utils-datasource" -> npm_comunica_version_datasource,
"@types/sax" -> "1.2.1"
),

scalaJSLinkerConfig in (Compile, fastOptJS ) ~= {
Compile / fastOptJS / scalaJSLinkerConfig ~= {
_.withOptimizer(false)
.withPrettyPrint(true)
.withSourceMap(true)
},
scalaJSLinkerConfig in (Compile, fullOptJS) ~= {
Compile / fullOptJS / scalaJSLinkerConfig ~= {
_.withSourceMap(false)
.withModuleKind(ModuleKind.CommonJSModule)
},
Expand All @@ -151,6 +154,7 @@ lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
"org.scala-js" %% "scalajs-stubs" % scalaStubVersion % "provided",
"org.slf4j" % "slf4j-api" % slf4j_version,
"org.slf4j" % "slf4j-simple" % slf4j_version,
"org.eclipse.rdf4j" % "rdf4j-sail" % rdf4jVersion,
"org.eclipse.rdf4j" % "rdf4j-storage" % rdf4jVersion,
"org.eclipse.rdf4j" % "rdf4j-tools-federation" % rdf4jVersion
))
Expand Down Expand Up @@ -178,8 +182,7 @@ npmPackageJson := {
case (x,idx) if ( (idx > indexStartDependencies) && (idx < indexEndDependencies) ) => x
}


val file = reflect.io.File("./package.json").writeAll(
reflect.io.File("./package.json").writeAll(
Predef.augmentString(
s"""{
"name": "@${(ThisBuild / organizationName).value}/${(ThisBuild / name).value}",
Expand All @@ -189,12 +192,31 @@ s"""{
"files": [
"js/target/scala-2.13/scalajs-bundler/main/discovery-opt.js"
],
"scripts": {
"test": "jest --detectOpenHandles"
},
"devDependencies": {
"@types/jest": "^$types_jest ",
"jest": "^$jest ",
"ts-jest": "^$tsjest"
},
"jest": {
"transform": {
".(ts|tsx)": "ts-jest"
},
"testRegex": "(ts/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
]
},
"dependencies": {
${dependencies.mkString("\n")}
},
"repository": {
"type": "git",
"url": "git+https://github.com/p2m2/Discovery.git"
"url": "git+https://github.com/p2m2/discovery.git"
},
"keywords": [
"sparql",
Expand All @@ -204,9 +226,9 @@ ${dependencies.mkString("\n")}
"author": "Olivier Filangi",
"license": "MIT",
"bugs": {
"url": "https://github.com/p2m2/Discovery/issues"
"url": "https://github.com/p2m2/discovery/issues"
},
"homepage": "https://github.com/p2m2/Discovery#README.md"
"homepage": "https://p2m2.github.io/discovery/"
}
""").stripMargin)
}
Expand Down
Loading

0 comments on commit a7cb7f4

Please sign in to comment.