componentsjs 5.0.1 → 5.3.0
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/README.md +1 -1
- package/components/context.jsonld +9 -0
- package/lib/ComponentsManager.d.ts +4 -0
- package/lib/ComponentsManager.js +10 -0
- package/lib/construction/ConfigConstructorPool.d.ts +9 -1
- package/lib/construction/ConfigConstructorPool.js +30 -10
- package/lib/construction/IConfigConstructorPool.d.ts +10 -0
- package/lib/loading/ComponentsManagerBuilder.js +6 -0
- package/lib/loading/ConfigRegistry.d.ts +6 -1
- package/lib/loading/ConfigRegistry.js +8 -0
- package/lib/preprocess/ConfigPreprocessorComponent.d.ts +3 -2
- package/lib/preprocess/ConfigPreprocessorComponent.js +4 -1
- package/lib/preprocess/ConfigPreprocessorOverride.d.ts +92 -0
- package/lib/preprocess/ConfigPreprocessorOverride.js +222 -0
- package/lib/preprocess/IConfigPreprocessor.d.ts +16 -1
- package/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.d.ts +15 -0
- package/lib/preprocess/parameterproperty/ParameterPropertyHandlerRange.js +96 -63
- package/package.json +3 -2
- package/CHANGELOG.md +0 -314
package/README.md
CHANGED
|
@@ -53,7 +53,7 @@ $ npm install -D componentsjs-generator
|
|
|
53
53
|
...
|
|
54
54
|
"build": "npm run build:ts && npm run build:components",
|
|
55
55
|
"build:ts": "tsc",
|
|
56
|
-
"build:components": "componentsjs-generator
|
|
56
|
+
"build:components": "componentsjs-generator",
|
|
57
57
|
"prepare": "npm run build",
|
|
58
58
|
...
|
|
59
59
|
}
|
|
@@ -77,6 +77,15 @@
|
|
|
77
77
|
"undefined": {
|
|
78
78
|
"@id": "oo:isUndefined"
|
|
79
79
|
},
|
|
80
|
+
"Override": {
|
|
81
|
+
"@id": "oo:Override"
|
|
82
|
+
},
|
|
83
|
+
"overrideInstance": {
|
|
84
|
+
"@id": "oo:overrideInstance"
|
|
85
|
+
},
|
|
86
|
+
"overrideParameters": {
|
|
87
|
+
"@id": "oo:overrideParameters"
|
|
88
|
+
},
|
|
80
89
|
"ParameterRange": {
|
|
81
90
|
"@id": "oo:ParameterRange"
|
|
82
91
|
},
|
|
@@ -33,6 +33,10 @@ export declare class ComponentsManager<Instance> {
|
|
|
33
33
|
* @param settings Optional settings that may influence instantiation.
|
|
34
34
|
*/
|
|
35
35
|
instantiate<T = Instance>(instanceIri: string, settings?: IConstructionSettings): Promise<T>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieve a list of all instantiated Resources.
|
|
38
|
+
*/
|
|
39
|
+
getInstantiatedResources(): Resource[];
|
|
36
40
|
/**
|
|
37
41
|
* Create an `componentsjs-error-state.json` file to represent the application state in the current working directory.
|
|
38
42
|
* @param error The error that causes this error state to be created.
|
package/lib/ComponentsManager.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComponentsManager = void 0;
|
|
4
4
|
const fs = require("fs");
|
|
5
|
+
const rdf_string_1 = require("rdf-string");
|
|
5
6
|
const ComponentsManagerBuilder_1 = require("./loading/ComponentsManagerBuilder");
|
|
6
7
|
const ErrorResourcesContext_1 = require("./util/ErrorResourcesContext");
|
|
7
8
|
/**
|
|
@@ -46,6 +47,15 @@ class ComponentsManager {
|
|
|
46
47
|
throw this.generateErrorLog(error);
|
|
47
48
|
}
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Retrieve a list of all instantiated Resources.
|
|
52
|
+
*/
|
|
53
|
+
getInstantiatedResources() {
|
|
54
|
+
const instances = this.configConstructorPool.getInstanceRegistry();
|
|
55
|
+
return Object.keys(instances)
|
|
56
|
+
.map(key => (0, rdf_string_1.stringToTerm)(key))
|
|
57
|
+
.map(term => this.configRegistry.getInstantiatedResource(term));
|
|
58
|
+
}
|
|
49
59
|
/**
|
|
50
60
|
* Create an `componentsjs-error-state.json` file to represent the application state in the current working directory.
|
|
51
61
|
* @param error The error that causes this error state to be created.
|
|
@@ -16,7 +16,7 @@ export declare class ConfigConstructorPool<Instance> implements IConfigConstruct
|
|
|
16
16
|
private readonly configPreprocessors;
|
|
17
17
|
private readonly configConstructor;
|
|
18
18
|
private readonly constructionStrategy;
|
|
19
|
-
private
|
|
19
|
+
private instances;
|
|
20
20
|
constructor(options: IInstancePoolOptions<Instance>);
|
|
21
21
|
instantiate(configResource: Resource, settings: IConstructionSettings): Promise<Instance>;
|
|
22
22
|
/**
|
|
@@ -41,6 +41,14 @@ export declare class ConfigConstructorPool<Instance> implements IConfigConstruct
|
|
|
41
41
|
* @param optional If the field is optional.
|
|
42
42
|
*/
|
|
43
43
|
validateParam(config: Resource, field: string, type: string, optional?: boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the instance registry.
|
|
46
|
+
*/
|
|
47
|
+
getInstanceRegistry(): Record<string, Promise<any>>;
|
|
48
|
+
/**
|
|
49
|
+
* Resets all preprocessors and clears the cached instances.
|
|
50
|
+
*/
|
|
51
|
+
reset(): void;
|
|
44
52
|
}
|
|
45
53
|
export interface IInstancePoolOptions<Instance> {
|
|
46
54
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfigConstructorPool = void 0;
|
|
4
|
+
const rdf_string_1 = require("rdf-string");
|
|
4
5
|
const ErrorResourcesContext_1 = require("../util/ErrorResourcesContext");
|
|
5
6
|
const ConfigConstructor_1 = require("./ConfigConstructor");
|
|
6
7
|
/**
|
|
@@ -27,7 +28,8 @@ class ConfigConstructorPool {
|
|
|
27
28
|
// Check if this resource is required as argument in its own chain,
|
|
28
29
|
// if so, return a dummy value, to avoid infinite recursion.
|
|
29
30
|
const resourceBlacklist = settings.resourceBlacklist || {};
|
|
30
|
-
|
|
31
|
+
const configResourceId = (0, rdf_string_1.termToString)(configResource.term);
|
|
32
|
+
if (resourceBlacklist[configResourceId]) {
|
|
31
33
|
return Promise.reject(new ErrorResourcesContext_1.ErrorResourcesContext(`Circular dependency was detected on ${configResource.value}`, { config: configResource }));
|
|
32
34
|
}
|
|
33
35
|
// Before instantiating, first check if the resource is a variable
|
|
@@ -36,24 +38,24 @@ class ConfigConstructorPool {
|
|
|
36
38
|
.getVariableValue({ settings, variableName: configResource.value }));
|
|
37
39
|
}
|
|
38
40
|
// Instantiate only once
|
|
39
|
-
if (!(
|
|
41
|
+
if (!(configResourceId in this.instances)) {
|
|
40
42
|
// The blacklist avoids infinite recursion for self-referencing configs
|
|
41
43
|
const subBlackList = Object.assign({}, resourceBlacklist);
|
|
42
|
-
subBlackList[
|
|
44
|
+
subBlackList[configResourceId] = true;
|
|
43
45
|
// Prepare instance parameters
|
|
44
46
|
let rawConfig;
|
|
45
47
|
try {
|
|
46
48
|
rawConfig = this.getRawConfig(configResource);
|
|
47
49
|
}
|
|
48
50
|
catch (syncError) {
|
|
49
|
-
this.instances[
|
|
50
|
-
return this.instances[
|
|
51
|
+
this.instances[configResourceId] = Promise.reject(syncError);
|
|
52
|
+
return this.instances[configResourceId];
|
|
51
53
|
}
|
|
52
54
|
const subSettings = Object.assign(Object.assign({}, settings), { resourceBlacklist: subBlackList });
|
|
53
55
|
// Invoke instance creation
|
|
54
|
-
this.instances[
|
|
56
|
+
this.instances[configResourceId] = this.configConstructor.createInstance(rawConfig, subSettings);
|
|
55
57
|
}
|
|
56
|
-
return this.instances[
|
|
58
|
+
return this.instances[configResourceId];
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
59
61
|
* Determine the raw config of the given config.
|
|
@@ -67,9 +69,12 @@ class ConfigConstructorPool {
|
|
|
67
69
|
for (const rawConfigFactory of this.configPreprocessors) {
|
|
68
70
|
const handleResponse = rawConfigFactory.canHandle(config);
|
|
69
71
|
if (handleResponse) {
|
|
70
|
-
const rawConfig = rawConfigFactory.transform(config, handleResponse);
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const { rawConfig, finishTransformation } = rawConfigFactory.transform(config, handleResponse);
|
|
73
|
+
if (finishTransformation) {
|
|
74
|
+
this.validateRawConfig(rawConfig);
|
|
75
|
+
return rawConfig;
|
|
76
|
+
}
|
|
77
|
+
config = rawConfig;
|
|
73
78
|
}
|
|
74
79
|
}
|
|
75
80
|
// If none can handle it, just return the original config
|
|
@@ -106,6 +111,21 @@ class ConfigConstructorPool {
|
|
|
106
111
|
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Invalid config: ${field} "${config.property[field].value}" must be a ${type}, but got ${config.property[field].type}`, { config });
|
|
107
112
|
}
|
|
108
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Returns the instance registry.
|
|
116
|
+
*/
|
|
117
|
+
getInstanceRegistry() {
|
|
118
|
+
return this.instances;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Resets all preprocessors and clears the cached instances.
|
|
122
|
+
*/
|
|
123
|
+
reset() {
|
|
124
|
+
this.instances = {};
|
|
125
|
+
for (const preprocessor of this.configPreprocessors) {
|
|
126
|
+
preprocessor.reset();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
109
129
|
}
|
|
110
130
|
exports.ConfigConstructorPool = ConfigConstructorPool;
|
|
111
131
|
//# sourceMappingURL=ConfigConstructorPool.js.map
|
|
@@ -11,4 +11,14 @@ export interface IConfigConstructorPool<Instance> {
|
|
|
11
11
|
* @returns {any} The run instance.
|
|
12
12
|
*/
|
|
13
13
|
instantiate: (configResource: Resource, settings: IConstructionSettings) => Promise<Instance>;
|
|
14
|
+
/**
|
|
15
|
+
* Return the instance regsitry.
|
|
16
|
+
* This is a hash from registered id to a Promise of the Instance.
|
|
17
|
+
*/
|
|
18
|
+
getInstanceRegistry: () => Record<string, Promise<Instance>>;
|
|
19
|
+
/**
|
|
20
|
+
* Resets any internal state to what it originally was.
|
|
21
|
+
* Used when new components are added inbetween 2 instantiations.
|
|
22
|
+
*/
|
|
23
|
+
reset: () => void;
|
|
14
24
|
}
|
|
@@ -9,6 +9,7 @@ const ConfigConstructorPool_1 = require("../construction/ConfigConstructorPool")
|
|
|
9
9
|
const ConstructionStrategyCommonJs_1 = require("../construction/strategy/ConstructionStrategyCommonJs");
|
|
10
10
|
const ConfigPreprocessorComponent_1 = require("../preprocess/ConfigPreprocessorComponent");
|
|
11
11
|
const ConfigPreprocessorComponentMapped_1 = require("../preprocess/ConfigPreprocessorComponentMapped");
|
|
12
|
+
const ConfigPreprocessorOverride_1 = require("../preprocess/ConfigPreprocessorOverride");
|
|
12
13
|
const ParameterHandler_1 = require("../preprocess/ParameterHandler");
|
|
13
14
|
const ComponentRegistry_1 = require("./ComponentRegistry");
|
|
14
15
|
const ComponentRegistryFinalizer_1 = require("./ComponentRegistryFinalizer");
|
|
@@ -99,6 +100,11 @@ class ComponentsManagerBuilder {
|
|
|
99
100
|
const configConstructorPool = new ConfigConstructorPool_1.ConfigConstructorPool({
|
|
100
101
|
objectLoader,
|
|
101
102
|
configPreprocessors: [
|
|
103
|
+
new ConfigPreprocessorOverride_1.ConfigPreprocessorOverride({
|
|
104
|
+
objectLoader,
|
|
105
|
+
componentResources,
|
|
106
|
+
logger: this.logger,
|
|
107
|
+
}),
|
|
102
108
|
new ConfigPreprocessorComponentMapped_1.ConfigPreprocessorComponentMapped({
|
|
103
109
|
objectLoader,
|
|
104
110
|
runTypeConfigs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Readable } from 'stream';
|
|
3
3
|
import type * as RDF from '@rdfjs/types';
|
|
4
|
-
import type { RdfObjectLoader } from 'rdf-object';
|
|
4
|
+
import type { RdfObjectLoader, Resource } from 'rdf-object';
|
|
5
5
|
import type { Logger } from 'winston';
|
|
6
6
|
import type { IModuleState } from './ModuleStateBuilder';
|
|
7
7
|
/**
|
|
@@ -30,6 +30,11 @@ export declare class ConfigRegistry {
|
|
|
30
30
|
* @param params A dictionary with named parameters.
|
|
31
31
|
*/
|
|
32
32
|
registerCustom(configId: string, componentTypeIri: string, params: Record<string, string>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the instantiated Resource that was registered to the given term.
|
|
35
|
+
* @param term The term of the Resource that was instantiated
|
|
36
|
+
*/
|
|
37
|
+
getInstantiatedResource(term: RDF.Term): Resource;
|
|
33
38
|
}
|
|
34
39
|
export interface IConfigLoaderRegistryOptions {
|
|
35
40
|
moduleState: IModuleState;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfigRegistry = void 0;
|
|
4
|
+
const rdf_string_1 = require("rdf-string");
|
|
4
5
|
const RdfParser_1 = require("../rdf/RdfParser");
|
|
5
6
|
/**
|
|
6
7
|
* Accepts registrations for configurations that contain instantiations of components.
|
|
@@ -50,6 +51,13 @@ class ConfigRegistry {
|
|
|
50
51
|
configResource.property[key] = this.objectLoader.createCompactedResource(`"${params[key]}"`);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the instantiated Resource that was registered to the given term.
|
|
56
|
+
* @param term The term of the Resource that was instantiated
|
|
57
|
+
*/
|
|
58
|
+
getInstantiatedResource(term) {
|
|
59
|
+
return this.objectLoader.resources[(0, rdf_string_1.termToString)(term)];
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
exports.ConfigRegistry = ConfigRegistry;
|
|
55
63
|
//# sourceMappingURL=ConfigRegistry.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Resource, RdfObjectLoader } from 'rdf-object';
|
|
2
2
|
import type { Logger } from 'winston';
|
|
3
3
|
import { GenericsContext } from './GenericsContext';
|
|
4
|
-
import type { IConfigPreprocessor } from './IConfigPreprocessor';
|
|
4
|
+
import type { IConfigPreprocessorTransform, IConfigPreprocessor } from './IConfigPreprocessor';
|
|
5
5
|
import type { ParameterHandler } from './ParameterHandler';
|
|
6
6
|
/**
|
|
7
7
|
* Handles config that refer to a component as type.
|
|
@@ -15,7 +15,7 @@ export declare class ConfigPreprocessorComponent implements IConfigPreprocessor<
|
|
|
15
15
|
protected readonly logger: Logger;
|
|
16
16
|
constructor(options: IComponentConfigPreprocessorOptions);
|
|
17
17
|
canHandle(config: Resource): IComponentConfigPreprocessorHandleResponse | undefined;
|
|
18
|
-
transform(config: Resource, handleResponse: IComponentConfigPreprocessorHandleResponse):
|
|
18
|
+
transform(config: Resource, handleResponse: IComponentConfigPreprocessorHandleResponse): IConfigPreprocessorTransform;
|
|
19
19
|
protected createGenericsContext(handleResponse: IComponentConfigPreprocessorHandleResponse, config: Resource): GenericsContext;
|
|
20
20
|
/**
|
|
21
21
|
* Determine the constructor arguments of the given config.
|
|
@@ -43,6 +43,7 @@ export declare class ConfigPreprocessorComponent implements IConfigPreprocessor<
|
|
|
43
43
|
* @param handleResponse The handle response.
|
|
44
44
|
*/
|
|
45
45
|
validateConfig(config: Resource, handleResponse: IComponentConfigPreprocessorHandleResponse): void;
|
|
46
|
+
reset(): void;
|
|
46
47
|
}
|
|
47
48
|
export interface IComponentConfigPreprocessorOptions {
|
|
48
49
|
objectLoader: RdfObjectLoader;
|
|
@@ -86,7 +86,7 @@ class ConfigPreprocessorComponent {
|
|
|
86
86
|
configRaw.property.arguments = this.transformConstructorArguments(config, handleResponse);
|
|
87
87
|
// Validate the input config
|
|
88
88
|
this.validateConfig(config, handleResponse);
|
|
89
|
-
return configRaw;
|
|
89
|
+
return { rawConfig: configRaw, finishTransformation: true };
|
|
90
90
|
}
|
|
91
91
|
createGenericsContext(handleResponse, config) {
|
|
92
92
|
// Create a new generics context for the component's generic type parameters
|
|
@@ -245,6 +245,9 @@ class ConfigPreprocessorComponent {
|
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
+
reset() {
|
|
249
|
+
// There is nothing to reset here
|
|
250
|
+
}
|
|
248
251
|
}
|
|
249
252
|
exports.ConfigPreprocessorComponent = ConfigPreprocessorComponent;
|
|
250
253
|
//# sourceMappingURL=ConfigPreprocessorComponent.js.map
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { Resource } from 'rdf-object';
|
|
2
|
+
import type { RdfObjectLoader } from 'rdf-object/lib/RdfObjectLoader';
|
|
3
|
+
import type { Logger } from 'winston';
|
|
4
|
+
import type { IConfigPreprocessor, IConfigPreprocessorTransform } from './IConfigPreprocessor';
|
|
5
|
+
/**
|
|
6
|
+
* An {@link IConfigPreprocessor} that handles the overriding of parameters.
|
|
7
|
+
* Values in the given {@link Resource}s will be replaced if any overriding object is found,
|
|
8
|
+
* targeting this resource.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ConfigPreprocessorOverride implements IConfigPreprocessor<Record<string, Resource>> {
|
|
11
|
+
readonly objectLoader: RdfObjectLoader;
|
|
12
|
+
readonly componentResources: Record<string, Resource>;
|
|
13
|
+
readonly logger: Logger;
|
|
14
|
+
private overrides;
|
|
15
|
+
constructor(options: IComponentConfigPreprocessorOverrideOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Checks if there are any overrides targeting the given resource.
|
|
18
|
+
* @param config - Resource to find overrides for.
|
|
19
|
+
*
|
|
20
|
+
* @returns A key/value object with keys being the properties that have an override.
|
|
21
|
+
*/
|
|
22
|
+
canHandle(config: Resource): Record<string, Resource> | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Override the resource with the stored values.
|
|
25
|
+
* @param config - The resource to override.
|
|
26
|
+
* @param handleResponse - Override values that were found for this resource.
|
|
27
|
+
*/
|
|
28
|
+
transform(config: Resource, handleResponse: Record<string, Resource>): IConfigPreprocessorTransform;
|
|
29
|
+
/**
|
|
30
|
+
* Clear all cached overrides so they will be calculated again on the next call.
|
|
31
|
+
*/
|
|
32
|
+
reset(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Generates a cache of all overrides found in the object loader.
|
|
35
|
+
* Keys of the object are the identifiers of the resources that need to be modified,
|
|
36
|
+
* values are key/value maps listing all parameters with their new values.
|
|
37
|
+
*/
|
|
38
|
+
createOverrideObjects(): Record<string, Record<string, Resource>>;
|
|
39
|
+
/**
|
|
40
|
+
* Finds all Override resources in the object loader and links them to their target resource.
|
|
41
|
+
*/
|
|
42
|
+
protected findOverrideTargets(): Iterable<{
|
|
43
|
+
override: Resource;
|
|
44
|
+
target: Resource;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Chains all Overrides together if they reference each other.
|
|
48
|
+
* E.g., if the input is a list of Overrides A -> B, B -> C, D -> E,
|
|
49
|
+
* the result wil be [[ A, B, C ], [ D, E ]].
|
|
50
|
+
*
|
|
51
|
+
* @param overrides - All Overrides that have to be combined.
|
|
52
|
+
*/
|
|
53
|
+
protected createOverrideChains(overrides: {
|
|
54
|
+
override: Resource;
|
|
55
|
+
target: Resource;
|
|
56
|
+
}[]): Resource[][];
|
|
57
|
+
/**
|
|
58
|
+
* Throws an error in case there are 2 chains targeting the same resource.
|
|
59
|
+
* @param chains - The override chains to check.
|
|
60
|
+
*/
|
|
61
|
+
protected validateChains(chains: Resource[][]): void;
|
|
62
|
+
/**
|
|
63
|
+
* Merges all Overrides in a chain to create a single override object
|
|
64
|
+
* containing replacement values for all relevant parameters of the final entry in the chain.
|
|
65
|
+
*
|
|
66
|
+
* @param chain - The chain of Overrides, with a normal resource as the last entry in the array.
|
|
67
|
+
*/
|
|
68
|
+
protected chainToOverrideObject(chain: Resource[]): {
|
|
69
|
+
target: string;
|
|
70
|
+
values: Record<string, Resource>;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Finds the final target and its type in an override chain.
|
|
74
|
+
* @param chain - The chain to find the target of.
|
|
75
|
+
*/
|
|
76
|
+
protected getChainTarget(chain: Resource[]): {
|
|
77
|
+
target: Resource;
|
|
78
|
+
type: Resource;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Extracts all relevant parameters of an Override with their corresponding new value.
|
|
82
|
+
* @param override - The Override to apply.
|
|
83
|
+
* @param target - The target resource to apply the Override to.
|
|
84
|
+
* @param parameters - The parameters that are relevant for the target.
|
|
85
|
+
*/
|
|
86
|
+
protected filterOverrideObject(override: Resource, target: Resource, parameters: Resource[]): Record<string, Resource>;
|
|
87
|
+
}
|
|
88
|
+
export interface IComponentConfigPreprocessorOverrideOptions {
|
|
89
|
+
objectLoader: RdfObjectLoader;
|
|
90
|
+
componentResources: Record<string, Resource>;
|
|
91
|
+
logger: Logger;
|
|
92
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigPreprocessorOverride = void 0;
|
|
4
|
+
const ErrorResourcesContext_1 = require("../util/ErrorResourcesContext");
|
|
5
|
+
/**
|
|
6
|
+
* An {@link IConfigPreprocessor} that handles the overriding of parameters.
|
|
7
|
+
* Values in the given {@link Resource}s will be replaced if any overriding object is found,
|
|
8
|
+
* targeting this resource.
|
|
9
|
+
*/
|
|
10
|
+
class ConfigPreprocessorOverride {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this.objectLoader = options.objectLoader;
|
|
13
|
+
this.componentResources = options.componentResources;
|
|
14
|
+
this.logger = options.logger;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Checks if there are any overrides targeting the given resource.
|
|
18
|
+
* @param config - Resource to find overrides for.
|
|
19
|
+
*
|
|
20
|
+
* @returns A key/value object with keys being the properties that have an override.
|
|
21
|
+
*/
|
|
22
|
+
canHandle(config) {
|
|
23
|
+
if (!this.overrides) {
|
|
24
|
+
this.overrides = this.createOverrideObjects();
|
|
25
|
+
}
|
|
26
|
+
return this.overrides[config.value];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Override the resource with the stored values.
|
|
30
|
+
* @param config - The resource to override.
|
|
31
|
+
* @param handleResponse - Override values that were found for this resource.
|
|
32
|
+
*/
|
|
33
|
+
transform(config, handleResponse) {
|
|
34
|
+
for (const id of Object.keys(config.properties)) {
|
|
35
|
+
const overrideValue = handleResponse[id];
|
|
36
|
+
if (overrideValue) {
|
|
37
|
+
config.properties[id] = [overrideValue];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { rawConfig: config, finishTransformation: false };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Clear all cached overrides so they will be calculated again on the next call.
|
|
44
|
+
*/
|
|
45
|
+
reset() {
|
|
46
|
+
this.overrides = undefined;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generates a cache of all overrides found in the object loader.
|
|
50
|
+
* Keys of the object are the identifiers of the resources that need to be modified,
|
|
51
|
+
* values are key/value maps listing all parameters with their new values.
|
|
52
|
+
*/
|
|
53
|
+
createOverrideObjects() {
|
|
54
|
+
const overrides = [...this.findOverrideTargets()];
|
|
55
|
+
const chains = this.createOverrideChains(overrides);
|
|
56
|
+
this.validateChains(chains);
|
|
57
|
+
const overrideObjects = {};
|
|
58
|
+
for (const chain of chains) {
|
|
59
|
+
const { target, values } = this.chainToOverrideObject(chain);
|
|
60
|
+
if (Object.keys(values).length > 0) {
|
|
61
|
+
overrideObjects[target] = values;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return overrideObjects;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Finds all Override resources in the object loader and links them to their target resource.
|
|
68
|
+
*/
|
|
69
|
+
*findOverrideTargets() {
|
|
70
|
+
const overrideUri = this.objectLoader.contextResolved.expandTerm('oo:Override');
|
|
71
|
+
const overrideInstanceUri = this.objectLoader.contextResolved.expandTerm('oo:overrideInstance');
|
|
72
|
+
for (const [id, resource] of Object.entries(this.objectLoader.resources)) {
|
|
73
|
+
if (resource.isA(overrideUri) && resource.value !== overrideUri) {
|
|
74
|
+
const targets = resource.properties[overrideInstanceUri];
|
|
75
|
+
if (!targets || targets.length === 0) {
|
|
76
|
+
this.logger.warn(`Missing overrideInstance for ${id}. This Override will be ignored.`);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (targets.length > 1) {
|
|
80
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Detected multiple overrideInstance targets for ${id}`, {
|
|
81
|
+
override: resource,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
yield { override: resource, target: targets[0] };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Chains all Overrides together if they reference each other.
|
|
90
|
+
* E.g., if the input is a list of Overrides A -> B, B -> C, D -> E,
|
|
91
|
+
* the result wil be [[ A, B, C ], [ D, E ]].
|
|
92
|
+
*
|
|
93
|
+
* @param overrides - All Overrides that have to be combined.
|
|
94
|
+
*/
|
|
95
|
+
createOverrideChains(overrides) {
|
|
96
|
+
// Start by creating small chains: from each override to its immediate target
|
|
97
|
+
const overrideChains = Object.fromEntries(overrides.map(({ override, target }) => [override.value, [override, target]]));
|
|
98
|
+
// Then keep combining those smaller chains into bigger chains until they are complete.
|
|
99
|
+
// If there is an override cycle (A -> B -> ... -> A) it will delete itself from the list of chains here.
|
|
100
|
+
let change = true;
|
|
101
|
+
while (change) {
|
|
102
|
+
change = false;
|
|
103
|
+
for (const [id, chain] of Object.entries(overrideChains)) {
|
|
104
|
+
let next = chain[chain.length - 1];
|
|
105
|
+
// If the next part of the chain is found in `overrideChains` we can merge them and remove the tail entry
|
|
106
|
+
while (overrideChains[next.value]) {
|
|
107
|
+
change = true;
|
|
108
|
+
const nextChain = overrideChains[next.value];
|
|
109
|
+
// First element of nextChain will be equal to last element of this chain
|
|
110
|
+
overrideChains[id].push(...nextChain.slice(1));
|
|
111
|
+
// In case of a cycle there will be a point where next equals the first element,
|
|
112
|
+
// at which point it will delete itself.
|
|
113
|
+
delete overrideChains[next.value];
|
|
114
|
+
next = chain[chain.length - 1];
|
|
115
|
+
}
|
|
116
|
+
// Reset the loop since we are modifying the object we are iterating over
|
|
117
|
+
if (change) {
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return Object.values(overrideChains);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Throws an error in case there are 2 chains targeting the same resource.
|
|
126
|
+
* @param chains - The override chains to check.
|
|
127
|
+
*/
|
|
128
|
+
validateChains(chains) {
|
|
129
|
+
const targets = chains.map((chain) => chain[chain.length - 1].value);
|
|
130
|
+
for (let i = 0; i < targets.length; ++i) {
|
|
131
|
+
const duplicateIdx = targets.findIndex((target, idx) => idx > i && target === targets[i]);
|
|
132
|
+
if (duplicateIdx > 0) {
|
|
133
|
+
const target = chains[i][chains[i].length - 1];
|
|
134
|
+
const duplicate1 = chains[i][chains[i].length - 2];
|
|
135
|
+
const duplicate2 = chains[duplicateIdx][chains[duplicateIdx].length - 2];
|
|
136
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Found multiple Overrides targeting ${targets[i]}`, {
|
|
137
|
+
target,
|
|
138
|
+
overrides: [duplicate1, duplicate2],
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Merges all Overrides in a chain to create a single override object
|
|
145
|
+
* containing replacement values for all relevant parameters of the final entry in the chain.
|
|
146
|
+
*
|
|
147
|
+
* @param chain - The chain of Overrides, with a normal resource as the last entry in the array.
|
|
148
|
+
*/
|
|
149
|
+
chainToOverrideObject(chain) {
|
|
150
|
+
const { target, type } = this.getChainTarget(chain);
|
|
151
|
+
// Apply all overrides sequentially, starting from the one closest to the target.
|
|
152
|
+
// This ensures the most recent override has priority.
|
|
153
|
+
const parameters = this.componentResources[type.value].properties.parameters;
|
|
154
|
+
const mergedOverride = {};
|
|
155
|
+
for (let i = chain.length - 2; i >= 0; --i) {
|
|
156
|
+
const filteredObject = this.filterOverrideObject(chain[i], target, parameters);
|
|
157
|
+
Object.assign(mergedOverride, filteredObject);
|
|
158
|
+
}
|
|
159
|
+
return { target: target.value, values: mergedOverride };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Finds the final target and its type in an override chain.
|
|
163
|
+
* @param chain - The chain to find the target of.
|
|
164
|
+
*/
|
|
165
|
+
getChainTarget(chain) {
|
|
166
|
+
const rdfTypeUri = this.objectLoader.contextResolved.expandTerm('rdf:type');
|
|
167
|
+
const target = chain[chain.length - 1];
|
|
168
|
+
const types = target.properties[rdfTypeUri];
|
|
169
|
+
if (!types || types.length === 0) {
|
|
170
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Missing type for override target ${target.value} of Override ${chain[chain.length - 2].value}`, {
|
|
171
|
+
target,
|
|
172
|
+
override: chain[chain.length - 2],
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (types.length > 1) {
|
|
176
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Found multiple types for override target ${target.value} of Override ${chain[chain.length - 2].value}`, {
|
|
177
|
+
target,
|
|
178
|
+
override: chain[chain.length - 2],
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
return { target, type: types[0] };
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Extracts all relevant parameters of an Override with their corresponding new value.
|
|
185
|
+
* @param override - The Override to apply.
|
|
186
|
+
* @param target - The target resource to apply the Override to.
|
|
187
|
+
* @param parameters - The parameters that are relevant for the target.
|
|
188
|
+
*/
|
|
189
|
+
filterOverrideObject(override, target, parameters) {
|
|
190
|
+
const overrideParametersUri = this.objectLoader.contextResolved.expandTerm('oo:overrideParameters');
|
|
191
|
+
const overrideObjects = override.properties[overrideParametersUri];
|
|
192
|
+
if (!overrideObjects || overrideObjects.length === 0) {
|
|
193
|
+
this.logger.warn(`No overrideParameters found for ${override.value}.`);
|
|
194
|
+
return {};
|
|
195
|
+
}
|
|
196
|
+
if (overrideObjects.length > 1) {
|
|
197
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Detected multiple values for overrideParameters in Override ${override.value}`, {
|
|
198
|
+
override,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
const overrideObject = overrideObjects[0];
|
|
202
|
+
// Only keep the parameters that are known to the type of the target object
|
|
203
|
+
const filteredObject = {};
|
|
204
|
+
for (const parameter of parameters) {
|
|
205
|
+
const overrideValues = overrideObject.properties[parameter.value];
|
|
206
|
+
if (!overrideValues || overrideValues.length === 0) {
|
|
207
|
+
continue;
|
|
208
|
+
}
|
|
209
|
+
if (overrideValues.length > 1) {
|
|
210
|
+
throw new ErrorResourcesContext_1.ErrorResourcesContext(`Detected multiple values for override parameter ${parameter.value} in Override ${override.value}. RDF lists should be used for defining multiple values.`, {
|
|
211
|
+
arguments: overrideValues,
|
|
212
|
+
target,
|
|
213
|
+
override,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
filteredObject[parameter.value] = overrideValues[0];
|
|
217
|
+
}
|
|
218
|
+
return filteredObject;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.ConfigPreprocessorOverride = ConfigPreprocessorOverride;
|
|
222
|
+
//# sourceMappingURL=ConfigPreprocessorOverride.js.map
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { Resource } from 'rdf-object';
|
|
2
|
+
export interface IConfigPreprocessorTransform {
|
|
3
|
+
/**
|
|
4
|
+
* If the result is final or other preprocessors are allowed to continue.
|
|
5
|
+
*/
|
|
6
|
+
finishTransformation: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The result of the transform.
|
|
9
|
+
*/
|
|
10
|
+
rawConfig: Resource;
|
|
11
|
+
}
|
|
2
12
|
/**
|
|
3
13
|
* Transforms an enhanced config of a certain form into a raw config
|
|
4
14
|
* so that it can be instantiated by {@link ConfigConstructor}.
|
|
@@ -14,5 +24,10 @@ export interface IConfigPreprocessor<HR> {
|
|
|
14
24
|
* @param config Config to transform.
|
|
15
25
|
* @param handleResponse Return value of the {#canHandle}.
|
|
16
26
|
*/
|
|
17
|
-
transform: (config: Resource, handleResponse: HR) =>
|
|
27
|
+
transform: (config: Resource, handleResponse: HR) => IConfigPreprocessorTransform;
|
|
28
|
+
/**
|
|
29
|
+
* Resets any internal state to what it originally was.
|
|
30
|
+
* Used when new components are added inbetween 2 instantiations.
|
|
31
|
+
*/
|
|
32
|
+
reset: () => void;
|
|
18
33
|
}
|
|
@@ -33,6 +33,11 @@ export declare class ParameterPropertyHandlerRange implements IParameterProperty
|
|
|
33
33
|
* @return IParamValueConflict A conflict value if there was an error, or undefined if there was no error
|
|
34
34
|
*/
|
|
35
35
|
hasValueType(value: Resource | undefined, type: Resource | undefined, errorContext: IErrorContext, genericsContext: GenericsContext): IParamValueConflict | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Utility function for handling Literals.
|
|
38
|
+
* If the provided value represents a valid Literal, the `valueRaw` field will be set.
|
|
39
|
+
*/
|
|
40
|
+
private interpretValueAsType;
|
|
36
41
|
static throwIncorrectTypeError(value: Resource | undefined, parameter: Resource, genericsContext: GenericsContext, conflict: IParamValueConflict): never;
|
|
37
42
|
/**
|
|
38
43
|
* Check if the given value is of the given type.
|
|
@@ -54,3 +59,13 @@ export interface IParamValueConflict {
|
|
|
54
59
|
context: IErrorContext;
|
|
55
60
|
causes?: IParamValueConflict[];
|
|
56
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Represents the result of an interpretValuesAsType operation.
|
|
64
|
+
*/
|
|
65
|
+
export interface ILiteralAsTypeInterpretationResult {
|
|
66
|
+
/**
|
|
67
|
+
* Value is true if a matching literal type was found.
|
|
68
|
+
*/
|
|
69
|
+
match: boolean;
|
|
70
|
+
value?: IParamValueConflict;
|
|
71
|
+
}
|
|
@@ -53,6 +53,11 @@ class ParameterPropertyHandlerRange {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
if (type.isA('ParameterRangeWildcard')) {
|
|
56
|
+
if (value && value.term.termType === 'Literal') {
|
|
57
|
+
// Get datatype of the configured value
|
|
58
|
+
const configuredDataType = value.term.datatype;
|
|
59
|
+
return this.interpretValueAsType(value, configuredDataType, errorContext, genericsContext).value;
|
|
60
|
+
}
|
|
56
61
|
return;
|
|
57
62
|
}
|
|
58
63
|
if (!value && type.isA('ParameterRangeUndefined')) {
|
|
@@ -64,69 +69,10 @@ class ParameterPropertyHandlerRange {
|
|
|
64
69
|
}
|
|
65
70
|
// Handle literal values
|
|
66
71
|
if (value && value.type === 'Literal') {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
case Iris_1.IRIS_XSD.boolean:
|
|
72
|
-
if (value.value === 'true') {
|
|
73
|
-
value.term.valueRaw = true;
|
|
74
|
-
}
|
|
75
|
-
else if (value.value === 'false') {
|
|
76
|
-
value.term.valueRaw = false;
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
return {
|
|
80
|
-
description: 'value must either be "true" or "false"',
|
|
81
|
-
context: errorContext,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
return;
|
|
85
|
-
case Iris_1.IRIS_XSD.integer:
|
|
86
|
-
case Iris_1.IRIS_XSD.number:
|
|
87
|
-
case Iris_1.IRIS_XSD.int:
|
|
88
|
-
case Iris_1.IRIS_XSD.byte:
|
|
89
|
-
case Iris_1.IRIS_XSD.long:
|
|
90
|
-
parsed = Number.parseInt(value.value, 10);
|
|
91
|
-
if (Number.isNaN(parsed)) {
|
|
92
|
-
return {
|
|
93
|
-
description: `value is not a number`,
|
|
94
|
-
context: errorContext,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
// ParseInt also parses floats to ints!
|
|
98
|
-
if (String(parsed) !== value.value) {
|
|
99
|
-
return {
|
|
100
|
-
description: `value can not be a float`,
|
|
101
|
-
context: errorContext,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
value.term.valueRaw = parsed;
|
|
105
|
-
return;
|
|
106
|
-
case Iris_1.IRIS_XSD.float:
|
|
107
|
-
case Iris_1.IRIS_XSD.decimal:
|
|
108
|
-
case Iris_1.IRIS_XSD.double:
|
|
109
|
-
parsed = Number.parseFloat(value.value);
|
|
110
|
-
if (Number.isNaN(parsed)) {
|
|
111
|
-
return {
|
|
112
|
-
description: `value is not a number`,
|
|
113
|
-
context: errorContext,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
value.term.valueRaw = parsed;
|
|
117
|
-
return;
|
|
118
|
-
case Iris_1.IRIS_RDF.JSON:
|
|
119
|
-
try {
|
|
120
|
-
parsed = JSON.parse(value.value);
|
|
121
|
-
value.term.valueRaw = parsed;
|
|
122
|
-
}
|
|
123
|
-
catch (error) {
|
|
124
|
-
return {
|
|
125
|
-
description: `JSON parse exception: ${error.message}`,
|
|
126
|
-
context: errorContext,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
return;
|
|
72
|
+
const result = this.interpretValueAsType(value, type, errorContext, genericsContext);
|
|
73
|
+
if (result.match) {
|
|
74
|
+
// Stop processing and return (with a possible IParamValueConflict) if a match was found.
|
|
75
|
+
return result.value;
|
|
130
76
|
}
|
|
131
77
|
}
|
|
132
78
|
// Allow IRIs to be casted to strings
|
|
@@ -359,6 +305,93 @@ class ParameterPropertyHandlerRange {
|
|
|
359
305
|
}
|
|
360
306
|
return hasTypeConflict || { description: 'unknown parameter type', context: errorContext };
|
|
361
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Utility function for handling Literals.
|
|
310
|
+
* If the provided value represents a valid Literal, the `valueRaw` field will be set.
|
|
311
|
+
*/
|
|
312
|
+
interpretValueAsType(value, type, errorContext, genericsContext) {
|
|
313
|
+
let parsed;
|
|
314
|
+
switch (type.value) {
|
|
315
|
+
case Iris_1.IRIS_XSD.string:
|
|
316
|
+
return { match: true };
|
|
317
|
+
case Iris_1.IRIS_XSD.boolean:
|
|
318
|
+
if (value.value === 'true') {
|
|
319
|
+
value.term.valueRaw = true;
|
|
320
|
+
}
|
|
321
|
+
else if (value.value === 'false') {
|
|
322
|
+
value.term.valueRaw = false;
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
return {
|
|
326
|
+
match: true,
|
|
327
|
+
value: {
|
|
328
|
+
description: 'value must either be "true" or "false"',
|
|
329
|
+
context: errorContext,
|
|
330
|
+
},
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
return { match: true };
|
|
334
|
+
case Iris_1.IRIS_XSD.integer:
|
|
335
|
+
case Iris_1.IRIS_XSD.number:
|
|
336
|
+
case Iris_1.IRIS_XSD.int:
|
|
337
|
+
case Iris_1.IRIS_XSD.byte:
|
|
338
|
+
case Iris_1.IRIS_XSD.long:
|
|
339
|
+
parsed = Number.parseInt(value.value, 10);
|
|
340
|
+
if (Number.isNaN(parsed)) {
|
|
341
|
+
return {
|
|
342
|
+
match: true,
|
|
343
|
+
value: {
|
|
344
|
+
description: `value is not a number`,
|
|
345
|
+
context: errorContext,
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
// ParseInt also parses floats to ints!
|
|
350
|
+
if (String(parsed) !== value.value) {
|
|
351
|
+
return {
|
|
352
|
+
match: true,
|
|
353
|
+
value: {
|
|
354
|
+
description: `value can not be a float`,
|
|
355
|
+
context: errorContext,
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
value.term.valueRaw = parsed;
|
|
360
|
+
return { match: true };
|
|
361
|
+
case Iris_1.IRIS_XSD.float:
|
|
362
|
+
case Iris_1.IRIS_XSD.decimal:
|
|
363
|
+
case Iris_1.IRIS_XSD.double:
|
|
364
|
+
parsed = Number.parseFloat(value.value);
|
|
365
|
+
if (Number.isNaN(parsed)) {
|
|
366
|
+
return {
|
|
367
|
+
match: true,
|
|
368
|
+
value: {
|
|
369
|
+
description: `value is not a number`,
|
|
370
|
+
context: errorContext,
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
value.term.valueRaw = parsed;
|
|
375
|
+
return { match: true };
|
|
376
|
+
case Iris_1.IRIS_RDF.JSON:
|
|
377
|
+
try {
|
|
378
|
+
parsed = JSON.parse(value.value);
|
|
379
|
+
value.term.valueRaw = parsed;
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
return {
|
|
383
|
+
match: true,
|
|
384
|
+
value: {
|
|
385
|
+
description: `JSON parse exception: ${error.message}`,
|
|
386
|
+
context: errorContext,
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
return { match: true };
|
|
391
|
+
default:
|
|
392
|
+
return { match: false };
|
|
393
|
+
}
|
|
394
|
+
}
|
|
362
395
|
static throwIncorrectTypeError(value, parameter, genericsContext, conflict) {
|
|
363
396
|
const withTypes = value && value.properties.types.length > 0 ? ` with types "${value.properties.types.map(resource => resource.value)}"` : '';
|
|
364
397
|
// eslint-disable-next-line @typescript-eslint/no-extra-parens
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "componentsjs",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "A semantic dependency injection framework",
|
|
5
5
|
"lsd:contexts": {
|
|
6
6
|
"https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^5.0.0/components/context.jsonld": "components/context.jsonld"
|
|
@@ -43,15 +43,16 @@
|
|
|
43
43
|
"rdf-object": "^1.13.1",
|
|
44
44
|
"rdf-parse": "^2.0.0",
|
|
45
45
|
"rdf-quad": "^1.5.0",
|
|
46
|
+
"rdf-string": "^1.6.0",
|
|
46
47
|
"rdf-terms": "^1.7.0",
|
|
47
48
|
"semver": "^7.3.2",
|
|
48
49
|
"winston": "^3.3.3"
|
|
49
50
|
},
|
|
50
51
|
"devDependencies": {
|
|
51
52
|
"@rubensworks/eslint-config": "^1.0.1",
|
|
53
|
+
"@types/jest": "^27.0.0",
|
|
52
54
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
53
55
|
"@typescript-eslint/parser": "^5.0.0",
|
|
54
|
-
"@types/jest": "^27.0.0",
|
|
55
56
|
"eslint": "^7.12.1",
|
|
56
57
|
"eslint-config-es": "3.25.3",
|
|
57
58
|
"eslint-import-resolver-typescript": "^2.3.0",
|
package/CHANGELOG.md
DELETED
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
All notable changes to this project will be documented in this file.
|
|
3
|
-
|
|
4
|
-
<a name="v5.0.1"></a>
|
|
5
|
-
## [v5.0.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0...v5.0.1) - 2022-03-02
|
|
6
|
-
|
|
7
|
-
### Changed
|
|
8
|
-
* [Bump to rdf-parse 2](https://github.com/LinkedSoftwareDependencies/Components.js/commit/5957c21d9ea0d8e6086be09d67ee99e64f8b2960)
|
|
9
|
-
|
|
10
|
-
<a name="v5.0.0"></a>
|
|
11
|
-
## [v5.0.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.7...v5.0.0) - 2022-03-01
|
|
12
|
-
|
|
13
|
-
### Changed
|
|
14
|
-
* [Bump context URL to 5.0.0](https://github.com/LinkedSoftwareDependencies/Components.js/commit/495654fa70f559aaaa86a0960686fd1ca23f9546)
|
|
15
|
-
* [Add incorrect version number as possible cause for remote lookup failure (#67)](https://github.com/LinkedSoftwareDependencies/Components.js/commit/adf1d7e092b95a2fc47c7d2da3dfe191fdb741aa)
|
|
16
|
-
|
|
17
|
-
<a name="v5.0.0-beta.7"></a>
|
|
18
|
-
## [v5.0.0-beta.7](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.6...v5.0.0-beta.7) - 2022-02-21
|
|
19
|
-
|
|
20
|
-
### Changed
|
|
21
|
-
* [Lower log level of empty modules to debug](https://github.com/LinkedSoftwareDependencies/Components.js/commit/df119861bc12992e05af05b42f0a734069de6915)
|
|
22
|
-
* [Bump to rdf-object 1.13.1](https://github.com/LinkedSoftwareDependencies/Components.js/commit/264be522079f86bd47bea9fe5730eaed29bbe450)
|
|
23
|
-
|
|
24
|
-
### Fixed
|
|
25
|
-
* [Fix incorrect error logging when generics error occurs in extends clause](https://github.com/LinkedSoftwareDependencies/Components.js/commit/1ce62d39896ca498ecba7443c9c7c298c9db0301)
|
|
26
|
-
* [Fix minor context issues](https://github.com/LinkedSoftwareDependencies/Components.js/commit/7adcd5fe0de73a42c8225069752be40214f843f3)
|
|
27
|
-
|
|
28
|
-
<a name="v5.0.0-beta.6"></a>
|
|
29
|
-
## [v5.0.0-beta.6](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.5...v5.0.0-beta.6) - 2022-02-09
|
|
30
|
-
|
|
31
|
-
### Fixed
|
|
32
|
-
* [Fix generic errors still throwing during ignored type checking](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c14adcf4757e5194db22c0f0285407bd03bf5635)
|
|
33
|
-
|
|
34
|
-
<a name="v5.0.0-beta.5"></a>
|
|
35
|
-
## [v5.0.0-beta.5](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.4...v5.0.0-beta.5) - 2022-02-08
|
|
36
|
-
|
|
37
|
-
### Added
|
|
38
|
-
* [Allow type-checking to be disabled via typeChecking](https://github.com/LinkedSoftwareDependencies/Components.js/commit/a55331085e4c5621832e6b23bc52b00068e8256a)
|
|
39
|
-
|
|
40
|
-
### Changed
|
|
41
|
-
* [Throw error on circular dependencies, Closes #53](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e7a28d1cf87d96d5b58bb6d1f19ce41d6e55aab6)
|
|
42
|
-
|
|
43
|
-
### Fixed
|
|
44
|
-
* [Fix seeAlso links not handling encoded URI components, Closes #43](https://github.com/LinkedSoftwareDependencies/Components.js/commit/2b72914d2720b2982d4570af55f9b5d7dc196c27)
|
|
45
|
-
|
|
46
|
-
<a name="v5.0.0-beta.4"></a>
|
|
47
|
-
## [v5.0.0-beta.4](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.3...v5.0.0-beta.4) - 2022-01-29
|
|
48
|
-
|
|
49
|
-
### Added
|
|
50
|
-
* [Support ParameterRangeIndexed for fixed literals](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0d97782a4a8dcca9fc5bbb3389a4213eca5a5205)
|
|
51
|
-
|
|
52
|
-
### Changed
|
|
53
|
-
* [Propagate original error messages to require calls, Closes #65](https://github.com/LinkedSoftwareDependencies/Components.js/commit/8934ec9b784def601730b3d3f2e60c4ff0b8776e)
|
|
54
|
-
* [Include config id in invalid param error message](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e724f44e2222eb9917da3b227e2ce0dc9cde15f9)
|
|
55
|
-
* [Update memberKeys to memberFields](https://github.com/LinkedSoftwareDependencies/Components.js/commit/2c7437e1519c1813fb1a29f50d7c20bdbdf7f06e)
|
|
56
|
-
|
|
57
|
-
<a name="v5.0.0-beta.3"></a>
|
|
58
|
-
## [v5.0.0-beta.3](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.2...v5.0.0-beta.3) - 2022-01-17
|
|
59
|
-
|
|
60
|
-
### Added
|
|
61
|
-
* [Add support for wildcard parameter ranges](https://github.com/LinkedSoftwareDependencies/Components.js/commit/83238a9fa08877f29326be562d7d3d5fff860c69)
|
|
62
|
-
* Improve error reporting:
|
|
63
|
-
* [Add causes for param check failures in error messages](https://github.com/LinkedSoftwareDependencies/Components.js/commit/9be1fd0899ffb8a77ea99e5fb86e661526ef6d1a)
|
|
64
|
-
* [Improve error message on invalid generic type instantiations](https://github.com/LinkedSoftwareDependencies/Components.js/commit/6ecb9798eeb84f09fece68b3a47454fa8c857ba4)
|
|
65
|
-
* [Move error context to error state file](https://github.com/LinkedSoftwareDependencies/Components.js/commit/dbf26e072bdc63168814ef4d503777efaf4745eb)
|
|
66
|
-
|
|
67
|
-
### Fixed
|
|
68
|
-
* Resolve several issues related to generics:
|
|
69
|
-
* [Throw error on invalid ParameterRangeGenericComponent](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c692ab6175ce466fb32fbe38b973644e2601b2e6)
|
|
70
|
-
* [Fix generic components not accepting specific types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c7739182fddcb92d46a86fe3e33d6e29fd1134b6)
|
|
71
|
-
* [Support generic type instantiation during component extension](https://github.com/LinkedSoftwareDependencies/Components.js/commit/98f70e350cc3f9bf8a4ea632db546f74624ddda7)
|
|
72
|
-
* [Support generic components in params with fixed generics](https://github.com/LinkedSoftwareDependencies/Components.js/commit/d8b30972e1306e9fe9db391d4693aa6000917e60)
|
|
73
|
-
* [Use GenericComponentExtension to refer to wrapped generic comp extensions](https://github.com/LinkedSoftwareDependencies/Components.js/commit/239895accfdb7f09a7ac8454928bd3e0be5e5f15)
|
|
74
|
-
* [Fix invalid range display with multiple generics](https://github.com/LinkedSoftwareDependencies/Components.js/commit/b98baf0bcf4546b60299ae548f929693345292bc)
|
|
75
|
-
* [Handle range merging if left or right is union](https://github.com/LinkedSoftwareDependencies/Components.js/commit/637e140106691b95f0f546cf88eb39f3f80dc61d)
|
|
76
|
-
* [Handle sub-types when merging param ranges](https://github.com/LinkedSoftwareDependencies/Components.js/commit/43290525b2e244f5fbb6d5f344760b863329c31b)
|
|
77
|
-
* [Allow merging of generic component param types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/ee8de7d9b8d18bf6968a17078e493946e5fca8cd)
|
|
78
|
-
* [Allow param range merging with generic components](https://github.com/LinkedSoftwareDependencies/Components.js/commit/bcea7dcff288ce7068ee244c49c12134208c89da)
|
|
79
|
-
* [Fix generics crash when doing repeated param type checking](https://github.com/LinkedSoftwareDependencies/Components.js/commit/237572cb8a9c546b098582041ccd7a457b41aecd)
|
|
80
|
-
|
|
81
|
-
<a name="v5.0.0-beta.2"></a>
|
|
82
|
-
## [v5.0.0-beta.2](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.1...v5.0.0-beta.2) - 2021-12-09
|
|
83
|
-
|
|
84
|
-
### Added
|
|
85
|
-
* [Handle keyof parameter ranges](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0f55ba05bff5311d111ca97256aaa2e7be7ae83b)
|
|
86
|
-
|
|
87
|
-
<a name="v5.0.0-beta.1"></a>
|
|
88
|
-
## [v5.0.0-beta.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v5.0.0-beta.0...v5.0.0-beta.1) - 2021-12-07
|
|
89
|
-
|
|
90
|
-
### Added
|
|
91
|
-
* [Handle generics in nested components](https://github.com/LinkedSoftwareDependencies/Components.js/commit/d33d4c2668974087873943b3d5c66300fa3df65b)
|
|
92
|
-
* [Handle generics in parameter ranges](https://github.com/LinkedSoftwareDependencies/Components.js/commit/d3358b74ab25a3aca13d6dfc97b16cfd836d4ba9)
|
|
93
|
-
* [Add generic vocabulary changes to context](https://github.com/LinkedSoftwareDependencies/Components.js/commit/b8af018bb8f344833c07d1ef795a6b08d414c2ad)
|
|
94
|
-
|
|
95
|
-
<a name="v5.0.0-beta.0"></a>
|
|
96
|
-
## [v5.0.0-beta.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.5.0...v5.0.0-beta.0) - 2021-11-30
|
|
97
|
-
|
|
98
|
-
### BREAKING CHANGES
|
|
99
|
-
* [Remove required and unique param flags in favor of parameter ranges](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0df26318e4803b06660b3458fc75d565c4b60f67):
|
|
100
|
-
This allows more complex ranges to be defined, such as nested arrays, or arrays of union types.
|
|
101
|
-
**Because of this change, arrays now must always be explicitly defined within an RDF list (or @list in JSON-LD).**
|
|
102
|
-
If one param value is provided, it is considered a singular value.
|
|
103
|
-
If the param value contains an RDF list, it is considered an array.
|
|
104
|
-
If multiple param values are provided without RDF list, an error is thrown.
|
|
105
|
-
|
|
106
|
-
### Added
|
|
107
|
-
* Validate parameter values by type:
|
|
108
|
-
* [Validate param ranges with union and intersection types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/d08ecdb94051d3e88e7e1ea09f0f77518fb0debf)
|
|
109
|
-
* [Validate types of resource-based param values](https://github.com/LinkedSoftwareDependencies/Components.js/commit/2be90ccb416215261ef9c785e89302f3c4ef9264)
|
|
110
|
-
* [Validate param ranges with tuple types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/05d84c4c1d4bde6bcb5a99d53df4e66ca69536bf)
|
|
111
|
-
* [Validate param ranges with literal types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/7373b0fc06bdaf95a8099b9f58b741cd6f4f1b9d)
|
|
112
|
-
|
|
113
|
-
### Changed
|
|
114
|
-
* [Allow IRIs to be casted to string params](https://github.com/LinkedSoftwareDependencies/Components.js/commit/978985684dcba67629d44bfd0e5cf75293c5ea7a)
|
|
115
|
-
* [Allow components to be registered to multiple modules](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e575e64ebd26092a6bb005d837023e35877e9308)
|
|
116
|
-
* [Make relative IRIs make use of importPaths-based URLs if possible](https://github.com/LinkedSoftwareDependencies/Components.js/commit/6a2e18c3bf6a1b95f826b66ee0ef8b154f10c3cc)
|
|
117
|
-
|
|
118
|
-
### Fixed
|
|
119
|
-
* [Fix raw JSON values not being serializable to strings](https://github.com/LinkedSoftwareDependencies/Components.js/commit/96fe46eda1e153e87b29689196506ce6fbbdae58)
|
|
120
|
-
|
|
121
|
-
<a name="v4.5.0"></a>
|
|
122
|
-
## [v4.5.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.4.1...v4.5.0) - 2021-08-30
|
|
123
|
-
|
|
124
|
-
### Changed
|
|
125
|
-
* [Migrate to @rdfjs/types](https://github.com/LinkedSoftwareDependencies/Components.js/commit/b2f9f2e0c5512e743b324f48f332d96e4214ec84)
|
|
126
|
-
|
|
127
|
-
<a name="v4.4.1"></a>
|
|
128
|
-
## [v4.4.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.4.0...v4.4.1) - 2021-07-26
|
|
129
|
-
|
|
130
|
-
### Fixed
|
|
131
|
-
* [Fix RDF lists not being accepted for all params](https://github.com/LinkedSoftwareDependencies/Components.js/commit/a01e3c80a3a5ce28180f57e8358327c53774b9ba)
|
|
132
|
-
|
|
133
|
-
<a name="v4.4.0"></a>
|
|
134
|
-
## [v4.4.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.2.1...v4.4.0) - 2021-06-30
|
|
135
|
-
|
|
136
|
-
### Added
|
|
137
|
-
* [Accept RDF lists as argument values, #47](https://github.com/LinkedSoftwareDependencies/Components.js/commit/3501a0fe676d1bc43c2d3ad329fca0adef48c8cd)
|
|
138
|
-
|
|
139
|
-
### Changed
|
|
140
|
-
* [Allow arrays of resources to be passed to ErrorResourcesContext](https://github.com/LinkedSoftwareDependencies/Components.js/commit/aedd53a3e923e030bf0d8433c27f1259183a0a14)
|
|
141
|
-
|
|
142
|
-
<a name="v4.3.0"></a>
|
|
143
|
-
## [v4.3.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.2.1...v4.3.0) - 2021-06-14
|
|
144
|
-
|
|
145
|
-
### Added
|
|
146
|
-
* [Support JSON param ranges via rdf:JSON, Closes #37](https://github.com/LinkedSoftwareDependencies/Components.js/commit/339d2219915bc618991a42adcd8b63a3d6caa9b5)
|
|
147
|
-
|
|
148
|
-
<a name="v4.2.1"></a>
|
|
149
|
-
## [v4.2.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.2.0...v4.2.1) - 2021-05-26
|
|
150
|
-
|
|
151
|
-
### Fixed
|
|
152
|
-
* [Allow configs to have multiple identical types, comunica/examples#11](https://github.com/LinkedSoftwareDependencies/Components.js/commit/5285f8e68fefb13d46538c6949238200055a2047)
|
|
153
|
-
|
|
154
|
-
<a name="v4.2.0"></a>
|
|
155
|
-
## [v4.2.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.1.0...v4.2.0) - 2021-05-19
|
|
156
|
-
|
|
157
|
-
### Added
|
|
158
|
-
* [Expose RdfObjectLoader ctor from ComponentsManagerBuilder](https://github.com/LinkedSoftwareDependencies/Components.js/commit/1b1c85adb50855eed5b628788ccea3609aa841ca)
|
|
159
|
-
|
|
160
|
-
<a name="v4.1.0"></a>
|
|
161
|
-
## [v4.1.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.6...v4.1.0) - 2021-04-27
|
|
162
|
-
|
|
163
|
-
### Added
|
|
164
|
-
* [Allow JSON-LD context validation to be skipped](https://github.com/LinkedSoftwareDependencies/Components.js/commit/40931625dc0a577800c60e0cb4aa12393eb26bab)
|
|
165
|
-
|
|
166
|
-
<a name="v4.0.6"></a>
|
|
167
|
-
## [v4.0.6](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.5...v4.0.6) - 2021-01-27
|
|
168
|
-
|
|
169
|
-
### Fixed
|
|
170
|
-
* [Fix undefined root constructor args missing instead of being undefined](https://github.com/LinkedSoftwareDependencies/Components.js/commit/de14c611122ddb031d2973d4e667efa5b13bdf45)
|
|
171
|
-
|
|
172
|
-
<a name="v4.0.5"></a>
|
|
173
|
-
## [v4.0.5](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.4...v4.0.5) - 2021-01-18
|
|
174
|
-
|
|
175
|
-
### Fixed
|
|
176
|
-
* [Allow module discovery in packages without package.json](https://github.com/LinkedSoftwareDependencies/Components.js/commit/a0ac0cb47b2ed07ef7a88619133af15ba71f3577)
|
|
177
|
-
|
|
178
|
-
<a name="v4.0.4"></a>
|
|
179
|
-
## [v4.0.4](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.3...v4.0.4) - 2021-01-15
|
|
180
|
-
|
|
181
|
-
### Changed
|
|
182
|
-
* [Bump rdf-parse with updated components.js context URL](https://github.com/LinkedSoftwareDependencies/Components.js/commit/7525a027c683890f30f4e47402c89dcca7dd89d7)
|
|
183
|
-
|
|
184
|
-
<a name="v4.0.3"></a>
|
|
185
|
-
## [v4.0.3](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.2...v4.0.3) - 2021-01-15
|
|
186
|
-
|
|
187
|
-
### Fixed
|
|
188
|
-
* [Fix broken infinite recursion workaround, #31](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e9f2fdc78eca77f3070663c4dc360e93b1f4c0bb)
|
|
189
|
-
|
|
190
|
-
<a name="v4.0.2"></a>
|
|
191
|
-
## [v4.0.2](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.1...v4.0.2) - 2021-01-15
|
|
192
|
-
|
|
193
|
-
### Fixed
|
|
194
|
-
* [Fix instances being created multiple times, Closes #31](https://github.com/LinkedSoftwareDependencies/Components.js/commit/94ce08874b24bf9c64d7f722beb2d5556aa9c7e9)
|
|
195
|
-
* [Fix value inheritance happening multiple times](https://github.com/LinkedSoftwareDependencies/Components.js/commit/1855178930d2babd2c3a4c6cdad66087c1db79cd)
|
|
196
|
-
|
|
197
|
-
<a name="v4.0.1"></a>
|
|
198
|
-
## [v4.0.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v4.0.0...v4.0.1) - 2021-01-14
|
|
199
|
-
|
|
200
|
-
### Fixed
|
|
201
|
-
* [Fix module resolution failure when outside main module](https://github.com/LinkedSoftwareDependencies/Components.js/commit/2fb4de8abda5d5e91d39942edcc0bafd29acd8ce)
|
|
202
|
-
|
|
203
|
-
<a name="v4.0.0"></a>
|
|
204
|
-
## [v4.0.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.6.0...v4.0.0) - 2021-01-14
|
|
205
|
-
|
|
206
|
-
This release contains breaking changes in the programmatic API,
|
|
207
|
-
but module and configuration files remain backwards-compatible.
|
|
208
|
-
|
|
209
|
-
### Added
|
|
210
|
-
* Developer convenience
|
|
211
|
-
* [Allow `lsd:module` to be set to true in package.json](https://github.com/LinkedSoftwareDependencies/Components.js/commit/afeac8ab11e801376d265d3e42b5df7e113bfce4)
|
|
212
|
-
* [Emit warning when a remote context lookup is being done](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0f3968c26ff5c3d38e3cc8282c6039ff1221b4fd)
|
|
213
|
-
* [Emit warning on potentially invalid parameters in config](https://github.com/LinkedSoftwareDependencies/Components.js/commit/a3ebb95a8d0e18ad062269c47b65cc2d9d1b603a)
|
|
214
|
-
* [Emit warning on potentially invalid IRIs](https://github.com/LinkedSoftwareDependencies/Components.js/commit/18f9f974965d049fd3808ae3a725a36bf264183b)
|
|
215
|
-
* [Generate componentsjs-error-state.json on error](https://github.com/LinkedSoftwareDependencies/Components.js/commit/bd47b17ba3fe82b2486e86bc678d950a9c478d18)
|
|
216
|
-
* [Validate multiple key-value occurences in collectEntries](https://github.com/LinkedSoftwareDependencies/Components.js/commit/ab88b14aa5f2c0c18b34668d6ca1aed8d611de11)
|
|
217
|
-
* [Improve printing of Resources in error reporting](https://github.com/LinkedSoftwareDependencies/Components.js/commit/48d2df7196a1e80e1bb55ac5c6518394b0942d4d)
|
|
218
|
-
* [Rewrite injection of custom JSON-LD document loader](https://github.com/LinkedSoftwareDependencies/Components.js/commit/98ae62f9ddb6589a8651f3a4b9bac6b2bb6642b4)
|
|
219
|
-
* [Migrate RDF loading logic to rdf-object](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e5eb9d27e04a4a333487d5805ce5b0d17cd578a7)
|
|
220
|
-
|
|
221
|
-
### Changed
|
|
222
|
-
* [Use rdfs:seeAlso instead of owl:imports for importing](https://github.com/LinkedSoftwareDependencies/Components.js/commit/4e4227cca2c588e008259440e211af90e6756949)
|
|
223
|
-
* [Handle semver on multiple occurrences of module packages](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c8b2e3377d397179505064e43c4408e19447df6f)
|
|
224
|
-
* [Improve performance of module state loading through parallelization](https://github.com/LinkedSoftwareDependencies/Components.js/commit/4c475b0ee4d7fae31a818dc72fe28223827fd1f1)
|
|
225
|
-
* Refactoring
|
|
226
|
-
* [Accept loading from RDF/JS streams, Closes #1](https://github.com/LinkedSoftwareDependencies/Components.js/commit/749a7e7b5166414f68b5aabd285e5fd747b4dac4)
|
|
227
|
-
* [Add logger](https://github.com/LinkedSoftwareDependencies/Components.js/commit/a5497590d3dabf06c00831f53d95da1554305b10)
|
|
228
|
-
* [Split up Loader into ComponentsManager and loading classes](https://github.com/LinkedSoftwareDependencies/Components.js/commit/687b15c61ea8766b49dadf132fd38b0151f7f6ac)
|
|
229
|
-
* [Split parameter property handling into seperate handlers](https://github.com/LinkedSoftwareDependencies/Components.js/commit/e60a2a8bddc8a89b834cc21db51964bb2f8c3a93)
|
|
230
|
-
* [Create dedicated ParameterHandler component](https://github.com/LinkedSoftwareDependencies/Components.js/commit/408d299f77bc172e61a46d7dfbc4a6c931cecff6)
|
|
231
|
-
* [Reorganize relevant classes into construction package](https://github.com/LinkedSoftwareDependencies/Components.js/commit/aa6b56328fd4442886a82fcad187bd7380c05f27)
|
|
232
|
-
* [Split arguments creation into separate handlers](https://github.com/LinkedSoftwareDependencies/Components.js/commit/f3e995bd603369fb6e21d9be041ce96bec3b475b)
|
|
233
|
-
* [Split constructor args handling into separate handlers](https://github.com/LinkedSoftwareDependencies/Components.js/commit/33f678c5e5df96277243feca893d46882ebdd927)
|
|
234
|
-
* [Refactor component factories as config preprocessors](https://github.com/LinkedSoftwareDependencies/Components.js/commit/181b165f929cfcab206bc6d5ba22032f76d723c8)
|
|
235
|
-
* [Remove Util.PREFIXES in favour if Iris](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0c0c671b18bd8fe2161d56fd39ee8645adc12c63)
|
|
236
|
-
* [Decouple CommonJS instantiation and serialization into strategies](https://github.com/LinkedSoftwareDependencies/Components.js/commit/4756e0ce2f52711d7eb6df7afcc1011da210dbf0)
|
|
237
|
-
* [Decouple instantiation logic from Loader class](https://github.com/LinkedSoftwareDependencies/Components.js/commit/02dd0e64e37c9961be68beba09f03a3b52d0c00f)
|
|
238
|
-
* [Rewrite RdfStreamIncluder as Transform stream](https://github.com/LinkedSoftwareDependencies/Components.js/commit/edf6c61b28f06d2539bcdc8498f10586272a2632)
|
|
239
|
-
* [Delay module registration until finalization phase](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0de3b7940277fd207d7729da4921e62063434e20)
|
|
240
|
-
* [Refactor module loading into ModuleStateBuilder](https://github.com/LinkedSoftwareDependencies/Components.js/commit/6e6e54b498efb3e922466ef9868995926cd20ca8)
|
|
241
|
-
|
|
242
|
-
### Removed
|
|
243
|
-
* [Remove feature to use global modules](https://github.com/LinkedSoftwareDependencies/Components.js/commit/fc0f943ac7e1cda4f84b3a65e2ad05ad1c7c42dc)
|
|
244
|
-
|
|
245
|
-
### Fixed
|
|
246
|
-
* [Fix config compilation using wrong file path](https://github.com/LinkedSoftwareDependencies/Components.js/commit/fd3f806fe9cbb4f74a433e2a31212b5acdddf056)
|
|
247
|
-
* [Fix mapped components only keeping first element of root arrays](https://github.com/LinkedSoftwareDependencies/Components.js/commit/0d33a9d88d473f930ce60c80949d13f5679b0df0)
|
|
248
|
-
|
|
249
|
-
<a name="v3.6.1"></a>
|
|
250
|
-
## [v3.6.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.6.0...v3.6.1) - 2020-11-25
|
|
251
|
-
|
|
252
|
-
### Fixed
|
|
253
|
-
* [Fix Array checks.](https://github.com/LinkedSoftwareDependencies/Components.js/commit/fdd48f6910ce395c72607992056f724953729f32)
|
|
254
|
-
* [Fix function check.](https://github.com/LinkedSoftwareDependencies/Components.js/commit/b685468cfc9de39c74207a1f79cc9efae2bffa4e)
|
|
255
|
-
|
|
256
|
-
<a name="v3.6.0"></a>
|
|
257
|
-
## [v3.6.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.5.0...v3.6.0) - 2020-09-14
|
|
258
|
-
|
|
259
|
-
### Added
|
|
260
|
-
* [Supporting variables in config compilation](https://github.com/LinkedSoftwareDependencies/Components.js/commit/5eb5def9d77b7755d9e121b07c9d23676684a5f1)
|
|
261
|
-
|
|
262
|
-
<a name="v3.5.0"></a>
|
|
263
|
-
## [v3.5.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.4.2...v3.5.0) - 2020-09-11
|
|
264
|
-
|
|
265
|
-
### Added
|
|
266
|
-
* [Accept variables as parameter values, that can be set at init](https://github.com/LinkedSoftwareDependencies/Components.js/commit/cbd6f115cabf2bfcdcc8466f434d5cf52a4c23d5)
|
|
267
|
-
|
|
268
|
-
<a name="v3.4.2"></a>
|
|
269
|
-
## [v3.4.2](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.4.1...v3.4.2) - 2020-08-27
|
|
270
|
-
|
|
271
|
-
### Fixed
|
|
272
|
-
* [Fix empty list class loading failure](https://github.com/LinkedSoftwareDependencies/Components.js/commit/3590171287d2d765417469ea85012b651c88064b)
|
|
273
|
-
|
|
274
|
-
<a name="v3.4.1"></a>
|
|
275
|
-
## [v3.4.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.4.0...v3.4.1) - 2020-07-01
|
|
276
|
-
|
|
277
|
-
### Changed
|
|
278
|
-
* [Make types proper dependencies](https://github.com/LinkedSoftwareDependencies/Components.js/commit/d50005517d606798de130a6cb2a4a4456683574c)
|
|
279
|
-
|
|
280
|
-
<a name="v3.4.0"></a>
|
|
281
|
-
## [v3.4.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.3.0...v3.4.0) - 2020-04-06
|
|
282
|
-
|
|
283
|
-
### Added
|
|
284
|
-
* [Add requireNoConstructor option for raw requireElements](https://github.com/LinkedSoftwareDependencies/Components.js/commit/2d3144b8baad1464d590b691da10b752f7b83342)
|
|
285
|
-
|
|
286
|
-
### Fixed
|
|
287
|
-
* [Fix incorrect error message for invalid dynamic entries](https://github.com/LinkedSoftwareDependencies/Components.js/commit/91b3a543973c06e3a0f3b6f667cc04a49e499103)
|
|
288
|
-
|
|
289
|
-
<a name="v3.3.0"></a>
|
|
290
|
-
## [v3.3.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.2.1...v3.3.0) - 2019-10-21
|
|
291
|
-
|
|
292
|
-
### Added
|
|
293
|
-
* [Allow requireName to be a relative path inside the module](https://github.com/LinkedSoftwareDependencies/Components.js/commit/562470dfbe6d3b1ab50e1202d8319adfafda024c)
|
|
294
|
-
|
|
295
|
-
### Changed
|
|
296
|
-
* [Return error code on failure to compile](https://github.com/LinkedSoftwareDependencies/Components.js/commit/06aa3420911a41963a97586cabbf34ae477084b1)
|
|
297
|
-
|
|
298
|
-
<a name="v3.2.1"></a>
|
|
299
|
-
## [v3.2.1](https://github.com/LinkedSoftwareDependencies/Components.js/compare/v3.2.0...v3.2.1) - 2019-02-21
|
|
300
|
-
|
|
301
|
-
### Fixed
|
|
302
|
-
* [Fix issues where context and component files would conflict](https://github.com/LinkedSoftwareDependencies/Components.js/commit/9e4812b23f6bc70099672172d480fc4855775622)
|
|
303
|
-
* [Fix incorrect comment context entry](https://github.com/LinkedSoftwareDependencies/Components.js/commit/21873b34a0dfc366f02ee1ad7dbd580795254ba5)
|
|
304
|
-
|
|
305
|
-
<a name="v3.2.0"></a>
|
|
306
|
-
## [v3.2.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/2.0.0...v3.2.0) - 2018-11-13
|
|
307
|
-
|
|
308
|
-
### Changed
|
|
309
|
-
* [Prioritize main modules when instantiating](https://github.com/LinkedSoftwareDependencies/Components.js/commit/c97f104d101f8dac96b501def69698615f58385b)
|
|
310
|
-
|
|
311
|
-
<a name="v3.1.0"></a>
|
|
312
|
-
## [v3.1.0](https://github.com/LinkedSoftwareDependencies/Components.js/compare/2.0.0...v3.1.0) - 2018-11-13
|
|
313
|
-
|
|
314
|
-
_Start tracking of changelog_
|