Skip to content

Commit a7cb7f4

Browse files
authored
Merge pull request #145 from p2m2/develop
0.3.0-alpha.6
2 parents f78a786 + 05ecff1 commit a7cb7f4

File tree

380 files changed

+169265
-166638
lines changed

Some content is hidden

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

380 files changed

+169265
-166638
lines changed

.circleci/config.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
version: 2.1
1919
orbs:
20-
node: circleci/node@4.2.0
20+
node: circleci/node@4.7.0
2121
workflows:
2222
compile-workflow:
2323
jobs:
@@ -189,8 +189,7 @@ jobs:
189189
- run:
190190
name: Test JVM env and Coverage
191191
command: |
192-
cat /dev/null | sbt clean coverage discoveryJVM/test:test
193-
sbt discoveryJVM/coverageReport
192+
cat /dev/null | sbt clean coverage discoveryJVM/Test/test discoveryJVM/coverageReport
194193
bash <(curl -s https://codecov.io/bash)
195194
bash <(curl -Ls https://coverage.codacy.com/get.sh) report
196195
@@ -206,14 +205,17 @@ jobs:
206205
- checkout
207206
- setup_remote_docker
208207
- node/install
209-
- restore_cache:
210-
keys:
211-
- v1-dependencies-{{ checksum "build.sbt" }}
212-
# fallback to using the latest cache if no exact match is found
213-
- v1-dependencies-
214208
- run:
215-
name: Test JS
209+
name: Test ScalaJs/JavaScript
216210
command: sbt discoveryJS/test
211+
- run:
212+
name: Test TypeScript
213+
command: |
214+
sbt "discoveryJS / Compile / fastOptJS / webpack"
215+
sbt npmPackageJson
216+
npm i
217+
npm test
218+
217219
#- run:
218220
# name: Set Npm token
219221
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
@@ -279,7 +281,7 @@ jobs:
279281
280282
publish_npm:
281283
docker:
282-
- image: circleci/node:12.20
284+
- image: cimg/node:16.7.0
283285
auth:
284286
username: ${DOCKER_USER}
285287
password: ${DOCKER_PASS}

README.md

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
# Discovery
22

3-
[![p2m2](https://circleci.com/gh/p2m2/Discovery.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
4-
[![codecov](https://codecov.io/gh/p2m2/Discovery/branch/develop/graph/badge.svg)](https://codecov.io/gh/p2m2/Discovery)
3+
[![p2m2](https://circleci.com/gh/p2m2/discovery.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
4+
[![codecov](https://codecov.io/gh/p2m2/discovery/branch/develop/graph/badge.svg)](https://codecov.io/gh/p2m2/discovery)
55
[![CodeFactor](https://www.codefactor.io/repository/github/p2m2/discovery/badge)](https://www.codefactor.io/repository/github/p2m2/discovery)
6-
[![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)
6+
[![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)
77

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

13-
## SBT confi
14-
15-
```
16-
libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.1.0",
17-
```
12+
further information and documentation, visit https://p2m2.github.io/discovery/
1813

1914
### Html/Js example
2015

@@ -80,21 +75,13 @@ libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.1.0",
8075
</script>
8176
```
8277

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

84-
[js fiddle example](https://jsfiddle.net/ofilangi/h6fbg845/)
85-
86-
#### Node import
8780

88-
##### dependencies
81+
## Import discovery with SBT
8982

90-
### html examples
91-
92-
[discovery-tutorial-html-js](https://github.com/p2m2/discovery-tutorial-html-js)
93-
94-
### NodeJs examples
95-
96-
[discovery-tutorial-nodejs](https://github.com/p2m2/discovery-tutorial-nodejs)
83+
```
84+
libraryDependencies += "com.github.p2m2" %%% "discovery" % "0.2.0"
85+
```
9786

98-
### Scala examples
9987

100-
full example with [table view implementation](https://github.com/p2m2/discovery-table-view) using [scalatags](https://github.com/lihaoyi/scalatags)

build.sbt

Lines changed: 53 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,35 @@ import sbt.Keys.scalacOptions
22
import sbtcrossproject.CrossPlugin.autoImport.crossProject
33

44
/* scala libs */
5-
lazy val utestVersion = "0.7.7"
6-
lazy val upickleVersion = "1.2.2"
7-
lazy val airframeLogVersion = "20.11.0"
8-
lazy val scalaParserCombinatorVersion = "1.1.2"
9-
lazy val RosHttpVersion = "3.0.0"
5+
lazy val utestVersion = "0.7.10"
6+
lazy val upickleVersion = "1.4.0"
7+
lazy val airframeLogVersion = "21.6.0"
108
lazy val scalaJsDOMVersion = "1.1.0"
119
lazy val scalaStubVersion = "1.0.0"
12-
lazy val scalatagVersion = "0.9.2"
13-
lazy val rdf4jVersion = "3.6.0-M2"
14-
lazy val slf4j_version = "1.7.9"
10+
lazy val scalatagVersion = "0.9.4"
11+
lazy val rdf4jVersion = "3.7.2"
12+
lazy val slf4j_version = "1.7.31"
1513

1614
/* p2m2 libs */
17-
lazy val comunica_actor_init_sparql_rdfjs_version = "1.0.0"
15+
lazy val comunica_actor_init_sparql_rdfjs_version = "1.21.1"
1816
lazy val data_model_rdfjs_version = "1.0.0"
19-
lazy val n3js_facade_version = "1.0.1"
20-
lazy val rdfxml_streaming_parser_version = "1.0.0"
17+
lazy val n3js_facade_version = "1.11.1"
18+
lazy val rdfxml_streaming_parser_version = "1.5.0"
2119

2220
/* npm libs */
2321
lazy val npm_axios_version = "0.21.1"
24-
lazy val npm_qs_version = "6.9.6"
22+
lazy val npm_qs_version = "6.10.1"
2523
lazy val npm_showdown_version = "1.9.1"
26-
lazy val npm_comunica_version = "1.19.2"
24+
lazy val npm_comunica_version_datasource = "1.21.1"
25+
26+
lazy val types_jest = "27.0.1"
27+
lazy val jest = "27.0.6"
28+
lazy val tsjest = "27.0.5"
2729

2830
releaseIgnoreUntrackedFiles := true
2931

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

3336

@@ -51,11 +54,11 @@ ThisBuild / organization := "com.github.p2m2"
5154
ThisBuild / organizationName := "p2m2"
5255
ThisBuild / organizationHomepage := Some(url("https://www6.inrae.fr/p2m2"))
5356
ThisBuild / licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/mit-license.php"))
54-
ThisBuild / homepage := Some(url("https://github.com/p2m2/Discovery"))
55-
ThisBuild / description := "Ease Sparql request on the network MetaboHUB/Semantics Databases."
57+
ThisBuild / homepage := Some(url("https://github.com/p2m2/discovery"))
58+
ThisBuild / description := "Ease Sparql request to reach semantic database."
5659
ThisBuild / scmInfo := Some(
5760
ScmInfo(
58-
url("https://github.com/p2m2/Discovery"),
61+
url("https://github.com/p2m2/discovery"),
5962
"scm:git@github.com:p2m2/Discovery.git"
6063
)
6164
)
@@ -101,21 +104,20 @@ lazy val root = (project in file("."))
101104

102105
lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
103106
.settings(
104-
resolvers += Resolver.bintrayRepo("hmil", "maven"),
105107
libraryDependencies ++= Seq(
108+
"com.softwaremill.sttp.client3" %% "core" % "3.3.4" % Test,
106109
"com.lihaoyi" %%% "utest" % utestVersion % Test,
107-
"fr.hmil" %%% "roshttp" % RosHttpVersion % Test ,
108110
"com.lihaoyi" %%% "upickle" % upickleVersion,
109111
"org.wvlet.airframe" %%% "airframe-log" % airframeLogVersion,
110-
"org.scala-lang.modules" %%% "scala-parser-combinators" % scalaParserCombinatorVersion
112+
"io.lemonlabs" %%% "scala-uri" % "3.5.0"
111113
),
112114
testFrameworks += new TestFramework("utest.runner.Framework"),
113115
scalacOptions ++= Seq("-deprecation", "-feature"),
114116
classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.AllLibraryJars,
115-
coverageMinimum := 70,
117+
coverageMinimumStmtTotal := 70,
116118
coverageFailOnMinimum := false,
117119
coverageHighlighting := true,
118-
parallelExecution in Test := false
120+
Test / parallelExecution := false
119121
)
120122
.jsConfigure(_.enablePlugins(ScalaJSBundlerPlugin))
121123
.jsSettings(
@@ -126,19 +128,20 @@ lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
126128
"com.github.p2m2" %%% "rdfxml-streaming-parser" % rdfxml_streaming_parser_version,
127129
),
128130
webpackBundlingMode := BundlingMode.LibraryAndApplication(),
129-
npmDependencies in Compile ++= Seq(
131+
Compile / npmDependencies ++= Seq(
130132
"axios" -> npm_axios_version,
131133
"qs" -> npm_qs_version,
132134
"showdown" -> npm_showdown_version,
133-
"@comunica/utils-datasource" -> npm_comunica_version
135+
"@comunica/utils-datasource" -> npm_comunica_version_datasource,
136+
"@types/sax" -> "1.2.1"
134137
),
135138

136-
scalaJSLinkerConfig in (Compile, fastOptJS ) ~= {
139+
Compile / fastOptJS / scalaJSLinkerConfig ~= {
137140
_.withOptimizer(false)
138141
.withPrettyPrint(true)
139142
.withSourceMap(true)
140143
},
141-
scalaJSLinkerConfig in (Compile, fullOptJS) ~= {
144+
Compile / fullOptJS / scalaJSLinkerConfig ~= {
142145
_.withSourceMap(false)
143146
.withModuleKind(ModuleKind.CommonJSModule)
144147
},
@@ -151,6 +154,7 @@ lazy val discovery=crossProject(JSPlatform, JVMPlatform).in(file("."))
151154
"org.scala-js" %% "scalajs-stubs" % scalaStubVersion % "provided",
152155
"org.slf4j" % "slf4j-api" % slf4j_version,
153156
"org.slf4j" % "slf4j-simple" % slf4j_version,
157+
"org.eclipse.rdf4j" % "rdf4j-sail" % rdf4jVersion,
154158
"org.eclipse.rdf4j" % "rdf4j-storage" % rdf4jVersion,
155159
"org.eclipse.rdf4j" % "rdf4j-tools-federation" % rdf4jVersion
156160
))
@@ -178,8 +182,7 @@ npmPackageJson := {
178182
case (x,idx) if ( (idx > indexStartDependencies) && (idx < indexEndDependencies) ) => x
179183
}
180184

181-
182-
val file = reflect.io.File("./package.json").writeAll(
185+
reflect.io.File("./package.json").writeAll(
183186
Predef.augmentString(
184187
s"""{
185188
"name": "@${(ThisBuild / organizationName).value}/${(ThisBuild / name).value}",
@@ -189,12 +192,31 @@ s"""{
189192
"files": [
190193
"js/target/scala-2.13/scalajs-bundler/main/discovery-opt.js"
191194
],
195+
"scripts": {
196+
"test": "jest --detectOpenHandles"
197+
},
198+
"devDependencies": {
199+
"@types/jest": "^$types_jest ",
200+
"jest": "^$jest ",
201+
"ts-jest": "^$tsjest"
202+
},
203+
"jest": {
204+
"transform": {
205+
".(ts|tsx)": "ts-jest"
206+
},
207+
"testRegex": "(ts/__tests__/.*|\\\\.(test|spec))\\\\.(ts|tsx|js)$$",
208+
"moduleFileExtensions": [
209+
"ts",
210+
"tsx",
211+
"js"
212+
]
213+
},
192214
"dependencies": {
193215
${dependencies.mkString("\n")}
194216
},
195217
"repository": {
196218
"type": "git",
197-
"url": "git+https://github.com/p2m2/Discovery.git"
219+
"url": "git+https://github.com/p2m2/discovery.git"
198220
},
199221
"keywords": [
200222
"sparql",
@@ -204,9 +226,9 @@ ${dependencies.mkString("\n")}
204226
"author": "Olivier Filangi",
205227
"license": "MIT",
206228
"bugs": {
207-
"url": "https://github.com/p2m2/Discovery/issues"
229+
"url": "https://github.com/p2m2/discovery/issues"
208230
},
209-
"homepage": "https://github.com/p2m2/Discovery#README.md"
231+
"homepage": "https://p2m2.github.io/discovery/"
210232
}
211233
""").stripMargin)
212234
}

devel.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,24 @@ sbt discoveryJS/fullOptJS
4040
sbt discoveryJS/fastOptJS::webpack
4141
sbt discoveryJS/fullOptJS::webpack
4242
sbt discoveryJVM/testOnly inrae.semantic_web.QueryPlannerTest
43+
```
44+
4345
## local publication -> .ivy2
46+
47+
```
4448
sbt publishLocal
45-
## osssonatype maven centra repository publication
49+
```
50+
## oss.sonatype maven central repository publication
51+
https://oss.sonatype.org/
52+
53+
```
4654
sbt publish
55+
```
56+
### NPM publication
57+
```
58+
sbt discoveryJS/fullOptJS::webpack
59+
sbt npmPackageJson => genere package.json
60+
npm view @p2m2/discovery version -> list published version
61+
npm unpublish @p2m2/discovery@X.X.X -> unpublished lib
4762
npm publish --access public
4863
```

dist/checksum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2ff59ae149c99f34c1272d97c1bff8c6 -
1+
757050151db1317a2002e50f435bc086 -

0 commit comments

Comments
 (0)