@lsbjordao/type-taxon-script 1.1.13 → 1.1.14
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.
- package/dist/exportOntology.js +16 -1
- package/package.json +1 -1
package/dist/exportOntology.js
CHANGED
|
@@ -238,11 +238,26 @@ function serializeObject(writer, subject, object, objectTypeName, objectId, visi
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
+
function getLatestCharactersVersion() {
|
|
242
|
+
const baseDir = './characters';
|
|
243
|
+
if (!fs_1.default.existsSync(baseDir))
|
|
244
|
+
return null;
|
|
245
|
+
const versions = fs_1.default.readdirSync(baseDir)
|
|
246
|
+
.filter(d => /^v\d+$/.test(d))
|
|
247
|
+
.map(d => ({ dir: d, num: parseInt(d.slice(1), 10) }))
|
|
248
|
+
.sort((a, b) => b.num - a.num);
|
|
249
|
+
return versions.length > 0 ? versions[0].dir : null;
|
|
250
|
+
}
|
|
241
251
|
function buildOntologyTTL() {
|
|
242
252
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
243
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
254
|
const writer = createWriter();
|
|
245
|
-
const
|
|
255
|
+
const version = getLatestCharactersVersion();
|
|
256
|
+
if (!version) {
|
|
257
|
+
console.error('\x1b[31m✖ No versioned directory found under ./characters/\x1b[0m');
|
|
258
|
+
return writerToString(writer);
|
|
259
|
+
}
|
|
260
|
+
const modules = yield importModules(`./characters/${version}/**/*.ts`);
|
|
246
261
|
for (const { mod } of modules) {
|
|
247
262
|
for (const exported of Object.values(mod)) {
|
|
248
263
|
if (!isClassLike(exported))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lsbjordao/type-taxon-script",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.14",
|
|
4
4
|
"author": "Lucas Jordão <tucarj@gmail.com> & André Eppinghaus <andreeppinghaus@gmail.com> & Vicente Calfo <vicentecalfo@gmail.com>",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "TypeTaxonScript",
|