Skip to content

Commit f8b3da7

Browse files
authored
Merge pull request #204 from p2m2/develop
0.4.3
2 parents 361d31a + df756df commit f8b3da7

11 files changed

+9907
-4351
lines changed

.circleci/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,13 @@ jobs:
301301
## bug with Node 17 -> https://github.com/webpack/webpack/issues/14532
302302
export NODE_OPTIONS=--openssl-legacy-provider
303303
sbt discoveryJS/fastOptJS/webpack
304+
sbt discoveryJS/fullOptJS/webpack
304305
sbt npmPackageJson
305306
npm i
307+
npm link
308+
cd ts
309+
npm link @p2m2/discovery
310+
cd ..
306311
npm test
307312
308313
publish_snapshot:

build.sbt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import sbtcrossproject.CrossPlugin.autoImport.crossProject
66
lazy val comunica_query_sparql_version = "2.6.6b"
77
lazy val data_model_rdfjs_version = "1.0.2"
88
lazy val n3js_facade_version = "1.16.3"
9-
lazy val rdfxml_streaming_parser_version = "1.5.1"
9+
lazy val rdfxml_streaming_parser_version = "2.2.1"
1010
lazy val axios_version = "1.3.2"
1111
//lazy val scalaJsMacrotaskExecutor = "1.0.0"
1212

1313
/* npm libs */
14-
lazy val npm_axios_version = "1.3.2"
14+
lazy val npm_axios_version = "1.3.4"
1515
lazy val npm_qs_version = "6.11.0"
1616
lazy val npm_showdown_version = "2.1.0"
1717
lazy val npm_comunica_version_datasource = "1.22.2"
@@ -26,7 +26,7 @@ lazy val tsjest = "29.0.5"
2626

2727
releaseIgnoreUntrackedFiles := true
2828

