Skip to content

Commit 44613cc

Browse files
committed
fix: xeml v0.10.7
1 parent b9094e9 commit 44613cc

File tree

10 files changed

+64
-475
lines changed

10 files changed

+64
-475
lines changed

apps/xeml/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @kitmi/xeml
22

3+
## 0.10.7
4+
5+
### Patch Changes
6+
7+
- Removed old code
8+
39
## 0.10.6
410

511
### Patch Changes

apps/xeml/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kitmi/xeml",
3-
"version": "0.10.6",
3+
"version": "0.10.7",
44
"description": "Jacaranda data entity modeling tool",
55
"main": "src/index.js",
66
"bin": {

apps/xeml/src/lang/Dataset.js

Lines changed: 0 additions & 195 deletions
This file was deleted.

apps/xeml/src/lang/Linker.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ const XemlParser = Xeml.parser;
99
const XemlTypes = require('./XemlTypes');
1010
const Entity = require('./Entity');
1111
const Schema = require('./Schema');
12-
const View = require('./View');
13-
const Dataset = require('./Dataset');
1412

1513
const {
1614
isIdWithNamespace,
@@ -22,8 +20,6 @@ const {
2220

2321
const ELEMENT_CLASS_MAP = {
2422
[XemlTypes.Element.ENTITY]: Entity,
25-
[XemlTypes.Element.VIEW]: View,
26-
[XemlTypes.Element.DATASET]: Dataset,
2723
};
2824

2925
const ELEMENT_WITH_MODULE = new Set([
@@ -452,14 +448,6 @@ class Linker {
452448
return this.loadElement(refererModule, XemlTypes.Element.TYPE, elementName, throwOnMissing);
453449
}
454450

455-
loadDataset(refererModule, elementName, throwOnMissing = true) {
456-
return this.loadElement(refererModule, XemlTypes.Element.DATASET, elementName, throwOnMissing);
457-
}
458-
459-
loadView(refererModule, elementName, throwOnMissing = true) {
460-
return this.loadElement(refererModule, XemlTypes.Element.VIEW, elementName, throwOnMissing);
461-
}
462-
463451
/**
464452
* Load an element based on the namespace chain.
465453
* @param {object} refererModule - The module that refers to the element.

apps/xeml/src/lang/Schema.js

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,6 @@ class Schema extends Clonable {
1919
*/
2020
entities = {};
2121

22-
/**
23-
* Datasets, dataset = entity + relations + projection
24-
* @member {object}
25-
*/
26-
datasets = {};
27-
28-
/**
29-
* Views, view = dataset + filters
30-
* @member {object}
31-
*/
32-
views = {};
33-
3422
/**
3523
* @param {Linker} linker
3624
* @param {string} name
@@ -108,17 +96,6 @@ class Schema extends Clonable {
10896
this.addEntity(entity);
10997
}
11098

111-
if (!_.isEmpty(this.info.views)) {
112-
this.info.views.forEach((viewName) => {
113-
let view = this.linker.loadView(this.xemlModule, viewName);
114-
if (!view.linked) {
115-
throw new Error(`View [${entity.name}] not linked after loading.`);
116-
}
117-
118-
this.addView(view);
119-
});
120-
}
121-
12299
this.linked = true;
123100

124101
return this;
@@ -170,43 +147,6 @@ class Schema extends Clonable {
170147
return this;
171148
}
172149

173-
/**
174-
* Check whether a view with given name is in the schema
175-
* @param {string} viewName
176-
* @returns {boolean}
177-
*/
178-
hasView(viewName) {
179-
return viewName in this.views;
180-
}
181-
182-
/**
183-
* Add a view into the schema
184-
* @param {View} view
185-
* @returns {Schema}
186-
*/
187-
addView(view) {
188-
pre: !this.hasView(view.name), `View name [${view.name}] conflicts in schema [${this.name}].`;
189-
190-
this.views[view.name] = view;
191-
192-
return this;
193-
}
194-
195-
/**
196-
* Get a document hierarchy
197-
* @param {object} fromModule
198-
* @param {string} datasetName
199-
* @returns {object}
200-
*/
201-
getDocumentHierachy(fromModule, datasetName) {
202-
if (datasetName in this.datasets) {
203-
return this.datasets[datasetName];
204-
}
205-
206-
let dataset = this.linker.loadDataset(fromModule, datasetName);
207-
return (this.datasets[datasetName] = dataset.buildHierarchy(this));
208-
}
209-
210150
/**
211151
* Get the referenced entity, add it into schema if not in schema
212152
* @param {object} refererModule
@@ -258,8 +198,6 @@ class Schema extends Clonable {
258198
deepCloneField(this, schema, 'comment');
259199
deepCloneField(this, schema, 'entities');
260200
deepCloneField(this, schema, 'types');
261-
deepCloneField(this, schema, 'datasets');
262-
deepCloneField(this, schema, 'views');
263201

264202
schema.linked = true;
265203

@@ -277,7 +215,6 @@ class Schema extends Clonable {
277215
comment: this.comment,
278216
entities: _.mapValues(this.entities, (entity) => entity.toJSON()),
279217
types: this.types,
280-
datasets: _.mapValues(this.datasets, (dataset) => dataset.toJSON()),
281218
views: _.mapValues(this.views, (view) => view.toJSON()),
282219
};
283220

0 commit comments

Comments
 (0)