@tpluscode/rdf-ns-builders 2.0.1 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (395) hide show
  1. package/README.md +4 -4
  2. package/package.json +34 -38
  3. package/bin/index.d.ts +0 -3
  4. package/bin/index.d.ts.map +0 -1
  5. package/bin/index.js +0 -13
  6. package/bin/index.mjs +0 -5
  7. package/build/index.d.ts +0 -9
  8. package/build/index.d.ts.map +0 -1
  9. package/build/index.js +0 -46
  10. package/build/index.mjs +0 -28
  11. package/build/interface.d.ts +0 -4
  12. package/build/interface.d.ts.map +0 -1
  13. package/build/interface.js +0 -44
  14. package/build/interface.mjs +0 -51
  15. package/build/modules.d.ts +0 -4
  16. package/build/modules.d.ts.map +0 -1
  17. package/build/modules.js +0 -25
  18. package/build/modules.mjs +0 -22
  19. package/build/prefix.d.ts +0 -4
  20. package/build/prefix.d.ts.map +0 -1
  21. package/build/prefix.js +0 -59
  22. package/build/prefix.mjs +0 -55
  23. package/build/strings.d.ts +0 -2
  24. package/build/strings.d.ts.map +0 -1
  25. package/build/strings.js +0 -7
  26. package/build/strings.mjs +0 -3
  27. package/index.d.ts +0 -91
  28. package/index.d.ts.map +0 -1
  29. package/index.js +0 -184
  30. package/index.mjs +0 -90
  31. package/loose.d.ts +0 -91
  32. package/loose.d.ts.map +0 -1
  33. package/loose.js +0 -184
  34. package/loose.mjs +0 -90
  35. package/vocabularies/acl.d.ts +0 -108
  36. package/vocabularies/acl.d.ts.map +0 -1
  37. package/vocabularies/acl.js +0 -10
  38. package/vocabularies/acl.mjs +0 -4
  39. package/vocabularies/as.d.ts +0 -220
  40. package/vocabularies/as.d.ts.map +0 -1
  41. package/vocabularies/as.js +0 -10
  42. package/vocabularies/as.mjs +0 -4
  43. package/vocabularies/bibo.d.ts +0 -274
  44. package/vocabularies/bibo.d.ts.map +0 -1
  45. package/vocabularies/bibo.js +0 -10
  46. package/vocabularies/bibo.mjs +0 -4
  47. package/vocabularies/cc.d.ts +0 -120
  48. package/vocabularies/cc.d.ts.map +0 -1
  49. package/vocabularies/cc.js +0 -10
  50. package/vocabularies/cc.mjs +0 -4
  51. package/vocabularies/cnt.d.ts +0 -44
  52. package/vocabularies/cnt.d.ts.map +0 -1
  53. package/vocabularies/cnt.js +0 -10
  54. package/vocabularies/cnt.mjs +0 -4
  55. package/vocabularies/constant.d.ts +0 -664
  56. package/vocabularies/constant.d.ts.map +0 -1
  57. package/vocabularies/constant.js +0 -10
  58. package/vocabularies/constant.mjs +0 -4
  59. package/vocabularies/csvw.d.ts +0 -189
  60. package/vocabularies/csvw.d.ts.map +0 -1
  61. package/vocabularies/csvw.js +0 -10
  62. package/vocabularies/csvw.mjs +0 -4
  63. package/vocabularies/ctag.d.ts +0 -8
  64. package/vocabularies/ctag.d.ts.map +0 -1
  65. package/vocabularies/ctag.js +0 -10
  66. package/vocabularies/ctag.mjs +0 -4
  67. package/vocabularies/dash.d.ts +0 -526
  68. package/vocabularies/dash.d.ts.map +0 -1
  69. package/vocabularies/dash.js +0 -10
  70. package/vocabularies/dash.mjs +0 -4
  71. package/vocabularies/dbo.d.ts +0 -4560
  72. package/vocabularies/dbo.d.ts.map +0 -1
  73. package/vocabularies/dbo.js +0 -10
  74. package/vocabularies/dbo.mjs +0 -4
  75. package/vocabularies/dc11.d.ts +0 -38
  76. package/vocabularies/dc11.d.ts.map +0 -1
  77. package/vocabularies/dc11.js +0 -10
  78. package/vocabularies/dc11.mjs +0 -4
  79. package/vocabularies/dcam.d.ts +0 -16
  80. package/vocabularies/dcam.d.ts.map +0 -1
  81. package/vocabularies/dcam.js +0 -10
  82. package/vocabularies/dcam.mjs +0 -4
  83. package/vocabularies/dcat.d.ts +0 -76
  84. package/vocabularies/dcat.d.ts.map +0 -1
  85. package/vocabularies/dcat.js +0 -10
  86. package/vocabularies/dcat.mjs +0 -4
  87. package/vocabularies/dcmitype.d.ts +0 -32
  88. package/vocabularies/dcmitype.d.ts.map +0 -1
  89. package/vocabularies/dcmitype.js +0 -10
  90. package/vocabularies/dcmitype.mjs +0 -4
  91. package/vocabularies/dcterms.d.ts +0 -205
  92. package/vocabularies/dcterms.d.ts.map +0 -1
  93. package/vocabularies/dcterms.js +0 -10
  94. package/vocabularies/dcterms.mjs +0 -4
  95. package/vocabularies/discipline.d.ts +0 -143
  96. package/vocabularies/discipline.d.ts.map +0 -1
  97. package/vocabularies/discipline.js +0 -10
  98. package/vocabularies/discipline.mjs +0 -4
  99. package/vocabularies/doap.d.ts +0 -123
  100. package/vocabularies/doap.d.ts.map +0 -1
  101. package/vocabularies/doap.js +0 -10
  102. package/vocabularies/doap.mjs +0 -4
  103. package/vocabularies/dpv.d.ts +0 -389
  104. package/vocabularies/dpv.d.ts.map +0 -1
  105. package/vocabularies/dpv.js +0 -10
  106. package/vocabularies/dpv.mjs +0 -4
  107. package/vocabularies/dqv.d.ts +0 -48
  108. package/vocabularies/dqv.d.ts.map +0 -1
  109. package/vocabularies/dqv.js +0 -10
  110. package/vocabularies/dqv.mjs +0 -4
  111. package/vocabularies/dtype.d.ts +0 -29
  112. package/vocabularies/dtype.d.ts.map +0 -1
  113. package/vocabularies/dtype.js +0 -10
  114. package/vocabularies/dtype.mjs +0 -4
  115. package/vocabularies/duv.d.ts +0 -28
  116. package/vocabularies/duv.d.ts.map +0 -1
  117. package/vocabularies/duv.js +0 -10
  118. package/vocabularies/duv.mjs +0 -4
  119. package/vocabularies/earl.d.ts +0 -66
  120. package/vocabularies/earl.d.ts.map +0 -1
  121. package/vocabularies/earl.js +0 -10
  122. package/vocabularies/earl.mjs +0 -4
  123. package/vocabularies/ebucore.d.ts +0 -2531
  124. package/vocabularies/ebucore.d.ts.map +0 -1
  125. package/vocabularies/ebucore.js +0 -10
  126. package/vocabularies/ebucore.mjs +0 -4
  127. package/vocabularies/exif.d.ts +0 -334
  128. package/vocabularies/exif.d.ts.map +0 -1
  129. package/vocabularies/exif.js +0 -10
  130. package/vocabularies/exif.mjs +0 -4
  131. package/vocabularies/foaf.d.ts +0 -158
  132. package/vocabularies/foaf.d.ts.map +0 -1
  133. package/vocabularies/foaf.js +0 -10
  134. package/vocabularies/foaf.mjs +0 -4
  135. package/vocabularies/frbr.d.ts +0 -223
  136. package/vocabularies/frbr.d.ts.map +0 -1
  137. package/vocabularies/frbr.js +0 -10
  138. package/vocabularies/frbr.mjs +0 -4
  139. package/vocabularies/geo.d.ts +0 -244
  140. package/vocabularies/geo.d.ts.map +0 -1
  141. package/vocabularies/geo.js +0 -10
  142. package/vocabularies/geo.mjs +0 -4
  143. package/vocabularies/geof.d.ts +0 -43
  144. package/vocabularies/geof.d.ts.map +0 -1
  145. package/vocabularies/geof.js +0 -10
  146. package/vocabularies/geof.mjs +0 -4
  147. package/vocabularies/geor.d.ts +0 -32
  148. package/vocabularies/geor.d.ts.map +0 -1
  149. package/vocabularies/geor.js +0 -10
  150. package/vocabularies/geor.mjs +0 -4
  151. package/vocabularies/gml.d.ts +0 -8
  152. package/vocabularies/gml.d.ts.map +0 -1
  153. package/vocabularies/gml.js +0 -10
  154. package/vocabularies/gml.mjs +0 -4
  155. package/vocabularies/gn.d.ts +0 -771
  156. package/vocabularies/gn.d.ts.map +0 -1
  157. package/vocabularies/gn.js +0 -10
  158. package/vocabularies/gn.mjs +0 -4
  159. package/vocabularies/gr.d.ts +0 -897
  160. package/vocabularies/gr.d.ts.map +0 -1
  161. package/vocabularies/gr.js +0 -10
  162. package/vocabularies/gr.mjs +0 -4
  163. package/vocabularies/grddl.d.ts +0 -64
  164. package/vocabularies/grddl.d.ts.map +0 -1
  165. package/vocabularies/grddl.js +0 -10
  166. package/vocabularies/grddl.mjs +0 -4
  167. package/vocabularies/gs1.d.ts +0 -2473
  168. package/vocabularies/gs1.d.ts.map +0 -1
  169. package/vocabularies/gs1.js +0 -10
  170. package/vocabularies/gs1.mjs +0 -4
  171. package/vocabularies/gtfs.d.ts +0 -206
  172. package/vocabularies/gtfs.d.ts.map +0 -1
  173. package/vocabularies/gtfs.js +0 -10
  174. package/vocabularies/gtfs.mjs +0 -4
  175. package/vocabularies/http.d.ts +0 -86
  176. package/vocabularies/http.d.ts.map +0 -1
  177. package/vocabularies/http.js +0 -10
  178. package/vocabularies/http.mjs +0 -4
  179. package/vocabularies/hydra.d.ts +0 -143
  180. package/vocabularies/hydra.d.ts.map +0 -1
  181. package/vocabularies/hydra.js +0 -10
  182. package/vocabularies/hydra.mjs +0 -4
  183. package/vocabularies/ical.d.ts +0 -179
  184. package/vocabularies/ical.d.ts.map +0 -1
  185. package/vocabularies/ical.js +0 -10
  186. package/vocabularies/ical.mjs +0 -4
  187. package/vocabularies/ldp.d.ts +0 -66
  188. package/vocabularies/ldp.d.ts.map +0 -1
  189. package/vocabularies/ldp.js +0 -10
  190. package/vocabularies/ldp.mjs +0 -4
  191. package/vocabularies/locn.d.ts +0 -55
  192. package/vocabularies/locn.d.ts.map +0 -1
  193. package/vocabularies/locn.js +0 -10
  194. package/vocabularies/locn.mjs +0 -4
  195. package/vocabularies/lvont.d.ts +0 -122
  196. package/vocabularies/lvont.d.ts.map +0 -1
  197. package/vocabularies/lvont.js +0 -10
  198. package/vocabularies/lvont.mjs +0 -4
  199. package/vocabularies/ma.d.ts +0 -185
  200. package/vocabularies/ma.d.ts.map +0 -1
  201. package/vocabularies/ma.js +0 -10
  202. package/vocabularies/ma.mjs +0 -4
  203. package/vocabularies/oa.d.ts +0 -149
  204. package/vocabularies/oa.d.ts.map +0 -1
  205. package/vocabularies/oa.js +0 -10
  206. package/vocabularies/oa.mjs +0 -4
  207. package/vocabularies/og.d.ts +0 -78
  208. package/vocabularies/og.d.ts.map +0 -1
  209. package/vocabularies/og.js +0 -10
  210. package/vocabularies/og.mjs +0 -4
  211. package/vocabularies/org.d.ts +0 -98
  212. package/vocabularies/org.d.ts.map +0 -1
  213. package/vocabularies/org.js +0 -10
  214. package/vocabularies/org.mjs +0 -4
  215. package/vocabularies/owl.d.ts +0 -162
  216. package/vocabularies/owl.d.ts.map +0 -1
  217. package/vocabularies/owl.js +0 -10
  218. package/vocabularies/owl.mjs +0 -4
  219. package/vocabularies/prefix.d.ts +0 -37
  220. package/vocabularies/prefix.d.ts.map +0 -1
  221. package/vocabularies/prefix.js +0 -10
  222. package/vocabularies/prefix.mjs +0 -4
  223. package/vocabularies/prov.d.ts +0 -286
  224. package/vocabularies/prov.d.ts.map +0 -1
  225. package/vocabularies/prov.js +0 -10
  226. package/vocabularies/prov.mjs +0 -4
  227. package/vocabularies/qb.d.ts +0 -83
  228. package/vocabularies/qb.d.ts.map +0 -1
  229. package/vocabularies/qb.js +0 -10
  230. package/vocabularies/qb.mjs +0 -4
  231. package/vocabularies/qkdv.d.ts +0 -205
  232. package/vocabularies/qkdv.d.ts.map +0 -1
  233. package/vocabularies/qkdv.js +0 -10
  234. package/vocabularies/qkdv.mjs +0 -4
  235. package/vocabularies/quantitykind.d.ts +0 -873
  236. package/vocabularies/quantitykind.d.ts.map +0 -1
  237. package/vocabularies/quantitykind.js +0 -10
  238. package/vocabularies/quantitykind.mjs +0 -4
  239. package/vocabularies/qudt.d.ts +0 -1084
  240. package/vocabularies/qudt.d.ts.map +0 -1
  241. package/vocabularies/qudt.js +0 -10
  242. package/vocabularies/qudt.mjs +0 -4
  243. package/vocabularies/qudtv.mjs +0 -2
  244. package/vocabularies/rdau.d.ts +0 -3128
  245. package/vocabularies/rdau.d.ts.map +0 -1
  246. package/vocabularies/rdau.js +0 -10
  247. package/vocabularies/rdau.mjs +0 -4
  248. package/vocabularies/rdf.d.ts +0 -52
  249. package/vocabularies/rdf.d.ts.map +0 -1
  250. package/vocabularies/rdf.js +0 -10
  251. package/vocabularies/rdf.mjs +0 -4
  252. package/vocabularies/rdfa.d.ts +0 -28
  253. package/vocabularies/rdfa.d.ts.map +0 -1
  254. package/vocabularies/rdfa.js +0 -10
  255. package/vocabularies/rdfa.mjs +0 -4
  256. package/vocabularies/rdfs.d.ts +0 -41
  257. package/vocabularies/rdfs.d.ts.map +0 -1
  258. package/vocabularies/rdfs.js +0 -10
  259. package/vocabularies/rdfs.mjs +0 -4
  260. package/vocabularies/rev.d.ts +0 -8
  261. package/vocabularies/rev.d.ts.map +0 -1
  262. package/vocabularies/rev.js +0 -10
  263. package/vocabularies/rev.mjs +0 -4
  264. package/vocabularies/rico.d.ts +0 -2726
  265. package/vocabularies/rico.d.ts.map +0 -1
  266. package/vocabularies/rico.js +0 -10
  267. package/vocabularies/rico.mjs +0 -4
  268. package/vocabularies/rif.d.ts +0 -8
  269. package/vocabularies/rif.d.ts.map +0 -1
  270. package/vocabularies/rif.js +0 -10
  271. package/vocabularies/rif.mjs +0 -4
  272. package/vocabularies/rr.d.ts +0 -89
  273. package/vocabularies/rr.d.ts.map +0 -1
  274. package/vocabularies/rr.js +0 -10
  275. package/vocabularies/rr.mjs +0 -4
  276. package/vocabularies/rss.d.ts +0 -28
  277. package/vocabularies/rss.d.ts.map +0 -1
  278. package/vocabularies/rss.js +0 -10
  279. package/vocabularies/rss.mjs +0 -4
  280. package/vocabularies/schema.d.ts +0 -6152
  281. package/vocabularies/schema.d.ts.map +0 -1
  282. package/vocabularies/schema.js +0 -10
  283. package/vocabularies/schema.mjs +0 -1
  284. package/vocabularies/sd.d.ts +0 -84
  285. package/vocabularies/sd.d.ts.map +0 -1
  286. package/vocabularies/sd.js +0 -10
  287. package/vocabularies/sd.mjs +0 -4
  288. package/vocabularies/sdmx.d.ts +0 -35
  289. package/vocabularies/sdmx.d.ts.map +0 -1
  290. package/vocabularies/sdmx.js +0 -10
  291. package/vocabularies/sdmx.mjs +0 -4
  292. package/vocabularies/sem.d.ts +0 -89
  293. package/vocabularies/sem.d.ts.map +0 -1
  294. package/vocabularies/sem.js +0 -10
  295. package/vocabularies/sem.mjs +0 -4
  296. package/vocabularies/sf.d.ts +0 -8
  297. package/vocabularies/sf.d.ts.map +0 -1
  298. package/vocabularies/sf.js +0 -10
  299. package/vocabularies/sf.mjs +0 -4
  300. package/vocabularies/sh.d.ts +0 -411
  301. package/vocabularies/sh.d.ts.map +0 -1
  302. package/vocabularies/sh.js +0 -10
  303. package/vocabularies/sh.mjs +0 -4
  304. package/vocabularies/shex.d.ts +0 -144
  305. package/vocabularies/shex.d.ts.map +0 -1
  306. package/vocabularies/shex.js +0 -10
  307. package/vocabularies/shex.mjs +0 -4
  308. package/vocabularies/sioc.d.ts +0 -204
  309. package/vocabularies/sioc.d.ts.map +0 -1
  310. package/vocabularies/sioc.js +0 -10
  311. package/vocabularies/sioc.mjs +0 -4
  312. package/vocabularies/skos.d.ts +0 -52
  313. package/vocabularies/skos.d.ts.map +0 -1
  314. package/vocabularies/skos.js +0 -10
  315. package/vocabularies/skos.mjs +0 -4
  316. package/vocabularies/skosxl.d.ts +0 -18
  317. package/vocabularies/skosxl.d.ts.map +0 -1
  318. package/vocabularies/skosxl.js +0 -10
  319. package/vocabularies/skosxl.mjs +0 -4
  320. package/vocabularies/sosa.d.ts +0 -80
  321. package/vocabularies/sosa.d.ts.map +0 -1
  322. package/vocabularies/sosa.js +0 -10
  323. package/vocabularies/sosa.mjs +0 -4
  324. package/vocabularies/sou.d.ts +0 -26
  325. package/vocabularies/sou.d.ts.map +0 -1
  326. package/vocabularies/sou.js +0 -10
  327. package/vocabularies/sou.mjs +0 -4
  328. package/vocabularies/ssn.d.ts +0 -50
  329. package/vocabularies/ssn.d.ts.map +0 -1
  330. package/vocabularies/ssn.js +0 -10
  331. package/vocabularies/ssn.mjs +0 -4
  332. package/vocabularies/test.d.ts +0 -41
  333. package/vocabularies/test.d.ts.map +0 -1
  334. package/vocabularies/test.js +0 -10
  335. package/vocabularies/test.mjs +0 -4
  336. package/vocabularies/time.d.ts +0 -214
  337. package/vocabularies/time.d.ts.map +0 -1
  338. package/vocabularies/time.js +0 -10
  339. package/vocabularies/time.mjs +0 -4
  340. package/vocabularies/unit.d.ts +0 -1724
  341. package/vocabularies/unit.d.ts.map +0 -1
  342. package/vocabularies/unit.js +0 -10
  343. package/vocabularies/unit.mjs +0 -4
  344. package/vocabularies/v.d.ts +0 -8
  345. package/vocabularies/v.d.ts.map +0 -1
  346. package/vocabularies/v.js +0 -10
  347. package/vocabularies/v.mjs +0 -4
  348. package/vocabularies/vaem.d.ts +0 -80
  349. package/vocabularies/vaem.d.ts.map +0 -1
  350. package/vocabularies/vaem.js +0 -10
  351. package/vocabularies/vaem.mjs +0 -4
  352. package/vocabularies/vann.d.ts +0 -22
  353. package/vocabularies/vann.d.ts.map +0 -1
  354. package/vocabularies/vann.js +0 -10
  355. package/vocabularies/vann.mjs +0 -4
  356. package/vocabularies/vcard.d.ts +0 -273
  357. package/vocabularies/vcard.d.ts.map +0 -1
  358. package/vocabularies/vcard.js +0 -10
  359. package/vocabularies/vcard.mjs +0 -4
  360. package/vocabularies/void.d.ts +0 -65
  361. package/vocabularies/void.d.ts.map +0 -1
  362. package/vocabularies/void.js +0 -10
  363. package/vocabularies/void.mjs +0 -4
  364. package/vocabularies/vs.d.ts +0 -14
  365. package/vocabularies/vs.d.ts.map +0 -1
  366. package/vocabularies/vs.js +0 -10
  367. package/vocabularies/vs.mjs +0 -4
  368. package/vocabularies/wdr.d.ts +0 -8
  369. package/vocabularies/wdr.d.ts.map +0 -1
  370. package/vocabularies/wdr.js +0 -10
  371. package/vocabularies/wdr.mjs +0 -4
  372. package/vocabularies/wdrs.d.ts +0 -8
  373. package/vocabularies/wdrs.d.ts.map +0 -1
  374. package/vocabularies/wdrs.js +0 -10
  375. package/vocabularies/wdrs.mjs +0 -4
  376. package/vocabularies/wgs.d.ts +0 -47
  377. package/vocabularies/wgs.d.ts.map +0 -1
  378. package/vocabularies/wgs.js +0 -10
  379. package/vocabularies/wgs.mjs +0 -4
  380. package/vocabularies/xhv.d.ts +0 -460
  381. package/vocabularies/xhv.d.ts.map +0 -1
  382. package/vocabularies/xhv.js +0 -10
  383. package/vocabularies/xhv.mjs +0 -4
  384. package/vocabularies/xkos.d.ts +0 -57
  385. package/vocabularies/xkos.d.ts.map +0 -1
  386. package/vocabularies/xkos.js +0 -10
  387. package/vocabularies/xkos.mjs +0 -4
  388. package/vocabularies/xml.d.ts +0 -8
  389. package/vocabularies/xml.d.ts.map +0 -1
  390. package/vocabularies/xml.js +0 -10
  391. package/vocabularies/xml.mjs +0 -4
  392. package/vocabularies/xsd.d.ts +0 -423
  393. package/vocabularies/xsd.d.ts.map +0 -1
  394. package/vocabularies/xsd.js +0 -10
  395. package/vocabularies/xsd.mjs +0 -4
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  > # @tpluscode/rdf-ns-builders
2
2
 