29-
val static_version_build = "0.4.2"
29+
val static_version_build = "0.4.3"
3030
val version_build = scala.util.Properties.envOrElse("DISCOVERY_VERSION", static_version_build)
3131
val SWDiscoveryVersionAtBuildTimeFile = "./shared/src/main/scala/fr/inrae/metabohub" +
3232
"/semantic_web/SWDiscoveryVersionAtBuildTime.scala"
@@ -105,7 +105,7 @@ lazy val discovery=
105105
.in(file("."))
106106
.settings(
107107
libraryDependencies ++= Seq(
108-
"com.softwaremill.sttp.client3" %% "core" % "3.8.11" % Test,
108+
"com.softwaremill.sttp.client3" %% "core" % "3.8.12" % Test,
109109
"com.lihaoyi" %%% "utest" % "0.8.1" % Test,
110110
"com.lihaoyi" %%% "upickle" % "3.0.0-M2",
111111
"org.wvlet.airframe" %%% "airframe-log" % "23.2.3",
@@ -208,6 +208,7 @@ s"""{
208208
"description": "${(ThisBuild / description).value}",
209209
"version": "${(ThisBuild / version).value}",
210210
"main": "./js/target/scala-2.13/scalajs-bundler/main/discovery-opt.js",
211+
"types": "./ts/types/discovery.d.ts",
211212
"files": [
212213
"js/target/scala-2.13/scalajs-bundler/main/discovery-opt.js"
213214
],

dist/discovery-web-dev.js

Lines changed: 9742 additions & 4330 deletions
Large diffs are not rendered by default.

dist/discovery-web-dev.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/discovery-web.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts/tests/github.issues.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SWDiscoveryConfiguration , SWDiscovery, URI } from "../../js/target/scala-2.13/scalajs-bundler/main/discovery-fastopt";
1+
import { SWDiscoveryConfiguration , SWDiscovery, URI } from "@p2m2/discovery";
22

33
describe("-- GITHUB ISSUES -- ", () => {
44

@@ -41,11 +41,9 @@ describe("-- GITHUB ISSUES -- ", () => {
4141
.something("hello")
4242
.isSubjectOf(URI("a"),"type")
4343
.filter.contains("Business")
44-
.console();
45-
/* .select("type")
46-
.commit()
47-
.raw();
44+
.console()
45+
.getSerializedString();
4846

49-
console.log("results:"+JSON.stringify(results))*/
47+
console.log("results:"+JSON.stringify(results))
5048
})
5149
});

ts/tests/swconfigurationbuilder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SWDiscoveryConfiguration , SWDiscovery , URI } from "../../js/target/scala-2.13/scalajs-bundler/main/discovery-fastopt";
1+
import { SWDiscoveryConfiguration , SWDiscovery , URI } from "@p2m2/discovery";
22

33
describe("SWDiscovery", () => {
44

ts/tests/swdiscovery.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SWDiscoveryConfiguration , SWDiscovery } from "../../js/target/scala-2.13/scalajs-bundler/main/discovery-fastopt";
1+
import { SWDiscoveryConfiguration , SWDiscovery } from "@p2m2/discovery";
22

33
describe("SWDiscovery", () => {
44

@@ -51,7 +51,7 @@ describe("SWDiscovery", () => {
5151
test("selectByPage", async () => {
5252
const args =
5353
await SWDiscovery(localConf)
54-
.something("h1").selectByPage(["h1"]);
54+
.something("h1").selectByPage("h1");
5555

5656
let numberOfPages : Number = Object.values(args)[0] as Number ;
5757
let lazyPage : Array<any> = Object.values(args)[1] as Array<any> ;
@@ -69,10 +69,10 @@ describe("SWDiscovery", () => {
6969
})
7070

7171
test("browse", () => {
72-
const results = SWDiscovery(localConf)
72+
const results : string[] = SWDiscovery(localConf)
7373
.something("h1")
7474
.isObjectOf("http://test11")
75-
.browse( ( n: any, p : Number) => {
75+
.browse( ( n: any, p : Number) : string => {
7676
return n.$type + " : " + p;
7777
});
7878
expect(results).toStrictEqual([

ts/tests/swtransaction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SWDiscoveryConfiguration , SWDiscovery } from "../../js/target/scala-2.13/scalajs-bundler/main/discovery-fastopt"
1+
import { SWDiscoveryConfiguration , SWDiscovery } from "@p2m2/discovery"
22

33
describe("SWDiscovery", () => {
44

ts/types/discovery.d.ts

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
export class SWDiscoveryConfiguration {
2+
static setConfigString(confjson:string) : SWDiscoveryConfiguration
3+
static init() : SWDiscoveryConfiguration
4+
5+
setPageSize(n: number) : SWDiscoveryConfiguration
6+
7+
setSizeBatchProcessing(n: number) : SWDiscoveryConfiguration
8+
9+
setLogLevel(level: string) : SWDiscoveryConfiguration
10+
11+
setCache(flag: boolean) : SWDiscoveryConfiguration
12+
13+
proxy(urlProxy : string , method? : string) : SWDiscoveryConfiguration
14+
15+
urlFile(
16+
filename:string,
17+
mimetype?:string,
18+
method?:string,
19+
auth?:string,
20+
login?:string,
21+
password?:string,
22+
token?:string) : SWDiscoveryConfiguration
23+
24+
sparqlEndpoint(
25+
url : string,
26+
method?:string,
27+
auth?:string,
28+
login?:string,
29+
password?:string,
30+
token?:string) : SWDiscoveryConfiguration
31+
32+
localFile(filename : string ,mimetype? : string) : SWDiscoveryConfiguration
33+
34+
rdfContent(content : string ,mimetype? : string) : SWDiscoveryConfiguration
35+
36+
sourcesSize : number
37+
pageSize : number
38+
sizeBatchProcessing : number
39+
logLevel : string
40+
cache : boolean
41+
42+
}
43+
44+
export class FilterIncrement {
45+
isLiteral : SWDiscovery
46+
isUri : SWDiscovery
47+
isBlank : SWDiscovery
48+
regex(pattern:string, flags?:string) : SWDiscovery
49+
contains(pattern:string) : SWDiscovery
50+
strStarts(pattern:string) : SWDiscovery
51+
strEnds(pattern:string) : SWDiscovery
52+
}
53+
54+
export class SWTransaction {
55+
progression(callBack : (percent: number) => any ) : SWTransaction
56+
requestEvent(callBack : (event: string) => any ) : SWTransaction
57+
abort() : SWTransaction
58+
commit() : SWTransaction
59+
raw() : Promise<any>
60+
distinct() : SWTransaction
61+
limit(l:number) : SWTransaction
62+
offset(l:number) : SWTransaction
63+
orderByAsc(...ref:string[]) : SWTransaction
64+
orderByDesc(...ref:string[]) : SWTransaction
65+
getSerializedString() : string
66+
setSerializedString(serialized_transaction:string) : SWTransaction
67+
console() : SWTransaction
68+
}
69+
70+
export function SWDiscovery(config?:SWDiscoveryConfiguration) : SWDiscovery
71+
72+
export class SWDiscovery {
73+
74+
setConfig(config:SWDiscoveryConfiguration) : SWDiscovery
75+
getConfig() : SWDiscoveryConfiguration
76+
77+
filter : FilterIncrement
78+
root() : SWDiscovery
79+
80+
prefix(short: string,long : URI | IRI | string) : SWDiscovery
81+
directive(diretive: string) : SWDiscovery
82+
prefix(directive: URI | IRI | string) : SWDiscovery
83+
84+
something(ref: string): SWDiscovery
85+
isSubjectOf(uri: URI | IRI | string, ref?: string): SWDiscovery
86+
isObjectOf(uri: URI | IRI | string, ref?: string): SWDiscovery
87+
isLinkTo(uri: URI | IRI | string, ref?: string): SWDiscovery
88+
isLinkFrom(uri: URI | IRI | string, ref?: string): SWDiscovery
89+
isA(uri: URI | IRI | string): SWDiscovery
90+
91+
92+
set(uri: URI | IRI | string) : SWDiscovery
93+
setList(uris: (URI | IRI | string)[]) : SWDiscovery
94+
datatype(uri: URI | IRI | string, ref: string): SWDiscovery
95+
96+
bind(ref: string) : SWDiscovery
97+
helper() : SWDiscovery
98+
console(): SWDiscovery
99+
focus() : string
100+
focus(ref: string) : SWDiscovery
101+
remove(focus: string) : SWDiscovery
102+
sparql() : string
103+
104+
select( ...lRef:string[] ) : SWTransaction
105+
selectByPage( ...lRef:string[] ) : Promise<[number,(SWTransaction[])]>
106+
selectDistinctByPage( ...lRef:string[] ) : Promise<[number,(SWTransaction[])]>
107+
108+
setSerializedString(serializedDiscovery:string) : SWDiscovery
109+
getSerializedString() : string
110+
111+
setDecoration(key : string, value : string) : SWDiscovery
112+
getDecoration(key : string) : string
113+
browse<Type>( fun : (n: any, p : Number) => Type ) : Type[]
114+
115+
116+
}
117+
118+
/**
119+
* RDF type definition
120+
*/
121+
122+
export interface IRI {}
123+
export function IRI(iri : String) : IRI
124+
export interface URI {}
125+
export function URI(iri : String) : URI
126+
export interface Anonymous {}
127+
export function Anonymous(iri : String) : Anonymous
128+
export interface PropertyPath {}
129+
export function PropertyPath(value : String) : PropertyPath
130+
export interface Literal {}
131+
export function Literal(value : String, datatype?: URI|string) : Literal
132+
export function Literal(value : number) : Literal
133+
export function Literal(value : boolean) : Literal
134+
export interface QueryVariable {}
135+
export function QueryVariable(name : string) : QueryVariable
136+

update_cdn_libjs.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
export NODE_OPTIONS=--openssl-legacy-provider
44

55
# clean dist directory
6-
rm dist/discovery*.js
6+
rm -f dist/discovery*.js
77
# generate build version
8-
rm ./shared/src/main/scala/inrae/semantic_web/SWDiscoveryVersionAtBuildTime.scala
8+
rm -f ./shared/src/main/scala/inrae/semantic_web/SWDiscoveryVersionAtBuildTime.scala
99

1010
# browser lib debug information
1111
sbt discoveryJS/fastOptJS/webpack
@@ -22,6 +22,10 @@ cp ./js/target/scala-2.13/scalajs-bundler/main/discovery-opt-bundle.js ./dist/di
2222
# typescript test
2323
sbt npmPackageJson
2424
npm i
25+
npm link
26+
cd ts
27+
npm link @p2m2/discovery
28+
cd ..
2529
npm test -- --silent && echo "typescript test ok" || exit 1
2630

2731
sed -i "s#discovery-fastopt-bundle#discovery-web-dev#g" $(find ./dist -type f -name "*dev*")

0 commit comments

Comments
 (0)