3
- Common RDF vocabularies extracted from [`@zazuko/rdf-vocabularies`][rdfv] and wrapped
3
+ Common RDF vocabularies extracted from [`@zazuko/vocabularies`][rdfv] and wrapped
4
4
  as [`@rdfjs/namespace`][ns] builder objects.
5
5
 
6
6
  Also includes TypeScript declarations of the terms included in the known
@@ -19,7 +19,7 @@ npm i -S @tpluscode/rdf-ns-builders
19
19
 
20
20
  ## Usage
21
21
 
22
- Simply import a namespace builder by its prefix defined in [`@zazuko/rdf-vocabularies`][rdfv]
22
+ Simply import a namespace builder by its prefix defined in [`@zazuko/vocabularies`][rdfv]
23
23
 
24
24
  ```ts
25
25
  import { schema } from '@tpluscode/rdf-ns-builders'
@@ -42,12 +42,12 @@ const schemaPerson: NamedNode = schema.Persona
42
42
 
43
43
  ## Roll your own
44
44
 
45
- Given a package with same exports as `@zazuko/rdf-vocabularies`, it is possible to generate a set of namespace builders generated from your own vocabularies.
45
+ Given a package with same exports as `@zazuko/vocabularies`, it is possible to generate a set of namespace builders generated from your own vocabularies.
46
46
 
47
47
  Install required peer dependencies:
48
48
 
49
49
  ```
50
- npm i -D ts-node ts-morph clownface @zazuko/rdf-vocabularies safe-identifier
50
+ npm i -D ts-node ts-morph clownface @zazuko/vocabularies safe-identifier
51
51
  ```
52
52
 
53
53
  Run the following command to generate builders package by providing the source package name and output directory.
package/package.json CHANGED
@@ -1,36 +1,30 @@
1
1
  {
2
2
  "name": "@tpluscode/rdf-ns-builders",
3
- "version": "2.0.1",
3
+ "version": "3.0.1",
4
4
  "description": "Generated RDF/JS namespace builders for common vocabularies",
5
+ "type": "module",
5
6
  "main": "index.js",
6
- "module": "index.mjs",
7
- "browser": "index.mjs",
7
+ "module": "index.js",
8
+ "browser": "index.js",
8
9
  "types": "index.d.ts",
9
10
  "bin": {
10
11
  "rdf-ns-builders": "bin/index.js"
11
12
  },
12
13
  "scripts": {
13
- "generate": "ts-node -P tsconfig.build.json src/bin/index.ts generate -p @zazuko/rdf-vocabularies -o src",
14
- "test": "c8 --reporter=lcov mocha --require ts-node/register test/index.test.ts",
14
+ "prepare": "patch-package",
15
+ "generate": "node --loader ts-node/esm src/bin/index.ts generate -p @zazuko/vocabularies -o src",
16
+ "test": "c8 --reporter=lcov mocha test/index.test.ts",
15
17
  "prepack": "npm run build",
16
- "build": "run-p build:*",
17
- "build:cjs": "tsc -P tsconfig.build.json",
18
- "build:esm": "babel src --out-dir . --extensions .ts --out-file-extension .mjs",
18
+ "lint": "eslint . --ext .ts --quiet --ignore-path .gitignore --ignore-path .eslintignore",
19
+ "build": "tsc",
19
20
  "release": "changeset publish"
20
21
  },
21
22
  "exports": {
22
- ".": {
23
- "require": "./index.js",
24
- "import": "./index.mjs"
25
- },
26
- "./loose": {
27
- "require": "./loose.js",
28
- "import": "./loose.mjs"
29
- }
23
+ ".": "./index.js",
24
+ "./loose": "./loose.js"
30
25
  },
31
26
  "files": [
32
27
  "*.js",
33
- "*.mjs",
34
28
  "bin",
35
29
  "build",
36
30
  "vocabularies",
@@ -38,56 +32,55 @@
38
32
  "*.d.ts.map"
39
33
  ],
40
34
  "dependencies": {
41
- "@rdf-esm/data-model": "^0.5.4",
42
- "@rdf-esm/namespace": "^0.5.1",
35
+ "@rdfjs/data-model": "^2",
36
+ "@rdfjs/namespace": "^2",
43
37
  "@rdfjs/types": "*",
38
+ "@types/rdfjs__namespace": "^2.0.2",
39
+ "@zazuko/prefixes": "^1.0.0-rc.0",
44
40
  "commander": "^7.2.0",
45
41
  "fs-extra": "^10.0.0"
46
42
  },
47
43
  "peerDependencies": {
48
- "@zazuko/rdf-vocabularies": "*",
44
+ "@zazuko/vocabularies": "^1.0.0-rc.2",
49
45
  "clownface": "^1",
50
46
  "safe-identifier": "^0.4.2",
51
47
  "ts-morph": ">=11",
52
48
  "ts-node": ">= 8"
53
49
  },
54
50
  "devDependencies": {
55
- "@babel/cli": "^7.10.3",
56
- "@babel/core": "^7.10.3",
57
- "@babel/preset-env": "^7.10.3",
58
- "@babel/preset-typescript": "^7.10.1",
59
- "@babel/register": "^7.10.4",
60
51
  "@changesets/cli": "^2.23.0",
61
- "@tpluscode/eslint-config": "^0.3.2",
52
+ "@tpluscode/eslint-config": "^0.4.2",
62
53
  "@types/chai": "^4.2.11",
63
54
  "@types/clownface": "^1.5.0",
64
55
  "@types/mocha": "^9.1.1",
65
- "@types/rdf-ext": "^1.3.5",
66
- "@types/rdfjs__namespace": "^1.1.1",
67
- "@typescript-eslint/eslint-plugin": "^5.29.0",
68
- "@typescript-eslint/parser": "^5.29.0",
69
- "@zazuko/rdf-vocabularies": "2021.9.22-3",
70
- "babel-plugin-add-import-extension": "^1.3.1",
56
+ "@types/rdf-ext": "^2.0.1",
57
+ "@types/rdfjs__data-model": "^2",
58
+ "@typescript-eslint/eslint-plugin": "^5.55.0",
59
+ "@typescript-eslint/parser": "^5.55.0",
60
+ "@zazuko/vocabularies": "^1.0.0-rc.2",
71
61
  "c8": "^7.11.3",
72
62
  "chai": "^4.2.0",
73
63
  "clownface": "^1.5.1",
74
64
  "eslint": "^8.5.0",
75
65
  "eslint-config-standard": "^17.0.0",
76
- "eslint-import-resolver-typescript": "^2.5.0",
77
- "eslint-plugin-import": "^2.23.4",
66
+ "eslint-import-resolver-typescript": "^3.5.3",
67
+ "eslint-plugin-import": "^2.27.5",
78
68
  "eslint-plugin-lit-a11y": "^2.2.0",
79
- "eslint-plugin-n": "^15.2.0",
69
+ "eslint-plugin-n": "^15.6.1",
80
70
  "eslint-plugin-node": "^11.1.0",
81
- "eslint-plugin-promise": "^6.0.0",
71
+ "eslint-plugin-promise": "^6.1.1",
72
+ "eslint-plugin-require-extensions": "^0.1.2",
82
73
  "husky": "^3.1.0",
83
74
  "lint-staged": "^13.0.3",
84
75
  "mocha": "^10.0.0",
85
76
  "npm-run-all": "^4.1.5",
77
+ "patch-package": "^6.5.1",
78
+ "postinstall-postinstall": "^2.1.0",
86
79
  "safe-identifier": "^0.4.2",
87
80
  "standard": "^17.0.0",
88
81
  "ts-morph": "^15.1.0",
89
- "ts-node": "^10.8.1",
90
- "typescript": "^4.7.4"
82
+ "ts-node": "^10.9.1",
83
+ "typescript": "^4.9.5"
91
84
  },
92
85
  "publishConfig": {
93
86
  "access": "public"
@@ -111,5 +104,8 @@
111
104
  "*.{js,ts}": [
112
105
  "eslint --fix --quiet"
113
106
  ]
107
+ },
108
+ "mocha": {
109
+ "loader": "ts-node/esm"
114
110
  }
115
111
  }
package/bin/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ts-node
2
- export {};
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/bin/index.ts"],"names":[],"mappings":""}
package/bin/index.js DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ts-node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const commander_1 = __importDefault(require("commander"));
8
- const build_1 = require("../build");
9
- commander_1.default.command('generate')
10
- .requiredOption('-p, --vocabsPackage <vocabsPackage>', 'Name of source package or path to local module (typescript included)')
11
- .option('-o, --outDir <outDir>', 'Directory in which to create builder modules', 'builders')
12
- .action(build_1.build);
13
- commander_1.default.parse(process.argv);
package/bin/index.mjs DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ts-node
2
- import Program from 'commander';
3
- import { build } from "../build/index.mjs";
4
- Program.command('generate').requiredOption('-p, --vocabsPackage <vocabsPackage>', 'Name of source package or path to local module (typescript included)').option('-o, --outDir <outDir>', 'Directory in which to create builder modules', 'builders').action(build);
5
- Program.parse(process.argv);
package/build/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type * as RdfVocabularies from '@zazuko/rdf-vocabularies';
2
- interface Build {
3
- outDir: string;
4
- vocabsPackage: string;
5
- }
6
- export declare type ImportedVocabularies = Pick<typeof RdfVocabularies, 'vocabularies' | 'prefixes'>;
7
- export declare function build({ outDir, vocabsPackage }: Build): Promise<void>;
8
- export {};
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAMhE,UAAU,KAAK;IACb,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,oBAAY,oBAAoB,GAAG,IAAI,CAAC,OAAO,eAAe,EAAE,cAAc,GAAG,UAAU,CAAC,CAAA;AAE5F,wBAAsB,KAAK,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB3E"}
package/build/index.js DELETED
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.build = void 0;
27
- const path_1 = require("path");
28
- const ts_morph_1 = require("ts-morph");
29
- const prefix_1 = require("./prefix");
30
- const modules_1 = require("./modules");
31
- const project = new ts_morph_1.Project();
32
- async function build({ outDir, vocabsPackage }) {
33
- const packagePath = vocabsPackage.startsWith('.') ? (0, path_1.resolve)(process.cwd(), vocabsPackage) : vocabsPackage;
34
- const rdfVocabularies = await Promise.resolve().then(() => __importStar(require(packagePath)));
35
- const promises = Object.entries(rdfVocabularies.prefixes).map(([prefix, namespace]) => {
36
- const sourceFile = project.createSourceFile((0, path_1.resolve)(outDir, 'vocabularies', `${prefix}.ts`), undefined, { overwrite: true });
37
- return (0, prefix_1.createPrefixFile)(sourceFile, prefix, namespace, rdfVocabularies);
38
- });
39
- await Promise.all(promises);
40
- const defaultModule = project.createSourceFile((0, path_1.resolve)(outDir, 'index.ts'), undefined, { overwrite: true });
41
- (0, modules_1.createDefaultModule)(defaultModule, rdfVocabularies.prefixes);
42
- const looseModule = project.createSourceFile((0, path_1.resolve)(outDir, 'loose.ts'), undefined, { overwrite: true });
43
- (0, modules_1.createLooseModule)(looseModule, rdfVocabularies.prefixes);
44
- await project.save();
45
- }
46
- exports.build = build;
package/build/index.mjs DELETED
@@ -1,28 +0,0 @@
1
- import { resolve } from 'path';
2
- import { Project } from 'ts-morph';
3
- import { createPrefixFile } from "./prefix.mjs";
4
- import { createDefaultModule, createLooseModule } from "./modules.mjs";
5
- const project = new Project();
6
- export async function build({
7
- outDir,
8
- vocabsPackage
9
- }) {
10
- const packagePath = vocabsPackage.startsWith('.') ? resolve(process.cwd(), vocabsPackage) : vocabsPackage;
11
- const rdfVocabularies = await import(packagePath);
12
- const promises = Object.entries(rdfVocabularies.prefixes).map(([prefix, namespace]) => {
13
- const sourceFile = project.createSourceFile(resolve(outDir, 'vocabularies', `${prefix}.ts`), undefined, {
14
- overwrite: true
15
- });
16
- return createPrefixFile(sourceFile, prefix, namespace, rdfVocabularies);
17
- });
18
- await Promise.all(promises);
19
- const defaultModule = project.createSourceFile(resolve(outDir, 'index.ts'), undefined, {
20
- overwrite: true
21
- });
22
- createDefaultModule(defaultModule, rdfVocabularies.prefixes);
23
- const looseModule = project.createSourceFile(resolve(outDir, 'loose.ts'), undefined, {
24
- overwrite: true
25
- });
26
- createLooseModule(looseModule, rdfVocabularies.prefixes);
27
- await project.save();
28
- }
@@ -1,4 +0,0 @@
1
- import { PropertySignatureStructure } from 'ts-morph';
2
- import { ImportedVocabularies } from './';
3
- export declare function createMembers(prefix: string, { vocabularies, prefixes }: ImportedVocabularies): Promise<PropertySignatureStructure[]>;
4
- //# sourceMappingURL=interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../src/build/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAiB,MAAM,UAAU,CAAA;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAA;AAkBzC,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC,CAyB3I"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createMembers = void 0;
7
- const ts_morph_1 = require("ts-morph");
8
- const rdf_vocabularies_1 = require("@zazuko/rdf-vocabularies");
9
- const clownface_1 = __importDefault(require("clownface"));
10
- const data_model_1 = require("@rdf-esm/data-model");
11
- const rdfsComment = (0, data_model_1.namedNode)('http://www.w3.org/2000/01/rdf-schema#comment');
12
- function createMember(prefixes, prefix, term, comment) {
13
- const member = {
14
- name: `"${term}"`,
15
- kind: ts_morph_1.StructureKind.PropertySignature,
16
- type: `NamedNode<'${prefixes[prefix]}${term}'>`,
17
- };
18
- if (comment) {
19
- member.docs = [comment];
20
- }
21
- return member;
22
- }
23
- async function createMembers(prefix, { vocabularies, prefixes }) {
24
- const prefixedRegex = new RegExp(`^${prefix}:(.+)$`);
25
- const terms = new Map();
26
- const dataset = (await vocabularies({ only: [prefix] }))[prefix];
27
- if (!dataset) {
28
- return [];
29
- }
30
- const graph = (0, clownface_1.default)({ dataset });
31
- [...graph.in().toArray(), ...graph.out().toArray()]
32
- .forEach((node) => {
33
- const prefixedName = (0, rdf_vocabularies_1.shrink)(node.value);
34
- const matchesPrefix = prefixedName.match(prefixedRegex);
35
- if (prefixedName && matchesPrefix) {
36
- const term = matchesPrefix[1];
37
- if (!terms.has(matchesPrefix[1])) {
38
- terms.set(term, createMember(prefixes, prefix, term, node.out(rdfsComment).values[0]));
39
- }
40
- }
41
- });
42
- return [...terms.values()].sort();
43
- }
44
- exports.createMembers = createMembers;
@@ -1,51 +0,0 @@
1
- import { StructureKind } from 'ts-morph';
2
- import { shrink } from '@zazuko/rdf-vocabularies';
3
- import cf from 'clownface';
4
- import { namedNode } from '@rdf-esm/data-model';
5
- const rdfsComment = namedNode('http://www.w3.org/2000/01/rdf-schema#comment');
6
-
7
- function createMember(prefixes, prefix, term, comment) {
8
- const member = {
9
- name: `"${term}"`,
10
- kind: StructureKind.PropertySignature,
11
- type: `NamedNode<'${prefixes[prefix]}${term}'>`
12
- };
13
-
14
- if (comment) {
15
- member.docs = [comment];
16
- }
17
-
18
- return member;
19
- }
20
-
21
- export async function createMembers(prefix, {
22
- vocabularies,
23
- prefixes
24
- }) {
25
- const prefixedRegex = new RegExp(`^${prefix}:(.+)$`);
26
- const terms = new Map();
27
- const dataset = (await vocabularies({
28
- only: [prefix]
29
- }))[prefix];
30
-
31
- if (!dataset) {
32
- return [];
33
- }
34
-
35
- const graph = cf({
36
- dataset
37
- });
38
- [...graph.in().toArray(), ...graph.out().toArray()].forEach(node => {
39
- const prefixedName = shrink(node.value);
40
- const matchesPrefix = prefixedName.match(prefixedRegex);
41
-
42
- if (prefixedName && matchesPrefix) {
43
- const term = matchesPrefix[1];
44
-
45
- if (!terms.has(matchesPrefix[1])) {
46
- terms.set(term, createMember(prefixes, prefix, term, node.out(rdfsComment).values[0]));
47
- }
48
- }
49
- });
50
- return [...terms.values()].sort();
51
- }
@@ -1,4 +0,0 @@
1
- import { SourceFile } from 'ts-morph';
2
- export declare function createLooseModule(sourceFile: SourceFile, prefixes: Record<string, string>): void;
3
- export declare function createDefaultModule(sourceFile: SourceFile, prefixes: Record<string, string>): void;
4
- //# sourceMappingURL=modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/build/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,UAAU,EAAE,MAAM,UAAU,CAAA;AAa/E,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIhG;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAIlG"}
package/build/modules.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDefaultModule = exports.createLooseModule = void 0;
4
- const safe_identifier_1 = require("safe-identifier");
5
- function createExport(prefix, exportName) {
6
- return {
7
- namedExports: [{
8
- name: exportName,
9
- alias: (0, safe_identifier_1.identifier)(prefix),
10
- }],
11
- moduleSpecifier: `./vocabularies/${prefix}`,
12
- };
13
- }
14
- function createLooseModule(sourceFile, prefixes) {
15
- Object.keys(prefixes).forEach(prefix => {
16
- sourceFile.addExportDeclaration(createExport(prefix, 'loose'));
17
- });
18
- }
19
- exports.createLooseModule = createLooseModule;
20
- function createDefaultModule(sourceFile, prefixes) {
21
- Object.keys(prefixes).forEach(prefix => {
22
- sourceFile.addExportDeclaration(createExport(prefix, 'strict'));
23
- });
24
- }
25
- exports.createDefaultModule = createDefaultModule;
package/build/modules.mjs DELETED
@@ -1,22 +0,0 @@
1
- import { identifier } from 'safe-identifier';
2
-
3
- function createExport(prefix, exportName) {
4
- return {
5
- namedExports: [{
6
- name: exportName,
7
- alias: identifier(prefix)
8
- }],
9
- moduleSpecifier: `./vocabularies/${prefix}`
10
- };
11
- }
12
-
13
- export function createLooseModule(sourceFile, prefixes) {
14
- Object.keys(prefixes).forEach(prefix => {
15
- sourceFile.addExportDeclaration(createExport(prefix, 'loose'));
16
- });
17
- }
18
- export function createDefaultModule(sourceFile, prefixes) {
19
- Object.keys(prefixes).forEach(prefix => {
20
- sourceFile.addExportDeclaration(createExport(prefix, 'strict'));
21
- });
22
- }
package/build/prefix.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { SourceFile } from 'ts-morph';
2
- import type { ImportedVocabularies } from '.';
3
- export declare function createPrefixFile(sourceFile: SourceFile, prefix: string, namespace: string, vocabs: ImportedVocabularies): Promise<void>;
4
- //# sourceMappingURL=prefix.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"prefix.d.ts","sourceRoot":"","sources":["../src/build/prefix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0C,MAAM,UAAU,CAAA;AAI7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAA;AAE7C,wBAAsB,gBAAgB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,iBAyD7H"}
package/build/prefix.js DELETED
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPrefixFile = void 0;
4
- const ts_morph_1 = require("ts-morph");
5
- const safe_identifier_1 = require("safe-identifier");
6
- const interface_1 = require("./interface");
7
- const strings_1 = require("./strings");
8
- async function createPrefixFile(sourceFile, prefix, namespace, vocabs) {
9
- const interfaceName = (0, safe_identifier_1.identifier)((0, strings_1.toProperCase)(prefix));
10
- sourceFile.addImportDeclaration({
11
- defaultImport: 'namespace',
12
- namedImports: [{
13
- name: 'NamespaceBuilder',
14
- }],
15
- moduleSpecifier: '@rdf-esm/namespace',
16
- });
17
- sourceFile.addImportDeclaration({
18
- namedImports: [{
19
- name: 'NamedNode',
20
- }],
21
- moduleSpecifier: '@rdfjs/types',
22
- });
23
- const prefixInterface = sourceFile.addInterface({
24
- name: interfaceName,
25
- });
26
- prefixInterface.addMember({
27
- name: "''",
28
- kind: ts_morph_1.StructureKind.PropertySignature,
29
- type: `NamedNode<'${namespace}'>`,
30
- });
31
- prefixInterface.addMembers(await (0, interface_1.createMembers)(prefix, vocabs));
32
- sourceFile.addVariableStatement({
33
- declarations: [{
34
- name: 'builder',
35
- initializer: `namespace("${namespace}")`,
36
- trailingTrivia: ' as any',
37
- }],
38
- declarationKind: ts_morph_1.VariableDeclarationKind.Const,
39
- });
40
- sourceFile.addVariableStatement({
41
- declarations: [{
42
- name: 'strict',
43
- initializer: 'builder',
44
- trailingTrivia: ` as NamespaceBuilder<keyof ${interfaceName}> & ${interfaceName}`,
45
- }],
46
- declarationKind: ts_morph_1.VariableDeclarationKind.Const,
47
- isExported: true,
48
- });
49
- sourceFile.addVariableStatement({
50
- declarations: [{
51
- name: 'loose',
52
- initializer: 'builder',
53
- trailingTrivia: ` as NamespaceBuilder & ${interfaceName}`,
54
- }],
55
- declarationKind: ts_morph_1.VariableDeclarationKind.Const,
56
- isExported: true,
57
- });
58
- }
59
- exports.createPrefixFile = createPrefixFile;
package/build/prefix.mjs DELETED
@@ -1,55 +0,0 @@
1
- import { StructureKind, VariableDeclarationKind } from 'ts-morph';
2
- import { identifier } from 'safe-identifier';
3
- import { createMembers } from "./interface.mjs";
4
- import { toProperCase } from "./strings.mjs";
5
- export async function createPrefixFile(sourceFile, prefix, namespace, vocabs) {
6
- const interfaceName = identifier(toProperCase(prefix));
7
- sourceFile.addImportDeclaration({
8
- defaultImport: 'namespace',
9
- namedImports: [{
10
- name: 'NamespaceBuilder'
11
- }],
12
- moduleSpecifier: '@rdf-esm/namespace'
13
- });
14
- sourceFile.addImportDeclaration({
15
- namedImports: [{
16
- name: 'NamedNode'
17
- }],
18
- moduleSpecifier: '@rdfjs/types'
19
- });
20
- const prefixInterface = sourceFile.addInterface({
21
- name: interfaceName
22
- });
23
- prefixInterface.addMember({
24
- name: "''",
25
- kind: StructureKind.PropertySignature,
26
- type: `NamedNode<'${namespace}'>`
27
- });
28
- prefixInterface.addMembers(await createMembers(prefix, vocabs));
29
- sourceFile.addVariableStatement({
30
- declarations: [{
31
- name: 'builder',
32
- initializer: `namespace("${namespace}")`,
33
- trailingTrivia: ' as any'
34
- }],
35
- declarationKind: VariableDeclarationKind.Const
36
- });
37
- sourceFile.addVariableStatement({
38
- declarations: [{
39
- name: 'strict',
40
- initializer: 'builder',
41
- trailingTrivia: ` as NamespaceBuilder<keyof ${interfaceName}> & ${interfaceName}`
42
- }],
43
- declarationKind: VariableDeclarationKind.Const,
44
- isExported: true
45
- });
46
- sourceFile.addVariableStatement({
47
- declarations: [{
48
- name: 'loose',
49
- initializer: 'builder',
50
- trailingTrivia: ` as NamespaceBuilder & ${interfaceName}`
51
- }],
52
- declarationKind: VariableDeclarationKind.Const,
53
- isExported: true
54
- });
55
- }
@@ -1,2 +0,0 @@
1
- export declare function toProperCase(str: string): string;
2
- //# sourceMappingURL=strings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/build/strings.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,UAEvC"}
package/build/strings.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toProperCase = void 0;
4
- function toProperCase(str) {
5
- return str.replace(/^\w/, substring => substring.toUpperCase());
6
- }
7
- exports.toProperCase = toProperCase;
package/build/strings.mjs DELETED
@@ -1,3 +0,0 @@
1
- export function toProperCase(str) {
2
- return str.replace(/^\w/, substring => substring.toUpperCase());
3
- }